1 Dr. Scott Schaefer Shadows. 2/40 Shadows Shadows provide clues about depth Make scenes appear more realistic.

Slides:



Advertisements
Similar presentations
8.1si31_2001 SI31 Advanced Computer Graphics AGR Lecture 8 Polygon Rendering.
Advertisements

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.
Optimized Stencil Shadow Volumes
Optimized Stencil Shadow Volumes
Game Programming 09 OGRE3D Lighting/shadow in Action
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
Shadow Rendering Techniques A point is in the shadow of a light source if it can not be “seen” by the light source, i.e. the line segment that connects.
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.
1 Dr. Scott Schaefer Hidden Surfaces. 2/62 Hidden Surfaces.
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering Cass Everitt and Mark J. Kilgard Speaker: Alvin Date: 5/28/2003 NVIDIA.
1 Dynamic Shadows and Lighting for Walkthrus of Large Models Brandon Lloyd COMP 258 December 2002.
Shadow Algorithms Gerald Matzka Computer Science Seminar.
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
1 Dr. Scott Schaefer Radiosity. 2/38 Radiosity 3/38 Radiosity Physically based model for light interaction View independent lighting Accounts for indirect.
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
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.
Hidden Surface Removal
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.
Technology and Historical Overview. Introduction to 3d Computer Graphics  3D computer graphics is the science, study, and method of projecting a mathematical.
CHAPTER 11 Shadows © 2008 Cengage Learning EMEA. LEARNING OBJECTIVES In this chapter you will learn about: – –Shadow rendering algorithms – –Blinn’s shadow.
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 Dr. Scott Schaefer Ray Tracing. 2/42 Ray Tracing Provides rendering method with  Refraction/Transparent surfaces  Reflective surfaces  Shadows.
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.
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.
Binary Space Partitioning Trees Ray Casting Depth Buffering
Advanced Computer Graphics Shadow Techniques CO2409 Computer Graphics Week 20.
Computer graphics & visualization Shadows / Transparency.
OpenGL Shadow. Content Shadowing using Stencil Buffer Shadowing using Projective Texture Shadow map Shadow volume.
1 Dr. Scott Schaefer Intersecting Simple Surfaces.
09/16/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Environment mapping Light mapping Project Goals for Stage 1.
CS123 | INTRODUCTION TO COMPUTER GRAPHICS Andries van Dam © Visible Surface Determination (VSD) To render or not to render, that is the question… 1 of.
Rendering Pipeline Fall, D Polygon Rendering Many applications use rendering of 3D polygons with direct illumination.
1 Perception and VR MONT 104S, Fall 2008 Lecture 20 Computer Graphics and VR.
Real-Time Dynamic Shadow Algorithms Evan Closson CSE 528.
1 CSCE 441: Computer Graphics Hidden Surface Removal Jinxiang Chai.
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.
01/28/09Dinesh Manocha, COMP770 Visibility Computations Visible Surface Determination Visibility Culling.
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
Rendering Pipeline Fall, 2015.
Real-Time Rendering Shadow Volumes
Hidden Surfaces Dr. Scott Schaefer.
3D Graphics Rendering PPT By Ricardo Veguilla.
Jim X. Chen George Mason University
CSCE 441: Computer Graphics Hidden Surface Removal
Introduction to Computer Graphics with WebGL
Real-time Rendering Shadow Maps
Radiosity Dr. Scott Schaefer.
UMBC Graphics for Games
Texture and Shadow Mapping
Frame Buffer Applications
Presentation transcript:

1 Dr. Scott Schaefer Shadows

2/40 Shadows Shadows provide clues about depth Make scenes appear more realistic

3/40 Shadows Shadows provide clues about depth Make scenes appear more realistic

4/40 Shadow Algorithms Simple/Planar Shadows Shadow Maps Shadow Volumes

5/40 Simple/Planar Shadows Projection of an object onto a planar surface (floor/wall) Build projection matrix from light to wall Draw object in black using projection matrix Image taken from

6/40 Simple/Planar Shadows Fast and simple Does not account for self-shadowing Only works for planar surfaces (nothing else has shadows cast on it) Image taken from

7/40 Shadow Maps

8/40 Shadow Maps Render scene from light’s perspective

9/40 Shadow Maps Render scene from light’s perspective Shadow Map

10/40 Shadow Maps Render scene from light’s perspective Render scene from viewer’s perspective

11/40 Shadow Maps Render scene from light’s perspective Render scene from viewer’s perspective For every pixel  Transform to world space  Compare distance to value in shadow map

