Loader category
Keep the scene hierarchy until the renderer needs it.
Scenegraph loaders preserve nodes, meshes, materials, transforms, and extensions as a structured representation. That lets applications inspect, transform, or render a scene without flattening it during decode.
Category data
Load many formats into one application path.
Category data lets related loaders return compatible structures, so rendering, analysis, and export code can be shared.
A scene is more than a mesh
Decode the relationships as well as the bytes.
A scenegraph carries the hierarchy that connects geometry, materials, animations, and transforms. The category keeps those relationships available to an application-specific renderer or converter.
Scene files
glTF, GLB, and OpenUSD
Preserves
Nodes, meshes, materials, transforms, animations, and extensions
Payloads
Binary buffers, images, compressed geometry, and textures
Output
Typed scene data close to the source format
The Scenegraph category represents hierarchical 3D scene descriptions. Each loader returns a typed representation close to its source format.
Detailed guide
The scenegraph data model
The sections below document the loaders and the source-shaped data structures they return.
Loaders
| Loader | Notes |
|---|---|
GLTFLoader | |
GLBLoader | |
USDLoader |
glTF Data Format
The data format is fairly raw, close to the unpacked glTF/GLB data structure, it is described by:
- a parsed JSON object (with top level arrays for
scenes,nodesetc) - a list of
ArrayBuffers representing binary blocks (into whichbufferViewsandimagesin the JSON point).
Data Structure
A JSON object with the following top-level fields:
| Field | Type | Default | Description |
|---|---|---|---|
magic | Number | glTF | The first four bytes of the file |
version | Number | 2 | The version number |
json | Object | {} | The JSON chunk |
buffers | ArrayBuffer[] | [] | (glTF) The BIN chunk plus any base64 or BIN file buffers |
Buffers can be objects in the shape of {buffer, byteOffset, byteLength}.
Helper Classes
To simplify higher-level processing of the loaded, raw glTF data, several helper classes are provided in the @loaders.gl/scene/gltf module, these can:
- unpack and remove certain glTF extensions
- extract typed array views from the JSON objects into the binary buffers
- create HTML images from image buffers
- etc
OpenUSD Data Format
USDLoader returns a USDStage with root-layer metadata, a hierarchy of typed USDPrim objects,
and the URLs of layers used during composition. See the
USDLoader reference for supported OpenUSD
features and current limitations.