PDA

View Full Version : wierd texture colors



Warrior
03-27-2001, 08:09 PM
i hope someone knows a possible solution to this cause its been baffling me all day http://www.opengl.org/discussion_boards/ubb/frown.gif


im mapping some textures to some polys and their colors have been changed somehow.
i have lighting disabled and materials disabled
so that shouldnt be affecting the color.
they are 32 bit textures.
when i built them i specified
GL_RGBA8 for the internal texture format and
GL_RGBA for the texture type
i believe this is correct and should not be affecting the outcome color of the texture.
one more thing they are targa images.


i hope thats enough info for someone to be able to share a possible solution with me,
thanks guys

[This message has been edited by Warrior (edited 03-27-2001).]

Bob
03-28-2001, 01:43 AM
Perhaps you set a polygon color with glColor and use GL_MODULATE in glTexEnv. Either set the color to white, or replace GL_MODULATE with GL_REPLACE. GL_MODULATE multiplies the polygon color with the texture color.

billy
03-28-2001, 01:48 AM
I had the same problem and it was the glcolor function before glbegin call. Use glcolor3f 1,1,1 (white) to view the real texture color.

DaViper
03-28-2001, 01:55 AM
it would help if you would post the piece of code...

Warrior
03-28-2001, 10:45 AM
i am setting my polygon color to 1, 1, 1
ill try replacing GL_MODULATE with GL_REPLACE
heh im at school right now, so if the above doesnt work ill paste some code when i get home

Warrior
03-28-2001, 01:07 PM
i think my problem is a bit more advanced than what previous posts have mentioned. ive checked all the obvious stuff. it has to be something else.

could it have something todo with the pixel packing alignment? im currently specifying no type of alignemt using glPixelStorei?? i believe.
could this be the problem?
that opengl is getting the data in the wrong order?

[This message has been edited by Warrior (edited 03-28-2001).]

DFrey
03-28-2001, 01:21 PM
Perhaps your image is in BGRA format rather than RGBA.

Warrior
03-28-2001, 01:23 PM
thanks for your reply, but no, ive changed it to rgba

Warrior
03-28-2001, 03:05 PM
WOOHOO!! http://www.opengl.org/discussion_boards/ubb/smile.gif
k guys i figured it out.
i had rewritten my targa loader over the weekend and i had forget to update the position of the file pointer so it was reading in the wrong data. hehe
quite often i find that most programming problems are problems just like these that are so easy to fix, but cause the most grief while trying to debug.
thanks guys
-Dave