Textures in texture atlas are "leaking" when moving camera

Hey guys! I wanted to convert all my materials into one texture atlas to reduce draw calls. I made all the meshes an set up all the uvs. In theory, it would be perfect, but when I moved the camera a row of pixels leaked from the neighbour textures and caused unwanted jitter (a black texture was next to a blue and a green one, and the sides of it would flash to green or blue when moving the camera). The texture atlas has Pixel filter mode, Clamp wrap mode, the size is 128x128 pixels and the format is RGBA24.


This texture is in the top-left corner, with a grey texture above and a blue, with fading opacity from 50 to 0, texture.


– David

Like the padding around the UV shells on standard textures you need some space between two parts of a texture atlas. It might look good up close, but with mipmapping you will always get bleeding at the edges, if you pack the textures too tight.

Pifliks comments helped me a lot, but he didn’t make an answer, so I am just giving him the credit this way.

“Well…the padding would typically be the same color as the texture itself…you simply repeat the last/first row/column of pixels a couple of times. The smaller the texture, the bigger is the effect of bleeding. It is always there, though. At the edges of your UVs you will always see the color of the neighboring pixels.” - Piflik