Three.js scene.remove vs. visible = false

If I remove the Object3D object from the scene, it will not be displayed, but it will remain in memory. If I set the visibility property of this object to false, it will not be displayed, but it will remain in memory. Who cares?

Context: I experience performance issues when I have many complex networks. Only one should be visible at any given time. Others are usually hidden with visible = false.

+4
source share
1 answer

Well, the difference is that when you delete an object in the scene, it is removed from the scene, that is, it is no longer among the children. While when it is simply set to invisible, it still remains in the scene data structure and can be used in calculations, for example, to rotate another object towards it.

But yes for rendering at the end there is no difference, both ways are to omit this object from the picture.

, , , . , , , , , , , . , , , , - ( , , - ).

, , , , , , three.js

+3

All Articles