Shadow Maps & Smoothies CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

An Optimized Soft Shadow Volume Algorithm with Real-Time Performance Ulf Assarsson 1, Michael Dougherty 2, Michael Mounier 2, and Tomas Akenine-Möller.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
Object Space EWA Surface Splatting: A Hardware Accelerated Approach to High Quality Point Rendering Liu Ren Hanspeter Pfister Matthias Zwicker CMU.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Computer Graphics methods
Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 3 Shadow and Environment Mapping
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
3D Graphics Rendering and Terrain Modeling
Rendering Fake Soft Shadows with Smoothies Laboratory for Computer Science Massachusetts Institute of Technology Eric Chan Frédo Durand.
1 Dr. Scott Schaefer Shadows. 2/40 Shadows Shadows provide clues about depth Make scenes appear more realistic.
Real-Time Rendering SPEACIAL EFFECTS Lecture 03 Marina Gavrilova.
Rasterization and Ray Tracing in Real-Time Applications (Games) Andrew Graff.
A Survey of Real-time Soft Shadows Algorithms Speaker: Alvin Date: 2003/7/23 EUROGRAPHICS 2003 J.-M. Hasenfratz, M. Lapierre, N. Holzschuch and F.X. Sillion.
Copyright  Philipp Slusallek Cs fall IBR: Model-based Methods Philipp Slusallek.
Computer Graphics (Fall 2005) COMS 4160, Lecture 16: Illumination and Shading 1
Efficient Image-Based Methods for Rendering Soft Shadows
Shadow Silhouette Maps Pradeep Sen, Mike Cammarano, Pat Hanrahan Stanford University.
A Real-Time Soft Shadow Volume Algorithm DTU Vision days Tomas Akenine-Möller Department of Computer Engineering Chalmers University of Technology Sweden
Skin Rendering GPU Graphics Gary J. Katz University of Pennsylvania CIS 665 Adapted from David Gosselin’s Power Point and article, Real-time skin rendering,
Perspective Shadow Maps Marc Stamminger and George Drettakis Speaker: Alvin Date: 5/28/2003 SIGGRAPH 2002.
Shadow Algorithms Gerald Matzka Computer Science Seminar.
Real-Time High Quality Rendering COMS 6160 [Fall 2004], Lecture 4 Shadow and Environment Mapping
Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges Tomas Akenine-Möller Ulf Assarsson Department of Computer Engineering, Chalmers University.
Copyright  Philipp Slusallek IBR: View Interpolation Philipp Slusallek.
Creating soft shadows Computer Graphics methods Submitted by: Zusman Dimitry.
CSCE 641: Computer Graphics Image-based Rendering Jinxiang Chai.
Computer Graphics Shadows
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
9/20/2001CS 638, Fall 2001 Today Finishing Up Reflections More Multi-Pass Algorithms Shadows.
Shadows Computer Graphics. Shadows Shadows Extended light sources produce penumbras In real-time, we only use point light sources –Extended light sources.
Erdem Alpay Ala Nawaiseh. Why Shadows? Real world has shadows More control of the game’s feel  dramatic effects  spooky effects Without shadows the.
Computer Graphics Mirror and Shadows
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
09/09/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Event management Lag Group assignment has happened, like it or not.
Computer Graphics 2 Lecture 8: Visibility Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
MIT EECS 6.837, Durand and Cutler Real-Time Shadows.
1 Shadows (2) ©Anthony Steed Overview n Shadows – Umbra Recap n Penumbra Analytical v. Sampling n Analytical Aspect graphs Discontinuity meshing.
Efficient Rendering of Local Subsurface Scattering Tom Mertens 1, Jan Kautz 2, Philippe Bekaert 1, Frank Van Reeth 1, Hans-Peter Seidel
Shadows. Shadows is important in scenes, consolidating spatial relationships “Geometric shadows”: the shape of an area in shadow Early days, just pasted.
Perspective Shadow Maps Marc Stamminger REVES/INRIA, Sophia-Antipolis, France now at: Bauhaus-Universität, Weimar, Germany George Drettakis REVES/INRIA,
Computer Graphics 2 Lecture 7: Texture Mapping Benjamin Mora 1 University of Wales Swansea Pr. Min Chen Dr. Benjamin Mora.
Rendering Fake Soft Shadows with Smoothies Eric Chan Massachusetts Institute of Technology.
Hardware-accelerated Rendering of Antialiased Shadows With Shadow Maps Stefan Brabec and Hans-Peter Seidel Max-Planck-Institut für Informatik Saarbrücken,
Efficient Image-Based Methods for Rendering Soft Shadows SIGGRAPH 2001 Maneesh Agrawala Ravi Ramamoorthi Alan Heirich Laurent Moll Pixar Animation Studios.
Sample Based Visibility for Soft Shadows using Alias-free Shadow Maps Erik Sintorn – Ulf Assarsson – uffe.
Real-Time High Quality Rendering CSE 291 [Winter 2015], Lecture 2 Graphics Hardware Pipeline, Reflection and Rendering Equations, Taxonomy of Methods
Variance Shadow Maps Andrew Lauritzen, RapidMind.
Real-Time Relief Mapping on Arbitrary Polygonal Surfaces Fabio Policarpo Manuel M. Oliveira Joao L. D. Comba.
11/5/2002 (c) University of Wisconsin, CS 559 Last Time Local Shading –Diffuse term –Specular term –All together –OpenGL brief overview.
MIT EECS 6.837, Durand and Cutler Texture Mapping & Other Fun Stuff.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.
1 Shadow Rendering Techniques: Hard and Soft Author: Jamiur Rahman Supervisor: Mushfiqur Rouf Department of CSE BRAC University.
The Graphics Pipeline Revisited Real Time Rendering Instructor: David Luebke.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Shadows & occlusion  Shadow - occlusion duality  Floor shadows.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Shuen-Huei Guan Seminar in CMLab, NTU
CENG 477 Introduction to Computer Graphics
Real-Time Soft Shadows with Adaptive Light Source Sampling
Deferred Lighting.
Jim X. Chen George Mason University
Real-time Rendering Shadow Maps
Real-Time Rendering Intro to Shadows
UMBC Graphics for Games
CS5500 Computer Graphics May 29, 2006
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Frame Buffer Applications
Adding Surface Detail 고려대학교 컴퓨터 그래픽스 연구실.
Presentation transcript:

