bits conversion question

Started by
0 comments, last by xg0blin 19 years, 7 months ago
Hi. I am using 16 bit pixels format, but now I added lighting, and I want to use an Intensity LUT. This LUT takes about 7mb, so I want to convert the engine into 8 bit, and to work with 8 bit, and to write a LUT, that converts 8 bit into 16 Bit. I know how to extract the RGB of 16 bit, but I have no idea how to reduce it into 8 bit. Another thing, I would also like to know how to convert 8 bit to 16 bit Cheers
Advertisement
You could take the simple route, and just shift the bits around. TO go from 8 to 16 you could do.

New16Value = Old8BitValue << 8;

To go from 16 to 8, just shift the other way

New8Value = Old16Value >> 8;

Viola.

This topic is closed to new replies.

Advertisement