The texture that gets rendered to the window is bound to Framebuffer 0. Is it possible to bind this texture to a texture unit, for use as a uniform sampler2D in a drawcall?
CodePudding user response:
No. The default framebuffer (which is what is provided by the window system) has no corresponding texture object that you could sample from.
If you want to sample from any render output, you are going to need to create a custom framebuffer object and render to some texture object attachments that you can then sample from.
Another option is to blit the default framebuffer color buffer into another framebuffer color attachment. See: https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glBlitFramebuffer.xhtml