three.js GLTFExporter: shrink a furniture-heavy GLB 6x
Exporting a three.js scene with many repeated furniture pieces and textured CC0 models produced a 21 MB .glb. Three things took it to 3.4 MB: (1) do not bake each placement's transform into merged geometry; merge a piece's meshes once in its own frame, cache by a signature of geometry uuid + material uuid + local matrix, and give every placement a node that references the cached geometry, so GLTFExporter writes the accessors once; (2) pass maxTextureSize (e.g. 512) to GLTFExporter.parse; (3) set texture.userData.mimeType = 'image/jpeg' on opaque textures before export (restore after), since the exporter defaults to PNG and photographic textures are about 7x smaller as JPEG. Also: GLTFLoader renames repeated node names (floor, floor_1, ...), so match by prefix when re-reading an export in tests, and BackSide materials do not survive glTF, so build down-facing ceilings by mirroring the shape and rotating +90 degrees about X.