API Reference · Model and texture loading
GltfAsset
public sealed class GltfAssetA glTF file, read once. Immutable and safe to share: every copy of the model on screen is an instance of this, and the geometry and textures are decoded and uploaded once however many there are.
This is the whole of the model pipeline. GltfLoader.LoadModel is load-then-instantiate in one call, which is right for a viewer with one model in it; a game with a crowd loads the asset once and instantiates it per character. A .glb loads from bytes alone; a .gltf with external buffers and images needs a GltfLoadOptions.Resolver, or a Uri whose scheme picks one.
Properties
| Member | Description |
|---|---|
| The clips the file declared, in its own order, bound to the asset's own template nodes. An instance gets its own copies bound to its own nodes; these are for looking at names and durations. |
| Everything the reader could not carry over, and why. Empty for a file that loaded whole. Worth logging once per asset: it is the only way to learn that a texture is missing because it was WebP, or that a rig stands still because one joint is outside the scene. |
| The file's root-level |
| The materials as read, one per glTF material that a drawn primitive uses (two, when one material covers both a primitive with texture coordinates and one without). Instances wear these or copies of them, by |
| Every mesh in the file that is drawn, one per glTF primitive, however many nodes draw it. Shared by every instance; the geometry is uploaded once. |
| The name given at load, which every instance's root node takes unless told otherwise. |
| How many glTF nodes are in the scene that was read. |
| The skins the file declared, bound to the template nodes. Instances get their own. |
| Every texture, one per image-and-wrap-mode the file's materials use. Shared by every instance. |
Methods
| Member | Description |
|---|---|
| The bounds the file authored for a mesh — its POSITION accessor's |
| The glTF material's |
| The glTF mesh's |
| A fresh copy of the model: its own node tree, skins bound to its own joints, its own animator and morph state, sharing this asset's meshes and textures — and its materials, unless |
| Reads a External resources, if the file has any, go through |
| Reads a |
| Reads a file by address. A |
| Which glTF mesh and primitive a |