Mesh costs one draw call per frame. In the benchmark POC, 2,000 meshes run at the display rate, while 20,000 run at about 12 FPS.
When a frame has more than 2,000 draw calls, the library logs this warning once:
Many identical objects: InstancedMesh
An InstancedMesh draws many copies of one geometry and one material in a single draw call. Each copy has its own matrix (and optionally its own color).
raycast, a hit on an instanced mesh carries instanceId, the index of the copy.
Other tips
- Share geometries and materials between meshes instead of creating one per object.
- Merge static geometry that never moves (
mergeGeometriesfromthree/addons/utils/BufferGeometryUtils.js). - Check
ctx.graphics.renderer.info.render.drawCallsto see the cost of a frame.