MagFilter is creating black outline


I have a quad with a texture on it. Imagine the texture being a 3*3 tile grid with the tile in the middle non transparent and the other 8 tiles surrounding it being transparent (R: 0, G: 0, B: 0, A: 0). Now the MagFilter is creating a black outline on the border between the tile with the visible part of the texture and the tiles with the non visible parts of the texture.

How can I avoid this?

With extra borders or with a 4x4 tile grid.

And actually, even a 4x4 grid will probably have the problem if you don’t clamp the texture coordinates in the shader.

I was thinking of the mipmap situation.

Padding/borders is the easiest solution.