How to get completely rid of shadow acne and erroneous self shadowing?

落爺英雄遲暮 提交于 2019-12-08 03:39:59

问题


I'm doing Simple Shadow Mapping and have problems with handling shadow acne and erroneous self shadowing and just can't get rid of it. I already tried adding a bias to the depth value and rendering back faces to the depth buffer, but it doesn't remove all artifacts. I also have problems choosing the right bias which leads to Peter Panning.

Here I have some screenshots.

So my questions are:

  1. Is there a robust (and easy) way to completely eliminate shadow acne and erroneous self shadowing?

  2. How to choose the perfect bias?


回答1:


There's a technique called variance shadow maps which is subject to its own peculiar artifacts, but which is very good at eliminating shadow acne and erroneous self-shadowing. It was designed as a nonlinear filter for shadow maps, to avoid jaggies due to low resolution.

Briefly, it estimates the variance of the depth map, and uses that to find a smooth, conservative estimate of shadowing vs. depth. You need to be careful about buffer precision, as most implementations seem to evaluate the variance in ways that abuse their dynamic range.



来源:https://stackoverflow.com/questions/12539869/how-to-get-completely-rid-of-shadow-acne-and-erroneous-self-shadowing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!