Hi,
I’m a little lost on how to create a float texture, between OpenGL 2.0 and OpenGL ES 2.0…
I used to do this on OpenGL:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, width, height, 0, GL_RGBA, GL_FLOAT, data);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F_ARB, width, height, 0, GL_RGBA, GL_FLOAT, data);
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA32F_ARB, width, height, 0, GL_ALPHA, GL_FLOAT, data);
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA16F_ARB, width, height, 0, GL_ALPHA, GL_FLOAT, data);
The 3rd argument being the internal storage format (VRAM), the 7th the number of channel in the source picture (RAM), and the 8th the source picture channel format (RAM).
However it looks like theses rules are no more valid with OpenGL ES 2, the manual is not very clear on that matter… From what I’ve understood only the 8th argument define the internal channel format ?
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_FLOAT, data);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_HALF_FLOAT_OES, data);
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_FLOAT, data);
glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, width, height, 0, GL_ALPHA, GL_HALF_FLOAT_OES, data);
1/ Am I right in both my examples ?
2/ Is there an universal way (GL/GL ES compatible) of creating a float texture ?
3/ With GL ES, what’s the use of the defines GL_RGBA32F_EXT, GL_RGBA16F_EXT, GL_ALPHA32F_EXT and GL_ALPHA16F_EXT ?
4/ With GL ES, when you create a FLOAT16 texture, does it assume the source picture is FLOAT32 ?
Thanks !