Ia3n

12-17-2006, 01:25 AM

I've implemented z-pass shadows and now would like to work on z-fail shadows. I can handle the capping and the projection to infinite distance, but I have a few problems with how to initialize the stencil buffer. I am supposed to clear it to the number of shadow volumes that the camera is inside, right?

The first problem is that that causes the whole problem with having to put caps on the near clipping plane that z-fail shadows are meant to avoid. What if the picture plane intersects a shadow volume? Do I then need to draw polygons on the near clipping plane to initialize the stencil buffer to different counts for which parts are ouside or inside the shadow volume?

The other problem is just plain solving for how many volumes the camera is inside. It seems like all the usual methods for accelerating collision detection are screwed up by the fact that the shadow volumes are generated from scratch every frame and have infinite extent. Can anyone point me toward any resources for collision detection on arbitrary, potentially concave, infinitely large volumes?

The first problem is that that causes the whole problem with having to put caps on the near clipping plane that z-fail shadows are meant to avoid. What if the picture plane intersects a shadow volume? Do I then need to draw polygons on the near clipping plane to initialize the stencil buffer to different counts for which parts are ouside or inside the shadow volume?

The other problem is just plain solving for how many volumes the camera is inside. It seems like all the usual methods for accelerating collision detection are screwed up by the fact that the shadow volumes are generated from scratch every frame and have infinite extent. Can anyone point me toward any resources for collision detection on arbitrary, potentially concave, infinitely large volumes?