Originally posted by NOAH IV:
Hi! I’m looking for advice on implementing shadow mapping…
Hi there,
I spent some time in the last three weeks to experiment shadow mapping and how it could be implemented in my work. I really was a fan of shadow maps however, after the experiments, I am now interested in shadow volumes more than shadowmaps. So, my advice is that they not so good to use.
The main concern was that I plan to use projected lighting a lot. For that reason, shadow maps would have created similar artifacts, thus looking better to the eye, however, keep reading…
So far i’ve been reading the presentations from nvidia site but their source codes looks too confuse to me. Maybe I’m skipping some theory that should be read first? Anyway, how did you learn that? Any tips for me?
I used the things you have (I got it from NVSDK) plus some ATi papers on pBuffers and render-texture, you really should not need more than that. About your confusion… well, I don’t know how can I help you but I am sure you will figure out if you keep spending time on them.
TIP: if you use RTT, make sure mipmaps are in place (or turn off mipmapping at all!) or you’ll get some pretty ugly troubles. Doing some DrawPixels could help a lot!
And what is the order of complexity and performance of these approaches?
After my experience, I feel implementing shadow maps effectively is not easier than shadow volumes. The main concern is that they suffer way too much from the precision issue. For most games with closed spaces this won’t be a problem but for me it is. It is somewhat easy for something to get closer enough to the light source so much it just ruins up everything.
I think the projective texturing approach is very good to do lighting, but not for shadowing.
Another problematic feature of shadow mapping is implementing a way to render them in an optimal way when fragment programs are used. For example, since the shadow map is depth-only, there is no such point in rendering using this or that feature (bump maps for example), but you can’t just disable color writes or something since the FP may be KILling fragments in a non-obvious way. Shadow volumes are somewhat easier there since vertex programs are somewhat easier.
Considering shadow maps in a VP+FP driven world, they look much more complicated.
So, I was a real fan of this technology remember it, however, my best advice is to leave them out of the way.
I initially liked it because I heard Pixar uses them in renderMan, however I now think the disavantages of the technology are way too much. Performance wise, I can’t tell since the simplification and shiluette algo used for shadow volume generation are the unknown factor. I don’t want to express an opinion about that until I test it more extensively however this requires a lot of work and will take some time.
Simply put, what most whitepapers does not tell you (well, they tell you, but just a little) is the precision issue.
I hope you can find this useful even if I think this will make you even more confused.
Bye.