Sampling float from texture(rect)

Hi there,

I wanted to use a texture/buffer to access my heightfield on my vertex shader. However, the heights are floats and it seems like all methods that sample 2dtextures return vec4, which has 4 bytes.
Any idea how i can sample floats? Can i combine the four ints/bytes back into the original floats? Or did i miss some other functions that can help me with this?

In case you have a one, two, or three channel texture, e.g. R32F, RG16F or RGB8, you still get a vec4 at fetch time, just the unavailable channels get default data, thus in case of a single channel R texture you get the result (r,0,0,1), where r is the actual component from the texture.

Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
Technical Blog: http://www.rastergrid.com/blog/