I have decided to switch my engine to OIT for a couple reasons - mainly because of my map styles. I just don't really like sorting geometry much - and the results are never pixel perfect.. anyways after looking at depth peeling, dual depth peeling, a-buffer, weighted average, and weighted sum techniques I decided on weighted average.
I'm a bit confused on the logistics of implementing it - in the white paper (Bavoil and Myers 2008) it states
accumulated RGBA color and the number of fragments per pixel (depth complexity) "
So - I'm already using a deferred shading engine - generating another texture is not a big deal - what I don't quite understand is how to write the average RGBA color and number of fragments per pixel to a 16 bit floating point texture.
Here's where I'm a bit confused:
This may be silly - but from my understanding.. for each fragment I would add the current RGBA color to the 16 bit texture -
My first question is how do I do this? Do I just set glBlendEquation to GL_FUNC_ADD and glBlendFunc(GL_ONE, GL_ONE)?
My second question is how do I save the depth complexity to the 16 bit texture also? The only way I can think to do it is making another texture and adding 1 to every texel that I pass over in the fragment shader (with the blend mode set as above)
Any insight to how to do this would be appreciated - thanks