I just posted a "question" at the xna forums, and thought I'd might as well post here too just in case someone drops by and wants to share their thoughts ;)
The post on the forum is here
After getting my pointlight cubemap shadow mapping to work I am facing a new challenge.
I have read papers, studied samples and made prototypes. But I just can't decide/figure out what the "best"(tm) approach to this ordeal is.
Possible methods of dealing with multiple lights and their shadows I have found so far:
1. Multiple shadow maps - One depth pass per light, resolved to a unique texture.
a) Light contribution in a single pass (looping over lights).
b) Light contribution in multiple passes (additive blending).
There are several flaws to this approach:
Needs many textures, possibly exceeding the shader maximum.
Limited number of lights in a single pass, too many additive passes and gets too slow.
2. Single shadow map reused - Multiple passes (if possible at all?)
a) One depth pass and one light contribution pass per light (additive blending).
Flaws here could be poor performance of many additive passes.
I never succeeded in implementing this, I had problems rendering the shadow maps in between the light
passes, which I guess makes sense (as there is already stuff in the GPU buffers etc).
3. "Standard" deferred rendering.
a) Pre-Z pass, G-buffer pass, one shadow/light pass per light.
This looks like an optimal render method for dealing with multiple lights and shadows
not to mention other benefits like post-processing.
The main thing that bugs me (and everyone else it seems) about this approach is
of course the alpha/transparency issues. Especially in scenes with lots of foliage and particle effects.
I think my main issue with all of this is shadow mapping.
For lights alone I could live with a "multi-pass multi-lights" approach. But when adding shadows to the equation
it is just slow / complicated / smelly and what not.
Then I ran across this article here: http://mynameismjp.wordpress.com/samples-tutorials-tools/deferred-shadow-maps-sample/
It's Matt's (MJP) article about Deferred Shadow Mapping, I still need to re-read it a few times to fully understand it I think,
but it looks like an excellent approach.
Anyone have experience with this method? Is it a suitable approach?
Can I render multiple shadow passes into the same shadow texture(?).
I'm about to test it out but any insight is appreciated.
Now, do I actually have a question hidden in this wall of text?
I'm not sure, however I find it helpful to write things down when puzzled.
I'm pretty sure that not everything I've written above is 100% accurate, so feel free to enlighten me (no pun intended).
I have already searched the forum and googled a fair bit, but there are so many terms involved and I have probably missed something.
A few of the more interesting posts, papers and articles I've read so far:
Xna.com forum posts - this, and this, and this
Other resources - Deferred Shading presentation by Shawn Hargreaves, Deferred Shading tutorial
I would appreciate any thoughts on the subject, how do you handle this, do you just use a single shadow caster, do you live
with the shortcomings of deferred rendering, do you avoid pointlight shadows etc.