I believe that Three.js is “Frustum Culling” objects outside the camera view (because when I zoom the camera and less objects are visible the performance increases).
How can I get a list (from Three.js) of objects that are not Frustum Culled?
I know I may be able to traverse the tree and do it myself by comparing object positions and size to the camera frustum, but I’m wondering if there’s some data in the Three renderer that I might be able to just grab and read, assuming Three.js is already tracking that.
I took a look: looks like WebGLRenderer internals are well hidden (private vars inside the constructor scope), so I’m not sure if there’s a simple way to see which objects are not frustum culled other than making my own Frustum and performing duplicate work.
It’d be nice if there was a way to get this info for free because the renderer is already doing it. So I made a feature idea for it on GitHub.
Keep in mind that this check may be expensive, and you’re doing it twice for everything.In which case, you may want to disable frustum culling, and cull yourself.