Download presentation
Presentation is loading. Please wait.
1
Perspective Shadow Maps Marc Stamminger REVES/INRIA, Sophia-Antipolis, France now at: Bauhaus-Universität, Weimar, Germany George Drettakis REVES/INRIA, Sophia-Antipolis, France
2
Generate shadow n Hard shadows algorithms-Which are binary. For example, shadow volumes,depth buffer,ray tracing n Soft shadows algorithms-Also display the penumbra area around the central umbra shadow. For example, radiosity
3
Generate shadow Ray TracingRadiosity
4
Generate shadow n Kevin Weiler and Peter Atherton, Siggraph ‘1977 –Hidden Surface Removal Using Polygon Area Sorting n Franklin C., Siggraph ‘1977 –Shadow Algorithms for Computer Graphics
5
Traditional Shadow Maps n Williams, Siggraph ‘1978 –render scene from light source –shadowing by depth comparison
6
Adaptive shadow maps n T.Lokovic E.Vearch, Siggraph ‘2000 –Deep Shadow Maps n Randima F. Sebastian F. Kavita B., Siggraph ‘2001 –Adaptive Shadow Maps –Replace the flat ahsdow map with an adaptive,hierarchical representation.
7
Adaptive shadow maps n drawback: By using multiple shadow maps,several rendering passes are required,and due to the more involved data structures,the methods no longer map to hardware.
8
Adaptive shadow maps
9
Introduction n Method used to generate shadows: 1.clipping 2.shadow volumes n These methods often suffer from robustness problems due to the geometric computations required,and may also involve a significant rendering overhead. n Such algorithms are usually a preprocess,and are thus best suited to static scenes.
10
Introduction n The paper by Lance Williams (Casting Curved Shadows on Curved Surfaces) 1978 -- “ Shadow map “
11
Shadow Maps n The algorithm 1.The depth values for the objects closest to the source are stored to the depth map for each point. 2.As each point is generated into the obsevers view,it is transformed into the light source’s coordinate system and tested for visibility.
12
Result
13
shadow map aliasing View frustum is for obsever Light frustum is for light source
14
shadow map aliasing N N
15
N α α L/2 dsds rsrs 1
16
shadow map aliasing dsds rsrs (L/2) * cos α 1
17
shadow map aliasing N d L/2 β β 1 rsrs
18
shadow map aliasing
19
For an orthogonal view, d is proportional to d s* r s. For directional light sources,d is only dependent of d s /r i. If d>di, shadow map aliasing happens.
20
shadow map aliasing n r s /r i is not close to a constant. n cos β /cosα become large. When the light rays are almost parallel to a surface. Situations
21
shadow map aliasing n prone to aliasing when zooming into shadow boundaries single shadow map pixel
22
shadow map aliasing n perspective aliasing parallel light okayaliased okay
23
shadow map aliasing n perspective aliasing –smooth transition aliased oversampled
24
shadow map aliasing n projection aliasing parallel light
25
shadow map aliasing n projection aliasing –very local aliased oversampled
26
Perspective shadow maps Step 1. Mapping the scene to post-perspective space. 2. Generating a standard shadow map by rendering a view from the transformed light source to the unit cube.
27
perspective transformation World space Observer f n (Camera distance)
28
perspective transformation post-perspective world space
29
perspective shadow map n standard shadow map n perspective shadow map shadow map image
30
perspective shadow map n standard shadow map n perspective shadow map aliased oversampled
31
perspective shadow map n shadow map in post-perspective space n just another shadow map projection n reduces perspective aliasing n regeneration per frame necessary
32
parallel light transformation post-perspective world space
33
parallel light transformation 1. Directional light sources can be considered as point lights at infinity plane. 2. The infinity plane is at: z=(f + n) / (f - n) 3. A directional light source from behind is mapped to a “inverted” point light source. 4. A directional light parallel to the image plane remains at infinity.
34
point light transformation post-perspective world space frontback
35
point light transformation n Point light on the plane through the view point which is perpendicular to the view direction,become directional.
36
discussion n best case: –parallel light in post-perspective space –no new perspective distortion post-perspective world space
37
discussion n non-optimal case: –point light close to frustum n worst case: –becomes uniform shadow map post-perspective world space
38
discussion A common problem in shadow maps is the bias necessary to avoid self-occlusion or surface acne. This problem is increased for perspective shadow maps,because objects are scaled non-uniformly.
39
Including all objects Casting Shadows The shadow map must contain all objects within that frustum plus all potential occluders outside the frustum that can cast a shadow onto any visible object.
40
shadow map window n geometric method to include all necessary objects
41
Including all objects Casting Shadows In World Space
42
Including all objects Casting Shadows In Post-perspective Space
43
Including all objects Casting Shadows n When a line intersects the camera plane, where the intersection point is mapped to infinity. n Moving the center of projection back, so that we are behind the furthermost point which can cast a shadow into the view frustum. n This camera point displacement is only for the shadow map generation, not for rendering the image.
44
Point Rendering n Point Rendering is particularly well suited for natural objects. n For the generation of uniform shadow maps point rendering loses most of its benefits. n Perspective Shadow Map fits nicely with the point rendering.
45
results
46
n first implementation on an Xbox game developer kit courtesy of Thatcher Ulrich
47
results
49
No shadowsUniform shadow map
50
results Perspective shadow map
51
conclusion n perspective shadow maps –shadow map in post-perspective space –just another shadow map matrix –non-uniform shadow map resolution –needs recomputation per frame –minimal overhead for dynamic scenes
52
報告完畢
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.