← Back to Tech Radar
Hacker News tech

SDF vs. MSDF vs. Slug: GPU Text Rendering

Trending on Hacker News: SDF vs. MSDF vs. Slug: GPU Text Rendering (117 points / 47 comments, via alphapixeldev.com)

In one line

The real difference between texture-atlas, SDF, MSDF, and Slug glyph rendering on the GPU: how each works, where each breaks, and when to use which.

Opening excerpt

Text looks simple until you have to draw it yourself. A letter is not a picture, it is a set of outlines: closed loops of straight lines and Bezier curves, filled according to a winding rule. Drawing that on a CPU into a bitmap is a solved problem. Drawing it on a GPU, crisply, at any size, under any 3D transform, while the text changes every frame, is not. Most engines dodge the hard version by baking glyphs into textures ahead of time and living with the compromises.

In 2017 Eric Lengyel published an algorithm, called Slug, that stopped dodging. It renders glyphs directly from their outlines in the fragment shader, with no texture atlas and no per-frame tessellation. Lengyel patented it in 2019, and on March 17, 2026 he dedicated that patent to the public domain. That is why we built Slughorn , our C++20 implementation of the Slug technique, and it is why we can now talk about how it works and where it wins.

This is a tour of how GPU text rendering actually works, from the bitmap atlas up to Slug, and where each method fits.

(Excerpted from the original; full article via the source link below.)

This story hit the Hacker News front page today (117 points / 47 comments, via alphapixeldev.com). Our Tech Radar aggregates daily signals on AI engineering, backend architecture and DevOps — browse the related services and further reading below, or get in touch with our team.

Source: Hacker News

Related Services

Related Reading