Archived

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

trager

glBlendFunc(GL_SRC_ALPHA,GL_ONE);

Recommended Posts

What do you mean by the color of the object, like the color you set with glColor4x(....)?, texels are always drawn as color
(tr*or+tg*og+tb*ob+ta*oa), where tx stands for texture x and o for object.

[edited by - Tree Penguin on January 17, 2004 7:35:27 AM]

Share this post


Link to post
Share on other sites
yup,

so if you use color4f(1,1,1,1) the background would be white and it seems to make the texture really bright for some reason.

If you set it to red the texture takes on a red hue most annoying.

Share this post


Link to post
Share on other sites
No luck with that james. It disabled blending and quite possibly made the original problem worse.

I think i need to describe what I''m trying to do



I have a 2d game with a simple menu.
The menu text is made from bitmaps.
The bitmaps have a few nearly black pixels around the edges.
I want to drop these and glBlendFunc(GL_SRC_ALPHA,GL_ONE); does that
I also want to be able to fade the text slighlty when it isnt selected.


I can get all of this to happen but when the menu items are drawn over the background they seem to get very bright.

When there is no background it all works perfectly.
Any ideas on how to solve this?


Share this post


Link to post
Share on other sites
Ooops, what was I thinking!

Perhaps what you should be using is alpha testing i.e. reject the pixels where alpha is above/below some threshold value. This then leaves you with the blend function to control how much the colour gets blended with the existing scene, to allow you to control the ''intensity'' of the output

Share this post


Link to post
Share on other sites