OpenGL ES 2.x: any way to reuse depth buffer for off-screen and on-screen rendering?

夙愿已清 提交于 2019-12-01 19:37:57

From reading the OpenGL® ES Common Profile Specification Version 2.0.25 it appears that neither of these are possible.

Section 4.4.2 says:

Framebuffer-attachable images may be attached to, and detached from, application-created framebuffer objects. In contrast, the image attachments of the window-system-provided framebuffer may not be changed by OpenGL ES.

(emphasis mine) So the second option in the question is not possible.

Section 4.4.3 suggests that the first option isn't possible either...

A renderbuffer object cannot be created with the name zero. If renderbuffer is zero, then any previous binding to target is broken and the target binding is restored to the initial state.

In the initial state, the reserved name zero is bound to RENDERBUFFER. There is no renderbuffer object corresponding to the name zero, so client attempts to modify or query renderbuffer state for the target RENDERBUFFER while zero is bound will generate errors.

...though this is less explicit. It isn't clear if there's some other name that could be used to refer to the default framebuffer's renderbuffers, though it's hard to imagine what name would make more sense than 0 since it's used for the default elsewhere.

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