Jump to content
Posted 09 January 2012 - 11:13 AM
Posted 09 January 2012 - 12:26 PM
Posted 09 January 2012 - 12:46 PM
What do you mean by "light attenuation texture lookup"?
In my deferred renderer, I have a few different buffers with material properties, like specular brightness and smoothness. That way you avoid expensive shader branching bit still maintain some control. It's a fairly common approach.
Posted 09 January 2012 - 01:01 PM
Posted 09 January 2012 - 05:39 PM
I haven't implemented a deferred renderer myself, but just a thought: Couldn't you, instead of a material ID, store texture coordinates in the g-buffer which index into a separate "material texture" with additional properties? Considering that a draw call would most probably have the same or similar material coordinates this might even be pretty cache friendly.
Posted 09 January 2012 - 11:19 PM
Posted 10 January 2012 - 03:10 AM
Posted 10 January 2012 - 03:23 AM
Light prepass is another option. Within your second pass you can use any lighting model you want. This is the method I'm playing with at the moment.
In summary, you do one pass to generate a g-buffer of only normal and depth, and then from this you generate a single RGB buffer with the diffuse light response of each surface. You then do a second pass, using the diffuse light buffer. This second pass can be any type you wish, provided it results in the same geometry.
Posted 10 January 2012 - 01:07 PM
Light prepass is another option. Within your second pass you can use any lighting model you want.