CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.

Slides:



Advertisements
Similar presentations
Exploration of advanced lighting and shading techniques
Advertisements

Saito, T. and Takahashi, T. Comprehensible Rendering of 3-D Shapes Proc. of SIGGRAPH '90 Genesis of Image Space NPR.
Lecture 8 Transparency, Mirroring
Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
CS 352: Computer Graphics Chapter 7: The Rendering Pipeline.
The Buffers and Operations
OpenGL Fragment Operations
Optimized Stencil Shadow Volumes
Graphics Pipeline.
Optimized Stencil Shadow Volumes
Game Programming 09 OGRE3D Lighting/shadow in Action
OPENGL Return of the Survival Guide. Buffers (0,0) OpenGL holds the buffers in a coordinate system such that the origin is the lower left corner.
CS 4363/6353 BASIC RENDERING. THE GRAPHICS PIPELINE OVERVIEW Vertex Processing Coordinate transformations Compute color for each vertex Clipping and Primitive.
University of Sulaimani - School of Science - Computer Dept.
Computer Graphic Creator: Mohsen Asghari Session 2 Fall 2014.
Computer Graphics methods
Course Note Credit: Some of slides are extracted from the course notes of prof. Mathieu Desburn (USC) and prof. Han-Wei Shen (Ohio State University). CSC.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Shadows.
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.
黃聰賢. Light Position Mesh Polygon Shadow Polygon  Clear color buffer and stencil buffer  Render the scene with ambient only.
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering Cass Everitt and Mark J. Kilgard Speaker: Alvin Date: 5/28/2003 NVIDIA.
Shadow Silhouette Maps Pradeep Sen, Mike Cammarano, Pat Hanrahan Stanford University.
1 Dynamic Shadows and Lighting for Walkthrus of Large Models Brandon Lloyd COMP 258 December 2002.
Shadow Algorithms Gerald Matzka Computer Science Seminar.
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.
© 2004 Tomas Akenine-Möller1 Shadow Generation Hardware Vision day at DTU 2004 Tomas Akenine-Möller Lund University.
CSE 872 Dr. Charles B. Owen Advanced Computer Graphics1 Other Rendering Techniques Types of rendering – Wireframe techniques – Scan-line conversion – Reyes.
Computer Graphics Shadows
09/18/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Bump Mapping Multi-pass algorithms.
Creating Reflections and Shadows Using Stencil Buffers Mark J. Kilgard NVIDIA Corporation.
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.
CS 638, Fall 2001 Today Light Mapping (Continued) Bump Mapping with Multi-Texturing Multi-Pass Rendering.
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.
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 10/24/ :01 UML Graphics II Shadows Session 4.
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.
Rendering Fake Soft Shadows with Smoothies Eric Chan Massachusetts Institute of Technology.
Computer graphics & visualization Shadows / Transparency.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
What are shaders? In the field of computer graphics, a shader is a computer program that runs on the graphics processing unit(GPU) and is used to do shading.
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.
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.
CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi.
Shadow Maps & Smoothies CS 446: Real-Time Rendering & Game Technology David Luebke University of Virginia.
Shuen-Huei Guan Seminar in CMLab, NTU
CENG 477 Introduction to Computer Graphics
Stenciling Effects Glenn G. Chappell
Discrete Techniques.
Real-Time Rendering Shadow Volumes
Jim X. Chen George Mason University
Real-time Rendering Shadow Maps
UMBC Graphics for Games
Texture and Shadow Mapping
Computer Graphics Practical Lesson 9
Ref: OpenGL Programming Guide (The Red Book)
Frame Buffer Applications
Presentation transcript:

CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi

Shadow Volumes

Stencil Buffer Like color/z buffer; one entry per pixel Like color/z buffer; one entry per pixel Traditionally a few bits of Z-buffer Traditionally a few bits of Z-buffer Stencil value also masks whether to render Stencil value also masks whether to render Render to Stencil Render to Stencil Stencil operation Stencil operation void StencilFunc (enum func, int ref, uint mask ) NEVER, ALWAYS, LESS, LEQUAL, EQUAL, GEQUAL, GREATER, or NOTEQUAL void StencilOp (enum sfail, enum zfail, enum zpass) KEEP, ZERO, REPLACE, INCR, DECR, INVERT KEEP, ZERO, REPLACE, INCR, DECR, INVERT glEnable(GL_STENCIL_TEST)

