<p>Well nevermind. I made some research and actually gonna:</p>

<ul>
<li>sample ESM using Poisson sampling in PCF fashion (thanks Bart Wronski for great Poisson Sample generator app) and extend this to PCSS technique (variable penumbra). Render to texture.</li>
<li>optionally depth aware blur to soften - EDIT not so fast this option doesnt work as expected, too bad. Instead rotating PCF kernel seem to work fine. </li>
</ul>

<p>And too bad not much of discussion here.</p>

CC BY-SA 3.0
2016-10-08T12:49:53.820Z
2016-10-08T21:47:30.660Z
2016-10-08T21:47:30.660Z
mdkdy
<p>Recently while searching of solving the shadow acne problem of traditional shadow mapping I implemented exponential shadow maps. It did the trick (no acne at all) but at the same time introduced other unacceptable errors.</p>
<p>For depth map blur I use gaussian blur with smallest sigma=1.</p>
<p>Test for shadow map:</p>
<pre><code>float occluder = texture(shadowMap lightCoords.xy).r;
float c = 5000.0;
float receiver = lightCoords.z;
float shadow = exp(c*(occluder-receiver));
shadow = clamp(shadow, 0.0, 1.0);
</code></pre>
<p>with small c factor <code>c=100.0</code>:</p>
<p><a href="https://i.sstatic.net/2EHPH.jpg" rel="noreferrer"><img src="https://i.sstatic.net/2EHPHm.jpg" alt="enter image description here" /></a></p>
<p>Unacceptable light bleeding</p>
<p>with high c factor <code>c=5000.0</code>:</p>
<p><a href="https://i.sstatic.net/BBYtJ.jpg" rel="noreferrer"><img src="https://i.sstatic.net/BBYtJm.jpg" alt="enter image description here" /></a></p>
<p>No light bleeding but high frequency detail appear &quot;swollen&quot;.</p>
<p>Cant find optimal c - light bleeding appear even at <code>c=3000.0</code> and high frequency shadow error is already there. Not blurring the depth map helps but then aliasing occurs.</p>
<p>And my question is - how can I improve this technique (ESM) or should I look for another? I think good quality shadows with nice performance are definitely possible - as seen in modern games like Witcher 3 or Fallout 4.</p>

<rendering><shadow>
searching for acceptable quality shadow mapping techniques
mdkdy
# searching for acceptable quality shadow mapping techniques

(Asked by: username_0 on 2016-10-06)

Recently while searching of solving the shadow acne problem of traditional shadow mapping I implemented exponential shadow maps. It did the trick (no acne at all) but at the same time introduced other unacceptable errors.

For depth map blur I use gaussian blur with smallest sigma=1.

Test for shadow map:

```
float occluder = texture(shadowMap lightCoords.xy).r;
float c = 5000.0;
float receiver = lightCoords.z;
float shadow = exp(c*(occluder-receiver));
shadow = clamp(shadow, 0.0, 1.0);

```

with small c factor `c=100.0`:

[![enter image description here](https://i.sstatic.net/2EHPHm.jpg)](https://i.sstatic.net/2EHPH.jpg)

Unacceptable light bleeding

with high c factor `c=5000.0`:

[![enter image description here](https://i.sstatic.net/BBYtJm.jpg)](https://i.sstatic.net/BBYtJ.jpg)

No light bleeding but high frequency detail appear "swollen".

Cant find optimal c - light bleeding appear even at `c=3000.0` and high frequency shadow error is already there. Not blurring the depth map helps but then aliasing occurs.

And my question is - how can I improve this technique (ESM) or should I look for another? I think good quality shadows with nice performance are definitely possible - as seen in modern games like Witcher 3 or Fallout 4.

**Tags:** rendering, shadow


---

## 1 answers

### Answer by username_0 on 2016-10-08. Score: 2

Well nevermind. I made some research and actually gonna:

* sample ESM using Poisson sampling in PCF fashion (thanks Bart Wronski for great Poisson Sample generator app) and extend this to PCSS technique (variable penumbra). Render to texture.
* optionally depth aware blur to soften - EDIT not so fast this option doesnt work as expected, too bad. Instead rotating PCF kernel seem to work fine.

And too bad not much of discussion here.


---

