What is the best way to do this? As I realized the ray-casting to every mesh is expensive by performance. And native intersection algorithm will affect all meshes, but not first from the camera.
Ray casting seems to be logical solution.
I believe, you may try also to use occlusion queries with some custom logic.
Here is a lot of info about it - How to Occlusion Culling properly
Thats just a thoughts about the task, currently I have this PG https://playground.babylonjs.com/#BSAAQP#9
Looks like intersection checks strongly affects performance, so I probably will try approach with ray casting.
I dont want to spent your time, I just wanted to know general approaches which I can to apply. You helped with them, thank you!