Blend black contour

I’ve tried all kind of google solutions without luck. Blending a texture on a transparent has black borders between color and transparency. Many thanks

You haven’t given us much to go on.

  • Are you using the correct blending mode? If the texture has pre-multiplied alpha, you need to use `glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) (assuming back-to-front rendering).
  • If the blending function uses destination alpha, does the framebuffer have an alpha channel?
  • Are you rendering in the correct order? Depth-testing won’t work with blending.

No luck. With alpha 0.7 it’s better but not good. I do

	if (AlphaV > 0.7f) {
	AlphaV = 0.7f;
glColor4f(1, 1, 1, AlphaV);

XPLMBindTexture2d(textures[ICE_TEXTURE].texIMGID, 0);
			glTexCoord2f(1, 1.0f); glVertex2f(right, bottom);	// Bottom Right Of The Texture and Quad
    		glTexCoord2f(0, 1.0f); glVertex2f(left, bottom);	// Bottom Left Of The Texture and Quad
			glTexCoord2f(0, 0.0f); glVertex2f(left, top);	// Top Left Of The Texture and Quad
			glTexCoord2f(1, 0.0f); glVertex2f(right, top);	// Top Right Of The Texture and Quad


Have you checked whether the problem is with the texture itself? If a background colour has been allowed to bleed into the border pixels when generating the texture, nothing that’s done in rendering can fix that.

The texture looks fine in photoshop. I don’t know what x-plane is doing in the background. Tried the linear to glnearest as google found but no luck also. Anything else to try? Thanks

Read the Premultiplied alpha post here, and search for “black” and “halo”:

As a bonus, read Premultiplied alpha part 2.


Also, re Photoshop, be sure you know what RGBA encoding you’re saving your images in:

Don’t understand, I only alpha fade in a *.png