My name is Petru and I'm responsible for this dynamic
I created this demo in order to test different ways to
generate dynamic shadows. Finally, I stopped at
Carmack's reversed method.
Basically, all the lighting informations are generated
in steps, and in the final step the material
information is added (textures).
1. First, all the scene is rendered on ZBuffer and
Screen using ambient light.
2. For each light:
2a. Draw shadows volumes using stencil buffer.
2b. For each light draw all static objects with
lightmap of current light (or no lightmap, just vertex
lighting for dynamic objects) taking care of the
3. Blend objects materials into scene.
The scene uses an Octree for objects management,
shadows volumes are clipped to scene, lightmaps are
optimized (are filled up in big textures).
In order to run the demo, you need DirectX8 and a 3D
card that suport stencil buffers. On mt Radeon 7000 it
runns acceptable (due to fill rate limitation on this
You can turn on/off lights, disable/enable material
rendering and other stuff.
This is intended to be just a quick view of how
stencil shadows may look.
The only disavantage I see to using shadow volumes, is
that the shadows are pretty hard in some places. But
this can be changed...
The demo can be taken from here:
Some more screen shoots are here: