Object cost when visible = false?


I was looking for the best way to “turn off/on” object and their computation temporarily.
I was wondering if in an object and more particulary a mesh with bufferGeometry and attributes, simply setting the “visible” attribute to false, would allow getting rid of the computation of the object/mesh. Would this be equivalent to what happens with frustum culling?
or if not, what other parameters should I pay attention to, to lower the performance cost?

Setting .visible = false will avoid the per-frame cost of rendering the object, as if the object were frustum-culled. There’s still some small cost involved with updating the object’s world matrix in the scene graph (if you have thousands of invisible objects you might notice this), and the object’s memory usage is not removed from the GPU unless it is disposed.


So, just also setting .matrixAutoUpdate = false should do the job?

That might help. I probably wouldn’t bother until/unless you start seeing matrix updates taking significant time in a developer tools profile though. For just a few objects, it’s ~nothing.

1 Like