White border artifact around alpha in imported texture (only on linear filtering)

Hi Guys,

I have a strange problem on an imported UI texture, when using linear filter there is a white line artifact on the frontier of the texture and alpha.

I have try every option including preserve border, but the only thing that change that is to desactivate filtering.

Maybe it is a bug or something ?

Linear Filtering With Artifact :
textureLinear.jpg

Nearest Filtering Without Artifact :
textureNearest.jpg

Thanks for your help

My guess would be that the engine is expecting textures with pre-multiplied alphas. Your transparent pixels are probably white instead of black (as they would be if they were pre-multiplied) so the white gets blended in at the edges to create fringes like that.

How does the texture look without alpha? What is the background color where the alpha is black?

Try to set it to clamp also instead of wrap. Always good for UI things.

Hi,

EDIT: That was the wrong texture (updated)
Thanks for anwser, here is my picture that I use : http://prntscr.com/36kll0

Will take a look about the color of pixel that is alpha, don’t know that there is a difference

Well sorry for double post, I have set pixel to black in the alpha zone, and looks like it is okay =)

Thanks for the help ! (very quick indeed)

Yes always make sure the pixels are not white, and preferably not black either. Use a darker tint of the average color in the image as background.

So I cannot just export as alpha pre-multiplied png ? Try this it work pretty well, I suppose I got this artifact because of the bilinear filtering taking two value one with alpha = 1.0 and a color and the other with alpha = 0.0 and white.

Hello, I have the same problem, but setting to neither black nor white would work, because the game is only black and white and it would always show :I

Found it. In textures set tiling to Clamp instead of Wrap or Mirror

Alpha in PNG is unfortunately a trash fire of incompatibility and has been for a long time. The implementation choices are not very useful for games :frowning:
You need to use TGA, or PSDs straight out of Photoshop, if you want to have correct control of alpha/color values.