Exports a SceneModel to glTF (2) format.

Emits a binary .glb containing:

  • The full scene-graph: one node per SceneObject, with one child node per SceneMesh carrying its model-space matrix.
  • Geometry attributes per SceneGeometry — positions (decompressed from quantised), normals (oct-decoded), texcoords (decompressed via the geometry's decompress matrix), vertex colours, indices. Accessors are reused across meshes that share a geometry.
  • Full PBR materials per SceneMaterial — base colour, metallic + roughness factors, alpha mode + cutoff, plus colour / metallic-roughness / normal / occlusion / emissive textures.
  • Texture image data, embedded as PNG or JPEG bytes — already-encoded bytes from the source SceneTexture.buffers / src (data URL or URL) are preserved verbatim; image / canvas / ImageData sources are re-encoded as PNG via a 2D canvas. Sampler state (filters + wrap modes) is mapped from the SceneTexture into glTF.

Compressed textures (S3TC, ASTC, BC7, ...) are skipped with a warning — embedding them would require a KHR_texture_basisu-style extension that isn't supported here.

For detailed usage, refer to @xeokit/sdk/formats/gltf.

Hierarchy (View Summary)

Constructors

Properties

defaultVersion: string

The default supported schema version.

encoders: { [key: string]: ModelEncoder }

An encoder for each supported schema version.

fileDataType: string

Data type of the file written by this Exporter.

format: string

The exported model file format.

versions: string[]

List of supported schema versions.

Methods