Sign in to follow this  

How exactly does a "light accumulation buffer" participate in a deferred renderer?

This topic is 2544 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I have implemented a deferred renderer, and I am wondering what exactly is a "light accumulation buffer" and how does it fit inside a deferred renderer?

Currently my deferred renderer is doing:
1. Rendering all information onto the g-buffers.
2. For every light, use the g-buffer information and write the final color to backbuffer (additively blending the pixels for each light pass)
3. Display the backbuffer.

Where and how should the "light accumulation buffer" comes into play in the deferred rendering algorithm??

regards.

Share this post


Link to post
Share on other sites
Just take look at this formula:

Diffuse = kd * Albedo * dot(N,L1) + kd * Albedo * dot(N,L2) + kd * Albedo * dot(N,L3) + ...
Specular = ks * Albedo * pow(dot(N,H1), ns) + ks * Albedo * pow(dot(N,H2), ns) + ...

You might be able to notice that you could easily factor out some factors like kd, ks and Albedo. It's the same with the light accumulation buffer:

Diffuse = kd * Albedo * (dot(N,L1) + dot(N,L2) + dot(N,L3) + ...)
Specular = ks * Albedo * (pow(dot(N,H1), ns) + pow(dot(N,H2), ns) + ...)

LightAccumulation.Diffuse = dot(N,L1) + dot(N,L2) + dot(N,L3) + ...
LightAccumulation.Specular = pow(dot(N,H1), ns) + pow(dot(N,H2), ns) + ...

And therefore:

LightComposition.Diffuse = kd * Albedo * LightAccumulation.Diffuse
LightComposition.Specular = ks * Albedo * LightAccumulation.Specular


You mostly just need it for a Light Pre-Pass renderer. It might be a bit unnecessary for a standard deferred renderer. It also depends on how much you extend it, like maybe with Fresnel, SH lighting, hemispheric lighting, ...

Share this post


Link to post
Share on other sites
A standard deferred renderer might benefit from a light accumulation buffer if you notice that constantly reading the diffuse albedo from G-buffer during light calculations is being a bottleneck.

In that case you could accumulate lights without the albedo, then do a final pass where you modulate the light accumulation with the scene's diffuse albedo. If I remember right that's what STALKER: Clear Sky does.

However personally I've not found that to be beneficial. It also creates the same problems that light prepass has (not easy to achieve unlimited "overburn" of lighting, not easy to have correctly colored specular)

Share this post


Link to post
Share on other sites

This topic is 2544 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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