troisjs / trois

✨ ThreeJS + VueJS 3 + ViteJS ⚡
https://troisjs.github.io
MIT License
4.24k stars 304 forks source link

Performance with large number of geometries #181

Open garma83 opened 1 year ago

garma83 commented 1 year ago

Hi,

This is mainly a warning for future users I guess.. Im happy to contribute but the original creator seems to have abandoned this package.

Anyway, the FAQ states that this package is just as performant as Three.js. This is not my experience in practice. The package creates geometries and meshes with large amounts of props, and attaches watchers to all of them. That is fine and even convenient for limited number of objects. But for scenes with more than 100 objects, mounting/dismounting the scene caused a lag of multiple seconds, even though three.js has no problem with it.

InstancedMesh can be a solution, but for situations where the objects are not the same (custom generated, or have different textures) this is not.

I have some ideas how to fix this, but would need involvement of the author: