Advertisement

Wierd color swapping with OpenGL

Started by December 12, 1999 05:32 PM
5 comments, last by GameDev.net 25 years, 2 months ago
Aparently some graphics cards switch around the RGB color triplet to some other form eg. BGR. If that is the case for your graphics card you would hve to check for that compatibility and respond accordingly. Have you had any problems with that before?

This might not be the case in your situation but I have not used that API so I cannot give you any positive answers.

William Reiach - Human Extrodinaire

Marlene and Me


I had to swap the R and B values when I was doing textures in MS's OpenGL. Sounds like a standard to me.
joeG
Advertisement
Are you guys using 24-bit .bmp files for your textures? Those are stored as BGR not RGB and that is probably causing your problems.
The image was a 24 bit tga file. I'll test a little bit then maybe just swap the colors around.

I hadn't noticed this before, but I might have just missed it.

If you're still using windowed mode, you might want to set up a standard Windows window that draws your textures using SetPixel() and the RGB macro. It helped me narrow down exactly where things went awry why I was getting textures set up.

BTW, I'm using TNT2 and haven't had that problem.

-the logistical one-http://members.bellatlantic.net/~olsongt
First off, this is using Nvidias ICD.

I have a terrain that I'm applying a texture map to, and it works ok, except for one issue.

For some reason, the output swaps red values for blue values. So something that in the texture map is 128,0,0. Comes out as 0,0,128.

I'm not doing anything fancy and most everything is at it's default setting, and I've never seen anything like this.

Any clues?

Advertisement
Uh, well. This problem sounds familiar to me. I think the R, G, B-values are stored in BGR-order in 24bit tga images, so all you have to do is to swap R and B in order to get RGB. However, this problem is in no way related to your drivers.

hth

[This message has been edited by Chappa (edited December 12, 1999).]

This topic is closed to new replies.

Advertisement