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

Thread: Shadow Volumes/Stencil Buffer

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2001
    Posts
    2

    Shadow Volumes/Stencil Buffer

    I currently have implemented shadow volumes in a 3d GL engine I'm writing. The shadow volumes use the standard approach, using the stencil buffer, but things are pretty damn slow.

    I'm only drawing about 50 - 100 polygons into the buffer, and the problem actually doesn't seem to be polygon related but fill-rate related because reducing the polygons doesn't have an enormous effect but reducing their size does.

    I'm currently running my demo on an Athlon 800 with a GeForce2 so one would expect that things would be snappy, but I have the feeling that using the stencil buffer is simply a slow ordeal. I'm not positive that the buffer operations run in hardware, but if they aren't I don't know what to do about it anyway.

    Anyone else have any experience with real-time shadow volume drawing/stenciling and how fast/slow it is? Any suggestions?

    Thanks,
    Scott

  2. #2
    Junior Member Newbie
    Join Date
    Jan 2001
    Location
    bcn
    Posts
    17

    Re: Shadow Volumes/Stencil Buffer

    Well, shadow volumes aren't hyperfast but they should run in real-time with high framerates for low detailed geometry (you are using only 100 polygons?). Perhaps it's an implementation problem. How much render passes are you using?

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Sep 2000
    Location
    Santa Clara, CA
    Posts
    1,463

    Re: Shadow Volumes/Stencil Buffer

    Stencil isn't expensive. What _is_ expensive is that stencil shadows are a form of massive multipass rendering.

    - Matt

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: Shadow Volumes/Stencil Buffer

    Are you running in 32 bpp mode? In 16 bpp the stenciling is handled by software. At least on Geforce and TNT series that is.

  5. #5
    Junior Member Newbie
    Join Date
    Feb 2001
    Posts
    2

    Re: Shadow Volumes/Stencil Buffer

    Originally posted by DFrey:
    Are you running in 32 bpp mode? In 16 bpp the stenciling is handled by software. At least on Geforce and TNT series that is.
    You are my savior. Thank you so much, I was running in 16-bit mode and when I switched to 32-bit it worked perfectly.

Posting Permissions

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