AssetLoader

class AssetLoader(nativeHandle: NativePointer)

AssetLoader consumes glTF 2.0 content and produces FilamentAsset objects.

AssetLoader parses a blob of glTF 2.0 content (either JSON or GLB format) and produces a FilamentAsset object, which is a bundle of Filament textures, vertex buffers, index buffers, and entities. An asset is composed of one or more FilamentInstance objects containing the loaded scene hierarchy.

Clients must use AssetLoader to:

  • Create and destroy FilamentAsset objects (similar to how Engine creates core objects)

  • Not fetch external buffer data or create textures (use ResourceLoader for this)

AssetLoader uses a MaterialProvider to create materials, e.g. createUbershaderProvider's pre-compiled set.

See also

Constructors

Link copied to clipboard
constructor(nativeHandle: NativePointer)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The provider this loader was configured with.

Link copied to clipboard

The materials this loader's assets use, across all its assets.

Link copied to clipboard
Link copied to clipboard

The native object, for interop with code calling the Fila* C API directly. Read-only: this wrapper owns it.

Functions

Link copied to clipboard

Create a FilamentAsset from glTF 2.0 data.

Link copied to clipboard

Create a FilamentInstance from an existing FilamentAsset.

Link copied to clipboard

Create a FilamentAsset with pre-allocated instances.

Link copied to clipboard

Destroy a FilamentAsset and release all associated resources.

Link copied to clipboard

Enable diagnostic output for asset loading.

Link copied to clipboard
fun gc()

Reclaims unused entities and components across all assets owned by this loader.