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 2 of 2

Thread: Stencil Buffer Shadow Overlapping

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2004
    Location
    St.Petersburg,Russia
    Posts
    15

    Stencil Buffer Shadow Overlapping

    I have 3 questions:
    1.I have more than a single one light source. How to enable real look-like overlapping between shadows casting from different light sources.Maybe using glBlendFunc()?
    (By the way how to make shadows from transparent objects)
    2.Sometimes i am using stencil buffer for creating pseudo lighting from a spot light. How to make it to be attenuated?
    3.I am also creating a dust effect room simply by drawing clipping volume from a lamp(pseudo light),but this volume goes through the different objects.How to stop the volume when it crosses another object.Maybe Depth Buffer can help?

  2. #2
    Super Moderator OpenGL Guru dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    4,388

    Re: Stencil Buffer Shadow Overlapping

    1) Clear the stencil between each light and project a light volume for each light individually to stencil test illumination true on your *illumination* pass not shadows on a shadow pass.
    Use glBlendFunc(GL_ONE, GL_ONE); for each light source contribution.

    2) Attenuate the illumination in the lighting pass. Use texture, math or whatever it takes.

    3) If I understand correctly, you need to stop the light volume when it intersects with an object. Investigate beam trees :-)

Posting Permissions

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