MaterialInstance
MaterialInstance customizes the parameters of a Material for per-object rendering.
Each Material can spawn multiple MaterialInstances with different parameter values (colors, textures, numeric uniforms, etc.). Changes to a MaterialInstance only affect renderables using that specific instance, not the Material or other instances.
Creating and destroying: Create instances via Material.createInstance() and destroy with Engine.destroy(instance). You can duplicate an existing instance using the companion object's duplicate() method.
Setting parameters: Use setParameter() overloads to set uniforms (booleans, floats, vectors, matrices, textures). Parameter names and types must match those defined in the material. Array parameters are also supported via setParameter(name, type, array, offset, count) variants.
Rendering state customization: Each MaterialInstance can override per-instance rendering behavior:
Scissor rectangle for pixel-perfect clipping
Polygon offset for depth artifacts
Culling mode (override material's cull setting)
Depth test configuration
Stencil test and operations
Color and depth write masks
These settings override the Material's defaults.
See also
MaterialInstance customizes the parameters of a Material for per-object rendering.
Each Material can spawn multiple MaterialInstances with different parameter values (colors, textures, numeric uniforms, etc.). Changes to a MaterialInstance only affect renderables using that specific instance, not the Material or other instances.
Creating and destroying: Create instances via Material.createInstance() and destroy with Engine.destroy(instance). You can duplicate an existing instance using the companion object's duplicate() method.
Setting parameters: Use setParameter() overloads to set uniforms (booleans, floats, vectors, matrices, textures). Parameter names and types must match those defined in the material. Array parameters are also supported via setParameter(name, type, array, offset, count) variants.
Rendering state customization: Each MaterialInstance can override per-instance rendering behavior:
Scissor rectangle for pixel-perfect clipping
Polygon offset for depth artifacts
Culling mode (override material's cull setting)
Depth test configuration
Stencil test and operations
Color and depth write masks
These settings override the Material's defaults.
See also
MaterialInstance customizes the parameters of a Material for per-object rendering.
Each Material can spawn multiple MaterialInstances with different parameter values (colors, textures, numeric uniforms, etc.). Changes to a MaterialInstance only affect renderables using that specific instance, not the Material or other instances.
Creating and destroying: Create instances via Material.createInstance() and destroy with Engine.destroy(instance). You can duplicate an existing instance using the companion object's duplicate() method.
Setting parameters: Use setParameter() overloads to set uniforms (booleans, floats, vectors, matrices, textures). Parameter names and types must match those defined in the material. Array parameters are also supported via setParameter(name, type, array, offset, count) variants.
Rendering state customization: Each MaterialInstance can override per-instance rendering behavior:
Scissor rectangle for pixel-perfect clipping
Polygon offset for depth artifacts
Culling mode (override material's cull setting)
Depth test configuration
Stencil test and operations
Color and depth write masks
These settings override the Material's defaults.
See also
MaterialInstance customizes the parameters of a Material for per-object rendering.
Each Material can spawn multiple MaterialInstances with different parameter values (colors, textures, numeric uniforms, etc.). Changes to a MaterialInstance only affect renderables using that specific instance, not the Material or other instances.
Creating and destroying: Create instances via Material.createInstance() and destroy with Engine.destroy(instance). You can duplicate an existing instance using the companion object's duplicate() method.
Setting parameters: Use setParameter() overloads to set uniforms (booleans, floats, vectors, matrices, textures). Parameter names and types must match those defined in the material. Array parameters are also supported via setParameter(name, type, array, offset, count) variants.
Rendering state customization: Each MaterialInstance can override per-instance rendering behavior:
Scissor rectangle for pixel-perfect clipping
Polygon offset for depth artifacts
Culling mode (override material's cull setting)
Depth test configuration
Stencil test and operations
Color and depth write masks
These settings override the Material's defaults.
See also
MaterialInstance customizes the parameters of a Material for per-object rendering.
Each Material can spawn multiple MaterialInstances with different parameter values (colors, textures, numeric uniforms, etc.). Changes to a MaterialInstance only affect renderables using that specific instance, not the Material or other instances.
Creating and destroying: Create instances via Material.createInstance() and destroy with Engine.destroy(instance). You can duplicate an existing instance using the companion object's duplicate() method.
Setting parameters: Use setParameter() overloads to set uniforms (booleans, floats, vectors, matrices, textures). Parameter names and types must match those defined in the material. Array parameters are also supported via setParameter(name, type, array, offset, count) variants.
Rendering state customization: Each MaterialInstance can override per-instance rendering behavior:
Scissor rectangle for pixel-perfect clipping
Polygon offset for depth artifacts
Culling mode (override material's cull setting)
Depth test configuration
Stencil test and operations
Color and depth write masks
These settings override the Material's defaults.
See also
Types
Element types for boolean parameter arrays.
Element types for boolean parameter arrays.
Element types for boolean parameter arrays.
Element types for boolean parameter arrays.
Element types for boolean parameter arrays.
Element types for floating-point parameter arrays.
Element types for floating-point parameter arrays.
Element types for floating-point parameter arrays.
Element types for floating-point parameter arrays.
Element types for floating-point parameter arrays.
Element types for integer parameter arrays.
Element types for integer parameter arrays.
Element types for integer parameter arrays.
Element types for integer parameter arrays.
Element types for integer parameter arrays.
Which face(s) the stencil operation applies to.
Which face(s) the stencil operation applies to.
Which face(s) the stencil operation applies to.
Which face(s) the stencil operation applies to.
Which face(s) the stencil operation applies to.
Stencil test operation determines how the stencil buffer is modified.
Stencil test operation determines how the stencil buffer is modified.
Stencil test operation determines how the stencil buffer is modified.
Stencil test operation determines how the stencil buffer is modified.
Stencil test operation determines how the stencil buffer is modified.
Properties
Gets/sets the face culling mode.
Gets/sets the face culling mode.
Gets/sets the face culling mode.
Gets/sets the face culling mode.
Gets/sets the face culling mode.
Gets/sets the depth function.
Gets/sets the depth function.
Gets/sets the depth function.
Gets/sets the depth function.
Gets/sets the depth function.
Gets/sets whether color write is enabled.
Gets/sets whether color write is enabled.
Gets/sets whether color write is enabled.
Gets/sets whether color write is enabled.
Gets/sets whether color write is enabled.
Gets/sets whether depth culling (depth testing) is enabled.
Gets/sets whether depth culling (depth testing) is enabled.
Gets/sets whether depth culling (depth testing) is enabled.
Gets/sets whether depth culling (depth testing) is enabled.
Gets/sets whether depth culling (depth testing) is enabled.
Gets/sets whether depth write is enabled.
Gets/sets whether depth write is enabled.
Gets/sets whether depth write is enabled.
Gets/sets whether depth write is enabled.
Gets/sets whether depth write is enabled.
Gets/sets whether double-sided lighting is enabled.
Gets/sets whether double-sided lighting is enabled.
Gets/sets whether double-sided lighting is enabled.
Gets/sets whether double-sided lighting is enabled.
Gets/sets whether double-sided lighting is enabled.
Gets/sets whether stencil write is enabled.
Gets/sets whether stencil write is enabled.
Gets/sets whether stencil write is enabled.
Gets/sets whether stencil write is enabled.
Gets/sets whether stencil write is enabled.
Gets/sets the alpha mask threshold for masked blending mode.
Gets/sets the alpha mask threshold for masked blending mode.
Gets/sets the alpha mask threshold for masked blending mode.
Gets/sets the alpha mask threshold for masked blending mode.
Gets/sets the alpha mask threshold for masked blending mode.
Returns the face culling mode for the shadow passes.
Returns the face culling mode for the shadow passes.
Returns the face culling mode for the shadow passes.
Returns the face culling mode for the shadow passes.
Returns the face culling mode for the shadow passes.
Gets/sets the clamping threshold used to suppress estimation errors when applying specular anti-aliasing.
Gets/sets the clamping threshold used to suppress estimation errors when applying specular anti-aliasing.
Gets/sets the clamping threshold used to suppress estimation errors when applying specular anti-aliasing.
Gets/sets the clamping threshold used to suppress estimation errors when applying specular anti-aliasing.
Gets/sets the clamping threshold used to suppress estimation errors when applying specular anti-aliasing.
Gets/sets the screen space variance of the filter kernel used when applying specular anti-aliasing.
Gets/sets the screen space variance of the filter kernel used when applying specular anti-aliasing.
Gets/sets the screen space variance of the filter kernel used when applying specular anti-aliasing.
Gets/sets the screen space variance of the filter kernel used when applying specular anti-aliasing.
Gets/sets the screen space variance of the filter kernel used when applying specular anti-aliasing.
Gets/sets the transparency rendering mode.
Gets/sets the transparency rendering mode.
Gets/sets the transparency rendering mode.
Gets/sets the transparency rendering mode.
Gets/sets the transparency rendering mode.
Functions
Sets different culling modes for color and shadow passes.
Sets different culling modes for color and shadow passes.
Sets different culling modes for color and shadow passes.
Sets different culling modes for color and shadow passes.
Sets different culling modes for color and shadow passes.
Sets a boolean parameter.
Sets a float parameter.
Sets an integer parameter.
Sets a texture parameter with sampler configuration.
Sets a 2-component boolean vector parameter.
Sets a 2-component float vector parameter.
Sets a 2-component integer vector parameter.
Sets a 3-component boolean vector parameter.
Sets a 3-component float vector parameter.
Sets a 3-component integer vector parameter.
Sets an RGB color parameter.
Sets a parameter from a boolean array.
Sets a parameter from a float array.
Sets a parameter from an integer array.
Sets a 4-component boolean vector parameter.
Sets a 4-component float vector parameter.
Sets a 4-component integer vector parameter.
Sets an RGBA color parameter.
Sets a boolean parameter.
Sets a float parameter.
Sets an integer parameter.
Sets a texture parameter with sampler configuration.
Sets a 2-component boolean vector parameter.
Sets a 2-component float vector parameter.
Sets a 2-component integer vector parameter.
Sets a 3-component boolean vector parameter.
Sets a 3-component float vector parameter.
Sets a 3-component integer vector parameter.
Sets an RGB color parameter.
Sets a parameter from a boolean array.
Sets a parameter from a float array.
Sets a parameter from an integer array.
Sets a 4-component boolean vector parameter.
Sets a 4-component float vector parameter.
Sets a 4-component integer vector parameter.
Sets an RGBA color parameter.
Sets a boolean parameter.
Sets a float parameter.
Sets an integer parameter.
Sets a texture parameter with sampler configuration.
Sets a 2-component boolean vector parameter.
Sets a 2-component float vector parameter.
Sets a 2-component integer vector parameter.
Sets a 3-component boolean vector parameter.
Sets a 3-component float vector parameter.
Sets a 3-component integer vector parameter.
Sets an RGB color parameter.
Sets a parameter from a boolean array.
Sets a parameter from a float array.
Sets a parameter from an integer array.
Sets a 4-component boolean vector parameter.
Sets a 4-component float vector parameter.
Sets a 4-component integer vector parameter.
Sets an RGBA color parameter.
Sets a boolean parameter.
Sets a float parameter.
Sets an integer parameter.
Sets a texture parameter with sampler configuration.
Sets a 2-component boolean vector parameter.
Sets a 2-component float vector parameter.
Sets a 2-component integer vector parameter.
Sets a 3-component boolean vector parameter.
Sets a 3-component float vector parameter.
Sets a 3-component integer vector parameter.
Sets an RGB color parameter.
Sets a parameter from a boolean array.
Sets a parameter from a float array.
Sets a parameter from an integer array.
Sets a 4-component boolean vector parameter.
Sets a 4-component float vector parameter.
Sets a 4-component integer vector parameter.
Sets an RGBA color parameter.
Sets a boolean parameter.
Sets a float parameter.
Sets an integer parameter.
Sets a texture parameter with sampler configuration.
Sets a 2-component boolean vector parameter.
Sets a 2-component float vector parameter.
Sets a 2-component integer vector parameter.
Sets a 3-component boolean vector parameter.
Sets a 3-component float vector parameter.
Sets a 3-component integer vector parameter.
Sets an RGB color parameter.
Sets a parameter from a boolean array.
Sets a parameter from a float array.
Sets a parameter from an integer array.
Sets a 4-component boolean vector parameter.
Sets a 4-component float vector parameter.
Sets a 4-component integer vector parameter.
Sets an RGBA color parameter.
Sets a polygon offset that will be applied to all renderables drawn with this material instance.
Sets a polygon offset that will be applied to all renderables drawn with this material instance.
Sets a polygon offset that will be applied to all renderables drawn with this material instance.
Sets a polygon offset that will be applied to all renderables drawn with this material instance.
Sets a polygon offset that will be applied to all renderables drawn with this material instance.
Set-up a custom scissor rectangle; by default it is disabled.
Set-up a custom scissor rectangle; by default it is disabled.
Set-up a custom scissor rectangle; by default it is disabled.
Set-up a custom scissor rectangle; by default it is disabled.
Set-up a custom scissor rectangle; by default it is disabled.
Sets the stencil comparison function for both front and back faces (default is ALWAYS).
Sets the stencil comparison function (default is ALWAYS).
Sets the stencil comparison function for both front and back faces (default is ALWAYS).
Sets the stencil comparison function (default is ALWAYS).
Sets the stencil comparison function for both front and back faces (default is ALWAYS).
Sets the stencil comparison function (default is ALWAYS).
Sets the stencil comparison function for both front and back faces (default is ALWAYS).
Sets the stencil comparison function (default is ALWAYS).
Sets the stencil comparison function for both front and back faces (default is ALWAYS).
Sets the stencil comparison function (default is ALWAYS).
Sets the depth fail operation for both front and back faces (default is KEEP).
Sets the depth fail operation (default is KEEP).
Sets the depth fail operation for both front and back faces (default is KEEP).
Sets the depth fail operation (default is KEEP).
Sets the depth fail operation for both front and back faces (default is KEEP).
Sets the depth fail operation (default is KEEP).
Sets the depth fail operation for both front and back faces (default is KEEP).
Sets the depth fail operation (default is KEEP).
Sets the depth fail operation for both front and back faces (default is KEEP).
Sets the depth fail operation (default is KEEP).
Sets the depth-stencil pass operation for both front and back faces (default is KEEP).
Sets the depth-stencil pass operation (default is KEEP).
Sets the depth-stencil pass operation for both front and back faces (default is KEEP).
Sets the depth-stencil pass operation (default is KEEP).
Sets the depth-stencil pass operation for both front and back faces (default is KEEP).
Sets the depth-stencil pass operation (default is KEEP).
Sets the depth-stencil pass operation for both front and back faces (default is KEEP).
Sets the depth-stencil pass operation (default is KEEP).
Sets the depth-stencil pass operation for both front and back faces (default is KEEP).
Sets the depth-stencil pass operation (default is KEEP).
Sets the stencil fail operation for both front and back faces (default is KEEP).
Sets the stencil fail operation (default is KEEP).
Sets the stencil fail operation for both front and back faces (default is KEEP).
Sets the stencil fail operation (default is KEEP).
Sets the stencil fail operation for both front and back faces (default is KEEP).
Sets the stencil fail operation (default is KEEP).
Sets the stencil fail operation for both front and back faces (default is KEEP).
Sets the stencil fail operation (default is KEEP).
Sets the stencil fail operation for both front and back faces (default is KEEP).
Sets the stencil fail operation (default is KEEP).
Sets the stencil read mask for both front and back faces (default is 0xFF / 255 / all bits).
Sets the stencil read mask (default is 0xFF / 255 / all bits).
Sets the stencil read mask for both front and back faces (default is 0xFF / 255 / all bits).
Sets the stencil read mask (default is 0xFF / 255 / all bits).
Sets the stencil read mask for both front and back faces (default is 0xFF / 255 / all bits).
Sets the stencil read mask (default is 0xFF / 255 / all bits).
Sets the stencil read mask for both front and back faces (default is 0xFF / 255 / all bits).
Sets the stencil read mask (default is 0xFF / 255 / all bits).
Sets the stencil read mask for both front and back faces (default is 0xFF / 255 / all bits).
Sets the stencil read mask (default is 0xFF / 255 / all bits).
Sets the stencil reference value for both front and back faces (default is 0).
Sets the stencil reference value (default is 0).
Sets the stencil reference value for both front and back faces (default is 0).
Sets the stencil reference value (default is 0).
Sets the stencil reference value for both front and back faces (default is 0).
Sets the stencil reference value (default is 0).
Sets the stencil reference value for both front and back faces (default is 0).
Sets the stencil reference value (default is 0).
Sets the stencil reference value for both front and back faces (default is 0).
Sets the stencil reference value (default is 0).
Sets the stencil write mask for both front and back faces (default is 0xFF / 255 / all bits).
Sets the stencil write mask (default is 0xFF / 255 / all bits).
Sets the stencil write mask for both front and back faces (default is 0xFF / 255 / all bits).
Sets the stencil write mask (default is 0xFF / 255 / all bits).
Sets the stencil write mask for both front and back faces (default is 0xFF / 255 / all bits).
Sets the stencil write mask (default is 0xFF / 255 / all bits).
Sets the stencil write mask for both front and back faces (default is 0xFF / 255 / all bits).
Sets the stencil write mask (default is 0xFF / 255 / all bits).
Sets the stencil write mask for both front and back faces (default is 0xFF / 255 / all bits).
Sets the stencil write mask (default is 0xFF / 255 / all bits).
Disables the scissor box test; rendering is not restricted to any region.
Disables the scissor box test; rendering is not restricted to any region.
Disables the scissor box test; rendering is not restricted to any region.
Disables the scissor box test; rendering is not restricted to any region.
Disables the scissor box test; rendering is not restricted to any region.