Planar Projective Shadow Using Stencil Buffer - PowerPoint PPT Presentation

1 / 9
About This Presentation
Title:

Planar Projective Shadow Using Stencil Buffer

Description:

penumbra. Hard Shadow. Soft Shadow. Fall 2004. 4. Soft Shadows (Ref) Point light generates hard shadows only. Soft shadows are NOT generated by low pass filters ... – PowerPoint PPT presentation

Number of Views:42
Avg rating:3.0/5.0
Slides: 10
Provided by: melod6
Category:

less

Transcript and Presenter's Notes

Title: Planar Projective Shadow Using Stencil Buffer


1
Planar Projective Shadow Using Stencil Buffer
  • Ref Real-time Rendering V2

2
Shadows are important
It is usually better to have an inaccurate shadow
than none at all
3
Terminology
Hard Shadow
Soft Shadow
4
Soft Shadows (Ref)
  • Point light generates hard shadows only
  • Soft shadows are NOT generated by low pass
    filters
  • Soft shadows are generally preferable, if
    possible.

5
Planar Projection Shadow (xz plane)
l
y
v any pt on model
v
x
shadow
p
6
Planar Projection (general)
7
Planar Projection Shadow
  • Problems Solutions
  • Z-fighting polygon offset, stencil
  • Shadow fall outside of the receiver stencil
  • Semi-transparent shadows blending stencil,
    ensuring each pixel is drawn at most once
  • Planar receiver only
  • Need to rendered each frame (while the shadows
    are view-independent). render the shadow into
    texture
  • Antishadow stencil
  • Reference and code (DevMaster)

8
Example
9
Remark
  • Shadow polygons are blended with the floor,
    one-by-one
  • Repetitive blending
  • To prevent this from happening, use stencil
    buffer
  • When a polygon is drawn, increment the stencil
    count (therefore, the area is not drawn again)

glStencilFunc(GL_EQUAL, 1, 0xFFFFFFFF) glStencilO
p (GL_KEEP, GL_KEEP, GL_INCR)
Write a Comment
User Comments (0)
About PowerShow.com