ABSTRACT

Distance fields have many applications in image processing, real-time rendering, and path-finding algorithms. Loosely speaking, a distance field is a grayscale bitmap in which each pixel’s intensity represents the distance to the nearest contour line in a source image. This chapter focuses on the two-dimensional (2D) distance field case. It explores the generation of distance fields rather than their application and deals with a brief overview of some rendering techniques that leverage distance fields, including one that enables cheap, high-quality antialiasing. The chapter presents a new technique that generates distance according to a squared Euclidean metric. Some fascinating and efficient methods for 2D distance field generation on the Graphics Processing Units have been proposed but many of these methods are complex, requiring cunning tricks such as embedding doubly-linked lists within a texture. Leveraging alpha testing in conjunction with distance fields enables high-quality magnification of vector art.