I would like to draw a scene to the default framebuffer, as well as draw some supporting data related to some of my painted models into an off-screen buffer with the same image size as the default framebuffer.
I understand that I can do these two things separately, in two calls to glDraw * (one rendering for FBO, and the other not), which will use two corresponding shader programs.
And I think (still learning about it), I can do them basically simultaneously, attaching two visualizers / textures to one FBO, making one glDraw * call with one shader program, whose fragment shader will write the corresponding values ββto several outputs corresponding to multiple FBO attachments, and finally copying one of the two images in the FBO to the default framebuffer, using it to texture the square to fill the scene or call glBlitFramebuffer.
But can I make one call to glDraw * using one shader program and make my fragment shader record both the visible framebuffer and some off-screen FBO? I do not suspect that I have seen the relevant documentation, but I am not sure.
source share