Material
Virtual base class for applying visual properties to an object, such as color and roughness.
Virtual 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.
Importantly, you can inherit from Material to create your own custom material type in script or in ReckfellExtension.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
MaterialConstructor
public Material();Properties2
NextPassProperty
public Material NextPass { get; set; }Sets the Material to be used for the next pass. This renders the object again using a different material.
Note: Material.NextPass materials are not necessarily drawn immediately after the source Material. Draw order is determined by material properties, Material.RenderPriority, and distance to camera.
Note: This only applies to StandardMaterial3Ds and ShaderMaterials with type "Spatial".
RenderPriorityProperty
public int RenderPriority { get; set; }Material sorting priority within a pass that supports it. The example’s camera-attached quad uses 127 for late drawing of its screen/depth-reading material. Priority does not change the screen/depth capture stage, recapture it between every material or turn it into a final frame containing all UI.
Methods10
CreatePlaceholderResource
public Resource CreatePlaceholder();Creates a placeholder version of this resource (PlaceholderMaterial).
ResourceGetNextPassMaterial
public Material GetNextPass();MaterialGetRenderPriorityint
public int GetRenderPriority();intInspectNativeShaderCodevoid
public void InspectNativeShaderCode();Only available when running in the editor. Opens a popup that visualizes the generated shader code, including all variants and internal shader code. See also Shader.InspectNativeShaderCode.
SetNextPassvoid
public void SetNextPass(Material nextPass);| Name | Type | Default |
|---|---|---|
nextPass | Material | — |
SetRenderPriorityvoid
public void SetRenderPriority(int priority);| Name | Type | Default |
|---|---|---|
priority | int | — |
_CanDoNextPassbool
public virtual bool _CanDoNextPass();Only exposed for the purpose of overriding. You cannot call this function directly. Used internally to determine if Material.NextPass should be shown in the editor or not.
bool_CanUseRenderPrioritybool
public virtual bool _CanUseRenderPriority();Only exposed for the purpose of overriding. You cannot call this function directly. Used internally to determine if Material.RenderPriority should be shown in the editor or not.
bool_GetShaderModeShader.Mode
public virtual Shader.Mode _GetShaderMode();Only exposed for the purpose of overriding. You cannot call this function directly. Used internally by various editor tools.
Shader.Mode_GetShaderRidRid
public virtual Rid _GetShaderRid();Only exposed for the purpose of overriding. You cannot call this function directly. Used internally by various editor tools. Used to access the RID of the Material's Shader.
RidFields and constants2
RenderPriorityMaxField
public const long RenderPriorityMax = 127;Maximum value for the Material.RenderPriority parameter.
RenderPriorityMinField
public const long RenderPriorityMin = -128;Minimum value for the Material.RenderPriority parameter.