Hello,
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?
1 Like
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.
5 Likes
So, just also setting .matrixAutoUpdate = false
should do the job?
1 Like
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.
2 Likes
Would it be also valid to set mesh material opacity to 0 or is it better using the visible property in order to refactor some old code 
I’d set visible=false. I think opacity=0 will still render the object to the depth buffer etc.
2 Likes