Stencil Shadow Volume Overview Render the scene with shadow color Render the scene with shadow color For each light source For each light source Using the depth from pass 1, construct a mask in the stencil buffer enabling pixels not in shadow Using the depth from pass 1, construct a mask in the stencil buffer enabling pixels not in shadow Shadow volume constructed by computing silhouettes of occluders Shadow volume constructed by computing silhouettes of occluders And capping the volumes And capping the volumes Render the scene again, lit this time. Render the scene again, lit this time. Stencil buffer masks out shadowed areas Stencil buffer masks out shadowed areas

Stencil Generation Disable depth and color writes Disable depth and color writes Set the stencil operation to increment on depth pass (counting shadows in front of the object) Set the stencil operation to increment on depth pass (counting shadows in front of the object) Enable back-face culling (ie front drawing) Enable back-face culling (ie front drawing) Draw the shadow volumes (ie front faces) Draw the shadow volumes (ie front faces) Set the stencil operation to decrement on depth pass Set the stencil operation to decrement on depth pass Enable front-face culling Enable front-face culling Draw the shadow volumes (ie back faces) Draw the shadow volumes (ie back faces) What if Eye is in shadow?

Stencil Shadow Volumes a b

Reverse Stencil Disable depth and color writes Disable depth and color writes Enable front-face culling Enable front-face culling Set the stencil operation to increment on depth fail (counting shadows behind the object). Set the stencil operation to increment on depth fail (counting shadows behind the object). Render the shadow volumes (ie back faces) Render the shadow volumes (ie back faces) Enable back-face culling Enable back-face culling Set the stencil operation to decrement on depth fail. Set the stencil operation to decrement on depth fail. Render the shadow volumes (ie front faces) Render the shadow volumes (ie front faces)

Shadow Map Aliasing single shadow map pixel

Perspective Shadow Maps [Stamminger & Grettakis 02] [Stamminger & Grettakis 02]

Deep Shadow Map Deep shadow maps Deep shadow maps Instead of storing a depth at each pixel Instead of storing a depth at each pixel Store a series of depths w/ reduction of light transmitted Store a series of depths w/ reduction of light transmitted Important for complex self- shadowing models Important for complex self- shadowing models Hair, clouds Hair, clouds [Lokovic & Veach 2000]

Deep Shadow Maps With self-shadowing Without self-shadowing

Shadows from Area Light Accumulation buffer Accumulation buffer Higher resolution than final image Higher resolution than final image Sample area light Sample area light Render from multiple light-points Render from multiple light-points Average Average [Heckbert & Herf 97] Overlapping shadows have undesired artifacts

Fake Soft Shadows Extend shadow map [Chan & Durand 03] Extend shadow map [Chan & Durand 03] Use extra primitives (smoothies) to soften shadows 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 not geometrically correct Shadows appear qualitatively like soft shadows Shadows appear qualitatively like soft shadows Hard shadowsFake soft shadows

Shadow Map Creation Render blockers into depth map Render blockers into depth map light’s view observer’s view

Silhouette Detection Find blockers’ silhouette edges in object space Find blockers’ silhouette edges in object space object-space silhouettes observer’s view light’s view

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

Construct Smoothies Blocker + smoothies: Blocker + smoothies: silhouette vertex silhouette edges smoothie edge smoothie corner t t blocker exterior

Construct Smoothies Smoothie edges: rectangles in screen space with a fixed width Smoothie edges: rectangles in screen space with a fixed width Smoothie corners: connect adjacent smoothie edges Smoothie corners: connect adjacent smoothie edges t t geometryshading

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

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

Hard Shadow Image sample behind blocker (intensity = 0) Image sample behind blocker (intensity = 0) smoothie light source blocker receiver completely in shadow

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

No Shadow Image sample illuminated (intensity = 1) Image sample illuminated (intensity = 1) illuminated smoothie light source blocker receiver