glReadPixels doesn't read depth buffer values on iOS

回眸只為那壹抹淺笑 提交于 2019-11-29 07:39:38

As you guess, reading the depth buffer isn't supported in ES 2.x. Per the glReadPixels man page (direct from Khronos) the only permissible values for 'format' in ES 2 are GL_ALPHA, GL_RGBA and GL_RGB.

From memory, depth textures are supported on recent versions of iOS, so it should be possible to run a pixel shader to convert a depth buffer into something you can read as RGBA if you're otherwise at a dead end.

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