Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Shadow Volumes.

  1. #1
    Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Sydney, NSW, Australia
    Posts
    428

    Shadow Volumes.

    Ok, im studying shadow volumes atm. I can project the shadow volume polygons ok, thats easy... But id like to clear something up. How do i work out using the stencil buffer where i should actually draw the shadow polygons.
    :: Sleep is a poor substitute for caffeine ::

  2. #2
    Junior Member Regular Contributor
    Join Date
    Aug 2001
    Location
    England
    Posts
    174

    Re: Shadow Volumes.

    You don't use the stencil buffer to work out where to draw the shadow polygons, you use the stencil to work out where to NOT put the light contribution from a particular source.

    This is generally done by the following steps:
    1) Clear stencil buffer to zero, disable colour (and depth buffer?) writes
    2) Set stencil buffer to increment on depth pass, do nothing on depth fail
    3) Render front faces of shadow volumes
    4) Set stencil to decrement on depth pass, do nothing on depth fail
    5) Render back faces of shadow volumes

    Thus, when all the shadow volumes faces are rendered, you will have a value of zero in the stencil buffer where there is no shadow, and another value if it is in shadow.

    There is a great paper by a couple of the guys at nVidia on the whole thing, that explains this really well. Check out developer.nvidia.com under OpenGL, it's by Mark Kilgard & Cass Everitt I believe.

    -Mezz

  3. #3
    Member Regular Contributor
    Join Date
    Nov 2000
    Location
    Sydney, NSW, Australia
    Posts
    428

    Re: Shadow Volumes.

    Thanks, coz i get the whole idea of a shadow volume, but i dont fully understand what comes after determining the shadow volume.
    :: Sleep is a poor substitute for caffeine ::

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •