Using OpenGL ES texture caches instead of glReadPixels to get texture data

最后都变了- 提交于 2019-12-05 12:41:00
Brad Larson

I describe a means of doing this in this answer, based on your above-linked article and Apple's ChromaKey sample from WWDC 2011. Given that Apple used this in one of their samples, and that I've not heard anything countering this from their OpenGL ES engineers, I believe this to be a valid use of the texture caches. It works on every iOS 5.x-compatible device that I've tried, and works in iOS 5.0 and 5.1 just as well. It's much, much faster than glReadPixels().

As far as when to lock the pixel buffer base address, you should be able to use glFlush() or the like to block until all data has been rendered to your FBO texture. This seems to work for the 30 FPS 1080p movie encoding I've done from texture-backed FBOs.

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