• Advertisement
Sign in to follow this  

Alpha Blending partial transparent to opaque background

This topic is 2876 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 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
Advertisement
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
Sign in to follow this  

  • Advertisement