*NOT* Blending 2D texture fonts over textures

Started by
8 comments, last by Narkster 22 years, 6 months ago
I was wondering if there was a way around this problem. When I use 2D texture font over other textures the fonts are very transparent. I have to use blending when I create the 2D fonts to get rid of the black squares but is there anything I can do about the fonts "fading" on the other textures? I have already tried glColor4f and using blending exclusively during the creating of the quads for the fonts. Thanks, -Nark
--------------------------Budha walks up to a hotdog vender and says:"Make me one with everything."L8R
Advertisement
I think it''s lesson 19 It''s about masking and it''ll help you out I think.
Languages: C/C++ C# JavaAPIs: Win32 OpenGL DirectXWeb: &#106avascript Perl JSP PHP-MySQL Oracle Database Programming</span><a href='http://www.ethereal-studios.com'>http://www.ethereal-studios.com</a></a>
yeah, but how would I take advantage of the alpha channel in targa files? sorry forgot to add that up there.

Thanks,
-Nark
--------------------------Budha walks up to a hotdog vender and says:"Make me one with everything."L8R
Assuming your font image isn''t ''corroded'' use:
  glAlphaFunc(GL_GREATER,0.0f);glEnable(GL_ALPHA_TEST);// Render your fontglDisable(GL_ALPHA_TEST);  



[Resist Windows XP''s Invasive Production Activation Technology!]
BTW, anyone know where I can get a good font builder? NeHe had a really good one on his downloads page, but I can''t find it anymore, assuming he took it down long ago when he redid the site.
Languages: C/C++ C# JavaAPIs: Win32 OpenGL DirectXWeb: &#106avascript Perl JSP PHP-MySQL Oracle Database Programming</span><a href='http://www.ethereal-studios.com'>http://www.ethereal-studios.com</a></a>
You can try http://www.lmnopc.com/bitmapfontbuilder/. I wrote a program that takes an image (actually .rim images, my own format) and (provided with the number of columns and rows) aligns all characters to the left, then calculates their width and stores it all in a file. The best part of having such a tool is that you''re not stuck with any single font to texture program. I''d advise you to do the same.

[Resist Windows XP''s Invasive Production Activation Technology!]
Thanks a lot! I''ve really been looking for one, it''s pretty cool that you took the time to write your own format. Nice work As a matter of fact, this was the program I was just looking for, I used it before for one of my games, but lost it ( I grieved for weeks). Thanks for helping me out.
Languages: C/C++ C# JavaAPIs: Win32 OpenGL DirectXWeb: &#106avascript Perl JSP PHP-MySQL Oracle Database Programming</span><a href='http://www.ethereal-studios.com'>http://www.ethereal-studios.com</a></a>
Plz excuse that poorly written response..., just know that I was very excited to have found this program once again. :D
Languages: C/C++ C# JavaAPIs: Win32 OpenGL DirectXWeb: &#106avascript Perl JSP PHP-MySQL Oracle Database Programming</span><a href='http://www.ethereal-studios.com'>http://www.ethereal-studios.com</a></a>
NaV, I can''t seem to get that Alpha thing working, are you saying like this?
  glAlphaFunc(GL_GREATER, 1.0f);glBindTexture(blah);glEnable(GL_ALPHA_TEST);//inser tex coords and verticies hereglDisable(GL_ALPHA_TEST);  


That''s the way I''m doing it, but it just loads the same texture..

Thanks,
-Nark
--------------------------Budha walks up to a hotdog vender and says:"Make me one with everything."L8R
It''s meant to be "0.0f" not "1.0f". All it does is not render anything that has 0 in its alpha channel, but everything else is rendered normally.

[Resist Windows XP''s Invasive Production Activation Technology!]

This topic is closed to new replies.

Advertisement