THREE.JS / FOUNDATIONS 242

One asset. Four identities.

Material variants keep shared geometry in one glTF asset while authored looks switch at runtime. This study follows the official post-load pattern so the extension metadata, primitive mappings, and fallback behavior stay inspectable.

Preparing glTF fixture—

Building a shared-geometry asset with authored material mappings…

backend
—
variant set
—
primitives
—
materials
—
frame ms
—
Variant switchboardwaiting

The parsed glTF variant metadata will appear after the loader finishes.

Extension contractwaiting
root variantsfinite · named

waiting

primitive mappingsmaterial + indices

waiting

fallbackno active variant

waiting

shared geometryone access buffer

waiting

KHR_materials_variants describes a finite set of authored looks; the viewer chooses at most one active variant for the asset.

The study uses GLTFLoader's unknown-extension metadata and the official manual selection pattern.

Derived from the official GLTFLoader + variants example, GLTFLoader, and the Khronos KHR_materials_variants specification. Use ?forceWebGL=1 to inspect the labeled WebGL2 reference.

LAB 242 / GLTF MATERIAL VARIANTS