Tech & AI News
Hacker News

SDF vs. MSDF vs. Slug: GPU Text Rendering

Signed distance fields (SDF) store each glyph’s edge distance in a small texture, allowing shaders to scale text smoothly with antialiasing by thresholding the distance. Multi-channel SDF (MSDF) extends this by encoding separate distance channels for each axis, improving sharpness for complex glyphs. Eric Lengyel’s Slug technique renders glyphs directly from vector outlines in the fragment shader, eliminating texture atlases and per-frame tessellation while preserving crisp edges at any size or perspective.