Jump to content
  • Advertisement
Sign in to follow this  

Blending issues...

This topic is 4733 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

I'm trying to do something relatively simple, and for some reason it isn't working. Attempts to google for it revealed code that did the exact same thing, and even earlier projects based on NeHe's tutorial do the same thing and those work.. Basically, I'm implanting a debugging menu in my graphics engine with which I can tweak the current map's parameters (fog, lights, texturing...) To do this, I render bitmap fonts. So far so good, I get my menu and it works just fine. Problem is, text doesn't always blend with the background, and it gets kind of hard to make out after a while. Think "badly-designed geocities/angelfire site" bad. ;) My solution? Simple. Just stick a 50% transluscent untextured black quad behind the text. That way I won't obscure the scene, and the scene doesn't interfere with the text. Easy as pie, right? Well, no. For some reason currently unknown to me, when I enable GL_BLEND the quad vanishes entirely. Basically I glLoadIdentity() to reset the view and place my text/background quad at a static location on the screen (this is drawn after the scene.) I then enable GL_BLEND, set the color to {0.0f 0.0f 0.0f 0.5f} (I've also tried white and varies other values for the last parameters,) and then I render a single quad. Then I disable GL_BLEND and render the rest of the text. Except this makes the quad vanish no matter what I seem to do with it (the text is fine.) Any ideas what could cause this to happen? Is there some property I forgot to enable/disable? I don't want to resort to alpha blending with a texture for something as simple as this; any help would be appreciated. :) Edit: A screenshot of what it looks like. Obviously you can't see the quad behind the text or I wouldn't be posting this. :P Free Image Hosting at www.ImageShack.us

Share this post


Link to post
Share on other sites
Advertisement
check your blendfunc and alpha test settings. Sounds like you've got alpha test enabled and ignoring anything less than 1.0.

Share this post


Link to post
Share on other sites
Doesn't seem to be the case... I've tried fiddling with those and it still doesn't show up. :(

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glAlphaFunc(GL_LESS, 0.05f);

Edit: Oh god. I fixed it. I hadn't disabled textures. XD

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!