Ten years is long for a commercial SDK serving a niche that most rendering engineers work around with approximations. Eric Lengyel’s Slug library reached that milestone this year, and the retrospective is worth reading not just as a product history but as a case study in picking a technically correct approach and waiting for the hardware to catch up.
Slug renders TrueType and OpenType glyphs directly on the GPU without any precomputed approximation. No texture atlas, no distance field, no offline baking step. The fragment shader receives the actual Bézier control points for the glyph, evaluates curve-ray intersections analytically, and computes exact fractional area coverage per pixel. That description sounds obvious until you compare it to what virtually everything else does.
The SDF Compromise and Its Limits
Chris Green’s 2007 SIGGRAPH paper on signed distance fields gave the games industry a workable GPU font rendering story that held up for years. The idea is straightforward: precompute a texture where each texel stores the signed distance to the nearest glyph edge, then threshold at zero at runtime. It scales reasonably, it’s cheap per-fragment, and for body text at predictable sizes it looks fine.
The failure modes are well-documented but worth being precise about. Corners in glyphs are inherently represented by a distance function that smooths over the angular discontinuity. When the signed distance field is sampled at a scale or offset that wasn’t anticipated during baking, corners go soft. At very large display sizes the approximation error becomes visible even to non-typographers. Fine strokes thin out incorrectly. The threshold that works at 24px may produce halos or fill collapse at 96px.
Multi-channel SDF (MSDF), developed by Viktor Chlumský and described in his 2015 thesis, distributes directional information across RGB channels to recover corner sharpness. It’s a genuine improvement and widely used in tools like libGDX and Godot. But it remains an approximation, and it still requires offline preprocessing to generate the MSDF texture, which means font loading pipelines need a separate baking stage and the data must be regenerated if the glyph set or resolution changes.
What Slug Does Instead
Slug’s fragment shader evaluates coverage analytically from first principles. For TrueType glyphs, the outlines are quadratic Bézier curves. Given a fragment position, the shader casts a conceptual horizontal ray and counts signed crossings with each curve, using the nonzero winding rule to determine inside/outside. The intersection test for a quadratic Bézier is a standard quadratic solve:
// For curve points P0, P1, P2 and ray at y = sample_y
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;
// Real roots give t values; evaluate x component, check winding direction
OpenType CFF outlines use cubic Bézier curves, which require a cubic solve. The winding number accumulation across all contributing curves gives a coverage value between 0.0 and 1.0 that represents the exact fractional area of the fragment interior covered by the glyph. No approximation, no texture lookup, no precomputed data.
The cost is obviously higher than sampling a texture. Lengyel’s 2017 JCGT paper formalizes the algorithm and addresses the performance question directly: per-fragment cost is proportional to the number of curves whose y-intervals overlap the current fragment row, not the total curve count for the glyph. A spatial acceleration structure culls the rest. In practice, for typical Latin glyphs at typical screen sizes, the number of contributing curves per fragment is small, and the arithmetic is straightforward enough that modern GPU fragment throughput handles it without making text rendering a bottleneck.
The Hardware Timing Problem
The reason Slug launched in 2015 and not earlier comes down to GPU memory architecture. Evaluating glyph outlines per-fragment requires the shader to access variable-length data, specifically the Bézier control points for whatever glyph is being drawn. Before OpenGL 4.3’s Shader Storage Buffer Objects arrived in 2012 (and Direct3D 11’s structured buffers before that), getting arbitrary per-object data into a fragment shader cleanly was awkward. Texture-encoded data worked but required careful packing, and the access patterns for variable-length curve data per glyph mapped poorly to the texture model.
SSBOs changed the calculus. With structured GPU-accessible buffers, the shader can index into a glyph’s curve data directly. The fragment throughput improvements in hardware from 2010 to 2015 were substantial enough that the per-fragment curve evaluation became feasible at interactive frame rates. Slug’s launch timing was not arbitrary; it was the point at which the hardware supported the approach without unacceptable performance compromise.
Where This Matters in Practice
For a 2D application rendering body text at one or two predictable sizes, the SDF/MSDF approach is entirely adequate and cheaper. Slug’s value proposition concentrates in specific scenarios:
3D billboards and in-world text. When text appears in a 3D scene on a surface at arbitrary angles and distances, precomputed distance fields must be generated at some resolution and they degrade at unexpected view distances. Slug renders correctly from any distance or angle because it’s computing coverage from geometry, not resampling a texture.
Zoomable document and map viewers. Applications that support continuous zoom through a wide range need correct rendering at every scale. Slug’s coverage computation is scale-independent by construction.
Variable fonts. OpenType 1.8 variable fonts encode a continuous design space, allowing a single font file to represent, say, any weight between Thin and Black via interpolation of Bézier control points. For SDF-based rendering, variable font support requires either baking an SDF per named instance or accepting that arbitrary intermediate positions won’t have corresponding precomputed data. For Slug, interpolating control points and evaluating coverage analytically is structurally identical to rendering static fonts. Variable font support composes for free.
High-DPI displays at large sizes. Display resolution has increased enough that rendering errors visible at 2x pixel density are hard to ignore in typographic contexts.
The Competitive Landscape in 2026
Slug isn’t the only analytical GPU rendering project. Vello, from the Linebender project and originally developed by Raph Levien, takes a compute-shader tiling architecture to GPU-accelerated 2D vector rendering, including text. Vello’s approach differs architecturally: rather than evaluating coverage per-fragment in a conventional fragment shader, it decomposes the scene into tiles and uses compute shaders to accumulate coverage across each tile. The tiling model maps well to GPU compute unit topology and can handle complex overlapping vector content efficiently.
Vello is open source, under active development, and aimed at a broader 2D rendering use case that includes paths, gradients, and images alongside text. Slug is a commercial SDK focused specifically on font rendering. The two aren’t direct competitors so much as differently scoped solutions using related analytical rendering ideas.
Pathfinder, the Mozilla project that explored similar territory, is effectively archived. It produced useful research and demonstrated the viability of GPU path rendering but didn’t sustain development.
Ten Years of Platform Maintenance
What Lengyel’s retrospective emphasizes, and what deserves more attention than the rendering algorithm itself, is the maintenance burden of a graphics SDK across a decade. In that time, three major GPU API generations cycled through relevance: OpenGL 4, DirectX 11, Vulkan/Metal/DX12. The OpenType specification grew to include variable fonts, color fonts with layered COLR tables, and the COLRv1 extension with gradient support. Mobile platforms introduced their own capability constraints and API variations.
Maintaining correct, performant Slug implementations across Vulkan, Metal, DirectX 12, and OpenGL 4 while tracking OpenType evolution is a sustained engineering effort. The commercial license model creates the financial incentive to maintain compatibility without breaking changes for existing customers. Open source equivalents don’t automatically solve this problem; they distribute the maintenance burden but don’t eliminate it, and they depend on a community sustaining that work.
The decade retrospective is ultimately an argument that exact computation, when the hardware can support it, produces a result that doesn’t require revisiting as rendering contexts change. A library that bakes in an approximation will need to be updated or replaced when the approximation’s assumptions stop holding. Slug’s analytical approach has remained correct across every hardware and API transition because the mathematics of Bézier curve intersection doesn’t change with the GPU generation.