Sign in to follow this  

Shadow factor

Recommended Posts

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?

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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.

 

Share this post


Link to post
Share on other sites

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 )

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this