Jump to content

  • Log In with Google      Sign In   
  • Create Account


Colored textured font


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
4 replies to this topic

#1 zedd   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 July 2001 - 12:15 PM

Hi I''m using textured font to draw text over my background scene. I use a black and white texture with anti-aliased characters and an alpha channel to make the black part transparent. It works fine but i''d like to be able to change the text color without having to load anything else (ie replace the white of the character by another color). Of course the text should still be blended correctly with the background. Is there a simple way to do this? thanks zedd

Sponsor:

#2 Elixir   Members   -  Reputation: 122

Like
Likes
Like

Posted 21 July 2001 - 12:28 PM

One of the common methods (and the way I do it) is to use vertex lighting. If you have a solid white texture and specify red light on it, it will turn it red (of course).


#3 zedzeek   Members   -  Reputation: 528

Like
Likes
Like

Posted 21 July 2001 - 05:18 PM

provided u have the alpha channel of the etxture setup well
use
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glDisable( GL_LIGHTING )
glColor4f(1,0,0, 1) // for red
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA. GL_ONE_MINUS_SRC_ALPHA )


http://members.xoom.com/myBollux

#4 zedd   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 July 2001 - 05:05 AM

hehe, i knew there was a simple solution, thanks zeek

#5 zedd   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 July 2001 - 05:06 AM

I was doing the exact same thing, but using GL_REPLACE.. stupid me




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