problem saving openGL FBO larger than window

后端 未结 4 657
猫巷女王i
猫巷女王i 2021-02-14 07:32

I\'m rendering into an OpenGL offscreen framebuffer object and like to save it as an image. Note that the FBO is larger than the display size. I can render into

4条回答
  •  情深已故
    2021-02-14 08:13

    Finally I solved the issue.

    I have to activate the fbo for saving its contents:

    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
    // save code
    ...
    glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
    

    while only selecting the fbo for glReadPixels via

    glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
    

    doesn't suffice.

    (All other things where correct and tested, eg. viewport sizes, width and height of buffer, image texture etc.)

提交回复
热议问题