Material
Material defines the visual appearance of a surface.
Materials are created from a binary blob generated by the material compiler (matc). A Material is a template from which MaterialInstance objects can be created.
Creating instances: Use createInstance() to spawn an instance from this material. Instances inherit the material's properties but can override parameters (color, texture, etc.) for per-object customization. Always destroy instances with Engine.destroy() before destroying the material.
Material compilation: Use compile() to asynchronously compile specific material variants. This is useful for precompiling variants you know will be used, reducing first-time rendering stalls. After issuing multiple compile() calls, call Engine.flush() so the backend can start compilation work.
Material properties: Material properties are read-only and determined at compile time from the matc-generated blob. These include shading model, blending mode, transparency mode, and other rendering settings. To override parameters per-instance, use MaterialInstance.
Types
Blending mode determines how a material's color is combined with the background.
Priority queue for asynchronous material compilation.
Culling mode determines which faces are rendered.
Attribute interpolation type in the fragment shader.
Holds information about a material parameter.
Uniform parameter types.
Precision of a numeric parameter.
Texture type of a sampler parameter.
Shading model determines how light interacts with the material surface.
Type of a subpass input parameter.
How transparent objects are rendered.
UBO batching mode controls whether material instances share uniform buffers.
Vertex domain specifies which coordinate space vertices are defined in.
Properties
The blending mode.
The face culling mode.
Get this material's default instance.
The minimum required feature level for this material.
Whether this material uses the shadowing factor as a color multiplier (unlit materials only).
Whether this material has specular anti-aliasing enabled.
The vertex attribute interpolation mode.
Whether alpha-to-coverage is enabled.
Whether color writes are enabled.
Whether depth testing is enabled.
Whether depth writes are enabled.
Whether this material renders both front and back faces (double-sided).
The alpha threshold for MASKED blending mode, in 0, 1.
The domain the material's shaders apply to.
The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.
The number of parameters declared by this material.
Information about all parameters declared by this material.
The reflection mode.
The refraction mode.
The refraction surface type.
The vertex attributes required by this material.
The shading model.
The clamping threshold of specular anti-aliasing, in 0, 1.
The screen-space variance of the specular anti-aliasing filter kernel, in 0, 1.
The variants this material supports: a mask of UserVariantFilterBit values.
The transparency rendering mode (only relevant for TRANSPARENT/FADE blending).
The vertex coordinate space domain.
Functions
Creates a new instance of this material. Material instances should be freed using Engine.destroy(MaterialInstance).
Get the transform parameter name associated with a sampler.
Indicates whether a parameter of the given name exists on this material.
Sets a parameter on this material's default instance. @see MaterialInstance.setParameter