problem saving openGL FBO larger than window

后端 未结 4 1609
栀梦
栀梦 2021-02-14 07:30

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:05

    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.)

提交回复
热议问题