Letter in black?

Started by
4 comments, last by yot 22 years, 6 months ago
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
Advertisement
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
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
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.
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!
~~~Cheers!Brett PorterPortaLib3D : A portable 3D game/demo libary for OpenGLCommunity Service Announcement: Read How to ask questions the smart way before posting!
hi,

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

yot

This topic is closed to new replies.

Advertisement