Original Post
I have been doing a little reading up on real-time shadowing, and most peticularily, soft shadows. In some powerpoint presentation by Nvidia (GDC2002_RobustShadowVolumes.ppt - not sure where I found it, probably at www.nvidia.com somewhere) they were using the stencil buffer to tell where there should and shouldn''t be a shadow. Now I will admit that I don''t understand a lot of the math/technical stuff there.
Using just one light source would give sharp edged shadows. To get smooth edge shadows, they used 12 dim lights and the same technique to get soft looking shadows. The real interesting piece is right near the end of the presentation that they said that the Doom 3 engine uses this technique. They said that they (the people who wrote the presentation) where getting 8 frames per second on a Geforce 4 Ti 4600.
Now I realize that I don''t understand a lot of this, but why isn''t it possible to simply use 1 light and blur the contents of the stencil buffer to make things look soft? If the stencil buffer already has definite sharp edges, why can''t each pixel of the stencil buffer be averaged with the 9 surrounding pixels to give a softer looking shadow while only using 1 light instead of 12? If the stencil buffer was 8 bits, why couldn''t you do the original stencil testing into the last (lower) 4 bits, calculate the averaged/filtered stencil buffer into the upper 4 bits, then copy the upper 4 bits into the lower 4 bits and then clear the upper 4 bits, and rener?
Ascii diagram:
Why isn''t this possible?
Moe''s Site
32 bit z/stencil bufer: [24 bits for z buffer][8 bits for stencil buffer] _ _ _ _ | _ _ _ _ upper bits | lower bits averaging the 9 surrounding pixels, where 9 is the darkest possible value: 0|0|0 0|0|9 0|9|9 before averaging 0|1|1 1|3|9 1|9|9 after the surrounding 9 pixels aver averaged