Shadows. Shadows is important in scenes, consolidating spatial relationships “Geometric shadows”: the shape of an area in shadow Early days, just pasted.

Slides:



Advertisements
Similar presentations
Lecture 8 Transparency, Mirroring
Advertisements

Technische Universität München Computer Graphics SS 2014 Graphics Effects Rüdiger Westermann Lehrstuhl für Computer Graphik und Visualisierung.
Computer Graphics methods
Week 7 - Monday.  What did we talk about last time?  Specular shading  Aliasing and antialiasing.
Week 10 - Monday.  What did we talk about last time?  Global illumination  Shadows  Projection shadows  Soft shadows.
3D Graphics Rendering and Terrain Modeling
03/12/02 (c) 2002 University of Wisconsin, CS559 Last Time Some Visibility (Hidden Surface Removal) algorithms –Painter’s Draw in some order Things drawn.
Computer Graphics Visible Surface Determination. Goal of Visible Surface Determination To draw only the surfaces (triangles) that are visible, given a.
Part I: Basics of Computer Graphics
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.
Chapter 6: Vertices to Fragments Part 2 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley Mohan Sridharan Based on Slides.
CS 325 Introduction to Computer Graphics 04 / 09 / 2010 Instructor: Michael Eckmann.
Practical and Robust Stenciled Shadow Volumes for Hardware-Accelerated Rendering Cass Everitt and Mark J. Kilgard Speaker: Alvin Date: 5/28/2003 NVIDIA.
Shadow Algorithms Gerald Matzka Computer Science Seminar.
1 CSCE 441: Computer Graphics Hidden Surface Removal (Cont.) Jinxiang Chai.
7M836 Animation & Rendering
1 7M836 Animation & Rendering Global illumination, ray tracing Arjan Kok
Vertices and Fragments III Mohan Sridharan Based on slides created by Edward Angel 1 CS4395: Computer Graphics.
Part I: Basics of Computer Graphics Rendering Polygonal Objects (Read Chapter 1 of Advanced Animation and Rendering Techniques) Chapter
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.
Direct Illumination with Lazy Visibility Evaluation David Hart Philip Dutré Donald P. Greenberg Cornell University SIGGRAPH 99.
Ray Tracing Primer Ref: SIGGRAPH HyperGraphHyperGraph.
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.
Computer Graphics Panos Trahanias ΗΥ358 Spring 2009.
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.
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.
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.
Computer Graphics The Rendering Pipeline - Review CO2409 Computer Graphics Week 15.
Shadow Mapping Chun-Fa Chang National Taiwan Normal University.
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.
CS 325 Introduction to Computer Graphics 03 / 24 / 2010 Instructor: Michael Eckmann.
CS 325 Introduction to Computer Graphics 03 / 22 / 2010 Instructor: Michael Eckmann.
Hidden Surface Removal
Implementation II.
Computer graphics & visualization Shadows / Transparency.
Global Illumination. Local Illumination  the GPU pipeline is designed for local illumination  only the surface data at the visible point is needed to.
Ray Tracing Fall, Introduction Simple idea  Forward Mapping  Natural phenomenon infinite number of rays from light source to object to viewer.
11/24/ :45 Graphics II Shadow Maps Reflections Session 5.
COMPUTER GRAPHICS CS 482 – FALL 2015 SEPTEMBER 29, 2015 RENDERING RASTERIZATION RAY CASTING PROGRAMMABLE SHADERS.
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.
09/23/03CS679 - Fall Copyright Univ. of Wisconsin Last Time Reflections Shadows Part 1 Stage 1 is in.
Visible-Surface Detection Methods. To identify those parts of a scene that are visible from a chosen viewing position. Surfaces which are obscured by.
Rendering Pipeline Fall, 2015.
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
Lighting.
Texture and Shadow Mapping
Frame Buffer Applications
Presentation transcript:

Shadows

Shadows is important in scenes, consolidating spatial relationships “Geometric shadows”: the shape of an area in shadow Early days, just pasted into the scene as textures to fake the shadow (can you think of any other places of such usage? )

