Jump to content
  • Advertisement

Archived

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

yot

Letter in black?

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
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

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!