Composed shadowmaps

Hi!

This is just a small idea I had and I would like to know what you think about it:

Think of a “normal” gamelevel (doom3 for example), most lights and surfaces are static.
The lights may vary in color or itensity over time but they don’t change their position.
Most of the shadowsmaps generated every frame would be identical with the maps generated in the previous frames.
Wouldn’t it be possible to change the rendering process to something like this:

  1. Generate a shadowmap for each light that’s visible.
    Reuse this map for every frame until the light isn’t visible anymore.

  2. Render a second shadowmap per frame only showing the dynamic entities in the lightcone.

  3. Do the two per fragment shadow tests. The fragment is shadowed when one of the tests fails.

I’m not sure if you can use the same dynamic-shadowmap for
each light you render, but I hope so :wink:
I haven’t tested this method yet (still waiting for framebuffer objects) but I’m quite sure that you can save a lot of fillrate and memorybandwidth. Especially when it comes to omnidirectional lights.

(Sorry for my bad english… :stuck_out_tongue: )

Hello!

This is a great idea but I’d recommend you to do an additional pass between pass 2 and pass 3. Just make a new shadow map combined of the static shadow map and the dynamio shadow map using a simple min (max) function. Then you have to do only one per pixel shadow test in the final pass.

BTW, Doom 3 uses shadow volumes so this won’t work there :slight_smile:

…but I’d recommend you to do an additional pass between pass 2 and pass 3.
Just make a new shadow map combined of the static shadow map and the
dynamio shadow map using a simple min (max) function.
I’m not sure, but can’t this be done in one pass?
A simple shader compares the incoming fragment depth from the “dynamic-render-pass” with
the static-shadowmap z and outputs the smaller (closer to light) value.

BTW, Doom 3 uses shadow volumes so this won’t work there
Yeah, I know :wink: .
I took Doom3 because it is the most sophisticated graphics engine
in a sold game.
Btw, Dooms lighting model was kind of a disapointment to me.
I mean, whats the use of a lightingsystem that recalculates all of
the lighting information each frame, but has very few dynamic lights?

Lighting is pretty cheap, if you remove shadows.
Plus it allows for specular lighting (almost impossible to precalculate and store), all that done per pixel. Storing it is way too much.