FBO lwjgl bigger than Screen Size - What I'm doing wrong?

旧时模样 提交于 2019-12-07 13:15:28

You need to call glViewport() with the FBO dimensions after binding it, and before starting to render. Note that the viewport dimensions are global state, not per-framebuffer state, so you also have to set them back when you render to the default framebuffer again.

With the numbers you use in the question (you obviously wouldn't want to use hardcoded numbers in real code):

public void activate() {
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, frameBufferObject);
    glViewport(0, 0, 1024, 1024);
}

public void deactivate();
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);
    glViewport(0, 0, 1024, 768);
}
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!