Signed distance functions are applied, for example, in
real-time rendering, for instance the method of
SDF ray marching, and
computer vision. SDF has been used to describe object geometry in
real-time rendering, usually in a raymarching context, starting in the mid 2000s. By 2007,
Valve was using SDFs to render large pixel-size (or
high DPI)
smooth fonts with
GPU acceleration in its games. Valve's method is not perfect as it runs in
raster space in order to avoid the computational complexity of solving the problem in the (continuous) vector space. The rendered text often loses sharp corners. In 2014, an improved method was presented by
Behdad Esfahbod. Behdad's GLyphy approximates the font's
Bézier curves with arc splines, accelerated by grid-based
discretization techniques (which culls too-far-away points) to run in real time. A modified version of SDF was introduced as a
loss function to minimise the error in interpenetration of pixels while rendering multiple objects. In particular, for any pixel that does not belong to an object, if it lies outside the object in rendition, no penalty is imposed; if it does, a positive value proportional to its distance inside the object is imposed. :f(x) = \begin{cases} 0 & \text{if }\, x \in \Omega^c\\ d(x, \partial\Omega) & \text{if }\, x \in \Omega \end{cases} In 2020, the
FOSS game engine
Godot 4.0 received SDF-based real-time
global illumination (SDFGI), that became a compromise between more realistic voxel-based GI and baked GI. Its core advantage is that it can be applied to infinite space, which allows developers to use it for open-world games. In 2023, the authors of the
Zed text editor announced a GPUI framework that draws all UI elements using the GPU at 120 fps. The work makes use of Inigo Quilez's list of geometric primitives in SDF,
Figma co-founder Evan Wallace's
Gaussian blur in SDF, and a new rounded rectangle SDF. ==See also==