# Clipping a mesh based on another mesh

**URL:** <https://forum.babylonjs.com/t/clipping-a-mesh-based-on-another-mesh/16557>\
**Category:** Questions\
**Tags:** material\
**Created:** [December 12, 2020, 12:43am UTC](https://forum.babylonjs.com/t/clipping-a-mesh-based-on-another-mesh/16557 "2020-12-12T00:43:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![afk2000](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/afk2000/32/7575_2.png) [@afk2000](https://forum.babylonjs.com/u/afk2000)\
**Post date:** [December 12, 2020, 12:43am UTC](https://forum.babylonjs.com/t/clipping-a-mesh-based-on-another-mesh/16557/1 "2020-12-12T00:43:30Z")

</div>

Is it possible to clip a mesh based on another mesh? For example, rendering just the shoestrings in the following model [photography. but, it gets the point across]. Ie, I just need to see 1 specific mesh. But, I don’t want to render the parts that would be hidden by another.  
I have a feeling this may be a limitation of WebGL rendering. But, any insight would be appreciated.

 ![strings](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/d/dfea89a34379f8f1048d3e963981fa1e3c8e9ba5.jpeg)  
 ![strings_hidden](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/0/03b10c46d8937aeb418d57b5ca054b742bb4537f.png)

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [December 13, 2020, 10:22pm UTC](https://forum.babylonjs.com/t/clipping-a-mesh-based-on-another-mesh/16557/2 "2020-12-13T22:22:01Z")

</div>

You can render the meshes you don’t want to see with `disableColorWrite = true` for their materials. That way, they won’t be seen but will still update the zbuffer:

> **[Babylon.js Playground](https://playground.babylonjs.com/#8YRQQS)**

---

<div class="post-metadata">

**Author:** ![afk2000](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/afk2000/32/7575_2.png) [@afk2000](https://forum.babylonjs.com/u/afk2000)\
**Post date:** [December 14, 2020, 4:29pm UTC](https://forum.babylonjs.com/t/clipping-a-mesh-based-on-another-mesh/16557/3 "2020-12-14T16:29:35Z")

</div>

Fantastic. Thank you!
