Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualHodgman

Posted 17 March 2013 - 11:18 PM

To get the same results with deferred-lighting and deferred-shading, your deferred-lighting "lighting accumulation buffer" has to accumulate diffuse and specular light seperately, so that later you can multiply them with the diffuse surface colour and specular surface colour, respectively. As long as you do that, they'll be the same.

 

The reason that many deferred-lighting systems are different, is because the above setup requires 6 channels in the accumulation buffer. As an optimization, you can instead just accumulate 4 channels -- the diffuse light RGB, and the specular light without any colour information. Later on, you can either treat all specular light as monochromatic, or you can 'guess' it's colour by looking at the accumulated diffuse colour.

[edit]

So if an object is affected by multiple lights, it will only apply the surface color to the output once vs the deferred shading approach which multiplies in the surface color for each light

Deferred shading does:

light0 * material + light1 * material + light2 * material

Deferred lighting does

(light0 + light1 + light2) * material

 

Both of these are exactly equivalent.


#1Hodgman

Posted 17 March 2013 - 10:16 PM

To get the same results with deferred-lighting and deferred-shading, your deferred-lighting "lighting accumulation buffer" has to accumulate diffuse and specular light seperately, so that later you can multiply them with the diffuse surface colour and specular surface colour, respectively. As long as you do that, they'll be the same.

 

The reason that many deferred-lighting systems are different, is because the above setup requires 6 channels in the accumulation buffer. As an optimization, you can instead just accumulate 4 channels -- the diffuse light RGB, and the specular light without any colour information. Later on, you can either treat all specular light as monochromatic, or you can 'guess' it's colour by looking at the accumulated diffuse colour.


PARTNERS