Shadow mapping when deferred shading

Hello guys,

Any hints on shadow mapping when deferred shading in TD?
Thanks in advance! :slight_smile:


normally when the render TOP does it’s magic, shadows are calculated by means of the lights own rendered depth map. there’s special “machinery” to make this faster and more optimized when using the render top, but to do this depth comparison in a deferred sense you’d need to get a lights depth render as a TOP buffer that you can feed into the glsl top that is doing the deferred shading.

you can do this for a light by plugging it into a depth TOP:

the depth top will only show the texture you see in the screen shot of course if shadows are enabled for the light.

each light consumes a decent amount of CPU overhead when shadows are enabled, similar to the overhead a render TOP consumes rendering the scene. Shadows are expensive in this sense.

Thanks for your answer @lucasm !! What if there are not light COMPs and lightning calculations are computed after as in the following Ragan’s example post

1 Like

I would like an answer to that question as much as you!

Something like a render top would have to be built / used though as each lights shadow calculation requires that depth render of the scene geometry from the lights perspective.

Rendering geometry is expensive initially because the scene geometry has to be prepared, uploaded then culled and finally rasterized.

I’ve spent a good amount of time researching other options for doing this in my own projects, and the most interesting research I’ve come across was this paper by Ola Olsson:

Efficient virtual shadow maps for many lights

If viable, maybe it could be implemented via c++ top, but at present the contents of that paper are waay over my head.

I’d be very interested in a solution too though!

1 Like

understood @lucasm ! Yes so apparently it’s even more difficult than I thought… Thanks for the reference!

1 Like