# Blur exponential Shadowmaps generating a self-shadow that can't be fixed with bias

**URL:** <https://forum.babylonjs.com/t/blur-exponential-shadowmaps-generating-a-self-shadow-that-cant-be-fixed-with-bias/3703>\
**Category:** Questions\
**Created:** [June 5, 2019, 12:29am UTC](https://forum.babylonjs.com/t/blur-exponential-shadowmaps-generating-a-self-shadow-that-cant-be-fixed-with-bias/3703 "2019-06-05T00:29:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Federico\_Marino](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/federico_marino/32/2402_2.png) [@Federico\_Marino](https://forum.babylonjs.com/u/Federico_Marino)\
**Post date:** [June 5, 2019, 12:29am UTC](https://forum.babylonjs.com/t/blur-exponential-shadowmaps-generating-a-self-shadow-that-cant-be-fixed-with-bias/3703/1 "2019-06-05T00:29:10Z")

</div>

Hi, I have this simple scene with spotlight pointing down and a ShadowGenerator  
Every mesh casts shadows

[https://www.babylonjs-playground.com/#JPVT2W#1](https://www.babylonjs-playground.com/#JPVT2W#1)

The shadows are being generated all over the meshes.  
I can’t find a bias value that fixes the problem.  
For bias=0.01, it still shows a lighter shadow, but on all surfaces.  
For bias=0.1 no shadow is shown

It seems that the shadow is been generated before the surfaces

 ![selfshadow](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/4/4796ff625759a03e2ac917c249b47498d255d394.jpeg)

Any idea o what’s wrong?

---

<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:** [June 5, 2019, 11:07am UTC](https://forum.babylonjs.com/t/blur-exponential-shadowmaps-generating-a-self-shadow-that-cant-be-fixed-with-bias/3703/2 "2019-06-05T11:07:08Z")

</div>

Exponential shadow map might get really tricky to get self shadow, I would recommend to use percentage CloserFiltering: [https://www.babylonjs-playground.com/#JPVT2W#2](https://www.babylonjs-playground.com/#JPVT2W#2)

or PCSS in this case.

In case you really want to use ESM, you can try the close ESM instead : [https://www.babylonjs-playground.com/#JPVT2W#3](https://www.babylonjs-playground.com/#JPVT2W#3)

---

<div class="post-metadata">

**Author:** ![Federico\_Marino](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/federico_marino/32/2402_2.png) [@Federico\_Marino](https://forum.babylonjs.com/u/Federico_Marino)\
**Post date:** [June 5, 2019, 12:45pm UTC](https://forum.babylonjs.com/t/blur-exponential-shadowmaps-generating-a-self-shadow-that-cant-be-fixed-with-bias/3703/3 "2019-06-05T12:45:34Z")

</div>

Thanks.  
But they require webgl2 right?  
Is there any alternative that uses webgl1 and generates soft edges?

---

<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:** [June 5, 2019, 12:56pm UTC](https://forum.babylonjs.com/t/blur-exponential-shadowmaps-generating-a-self-shadow-that-cant-be-fixed-with-bias/3703/4 "2019-06-05T12:56:19Z")

</div>

yup the second playground I linked above using closeESM which was initially develop to workaround self shadowing in ESM
