But what do you do when you have more methods such as this? Say the bool changes along with 3 others, you’d traverse the same scene in the same frame. While, if you have to traverse it at least once to figure out the layer stuff, or whats visible and what not, you could pull from this state and do it all in one pass. Still, this traversal from your snippet is cheap, but you can’t do that with a matrix i think, even if you assign it like that internally the setter calls copy()
, yielding another loop and increments.
I’m still thinking though, layers may potentially avoid this overhead and achieve the same use case, if say you’re rendering certain meshes in additional passes. With a named set, you could call render(Object3D[], camera)
but since it has to be a scene, you can’t just reparent them. If you keep a copy of a mesh and are trying to sync it, it might be easier and even faster to render just one more time with a certain layer.