New shadowing techniques...

Started by
14 comments, last by iNsAn1tY 20 years ago
There's a link on this page to what may be the paper on penumbra edges someone mentioned:
http://www.peroxide.dk/tuts_c.shtml
It includes code for using vertex shaders for the shadow geometry and pixel shaders for the penumbras.
The results look excellent, and I imagine it's by far the best way of calculating soft shadows for dynamic geometry.

If this technique is as accurate as the paper indicates, why bother with spherical harmonics for shadows? Is it simply that the lighting calculations are more accurate?

[edited by - MumbleFuzz on April 16, 2004 3:25:05 PM]
MumbleFuzz
Advertisement
The "smoothie" paper looks intersting. Looks like a nice method to augment shadow maps. But it must be very performance intensive to compute all those edge smoothies on the CPU (+ reupload to the card), every time a light changes position. For multiple moving lights, you''d need multiple instances of the smoothies per frame. This will quickly saturate the AGP bus, stress the CPU, and add many faces per frame. I think this method will only become interesting with uberbuffers, ie. texture access in a vertex shader (vs 3.0 or similar).
Adding to my previous post: I wonder if there would be a method to add the smoothies on the GPU, by using a similar VS extrusion method as with stencil shadows. Hmmm.
quote:Original post by MumbleFuzz
If this technique is as accurate as the paper indicates, why bother with spherical harmonics for shadows? Is it simply that the lighting calculations are more accurate?

The benefit of Precomputed Radiance Transfer (spherical harmonics != PRT - spherical harmonics have other uses and PRT can be done using other representations) is that the cost of the technique is constant regardless of the complexity of the lighting environment. The technique is only really appropriate for low frequency, distant lighting environments but given those constraints the cost is independent of the number and size of the light sources. Other soft shadow techniques require n times as much work for n light sources and aren''t really suitable for really large area light sources.

PRT can also handle indirect lighting which is a pretty nice feature to have. For static models and diffuse surfaces PRT approximates full Global Illumination pretty well. The big weakness of PRT is that it doesn''t work very well with animated models.

Game Programming Blog: www.mattnewport.com/blog

muhamed adel,
Do you know if extruding shadow volumes in a vertex shader is always a win over extruding volumes on the cpu? I seem to remember that vs extrusion results in a ~6x increase in vertex count. How fast is the gpu at handling all these extra degenerates + volume extrusion compared to cpu volume extrusion + uploading the volume geometry?
quote:Original post by DonnieDarko
I seem to remember that vs extrusion results in a ~6x increase in vertex count.?

Who told you that?? the poly count is the same (or should be the same) if you are using the depth fail in both case.if you are using depth pass, then you will not need the front and back caps of the shadow volume,which may cause the increase in the polycount,but it is ~3x increase not 6x.
BUT
1-if you are using depth fail ( and you should be for FPS at least) then the poly count should be approxiamtely the same.
2-The probelm of generating the shadow volume on the cpu is the locking of the vertex buffer of the model, and the iterating of the processor throught the edges and vertecies.this makes the preformance extremely affcted with the polycount.
3-The vertex shader for extruding the shadow volume is short (not a great number of instructions, as it can be done on a 1.1 VS, and ofcourse it can be done in software.
4- See the sample on booyah site, it is done in a vertex shader and have a very high fps (more than 500 fps on my 9700 pro).
5-No locking for veertex buffers is done when using a veretex shader.

This topic is closed to new replies.

Advertisement