top of page
MSDF atlas generation and
text rendering
Year:
2026
As part of The Game Assembly's Tool Development course I worked on integrating text rendering capabilities into my group's custom game engine in the form of MSDF.
To the right is the HLSL shader that my group's custom game engine uses to render font glyphs using MSDF. It is based on Victor Chlumský's shader example that he's provided on his GitHub, but I've translated it from GLSL to HLSL and modified it to work using our game engine's shader conventions.
If you have a keen eye you might notice that we're technically using MTSDF (Multi-channel Transparent Signed Distance Field) atlases rather than pure MSDF atlases in our engine. This works exactly like MSDF atlases really, but we also provide our shader with a normal SDF in the atlases alpha channel. This enables us to create "soft" effects on our texts, like an inner- or outer glow.
This is, however, currently still a work in progress and will be updated at a later date when I've set it up properly.
Type:
Game Engine Tool/Feature
Pictured to the left is an MSDF Atlas generated in the Spare Parts engine using Viktor Chlumský's msdf-atlas-gen library. MSDF stands for Multi-signed Distance Field and is a technique used for rendering font glyphs. Originally developed by Valve in their paper about SDF, and later expanded upon by Chlumský by introducing multiple distance field to create sharper and better looking text.
The biggest advantage to using text rendered via MDSF rather than other types of text rendering is its capability to render sharp font glyphs, even in a 3D space, only using a MSDF font atlas and a specific shader to interpet the distance fields.
bottom of page