开发者

CGImageRef from OpenGL ES framebuffer (iOS)

How can I efficiently开发者_开发知识库 create a CGImageRef from the EAGLView's framebuffer contents using glReadPixels? Perhaps I can "render directly to a texture"?

I'm relatively new to OpenGL ES so any help is much appreciated!


The function glReadPixels is very expensive... if you want to render to a texture you could take a look at:

  • iPhone post-processing with a single FBO with Opengl ES 2.0?
  • Rendering to texture on iOS OpenGL ES—works on simulator, but not on device
  • Writing to then reading from an offscreen FBO on iPhone; works on simulator but not on device? (answer is at end of question...)
  • http://developer.apple.com/library/ios/#qa/qa1704/_index.html
  • http://www.visualnewt.com/OpenGL/learning_iphones_opengl_es/
  • http://www.khronos.org/opengles/sdk/docs/man/xhtml/glCopyTexImage2D.xml

For a reference of OpenGL ES on iOS see http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Glossary/Glossary.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