Type of Shadows Sharp-edged or soft-edged? Umbra and penumbra –Umbra: the area completely cut off from the light source –Penumbra: receives some light from the light source (penumbra surrounds umbra) Depending on the types of light sources, may or may not get penumbra –Point source –Area source

A Simple Shadow on A Ground Plane (Blinn’88) Throwing shadows onto a flat plane Only works with scenes where objects don’t cast shadows on each other Assuming single light source at infinite distance – parallel light rays L(x l, y l, z l ) Point on the object P(x p, y p, z p ) Shadow at S(x sw, y sw, 0)

Blinn’s Algorithm Considering the geometry: S = P -  L

Blinn’s Shadow Algorithm In matrix form: In fact, this is a form of projection, oblique projection

Shadow Algorithms Basic idea: Determine which surfaces can be "seen" from the light source Surfaces that can not be seen from the light are in shadow Shadows in the illumination model: I = ambient +  Si (diffuse + specular) Si = 0 if light i is blocked (will cast a shadow) Si = 1 if light i is not blocked (the point is lit)

General approach Main idea: –Point P is in shadow  P is not visible from light source 4 algorithms are discussed in the following: –Shadow z-buffer, two-pass z-buffer or (shadow map) –Shadow volume –Shadowing using Weiler-Atherton algorithm –Projecting Polygons/Span-line

Shadow Map  1 st pass: create a z-buffer from light position, store distance from light source in shadow-buffer [x][y]. (only z-buffer, no color buffer)  2 nd pass: do z-buffer from eye position. for each visible pixel (x,y,z) in 3D image space  inverse map to world space  map to screen space of shadow buffer  Compare z with that in the shadow buffer[x][y]  If shadow buffer[x][y] is smaller, pixel is in shadow!!

Shadow Map Advantage: –Simple Disadvantage: –Shadow distance from light position may appear blocky –Storage –Light source in the view volume?

Shadow Volumes Create a shadow volume for each front facing polygon Put shadow volumes in the polygon database (just mark the polygons of the shadow volume as in-visible) Do parity test to determine if a visible point is in shadow or not

Shadow Volumes

 Front facing polygon hides all in back (A); back-facing does not(C); vector view-to-point hits more front ones  One way to implement  For each pixel, need to keep a counter  Need to make sure the polygons are rendered in depth order, say, front-to-back  Every time a front-facing shadow polygon is encountered, increment  Every time a back-facing shadow polygon is encountered, decrement  Does it matter if the view point is in shadows? Using Shadow Volumes

Shadow Volume Example

Shadow Volume Advantage: –Object space precision Disadvantage: –Polygon count explodes with object complexity of geometry and number of light sources

Shadowing using Weiler- Atherton Algorithm Using the Weiler-Atherton visible surface determination algorithm twice: First for the light source, and then for the viewpoint (an object space method)

Algorithm 1.Perform Weiler-Atherton algorithm to extract visible polygon fragments to the light source 2.Transform the lit polygon fragments back into the modeling space. Each polygon fragment is linked to its original polygon as the surface detail polygons 3.Perform the regular visible surface determination again for the view point using Weiler-Atherton algorithm (note: we don’t need to consider the surface detail polygons here as they are coplanar with their original polygons) 4.Visible surfaces covered by surface detail polygons are rendered as lit, whereas uncovered visible surfaces are rendered in shadow. For multiple light sources, we perform (1),(2) multiple times

WA Shadowing

Shadows – Span line Pre-process –Project all polygons onto a sphere center around the light source –Disjoint ones are discarded –Overlapping ones are marked as ‘shadow pairs’ Output: for each polygon, there are a list of polygons that will cast shadows on it

 Run time, use a modified span-line rendering algorithm  For each polygon with an empty ‘shadow pair’ list, proceed as usual  Otherwise, project the shadow polygons onto the plane where the current polygon resides  A casts shadow A’ on B Shadows – Span Line

Three cases of spans Shadow polygon does not cover the current scan-line (span) that is being generated Shadow polygon completely cover the current span Shadow polygon covers the current span partially

Span-Line Shadow Object space High time complexity