Material

actual class 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.

expect class 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.

actual class 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.

actual class 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.

actual class 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.

Constructors

Link copied to clipboard
constructor(nativeMaterial: Material)
constructor(jsMaterial: Material)
constructor(nativeHandle: MemorySegment?)
constructor(nativeHandle: CPointer<FilaMaterial>?)

Types

Link copied to clipboard

Blending mode determines how a material's color is combined with the background.

Blending mode determines how a material's color is combined with the background.

Blending mode determines how a material's color is combined with the background.

Blending mode determines how a material's color is combined with the background.

Blending mode determines how a material's color is combined with the background.

Link copied to clipboard
actual class Builder

Builder for creating Material objects from compiled material packages.

expect class Builder

Builder for creating Material objects from compiled material packages.

actual class Builder

Builder for creating Material objects from compiled material packages.

actual class Builder

Builder for creating Material objects from compiled material packages.

actual class Builder

Builder for creating Material objects from compiled material packages.

Link copied to clipboard

Priority queue for asynchronous material compilation.

Priority queue for asynchronous material compilation.

Priority queue for asynchronous material compilation.

Priority queue for asynchronous material compilation.

Priority queue for asynchronous material compilation.

Link copied to clipboard

Culling mode determines which faces are rendered.

Culling mode determines which faces are rendered.

Culling mode determines which faces are rendered.

Culling mode determines which faces are rendered.

Culling mode determines which faces are rendered.

Link copied to clipboard

Attribute interpolation type in the fragment shader.

Attribute interpolation type in the fragment shader.

Attribute interpolation type in the fragment shader.

Attribute interpolation type in the fragment shader.

Attribute interpolation type in the fragment shader.

Link copied to clipboard
actual class Parameter(val name: String, val type: Material.Parameter.Type, val precision: Material.Parameter.Precision, val count: Int)

Holds metadata about a material parameter.

expect class Parameter(name: String, type: Material.Parameter.Type, precision: Material.Parameter.Precision, count: Int)

Holds metadata about a material parameter.

actual class Parameter(val name: String, val type: Material.Parameter.Type, val precision: Material.Parameter.Precision, val count: Int)

Holds metadata about a material parameter.

actual class Parameter(val name: String, val type: Material.Parameter.Type, val precision: Material.Parameter.Precision, val count: Int)

Holds metadata about a material parameter.

actual class Parameter(val name: String, val type: Material.Parameter.Type, val precision: Material.Parameter.Precision, val count: Int)

Holds metadata about a material parameter.

Link copied to clipboard

Reflection rendering mode.

Reflection rendering mode.

Reflection rendering mode.

Reflection rendering mode.

Reflection rendering mode.

Link copied to clipboard

Refraction rendering mode.

Refraction rendering mode.

Refraction rendering mode.

Refraction rendering mode.

Refraction rendering mode.

Link copied to clipboard

Type of refracted surface.

Type of refracted surface.

Type of refracted surface.

Type of refracted surface.

Type of refracted surface.

Link copied to clipboard
actual enum Shading : Enum<Material.Shading>

Shading model determines how light interacts with the material surface.

expect enum Shading : Enum<Material.Shading>

Shading model determines how light interacts with the material surface.

actual enum Shading : Enum<Material.Shading>

Shading model determines how light interacts with the material surface.

actual enum Shading : Enum<Material.Shading>

Shading model determines how light interacts with the material surface.

actual enum Shading : Enum<Material.Shading>

Shading model determines how light interacts with the material surface.

Link copied to clipboard

How transparent objects are rendered.

How transparent objects are rendered.

How transparent objects are rendered.

How transparent objects are rendered.

How transparent objects are rendered.

Link copied to clipboard

UBO batching mode controls whether material instances share uniform buffers.

UBO batching mode controls whether material instances share uniform buffers.

UBO batching mode controls whether material instances share uniform buffers.

UBO batching mode controls whether material instances share uniform buffers.

UBO batching mode controls whether material instances share uniform buffers.

Link copied to clipboard

User variant filter bits for material compilation.

User variant filter bits for material compilation.

