user3549576
user3549576

Reputation: 307

three.js mesh rendering too slow

I have three layers (Object3D) each has about 20K sphere geometries. The rendering is making the whole browser stuck. Is there any way for faster rendering of these objects? As few other answers on SO, I am using same geometry and re-using three materials created only once. Also, these are dynamic objects and cannot use pre-generated json. Thanks in advance!

Upvotes: 2

Views: 1482

Answers (1)

pailhead
pailhead

Reputation: 5431

It’s slowing down because of the overhead involved when drawing each sphere.

Instancing here helps by reducing both the drawcall overhead and potentially removing nodes for the matrix updates.

Thee.js has a low level interface that does not work on the scene level.

You can try this 3rd part module https://www.npmjs.com/package/three-instanced-mesh

Upvotes: 1

Related Questions