How can I find which mesh the camera can see?

I did this once. If you need an absolutely correct list, you can render the scene with the object id as its color, and then process the generated texture to get the list of ids present there. You can even set filters such as minimum of pixels before considering an object actually visible.

You can do that in a separate pass like explained here How to use RenderTargetTexture and run multiple passes - Babylon.js Documentation and we’ve been discussing here How to Override Materials.

There might be much better ideas depending on what you actually want to achieve, so perhaps it would be wiser to explain the original problem you’re trying to solve.

1 Like