CSL 859: Advanced Computer Graphics - PowerPoint PPT Presentation

About This Presentation
Title:

CSL 859: Advanced Computer Graphics

Description:

CSL 859: Advanced Computer Graphics Dept of Computer Sc. & Engg. IIT Delhi – PowerPoint PPT presentation

Number of Views:89
Avg rating:3.0/5.0
Slides: 26
Provided by: sub72
Category:

less

Transcript and Presenter's Notes

Title: CSL 859: Advanced Computer Graphics


1
CSL 859 Advanced Computer Graphics
  • Dept of Computer Sc. Engg.
  • IIT Delhi

2
Shadow Volumes
3
Shadow Volumes
4
Stencil Buffer
  • Like color/z buffer one entry per pixel
  • Traditionally a few bits of Z-buffer
  • Stencil value also masks whether to render
  • Render to Stencil
  • Stencil operation
  • void StencilFuncĀ (enum func, int ref, uint mask
    ) NEVER, ALWAYS, LESS, LEQUAL, EQUAL,
    GEQUAL, GREATER, or NOTEQUALvoid
    StencilOpĀ (enum sfail, enum zfail, enum zpass)
  • KEEP, ZERO, REPLACE, INCR, DECR, INVERT
  • glEnable(GL_STENCIL_TEST)

5
Stencil Shadow Volume Overview
  • Render the scene with shadow color
  • For each light source
  • Using the depth from pass 1, construct a mask in
    the stencil buffer enabling pixels not in shadow
  • Shadow volume constructed by computing
    silhouettes of occluders
  • And capping the volumes
  • Render the scene again, lit this time.
  • Stencil buffer masks out shadowed areas

6
Stencil Generation
  • Disable depth and color writes
  • Set the stencil operation to increment on depth
    pass (counting shadows in front of the object)
  • Enable back-face culling (ie front drawing)
  • Draw the shadow volumes (ie front faces)
  • Set the stencil operation to decrement on depth
    pass
  • Enable front-face culling
  • Draw the shadow volumes (ie back faces)

What if Eye is in shadow?
7
Stencil Shadow Volumes
a
b
8
Reverse Stencil
  • Disable depth and color writes
  • Enable front-face culling
  • Set the stencil operation to increment on depth
    fail (counting shadows behind the object).
  • Render the shadow volumes (ie back faces)
  • Enable back-face culling
  • Set the stencil operation to decrement on depth
    fail.
  • Render the shadow volumes (ie front faces)

9
Shadow Map Aliasing
10
Perspective Shadow Maps
  • Stamminger Grettakis 02

11
Deep Shadow Map
  • Deep shadow maps
  • Instead of storing a depth at each pixel
  • Store a series of depths w/ reduction of light
    transmitted
  • Important for complex self-shadowing models
  • Hair, clouds

Lokovic Veach 2000
12
Deep Shadow Maps
Without self-shadowing
With self-shadowing
13
Shadows from Area Light
  • Accumulation buffer
  • Higher resolution than final image
  • Sample area light
  • Render from multiple light-points
  • Average

Heckbert Herf 97 Overlapping shadows have
undesired artifacts
14
Fake Soft Shadows
  • Extend shadow map Chan Durand 03
  • Use extra primitives (smoothies) to soften shadows

lights view (blockers only)
lights view (blockers smoothies)
15
Fake Soft Shadows
  • Shadows not geometrically correct
  • Shadows appear qualitatively like soft shadows

Hard shadows
Fake soft shadows
16
Shadow Map Creation
  • Render blockers into depth map

observers view
lights view
17
Silhouette Detection
  • Find blockers silhouette edges in object space

object-space silhouettes
observers view
lights view
18
Construct Smoothies
  • Blocker only

silhouette vertex
silhouette edges
blocker exterior
19
Construct Smoothies
  • Blocker smoothies

t
silhouette vertex
silhouette edges
t
smoothie edge
smoothie corner
blocker exterior
20
Construct Smoothies
  • Smoothie edges rectangles in screen space with a
    fixed width
  • Smoothie corners connect adjacent smoothie edges

t
t
geometry
shading
21
Render Smoothies
  • Store depth and alpha values into smoothie buffer

Smoothie Buffer (alpha)
Smoothie Buffer (depth)
lights viewpoint
22
Compute Shadows
  • Compute intensity using depth comparisons

23
Hard Shadow
  • Image sample behind blocker (intensity 0)

light source
smoothie
blocker
receiver
completely in shadow
24
Soft Shadows
  • Image sample behind smoothie (intensity ?)

light source
smoothie
blocker
receiver
partially in shadow
25
No Shadow
  • Image sample illuminated (intensity 1)

light source
smoothie
blocker
receiver
illuminated
Write a Comment
User Comments (0)
About PowerShow.com