Now while the first pass works as intended: Result of first rendering That however didn't really work so I split the glDrawArraysInstanced into 2 glDrawArrays and checked the 2 results. The first renderpass should draw the whole texture in grey (rgb = (0.5, 0.5, 0.5)) and the second should add another vec3(0.5) to that, so the result will be white. Now I call glDrawArraysInstanced with instancecount 2. So i draw into Framebuffer1, but also use the current colortexture attachement for the drawing. Vec3 text = texture(Framebuffer1, TexCoords).rgb
I have 2 framebuffers: Default and Framebuffer1.Īnd give the colortexture attachment of Framebuffer1 as uniform 'Fb1_cta' to the following fragment shader: out vec4 FragColor I found a way to do this is by having a shader which gets all the textures and renders their combination.īut to improve the performance wouldn't it be better to just have one shader and framebuffer, and then through instanced drawing the shader draws onto the framebuffer colortexture attachement it is using for drawing? I'm trying to basically 'add' framebuffers, or better the colortexture attachmement of framebuffers.