View
215
Download
1
Tags:
Embed Size (px)
Citation preview
Perspective Shadow Maps
Marc StammingerREVES/INRIA, Sophia-Antipolis, France
now at: Bauhaus-Universität, Weimar, Germany
George DrettakisREVES/INRIA, Sophia-Antipolis, France
Generate shadow
Hard shadows algorithms-Which are binary.
For example, shadow volumes ,depth buffer,ray tracing
Soft shadows algorithms-Also display the
penumbra area around the central umbra shadow.
For example, radiosity
Generate shadow
Kevin Weiler and Peter Atherton, Siggraph ‘1977– Hidden Surface Removal Using Polygon Area
Sorting
Franklin C., Siggraph ‘1977– Shadow Algorithms for Computer
Graphics
Traditional Shadow Maps
Williams, Siggraph ‘1978– render scene from light source– shadowing by depth comparison
Adaptive shadow maps
T.Lokovic E.Vearch , Siggraph ‘2000– Deep Shadow Maps
Randima F. Sebastian F. Kavita B., Siggraph ‘2001– Adaptive Shadow Maps– Replace the flat ahsdow map with an
adaptive,hierarchical representation.
Adaptive shadow maps
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.
Introduction Method used to generate shadows: 1.clipping 2.shadow volumes These methods often suffer from robustness
problems due to the geometric computations required,and may also involve a significant rendering overhead.
Such algorithms are usually a preprocess,and are thus best suited to static scenes.
Introduction The paper by Lance Williams (Casting Curved
Shadows on Curved Surfaces) 1978 --“Shadow map“
Shadow Maps
The algorithm1.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.
shadow map aliasing
ds
rs
(L/2) * cosα
1
cos
1**
rs
cos*
1rsdsl
lds
cos
1**
rs
cos*
1rsdsl
lds
cos
1**
rs
cos*
1rsdsl
lds
shadow map aliasing
For an orthogonal view, d is proportional to ds*rs.
For directional light sources ,d is only dependent of ds/ri.
If d>di , shadow map aliasing happens.
shadow map aliasing
rs/ri is not close to a constant. cosβ /cosα become large. When the light rays are almost
parallel to a surface.
Situations
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.
perspective shadow map
shadow map in post-perspective space
just another shadow map projection
reduces perspective aliasing regeneration per frame necessary
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.
point light transformation
Point light on the plane through the view point which is perpendicular to the view direction ,become directional.
discussion
best case:– parallel light in
post-perspectivespace
– no new perspectivedistortion
post
-pers
pect
ive
w
orl
d s
pace
discussion
non-optimal case:– point light
close tofrustum
worst case:– becomes
uniformshadow map p
ost
-pers
pect
ive
w
orl
d s
pace
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.
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.
Including all objects Casting Shadows
When a line intersects the camera plane, where the intersection point is mapped to infinity.
Moving the center of projection back, so that we are behind the furthermost point which can cast a shadow into the view frustum.
This camera point displacement is only for the shadow map generation , not for rendering the image.
Point Rendering
Point Rendering is particularly well suited for natural objects.
For the generation of uniform shadow maps point rendering loses most of its benefits.
Perspective Shadow Map fits nicely with the point rendering.
conclusion
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