Practical analytic 2D signed distance field generation
Wasim Abbas, Chris Doran, Rich Evans, Roberto Lopez Mendez · 2016
In this talk, we present a novel technique to generate Signed Distance Fields (SDF) from vector paths. Unlike existing methods, instead of first rasterizing a path to a bitmap and then deriving the SDF, we can calculate the minimum distance for each pixel to the nearest segment directly from a path description comprised of line segments and Bezier curves. Our analytical method differs from previous works by computing distance in a canonical quadratic space. We have tested our code in Skia to accelerate SDF text rendering and we have found that our method is higher quality and more than 70% faster. Higher quality SDFs are achieved by sampling vector data at the SDF resolution required without losing quality to prior rasterization steps.