User variant filter bits for material compilation.

User variant filter bits for material compilation.

User variant filter bits for material compilation.

Link copied to clipboard

Vertex domain specifies which coordinate space vertices are defined in.

Vertex domain specifies which coordinate space vertices are defined in.

Vertex domain specifies which coordinate space vertices are defined in.

Vertex domain specifies which coordinate space vertices are defined in.

Vertex domain specifies which coordinate space vertices are defined in.

Functions

Link copied to clipboard
actual fun compile(priority: Material.CompilerPriorityQueue, variants: Int, callback: () -> Unit?)

Asynchronously compile a subset of this Material's variants.

expect fun compile(priority: Material.CompilerPriorityQueue, variants: Int, callback: () -> Unit? = null)

Asynchronously compile a subset of this Material's variants.

actual fun compile(priority: Material.CompilerPriorityQueue, variants: Int, callback: () -> Unit?)

Asynchronously compile a subset of this Material's variants.

actual fun compile(priority: Material.CompilerPriorityQueue, variants: Int, callback: () -> Unit?)

Asynchronously compile a subset of this Material's variants.

actual fun compile(priority: Material.CompilerPriorityQueue, variants: Int, callback: () -> Unit?)

Asynchronously compile a subset of this Material's variants.

Link copied to clipboard

Create a new MaterialInstance from this material.

Create a new MaterialInstance with an optional debug name.

Create a new MaterialInstance from this material.

Create a new MaterialInstance with an optional debug name.

Create a new MaterialInstance from this material.

Create a new MaterialInstance with an optional debug name.

Create a new MaterialInstance from this material.

Create a new MaterialInstance with an optional debug name.

Create a new MaterialInstance from this material.

Create a new MaterialInstance with an optional debug name.

Link copied to clipboard

Get the blending mode.

Get the blending mode.

Get the blending mode.

Get the blending mode.

Get the blending mode.

Link copied to clipboard

Get the face culling mode.

Get the face culling mode.

Get the face culling mode.

Get the face culling mode.

Get the face culling mode.

Link copied to clipboard

Get this material's default instance.

Get this material's default instance.

Get this material's default instance.

Get this material's default instance.

Get this material's default instance.

Link copied to clipboard

Get the minimum required feature level for this material.

Get the minimum required feature level for this material.

Get the minimum required feature level for this material.

Get the minimum required feature level for this material.

Get the minimum required feature level for this material.

Link copied to clipboard

Get the vertex attribute interpolation mode.

Get the vertex attribute interpolation mode.

Get the vertex attribute interpolation mode.

Get the vertex attribute interpolation mode.

Get the vertex attribute interpolation mode.

Link copied to clipboard
actual fun getMaskThreshold(): Float

Get the alpha threshold for MASKED blending mode.

expect fun getMaskThreshold(): Float

Get the alpha threshold for MASKED blending mode.

actual fun getMaskThreshold(): Float

Get the alpha threshold for MASKED blending mode.

actual fun getMaskThreshold(): Float

Get the alpha threshold for MASKED blending mode.

actual fun getMaskThreshold(): Float

Get the alpha threshold for MASKED blending mode.

Link copied to clipboard
actual fun getName(): String

Get the name of this material.

expect fun getName(): String

Get the name of this material.

actual fun getName(): String

Get the name of this material.

actual fun getName(): String

Get the name of this material.

actual fun getName(): String

Get the name of this material.

Link copied to clipboard
actual fun getParameterCount(): Int

Get the number of parameters declared by this material.

expect fun getParameterCount(): Int

Get the number of parameters declared by this material.

actual fun getParameterCount(): Int

Get the number of parameters declared by this material.

actual fun getParameterCount(): Int

Get the number of parameters declared by this material.

actual fun getParameterCount(): Int

Get the number of parameters declared by this material.

Link copied to clipboard

Get metadata about all parameters declared by this material.

Get metadata about all parameters declared by this material.

Get metadata about all parameters declared by this material.

Get metadata about all parameters declared by this material.

Get metadata about all parameters declared by this material.

