Menu

Why 2D Pixel Art Sprites Bleed Seams in Godot 4 & Unity — MaxRects-BSSF Atlas Packing + 1px Edge Extrusion in HTML5 Canvas
📰

Why 2D Pixel Art Sprites Bleed Seams in Godot 4 & Unity — MaxRects-BSSF Atlas Packing + 1px Edge Extrusion in HTML5 Canvas

DEV Community: javascript·NiNo Studio·about 8 hours ago
#r1ZyT9O7
#devtojavascript#devto#dev#edge#sprite
Long article (1730 words) — no AI summary yet.
Reading 0:00
15s threshold

If you pack 16×16 or 32×32 pixel-art sprites edge-to-edge on a sprite sheet, everything looks clean at 1× integer zoom—until the camera scrolls at a fractional position, a sprite scales slightly, or a tilemap rotates.

Suddenly, 1px hairline seams flicker around tiles and characters: neighboring frame pixels leak in, or dark gray fringes outline every transparent edge.

The culprit is GPU UV sampling. Even with nearest-neighbor filtering ( CanvasItem.TEXTURE_FILTER_NEAREST in Godot 4 or FilterMode.Point in Unity), floating-point texture coordinates at (u = x / W) can straddle a texel boundary by 1e-6 , pulling samples from an adjacent sprite—or from rgba(0, 0, 0, 0) transparent gutter texels when mipmaps or bilinear taps are active.

Fixing this cleanly requires two things in your atlas pipeline: 1px edge-extrude bleed and MaxRects-BSSF packing .

1.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.