# Three.js stencil buffer example to Babylon.js

**URL:** <https://forum.babylonjs.com/t/three-js-stencil-buffer-example-to-babylon-js/60221>\
**Category:** Questions\
**Created:** [August 24, 2025, 10:41pm UTC](https://forum.babylonjs.com/t/three-js-stencil-buffer-example-to-babylon-js/60221 "2025-08-24T22:41:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![CarlBateman](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@CarlBateman](https://forum.babylonjs.com/u/CarlBateman)\
**Post date:** [August 24, 2025, 10:41pm UTC](https://forum.babylonjs.com/t/three-js-stencil-buffer-example-to-babylon-js/60221/1 "2025-08-24T22:41:59Z")

</div>

I’m trying to port the Three.js stencil buffer example ([Tamani-coding - Threejs Stencil Buffer Example - StackBlitz](https://stackblitz.com/github/tamani-coding/threejs-stencil-buffer-example)) to Babylon.js.

But stencils seem to be fundamentally different between the two, is it even possible?

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/1/2106749772abd71871aa75beac4bd4b454240051.png)

---

<div class="post-metadata">

**Author:** ![11128](https://avatars.discourse-cdn.com/v4/letter/1/d07c76/32.png) [@11128](https://forum.babylonjs.com/u/11128)\
**Post date:** [August 25, 2025, 4:33am UTC](https://forum.babylonjs.com/t/three-js-stencil-buffer-example-to-babylon-js/60221/2 "2025-08-25T04:33:02Z")

</div>

Here’s a link to something that has almost the same effect

> [@Impossible geometry with stencil](https://forum.babylonjs.com/t/impossible-geometry-with-stencil/41538):
>

---

<div class="post-metadata">

**Author:** ![CarlBateman](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@CarlBateman](https://forum.babylonjs.com/u/CarlBateman)\
**Post date:** [August 25, 2025, 8:46am UTC](https://forum.babylonjs.com/t/three-js-stencil-buffer-example-to-babylon-js/60221/3 "2025-08-25T08:46:09Z")

</div>

Outstanding. That looks exactly like what I’m looking for.

Thanks. I’ll investigate further.
