# Hide mesh but show it‘s shadows?

**URL:** <https://forum.babylonjs.com/t/hide-mesh-but-show-it-s-shadows/4697>\
**Category:** Questions\
**Created:** [July 24, 2019, 5:10pm UTC](https://forum.babylonjs.com/t/hide-mesh-but-show-it-s-shadows/4697 "2019-07-24T17:10:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![vedrrran](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/vedrrran/32/3578_2.png) [@vedrrran](https://forum.babylonjs.com/u/vedrrran)\
**Post date:** [July 24, 2019, 5:10pm UTC](https://forum.babylonjs.com/t/hide-mesh-but-show-it-s-shadows/4697/1 "2019-07-24T17:10:15Z")

</div>

Is it possible to use mesh to make its shadow and hide it in the same time? I‘m planing to use tubes to make shadows but I would like to hide them and render lines instead (works better for my aeshetics).

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [July 24, 2019, 5:23pm UTC](https://forum.babylonjs.com/t/hide-mesh-but-show-it-s-shadows/4697/2 "2019-07-24T17:23:27Z")

</div>

Hey unfortunately so far we are not rendering meshes that are not visible but I could imagine an option for shadow maps to avoid this limitation

---

<div class="post-metadata">

**Author:** ![DerKarlos](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/derkarlos/32/4346_2.png) [@DerKarlos](https://forum.babylonjs.com/u/DerKarlos)\
**Post date:** [October 31, 2020, 7:01pm UTC](https://forum.babylonjs.com/t/hide-mesh-but-show-it-s-shadows/4697/3 "2020-10-31T19:01:22Z")

</div>

I may have a way:  
Use addLODLevel with the second parameter as null.  
But that may be an error in BJS and will not work forever.

---

<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:** [October 31, 2020, 7:52pm UTC](https://forum.babylonjs.com/t/hide-mesh-but-show-it-s-shadows/4697/4 "2020-10-31T19:52:09Z")

</div>

This is a bug indeed, setting a LOD to null should remove the mesh and hence its shadow.

You can display the shadow of a mesh without showing the mesh by applying a material with `disableColorWrite = disableDepthWrite = true`:

[https://www.babylonjs-playground.com/#F7KZ7C#12](https://www.babylonjs-playground.com/#F7KZ7C#12)

Another way to do it is to set `visibility = 0` for the mesh and enable shadow transparency by setting `transparencyShadow = true` on the shadow generator:

[https://www.babylonjs-playground.com/#F7KZ7C#13](https://www.babylonjs-playground.com/#F7KZ7C#13)
