Let's say I had a color whose value is 130 and is a unsigned char (BYTE) value
I want to convert it into a float value within the range of 0...1
How do I go about doing that?
I tried to cast directly, but it is no working
like
SrMaterial mat = subMesh->material;
D3DMATERIAL9 material;
material.Diffuse.r = mat.diffuse.r;
Here the SrMaterial consists of color values whose type is srbyte which is in turn defined as unsigned char.
But their values are incredibly large. I don't believe that they are supposed to be rendered in Direct3D environment..
Thanks in advance
Jack