Rendering Text in Metal with Signed-Distance Fields

Warren Moore covers how to use the GPU to add text into a Metal app.

Prior to this post I wasn’t familiar with signed-distance fields, here’s a primer:

“…a precomputed representation of a font atlas that stores the glyph outlines implicitly. Specifically, the texel values of a signed-distance field texture correspond to the distance of the texel to the nearest glyph edge, where texels outside the glyph take on negative values.”