The Spectrum Dispatch News

technology

GPU Text Rendering: From Atlases to Slug's Outline-Based Approach

Five methods for rendering text on GPUs—from bitmap atlases to Slug's patented technique, now public domain—each with different trade-offs in quality, speed, and complexity.

GPU Text Rendering: From Atlases to Slug's Outline-Based Approach

Rendering text on a GPU presents a fundamental challenge: glyphs are vector outlines, not pixels, and must appear crisp at any scale, under 3D transforms, and potentially change every frame. According to alphapixeldev.com, the industry has developed five main approaches, each making different trade-offs.

GPU Text Rendering: From Atlases to Slug’s Outline-Based Approach

Texture atlases remain the oldest and most common method. Glyphs are rasterized once at a fixed size into a shared texture, then drawn as textured quads. This is fast and portable, but scaling exposes the underlying problem: magnified text becomes blocky or blurry, shrunk text shimmers, and languages like Chinese, Japanese, and Korean require baking tens of thousands of glyphs at multiple sizes—a significant memory cost.

Signed Distance Fields (SDF), introduced by Valve’s Chris Green in 2007, store the distance from each texel to the nearest edge rather than pixel data. This allows scaling a small SDF texture up dramatically while maintaining clean edges. However, SDFs still lie about corners; sharp points like the apex of an “A” get softened by bilinear interpolation, and thin stems can break up at high magnification.

Multi-Channel SDFs (MSDF), developed by Viktor Chlumsky and described in his 2015 thesis, encode distance across three color channels (red, green, blue), each tracking different edge subsets. The shader takes the median of the three channels to reconstruct sharp corners almost perfectly. MSDF is described as the “current sweet spot” for many teams and is widely adopted via Chlumsky’s MIT-licensed msdfgen tool, though it still requires pre-baked atlases.

Tessellation methods—including Loop-Blinn, NVIDIA’s NV_path_rendering, Pathfinder, and Rive—convert outlines into geometry the GPU rasterizes directly. Rive, open-sourced in 2024, reduces vector paths into triangle patches and uses pixel local storage to achieve 120 fps on animated vector art. These approaches are resolution-independent and suit animated vector graphics, but require per-frame tessellation when geometry changes and can produce geometry bloat for complex glyphs.

Slug, published by Eric Lengyel in 2017 and patented in 2019, abandons both atlases and per-frame tessellation. It stores glyphs as lists of quadratic Bezier curves and line segments in a GPU buffer, builds a lightweight acceleration structure partitioning glyphs into horizontal bands, and resolves coverage directly in the fragment shader. On March 17, 2026, Lengyel dedicated the patent to the public domain, enabling implementations like Slughorn, a C++20 version described on alphapixeldev.com.

Key facts

  • Five main GPU text rendering methods exist: texture atlases, SDF, MSDF, tessellation approaches, and Slug
  • Texture atlases are fast and portable but blur when scaled and require separate baking for each size and language
  • SDF improves scalability but softens sharp corners; MSDF fixes this using three distance channels
  • Tessellation methods like Rive are resolution-independent and suit animated vector art but require per-frame geometry updates
  • Slug renders directly from vector outlines without pre-baked textures or per-frame tessellation, and its patent entered the public domain on March 17, 2026

Sources

← All posts