View Full Version : Shadow Volume Optimizations

12-24-2002, 02:28 PM
I have been doing a engine which uses various shadow generation approaches: shadow volumes, shadow maps, planar projection etc... Now I was wondering if anyone has any tricks for making them faster.

12-24-2002, 03:19 PM
Well I know for shadow volumes there are a few tricks you can do. I'm not sure how you are doing the shadow volumes but if you are using the method where the volume is projected to infinity you can use a scissor rectangle to clip the volume where it can't be seen to save fill rate. Using a quad strip or triangle stip to draw the volume helps a lot if you are currently using just plain quads or plain triangles. Precomputing the volumes whenever possible is always a good way to speed up rendering. This may also work for shadow maps too, but im not sure; never tried it myself. There is an article on making shadow volumes faster on either gamedev.net or gamasutra. I know they both have very good recent articles about shadow volumes but I don't remember which one talked about the optimizations. Maybe they both do, I havn't looked at either articles in a while since the whole shadow volume thing for me has been done quite a while ago. http://www.opengl.org/discussion_boards/ubb/biggrin.gif

Oh also I'm sure you know this but I'll throw this in here anyway. With shadow maps you can lower the map resolution to gain some speed while sacrificing some precision.


12-25-2002, 12:31 PM
Have you tried anything like projecting the silhouete unto a plane and triangulating that? Is it faster than projecting the entire mesh? Even considering vertex shaders. I had a tip from XXX about using the alpha channel to do the shadow volume where when an edge was used more than once a you could used the alpha channel to record that in one pass. Problem is I don't think I can do transparent thing then (ahh well I'll add it in as an option anyway).