Vereb
Vereb

Reputation: 14736

Fragment shader rendering to off-screen frame buffer

In a Qt based application I want to execute a fragment shader on two textures (both 1000x1000 pixels).

I draw a rectangle and the fragment shader works fine.

But, now I want to renderer the output into GL_AUX0 frame buffer to let the result read back and save to a file.

Unfortunately if the window size is less than 1000x1000 pixels the output is not correct. Just the window size area is rendered onto the frame buffer.

How can I execute the frame buffer for the whole texture?

Upvotes: 0

Views: 1895

Answers (1)

Malte Clasen
Malte Clasen

Reputation: 5637

The recommended way to do off-screen processing is to use Framebuffer Objects (FBO). These buffers act similar the render buffers you already know, but are not constrained by the window resolution or color depths. You can use the GPGPU Framebuffer Object Class to hide low-level OpenGL commands and use the FBO right away. If you prefer doing this on your own, have a look at the extension specification.

Upvotes: 1

Related Questions