Shadows David Luebke University of Virginia. Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

Lecture 8 Transparency, Mirroring
An Optimized Soft Shadow Volume Algorithm with Real-Time Performance Ulf Assarsson 1, Michael Dougherty 2, Michael Mounier 2, and Tomas Akenine-Möller.
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Understanding the graphics pipeline Lecture 2 Original Slides by: Suresh Venkatasubramanian Updates by Joseph Kider.
Graphics Pipeline.
Optimized Stencil Shadow Volumes
Game Programming 09 OGRE3D Lighting/shadow in Action
University of Sulaimani - School of Science - Computer Dept.
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Week 9 - Friday.  What did we talk about last time?  Area lighting  Environment mapping  Blinn and Newell's method  Sphere mapping  Cubic environmental.
Computer Graphics methods
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
3D Graphics Rendering and Terrain Modeling
9/25/2001CS 638, Fall 2001 Today Shadow Volume Algorithms Vertex and Pixel Shaders.
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.
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,
1 Dynamic Shadows and Lighting for Walkthrus of Large Models Brandon Lloyd COMP 258 December 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.
Creating soft shadows Computer Graphics methods Submitted by: Zusman Dimitry.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Other Rendering Techniques Types of rendering – Wireframe techniques – Scan-line conversion – Reyes.
Introduction to 3D Graphics John E. Laird. Basic Issues u Given a internal model of a 3D world, with textures and light sources how do you project it.
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 Algorithms Ikrima Elhassan.
1 Perception, Illusion and VR HNRS 299, Spring 2008 Lecture 19 Other Graphics Considerations Review.
CS 638, Fall 2001 Today Light Mapping (Continued) Bump Mapping with Multi-Texturing Multi-Pass Rendering.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CSE 381 – Advanced Game Programming Basic 3D Graphics
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Chapter 6 Special Effects 강 신 진강 신 진
C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 C O M P U T E R G R A P H I C S Guoying Zhao 1 / 14 Going-through.
Week 2 - Friday.  What did we talk about last time?  Graphics rendering pipeline  Geometry Stage.
CHAPTER 11 Shadows © 2008 Cengage Learning EMEA. LEARNING OBJECTIVES In this chapter you will learn about: – –Shadow rendering algorithms – –Blinn’s shadow.
Advanced Computer Graphics Depth & Stencil Buffers / Rendering to Textures CO2409 Computer Graphics Week 19.
MIT EECS 6.837, Durand and Cutler Real-Time Shadows.
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.
1 Shadows (2) ©Anthony Steed Overview n Shadows – Umbra Recap n Penumbra Analytical v. Sampling n Analytical Aspect graphs Discontinuity meshing.
Week 10 - Wednesday.  What did we talk about last time?  Shadow volumes and shadow mapping  Ambient occlusion.
1 10/24/ :01 UML Graphics II Shadows Session 4.
Multi-pass Rendering. © 2002 James K. Hahn, N.H. Baek2 Multi-pass Rendering Repeat: image  Rendering pass  result imageRepeat: image  Rendering pass.
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.
Computer graphics & visualization Shadows / Transparency.
OpenGL Shadow. Content Shadowing using Stencil Buffer Shadowing using Projective Texture Shadow map Shadow volume.
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.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
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.
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
Discrete Techniques.
3D Graphics Rendering PPT By Ricardo Veguilla.
Jim X. Chen George Mason University
Introduction to Computer Graphics with WebGL
Real-time Rendering Shadow Maps
UMBC Graphics for Games
Texture and Shadow Mapping
Frame Buffer Applications
Presentation transcript:

Shadows David Luebke University of Virginia

Shadows An important visual cue, traditionally hard to do in real-time rendering Outline: –Notation –Planar shadows –Soft shadows –Projective shadows –Shadow volumes –Shadow maps –Shadow optimizations

Notation Light source –Point vs area Occluders & receivers –Identify ahead of time? –Self-shadowing? Shadow –Umbra –Penumbra Soft vs hard shadows

Planar Shadows Old trick: project the occluder geometry to a plane and render over ground plane –Can do with a matrix –Z-bias issues –Semiopaque shadows harder Stencil and Z-buffer tricks –Another option: generate textured rectangle Problems –Light source inside object (Antishadows) –Only planar receivers  no self-shadowing

Planar Soft Shadows Basic idea: –Sample light source multiple times, average results (accumulation buffer) into a texture Gooch et al: move plane up and down –Nested shadows  fewer passes

Projective Shadows Render scene from light’s point of view –Render all occluders as black –Can turn off depth buffer etc Project onto receiver polygons using projective texture mapping Works for curved surfaces Designer separates occluders and receivers  no self-shadowing

Shadow Volumes Basic idea: –Create polygonal objects to represent shadowed volumes –Make clever use of stencil buffer so that these objects affect what lighting is done

Stencil Buffer The stencil buffer has been around since OpenGL 1.0 –Basic idea: provide a per-pixel flag to indicate whether pixels are drawn or not –But… –Let that flag be an integer (usually 8 bits) Usually shared with depth buffer –And let drawing operations increment or decrement the stencil buffer based on different events Always, depth-pass, depth-fail, etc.

Shadow Volumes Details of the basic algorithm: –Compute shadow volumes View-independent! –Clear stencil buffer –Render the scene without diffuse/spec lighting –“Render” front faces of shadow volumes Turn off color, depth updates (but leave depth test on) Visible polygons increment pixel stencil buffer count –“Render” back faces of shadow volumes Turn off color, depth updates (but leave depth test on) Visible polygons decrement pixel stencil buffer count –Render scene with only diffuse/spec lighting Only update pixels where stencil = 0

Shadow Volumes Refinements (see book, next slides) –NV30, XBox supports signed stencil addition Two-sided lighting determines whether polygon adds or subtracts 1 from stencil buffer One-pass algorithm! But a little slower in practice? –What if you’re inside a shadow volume? Invert meaning of stencil test –What if near clip intersects shadow plane? Carmack, others: use z-fail test Clever extensions in NV2X help this idea out –Creating shadow volumes: vertex program! ATI: clever degenerate-edge trick again

Shadow Volumes Advantages: –Robust –Self-shadowing –GPU Disadvantages: –Can be geometry limited Stencil polys Multi-pass scene geometry –Can be fill limited –Stencil test – per pixel expense –Hard shadows

Shadow Volumes Will return to the gruesome details shortly

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

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

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