Download presentation
Presentation is loading. Please wait.
Published byCamilla Mitchell Modified over 9 years ago
1
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Practical logarithmic rasterization for low error shadow maps Brandon LloydUNC-CH Naga GovindarajuMicrosoft Steve MolnarNVIDIA Dinesh ManochaUNC-CH
2
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 2 Shadows Shadows are important aid spatial reasoning enhance realism can be used for dramatic effect High quality shadows for real-time applications remains a challenge
3
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 3 Shadow approaches Raytracing [Whitted 1980] not yet real-time for complex, dynamic scenes at high resolutions Shadow volumes [Crow 1977] can exhibit poor performance on complex scenes
4
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 4 Light Eye Shadow maps [Williams 1978]
5
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 5 Logarithmic perspective shadow maps (LogPSMs) [Lloyd et al. 2007] Standard shadow mapLogPSM
6
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 6 Logarithmic perspective shadow maps (LogPSMs) [Lloyd et al. 2007] Standard shadow mapLogPSM
7
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 7 Goal linear rasterizationlogarithmic rasterization Perform logarithmic rasterization at rates comparable to linear rasterization
8
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 8 Outline Background Handling aliasing error LogPSMs Hardware enhancements Conclusion and Future work
9
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 9 High resolution shadow maps Requires more bandwidth Decreases shadow map rendering performance Requires more storage Increased contention for limited GPU memory Decreased cache coherence Decreases image rendering performance Poor shadow map query locality
10
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 10 Sample at shadow map query positions No aliasing Uses irregular data structures requires fundamental changes to graphics hardware [Johnson et al. 2005] Irregular z-buffer [Aila and Laine 2004; Johnson et al. 2004]
11
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 11 Adaptive partitioning Adaptive shadow maps [Fernando et al. 2001] Queried virtual shadow maps [Geigl and Wimmer 2007] Fitted virtual shadow maps [Geigl and Wimmer 2007] Resolution matched shadow maps [Lefohn et al. 2007] Multiple shadow frusta [Forsyth 2006]
12
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 12 Adaptive partitioning Requires scene analysis Uses many rendering passes
13
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 13 Scene-independent schemes Match spacing between eye samples Faster than adaptive partitioning no scene analysis few render passes eye sample spacing
14
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 14 Cascaded shadow maps [Engel 2007] Parallel split shadow maps [Zhang et al. 2006] Cascade shadow maps
15
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 15 Projective warping Perspective shadow maps (PSMs) [Stamminger and Drettakis 2002] Light-space perspective shadow maps (LiSPSMs) [Wimmer et al. 2004] Trapezoidal shadow maps (TSMs) [Martin and Tan 2004] Lixel for every pixel [Chong and Gortler 2004]
16
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 16 Projective warping Not necessarily the best spacing distribution PSM LiSPSM high error low error moderate error y x
17
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 17 Logarithmic+perspective parameterization Perspective projection Logarithmic transform Resolution redistribution
18
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 18 Size of the shadow map* required to remove aliasing error (ignoring surface orientation) Uniform Perspective Logarithmic + perspective Bandwidth/storage savings - near and far plane distances of view frustum *shadow map texels / image pixels
19
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 19 Single shadow map LogPSM LogPSMs have lower maximum error more uniform error Image resolution: 512 2 Shadow map resolution: 1024 2 f/n = 300 Grid lines for every 10 shadow map texels Color coding for maximum texel extent in image LiSPSM LogPSM LiSPSM LogPSM
20
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 20 Comparisons
21
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 21 More details Logarithmic perspective shadow maps UNC TR07-005 http://gamma.cs.unc.edu/logpsm
22
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 22 Outline Background Hardware enhancements rasterization to nonuniform grid generalized polygon offset depth compression Conclusion and Future work
23
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 23 Graphics pipeline fragment processor vertex processor rasterizer alpha, stencil, & depth tests blending clipping memory interface depth compression color compression setup
24
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 24 Rasterization Coverage determination coarse stage– compute covered tiles fine stage – compute covered pixels Attribute interpolation interpolate from vertices depth, color, texture coordinates, etc.
25
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 25 Signs used to compute coverage Water-tight rasterization Use fixed-point fixed-point “snaps” sample locations to an underlying uniform grid Edge equations +++ -++ +-+ ++-
26
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 26 Attribute interpolation Same form as edge equations:
27
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 27 Logarithmic rasterization light spacelinear shadow map space warped shadow map space Linear rasterization with nonuniform grid locations. y x y'y' x
28
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 28 Edge and interpolation equations Monotonic existing tile traversal algorithms still work optimizations like z-min/z-max culling still work
29
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 29 Coverage determination for a tile Full parallel implementation Full evaluation
30
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 30 Per-triangle constants Coverage determination for a tile Incremental in x Full evaluation Incremental x 12
31
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 31 Generalized polygon offset texel width - depth slope - smallest representable depth difference constant light
32
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 32 Generalized polygon offset texel width - depth slope - smallest representable depth difference constant not constant light
33
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 33 Generalized polygon offset Do max per pixel Split polygon Interpolate max at end points
34
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 34 Depth compression Important for reducing memory bandwidth requirements Exploits planarity of depth values Depth compression survey [Hasselgren and Möller 2006] depth compressor tile tile table store compressed yes store uncompressed no fits in bit budget?
35
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 35 Depth compression - Standard compressed untouched clamped Linear depth compressionOur depth compression Resolution: 512x512
36
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 36 Depth compression - LiSPSM compressed untouched clamped Linear depth compressionOur depth compression Resolution: 512x512
37
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 37 Depth compression - LogPSM compressed untouched clamped Linear depth compressionOur depth compression Resolution: 512x512
38
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 38 Depth compression – LogPSM Higher resolution compressed untouched clamped Linear depth compressionOur depth compression low curvature Resolution: 1024x1024
39
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 39 ΔxΔxΔxΔxΔxΔx ΔxΔxΔxΔxΔxΔx ΔxΔxΔxΔxΔxΔx ΔxΔxΔxΔxΔxΔx ΔyΔy ΔyΔy ΔyΔy z0z0 dd dda0a0 a1a1 dd ddz0z0 ΔyΔy ΔyΔy ΔyΔy ΔyΔy ΔxΔx 24363 103163 183103 393 Differential encoding Anchor encoding128-bit allocation table Our compression scheme
40
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 40 Test scenes Town model 58K triangles Robots model 95K triangles Power plant 13M triangles 2M rendered
41
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 41 Compression methods tested Anchor encoding [Van Dyke and Margeson 2005] Differential differential pulse code modulation (DDPCM) [DeRoo et al. 2002] Plane and offset [Ornstein et al. 2005] Hasselgren and Möller [2006]
42
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 42 Compression results Average compression over paths through all models Varying light and view direction
43
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 43 Compression results Anchor encoding best linear method higher tolerance for curvature
44
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 44 Summary of hardware enhancements Apply F(y) to vertices in setup log and multiply-add operations Evaluators for G(y’) exponential and multiply-add operations Possible increase in bit width for rasterizer Generalized polygon offset New depth compression unit can be used for both linear and logarithmic rasterization
45
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 45 Feasibility Leverages existing designs Trades computation for bandwidth Aligns well with current hardware trends computation cheap bandwidth expensive
46
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 46 Conclusion Shadow maps Handling errors requires high resolution Logarithmic rasterization significant savings in bandwidth and storage Incremental hardware enhancements Rasterization to nonuniform grid Generalized polygon offset Depth compression Feasible leverages existing designs aligns well with hardware trends
47
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 47 Future work Prototype and more detailed analysis Greater generalization for the rasterizer reflections, refraction, caustics, multi-perspective rendering [Hou et al. 2006; Liu et al. 2007] paraboloid shadow maps for omnidirectional light sources [Brabec et al. 2002] programmable rasterizer?
48
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 48 Acknowledgements Jon Hasselgren and Thomas Akenine-Möller for depth compression code Corey Quammen for help with video Ben Cloward for robots model Aaron Lefohn and Taylor Halliday for town model
49
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 49 Acknowledgements Funding agencies NVIDIA University Fellowship NSF Graduate Fellowship ARO Contracts DAAD19-02-1-0390 and W911NF-04-1-0088 NSF awards 0400134, 0429583 and 0404088 DARPA/RDECOM Contract N61339-04-C-0043 Disruptive Technology Office.
50
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 50 Questions
51
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 51 Precision depends on resolution in y and Inputs limited to 24 bits of precision (floating point mantissa)
52
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 52 Generalized polygon offset f For flythroughs in our test scenes: Split situation occured for 1% of polygons Average was.001
53
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 53 Coverage determination for a tile Incremental in y Full evaluation Incremental x Incremental y 1 3 2 Per-frame constants
54
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 54 Coverage determination for a tile Look up table Full evaluation Incremental x Incremental y LUT 21 Per-frame constants
55
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 55 Coverage determination for a tile Look up table Full evaluation Incremental x Incremental y LUT 3 2 1 Per-frame constants
56
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 56 Comparisons Standard FP+Perspective ZP5+PerspectiveFP+Log+Perspective
57
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 57 Equal error 2900 2 (4096x2053) 512 2 (210x1248) LiSPSMLogSPSM
58
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL 58 Simulating logarithmic rasterization Apply F(y) in vertex program requires fine tesselation to avoid error increases vertex transformation load Brute-force rasterization with a fragment program disables optimizations due to depth writes
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.