Sign in to follow this  
tomer_sh

bits conversion question

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this