Jump to content

  • Log In with Google      Sign In   
  • Create Account


Wierd color swapping with OpenGL


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 12 December 1999 - 11:32 AM

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?


Sponsor:

#2 Gromit   Members   -  Reputation: 144

Like
Likes
Like

Posted 04 December 1999 - 07:45 PM

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.



#3 joeG   Members   -  Reputation: 172

Like
Likes
Like

Posted 06 December 1999 - 03:48 AM

I had to swap the R and B values when I was doing textures in MS's OpenGL. Sounds like a standard to me.

#4 Kyle Radue   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 December 1999 - 04:22 AM

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.

#5 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 06 December 1999 - 05:04 AM

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.


#6 logistix   Members   -  Reputation: 122

Like
Likes
Like

Posted 06 December 1999 - 02:23 PM

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.


#7 Chappa   Members   -  Reputation: 122

Like
Likes
Like

Posted 12 December 1999 - 11:32 AM

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).]





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS