There are different methods to achieve Shadows:
- Stencil Shadows
- ZFail
- ZPass (better known as Carmacks Reverse)
- Shadow Mapping
these are the common ones nowadays used.
They both have advantages and disadvantages.
The Stencil Shadows needs a lot of CPU time because you have to calculate the whole shadowvolume. But therefore there are detailed selfshadowing with no really additional work.
Shadow Mapping is instead a simple depthmap technique where you have to position the Camera at the position of the light source and then if you render the scene to the dephtbuffer. After that you have to render scene normal and lookup in the
'shadowmap' where you have to render the scene shadowed. These has the advantage, that you don't need to know anything about the scene geometry, but therefore you may have to du antialiasing for the shadow as it would look pixelated without.
In my current Version I use Stencil Shadows with both methods (ZFail/ZPass) integrated. Currently I try to write a shader to pass the shadowvolume calculation to the gpu which is a lot faster than doing it on the CPU.
The release is delayed a bit, as I have unfortunately not that much time currently. But If you want to look how the shadows look like in Game (well better in demo ;) )
http://www.myvideo.de/watch/898684