Limit Of THREE.Scene

Hii,
i made a project where we can draw line and circle dynamically using Three.js , the shapes are added in THREE.Scene,But one question comes to my mind how many shapes or object can be added in THREE.Scene.Is there is any limit to THREE.Scene.If there is then how to improve the performance

There is no limit of objects, but limited hardware (and limits browser will give to your process, but that should be enough). To improve performance you can use InstancedBufferGeometry, if you take a look at the examples you can see what performance boost can be archived, since instead having a render-call per mesh, there is only one. Culling can be improved to a specific scenario too, like if you can separate the scene into clear separated cells like in a octree, culling can be speed up with bounding hierarchies or cells (this requires some modifications of THREE)

Dealing with InstancedBufferGeometry isn’t the same as using a basic mesh, you need to deal with the positions and rotations yourself with InstancedBufferAttribute. You also probably have to extend the shader you use, not sure if there’s already a standard implementation for the standard materials. If you never heard of all this you should take a look at the examples.

1 Like