How can I clip an object's visibility when it's behind or intersecting another semi-transparent object?

I’m wondering if it is possible to create a semitransparent object behind which certain assigned objects are clipped. This would create a kind of boolean effect. It seems to me that the stencil buffer might be involved based on this related playground example. The example does almost the opposite of what I want, but still the concept is there.

Could someone direct me to relevant documentation on achieving this?

Hello and welcome on the forum !!!

I am having some issues to understand exactly what you are trying to achieve :frowning: could you try to draw it maybe ?

This might help redirecting to some relevant documentation but you might look for clipplanes: Use clip planes - Babylon.js Documentation

It’s been an age, but clip planes were the answer. Thanks sebavan!

1 Like