I have a cs project, and I have a simple CS sphere in my project. I am trying to set the color of the textures for tis sphere.It looks like the RGB values I use setting the textures color are not the real colors that are rendered on the screen!For instance the following RGB values display as following (I used MS paint with the color picker to sample the color from the screen):

more specifically I am interested in the this color(238, 130, 238) which yields (239, 130, 239)

I have verified that the color depth is 32 bits (tried also with 24), and the weird thing is that when I query CS for the color of the texture I get the same RGB value that it was set to, but on the screen it looks like there is some transformation happening and the RGB value is modified. This happens also when I turn all lights off and set ambient to (1,1,1).

I think you cannot depend on exactly the same color being rendered. There are too many things happening by the OpenGL system and the 3D card (like filtering, AA, and other effects) so that exact colors don't come out exactly the same.

But I also don't think this should be a problem. You cannot really see such small differences.

Thing is I do need the color to display exactly the same as I have a different program (which aparantly I can't modify at the moment) that looks for this specific color and displays video on this specific color. It is not about the visible difference. Suppose I COULD change the code of the other party prgram expecting for that color to expect another color I am still looking for something that won't change inside cs/OpenGL regardless of the platform I will use.

Thing is I do need the color to display exactly the same as I have a different program (which aparantly I can't modify at the moment) that looks for this specific color and displays video on this specific color. It is not about the visible difference. Suppose I COULD change the code of the other party prgram expecting for that color to expect another color I am still looking for something that won't change inside cs/OpenGL regardless of the platform I will use.

I have verified that the color depth is 32 bits (tried also with 24), and the weird thing is that when I query CS for the color of the texture I get the same RGB value that it was set to, but on the screen it looks like there is some transformation happening and the RGB value is modified. This happens also when I turn all lights off and set ambient to (1,1,1).

Disable texture compression on the texture (set the texture class to "nocompress").

I have verified that the color depth is 32 bits (tried also with 24), and the weird thing is that when I query CS for the color of the texture I get the same RGB value that it was set to, but on the screen it looks like there is some transformation happening and the RGB value is modified. This happens also when I turn all lights off and set ambient to (1,1,1).

Disable texture compression on the texture (set the texture class to "nocompress").

Hi res,

thanks for your reply, I tried doing that but it looks like some exception that I can't see occurs or sometuing soesn't work correctly, here's my code:

Code:

string materialSuffix = "material";string textureSuffix = "texture";

string textureName = newMaterialNameBase + textureSuffix;

// For this to work, we need to remove the existing texture from the engine's // texture list. If meshWrapper colors will be used by more than one meshWrappers,// this will have to change to adding a new texture with a different name.iTextureWrapper* roomTextureWrapper = engine->FindTexture(textureName.c_str());if (roomTextureWrapper != 0){engine->GetTextureList()->Remove(roomTextureWrapper);}roomTextureWrapper = engine->CreateBlackTexture(textureName.c_str(), 256, 256, 0, CS_TEXTURE_3D);

I have verified that the color depth is 32 bits (tried also with 24), and the weird thing is that when I query CS for the color of the texture I get the same RGB value that it was set to, but on the screen it looks like there is some transformation happening and the RGB value is modified. This happens also when I turn all lights off and set ambient to (1,1,1).

Disable texture compression on the texture (set the texture class to "nocompress").

ok I fixed that problem and managed to set the class name, I tried the "nocompress" "normalmap" and teh "lookup" but neither fixed the problem.The code is similar to the 1 above.

// For this to work, we need to remove the existing texture from the engine's // texture list. If meshWrapper colors will be used by more than one meshWrappers,// this will have to change to adding a new texture with a different name.iTextureWrapper* roomTextureWrapper = engine->FindTexture(textureName.c_str());if (roomTextureWrapper != 0){engine->GetTextureList()->Remove(roomTextureWrapper);}roomTextureWrapper = engine->CreateBlackTexture(textureName.c_str(), 256, 256, 0, CS_TEXTURE_3D);