Tech news, developer blogs and social updates in one fast feed
SDF vs. MSDF vs. Slug: GPU Text Rendering
How do I choose a text rendering algorithm between SDF, MSDF, Slug, Texture Atlas or Rive? 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[…]
GPU text rendering techniques include bitmap atlas, signed distance field (SDF), and multi-channel signed distance field (MSDF) methods, each with trade-offs for scalability and crispness.
GPU text rendering is a complex task that requires filling interiors, producing antialiased edges, and staying sharp at various scales.
Bitmap atlas method is fast and portable but has issues with scaling and language support.
Signed distance field (SDF) method stores distance to nearest edge and can produce crisp edges but softens corners.
Multi-channel signed distance field (MSDF) method stores three distance channels to preserve sharp corners and is widely adopted.
Summarised automatically by AI from the original article by Hacker News. AI can make mistakes, so check the original for details.
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.
Read the full story on Hacker NewsThat's the opening of the story. The full piece is published by Hacker News.
Yantra is a C++ parser generator: lexer, parser, and AST walker all generated from one tool. It builds the whole AST first, then walks it.Most LALR parser generators (Yacc…
The X Fold 6 looks like foldables did three months ago. It's a quirk of the release calendar that when Vivo's X Fold 6 launched in China this June, it was just another foldable…
About 66 million years ago, the Chicxulub asteroid smashed into Earth, kicking up tsunamis and dropping hot debris that annihilated non-avian dinosaurs and many other species…