THREE.JS / FOUNDATIONS 248

One mesh. One batch. Many transforms.

An InstancedMesh is authored as one draw-friendly object, then exported as the portable EXT_mesh_gpu_instancing glTF extension. This lab compares the authored batch with the exact JSON or GLB artifact parsed back by GLTFLoader.

Preparing instancing fixture—

Building a shared geometry, material, transform buffer, and instance-color buffer…

backend
—
source batch
—
last artifact
—
parsed batch
—
frame ms
—
Instancing controlsready

Export JSON or GLB to create an in-memory artifact; the load buttons then parse that exact artifact through GLTFLoader.

Portable instance contractGLTFExporter
source batchwaiting

one shared mesh

JSON outputnot exported

TRS accessors

GLB outputnot exported

binary glTF

parsed batchnot loaded

loader reconstruction

extensionwaiting

required + color

The exporter writes translation, rotation, and scale accessors on the node extension. The loader consumes those accessors and rebuilds one InstancedMesh, keeping the draw-batch boundary visible.

This fixture is local evidence for the current Three.js build, not a universal guarantee for every geometry or material.

Derived from the official InstancedMesh, GLTFExporter, GLTFLoader, and glTF instancing example. The extension contract is defined by Khronos EXT_mesh_gpu_instancing. Use ?forceWebGL=1 to inspect the labeled WebGL2 preview.

AUTHORED BATCH one draw boundary
ROUND-TRIP extension → InstancedMesh
LAB 248 / EXT_MESH_GPU_INSTANCING