Shadow Maps & Smoothies CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia

2 David Luebke Real-Time Rendering Demo Today: Travis Sluka Tuesday: John Dimeo

3 David Luebke Real-Time Rendering Shadow Maps Idea: –Render scene from light source, read Z-buffer –Result: discretized image ( shadow map ) telling distance of objects to light source –Render scene normally At each pixel, calculate distance D to light Compare to distance S stored in shadow map If D=S, surface lit by light, else in shadow

4 David Luebke Real-Time Rendering Shadow Maps The basic algorithm (w/o hardware) –Render scene with ambient lighting only –Read Z-buffer, transform values into coordinate system of light –Use comparison to set alpha buffer –Render w/ diffuse and specular components, multiplying by alpha

5 David Luebke Real-Time Rendering Shadow Maps Advantages: –Hardware-accelerated general shadow algorithm –Supports self-shadowing –Cost is linear in # lights and # polygons Disadvantages: –Self-shadow aliasing Biasing and other techniques can help, but not fix –Shadow map resolution critical! Solution: perspective shadow maps

6 David Luebke Real-Time Rendering Recap: Shadow Maps The basic idea: –Render scene from light source, read Z-buffer –Result: discretized image ( shadow map ) telling distance of objects to light source –Render scene normally At each pixel, calculate distance D to light Compare to distance S stored in shadow map – Use projective texturing to compute texcoords If D=S, surface lit by light, else in shadow – Comparison on CPU (store result in α) or in hardware Show NVIDIA shadowcast demo

