Chevron Down
Table of Contents
Chevron DownAPI Reference

GLTFWriter

The GLTFWriter is a writer for glTF scenegraphs.

LoaderCharacteristic
File Extensions.glb,.gltf
File TypesBinary, JSON, Linked Assets
Data FormatScenegraph
File FormatglTF
Encoder TypeSynchronous (limited), Asynchronous
Worker Thread SupportNo
Streaming SupportNo

Usage

import {GLTFWriter} from '@loaders.gl/gltf';
import {encodeSync} from '@loaders.gl/core';

const arrayBuffer = encodeSync(gltf, GLTFWriter, options);

Options

OptionTypeDefaultDescription
DracoWriterDracoWriternullTo enable DRACO encoding, the application needs to import and supply the DracoWriter class.
DracoLoaderDracoLoadernullTo enable DRACO encoding, the application needs to import and supply the DracoLoader class.