Eric Lengyel published a retrospective on the Slug GPU font rendering library this month, marking ten years of a library that computes glyph coverage exactly rather than approximating it. Ten years is long enough to draw some conclusions about a technology’s trajectory, and Slug’s position in the ecosystem is instructive: technically superior to the dominant approach by most meaningful measures, commercially licensed in a world that expects font tooling to be free, and now facing a new open-source competitor that has started converging on the same mathematical foundation from a different angle.
What Exact Coverage Actually Means
The majority of GPU font rendering in production today uses signed distance fields, a technique Chris Green published at SIGGRAPH in 2007 while at Valve. The core idea is to precompute a texture where each texel stores the signed distance to the nearest glyph edge, then reconstruct the glyph boundary in the fragment shader by thresholding that distance. The shader is trivially cheap: one texture fetch and a comparison. For 2007 hardware, and for the use case of game UI text at a known size range, it was a reasonable trade.
The structural limitation is that a distance field stores one scalar per texel: distance to the nearest edge. It does not store shape. Two different glyph outlines can produce identical distance fields in a region. Sharp corners, which are angular discontinuities in the outline, soften because the distance function cannot distinguish between the interior of a sharp angle and the interior of a rounded one at the same distance from the boundary. Fine strokes thin or disappear at sizes far from the bake resolution. At large magnification, the approximation fails visibly.
Viktor Chlumský’s MSDF approach improved on this by encoding directional distance information across RGB channels and using a median-of-three reconstruction in the fragment shader. Corners are preserved much better. MSDF is the practical improvement that most modern engines and frameworks have migrated to, and its tooling is permissively licensed and widely integrated. But it remains an approximation. The RGB channels encode edge directions, not coverage. At extreme scales or with very fine strokes, the approximation degrades.
Slug’s approach, formalized in a 2017 JCGT paper, does not approximate. For each fragment, the shader loads the raw Bezier control points for the current glyph from a GPU-accessible structured buffer, identifies which curve segments have y-intervals overlapping the fragment row via a spatial band acceleration structure, then integrates the winding number contribution of each segment over the fragment area using Green’s theorem. The result is an exact fractional coverage value in [0, 1].
For a quadratic Bezier segment P(t) = (1-t)² P₀ + 2t(1-t) P₁ + t² P₂, finding the y-crossing at a sample coordinate reduces to solving a quadratic:
float a = P0.y - 2.0 * P1.y + P2.y;
float b = 2.0 * (P1.y - P0.y);
float c = P0.y - sample_y;
float disc = b * b - 4.0 * a * c;
if (disc >= 0.0) {
float t1 = (-b - sqrt(disc)) / (2.0 * a);
float t2 = (-b + sqrt(disc)) / (2.0 * a);
// For each t in [0,1], evaluate x position and
// accumulate signed winding from the derivative direction
}
The winding accumulation integrated over the fragment area gives coverage, not just an inside/outside determination. Loop and Blinn’s 2005 resolution-independent curve rendering also used exact Bezier evaluation but only produced a binary result; the KLM implicit test gives shape correctness without coverage, which means MSAA is required for anti-aliasing. Slug closes that gap by computing area rather than just testing point membership.
Why 2015
The fragment shader loop over variable-length curve data requires GPU-accessible buffers with arbitrary per-fragment random access. Direct3D 11 structured buffers arrived in 2009. OpenGL Shader Storage Buffer Objects landed in GLSL 4.3 in 2012. Before that, fitting glyph outline data into textures and accessing it efficiently from fragment shaders was cumbersome enough to make per-fragment curve evaluation impractical outside specialized hardware. The combination of SSBOs, improved fragment throughput, and a broadly stable OpenGL 4.x baseline converged around 2012 to 2014. Slug launched when the hardware had crossed the viability threshold.
The parallel to real-time raytracing is fair. Exact computation was theoretically available on any programmable GPU; hardware throughput is what made it a sensible choice for production use.
The Sub-Pixel Advantage
The most visible differentiator at the sizes where text rendering matters most is sub-pixel anti-aliasing. LCD displays have horizontally offset R, G, B sub-pixels. Correct sub-pixel rendering requires three independent coverage values per pixel, each computed over a rectangle one-third the pixel width. Slug runs the same area integral three times at offset x positions:
float cov_r = integrateGlyphArea(x - subpixel_w, y, subpixel_w, pixel_h);
float cov_g = integrateGlyphArea(x, y, subpixel_w, pixel_h);
float cov_b = integrateGlyphArea(x + subpixel_w, y, subpixel_w, pixel_h);
A single-channel SDF cannot do this. The RGB channels in an MSDF texture encode edge directions, not sub-pixel positions; repurposing them for sub-pixel coverage would require storing the distance field information elsewhere. At 8 to 12 point text on a 96 DPI monitor, the difference between correct sub-pixel coverage and approximated coverage is legible. High-DPI displays reduce the perceptual benefit below the threshold, which is why macOS removed system-level sub-pixel antialiasing for Retina displays. Standard desktop monitors, VR headsets, and 3D world-space text rendered at oblique angles remain practical targets where the advantage holds.
Variable Fonts Are Structurally Free
OpenType 1.8 introduced variable fonts in 2016: a single file encoding a continuous design space across weight, width, and optical size as interpolated Bezier control points. For SDF and MSDF, each position in the design space may require a separately baked atlas or live regeneration. A continuous design space is practically intractable with precomputed textures. For Slug, variable fonts require only linear interpolation of control points before GPU upload. Interpolated Bezier curves are still Bezier curves; the shader evaluates them identically. Variable font support is architecturally free, not a special case.
The Adoption Gap
Slug has been commercially available for ten years and is technically correct by the standards that matter for text rendering. SDF and MSDF remain the default choice in most game engines, UI frameworks, and rendering libraries. The reasons are not mysterious.
MSDFgen and the msdf-atlas-gen toolchain are free and permissively licensed. Godot uses MSDF. The Unity and Unreal ecosystems have multiple SDF-based font rendering plugins. The marginal quality improvement from exact coverage is imperceptible for many use cases: game UI text at fixed sizes on high-DPI displays, where SDF is baked at sufficient resolution and the pixel density masks approximation errors. Slug’s license is a real cost for teams evaluating font rendering options, particularly small studios and open-source projects.
This is the pattern where a technically superior solution captures a narrower deployment than its quality would predict. The conditions for that pattern are all present: free alternatives that are good enough for the dominant use case, a meaningful licensing cost, and a quality differential that only shows at edge cases and display conditions that not every product encounters.
The Vello Horizon
The emerging open-source alternative that reaches Slug’s level of correctness is Vello, the Linebender project’s compute-shader 2D renderer. Rather than per-fragment curve evaluation in the fragment stage, Vello uses a tiling approach: divide the screen into tiles, assign curve segments to tiles in a compute geometry pass, then accumulate exact area coverage per tile in additional compute passes. For 2D document and UI rendering where the entire scene can be batched, this amortizes work efficiently across fully covered tiles. Mozilla’s Pathfinder explored similar territory and is now archived; Vello is the active continuation of that work.
Vello sits less naturally inside existing 3D game frame graphs, where Slug’s fragment shader approach integrates as a simple quad draw into an existing rendering pipeline. The architectural fit matters as much as the algorithm. Vello is Rust-native, open-source, and improving steadily; it represents the path by which exact GPU font rendering may eventually reach broader deployment without the commercial licensing constraint.
What a Decade of Maintenance Means
Slug today supports Vulkan, Metal, Direct3D 12, and OpenGL 4, across Windows, macOS, Linux, iOS, and Android, with distinct shader implementations in GLSL, HLSL, and MSL. The core algorithm is stable; it required no changes across any API generation. The implementation had to be ported repeatedly as the GPU API landscape fragmented. SPIR-V and the spirv-cross toolchain add surface area. Supporting four actively maintained graphics APIs and three shader languages in a commercial library with a small team is a sustained engineering effort that does not show up in benchmarks.
The library Lengyel shipped in 2015 was correct then. The library he ships in 2026 is correct in more places, on more hardware, through API generations the original implementation could not have targeted. That consistency across a turbulent decade of GPU API evolution is the underappreciated part of the retrospective. The algorithm was always right; keeping it working as the platform moved underneath it is the real engineering story.