12/40 Shadow Maps Render scene from light’s perspective Render scene from viewer’s perspective For every pixel  Transform to world space  Compare distance to value in shadow map

13/40 Shadow Maps Render scene from light’s perspective Render scene from viewer’s perspective For every pixel  Transform to world space  Compare distance to value in shadow map In shadow!

14/40 Shadow Maps Render scene from light’s perspective Render scene from viewer’s perspective For every pixel  Transform to world space  Compare distance to value in shadow map In shadow!

15/40 Shadow Maps Render scene from light’s perspective Render scene from viewer’s perspective For every pixel  Transform to world space  Compare distance to value in shadow map Not in shadow!

16/40 Shadow Maps Image taken from

17/40 Shadow Maps Advantages  Simple to implement  Does not depend on scene complexity (except to render shadow map) Disadvantages  Fixed resolution image leads to artifacts  Omni-directional light sources require 6 shadow maps to cover every direction

18/40 Perspective Shadow Maps Shadow maps are limited by screen resolution and depend on object distance! Small distance

19/40 Perspective Shadow Maps Shadow maps are limited by screen resolution and depend on object distance! Huge distance

20/40 Perspective Shadow Maps Distort viewing transformation from light’s perspective to create a more uniform sampling from viewer’s perspective Image taken from “Perspective Shadow Maps”

21/40 Perspective Shadow Maps Distort viewing transformation from light’s perspective to create a more uniform sampling from viewer’s perspective Image taken from “Perspective Shadow Maps”

22/40 Anatomy of a Shadow Shadowing object Partially shadowed object Light source Eye position (note that shadows are independent of the eye position) Surface inside shadow volume (shadowed) Surface outside shadow volume (illuminated) Shadow volume (infinite extent)

23/40 Shadow Volumes Build polygons for shadow volumesexplicitly Render shadow volume polygons from viewer’s perspective and count inside/outside shadows Image taken from “Practical & Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering”

24/40 Shadow Volumes Shadowing object Light source Eye position

25/40 Shadow Volumes Shadowing object Light source zero Eye position

26/40 Shadow Volumes Shadowing object Light source zero Eye position Unshadowed object Shadow Volume Count = = 0

27/40 Shadow Volumes Shadowing object Light source zero Shadowed object Shadow Volume Count = = 2 Eye position

28/40 Shadow Volumes Shadowing object Light source zero Unshadowed object Shadow Volume Count = 0 Eye position

29/40 Implementing Shadow Volumes For each surface, find silhouette edges Build shadow volume (viewer independent) by extending away from light Image taken from “Practical & Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering”

30/40 Implementing Shadow Volumes Use stencil buffer to count intersections with shadow volume  Render front faces and increment if closer to viewer  Render back faces and decrement if closer to viewer  Don’t update color or depth values!!!! If stencil buffer is non-zero, then pixel in shadow Image taken from “Practical & Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering” Stencil value 1 Stencil value 0

31/40 Shadow Volumes: Examples Images taken from “Practical & Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering”

32/40 Shadow Volumes: Examples Image taken from “Doom 3”

33/40 Problems with Shadow Volumes zero Near clip plane Far clip plane

34/40 Problems with Shadow Volumes zero Near clip plane Far clip plane Missed shadow volume intersection due to near clip plane clipping; leads to mistaken count

35/40 Problems with Shadow Volumes Shadowing object Light source Shadow test fails! Shadow Volume Count = 0 Eye position

36/40 Shadow Volumes Advantages  Omni-directional light sources  Proper self-shadowing behavior  Pixel perfect shadows Disadvantages  Surfaces can only use planar polygons  Silhouette computation uses CPU  Heavy on fill-rate  Near/Far clipping planes lead to problems

37/40 Soft Shadows Point lights cause hard shadows Lights are not infinitely small points in reality Area light sources cause soft shadows

38/40 Soft Shadows Point lights cause hard shadows Lights are not infinitely small points in reality Area light sources cause soft shadows

39/40 Soft Shadows Simulate area lights with lots of points lights Image taken from “Practical & Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering” Expensive The cluster of point lights.

40/40 Soft Shadows Simulate area lights with lots of points lights Blur shadows in image space Cheap, inaccurate

41/40

42/40 Solution: Invert Depth Test Shadowing object Light source Shadowed object Shadow Volume Count = =-1 Eye position - + -

43/40 Solution: Invert Depth Test Shadowing object Light source Shadowed object Shadow Volume Count = =-1 Eye position Now have problem with far clipping plane