Presentation is loading. Please wait.

Presentation is loading. Please wait.

Robust Shadow Maps for Large Environments

Similar presentations


Presentation on theme: "Robust Shadow Maps for Large Environments"— Presentation transcript:

1 Robust Shadow Maps for Large Environments
Daniel Scherzer Hi! I‘m Daniel Scherzer from the Vienna Univerersity of Technology and today I want to talk about: „Robust shadow maps for large environments“ Institute of Computer Graphics and Algorithms Vienna University of Technology

2 Motivation: The Challenge
Huge and dynamic environments More than 100,000 visible triangles Automatic shadow generation No artifacts? Let’s think of a real challenge for shadow generation. We may think of an environment which has huge extents and thousends of objects. As a result of this we may have 100,000 or more visible triangles. We want every object to be a possible dynamic shadow caster or shadow receiver. And we want to do this automatic without any need for a user intervention. And of course we want to achive this without noticable artifacts. Daniel Scherzer

3 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 As the title of the talk already suggests we used shadow maps to conquer the given challenge. Shadow maps where choosen because they offer great independence of the scene complexity And as a result are not as easily fill-rate limited as shadow volumes for the case of many polygons. They also need only one additional depth only render pass. The also can handle self-shadowing and arbitrary caster/receiver constellations. Daniel Scherzer

4 Shadow Map Algorithm: Second Pass
Shadow Map Algorithm: First Pass Light Eye 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 In the second pass you render the scene from the eyes point-of-view and for each fragment you transform this fragment into light space and in light space you compare the depth values of the eye-fragment and the shadow map texel at this position. and if the depth of the eye fragment is bigger than the fragment is in shadow because its farther away than the texel seen from the light source. Daniel Scherzer

5 Problem: Perspective aliasing
Sufficient resolution far from the observer Insufficient resolution near the observer okay aliased Daniel Scherzer

6 Problem: Projection aliasing
Receivers ~ perpendicular to shadow plane With receivers ruffly perpendicular to the shadow plane we have stored little information in the shadow map. From the observers point of view this can lead to very noticable artefacts caused by projection aliasing. Daniel Scherzer

7 Problem: Self-(un)shadowing
Polygon Observers‘s distance > shadow depth Incorrect self-shadowing Daniel Scherzer

8 Problems of Shadow Maps
Cause Sample Error Perspective aliasing Insufficient resolution near the observer Projection aliasing Insufficient resolution on polygons almost parallel to the light direction Self-(un) shadowing Moiré-patterns Daniel Scherzer

9 Solution: Perspective aliasing
Insufficient resolution near the observer aliased okay Daniel Scherzer

10 Solution: Perspective aliasing
Insufficient resolution near the observer Redistribute shadow map samples Daniel Scherzer

11 Solution: Perspective aliasing
Sufficient resolution near the observer Redistribute shadow map samples still okay okay now Daniel Scherzer

12 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

13 Solution: Projection aliasing
Receivers ~ perpendicular to shadow plane Redistribution doesn‘t work But! With receivers ruffly perpendicular to the shadow plane we have stored little information in the shadow map. From the observers point of view this can lead to very noticable artefacts caused by projection aliasing. Daniel Scherzer

14 Solution: Projection aliasing
Diffuse lighting: I = IL max( dot( L, N ), 0 ) ~ perpendicular receivers have small I Dark Hides artefacts! L N Daniel Scherzer

15 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

16 Solution: Projection aliasing
Screen-space blur of shadows Hides artefacts Shadows get softer Daniel Scherzer

17 Problem: Self-(un)shadowing
Polygon Biased polygon Observers‘s distance > shadow depth Incorrect self-shadowing Observer‘s distance < shadow depth Self-shadowing eliminated Daniel Scherzer

18 Solution: Self-(un)shadowing
How do we choose the bias? No biasing Constant biasing Slope-scale biasing Daniel Scherzer

19 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 Another problem occurs for spot lights and for techniques to reduce the perspective aliasing, because here we have a perspective Z. Daniel Scherzer

20 Solution: Self-(un)shadowing
Other possibility to avoid self-shadowing: Normally we use the front-side polygons Now we use the back-side polygons Only works with watertight models Daniel Scherzer

21 Conclusions Cause Sample Solution Perspective aliasing
Perspective Transformation (LispSM) Projection aliasing Blurring, light-model Self-(un) shadowing Biasing, back-side rendering Daniel Scherzer

22 Putting It All Together
Daniel Scherzer


Download ppt "Robust Shadow Maps for Large Environments"

Similar presentations


Ads by Google