# Adding Material to LinesMesh results in Bug in ClipPlane

**URL:** <https://forum.babylonjs.com/t/adding-material-to-linesmesh-results-in-bug-in-clipplane/25063>\
**Category:** Bugs\
**Created:** [November 7, 2021, 5:25pm UTC](https://forum.babylonjs.com/t/adding-material-to-linesmesh-results-in-bug-in-clipplane/25063 "2021-11-07T17:25:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Easystreet](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/easystreet/32/15243_2.png) [@Easystreet](https://forum.babylonjs.com/u/Easystreet)\
**Post date:** [November 7, 2021, 5:25pm UTC](https://forum.babylonjs.com/t/adding-material-to-linesmesh-results-in-bug-in-clipplane/25063/1 "2021-11-07T17:25:36Z")

</div>

Hi,

I’ve stumbled across an error and I believe it might be a bug:  
If I add a material to a LinesMesh and apply a ClipPlane to my scene it will break the scene & not render anything.  
Example Playground: [Babylon.js Playground](https://playground.babylonjs.com/#S8K7T3)  
Commenting out line 15 will allow the scene to render again.

---

<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:** [November 7, 2021, 7:20pm UTC](https://forum.babylonjs.com/t/adding-material-to-linesmesh-results-in-bug-in-clipplane/25063/2 "2021-11-07T19:20:04Z")

</div>

Welcome aboard!

Here’s the fix for this problem:

> <https://github.com/BabylonJS/Babylon.js/pull/11401>
>
> See https://forum.babylonjs.com/t/adding-material-to-linesmesh-results-in-bug-in…-clipplane/25063.
> 
> Note that \`ShaderMaterial\` now supports clip planes, so a bit of code can be removed from \`LinesMesh\`.

This PG will work once the fix is merged:  
[https://playground.babylonjs.com/#S8K7T3#4](https://playground.babylonjs.com/#S8K7T3#4)

---

<div class="post-metadata">

**Author:** ![Easystreet](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/easystreet/32/15243_2.png) [@Easystreet](https://forum.babylonjs.com/u/Easystreet)\
**Post date:** [November 7, 2021, 9:12pm UTC](https://forum.babylonjs.com/t/adding-material-to-linesmesh-results-in-bug-in-clipplane/25063/3 "2021-11-07T21:12:50Z")

</div>

That was astonishingly fast! Thanks a bunch 🌻
