Shadow Algorithms - PowerPoint PPT Presentation

About This Presentation
Title:

Shadow Algorithms

Description:

Objects appear not anchored. Shadow provides additional information. Second view ... Contra: blocky, self-shadowing, compare with neighbor, drawn twice. 13 / 22 ... – PowerPoint PPT presentation

Number of Views:87
Avg rating:3.0/5.0
Slides: 24
Provided by: gerald102
Category:

less

Transcript and Presenter's Notes

Title: Shadow Algorithms


1
Shadow Algorithms
  • Gerald Matzka
  • Computer Science Seminar

2
Overview
  • Introduction
  • Shadow Algorithms
  • Fake Shadow
  • Vertex Projection
  • Shadow Z-Buffer
  • Shadow Volume
  • Shadow Volume Reconstruction
  • Static Shadow
  • Use Cases

3
Introduction
  • Why Shadow?
  • What is Shadow?
  • Anatomy of Shadow
  • Umbra vs. Penumbra
  • Shadow Volume

4
Why Shadow?
  • Objects appear not anchored
  • Shadow provides additional information
  • Second view of an object
  • Without shadow object seems to float
  • State of the art

5
Definition Shadow
  • An area that is only partially irradiated or
    illuminated due to blockage of light by an opaque
    object.
  • A point is in shadow relative to a given light
    source if rays from that light source cannot
    directly reach the point. Shadowed points cannot
    see the light.

6
Umbra vs. Penumbra
  • Area light sources produce soft shadow
  • Umbra area in full shadow
  • Penumbra boundary area gradient from full
    shadow to light

7
Definition Shadow Volume
  • Shadow planes
  • Volume formed from shadow planes
  • Open and infinite
  • Inside in shadow - outside in light
  • Must be clipped and capped

8
Shadow Algorithms
  • Fake Shadow
  • Vertex Projection
  • Shadow Z-Buffer
  • Shadow Volume
  • Shadow Volume Reconstruction
  • Static Shadow

9
Fake Shadow
  • No exact calculation
  • Approximation of shadow position and shape
  • Estimated by center or anchor of object
  • Pro simple, fast
  • Contra flat ground, only ground shading, not
    exact, rotate limitations

10
Vertex Projection
  • Object projected to ground
  • Exact mathematical calculation
  • Pro still simple, exact, no rotate limitations
  • Contra flat ground, only ground shading

11
Shadow Z-Buffer
  • Based on hidden surfaces
  • Lights point of view rendering into Z-Buffer
  • Cameras point of view rendering, lookup in
    Z-Buffer
  • Transformation between camera and light view
  • Z-value compare - shadowed or lit

12
Shadow Z-Buffer cont.
  • Problems inaccuracies in calculations
  • self-shadowing small fudge factor
  • point-sampling area-sampling
  • Pro accurate, medium effort
  • Contra blocky, self-shadowing, compare with
    neighbor, drawn twice

13
Shadow Volumes
  • Count of Shadow Volumes at viewing position
  • front plus ? back minus
  • Three steps
  • silhouette generation
  • drawing of shadow volume(s)
  • rendering the shadow

14
Shadow Volumes cont.
  • Step 1 Silhouette generation
  • boundaries between adjacent front-facing and
    back-facing polygons ? silhouette
  • adding light vertex to silhouette vertexes ?
    shadow planes
  • shadow planes together with object ? shadow volume

15
Shadow Volumes cont.
  • Step 2 Drawing of Shadow volume
  • rendered twice in stencil buffer (cull-mode)

16
Shadow Volumes cont.
  • Step 3 Rendering the Shadow
  • stencil buffer holds shadow
  • render a polygon using stencil buffer bits
  • shadow for one light created
  • Repeat for next light from step 1

17
Shadow Volumes cont.
  • Pro
  • greatly improved realism
  • hardware support of stencil buffer
  • Contra
  • high requirement on fill-rate
  • sharp shadow
  • additional scene management

18
Shadow Volume Reconstruction
  • mixture of Z-Buffer and Shadow Volume
  • lights point of view rendering
  • edge filter to create silhouette image
  • silhouette image used as shadow volume
  • clip and cap shadow volume
  • draw shadow volume
  • apply shadow accordingly

19
Shadow Volume Reconstruction
  • Pro
  • smoother than Z-Buffer
  • faster than Shadow Volume
  • Contra
  • additional step (edge filter, reconstruction)
  • inaccuracies (edge filter, reconstruction)

20
Static Shadow
  • not a real-time Shadow Algorithm
  • none moving or none animating objects
  • pre-calculated shadow maps
  • rendered as normal polygons

21
Use Cases
  • Games and 3D Engines
  • Ray-Tracers (no real-time shading)
  • Trade-Off between speed and quality!!!
  • Outcast derived Z-Buffer algorithm, caused by
    voxel and polygon mixture

22
Conclusion
  • Shadow gives large amount of information
  • Shadow generation is a classic computer graphics
    problem
  • Several basic algorithms with advantages and
    disadvantages
  • State of the art in modern computer games

23
The End
  • Thanks for listening!
Write a Comment
User Comments (0)
About PowerShow.com