Screen-space shadow map pass

Started by
3 comments, last by MJP 13 years, 1 month ago
Should I create a screen space shadow map using the cascaded shadow map and sample it in the lighting pass or my deferred lighting system? Or simply check if each pixel is in the shadow using the cascaded shadow map in the lighting pass?
Advertisement

Should I create a screen space shadow map using the cascaded shadow map and sample it in the lighting pass or my deferred lighting system? Or simply check if each pixel is in the shadow using the cascaded shadow map in the lighting pass?


Unless you want to blur the result of your shadow map pass or something like that, there's no reason to put them in separate passes.

[quote name='TiagoCosta' timestamp='1299359755' post='4782212']
Should I create a screen space shadow map using the cascaded shadow map and sample it in the lighting pass or my deferred lighting system? Or simply check if each pixel is in the shadow using the cascaded shadow map in the lighting pass?


Unless you want to blur the result of your shadow map pass or something like that, there's no reason to put them in separate passes.
[/quote]

Hi MPJ,
i'm following your article (deffered shadow maps) and there you said that separate shadow map pass is quite good :)
If you happen to have a rendered z-buffer already (as in z-pre-pass or deferred lighting/shading), and you want to minimize memory usage, then a [color="#1C2837"]screen space shadow buffer can be used to accumulate several successively-rendered shadow maps, which allows the shadow maps to occupy the same render-target (only one is needed at a time). If you don't have lots of different shadow-maps though, then the RAM usage of a full-screen buffer might outweigh this benefit...
[color="#1C2837"]
[color="#1C2837"]With a [color="#1C2837"]screen space shadow buffer, when lighting,[color="#1C2837"] you can take one sample from the shadow[color="#1C2837"] buffer, instead of many samples (one from each shadow map).
[color="#1C2837"]This would be more efficient for some uses and less efficient for others.

[color="#1C2837"]With the cascaded shadow map, if you render all the cascades into a single texture/render-target, then you don't need this [color="#1C2837"]accumulation feature.
[color="#1C2837"]Alternatively, if your cascades are all on different textures, it might (guessing) be beneficial to accumulate those separate shadow textures all into a single [color="#1C2837"]screen space shadow buffer...

[color="#1C2837"]Also, a [color="#1C2837"]screen space shadow buffer is limited by the number of channels in the buffer -- if you want lots of individual shadow-casting light-sources, then it's not very suitable.
The says (or should say) that doing a full-screen shadow map can be a nice approach if you're not doing deferred rendering. If you're doing deferred rendering then you've already decoupled your lighting/shadowing into a separate full-screen pass so there's not as much benefit to splitting it up again.

This topic is closed to new replies.

Advertisement