Separate blend equations for FBO color attachments


Is there any way to set separate blend equations to differend color attachments of one FBO.
(at least on nvidia 280 class cards with opengl 3.0 support)

I have fbo with 2 color attachments (GL_COLOR_ATTACHMENT0_EXT and GL_COLOR_ATTACHMENT1_EXT)
and the glsl shader that outputs to gl_FragData[0] and gl_FragData[1].

Now i want the first glsl output to be blended with attachment 0
and the second output to be added to attachment 1
(glBlendFunc(GL_ONE, GL_ONE))

How to do the trick ? It is possible ?
I need to out a lot of quads, each should blend with one attachment and add to another - the fragment shader that calculates outputs is non-trivial - so running it 2 times is a big waste of computing power :stuck_out_tongue:

OpenGL can only enable or disable blending differently on each render target. There is no way to set different blend equations. I actually wrote a post about this myself:…5723#Post255723


Sorry to bump, but I found this on Google and as of OpenGL 4.0 this is no longer the case!
See “Draw Buffers Blend”, i.e. the glBlendFunci() and similar functions