Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Optimized Stencil Shadow Volumes
Graphics Pipeline.
Game Programming 09 OGRE3D Lighting/shadow in Action
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Computer Graphics methods
Real-Time Rendering Self-Shadowing
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
3D Graphics Rendering and Terrain Modeling
Ray Tracing & Radiosity Dr. Amy H. Zhang. Outline  Ray tracing  Radiosity.
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.
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering Cass Everitt and Mark J. Kilgard Speaker: Alvin Date: 5/28/2003 NVIDIA.
(conventional Cartesian reference system)
3D Graphics Processor Architecture Victor Moya. PhD Project Research on architecture improvements for future Graphic Processor Units (GPUs). Research.
Approximate Soft Shadows on Arbitrary Surfaces using Penumbra Wedges Tomas Akenine-Möller Ulf Assarsson Department of Computer Engineering, Chalmers University.
7M836 Animation & Rendering
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Models and Architectures Ed Angel Professor of Computer Science, Electrical and Computer.
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
Shadow No, not the Hank Marvin kind!. Go to: ows.html ows.html.
Shadow Algorithms Ikrima Elhassan.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
1 Computer Graphics Week13 –Shading Models. Shading Models Flat Shading Model: In this technique, each surface is assumed to have one normal vector (usually.
COMP 175: Computer Graphics March 24, 2015
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
09/11/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Graphics Pipeline Texturing Overview Cubic Environment Mapping.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
Ray Tracing Chapter CAP4730: Computational Structures in Computer Graphics.
CSC 461: Lecture 3 1 CSC461 Lecture 3: Models and Architectures  Objectives –Learn the basic design of a graphics system –Introduce pipeline architecture.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
CS 638, Fall 2001 Multi-Pass Rendering The pipeline takes one triangle at a time, so only local information, and pre-computed maps, are available Multi-Pass.
Rendering Overview CSE 3541 Matt Boggus. Rendering Algorithmically generating a 2D image from 3D models Raster graphics.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
1 10/24/ :01 UML Graphics II Shadows Session 4.
1Computer Graphics Lecture 4 - Models and Architectures John Shearer Culture Lab – space 2
Shadows. Shadows is important in scenes, consolidating spatial relationships “Geometric shadows”: the shape of an area in shadow Early days, just pasted.
CS-378: Game Technology Lecture #8: More Mapping Prof. Okan Arikan University of Texas, Austin Thanks to James O’Brien, Steve Chenney, Zoran Popovic, Jessica.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Binary Space Partitioning Trees Ray Casting Depth Buffering
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
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.
Stencil Shadows Garrett Weng. What are stencil shadows? Also known as shadow volumes Relies on use of the stencil buffer Create volumes of the shadows.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
CENG 477 Introduction to Computer Graphics
Week 2 - Friday CS361.
A Geometry-Based Soft Shadow Volume Algorithm Using Graphics Hardware
Deferred Lighting.
Robust Shadow Maps for Large Environments
Real-Time Rendering Shadow Volumes
3D Graphics Rendering PPT By Ricardo Veguilla.
Models and Architectures
Jim X. Chen George Mason University
Models and Architectures
Introduction to Computer Graphics with WebGL
Models and Architectures
Texture and Shadow Mapping
Models and Architectures
Chapter XV Shadow Mapping
Frame Buffer Applications
Presentation transcript:

Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528

Inspiration Interested in virtual environments which shadows are a part of. Shadows are cool. John Carmak Shadows in the new Doom engine

Importance of Shadows in Virtual Environments You’ve all seen this distinction before. On the left a scene with no shadows. It is hard to determine the spatial location of the models and lights. With shadows...

The Lighting Problem Shadows are a Global Illumination Model problem. Many objects must be taken into consideration when calculating the shadow at a specific point. Ray Tracers and Radiosity Techniques handle shadows well.

Problems With This Model For Real-Time Applications Speed. Global Illumination Models are slow and it is not feasible with current technology to use such a model in a real- time virtual environment.

Quick Fix Rendering shadows in Real-Time is almost always separated from the lighting model and uses geometric tricks to approximate the shadows. As with most things there is a trade off among these tricks between the accuracy/realism of the shadows and speed.

Real-Time Dynamic Shadow Algorithms Planar Projected Algorithms - Fast - Very limited use Shadow Mapping - Robust - Harder to handle omni directional lights Shadow Volumes - Shadow Volumes are hard to compute efficiently - Handles omni directional lights very well

Planar Projected Shadows Very Fast Squishes the Model onto a plane in just one matrix multiplication Easy To Implement and with good results when casting shadows onto one plane Can extend to cast onto multiple planes, but each plane will require another rendering of the model. Cube 8 Lights

Shadow Mapping [Lance Williams 78] Render scene from the point of view of the camera with depth test enabled. Result is a shadow map from the lights perspective stored in the depth buffer. Next, render scene from cameras point of view and determine the pixels (X,Y,Z) coordinates with respect to the Lights coordinate system. Compare the Z value of the pixel with the value stored at position (X,Y) in the depth map. If the values are equal then the pixel is lit, if it is greater then the pixel is shadowed.

Shadow Mapping Pixel in Shadow: The fragments Z in light space is greater then the stored value in the depth map at fragments XY position Pixel Lit: The fragments Z in light space is equal to the value in the shadow map. Pixel in Shadow Pixel Lit

Shadow Mapping The resolution of the shadow map should be the same as the color buffer or aliasing artifacts can occur. Must render multiple shadow maps for omni directional lights.

Shadow Volumes Makes use of the stencil buffer to block out areas in which a shadow is cast. First render scene with only ambient light. Compute shadow volume. Render the front facing polygons of the shadow volume and increment the stencil buffer for each successful stencil test Render the back facing polygons and decrement the stencil buffer for successful stencil tests. Finally render the scene with diffuse and specular lights in all places that the stencil buffer is equal to 0. Algorithm

Shadow Volumes A Shadow Volume is a volume in space for which anything within that volume is in shadow. It is formed from the light being blocked by an occluder. It is infinite at one end and starts at the occluding object. Note: here the shadow volume is actually capped. Computing the shadow volume is hard work. Lots of geometric computations.

How The Shadow Volumes Work If you consider a camera at any point outside of the shadow and a point being shaded. Shoot a ray from the camera to the point. If the point is in the shadow volume it will have a positive value since the ray incremented the stencil buffer every time it entered the shadow volume(front facing), and decremented it when it left(back facing). If the camera is within the shadow volume the incrementing and decrementing must be reversed. This however is extra work for a check to determine the location of the camera must be made.

The Future of Shadows Shadow Algorithm Specific Hardware Acceleration NVIDIA Shadow Buffer Technology Used in the GeForce3 Uses Shadow Map Technique

My Implementations Planar Projected Shadows Shadow Volumes Both of these have two versions one with correct support for multiple lights, one optimized for use with one light.

Planar Projected Shadows Plane Eq: Ax + By + Cz + D = 0 [x, y, z] is the difference between the center of the model and the light source. Ideally you want to use the distance from each vertex. However it is not as fast since the matrix will have to be computed on a per vertex basis instead of a per model basis. The vertices of the model are multiplied by the Planar Projection matrix. You can find this matrix in the Red Book.

Shadow Volumes There are 2 implementations for shadow volumes. One optimized for one light, and one set up for multiple lights. My implementations follow the algorithm discussed before except instead of rendering a scene once for ambient light then diffuse and specular I use a shading polygon. Render a polygon that covers the entire scene and then blend it wherever the stencil buffer is not zero. So all the areas in shadow are blended with a shadow polygon. This will save a complete rendering of the scene, by merging the lighting properties into one pass. Many complications can arise from finding a good capping value (the distance it extends towards infinity) for the shadow volume. To simplify this for myself I just allow the user to change the current shadow cap. In practice for arbitrary cameras and virtual environments the shadow volume should be capped to correspond with the clipping planes. However this can lead to many artifacts and there are many special cases to account for.

Shadow Volumes

Results: A Few More Pictures Shadow Volumes cast on all objectsAn omni directional scene for shadow volumes.

Results: A Few More Pictures Planar Projected Shadows Shadow Volumes Notice the self shadowing

Results: A Few More Pictures Two LightsEight Lights