When one calls:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texWidth, texHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, rawData);
it’s easy to know how to format the data: pass in an array of bytes, in the range 0-255, where 0 is lowest and 255 is brightest for each color component.
When you do the same with GL_FLOAT, you pass in an array of floats. My question is, what is the range of each color component value? 0 to 1.0? 0 to the maximum value of a float?
And you would pass in an array of floats, 4 floats per pixel when GL_RGBA is used, correct?
Also, to confirm: GL_HALF_FLOAT_OES is not a parameter for glTexImage2D, but instead is only for verticex, correct?
My iPad 3 reports “GL_OES_texture_float” and “GL_OES_texture_half_float_linear” as being supported. This means I can indeed use GL_FLOAT as a parameter to glTexImage2D, right? Anyone know if the iPad 2 supports this?
The range of floating-point values is… the range of floating-point values. That’s kinda the point of using them. When you fetch from a floating-point texture in a shader, you get the floating-point value stored there. There is no clamping or anything applied.
If you make a half-float texture, then it’s values have the range of a 16-bit floating-point value. If you make a single-precision float texture, then it’s values have the range of a 32-bit floating-point value.