Quick answer: Add 4–8 pixels of padding around each sub-texture in the atlas (with edge color extended into the border). Increase padding for mipmapped textures.

You combine a dozen small mesh meshes and their textures into one atlas to cut draw calls. The result looks great close up but at distance you see thin colored lines where one tile’s texture bleeds into another. Classic atlas bleed from insufficient padding.

Why Bleed Happens

Bilinear filtering samples 2×2 texels per pixel and interpolates. At a tile boundary, the sample reaches one texel past the tile edge into the neighbor. With mipmaps, the boundary effect compounds: each mip level halves resolution, so a 2-texel buffer at mip 0 becomes 1 texel at mip 1, 0.5 at mip 2 — bleed becomes inevitable.

Fix 1: Pad with Edge Color

When generating the atlas:

  1. Place each sub-texture with N pixels of empty border (4 for non-mip, 8 for mip).
  2. Fill the border with the edge color of the sub-texture (clamp the texture).
  3. Or, repeat the texture edge into the border (cheap and works for tile-friendly textures).

Now bilinear sampling at the tile’s edge picks up the matching color from the border, not the neighbor.

Fix 2: Power-of-Two Atlas

NPOT (non-power-of-two) atlases can have mip generation quirks. Stick to POT sizes (256, 512, 1024, 2048) for consistent mip behavior across GPUs.

Fix 3: Adjust UVs Inward

Even with padding, you can inset UVs slightly so the sampled range starts a pixel inside the tile boundary:

uv.x = lerp(uv_min.x + texel_size, uv_max.x - texel_size, raw_uv.x);
uv.y = lerp(uv_min.y + texel_size, uv_max.y - texel_size, raw_uv.y);

Halves the effective tile size by 2 texels (acceptable for most uses) and eliminates any sub-texel bleed.

Fix 4: Disable Mips for UI Atlases

UI elements aren’t sampled at distance; mipmaps are wasted memory. In the texture importer for the atlas, uncheck Generate Mip Maps. Padding requirement drops to 2 pixels and total memory goes down.

Verifying

View the combined mesh from various distances and angles. Bleed shows up as thin lines at tile boundaries, especially against dark backgrounds. After fix, no lines. Confirm with screenshot comparison.

“Padding plus inset UVs eliminates atlas bleed. The math is simple; budgets are tight; designers must account for it during authoring.”

Document the atlas padding requirement in your art pipeline — new tilesets that ignore it produce bleed regressions in QA.