Q:

Is it possible to get pixels from OpenGL buffer at the original size?

I have a 4K project using OpenGL. So all my images are 4K based and it renders ok on my full-screen 1080p computer. OpenGL just resizes nicely without problems. But I want to use something like glReadPixels() to read the buffer but from the 4K origin. So far I couldn't figure out if this is even possible. Not sure what happens with the GPU frame buffer when it resizes, I guess it just keeps the buffer resized to 1080p making it impossible to fetch the original 4k content? If that's the case, I will do something else, but had to ask before I venture into some extra code. ;-) Thank you.

A:

Use a framebuffer object to render your scene at the resolution you like and read back the data from there. If you still want the "live preview" in the window, just blit the FBO contents to your default framebuffer (and scale them down in that step).

