#### Archived

This topic is now archived and is closed to further replies.

# Letter in black?

This topic is 5997 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

hi, no, I''m NOT going to make a new film called Letter in black I have prob with fonts. I have a routine that loads a font from a .tga file. Each Letter is within a black box, which means I have a black box on the screen and within the letters. I wanted to know how to remove this black box, so that the letters are drawn without any kind of border. I tried a way with glBlendFunc, but after thinking about it, I saw that this wouldn''t make any sense, because the letters would be also influenced and not only the black shit. Thx for your advise yot

##### Share on other sites
if you''re using tga files, use the available alpha channels. Both photoshop and Pain Shop Pro support alpha channels. More or less, you need to invert the black portion of the tga image to an alpha layer.

Best of luck,
Jason

##### Share on other sites
hi,

thx for advise, I already thought about that, but isn''t there any other way? It must be possible disable one color like in DirectX...

yot

##### Share on other sites
I think you should take DeschutesCore''s advice. The only other way is to use depthmasks, which aren''t only twice as annoying but also twice as slow. (since you need to work with two contrasting images of the same letter).

Using the alpha channel in a tga file has got to be one of the easiest ways to accomplish what you''re trying to do in opengl.

##### Share on other sites
If you don''t want to screw with the TGA in the paint program, screw with it when you load it. It is appalingly easy to do a colour key (the thing in DX which I believe isn''t supported anymore? Maybe just not in DDraw).

for each pixel if pixel.r = pixel.g = pixel.b = 0 then pixel.alpha = 0.0f else pixel.alpha = 1.0f

Of course your implementation depends on how you loaded the pixel values etc.

~~~
Cheers!
Brett Porter
PortaLib3D : A portable 3D game/demo libary for OpenGL
Community Service Announcement: Read How to ask questions the smart way before posting!

##### Share on other sites
hi,

thx to all who wanted to help me, but I finally used the alpha channel modification of the tga.

yot

• 45
• 11
• 17
• 11
• 13