Perspective Shadow Maps Marc Stamminger and George Drettakis Speaker: Alvin Date: 5/28/2003 SIGGRAPH 2002
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps2 Outline – Shadow Maps – Shadow Map Aliasing – Frame Works – Light Sources – Point Rendering – Result – Conclusion
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps3 Shadow Maps [Williams78] Casting curved shadows on curved surfaces – Image-space algorithm – Well suited for hardware implementation
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps4 Shadow Maps Algorithm – Render scene as seen from light source – Save back depth buffer (2D shadow map) – Render scene from viewer ’ s position Transform pixel coordinates to light source space Compare z with z value stored in shadow map – Pixel is in shadow if z(light) < z(viewer)
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps5 Outline – Shadow Maps – Perspective Aliasing – Frame Works – Light Sources – Point Rendering – Result – Conclusion
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps6 Perspective aliasing
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps7 Outline – Shadow Maps – Perspective Aliasing – Frame Works – Light Sources – Point Rendering – Result – Conclusion
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps8 Idea uniform shadow map perspective shadow map
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps9 Idea uniform shadow map perspective shadow map
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps10 Frame Works – Map the scene to post-perspective space. – Generate a standard shadow map in this space by rendering a view from the transformed light source to the unit cube.
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps11 Including Objects Casting Shadows S: The bounding box of the scene objects. V: The viewing frustum. L: The light frustum. l: The light source. M: Contain all rays from the points in V to l. H: M ۸ S ۸ L
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps12 Shadows From Behind ► ► Virtually move camera backwards
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps13 Outline – Shadow Maps – Perspective Aliasing – Frame Works – Light Sources – Point Rendering – Result – Conclusion
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps14 Light Sources – Parallel light transformation – Point light transformation In this paper, point lights means spot lights. – Discussion
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps15 Parallel Light Transformation – Parallel light becomes point light at infinity. – Perspective mapping can move these source to a infinity position. z = (far+near)/(far-near) – A directional light source from behind is mapped to a “ inverted ” point light source. – Inverted point can be handle as hit point furthest from the point source survive.
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps16 Parallel Light Transformation
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps17 Point light transformation – Point light sources in front of the viewer remain point lights. – Point light sources behind the viewer are mapped beyond the infinity plane and becomes inverted. – Point light sources on the plane which is perpendicular to the view direction become directional.
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps18 Point light transformation
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps19 Discussion – Worst case: Become uniform shadow map. – Best case: – Parallel light in post- perspective space. – No new perspective distortion.
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps20 Near Plane Selection – Near plane as far as possible – Automatic selection: reading back depth buffer.
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps21 Outline – Shadow Maps – Perspective Aliasing – Frame Works – Light Sources – Point Rendering – Result – Conclusion
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps22 Point Rendering Not suited for uniform Shadow Map. – Not suited for uniform Shadow Map. A very large, dense point set needs to be generated frequently. Well suited for Perspective Shadow Map. – Well suited for Perspective Shadow Map. – Point clouds have uniform point density. – Point clouds have uniform point density. – Assume the point densities are uniform. – Assume the point densities are uniform. – Easy to select the splat size to avoid holes. – Easy to select the splat size to avoid holes.
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps23 Outline – Shadow Maps – Perspective Aliasing – Frame Works – Light Sources – Point Rendering – Result – Conclusion
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps24 Result
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps25 Result With shadow maps of size 1024*1024. FPS = 15
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps26 Result With shadow maps of size 1024*1024. FPS = 10
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps27 Result With shadow maps of size 1024*1024. FPS = 10
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps28 Result With shadow maps of size 1024*1024. FPS = 10
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps29 Result no shadows 20 million triangles, FPS = 1
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps30 Result no shadows 20 million triangles, FPS = 1
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps31 Result no shadows 20 million triangles, FPS = 0.83
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps32 Demo
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps33 Outline – Shadow Maps – Perspective Aliasing – Frame Works – Light Sources – Point Rendering – Result – Conclusion
Alivn/GAME LAB/CSIE/NDHUPrespective Shadow Maps34 Conclusion Perspective Shadow Maps – Shadow map in post-perspective space – View-dependent – Easy for hardware support – Needs recomputation per frame – Minimal overhead for dynamic scenes