What are the steps necessary to render my scene to a Framebuffer Object(FBO) and then render that FBO to the screen?

后端 未结 2 606
南旧
南旧 2020-12-31 15:56

I\'ve got a fairly complicated scene with many GL_POINTS that I need to render. The scene will be largely static, so I\'d like to render it to a Framebuffer Object and then

2条回答
  •  抹茶落季
    2020-12-31 16:09

    Here is alternative example which does not require textures:

    // copy framebuffer
    if(fboUsed)
    {
        glBindFramebuffer(GL_READ_FRAMEBUFFER, fboId);
        glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
        glBlitFramebuffer(0, 0, TEXTURE_WIDTH, TEXTURE_HEIGHT,
                          0, 0, screenWidth, screenHeight,
                          GL_COLOR_BUFFER_BIT,
                          GL_LINEAR);
        glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
     }
    

    Replace variables in blit with your own.

    Apperently frame buffer 0 is front buffer. fboId is your frame buffer number.

提交回复
热议问题