Texture scale converted to [0..1] when received in ofshader

I have noticed a strange behavior of ofshader when float textures are binded that I can’t explain.

I am using a ofxCvFloatImage to store raw depth data from a kinect with values between 0 and 4000. I process the data in an ofShader.
I would thus be happy to get the raw values in my shader but I noticed that the values are mapped from the native scale range of the image to the [0…1] range when the Texture is binded to the shader.

Is that normal ?

I found a workaround by sending a conversion scale to my shader and converting back the values to the full range but maybe I am missing something about how ofshader works ?

In OpenGL, 2D texture coordinate always range from 0…1 inclusive. If you need it to range from 0…4000, you can use the mix() in GLSL to map the 0…1 value to your 0…4000 range.

mix() performs linear interpolation. This page describes how to use it.

Thank you !