Technology news
Technology news How do I select a text rendering algorithm in between SDF, MSDF, Slug, Texture Atlas or Rive?
Text looks easy till you need to draw it yourself. A letter is not an image, it is a set of details: closed loops of straight lines and Bezier curves, filled according to a winding guideline. Drawing that on a CPU into a bitmap is a resolved issue. Drawing it on a GPU, crisply, at any size, under any 3D change, while the text modifications every frame, is not. The majority of engines evade the difficult variation by baking glyphs into textures ahead of time and living with the compromises.
In 2017 Eric Lengyel released an algorithm, called Slug, that stopped evading. It renders glyphs straight from their details in the piece shader, without any texture atlas and no per-frame tessellation. Lengyel patented it in 2019, and on March 17, 2026 he devoted that patent to the general public domain. That is why we constructed Slughorn, our C++ 20 application of the Slug method, and it is why we can now discuss how it works and where it wins.
This is a trip of how GPU text rendering in fact works, from the bitmap atlas approximately Slug, and where each technique fits.
Technology news What makes glyphs difficult
Every scalable typeface shops each glyph as vector details. TrueType utilizes quadratic Bezier curves, OpenType with CFF utilizes cubic curves, and both mix in straight sectors. The interior of the letter is whatever the fill guideline states is within, normally the nonzero winding guideline: shoot a ray from the pixel, count how the overview crosses it, and if the winding number is nonzero the pixel is inside the glyph.
A glyph is a set of describes, not pixels: filled dots are on-curve points, open circles are Bezier control points.
The renderer needs to do 3 things simultaneously and do them quick: fill the interior properly, produce tidy antialiased edges, and remain sharp whether the glyph is 8 pixels high in a menu or filling the screen on a signboard turned in point of view. On a CPU you rasterize each glyph as soon as at its target size and you are done. On a GPU you wish to draw countless glyphs per frame, at approximate scales, preferably without re-rasterizing anything. That restraint is where every method listed below makes its trade.
Technology news Technique 1: the texture atlas( bitmap glyphs)
The earliest and still most typical method. Rasterize each glyph when, at one size, into a shared texture called an atlas, then draw each on-screen character as a textured quad that samples its slot.
It is quickly, trivially portable, and works on anything with a texture system. That is why it is all over.
The issues appear the minute you scale. Expand past the baked size and the glyph becomes blurred or blocky pixels, due to the fact that you are amplifying a bitmap. Diminish it and you get shimmer and dropped stems unless you bake mip levels. Every size you desire crisp is another atlas. Every language is another issue: a Latin atlas is little, however Chinese, Japanese, and Korean have 10s of countless glyphs, and baking all of them at numerous sizes is a memory catastrophe. And a bitmap has no concept it is being seen in point of view, so text laid onto a 3D surface area looks soft.
Amplifying a baked atlas glyph( left and center) versus rendering it from the summary( right ).
Technology news Approach 2: signed range fields (SDF)
Valve presented the repair that brought the market for a years. Chris Green’s 2007 SIGGRAPH work, “Improved Alpha-Tested Magnification for Vector Textures and Special Effects,” shops not the glyph’s pixels however a signed range field: each texel holds the range to the closest edge, favorable within, unfavorable exterior. In the shader you sample that field and limit at absolutely no. Since range inserts efficiently, you can scale a little SDF texture up drastically and still get a tidy edge, and you get low-cost antialiasing by softening the limit.
One little texture, resolution independent within factor, one inexpensive shader. For a long period of time this was the default for crisp UI text and video game HUDs, and it still is on constrained hardware.
An SDF is still a baked texture tested at a set resolution, and it lies about corners. A sharp corner is a discontinuity in the range field, and bilinear interpolation rounds it off. Every tough corner on a letter, the point of an “A”the notch of a “K”gets softened. Press the zoom far enough, or make the glyph little enough that the field is just a couple of texels broad, and thin stems separate and information smears.
A signed range field( left) and the crisp edge a shader recuperates from it( right ).
Technology news Approach 3: multi-channel signed range fields (MSDF )
Viktor Chlumsky’s work, from his 2015 thesis and the 2018 paper “Improved Corners with Multi-Channel Signed Distance Fields,” repairs the corner issue. Rather of one range channel, MSDF shops 3, in red, green, and blue, each encoding range to a various subset of edges picked so that sharp corners make it through. In the shader you take the mean of the 3 channels. The mean technique rebuilds corners nearly completely, so an MSDF glyph remains crisp at zooms that would round an SDF to mush.
MSDF is the present sweet area for a great deal of groups, and Chlumsky’s msdfgen is MIT certified and commonly embraced. If you require crisp scalable text and you want to bake an atlas, it is an exceptional option.
It is still an atlas, however, with the expenses that suggests. You bake each glyph at a picked resolution ahead of time, so vibrant or user-supplied text, and huge glyph sets like CJK, still suggest baking pipelines and memory spending plans. Generation is more costly than plain SDF. At really little sizes you are still tasting too couple of texels to hold great information, and at severe minification you still battle aliasing. The three-channel lookup expenses more bandwidth than one. MSDF raises the ceiling on quality, however it still utilizes an atlas.
SDF rounds sharp corners; MSDF protects them. Images: Viktor Chlumsky/ msdfgen( MIT).
Technology news Technique 4: tessellation and protection (Loop-Blinn, NV_path_rendering, Pathfinder, Rive)
A various household avoids textures completely and turns the overview into geometry the GPU can rasterize.
- Loop-Blinn feeds curved triangles to the GPU and utilizes a per-pixel dispose of shader to keep just the within each quadratic Bezier, integrated with the stencil buffer to solve winding. Sophisticated, however reputable antialiasing is really hard without techniques that cost quality.
- Stencil-then-cover, exposed as NVIDIA’s NV_path_rendering extension, draws the course into the stencil buffer in one pass, then covers it in a 2nd. It is high quality however leans on supplier extensions and particular hardware courses.
- Pathfinder tessellates edges into microtriangles, calculates signed trapezoidal locations per pixel, and builds up protection in a calculate pass. Tile-based and quick on modern-day GPUs.
- Rive’s renderer, open-sourced in 2024, lowers antialiased vector courses into distinct triangle spots and rasterizes them through an enormously parallel pipeline with pixel regional storage, striking 120 fps on animated vector art.
This household is truly resolution-independent and, for animated developed vector graphics, typically the ideal response. Rive in specific is developed for art work that moves. The expenses are the tessellation itself, which needs to be redone when geometry modifications, the geometry blowup for intricate glyphs, the problem of tidy analytic antialiasing, and sometimes a reliance on particular hardware functions or extensions.
Tessellation techniques turn the overview into triangles the GPU rasterizes.
Technology news Approach 5: Slug, rendering directly from the summary
Slug avoids the atlas and per-frame tessellation and keeps the glyph as a list of quadratic Bezier curves and line sectors saved in a little GPU buffer. Together with it, Slug constructs a light-weight per-glyph velocity structure that separates the glyph into horizontal bands, so an offered pixel just needs to think about the handful of curves near it instead of the entire summary.
It deals with protection straight in the piece shader. For each pixel it successfully casts a ray, discovers where that ray crosses the close-by Bézier curves, and counts those crossings to calculate the winding number and for that reason protection. The tough part, and Lengyel’s secret sauce, is a test he calls root eligibility: an exact guideline for which curve-ray crossways must count, so the winding mathematics is specific at the shared endpoints where curves satisfy and where ignorant methods produce fractures or double-counts. Due to the fact that the shader is fixing the curve formulas analytically instead of tasting a baked field, it produces precise protection and tidy antialiasing at any scale.
Slug’s core concept: for each pixel, cast a ray and count the number of times it crosses the overview.
There is no baked resolution, so the very same glyph is razor sharp at 6 pixels or 6000, and it remains sharp under approximate 2D and 3D changes, consisting of point of view, due to the fact that protection is calculated per pixel after the change. There is no atlas, so a hundred thousand CJK glyphs cost a typeface’s worth of overview information, not an atlas the size of a video. Text can alter every frame at no baking expense, which is precisely what you desire for live information, user input, and localized material. And everything takes place in a single draw with a regular piece shader, no supplier extension needed.
This is important when you can not forecast how the text will be seen. Atlas, SDF, and MSDF all bake a set resolution ahead of time, which silently presumes a bounded variety of on-screen sizes and seeing angles. When the relationship in between the text airplane and the video camera is not understood beforehand, a totally free 3D electronic camera, an approximate zoom, a close-up, or a high off-axis grazing angle, those baked approximations break down: amplify past the baked resolution and the atlas blurs while SDF and MSDF round and smear, and at oblique angles the tested field aliases. You can not pre-allocate adequate resolution for each possible view without the storage taking off. Slug calculates protection analytically, per pixel, after the change, so it remains specific no matter how close, how far, or how oblique the audience gets, with absolutely nothing baked and no ceiling to strike. Tessellation is the just other household that shares this, and it spends for it in tessellation expense and more difficult antialiasing. That is why Slughorn is the one to grab in interactive 3D, AR and VR, flythroughs, moving HUDs, and CAD or digital-twin navigation, where you do not get to choose ahead of time how close or how oblique the audience will be.
Technology news Seeing the distinction
We rendered the very same capital R with Slughorn (our osgSlug combination) beside the options you would in fact grab: a single-channel SDF, an MSDF, Rive’s renderer, and osgText’s bitmap together with its bitmap-derived SDF. Every texture-based panel got the very same budget plan, 64 texels per em, so what separates them is method, not resolution.
Straight on at their baked size, 5 of the 6 are almost similar: Slughorn, Rive, and MSDF replicate the overview, and the single-channel SDFs vary just by somewhat rounded corners at the foot of the leg. The outlier is the osgText bitmap, a 64 px/em image amplified about 4 times, which can not recuperate information it never ever kept.
Tilt the glyph into point of view and the image modifications.
In grazing viewpoint, Slughorn and the 3 distance-field panels keep the R in location with tidy edges, since they calculate protection per pixel inside the glyph’s own aircraft, so the forecast costs them absolutely nothing. The osgText bitmap blurs as it declines. Rive’s R is the incorrect shape: its renderer just accepts 2D affine changes, and a point of view forecast is not affine, so the very best it can do is an approximation that is precise at the center and wanders towards the edges.
Now focus on a single edge.
At severe zoom, just the curve-based renderers, Slughorn and Rive, still produce a directly, tidy edge, due to the fact that both work from the real summary at whatever size it is revealed( Rive by re-tessellating every frame for this view). The distance-field panels notch, where inserting in between saved samples no longer matches the real curve. The osgText bitmap has actually liquified into a single grey gradient, since each of its texels now covers a big part of the panel.
A note on fairness, since the technical reader will ask. Every texture-based approach here utilized the very same 64 texels per em, and providing more presses these artifacts back without eliminating them. The SDF and MSDF panels utilize default bake settings, and MSDF’s error-correction choices would soften a few of the notches in the last image. Rive is revealed at its finest for these views, rendered through the cam every frame, which is more generous than how it is generally embedded in a 3D scene, where it would be drawn into a texture and mapped onto the surface area, preventing the distortion however blurring the method the bitmap does.
Technology news Head to head
Pale green marks where Slug is the very best or a tied-best option.
Technology news Which one must you utilize
There is no single winner, there is an ideal tool per task.
- Grab Slug(horn) when you require text that is crisp at every scale and under 3D and viewpoint (VR/AR/xR), when you have substantial or vibrant glyph sets, when the text modifications continuously, or when you are rendering blended vector UI into a real-time pipeline. This is GIS glass cockpits, visual simulation labels, area domain screens, AR overlays, and any user interface that needs to remain clear while it moves. This is why we developed Slughorn.
- Grab MSDF when you desire crisp scalable text, you can bake an atlas in advance, and you more than happy on a broad series of hardware. It is a terrific default for easier video game HUDs and app UI.
- Grab plain SDF when the hardware is constrained, the text is relatively fixed, and you can cope with softened corners.
- Grab a bitmap atlas when the text is a set size on a repaired UI and you desire the most basic, most portable thing that works.
- Grab Rive or a tessellation renderer when the task is developed vector art work that stimulates, not mainly text.
Technology news Wait, there’s more
We keep stating text due to the fact that text is where Slug made its name, however Slughorn draws anything you can reveal as filled and rubbed vector geometry, from any of its backends. That implies complete SVG with gradients, layered shaders, and animation within layers, and it holds up at map-cartography scale, drawing labels and linework at clearness and resolution the pre-baked techniques can not reach. There is a lot more we will be showing quickly. For the functions we have actually not called out here, see the Slughorn repository on GitHub
Technology news Proclaiming Slughorn’s horn
Slughorn is our application of the Slug method in contemporary C++ 20. It does the heavy work when, at develop time, so there is no runtime tessellation: the summary information and band structure are prepared ahead of time and the shader simply assesses protection. And while text is where Slug made its name, Slughorn does not deal with glyphs specifically: a glyph is simply a popular shape. Anything you can refer to as vector courses renders through the very same pipeline, with the exact same quality. It consumes the formats you currently utilize, consisting of SVG, FreeType typefaces, and courses from Blend2D, Cairo, and Skia, and it exposes a native Canvas-style API for authoring shapes straight, with fills, strokes, and gradients composited into a single GPU-ready atlas of overview information. It targets OpenGL, Vulkan, WebGPU, and DirectX, and ships with Python bindings together with the C++ API, so the very same making works from an ingrained HUD to a complete 3D scene.
Credit where it is due: the Slug algorithm is Eric Lengyel’s, released in the Journal of Computer Graphics Techniques and, considering that March 2026, totally free for anybody to execute. We believe it is the ideal structure for appropriate, resolution-independent text on the GPU, and Slughorn is our handle making it simple to utilize.
If you are combating blurred labels in a 3D scene, an atlas that will not fit your glyph set, or text that needs to remain crisp while it moves, that is precisely the type of issue we fix. Contact us to speak about Slughorn or to put it to operate in your pipeline.
Technology news Referrals
- Eric Lengyel, “GPU-Centered Font Rendering Directly from Glyph Outlines,” Journal of Computer Graphics Techniques, vol. 6, no. 2, 2017.
- Eric Lengyel, “A Decade of Slug” (Slug patent committed to the general public domain, March 2026), terathon.com.
- Chris Green, “Improved Alpha-Tested Magnification for Vector Textures and Special Effects,” Valve, SIGGRAPH 2007.
- Viktor Chlumsky, “Shape Decomposition for Multi-Channel Distance Fields” (thesis, 2015) and “Improved Corners with Multi-Channel Signed Distance Fields,” Computer System Graphics Forum, 2018. msdfgen is MIT accredited.
- Rive, “Rive Renderer, now open source and available on all platforms,” 2024.
- servo/pathfinder job and its “Related approaches” paperwork.
Technology news Often asked concerns
What is the distinction in between texture-atlas, SDF, MSDF, and Slug text rendering?
A texture atlas shops each glyph as a baked bitmap, so it blurs as soon as you scale past its baked size. SDF (signed range field) shops distance-to-edge rather, which scales much better however rounds sharp corners. MSDF includes channels so corners remain crisp, however it is still a baked atlas at a picked resolution. Slug avoids the atlas and calculates protection from the glyph’s real Bezier overview in the shader, so it remains precise at any size or angle.
Why does text go fuzzy when I scale or tilt it in 3D?
Since a lot of engines draw text from a pre-baked bitmap atlas. Amplify past the baked resolution, tilt it in point of view, or cover it onto a surface area, and you are extending a repaired grid of pixels, so the edges soften. Outline-based techniques like Slug prevent this since protection is calculated per pixel after the change.
What is the Slug algorithm?
Slug is a strategy released by Eric Lengyel in 2017 that renders glyphs straight from their quadratic Bezier lays out on the GPU, without any texture atlas and no per-frame tessellation. A piece shader casts a ray per pixel and counts curve crossings to get specific protection, utilizing Lengyel’s “root eligibility” test for accuracy where curves satisfy.
Is the Slug method totally free to utilize now?
Yes. Lengyel devoted the Slug patent to the general public domain in March 2026, so anybody can execute the strategy. AlphaPixel’s Slughorn is a C++ 20, MIT-licensed application of it.
When should I utilize MSDF rather of Slug?
When you can bake an atlas in advance, your text is relatively fixed, and you desire one low-cost shader that works on a wide variety of hardware. MSDF is a strong default for video game HUDs and app UI. Slug wins when text should remain crisp at any scale and angle, when glyph sets are big or vibrant, or when the video camera relationship is unbounded.
Does Slug manage big glyph sets like Chinese, Japanese, and Korean?
Yes, and without the atlas-memory surge. Since Slug shops describe information rather of baked bitmaps, 10s of countless CJK glyphs cost a typeface’s worth of curve information instead of a huge multi-size texture. In Slughorn the per-glyph band structure includes moderate overhead, still well listed below a CJK atlas.
How is Slughorn connected to Slug?
Slug is the algorithm (Lengyel’s); Slughorn is AlphaPixel’s library that executes it. Slughorn feeds any GPU API (OpenGL, Vulkan, WebGPU, Direct3D) and draws any filled and rubbed vector geometry, not simply text.
Discover more from PMN S.P.O.R.T.S - A PRIME MEDIA NETWORK BRAND
Subscribe to get the latest posts sent to your email.