7 David Luebke Real-Time Rendering Smoothies Many, many refinements on shadow algorithms out there To give you a feel for the range of solutions, I’ll present one recent paper – Rendering Fake Soft Shadows with Smoothies –Eric Chan & Fredo Durand (MIT) –Slides borrowed from their NVIDIA-U talk

Rendering Fake Soft Shadows with Smoothies Laboratory for Computer Science Massachusetts Institute of Technology Eric Chan Frédo Durand

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

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

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 Assarsson and Akenine-Möller wedge

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.

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

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

Fake Soft Shadows Shadows not geometrically correct Shadows appear qualitatively like soft shadows Hard shadowsFake soft shadows

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

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

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

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

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

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

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

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

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

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

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

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

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

Multiple Blockers and Receivers

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

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

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

Multiple Blockers What happens when smoothies overlap? smoothie overlap

Multiple Blockers (cont.) Minimum blending: just keep minimum of alpha values smoothieray tracer

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 cones and sheetsquads blockers onlyblockers + smoothies Geometry: Store depth: Penumbra MapsSmoothies

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

Video

Hiding Aliasing (256 x 256) shadow mapbicubic filter smoothie (t = 0.02)smoothie (t = 0.08) 16 ms129 ms 19 ms

Hiding Aliasing (1024 x 1024) shadow mapbicubic filter smoothie (t = 0.02)smoothie (t = 0.08) 17 ms142 ms 22 ms24 ms

Comparison to Ray Tracer smoothieray tracer increasing size of light source

Video original md2shader demo courtesy of Mark Kilgard

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

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

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

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

Other Cool Shadow Stuff l Deep shadow maps –Instead of storing a depth at each pixel –Store a series of depths w/ reduction of light transmitted –Important for complex self-shadowing models n Hair, clouds –Not real-time (yet…) l Final examples of cool shadow stuff: Deep Shadow Maps, Lokovic & Veach, SIGGRAPH 2000

Other Cool Shadow Stuff l Deep shadow maps –Instead of storing a depth at each pixel –Store a series of depths w/ reduction of light transmitted –Important for complex self-shadowing models n Hair, clouds –Not real-time (yet…) l Final examples of cool shadow stuff: With self-shadowing

Other Cool Shadow Stuff l Deep shadow maps –Instead of storing a depth at each pixel –Store a series of depths w/ reduction of light transmitted –Important for complex self-shadowing models n Hair, clouds –Not real-time (yet…) l Final examples of cool shadow stuff: Without self-shadowing

Other Cool Shadow Stuff l Deep shadow maps –Instead of storing a depth at each pixel –Store a series of depths w/ reduction of light transmitted –Important for complex self-shadowing models n Hair, clouds –Not real-time (yet…) l Final examples of cool shadow stuff: A cloud with pipes (duh)

Other Cool Shadow Stuff l Perspective shadow maps –Avoid shadow map aliasing by composing perspective projection of camera into shadow map l Final examples of cool shadow stuff: A scene rendered w/ 512x512 shadow map

Other Cool Shadow Stuff l Perspective shadow maps –Avoid shadow map aliasing by composing perspective projection of camera into shadow map l Final examples of cool shadow stuff: The shadow map. Note wasted resolution.

Other Cool Shadow Stuff l Perspective shadow maps –Avoid shadow map aliasing by composing perspective projection of camera into shadow map –Must be recomputed each frame l Final examples of cool shadow stuff: 512x512 perspective shadow map

Other Cool Shadow Stuff l Perspective shadow maps –Avoid shadow map aliasing by composing perspective projection of camera into shadow map –Must be recomputed each frame l Final examples of cool shadow stuff: The perspective shadow map uses resolution more effectively

Other Cool Shadow Stuff l Perspective shadow maps –Avoid shadow map aliasing by composing perspective projection of camera into shadow map –Must be recomputed each frame l Final examples of cool shadow stuff: Perspective Shadow Maps, Stamminger & Drettakis, SIGGRAPH 2002