Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

Material

Inherits: Resource < RefCounted < Object

Inherited By: BaseMaterial3D, CanvasItemMaterial, FogMaterial, PanoramaSkyMaterial, ParticleProcessMaterial, PhysicalSkyMaterial, PlaceholderMaterial, ProceduralSkyMaterial, ShaderMaterial

Abstract base class for applying visual properties to an object, such as color and roughness.

描述

Material is a base resource used for coloring and shading geometry. All materials inherit from it and almost all VisualInstance3D derived nodes carry a Material. A few flags and parameters are shared between all material types and are configured here.

教程

属性

Material

next_pass

int

render_priority

Methods

bool

_can_do_next_pass ( ) virtual const

bool

_can_use_render_priority ( ) virtual const

Mode

_get_shader_mode ( ) virtual const

RID

_get_shader_rid ( ) virtual const

Resource

create_placeholder ( ) const

void

inspect_native_shader_code ( )


常量

RENDER_PRIORITY_MAX = 127

Maximum value for the render_priority parameter.

RENDER_PRIORITY_MIN = -128

Minimum value for the render_priority parameter.


Property Descriptions

Material next_pass

Sets the Material to be used for the next pass. This renders the object again using a different material.

Note: This only applies to StandardMaterial3Ds and ShaderMaterials with type "Spatial".


int render_priority

  • void set_render_priority ( int value )

  • int get_render_priority ( )

Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects.

Note: This only applies to StandardMaterial3Ds and ShaderMaterials with type "Spatial".

Note: This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).


Method Descriptions

bool _can_do_next_pass ( ) virtual const

There is currently no description for this method. Please help us by contributing one!


bool _can_use_render_priority ( ) virtual const

There is currently no description for this method. Please help us by contributing one!


Mode _get_shader_mode ( ) virtual const

There is currently no description for this method. Please help us by contributing one!


RID _get_shader_rid ( ) virtual const

There is currently no description for this method. Please help us by contributing one!


Resource create_placeholder ( ) const

Creates a placeholder version of this resource (PlaceholderMaterial).


void inspect_native_shader_code ( )

There is currently no description for this method. Please help us by contributing one!