views:

51

answers:

0

Hi,

I'm rolling a deferred shader pipe, and due to the need to keep the G-buffers in a unified format a need to compress attributes is needed. I've sadly been unable to find some good information on how this actually is done.

I have a G-buffer format that uses 16 bits per component in a fixed point format. Sadly as I target shader model 3 hardware I can't use bit operators. So, basically, how does one go about to pack 2 8 bit values in the 0..1 range into a single 16 bit channel, also in the 0..1 range? Preferably applicable to either CG or HLSL.