performance: one single mesh with multiple materials or scene graph (multiple objects with single material) ?

50,000 draw calls is too many, unless you’re OK with low framerates. To reduce the draw calls while preserving interactivity, filtering, highlighting, etc., you must use some form of batching. This does mean that you’ll need to implement these interactive features without the convenience of separate scene graph meshes and materials on each of the 50,000 objects, but that’s OK.

BatchedMesh is the next-most-convenient built-in option for three.js. For example you can show/hide objects dynamically, to ‘hide’ an object you could temporarily hide it from the batch and render it separately as a 2nd draw call, or use custom shaders to highlight it using the fragment shader.

That said, it’s also possible to implement this just within a normal mesh, it just requires more manual control, see When is it actually beneficial to use LOD in Three.js for performance? - #10 by donmccurdy.

1 Like