Fragment shader rendering to off-screen frame buff

2019-08-26 23:40发布

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?

Thanks, Gabor

1条回答
甜甜的少女心
2楼-- · 2019-08-26 23:47

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.

查看更多
登录 后发表回答