The problem of GLTFLoader with InstancedMesh

If you have a GLB model that contains many repetitions of the same mesh(es) then glTF Transform can detect that, consolidate any redundant data, and (optionally) add the EXT_mesh_gpu_instancing extension causing GLTFLoader to create THREE.InstancedMesh objects. Typical usage in the CLI would look something like this:

# install
npm install --global @gltf-transform/cli

# help
gltf-transform --help

# deduplicate and instance
gltf-transform dedup in.glb out.glb
gltf-transform instance out.glb out.glb

Or there’s a Node.js or Web-friendly scripting API for this too.

If you just have a GLB containing one example of the thing you want to repeat throughout the scene, though, that’s probably out of glTF-Transform’s wheelhouse. R3F is good for that, for vanilla three.js you’d have to deconstruct the scene a bit and I don’t know of general-purpose examples for that.