MaterialPackage

actual class MaterialPackage

MaterialPackage holds the compiled binary data of a Filament material.

A MaterialPackage is produced by MaterialBuilder after material source code compilation. It contains optimized shader code for multiple backends (OpenGL, Vulkan, Metal, WebGPU), material metadata, and parameter definitions.

Usage: After building a MaterialPackage with MaterialBuilder, pass the package data to Filament's Material system via Engine.Material creation. The package is self-contained and can be serialized, cached, or transmitted.

Validity: Always check isValid() before using a package. An invalid package indicates compilation failure and should be discarded.

See also

expect class MaterialPackage

MaterialPackage holds the compiled binary data of a Filament material.

A MaterialPackage is produced by MaterialBuilder after material source code compilation. It contains optimized shader code for multiple backends (OpenGL, Vulkan, Metal, WebGPU), material metadata, and parameter definitions.

Usage: After building a MaterialPackage with MaterialBuilder, pass the package data to Filament's Material system via Engine.Material creation. The package is self-contained and can be serialized, cached, or transmitted.

Validity: Always check isValid() before using a package. An invalid package indicates compilation failure and should be discarded.

See also

actual class MaterialPackage(buffer: ByteArray = ByteArray(0))

MaterialPackage holds the compiled binary data of a Filament material.

A MaterialPackage is produced by MaterialBuilder after material source code compilation. It contains optimized shader code for multiple backends (OpenGL, Vulkan, Metal, WebGPU), material metadata, and parameter definitions.

Usage: After building a MaterialPackage with MaterialBuilder, pass the package data to Filament's Material system via Engine.Material creation. The package is self-contained and can be serialized, cached, or transmitted.

Validity: Always check isValid() before using a package. An invalid package indicates compilation failure and should be discarded.

See also

actual class MaterialPackage

MaterialPackage holds the compiled binary data of a Filament material.

A MaterialPackage is produced by MaterialBuilder after material source code compilation. It contains optimized shader code for multiple backends (OpenGL, Vulkan, Metal, WebGPU), material metadata, and parameter definitions.

Usage: After building a MaterialPackage with MaterialBuilder, pass the package data to Filament's Material system via Engine.Material creation. The package is self-contained and can be serialized, cached, or transmitted.

Validity: Always check isValid() before using a package. An invalid package indicates compilation failure and should be discarded.

See also

actual class MaterialPackage

MaterialPackage holds the compiled binary data of a Filament material.

A MaterialPackage is produced by MaterialBuilder after material source code compilation. It contains optimized shader code for multiple backends (OpenGL, Vulkan, Metal, WebGPU), material metadata, and parameter definitions.

Usage: After building a MaterialPackage with MaterialBuilder, pass the package data to Filament's Material system via Engine.Material creation. The package is self-contained and can be serialized, cached, or transmitted.

Validity: Always check isValid() before using a package. An invalid package indicates compilation failure and should be discarded.

See also

Constructors

Link copied to clipboard
constructor(buffer: ByteArray = ByteArray(0))

Functions

Link copied to clipboard
actual fun getBuffer(): ByteArray

Get the binary package data as a byte array.

expect fun getBuffer(): ByteArray

Get the binary package data as a byte array.

actual fun getBuffer(): ByteArray

Get the binary package data as a byte array.

actual fun getBuffer(): ByteArray

Get the binary package data as a byte array.

actual fun getBuffer(): ByteArray

Get the binary package data as a byte array.

Link copied to clipboard
actual fun isValid(): Boolean

Check if this package is valid.

expect fun isValid(): Boolean

Check if this package is valid.

actual fun isValid(): Boolean

Check if this package is valid.

actual fun isValid(): Boolean

Check if this package is valid.

actual fun isValid(): Boolean

Check if this package is valid.