I'm trying to create a float texture to store intermediate results of my rendering pipeline created by a fragment shader. I need the values of the fragments to be signed floats.
I understand that there is the OES_texture_float extension which should be supported by all new iOS devices (i.e. beginning from iPhone 3GS/iPod Touch 3/iPad according to the Apple guide).
However, when I create such a texture using
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_HALF_FLOAT_OES, NULL);
start my app and inspect it in Instruments, it tells me:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_HALF_FLOAT_OES, NULL) : (invalid enum=0x8d61): Invalid enum for argument 'type'
The curious thing is that it's nevertheless working on my iPhone 4S, but not on a iPhone 4 (which should be supported as well). The error message appears for both devices, though. But on the iPhone 4 OpenGL can't build a valid framebuffer object using this texture as a rendering target. On the 4S that works perfectly well.
Do you have any suggestions what I'm doing wrong?
Thanks!