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

**URL:** <https://forum.babylonjs.com/t/how-can-i-clip-an-objects-visibility-when-its-behind-or-intersecting-another-semi-transparent-object/7279>\
**Category:** Questions\
**Created:** [November 28, 2019, 9:24pm UTC](https://forum.babylonjs.com/t/how-can-i-clip-an-objects-visibility-when-its-behind-or-intersecting-another-semi-transparent-object/7279 "2019-11-28T21:24:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![IIerpos](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@IIerpos](https://forum.babylonjs.com/u/IIerpos)\
**Post date:** [November 28, 2019, 9:24pm UTC](https://forum.babylonjs.com/t/how-can-i-clip-an-objects-visibility-when-its-behind-or-intersecting-another-semi-transparent-object/7279/1 "2019-11-28T21:24:39Z")

</div>

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](https://playground.babylonjs.com/#XU86GQ#2). 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?

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [November 28, 2019, 9:55pm UTC](https://forum.babylonjs.com/t/how-can-i-clip-an-objects-visibility-when-its-behind-or-intersecting-another-semi-transparent-object/7279/2 "2019-11-28T21:55:41Z")

</div>

Hello and welcome on the forum !!!

I am having some issues to understand exactly what you are trying to achieve ☹ 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](https://doc.babylonjs.com/how_to/clip_planes)

---

<div class="post-metadata">

**Author:** ![IIerpos](https://avatars.discourse-cdn.com/v4/letter/i/9de053/32.png) [@IIerpos](https://forum.babylonjs.com/u/IIerpos)\
**Post date:** [January 14, 2020, 9:56pm UTC](https://forum.babylonjs.com/t/how-can-i-clip-an-objects-visibility-when-its-behind-or-intersecting-another-semi-transparent-object/7279/3 "2020-01-14T21:56:44Z")

</div>

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