1 / 38

Fast Soft Self-Shadowing on Dynamic Height Fields

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; …]

karenj
Download Presentation

Fast Soft Self-Shadowing on Dynamic Height Fields

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Derek Nowrouzezahrai University of Toronto Fast Soft Self-Shadowing on Dynamic Height Fields John Snyder Microsoft Research

  2. [Sloan&Cohen00] Related Work • horizon mapping [Max88; …] • hard shadows • precomputed for static geometry

  3. Related Work • shadow map filtering [Reeves87; …] • light “bleeding” artifacts • small light sources • no complex environmental lighting [Donnelly06]

  4. Related Work • ambient occlusion [Bunnell05; Kontkanen05; …] • AO in screen-space [Shanmugam07;…] • “cone” blocker model [Heidrich00;…] [Dimitrov08] [Oat07]

  5. Related Work • static relighting [Sloan02; Ng04; …] • dynamic relighting [Bunnell05, Ren06, Sloan07]

  6. Goals • strong response to lighting direction (cast shadows) ambient occlusion low-frequency SH [Ren06]

  7. Goals • strong response to lighting direction (cast shadows) • environmental + directional lighting

  8. 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

  9. 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}

  10. 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.

  11. Calculating the Horizon Map

  12. Calculating the Horizon Map t

  13. Calculating the Horizon Map t

  14. Calculating the Horizon Map t

  15. Calculating the Horizon Map t

  16. Calculating the Horizon Map t

  17. Calculating the Horizon Map t

  18. Calculating the Horizon Map t

  19. Calculating the Horizon Map t

  20. Calculating the Horizon Map max t Problem: aliasing – need many samples in t. Solution: prefilter height field, apply multi-scale derivative.

  21. 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

  22. ( ) - 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

  23. 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

  24. Pyramid Level Step • k = 1 (standard power-of-2 pyramid)  abrupt transitions • k = 4 smoothes transitions k = 1 k = 2 k = 3 k = 4

  25. 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

  26. 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}

  27. 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

  28. 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

  29. 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.

  30. 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

  31. å 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

  32. Soft Shadowed Shading with SH SH triple product H ( N ) x or BRDF x Visibility SH Product and dot with lighting

  33. Comparison with Ground Truth ground truth k = 1, o = 1 k = 2, o = 2 k = 3, o = 3 k = 4, o = 4

  34. Measured Performance

  35. Image Results

  36. Video Results Clip 1 Clip 2

  37. 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

  38. Thanks! Any questions?

More Related