I'm converting some OpenGL ES 2.0 code to run on standard desktop hardware which does not support OpenGL ES 2.0, but only standard OpenGL.
The code uses the extension GL_EXT_shader_framebuffer_fetch
(previously known as GL_APPLE_shader_framebuffer_fetch
), which allows the fragment shader to read the 'previous' fragment color through:
mediump vec4 lastFragColor = gl_LastFragData[0];
This can be used to do custom (i.e. programmable) blending.
Is there an equivalent for this in OpenGL?
If not, I would have to render to a framebuffer texture and attach this texture to the same fragment shader that is rendering to it.