Converting 8 bit color into RGB value
问题 I'm implementing global illumination in my game engine with "reflective shadow maps". RSM has i.a. color texture. To save memory. I'm packing 24 bit value into 8 bit value. Ok. I know how to pack it. But how do I unpack it? I had idea to create a 1D texture with 8 bit palette, with 255 different colors. My 8 bit color would be index of pixel in that texture. I'm not sure how to generate this kind of texture. Are there any mathematical ways to convert 8 bit value into rgb? @edit The color is