So I am working on openGL ES2.0 and GLSL and I have a question about fragment shader. Through my vertex and fragment shader, I compute and get blended image. I however want to output differently. So for example, on my fragment shader, I have
vec4 image1 = texture2DProj(tex1,projCoord);
vec4 image2 = vec4(1.0,0.0,0.0,1.0); //red
I want to show my output (gl_FragColor) as image2, red color. But I want to find a way to also pass image1 to my openGL ES2.0 code. Is there anyway to do this?
I know that in regular openGL, (Not ES), you can do something like gl_FragData[n] and do frame buffer attachment and etc. In openGL ES2.0, I can only do gl_FragData[0], [1] will be out of index. Normally, in my case, gl_FragColor will be store whatever I have to frame buffer. So in this case, if I do
gl_FragColor = image2;
red color image will be store in frame buffer. I just want to show image2 but I want to access image1's frame buffer only. Is there anyway to do it?