views:

484

answers:

1

I am attempting to use Textured fonts as so that I can display text in my openGL scene. However I am having trouble finding glBlendFunc values that will work.

The background that the text will be placed on is a grayscale image but will change throughout the execution. Because the background changes the text could possibly be on top of any color from black to white.

The best values I have found are glBlendFunc(Gl.GL_SRC_COLOR, Gl.GL_ONE_MINUS_SRC_ALPHA). This will make the black box surrounding the character disappear but the character itself will fade as the background goes towards white.

Please help!

+1  A: 

Do you want the text to invert based on the background color? white text over black background, black text on white? I think you can achieve an invert via blendfunc.

Alternatively you can use a font texture which has a "border" built into it to help set the character apart from the background. Imagine a white font w/ a smooth alpha blended black "glow". The font will look good against almost all colors.

basszero