610 likes | 1.15k Views
Logarithmic perspective shadow maps. 1 University of North Carolina – Chapel Hill 2 Microsoft 3 NVIDIA. Brandon Lloyd 1,2 Naga Govindaraju 2 Cory Quammen 1 Steve Molnar 3 Dinesh Manocha 1. Low error shadows for real-time applications Emphasis on performance. Goal.
E N D
Logarithmic perspective shadow maps 1University of North Carolina – Chapel Hill 2Microsoft 3NVIDIA Brandon Lloyd1,2 Naga Govindaraju2 Cory Quammen1 Steve Molnar3 Dinesh Manocha1
Low error shadows for real-time applications Emphasis on performance Goal
Standard Shadow Map undersampled aliasing
Outline • Related work • Logarithmic perspective warping • Error analysis • Experimental results • Conclusion
Single shadow map warping • Perspective shadow maps (PSMs) [Stamminger and Drettakis 2002] • Light-space perspective shadow maps (LiSPSMs) [Wimmer et al. 2004] • Trapezoidal shadow maps [Martin and Tan 2004]
Warping cannot be used for all light directions Single shadow map warping
Perspective warped cube maps[Kozlov 2004] Face partitioning
z-partitioning • Cascaded shadow maps [Engel 2007] • Parallel split shadow maps [Zhang et al. 2006] • Separating-plane shadow maps[Mikkelsen 2007] z
z-partitioning • Cascaded shadow maps [Engel 2007] • Parallel split shadow maps [Zhang et al. 2006] • Separating-plane shadow maps[Mikkelsen 2007] z
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] • Tiled shadow maps[Arvo 2004] • Multiple shadow frusta [Forsyth 2006]
GPU implementations[Arvo 2006; Sintorn et al. 2008] Hardware architecture[Johnson et al. 2005] Irregular z-buffer [Aila and Laine 2004;Johnson et al. 2004]
Methods for better sampling • Scene-independent • Single SM warping • Face partitioning • z-partitioning • Scene-dependent • Adaptive • Irregular + Lower, nearly constant cost – Higher error + Lower error – Higher, variable cost
Filtering • Percentage closer filtering[Reeves et al. 1987] • Variance shadow maps[Donnely and Lauritzen 2006; Lauritzen and McCool 2008] • Convolution shadow maps[Annen et al. 2007] • Exponential shadow maps[Salvi 2008; Annen et al. 2008]
Logarithmic perspective shadow maps (LogPSMs) • Replace perspective warping in scene-independent • single shadow map • z-partitioning • face partitioning • Similar performance with less error • Similar error with less texture resolution
Outline • Related work • Logarithmic perspective warping • Error analysis • Experimental results • Conclusion
Not necessarily the best fit to required sampling distribution Perspective warping PSM LiSPSM moderate error high error y x moderate error low error
Logarithmic+perspective warping low error high error y x Logarithmictransform Perspectiveprojection
Logarithmic rasterization • Brute-force rasterization • use a fragment program • Slower than standardrasterization • disables optimizations • z-culling • double-speed z-only rendering • breaks linear depth compression schemes
Logarithmic rasterization • Hardware rasterization[Lloyd et al. 2007] • equivalent to rasterizing on non-uniform grid • requires incremental modifications • Software rasterization • Larrabee [Seiler et al. 2008] • Performance comparable to standard rasterization
Outline • Related work • Logarithmic perspective warping • Error analysis • Experimental results • Conclusion
Error analysis • Need more analysis for previous methods • little analysis for point lights • limited analysis for lights in general position[Tadamura et al. 1999; Zhang et al. 2006]
Combinations of algorithms P - Perspective warping LogP - Logarithmic perspective warping ZP - z-partitioning FP - face partitioning single SM Standard P LogP z-partitioning ZP ZP+P ZP+LogP face-partitioning - FP+P FP+LogP
single SM Standard P LogP z-partitioning ZP ZP+P ZP+LogP face-partitioning FP+P FP+LogP Combinations of algorithms Which algorithm gives the least error for the fewest shadow maps? P - Perspective warping LogP - Logarithmic perspective warping ZP - z-partitioning FP - face partitioning
Quantifying aliasing error shadow map light light image plane eye eye image plane
Quantifying aliasing error shadow map light light image plane eye eye image plane
Quantifying aliasing error shadow map light light image plane • Maximum error: • over a light ray • over the frustum • over all light positions eye eye image plane
Near optimal, scene-independent warping • Minimizes maximum error over a face • Too complicated for practical use • Used as a baseline
Maximum errorover all light positions Logarithmic perspective warping is about the best we can do for scene-independent algorithms
Error distribution along a face Uniform LiSPSM PSM LogPSM max error in t max error in s far far near near Uniform LiSPSM PSM LogPSM
Maximum error for varying light directions 25 Standard Perspective 20 Log+perspective 15 max error (log2 scale) direction to light 10 5 view direction 0 20 40 60 80
Maximum error for varying light directions 25 Standard Perspective 20 Log+perspective FP+LogP 15 max error (log2 scale) direction to light 10 5 view direction 0 20 40 60 80
error reduction error reduction error reduction error reduction error reduction z-partitioning max error (log2 scale) FP uses 1-7partitions (3.8 average) max error (log2 scale)
Least error for fewest shadow maps? max error (log2 scale) FP uses 1-7partitions (3.8 average) max error (log2 scale)
Outline • Related work • Logarithmic perspective warping • Error analysis • Experimental results • Conclusion
LogPSMs have lower maximum error more uniform error Image resolution: 5122 Shadow map resolution: 10242 f/n = 300 Grid lines for every 10 shadow map texels Color coding for maximum texel extent in image Single shadow map LogPSM LogPSM LiSPSM LiSPSM LogPSM
Partitioning schemes FP+P Standard ZP5+P FP+LogP
Comparison video Cascaded = ZP5LogPSM = FP+LogP PSM = LiSPSM with PSM parameter
Limitations of LogPSMs • Not currently supported in hardware • Share problems as other warping algorithms: • do not handle aliasing error due to surface orientation • face partitioning needed for most benefit • not as simple as z-partitioning • can exhibit shearing artifacts
Conclusion • LogPSMs • Single shadow map • z-partitioning • face partitioning • Error analysis • LogPSMs are close to optimal for scene-independent algorithms • LogPSMs achieve low error with few shadow maps
Future work • Other error metrics [Zhang et al. 2007] • Combine with scene-dependent algorithms • LiSPSM + adaptive [Giegl and Wimmer 2007] • LiSPSM + irregular [Sintorn et al. 2008]
Acknowledgements • Aaron Lefohn and Taylor Holliday for town model • Ben Cloward for robot model • David Feng and Nico Galoppo • Funding agencies • NVIDIA University Fellowship • NSF Graduate Fellowship • ARO, NSF, DARPA/RDECOM, Disruptive Technology Office