I have an existing framebuffer (with color and depth information) that I need to composite with the canvas' backbuffer (drawing buffer). How can I draw the contents from one framebuffer into the backbuffer?
Alternatively, if there is a way to directly manipulate the drawing buffer, I could put my information directly into it without creating a second framebuffer. Write now I am writing a texture into the framebuffer using:
gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, texture, 0);
But that will not work on the drawing buffer because it throws an error when gl.FRAMEBUFFER is not bound (and I don't know a way to bind it to the drawing buffer).