Hello,
Sorry if this is not the correct forum for this question. There doesn’t seem to be an OGLES-specific forum.
I’m developing an OGLES application for iPhone for which dynamic textures are crucial. I am trying to implement these using a framebuffer bound to a texture, since according to the Gold Book, this should provide better performance than editing the texture using glCopyTexSubImage2D (which works, but seems to run very slowly on iPhone hardware).
Unlike render-to-texture or similar effects, I need to be able to rewrite specific arbitrary texels in the buffer. This is where I am running into problems. According to the OGL FAQ, there isn’t any generic means of obtaining the address of a framebuffer in memory:-
http://www.opengl.org/resources/faq/technical/rasterization.htm
14.010 How do I obtain the address of the OpenGL framebuffer, so I can write directly to it?
OpenGL doesn't provide a standard mechanism to let an application obtain the address of the framebuffer. If an implementation allows this, it's through an extension.
Typically, programmers who write graphics programs for a single standard graphics hardware format, such as the VGA standard under Microsoft Windows, will want the framebuffer's address. The programmers need to understand that OpenGL is designed to run on a wide variety of graphics hardware, many of which don't run on Microsoft Windows and therefore, don't support any kind of standard framebuffer format. Because a programmer will likely be unfamiliar with this proprietary framebuffer layout, writing directly to it would produce unpredictable results. Furthermore, some OpenGL devices might not have a framebuffer that the CPU can address.
You can read the contents of the color, depth, and stencil buffers with the glReadPixels() command. Likewise, glDrawPixels() and glCopyPixels() are available for sending images to and BLTing images around in the OpenGL buffers.[/b]
This rationale makes sense for standard OGL, but ES doesn’t implement glDrawPixels() or glCopyPixels()!
So what I’m asking is, is there are any kind of replacement for this functionality in ES? Or does anybody know of an extension for iPhone which does allow direct framebuffer access?
Thanks in advance.