GltfAsset

A loaded glTF asset whose GPU resources are ready. Obtain via rememberGltfAsset.

Pass this to one or more GltfInstance composables to place copies of the model in the scene without re-importing the asset each time.

Instance lifetime

gltfio has no API to destroy a single instance — every GltfInstance created from this asset stays alive until the asset itself is destroyed (i.e. until the rememberGltfAsset call that produced it leaves composition). Reusing one asset across many instances is cheap, but avoid churning hundreds of short-lived instances from a single long-lived asset.

Properties

Link copied to clipboard

The centre of the model's bounding box, in the model's own units, for CameraState.fitting. An instance's position, scale and fitToSize move the model away from it.

Link copied to clipboard

True when all GPU resources (textures, buffers) have been uploaded. GltfInstance uses this to avoid rendering incomplete models.

Link copied to clipboard

The names of the asset's KHR_materials_variants, for GltfInstance's materialVariant; empty without any.

Link copied to clipboard

Fraction of the GPU resources uploaded so far, 0 to 1; reaches 1 with isReady. Covers the upload only: reading the bytes happens in your load lambda, before the asset exists.

Link copied to clipboard

The radius around center that holds the whole model, in its own units; 0 for a file that declares no bounds.