Occlusion with invisible mesh

Hello Babylonians!

I’m trying to use occlusion to hide a part of a mesh which is behind an other invisible mesh.

But I want to hide only one mesh not every meshes.

For example in this tiny PG: Babylon.js Playground
I just want to hide (make it invisible) only the tiny part of the sphere behind the cube. But not the ground.

In the future I want to totally set the visibility of the cube at 0 and still put the tiny part of the sphere, behind the invisible cube , invisible too.

You can not hide part of a mesh with occlusions. You can only hide an entire mesh.

This may be possible by removing faces from a mesh (by designing them into a variable to display them again). But I fear that it will be very difficult to put in place. The difficulty of knowing which part of the mesh is behind another, to remove only the good faces hidden.

Occlusions mask the entire mesh and it is based on what the camera sees, not according to a piece of mesh hiding by another.

2 Likes

Oh I see @Dad72
Thank you for your help!