Recommended Posts

I have made some font as bitmaps (letter's are white, and backgrounds are black), I just want the black part to be transparent and also to draw black colored text. I have loaded the font as textures but have problems with how it looks, black is transperent (even the black letters) and the font seems to blend in with what has already been drawn(when font is other than black). Currently the blend func is glBlendFunc(GL_SRC_ALPHA, GL_ONE).
Thank you!

Share this post

Link to post

Share on other sites

What you wanna do is called masking.As far as i know you cant mask with a single pass (unless your bitmapsare 32 bits with alpha channel). You need to draw each letter twice, eachtime with different glBlendFunc(). Or you can avoid the problem simply by using the z-buffer and drawing your letters first closer than the rest of your scene(on a black background ofcourse).