I'm using ilCopyPixels to get all of the colors from a texture. And after puzzling a while, i found out, that ilCopyPixels gives me negative values( using IL_FLOAT). And that these negative values turned out to be the highlighted parts of the image. So 1+that_value, gives the correct value in a range of 0.0f-1.0f. I think this might be really obvious for some of you, but i don't understand why it gives me those negative values.. By the way, i used IL_FLOAT, because IL_BYTE, or IL_UNSIGNED_BYTE looked even worse
. Anyway, here is most of the relevant code:
Data=BufferUtils.createByteBuffer(512*512*4*4); //texture is 512 by 512 pixels exact. and .png but i doubt it matters?
//after that, just continues to load the texture normal, so it can be displayed as well
//some where else, i try to make something of the Data
for (int i=0;i<512;i++)
for (int j=0;j<512;j++)
float c=new float;
for (int k=0;k<3;k++)
//now here I can use c[0-2] with GL11.glColor3f(); to get proper colors, like in the texture
So what's up with the negative values? I suppose it has something to do with the way DevIL and/or OpenGL stores texture data..., but how is that?
PS I know this is really not the best way to do this,, the loop is quite expensive
But it was just for seeing what the hell the DevIL gave me