Floating point textures and GLSL


I’ve been trying to implement 16 bit float pbuffers with 16bit float textures. As i understand it you are no longer clamped to the [0,1] range with such textures using ATI_texture_float extension with GL_RGBA_FLOAT16_ATI, however in GLSL when working with negative values, nothing seems to work, only the positive values.

The GLSL spec odviously copes with negatives, so i am wondering what the range of a 16 bit float can have, and also if anybody else has had such experiences ??



Floating point values are fully supported in the range of the data type you are using (16 bits or 32 bits). But remember that the final rendering values will still be clamped to the interval [0, 1]. Your pbuffer might be in 16 bits precision by channel, but your frame buffer is not. To see if your shader is working, you should try mapping your data in the range which will be displayed.

Hope it helps. :slight_smile:

Hi, actually what i am doing is using this texture as sort of raw data, and deciding whether to process this particular fragment, i then go on to do colouring in a different way, that uses a [0,1] range for writing the output colour. I wanted to know if texturing using the above mentioned method can work in this manner (ignoring colouring to the frame buffer, just for general computation)

any ideas??, maybe i have found a bug!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.