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

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(nativeHandle: MemorySegment?)
constructor(nativeHandle: CPointer<FilaPackage>?)

Properties

Link copied to clipboard
actual val buffer: ByteArray

Get the binary package data as a byte array.

expect val buffer: ByteArray

Get the binary package data as a byte array.

actual val buffer: ByteArray

Get the binary package data as a byte array.

actual val buffer: ByteArray

Get the binary package data as a byte array.

actual val buffer: ByteArray

Get the binary package data as a byte array.

Link copied to clipboard
actual val isValid: Boolean

Check if this package is valid.

expect val isValid: Boolean

Check if this package is valid.

actual val isValid: Boolean

Check if this package is valid.

actual val isValid: Boolean

Check if this package is valid.

actual val isValid: Boolean

Check if this package is valid.

Link copied to clipboard
val MaterialPackage.nativeObject: MaterialPackage
val MaterialPackage.nativeObject: MemorySegment?