Original Post
Is there a more-or-less kosher way to compress multiple colors into a single shader register? Let's say, in shader model 3?
I'm sort of hurting for registers right now, so I'm trying to scrounge around for places to compress data into fewer registers, or even combining multiple registers into the same register.
I think SM3 (pretty much) guarantees that you get a full 4x4 bytes per register. But color information doesn't need more than a single byte per color channel for even full 32 bit color. So it seems like it should be possible to pack multiple colors in to a single register. I could probably come up with something with a bit of thought, but I'm wondering if anyone has done all the hard work for me already All the triangles I'm rendering are flat shaded, so I don't even need to worry about interpolating the compressed register, though a method that allows the compressed version to be interpolated and get back interpolated colors in the pixel shader when you uncompress would be pretty sweet
I'm sort of hurting for registers right now, so I'm trying to scrounge around for places to compress data into fewer registers, or even combining multiple registers into the same register.
I think SM3 (pretty much) guarantees that you get a full 4x4 bytes per register. But color information doesn't need more than a single byte per color channel for even full 32 bit color. So it seems like it should be possible to pack multiple colors in to a single register. I could probably come up with something with a bit of thought, but I'm wondering if anyone has done all the hard work for me already All the triangles I'm rendering are flat shaded, so I don't even need to worry about interpolating the compressed register, though a method that allows the compressed version to be interpolated and get back interpolated colors in the pixel shader when you uncompress would be pretty sweet