Shadow Volumes Revisited - PowerPoint PPT Presentation

About This Presentation
Title:

Shadow Volumes Revisited

Description:

4. Demonstration movie. 5. Conclusion. Motivation. Shadow volumes: Dynamic ... graphics accelerators of latest generation (no stencil ... Movie ... – PowerPoint PPT presentation

Number of Views:39
Avg rating:3.0/5.0
Slides: 21
Provided by: vis76
Learn more at: http://stereofx.org
Category:

less

Transcript and Presenter's Notes

Title: Shadow Volumes Revisited


1
Shadow Volumes Revisited
  • Stefan Roettger
  • Alexander Irion
  • Thomas Ertl
  • University of Stuttgart, VIS Group

2
Outline of the Talk
  • 1. Motivation Shadow volumes on PS2
  • 2. Shadow volumes by Crow (1977)
  • 3. Methods w/o stencil buffer
  • 4. Demonstration movie
  • 5. Conclusion

3
Motivation
  • Shadow volumes
  • Dynamic shadows in real-time
  • Utilization of graphics hardware (stencil
    buffer)
  • Problem
  • - Restricted to graphics accelerators of latest
    generation (no stencil buffer on Voodoo3 and PS2
    for example)
  • Solution Utilization of the screen buffer
  • Result Shadow volumes supported by Voodoo1!

4
Shadow Volumes Crow 77
Step 1 Render scene ? Z-values
5
Shadow Volumes Crow 77
Front face 1
Back face -1
Step 2 Render shadow volume faces
6
Shadow Volumes Crow 77
Front face 0 (Depth test) Back face 0 (Depth
test)
? 0
7
Shadow Volumes Crow 77
0
Front face 1 Back face 0 (Depth test)
? 1
8
Shadow Volumes Crow 77
1
0
Front face 1 Back face -1
? 0
9
Shadow Volumes Crow 77
0
1
0
Step 3 Apply shadow mask to scene
10
Methods w/o Stencil Buffer
  • Idea Compute shadow mask in screen buffer
  • Problem dstColor dstColor - 1 not available
  • Solution Instead 1 2 (double values)
  • Instead -1 /2 (halve values)

Blend functions for 2, /2 cdst fcsrc
gcdst 2 fcdst, csrc1, g1 ? cdst
cdst1 1cdst /2 f0, g0.5 ? cdst 0
cdst0.5
11
Pixel States
States 1/4 lit, 1/2 1 shadowed
  • ? Initialize all pixels with color value 1/4

2
2
1/4
1/2
1
2 (Clamping!)
/2
/2
State changes Point in shadow volume 2
Point in front of shadow volume no change
Point behind shadow solume 2 , /2 ?
Clamping does not invalidate states!
12
Shadow Mask Normalization
Apply the following operations to the shadow mask
1/4
1/2
1
2
1/2
1
Invert (c1-c)
1/2
0
2
1
0
Light
Shadow
13
Shadow Mask Application
  • Black shadows Multiply b/w shadow mask with
    scene render the scene with cdst cdst csrc
  • Ambient shadows Render scene again to add
    ambient lighting term with cdst cdst csrc
  • QuickNDirty shadows Halve intensity of shadowed
    pixels by means of normalization to 0.5/1 and
    with cdst cdst csrc

14
Example Shadow Mask
15
Example Normalization
16
Example Shadowed Scene
17
Extensions to the Algorithm
  • The shadow mask can also be computed in the
    alpha-channel which performs even faster than the
    original algorithm.
  • Then the shadow mask can be copied efficiently
    into an alpha texture map and applied afterwards.
  • Advantages
  • Scene is rendered only once for quickndirty
    shadows.
  • Computation of shadow mask with lower resolution
    than screen buffer ? shadow mask is rasterized
    much faster.

18
Demonstration Movie
19
Conclusion
  • Efficient computation of dynamic shadows possible
    without stencil buffer.
  • Shadow mask is computed either in screen buffer
    (Voodoo1/2/3) or in alpha-channel (PS2).
  • Idea Utilize 2, /2 operations instead of 1,
    -1.
  • Different modes of application Black, ambient,
    or quickndirty shadows (scene rendered only once
    in the latter case).
  • By copying the shadow mask into a alpha-texture
    the shadow mask can be computed at lower
    resoutions than the screen buffer ? overcome
    rasterization bottleneck.

20
Thank you!
  • Questions?
Write a Comment
User Comments (0)
About PowerShow.com