1 / 38

Rendering Fake Soft Shadows with Smoothies

Rendering Fake Soft Shadows with Smoothies. Eric Chan Frédo Durand. Laboratory for Computer Science Massachusetts Institute of Technology. Real-Time Shadows. Goals: Interactive framerates Hardware-accelerated Good image quality Dynamic environments Applications:

sonnagh
Télécharger la présentation

Rendering Fake Soft Shadows with Smoothies

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. Rendering Fake Soft Shadows with Smoothies Eric Chan Frédo Durand Laboratory for Computer ScienceMassachusetts Institute of Technology

  2. Real-Time Shadows • Goals: • Interactive framerates • Hardware-accelerated • Good image quality • Dynamic environments • Applications: • Game engines (e.g. Doom 3) • Interactive walkthroughs • Challenge: balancing quality and performance NVIDIA

  3. Two Algorithms from the 1970’s • Shadow volumes (Crow 1977) • Object-space • Accelerated by hardware stencil buffer • Large fillrate consumption • Shadow maps (Williams 1978) • Image-space • Fast and simple • Supported in hardware • Undersampling artifacts NVIDIA

  4. Soft Shadow Volumes • Penumbra wedges: • Shadow polygons wedges • Compute penumbra with pixel shaders • Accurate approximation • Papers: • Assarsson et al. (EGRW 2002, SIGGRAPH 2003, HWWS 2003) • But: much higher fillrate needed wedge Assarsson and Akenine-Möller

  5. Soft Shadow Maps • Ideas: • Filtering • Stochastic sampling • Image warping • Examples: • Percentage closer filtering (Reeves et al., SIGGRAPH 1987) • Deep shadow maps (Lokovic and Veach, SIGGRAPH 2000) • Image-based soft shadows (Agrawala et al., SIGGRAPH 2000) • Multisampling hard shadows (Heckbert and Herf, TR 1997) • But: need dense sampling to minimize artifacts Agrawala et al.

  6. Soft Shadow Maps (cont.) • Approximations • Examples: • Convolution (Soler and Sillion, SIGGRAPH 1998) • Linear lights (Heidrich et al., EGRW 2000) • Outer surfaces (Parker et al., TR 1998) • Plateaus (Haines, JGT 2001) • Penumbra maps (Wyman and Hansen, EGSR 2003) Soler and Sillion

  7. Overview • Extend basic shadow map approach • Use extra primitives (smoothies) to soften shadows light’s view (blockers only) light’s view (blockers + smoothies)

  8. Fake Soft Shadows • Shadows not geometrically correct • Shadows appear qualitatively like soft shadows Hard shadows Fake soft shadows

  9. Contributions • Smoothie shadow algorithm: • Creates soft shadow edges • Hides aliasing artifacts • Efficient (object / image space) • Hardware-accelerated • Supports dynamic scenes

  10. 1. Create Shadow Map • Render blockers into depth map observer’s view light’s view

  11. 2. Identify Silhouette Edges • Find blockers’ silhouette edges in object space object-space silhouettes observer’s view light’s view

  12. 3. Construct Smoothies • Blocker only: silhouette vertex silhouette edges blocker exterior

  13. 3. Construct Smoothies (cont.) • Blocker + smoothies: silhouette vertex t silhouette edges t smoothie edge smoothie corner blocker exterior

  14. 3. Construct Smoothies (cont.) • Smoothie edges are rectangles in screen space with a fixed width • Smoothie corners connect adjacent smoothie edges t t geometry shading

  15. 4. Render Smoothies • Store depth and alpha values into smoothie buffer Smoothie Buffer (depth) Smoothie Buffer (alpha) light’s viewpoint

  16. light source smoothie blocker receiver 5. Compute Shadows • Compute intensity using depth comparisons

  17. 5. Compute Shadows • Image sample behind blocker (intensity = 0) light source smoothie blocker receiver completely in shadow

  18. 5. Compute Shadows • Image sample behind smoothie (intensity = ) light source smoothie blocker receiver partially in shadow

  19. 5. Compute Shadows • Image sample illuminated (intensity = 1) light source smoothie blocker receiver illuminated

  20. light source smoothie  r b blocker receiver Computing Alpha Values • Intuition: • Alpha defines penumbra shape • Should vary with ratio b/r

  21. Computing Alpha Values (cont.) • Linearly interpolate alpha • Remap alpha at each pixel using ratio b/r: ’ =  / (1 – b/r) original  remapped  result

  22. Multiple Blockers and Receivers

  23. Multiple Receivers Smoothie buffer (linearly-interpolated ) 1 same thickness 2 light’s view

  24. Multiple Receivers (cont.) Smoothie buffer (remapped ) 1 different thickness 2 light’s view

  25. Multiple Receivers (cont.) Final image different thickness observer’s view

  26. Multiple Blockers • What happens when smoothies overlap? smoothie overlap

  27. Multiple Blockers (cont.) • Minimum blending: just keep minimum of alpha values smoothie ray tracer

  28. Comparison to Penumbra Maps • Penumbra maps (Wyman and Hansen, EGSR 2003) • Same idea, different details • Smoothie depth: • Extra storage + comparison • Handles surfaces that act only as receivers Penumbra Maps Smoothies Geometry: Store depth:

  29. Results • System information: • 2.6 GHz Intel Pentium 4 • NVIDIA Geforce FX 5800 Ultra

  30. Video

  31. Hiding Aliasing (256 x 256) 16 ms 129 ms shadow map bicubic filter 19 ms 19 ms smoothie (t = 0.02) smoothie (t = 0.08)

  32. Hiding Aliasing (1024 x 1024) 17 ms 142 ms shadow map bicubic filter 22 ms 24 ms smoothie (t = 0.02) smoothie (t = 0.08)

  33. Comparison to Ray Tracer increasing size of light source smoothie ray tracer

  34. Video original md2shader demo courtesy of Mark Kilgard

  35. Discussion • Shadow maps: • Assumes directional light or spotlight • Discrete buffer samples • Shadow volumes: • Assumes blockers are closed triangle meshes • Silhouettes identified in object space • Smoothies: • Rendered from light’s viewpoint • Occupy small screen area inexpensive

  36. Summary • Contribution: • Simple extension to shadow maps • Shadows edges are fake, but look like soft shadows • Fast, maps well to graphics hardware

  37. Trends in Real-Time Shadows • Architectures and algorithms go together • Currently, architectures algorithms: • Store per-pixel data at full precision • But also, algorithms architectures: • Shadow maps • Shadow volume depth bounds • Aggressive early z and stencil reject

  38. Acknowledgments Hardware, drivers, and bug fixes • Mark Kilgard, Cass Everitt, David Kirk, Matt Papakipos (NVIDIA) • Michael Doggett, Evan Hart, James Percy (ATI) • Writing and code • Sylvain Lefebvre, George Drettakis, Janet Chen, Bill Mark • Xavier Décoret, Henrik Wann Jensen • Funding • ASEE NDSEG Fellowship

More Related