Original Post
If you have for example a conventional 8-bit RGB or RGBA texture you can pack a float (for example depth) in there using some GLSL based encoding/decoding trick. Now I'd like to examine some special case. Let's say we have a 16-bit float RGB or RGBA texture as render target. I have 2 float values which are in the range 0-1 and for which it would be okay to loose precision down to 8-bit or 7-bit. Is there a way to pack 2 float values into 1 16-bit float texture color component? Since that way a single GBuffer texture could hold 8 float values of limited accuracy. Somebody said one to use "float output = floor( floatValue1 * 255.0 ) + floatValue2;". Somehow I don't think that would do the trick as 16-bit float is not stored in a way for this to have much of an effect. I presume the sign bit, exponent bits and a couple of value bits would have to be used to store one value and the rest for the second.