GLSL: packing two floats into one

Hey folks. I’ve got an RGB32F texture, and I have to cram two vec3s into it. All vector values are in the [0, 1] range. Does anyone know how? If so, please share your method.

http://mywiki.wooledge.org/XyProblem ?

http://glm.g-truc.net/0.9.4/api/a00135.html

if range is 0 … 1 you’re good with the https://www.opengl.org/sdk/docs/man4/html/packHalf2x16.xhtml method.

tho’ result is a int32, might want to use a RGB32I (integer) texture, which can be a problem if running msaa.

https://www.opengl.org/sdk/docs/man/html/intBitsToFloat.xhtml