PDA

View Full Version : Shadows maps refinement



devdept
09-29-2011, 02:37 AM
Hi All,

You all know shadow maps bigger limit: zooming closer to the geometry you see those ugly staircases!

We are trying to refine the map as you zoom closer to the geometry and getting very promising results?

The problem?

Computing on the fly the proper size of the chunk of the scene inside the frustum to get the texture properly sized.

Do you know if this problems has already been studied from somebody else? Shall we take the depth buffer or geometric approach?

Thanks in advance,

Alberto.

ZbuffeR
09-29-2011, 04:41 AM
Cascading shadow maps and Parallel-Split Shadow Maps are ways to increase the shadow resolution where needed :
http://http.developer.nvidia.com/GPUGems3/gpugems3_ch10.html

PCF can also help to reduce visible staircase, replaced by more blurry shadows.

I suggest you read this list of techniques :
http://en.wikipedia.org/wiki/Shadow_mapping#Shadow_mapping_techniques

Dark Photon
09-29-2011, 04:54 AM
The problem? Computing on the fly the proper size of the chunk of the scene inside the frustum to get the texture properly sized. Do you know if this problems has already been studied from somebody else?
Yes. What it sounds like you want is Sample Distribution Shadow Maps (http://visual-computing.intel-research.net/art/publications/sdsm/) (SDSM). This is a bolt-on to basic Cascaded/Parallel-Split Shadow Maps to help you position and size your maps. Basically pre-render a depth map of the scene. Then crunch that quickly on the GPU (with OpenCL/CUDA kernel or via GLSL shaders) to determine where you need shadow map coverage. Briefly mentioned a few bits of my experience with this here (http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=303444&Searchpa ge=1&Main=58465&Words=sdsm&Search=true#Post303444) .

Yeah, the tricky thing with large zooms (narrow frustums) is that it makes the frustum splits very long and very thin, which doesn't work well for fitting shadow maps to. You need a quick way to wack off all the "dead space" that doesn't have any shadow receivers in it so you don't waste shadow map res in those areas and focus your res precisely on the area(s) you need.

As a first-cut, you can use cull results to provide a rough bounds to your scene, but in this day in age (with spatially large batches and near-free triangle culling on the GPU), the "rough" is the killer. In my experience, this ends up being way too course to maximize use of your shadow resolution. You need finer bounds on your rendered fragments, and that's what SDSM gives you.

devdept
09-29-2011, 05:10 AM
Thanks guys, these articles will for sure help us computing this volume.

Thanks so much again!

Alberto