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

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

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 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 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)

1. 1
Rutin
27
2. 2
3. 3
4. 4
5. 5

• 11
• 9
• 9
• 9
• 14
• Forum Statistics

• Total Topics
633312
• Total Posts
3011314
• Who's Online (See full list)

There are no registered users currently online

×