the shadow knows Shadow Algorithms Who knows what evil lurks in the - - PDF document

the shadow knows shadow algorithms
SMART_READER_LITE
LIVE PREVIEW

the shadow knows Shadow Algorithms Who knows what evil lurks in the - - PDF document

the shadow knows Shadow Algorithms Who knows what evil lurks in the hearts of men? Why shadows? Anatomy of a shadow Increase realism Umbra Area completely obscured by object Shows relationships between objects. Hard


slide-1
SLIDE 1

1

Shadow Algorithms …the shadow knows

Who knows what evil lurks in the hearts of men?

Why shadows?

Increase realism Shows relationships between objects.

Anatomy of a shadow

Umbra

Area completely obscured by object “Hard” shadows

Penumbra

Area partially obscured by object “Soft” shadows

Anatomy of a shadow

Learner.org

Anatomy of a Shadow

Learner.org

slide-2
SLIDE 2

2

Anatomy of a shadow

Watt / Policarpo

Shadows and Computer Graphics

Notes about shadows in computer

graphics

Still an area of active research

Soft shadows Real time / efficient techniques

In Global illumination algorithms shadows,

even soft shadows, come “for free”.

Precalculated and “mapped” shadows.

Classic Shadow Algorithms

Projecting Polygons / scan line Shadow volumes Shadow Z-Buffer (Shadow Map)

Scan Line Algorithm

[Appel 1968][Kelley 1970]

Object space algorithm

Uses aux data structure that records, for each

polygon pair, if one polygon shadows another.

Projection from light source onto a sphere Number of possible entries = n(n-1) Used in conjunction with a scan line algorithm

Scan Line Algorithm

Projection

Scan Line Algorithm

(a) A is visible (b) B is visible (c) B is shadowed by A (d) B is visible

Watt / Policarpo

slide-3
SLIDE 3

3

Shadow Volumes

[Crow 1977]

Object space

Calculate volume swept out by shadow

  • f an object

Intersect this volume with view volume

Shadow volumes

Watt / Policarpo

Shadow Volumes

Watt / Policarpo

Shadow Volumes

Advantages

Can shadow anything (including self-

shadowing)

Disadvantages

Must construct the shadow volumes Counting problem

Shadow z-buffer (Shadow Map)

[Williams 1978]

Image space

Use a Z buffer (depth buffer) from light

source point of view and use as a texture onto scene rendered from viewpoint

Shadow Map

Step 1 (Construct shadow map)

The view of the scene is constructed from

the light source’s point of view.

The depth values (Z) for the objects

closest to the light source are stored to the depth map for each point.

slide-4
SLIDE 4

4

Shadow Map

Step 2 – Use Shadow Map

Render scene from viewpoint use the saved depth buffer as a texture

which is projected from the light's position

compare the value from the texture

projected onto the point to the distance from the point to the light

Shadow Map

http://www-sop.inria.fr/reves/personnel/Marc.Stamminger/psm/

Shadow Map

Basic Z buffer algorithm

Initialize frame buffer (to background) Initialize Z-buffer (to 0) For each polygon P { For each pixel p in polygon’s projection { z = P’s z at pixel p if (z > Zbuffer at that pixel) { zBuffer at pixel = z Frame buffer at pixel = calcColor() } }

Shadow Map

Modified Z buffer algorithm

Initialize frame buffer (to background) Initialize Z-buffer (to 0) For each polygon P { For each pixel p in polygon’s projection { z = P’s z at pixel p if (z > Zbuffer at that pixel) { zBuffer at pixel = z Frame buffer at pixel = calcColor() if ( z > shadow depth) place in shadow } }

Shadow Map

Advantages

Z-buffer, projection supported in hardware

Disadvantages

Aliasing Self shadowing difficult

Building a Better Shadow Map

Filtering

slide-5
SLIDE 5

5

Building a Better Shadow Map

Deep Shadow Maps

shadow maps store visibility functions for

every pixel.

function describes how the light passes

from the shadow camera origin to the desired pixel.

0 – 1 rather than 0 or 1.

Building a Better Shadow Map

Lokovic/Veach 2000

Summary

Shadows…the shadow knows Classic Shadow Algorithms

Scan line Shadow volumes Shadow maps

Shadow algorithms are still an active research

area.

Questions?

Wednesday

Peter Anderson…

Linear Pixel Shuffling Don’t forget 1 page summary!