Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone, float textures

I need to have GL_RGBA32F as internal format, but i do not get this in OpenGL ES implementation. Instead of this i get only GL_FLOAT as a texture data type. The OES_texture_float spec has nothing to say what's inside. So i do not know, whether my texture data will be normalized to [0, 1] or not. Basically i need to store in texture unclamped texture data regardless it's float or integer value. How i can get not normalized data inside my texture?

like image 791
iDev Avatar asked Jun 14 '26 05:06

iDev


1 Answers

Sadly, OpenGL ES treats the parameters to glTex(Sub)Image* differently from desktop OpenGL.

In desktop OpenGL, what defines the actual format of the texture is the internalformat. In GL ES 2.0, it is the format and type values that define this. So if you upload a (GL_RGBA, GL_UNSIGNED_BYTE) texture, that's the equivalent of using GL_RGBA8 as the internal format.

What this means is that, if you want a floating-point texture, you use (GL_RGBA, GL_FLOAT) as the format and type parameters. It's a pointless inconsistency between the two specifications.

like image 142
Nicol Bolas Avatar answered Jun 16 '26 20:06

Nicol Bolas