Fragment shader rendering to off-screen frame buffer

左心房为你撑大大i 提交于 2019-12-11 18:30:14

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/1483903/fragment-shader-rendering-to-off-screen-frame-buffer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!