Shadow factor

Started by
4 comments, last by galop1n 6 years, 7 months ago

Does one normally apply the shadow factor calculated from a shadow map to all direct light contributions or only the direct light contribution of the shadow map light?

In order to support a variable number of shadow maps, does one accumulate the shadow factors in an RTV which is then used as an RSV for the actual lighting?

🧙

Advertisement

Only the shadow map from the light casting that shadow should be used when drawing the light - its used for removing the light contribution.

 

It depends on how you do your drawing when dealing with shadow maps.

For a forward render, you would loop over the lights affecting a pixel/region, so it would require you to gather all the shadowmaps in some way (atlas, array etc..)

For a deferred render, the lighting/result is accumulated into a rendertarget, so normally you would only draw one light source at a time in this case.

 

Henning

58 minutes ago, semler said:

For a deferred render, the lighting/result is accumulated into a rendertarget, so normally you would only draw one light source at a time in this case.

Why is forward different from deferred? It seems to me that both accumulation and texture array work for forward and deferred.

🧙

Yes you are correct, both methods are viable for both methods.

But normally you would like to bunch the lights together in the forward renderer to avoid having to render the geometry multiple times (ie loop over lights per object). This is not nearly as important for the deferred renderer, where you render the lights (the area on screen they affect) instead of objects.

 

Modern deferred usually also loop over light to get a single gbuffer read and single lighting write to save bandwidth, so the packing of shadow maps is as important as in a forward+.

So far, shadowmap packing had to deal with texture array and sub rectangle but bindless on dx12 offer a third solution that simplify the problem ( + support variable size cube map / formats )

This topic is closed to new replies.

Advertisement