Download presentation
Presentation is loading. Please wait.
1
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Practical Logarithmic Shadow Maps Brandon LloydUNC-CH Naga GovindarajuUNC-CH David TuftUNC-CH Steve MolnarNvidia Dinesh ManochaUNC-CH
2
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 2 Motivation Interactive shadow computation remains a challenge increasing scene complexity large, open environments user expect high quality
3
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 3 Shadow maps Simple two pass algorithm Supports wide range of geometric representations Cheap to render Disadvantage: Aliasing artifacts at shadow edges
4
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 4 Warping algorithms Perspective shadow maps (PSMs) [Stamminger and Drettakis 2002] Increase sample density where needed by reparametrizing the shadow map Trapezoidal shadow maps (TSMs) [Martin and Tan 2004] Light-space perspective shadow maps (LSPSMs) [Wimmer et al. 2004]
5
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 5 Comparison of parameterizations 4x4 projection matrixLogarithmic
6
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 6 Main results Logarithmic parameterization for directional and point lights Error analysis for point lights Hardware architecture enhancements for logarithmic rasterization
7
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 7 Outline Related work Aliasing error Logarithmic parameterization Hardware architecture Results
8
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 8 Partitioning algorithms Separate shadow maps for different parts of the scene Includes cascaded shadow maps Tiled shadow maps [Arvo 2004] Adaptive shadow maps [Fernando et al. 2001; Lefohn et al. 2006] Plural sunlight buffers [Tadamura et al. 1999,2001]
9
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 9 Warping + partitioning 4x4 matrix Lixel for every pixel [Chong and Gortler 2004] PSM with cube maps [Kozlov 2004] Warping + various frustum partitioning schemes [Lloyd et al. 2006] Dual paraboloid [Brabec et al. 2002]
10
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 10 Specialized representations Silhouette shadow maps [Sen et al. 2004] Irregular shadow maps [Johnson et al. 2004,2005; Aila and Laine 2004] Solves the aliasing problem GPU support requires major changes
11
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 11 Outline Related work Aliasing error Logarithmic parameterization Hardware architecture Results
12
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 12 Aliasing error shadow plane view frustum eye light
13
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 13 light beam 'wlwl 'wiwi 'wiwi 'wiwi 'wiwi Aliasing error 'wlwl image beam
14
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 14 wiwi wlwl light beam image beam θlθl θiθi 'wiwi Aliasing error 'wlwl m= 'wlwl 'wiwi cos θ l cos θ i wlwl wiwi Perspective aliasing cos θ l cos θ i Projection aliasing wlwl wiwi ≈
15
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 15 wiwi wlwl θlθl θiθi 'wiwi Aliasing error 'wlwl m= 'wlwl 'wiwi wlwl wiwi Perspective aliasing wlwl wiwi ≈ light beam image beam cos θ l cos θ i cos θ l cos θ i Projection aliasing
16
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 16 wiwi wlwl light beam image beam Controlling aliasing error To eliminate perspective aliasing: w l ≤ w i Light beam width depends on: Shadow map resolution Parameterization
17
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 17 Outline Related work Aliasing error Logarithmic parameterization Directional light Point light Hardware architecture Results
18
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 18 Parameterization Standard Perspective warped light image plane shadow map light
19
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 19 Directional light image beam light image plane t wlwl light z 1 wiwi 1. Light beam widths 2. Texel spacing function 3. Parameterization [Wimmer et al. 04]
20
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 20 Quadratic z beam width Uniform z beam width Linear z beam width Directional light With 4x4 matrix With logarithm
21
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 21 Comparison Standard Perspective Logarithmic frustum fov = 60 ○
22
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 22 Point lights light view frustum
23
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 23 Point lights light light image plane view frustum face z y w l ~ z
24
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 24 Point light spacing function - z face y z z y light
25
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 25 Point light spacing function - z face y light y z z
26
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 26 Point light spacing function - z face y light y z z
27
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 27 Point lights – parameterization
28
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 28 Fitting the spacing function - z Parameterization for exact function is complicated Fit two parabolas: Parameterization: 0 z Point light spacing function
29
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 29 4x4 matrix + logarithm v c : [x c z c y c w c ] T - clip coordinate v n : [x n z n y n 1] T - normalized device coordinate v : [x z y 1] T - world coordinate P : perspective or orthographic projection matrix a 0 -a 3 : constants b 0 -b 3 : constants To screen coordinates s= a 0 ln( a 1 x n + a 2 ) + a 3 t= b 0 ln( b 1 z n + b 2 ) + b 3 To NDC coords. v c = P v v n = v c /w c
30
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 30 Parameterization summary DirectionalPoint x: z: without logwith log ortho. persp. Actual spacing functions Spacing functions from 4x4 matrix + log
31
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 31 Outline Related work Aliasing error Logarithmic parameterization Hardware architecture Results
32
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 32 Logarithmic parameterization Unwarped view frustum
33
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 33 Vertex program Transform vertices on the GPU Requires finely tesselated model Increases burden on vertex processor Adaptive tesselation complicated Easier with DX10 geometry shaders
34
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 34 Fragment program Brute force rasterization Render bounding primitive Transform fragments to original triangle Discard if not inside 10x slow down Computing bounding primitive is complicated Easier with DX10 geometry shaders
35
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 35 Graphics pipeline fragment processor vertex processor rasterizer alpha, stencil, & depth tests blending clip & back-face cull memory interface depth compression color compression
36
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 36 Rasterizing equations Coverage determination use sign of edge distance equations Attribute interpolation depth, color, texture coordinates, etc.
37
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 37 Rasterizing equations Parameterization: Edge distance and attribute interpolation:
38
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 38 Incremental computation 1 MULT + 2 ADD per step
39
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 39 Depth compression First orderSecond order Compressed tiles shown in red
40
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 40 Feasibility Current hardware trend Computational power increasing rapidly Bandwidth lags behind Log shadow maps Increase computation Reduce memory/bandwidth consumption
41
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 41 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]
42
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 42 Outline Previous work Aliasing error Logarithmic parameterization Hardware implementation Results
43
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 43 Results Power plant 13 Mtris Oil tanker 82 Mtris Town scene 59 Ktris
44
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 44 Results StandardPerspective warping Logarithmic
45
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 45 Results Perspective warpingLogarithmic
46
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 46 Results Perspective warpingLogarithmic
47
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 47 Comparison to z-partitioning Perspective with k z-partitions Logarithmic
48
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 48 Results z-partitioning (k=4)Logarithmic
49
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 49 Results
50
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 50 Results Perspective warpingLogarithmic
51
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 51 Results Perspective warpingLogarithmic
52
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 52 Results – Point lights StandardPerspective warping Logarithmic high error
53
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 53 Advantages Logarithmic shadow maps require less bandwidth and storage Smoother parameterization than z-partitioning
54
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 54 Disadvantages Does not handle projection aliasing Requires multiple shadow maps Up to 5 directional light Up to 4 per frustum face for point light Warped depth values
55
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 55 Conclusion Logarithmic parameterization Lower error than previous methods Hardware architecture for log rasterization Requires only small enhancements to current graphics hardware Exploits current hardware trends
56
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 56 Future work More details for hardware implementation precision requirements filtering shadow map bias Other applications for nonlinear rasterization
57
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 57 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
58
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 58 Questions? http://gamma.cs.unc.edu/logsm
59
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 59 Coordinate systems view y z x warping frustum view frustum light shadow map t s Light space [Wimmer et al. 04] z x
60
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 60 Directional light - general case Highest error ( w l /w i ) occurs at the faces Partition frustum to handle each face separately wlwl light shadow map t z
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.