Link copied to clipboard
actual fun getParameterTransformName(samplerName: String): String?

Get the transform parameter name associated with a sampler.

expect fun getParameterTransformName(samplerName: String): String?

Get the transform parameter name associated with a sampler.

actual fun getParameterTransformName(samplerName: String): String?

Get the transform parameter name associated with a sampler.

actual fun getParameterTransformName(samplerName: String): String?

Get the transform parameter name associated with a sampler.

actual fun getParameterTransformName(samplerName: String): String?

Get the transform parameter name associated with a sampler.

Link copied to clipboard

Get the reflection mode.

Get the reflection mode.

Get the reflection mode.

Get the reflection mode.

Get the reflection mode.

Link copied to clipboard

Get the refraction mode.

Get the refraction mode.

Get the refraction mode.

Get the refraction mode.

Get the refraction mode.

Link copied to clipboard

Get the refraction surface type.

Get the refraction surface type.

Get the refraction surface type.

Get the refraction surface type.

Get the refraction surface type.

Link copied to clipboard

Get the set of vertex attributes required by this material.

Get the set of vertex attributes required by this material.

Get the set of vertex attributes required by this material.

Get the set of vertex attributes required by this material.

Get the set of vertex attributes required by this material.

Link copied to clipboard

Get the shading model.

Get the shading model.

Get the shading model.

Get the shading model.

Get the shading model.

Link copied to clipboard

Get the specular anti-aliasing threshold.

Get the specular anti-aliasing threshold.

Get the specular anti-aliasing threshold.

Get the specular anti-aliasing threshold.

Get the specular anti-aliasing threshold.

Link copied to clipboard

Get the specular anti-aliasing variance.

Get the specular anti-aliasing variance.

Get the specular anti-aliasing variance.

Get the specular anti-aliasing variance.

Get the specular anti-aliasing variance.

Link copied to clipboard

Get the transparency rendering mode (only relevant for TRANSPARENT/FADE blending).

Get the transparency rendering mode (only relevant for TRANSPARENT/FADE blending).

Get the transparency rendering mode (only relevant for TRANSPARENT/FADE blending).

Get the transparency rendering mode (only relevant for TRANSPARENT/FADE blending).

Get the transparency rendering mode (only relevant for TRANSPARENT/FADE blending).

Link copied to clipboard

Get the vertex coordinate space domain.

Get the vertex coordinate space domain.

Get the vertex coordinate space domain.

Get the vertex coordinate space domain.

Get the vertex coordinate space domain.

Link copied to clipboard
actual fun hasParameter(name: String): Boolean

Check whether a parameter with the given name exists.

expect fun hasParameter(name: String): Boolean

Check whether a parameter with the given name exists.

actual fun hasParameter(name: String): Boolean

Check whether a parameter with the given name exists.

actual fun hasParameter(name: String): Boolean

Check whether a parameter with the given name exists.

actual fun hasParameter(name: String): Boolean

Check whether a parameter with the given name exists.

Link copied to clipboard

Check if alpha-to-coverage is enabled.

Check if alpha-to-coverage is enabled.

Check if alpha-to-coverage is enabled.

Check if alpha-to-coverage is enabled.

Check if alpha-to-coverage is enabled.

Link copied to clipboard

Check if color writes are enabled. Default is true.

Check if color writes are enabled. Default is true.

Check if color writes are enabled. Default is true.

Check if color writes are enabled. Default is true.

Check if color writes are enabled. Default is true.

Link copied to clipboard

Check if depth testing is enabled. Default is true.

Check if depth testing is enabled. Default is true.

Check if depth testing is enabled. Default is true.

Check if depth testing is enabled. Default is true.

Check if depth testing is enabled. Default is true.

Link copied to clipboard

Check if depth writes are enabled. Default is true.

Check if depth writes are enabled. Default is true.

Check if depth writes are enabled. Default is true.

Check if depth writes are enabled. Default is true.

Check if depth writes are enabled. Default is true.

Link copied to clipboard
actual fun isDoubleSided(): Boolean

Check if this material renders both front and back faces (double-sided). Default is false (back culling).

