Sign in to follow this  
chibitotoro0_0

Alpha Blending partial transparent to opaque background

Recommended Posts

Hi everyone, This is a simple problem that I haven't ran into the past but is haunting me now. Here's the screenie: Here is the texture I'm using:
glEnable(GL_BLEND);

glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

I draw the pink background first as well and then the polygon on top. As you can see there is a black outline around the texture. Thanks for the pointers!

Share this post


Link to post
Share on other sites
That happens when you have a linear filtering mode for your texture. Because of that, nearby black texels get blended in. You need to edit your texture to get rid of those black texels.

Share this post


Link to post
Share on other sites
I changed

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);




to

glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_NEAREST);



and still the same results. Are you saying I need to edit the original PNG?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this