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

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

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

Any idea o what’s wrong?

Exponential shadow map might get really tricky to get self shadow, I would recommend to use percentage CloserFiltering:

or PCSS in this case.

In case you really want to use ESM, you can try the close ESM instead :

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

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

1 Like