expect fun isDoubleSided(): Boolean

Check if this material renders both front and back faces (double-sided). Default is false (back culling).

actual fun isDoubleSided(): Boolean

Check if this material renders both front and back faces (double-sided). Default is false (back culling).

actual fun isDoubleSided(): Boolean

Check if this material renders both front and back faces (double-sided). Default is false (back culling).

actual fun isDoubleSided(): Boolean

Check if this material renders both front and back faces (double-sided). Default is false (back culling).

Link copied to clipboard
actual fun setDefaultParameter(name: String, value: Boolean)

Set a boolean parameter on this material's default instance.

actual fun setDefaultParameter(name: String, value: Float)

Set a float parameter on this material's default instance.

actual fun setDefaultParameter(name: String, value: Int)

Set an integer parameter on this material's default instance.

actual fun setDefaultParameter(name: String, x: Float, y: Float)

Set a 2D vector parameter on this material's default instance.

actual fun setDefaultParameter(name: String, x: Float, y: Float, z: Float)

Set a 3D vector parameter on this material's default instance.

actual fun setDefaultParameter(name: String, x: Float, y: Float, z: Float, w: Float)

Set a 4D vector parameter on this material's default instance.

expect fun setDefaultParameter(name: String, value: Boolean)

Set a boolean parameter on this material's default instance.

expect fun setDefaultParameter(name: String, value: Float)

Set a float parameter on this material's default instance.

expect fun setDefaultParameter(name: String, value: Int)

Set an integer parameter on this material's default instance.

expect fun setDefaultParameter(name: String, x: Float, y: Float)

Set a 2D vector parameter on this material's default instance.

expect fun setDefaultParameter(name: String, x: Float, y: Float, z: Float)

Set a 3D vector parameter on this material's default instance.

expect fun setDefaultParameter(name: String, x: Float, y: Float, z: Float, w: Float)

Set a 4D vector parameter on this material's default instance.

actual fun setDefaultParameter(name: String, value: Boolean)

Set a boolean parameter on this material's default instance.

actual fun setDefaultParameter(name: String, value: Float)

Set a float parameter on this material's default instance.

actual fun setDefaultParameter(name: String, value: Int)

Set an integer parameter on this material's default instance.

actual fun setDefaultParameter(name: String, x: Float, y: Float)

Set a 2D vector parameter on this material's default instance.

actual fun setDefaultParameter(name: String, x: Float, y: Float, z: Float)

Set a 3D vector parameter on this material's default instance.

actual fun setDefaultParameter(name: String, x: Float, y: Float, z: Float, w: Float)

Set a 4D vector parameter on this material's default instance.

actual fun setDefaultParameter(name: String, value: Boolean)

Set a boolean parameter on this material's default instance.

actual fun setDefaultParameter(name: String, value: Float)

Set a float parameter on this material's default instance.

actual fun setDefaultParameter(name: String, value: Int)

Set an integer parameter on this material's default instance.

actual fun setDefaultParameter(name: String, x: Float, y: Float)

Set a 2D vector parameter on this material's default instance.

actual fun setDefaultParameter(name: String, x: Float, y: Float, z: Float)

Set a 3D vector parameter on this material's default instance.

actual fun setDefaultParameter(name: String, x: Float, y: Float, z: Float, w: Float)

Set a 4D vector parameter on this material's default instance.

actual fun setDefaultParameter(name: String, value: Boolean)

Set a boolean parameter on this material's default instance.

actual fun setDefaultParameter(name: String, value: Float)

Set a float parameter on this material's default instance.

actual fun setDefaultParameter(name: String, value: Int)

Set an integer parameter on this material's default instance.

actual fun setDefaultParameter(name: String, x: Float, y: Float)

Set a 2D vector parameter on this material's default instance.

actual fun setDefaultParameter(name: String, x: Float, y: Float, z: Float)

Set a 3D vector parameter on this material's default instance.

actual fun setDefaultParameter(name: String, x: Float, y: Float, z: Float, w: Float)

Set a 4D vector parameter on this material's default instance.