Slughorn

Text on a GPU is usually faked. The common trick is a texture atlas of pre-rasterized glyphs, which looks fine until you zoom in, tilt the text in 3D, or wrap it onto a curved surface. Then the edges go soft and blocky, because you are scaling a bitmap. For a cockpit label, a map annotation, or a moving-map readout that has to stay crisp at any range, that is not good enough.

Slughorn is our answer. It is a modern C++20 library, MIT-licensed and open on GitHub, that implements the open-source release of the "Slug" GPU vector-graphics technique by Eric Lengyel. Slug draws glyphs from their actual Bezier outlines on the GPU, so text stays sharp at any zoom and any angle, with no atlas to run out of and no resolution to outgrow.

For how Slug compares to texture atlases, SDF, and MSDF, and where each one still fits, see our explainer, SDF vs MSDF vs Slug: GPU text rendering.

What Slughorn is, and isn't

Slughorn is not a renderer. It does not try to own your scene graph, swap chain, camera, or material system. It is an input and adaptation layer: you hand it vector data (from a backend that produces Bezier curves, or through an HTML canvas-style API written directly in code) and it prepares Slug-compatible data that your own GPU pipeline uploads and draws. It intentionally drops into a pipeline you already have instead of asking you to rebuild around it.

Where it runs

Slughorn makes no assumptions about the graphics API. It works with OpenGL, Vulkan, WebGL, WebGPU, Direct3D, and Metal: Slughorn produces the data, your renderer draws the curves. For OpenSceneGraph we maintain a companion project, osgSlug, that wires Slughorn into an OSG scene, and the same approach extends to VulkanSceneGraph. If you already run one of the engines we work in, sharp vector text is a small integration, not a rewrite.

What it's for

Avionics and instrument displays, moving maps and geospatial annotation, embedded and safety-critical UIs, and any real-time 3D scene where labels and glyphs have to stay legible while the camera moves. It handles vector graphics beyond text as well: MSDF and composite-shape masking, miters and caps, with fuller Porter-Duff compositing on the way.

Get it, or get help with it

Slughorn is free and MIT-licensed. Read the background here, get the code and User Guide at slughorn.io, or pull it from GitHub. If you want it integrated into your engine, extended for your data, or supported under contract, that is the kind of work we do every day.

Frequently asked questions

What is Slughorn?

Slughorn is our modern C++20 library that renders vector graphics and text on the GPU directly from Bezier outlines, using the public-domain Slug technique invented by Eric Lengyel. Text and shapes stay sharp at any zoom and any angle, with no glyph atlas to run out of and no baked resolution to outgrow.

Is Slughorn free, and what is the license?

Yes. Slughorn is free and MIT-licensed, and the source is on GitHub at github.com/AlphaPixel/slughorn. You can use it in commercial and closed-source products under the MIT terms.

Which graphics APIs does Slughorn support?

Slughorn is renderer-agnostic. It produces the vector data and your pipeline draws it, so it works with OpenGL, OpenGL ES and WebGL, Vulkan, WebGPU, Direct3D, and Metal. It does not own your scene graph, swap chain, camera, or material system.

Does Slughorn work with OpenSceneGraph or VulkanSceneGraph?

Yes. We maintain a companion project, osgSlug, that wires Slughorn into an OpenSceneGraph scene, and the same approach extends to VulkanSceneGraph. If you already run one of those engines, adding sharp vector text is a small integration, not a rewrite.

How is Slughorn different from an SDF or MSDF text atlas?

An atlas, SDF, or MSDF bakes glyphs at a fixed resolution, so they soften, round, or blur when you zoom in or tilt the text in 3D. Slughorn computes coverage from the actual outline per pixel, so it stays exact at any scale and any angle. Our explainer, SDF vs MSDF vs Slug, walks through where each method still fits.

Can Slughorn draw more than text?

Yes. A glyph is just a popular shape. Slughorn draws anything you can express as filled and stroked vector geometry, with MSDF and composite-shape masking, miters and caps, and fuller Porter-Duff compositing on the way.

What is Slughorn good for?

Avionics and instrument displays, moving maps and geospatial annotation, embedded and safety-critical UIs, and any real-time 3D scene where labels have to stay legible while the camera moves.

Can you integrate or support Slughorn for us?

Yes. Slughorn is free to use on your own, and if you want it integrated into your engine, extended for your data, or supported under contract, that is work we do every day. Get the code and User Guide at slughorn.io.

Talk to us

Tell us what you’re building and where it’s stuck. We’ll tell you straight whether it’s something we can help with, and how we’d approach it.

Or see how we run consulting and software development engagements.

Scroll to top

connect

Have a difficult problem that needs solving? Talk to us! Fill out the information below and we'll call you as soon as possible.

Diagram of satellite communications around the Earth
Skip to content