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

Thread: Alpha obiects with multiple lights and stencil shadows

  1. #1

    Alpha obiects with multiple lights and stencil shadows

    Hi,
    Do you have any ideas how to make such thing:
    I'm doing one pass for every light in the scene and I have stencil shadows. I want to add transparent obiects that are affected by shadows.
    I'm making first pass for depth only (and ambient light) so I cannot modify depth by transparent obiects, because after that I wouldn't be possible to render obiects behind transparent one. And if I render transparent obiect and in next pass for next light I render obiect behind this transparent one won't be visible.
    I can render transparent obiects after rendering all lights, but this needs to render shadow volumes one more time for every light.
    I dont't have any idea so I think I'm gonna make transparent obiects without shadows but I'm very curious how to make it with shadows without rendering volumes two times.

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

    Re: Alpha obiects with multiple lights and stencil shadows

    Here's an example but it's D3D, you could try porting it. It should give you a pretty good idea of how this can be done.

    http://esprit.campus.luth.se/~humus/...rect3D&start=8

  3. #3
    Junior Member Regular Contributor
    Join Date
    Oct 2003
    Location
    Hamburg, Germany
    Posts
    118

    Re: Alpha obiects with multiple lights and stencil shadows

    That usually the disadvantage of volume shadows with the stencil buffer. Transparent polygons cannot receive or cast shadows.

    Code :
     
                              Solid  Alpha-Test  Alpha-Blend
     
    Shadow Volume cast         +       
    Shadow Volume receive      +       +
    Shadow Buffer cast         +       +
    Shadow Buffer receive      +       +           +

  4. #4
    Junior Member Newbie
    Join Date
    Jun 2004
    Location
    Toulouse (FRANCE)
    Posts
    4

    Re: Alpha obiects with multiple lights and stencil shadows

    Yes i think it is better to project a shadow texture for the alpha transparent objects unstead of volume texture. This is what is done in Doom 3. Perhaps with shaders 3.0 we will be able to have some improvements in the stencil part. (useful for the soft shadows, see the unreal 3 engine )
    ( Be Side )

Posting Permissions

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