Problems with glColor3f() and texturing

Mars_999
Unregistered
 
Post: #1
I have text on the screen and want to change the color using glColor3f() and I also have a tiling engine that is being rendering. When I use glColor3f() with the font the textures change color also? If red the whole screen is red. Is it possible that you can't use glColor3f() with textures when they are on the screen. I have glDisable(texturing) on when the text is being displayed? Thanks
Quote this message in a reply
Marabese
Unregistered
 
Post: #2
try to use glColor3f(1.0,1.0,1.0) before drawing the textures
Quote this message in a reply
Mars_999
Unregistered
 
Post: #3
Quote:Originally posted by Marabese
try to use glColor3f(1.0,1.0,1.0) before drawing the textures


Thats works to make the fonts all white but I would like to have red fonts?
Quote this message in a reply
Mars_999
Unregistered
 
Post: #4
Ah I Fixed it. WOOT!! Wow
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #5
Code:
glColor3f(1, 0, 0);
draw_fonts();
glColor3f(1, 1, 1);
draw_other_stuff();
Quote this message in a reply
Mars_999
Unregistered
 
Post: #6
Quote:Originally posted by OneSadCookie
Code:
glColor3f(1, 0, 0);
draw_fonts();
glColor3f(1, 1, 1);
draw_other_stuff();


Nope, it had to do with GL_MODULATE I switch to GL_REPLACE and all is good.
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #7
using GL_REPLACE as your texture environment mode will mean that your textures are never modulated by the vertex color, something which is not usually desirable. Try doing what I suggested.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #8
Quote:Originally posted by OneSadCookie
using GL_REPLACE as your texture environment mode will mean that your textures are never modulated by the vertex color, something which is not usually desirable. Try doing what I suggested.


Nope text is white and not blue. but the whole screen is not blue.
Quote this message in a reply
Hog
Member
Posts: 151
Joined: 2002.09
Post: #9
GL_REPLACE texture mode does not seem to be supported anymore, or i'm doing something wrong when i try to use it...

anyways, you may not be able to apply vertex lighting in GL_REPLACE mode
Quote this message in a reply
Mars_999
Unregistered
 
Post: #10
Quote:Originally posted by c_dev
GL_REPLACE texture mode does not seem to be supported anymore, or i'm doing something wrong when i try to use it...

anyways, you may not be able to apply vertex lighting in GL_REPLACE mode


Well for now it seems to be fine with the freatures I am using. If I run into problems using other features I guess I will have to live with white fonts. Dont want to do that.
Quote this message in a reply
Mars_999
Unregistered
 
Post: #11
Quote:Originally posted by OneSadCookie
Code:
glColor3f(1, 0, 0);
draw_fonts();
glColor3f(1, 1, 1);
draw_other_stuff();


Your Idea works but it needs to be done differently then you posted. I have to call the glColor(whatever color) then glRasterPos() and then Draw text and the call glColor3f(white) and everything works fine with GL_MODULATE again. Weird but I found out that you need to call the glColor() before you call glRasterPos() due to it messing up the colors. All is great now. Thanks
Quote this message in a reply
Member
Posts: 157
Joined: 2002.12
Post: #12
Color changes won't take effect after you set the the rasterPos.
Set color before you call rasterPos()


if(color!=null) glColor4f(color->x, color->y, color->z, color->w);
glRasterPos3d (pos->x, pos->y, 0);
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  glColor3f Question Jake 12 4,685 Oct 10, 2003 04:55 PM
Last Post: Jake