| morgan March 24, 2001, 11:46 PM |
|
Hi Jon,
I've been working on similar problems with stencil buffer shadows. I have a paper coming (maybe to flipcode) on the topic, but here are some notes about my experiences:
Yes, you need the near clipping plane *really* close (the alternatives are too horrible to mention). If you also move in the far clipping plane (mine is at 50 meters), this doesn't trash the z0-buffer too badly.
It is possible to determine shadow volumes very fast, especially for static geometry, since you only have to look at object edges, not triangle edges. Using clever silhouette finding algorithms, I got exact shadow volume determination down to one dot product per face and one compare per (object) edge.
When trying to determine if the camera is in a shadow volume, plucker coordinates and bounding volumes are your friends.
For one light, you can save a whole rendering pass by subtracting light from shadowed areas with a black polygon instead of adding light with subsequent passes. I think you can do the same for multiple, colored lights by alpha blending against the inverse of the light color (the order of light sources will affect the result, however, so this is questionable). If you know how to get a subtractive alpha blending, that's really what you want.
-m
|