2

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.

Ylisar
  • 4,293
  • 21
  • 27

1 Answers1

0

Maybe this link will help you: http://www.gamedev.net/topic/534283-hlsl-pack-two-values-into-one-component-of-a-4x16_unorm-target/

But by my experience i would say the packing costs are high. I use more Multiple Rendertargets (MRT) to save the data and this works fine for me.

Gnietschow
  • 3,070
  • 1
  • 18
  • 28