220 likes | 230 Views
This paper discusses the challenge of generating automatic shadows in huge and dynamic environments with more than 100,000 visible triangles, and proposes a robust shadow map algorithm that handles self-shadowing and arbitrary caster/receiver constellations.
E N D
Robust Shadow Maps for Large Environments Daniel Scherzer Institute of Computer Graphics and Algorithms Vienna University of Technology
Motivation: The Challenge • Huge and dynamic environments • More than 100,000 visible triangles • Automatic shadow generation • No artifacts? Daniel Scherzer
Motivation: Why Shadow Maps? • Independent of scene complexity • Not as fill-rate limited with many polygons as shadow volumes • Only one additional (depth only) render pass • Handle self-shadowing correctly • Handle arbitrary caster/receiver constellations Daniel Scherzer
Eye Shadow Map Algorithm: Second Pass Shadow Map Algorithm: First Pass Light Eye-view Shadow map • Render scene from light-view and save depth values • Render scene from eye-view • Transform each fragment to light source space • Compare zeye with zlight value stored in shadow map • zeye > zlight fragment is in shadow Daniel Scherzer
aliased okay Problem: Perspective aliasing • Sufficient resolution far from the observer • Insufficient resolution near the observer Daniel Scherzer
Problem: Projection aliasing • Receivers ~ perpendicular to shadow plane Daniel Scherzer
Observers‘s distance > shadow depth Incorrect self-shadowing Problem: Self-(un)shadowing Polygon Daniel Scherzer
Problems of Shadow Maps Daniel Scherzer
Insufficient resolution near the observer okay aliased Solution: Perspective aliasing Daniel Scherzer
Insufficient resolution near the observer Redistribute shadow map samples Solution: Perspective aliasing Daniel Scherzer
Sufficient resolution near the observer Redistribute shadow map samples okay now still okay Solution: Perspective aliasing Daniel Scherzer
Solution: Perspective aliasing • How do we redistribute the shadow map samples? • Using a perspective transformation • Just another perspective matrix • During shadow map generation • During rendering • For further details see[WSP2004] [WSP2004] M. Wimmer, D. Scherzer, and W. Purgathofer; Light space perspective shadow maps; In Proceedings of Eurographics Symposium on Rendering 2004 Daniel Scherzer
Solution: Projection aliasing • Receivers ~ perpendicular to shadow plane • Redistribution doesn‘t work • But! Daniel Scherzer
N L Solution: Projection aliasing • Diffuse lighting: I = IL max( dot( L, N ), 0 ) • ~ perpendicular receivers have small I • Dark Hides artefacts! Daniel Scherzer
Solution: Projection aliasing • Guidelines for the light- source • Small ambient term • Diffuse is good for hiding artefacts • Specular is no problem • Light direction and view direction nearly the same • Resolution in shadow map suffices Daniel Scherzer
Solution: Projection aliasing • Screen-space blur of shadows • Hides artefacts • Shadows get softer Daniel Scherzer
Polygon Biased polygon Observer‘s distance < shadow depth Self-shadowing eliminated Observers‘s distance > shadow depth Incorrect self-shadowing Problem: Self-(un)shadowing Daniel Scherzer
Slope-scale biasing Constant biasing No biasing Solution: Self-(un)shadowing • How do we choose the bias? Daniel Scherzer
Solution: Self-(un)shadowing • How do we choose the bias? • Perspective Z is hyperbolic, not linear! • Normal Slope-scale doesn’t work • Do slope-scale biasing • On the post-projective Z-slope • Or calculate linear Z with vertex shader Daniel Scherzer
Solution: Self-(un)shadowing • Other possibility to avoid self-shadowing: Normally we use the front-side polygons Now we use the back-side polygons Daniel Scherzer
Conclusions Daniel Scherzer
Putting It All Together Daniel Scherzer