380 likes | 392 Views
Derek Nowrouzezahrai University of Toronto. Fast Soft Self-Shadowing on Dynamic Height Fields. John Snyder Microsoft Research. [Sloan&Cohen00]. Related Work. horizon mapping [Max88; …] hard shadows precomputed for static geometry. Related Work. shadow map filtering [Reeves87; …]
E N D
Derek Nowrouzezahrai University of Toronto Fast Soft Self-Shadowing on Dynamic Height Fields John Snyder Microsoft Research
[Sloan&Cohen00] Related Work • horizon mapping [Max88; …] • hard shadows • precomputed for static geometry
Related Work • shadow map filtering [Reeves87; …] • light “bleeding” artifacts • small light sources • no complex environmental lighting [Donnelly06]
Related Work • ambient occlusion [Bunnell05; Kontkanen05; …] • AO in screen-space [Shanmugam07;…] • “cone” blocker model [Heidrich00;…] [Dimitrov08] [Oat07]
Related Work • static relighting [Sloan02; Ng04; …] • dynamic relighting [Bunnell05, Ren06, Sloan07]
Goals • strong response to lighting direction (cast shadows) ambient occlusion low-frequency SH [Ren06]
Goals • strong response to lighting direction (cast shadows) • environmental + directional lighting
Goals • strong response to lighting direction (cast shadows) • environmental + directional lighting • dynamic geometry (not precomputed) • real-time performance • limitation: geometry is height field • applications: • terrain rendering (flight simulators, games, mapping/navigation) • data visualization
Summary of Main Ideas • approximate horizon map via multi-resolution • create height field pyramid [Burt81] • sample height differences from each pyramid level • use coarser levels as distance to receiver increases • reduces sampling • convert horizon map to SH visibility for soft shadowing • use visibility wedges [Dimitrov08] • get good directional lighting response • sharpen shadows by restricting wedges azimuthally • fast: {2D lookup + SH z rotation + Σ over wedges}
Horizon Map [Max88] height field: z=f(x)=f(x,y), point: p(x) = (x,f(x)) horizon angle: (x,) max angle horizon makes at p in azimuthal direction Sample at all points xalong set of directions i.
Calculating the Horizon Map max t Problem: aliasing – need many samples in t. Solution: prefilter height field, apply multi-scale derivative.
Multi-Resolution Approximation multi-scale derivative pyramid level i d d d d i i-1 i-2 i-3 sampling distance for level i As t↑, i ↑ : sample coarser levels further from x. fi fi-1 fi-2 fi-3
( ) - w = j 1 tan D ( f , x , , d ) i i i Multi-Resolution Horizon Angle horizon angle sample i d d d d i-3 i-1 i-2 i w w w w i-3 i i-1 i-2
w t j = t w j w j ( , x , ) b - spline ( , ( x , , d ),..., ( x , , d )) - - 0 0 1 1 N N Take max over sample knots and midpoints: w j » w t j ( x , ) max ( , x , ) t Î - { 0 , N 1 } Multi-Resolution Horizon Angle Up-sample coarser levels with 2D B-splines: w w w w i-3 i i-1 i-2 Reconstruct blocking angle function with 1D B-splines: knot mid
Pyramid Level Step • k = 1 (standard power-of-2 pyramid) abrupt transitions • k = 4 smoothes transitions k = 1 k = 2 k = 3 k = 4
Pyramid Level Offset • pyramid level bias when sampling height differences • increasing bias increases shadow sharpness • increases sampling requirements o = 0 o = 1 o= 2 o = 3 o = 4
Summary of Main Ideas • approximate horizon map via multi-resolution • create height field pyramid [Burt81] • sample height differences from each pyramid level • use coarser levels as distance to receiver increases • reduces sampling • convert horizon map to SH visibility for soft shadowing • use visibility wedges [Dimitrov08] • get good directional lighting response • sharpen shadows by restricting wedges azimuthally • fast: {2D lookup + SH z rotation + Σ over wedges}
Reconstructing Visibility • so far discussed sampling in single azimuthal direction • large lights sample multiple azimuthal directions • linearly interpolate horizon angle as function of • sequential pairs of idetermine visibility wedges
f Î f f q £ w f ì 0 , if [ , ] and ( ) + 1 f q = i i v ( , ) í 1, otherwise. î ò w w = w w v ( , ) v ( s , , ) y ( s ) ds i a b a b i S Projecting Visibility to SH • Visibility for a single wedge • Project visibility wedge to SH (order 4) • fix i = 0 and Δφ.Store as 2D table
Reconstruct Full Visibility • N azimuthal sampling directions N horizon angles • (N – 1) adjacent horizon angle pairs (wedge boundaries) • (N – 1) table lookups + (N – 1) SH Z-rotations • rotate wedge from i = 0 to azimuthal direction • Sum over all wedges • All operations (including horizon angle calculation) in a single • GPGPU shader. See [Snyder08] for full source code.
Azimuthal Swaths • azimuthal swaths contain many visibility wedges • key lights: restrict swath • get sharper shadows • acts as a geometric mask • only sample where necessary • env lights: use complete swath
å j rot ( , ) z i wedges N x H ( N ) x Soft Shadowed Shading with SH visibility vector at x diffuse reflectance: clamped cosine around normal Nx lighting environment
Soft Shadowed Shading with SH SH triple product H ( N ) x or BRDF x Visibility SH Product and dot with lighting
Comparison with Ground Truth ground truth k = 1, o = 1 k = 2, o = 2 k = 3, o = 3 k = 4, o = 4
Video Results Clip 1 Clip 2
Conclusions • multi-resolution approximation for horizon map • soft shadowing via fast SH projection • key + env lighting decomposition • simple GPU implementation • real-time up to 512x512 dynamic height fields • performance independent of geometric content