Bake an Object3D Hierarchy to less objects


I have a scene with a dynamic part and a static part. Most of the objects are in the static part and don’t move. They also share a lot of materials, but not geometry (~3000 objects using ~10 materials).
In some 3D engines, I can mark them as static and their geometries will be combined behind the scenes, grouped by materials, and as a result will be rendered in much fewer batches (usually the same amount of batches as there are different materials).

Is this something threejs can do out of the box / in an example of any kind?

I saw THREE.StaticMesh - Less memory, render faster - #8 by Noam_Gat , but can that also operate on objects with materials?


Yes it does. But it does not bake their geometries, see the notes.

Ah, I see. Then it is not for our needs, as we have a lot of very small meshes that are on-screen, so culling is not the issue. Batch reduction is the main target. Thanks!