Shadow Volumes

A quick peek at the Xith3D/jogl engine casting shadows. These models are not completely sealed, so the shadows are incorrect in some places.

Question 1: Does anyone know a way to take a arbitrary shape and build a form fitting hull that is sealed? It would be nice to have the code create a good shadow occluder (and lower poly too) when the shape itself does not conform.

Question 2: Self shadowing mostly sucks in shadow volumes, especially if there are lots of detail. I would prefer to use vertex or pixel lighting for that. Anyone know a way to change the stencil algorithm to not draw on itself?

Dave

I fixed some bugs in the shadow volume code. here is the result:

Unfortunetly this is implementing the Zpass algorithm, which has a fatal flaw when the viewer enters the shadow.

The only solution I know is to change to a zfail algorithm and build back and front caps for the volumes, which I have not figured out how to do yet.

One thing is that the performance is really good so far since I only recalculate the geometry in the volume if the lightsource changes or the occluder moves. This scene is rendering at 200 fps.

That’s almost frustratingly pretty. Now implement bumpmaps and projected lights, and you’ve got yourself a doom3 engine. :wink:

As for Question 1, I think I’ve read articles like that on either gamedev.net or gamasutra.
Actually, it was about retesselating a mesh into more uniform triangles or something, iirc. I wasn’t really paying attention. :wink: