Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Brandon Lloyd Naga Govindaraju David Tuft Steve Molnar Dinesh Manocha UNC-CH UNC-CH UNC-CH Nvidia UNC-CH
Motivation
Interactive shadow computation remains a challenge
increasing scene complexity large, open environments user expect high quality
Shadow maps
Simple two pass algorithm Supports wide range of geometric representations Cheap to render Disadvantage: Aliasing artifacts at shadow edges
3 The UNIVERSITY of NORTH CAROLINA at CHAPEL
Warping algorithms
Increase sample density where needed by reparametrizing the shadow map
Light-space perspective shadow maps (LSPSMs) [Wimmer et al. 2004]
Comparison of parameterizations
Logarithmic
The UNIVERSITY of NORTH CAROLINA at CHAPEL
Main results
Logarithmic parameterization for directional and point lights Error analysis for point lights Hardware architecture enhancements for logarithmic rasterization
6
Outline
Related work Aliasing error Logarithmic parameterization Hardware architecture Results
Partitioning algorithms
Separate shadow maps for different parts of the scene Includes cascaded shadow maps
Warping + partitioning
4x4 matrix
Lixel for every pixel
[Chong and Gortler 2004] [Kozlov 2004]
PSM with cube maps Warping + various frustum partitioning schemes [Lloyd et al. 2006]
Dual paraboloid
Specialized representations
Silhouette shadow maps
[Sen et al. 2004]
10
Outline
Related work Aliasing error Logarithmic parameterization Hardware architecture Results
11
Aliasing error
light
shadow plane
Aliasing error
light beam
image beam
w'i
w'l
13
Aliasing error
light beam image beam
wl l
i wi w'i w'l
cos i cos l
Projection aliasing
14
Aliasing error
light beam image beam
wl l
i wi w'i w'l
cos i cos l
Projection aliasing
15
wl wi
wl wi
16
Outline
Related work Aliasing error Logarithmic parameterization
Directional light Point light
Parameterization
light light image plane light
shadow map
shadow map
Standard
18
Perspective warped
The UNIVERSITY of NORTH CAROLINA at CHAPEL
Directional light
light
t z
1
light image plane
3. Parameterization
wl
[Wimmer et al. 04] 19
wi
image beam
Directional light
With 4x4 matrix
Uniform
beam width
With logarithm
Linear
z
Quadratic
beam width
beam width
z z
20
Comparison
Shadow maptexels / image texels
10
8
Standard
10
10
Perspective
10
Logarithmic
10
0
10
10
10
10
f/n
21
frustum fov = 60
Point lights
light
view frustum
22
Point lights
light
y z
23
wl ~ z
view frustum face
The UNIVERSITY of NORTH CAROLINA at CHAPEL
y ylight z
face z
24
y ylight z
face z
25
y ylight z
face z
26
27
Parameterization:
z
28
vc = P v vn= vc /wc
vc : vn : v:
- clip -
P:
perspective or orthographic
Parameterization summary
Spacing functions from 4x4 matrix + log
without log with log Directional x: Point
z:
30
persp.
ortho.
Outline
Related work Aliasing error Logarithmic parameterization Hardware architecture Results
31
Logarithmic parameterization
view frustum
Unwarped
32
Vertex program
Transform vertices on the GPU Requires finely tesselated model
Increases burden on vertex processor
33
Fragment program
Brute force rasterization
Render bounding primitive Transform fragments to original triangle Discard if not inside
34
Graphics pipeline
vertex processor clip & back-face cull rasterizer fragment processor alpha, stencil, & depth tests blending
35
Rasterizing equations
Coverage determination
use sign of edge distance equations
Attribute interpolation
depth, color, texture coordinates, etc.
36
Rasterizing equations
Edge distance and attribute interpolation:
Parameterization:
37
Incremental computation
Depth compression
First order
Second order
Feasibility
Current hardware trend
Computational power increasing rapidly Bandwidth lags behind
40
Nonlinear rasterization
Configurable rasterizer Other rasterization functions are possible Might be useful for other effects
Reflections, refractions, caustics, general multi-view perspective [Hou et
al. 06]
41
Outline
Previous work Aliasing error Logarithmic parameterization Hardware implementation Results
42
Results
Power plant
13 Mtris
Oil tanker
82 Mtris
Town scene
59 Ktris
43
Results
Standard
44
Results
Perspective warping
45
Logarithmic
The UNIVERSITY of NORTH CAROLINA at CHAPEL
Results
Perspective warping
46
Logarithmic
The UNIVERSITY of NORTH CAROLINA at CHAPEL
Comparison to zpartitioning
Shadow map texels / image texels
10
8
k=1
10
10
k=2
10
k=4 k=8
Logarithmic
10
10
10
10
10
f/n
47
Results
z-partitioning (k=4)
48
Logarithmic
The UNIVERSITY of NORTH CAROLINA at CHAPEL
Results
49
Results
Perspective warping
50
Logarithmic
The UNIVERSITY of NORTH CAROLINA at CHAPEL
Results
Perspective warping
51
Logarithmic
The UNIVERSITY of NORTH CAROLINA at CHAPEL
high error
52
Advantages
Logarithmic shadow maps require less bandwidth and storage Smoother parameterization than z-partitioning
53
Disadvantages
Does not handle projection aliasing Requires multiple shadow maps
Up to 5 directional light Up to 4 per frustum face for point light
Conclusion
Logarithmic parameterization
Lower error than previous methods
55
Future work
More details for hardware implementation
precision requirements filtering shadow map bias
56
Acknowledgements
Aaron Lefohn for the town model Supported in part by:
NSF Graduate Fellowship ARO Contracts DAAD19-02-1-0390 and W911NF-04-1-0088 NSF awards 0400134 and 0118743 ONR Contract N00014-01-1-0496 DARPA/RDECOM Contract N61339-04-C-0043 Intel
57
Questions?
http://gamma.cs.unc.edu/logsm
58
Coordinate systems
light
y z x
view
warping frustum
shadow map
zt s x
view frustum
Light space
59
Highest error (wl /wi) occurs at the faces Partition frustum to handle each face separately
wl
60