Jump to content
  • Advertisement
Sign in to follow this  
tomer_sh

bits conversion question

This topic is 5039 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!