Docsity

Lecture Slides on Shadows - Computer Graphics | CS 412, Lab Reports of Computer Graphics

Toggle sidebar
bg1
1
ECE/CS 412 Introduction to Computer Graphics
Pradeep Sen Class 25– November 26, 2008
ECE/CS 412
Introduction to
Computer Graphics
Pradeep Sen
Advanced Graphics Lab
Class 25
November 26, 2008
ECE/CS 412 Introduction to Computer Graphics
Pradeep Sen Class 25– November 26, 2008
Shadows
ECE/CS 412 Introduction to Computer Graphics
Pradeep Sen Class 25– November 26, 2008
Shadows are an important part of any image
Help define the spatial relationship between
objects
source: artis.imag.fr
ECE/CS 412 Introduction to Computer Graphics
Pradeep Sen Class 25– November 26, 2008
Shadows are an important part of any image
Help define the spatial relationship between
objects
Create “mood” for scene
Toy Story 2, Pixar (1999)
ECE/CS 412 Introduction to Computer Graphics
Pradeep Sen Class 25– November 26, 2008
Shadows are an important part of any image
Help define the spatial relationship between
objects
Create “mood” for scene
Add to game play
Doom 3, id (2004) ECE/CS 412 Introduction to Computer Graphics
Pradeep Sen Class 25– November 26, 2008
Shadows are an important part of any image
Help define the spatial relationship between
objects
Create “mood” for scene
Add to game play
Make an image look photorealistic
Final Fantasy, Square (2001)
pf3
pf4
pf5

Partial preview of the text

Download Lecture Slides on Shadows - Computer Graphics | CS 412 and more Lab Reports Computer Graphics in PDF only on Docsity!

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

ECE/CS 412

Introduction to

Computer Graphics

Pradeep Sen Advanced Graphics Lab

Class 25 November 26, 2008

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Shadows

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Shadows are an important part of any image

ƒ Help define the spatial relationship between objects

source: artis.imag.fr ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Shadows are an important part of any image ƒ Help define the spatial relationship between objects ƒ Create “mood” for scene

Toy Story 2 , Pixar (1999)

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Shadows are an important part of any image

ƒ Help define the spatial relationship between objects

ƒ Create “mood” for scene

ƒ Add to game play

Doom 3 , id (2004) ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Shadows are an important part of any image ƒ Help define the spatial relationship between objects ƒ Create “mood” for scene ƒ Add to game play ƒ Make an image look photorealistic

Final Fantasy , Square (2001)

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Why are shadows so hard to compute?

ƒ This is the first example of non-local light transport we are looking at

ƒ Consider our rendering model: as we rasterize each triangle and shade it we don’t have information about the rest of the scene!

ƒ To render shadows, we have to know what else is going on in the scene

ƒ An example of “global illumination”

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Kinds of shadows

ƒ Hard shadows

  • Shadows cast from a point light source
  • Everything is either lit or not ƒ Soft shadows
  • Shadows cast from an area light source
  • Some points see the entire light source, some see none of it, and some see part of it

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Examples

Hard shadows Soft shadows

Sen et al. SIGGRAPH 2003 Ng et al. SIGGRAPH 2004

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Hard shadows

ƒ There are several algorithms to cast hard shadows in real-time:

  • Precomputed
  • Approximations
  • Correct self-shadowing

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Planar shadows

ƒ Used to cast shadows onto a flat plane

ƒ Very common in games

Madden 2007 , Electronic Arts (2006) ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Planar shadows

ƒ Used to cast shadows onto a flat plane ƒ Very common in games

Madden 2007 , Electronic Arts (2006)

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Problems with shadow maps

ƒ Aliasing artifacts because of quantization of depth map!

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Proposed solutions for artifacts

ƒ For the past 20 years, there have been many proposed solutions to address these quantization artifacts

  • Percentage Closer Filtering (Reeves et al.)
  • Perspective Shadow Maps (Stamminger et al.)
  • Adaptive Shadow Maps (Fernando et al.)
  • Silhouette Shadow Maps (Sen et al.)
  • etc.

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Percentage closer filtering

ƒ Developed by Reeves et al. SIGGRAPH 1987 to address these artifacts

ƒ Observation: multiple samples can be used to reduce quantization artifacts

ƒ The trick is how to filter these samples properly

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Adaptive shadow maps

ƒ Developed by Fernando et al. SIGGRAPH 2001 ƒ Observation: combat aliasing by dedicating more samples to the region that the user is currently viewing ƒ They develop a hierarchical structure that stores depth maps of varying resolutions

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Adaptive shadow maps

standard shadow maps adaptive shadow maps

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Perspective shadow maps

ƒ Developed by Stamminger and Drettakis (SIGGRAPH 2002) ƒ Observation: one source of artifacts is the differences in perspective projection between the light source and viewer ƒ Combat these artifacts by transforming the objects by the eye’s perspective projection before computing the shadow map

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Sources of artifacts

From Stamminger et al. SIGGRAPH 02

cos( )

cos() α

β i s s r d = dr

Perspective aliasing Projective aliasing ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Perspective shadow maps

From Stamminger et al. SIGGRAPH 02

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Perspective shadow maps results

standard shadow maps (^) perspective shadow maps

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Problems with perspective shadow maps

ƒ Lots of special cases that are difficult to implement

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

Shadow silhouette maps

ƒ Observation: shadow maps work well in regions that are fully lit and regions that are fully shadowed

ƒ The quantization artifacts are due to the approximation of the sample as a box

ƒ Can we use the silhouette map algorithm to deform the box to match shadow discontinuities?

ECE/CS 412 Introduction to Computer Graphics Pradeep Sen Class 25– November 26, 2008

depth map

Shadow silhouette map algorithm

silhouette map

Enhance the depth map with a new texture: the silhouette map