A baked signed distance field is a pre-computed grid of distance samples that approximates a shape whose distance function cannot be expressed as a compact formula. Instead of evaluating an analytical expression at every query point, you sample the true distance once at each grid cell, store the samples, and reconstruct an approximate distance at runtime through interpolation. The grid becomes the representation of the field.
This is the standard approach whenever the source geometry is not a mathematical primitive: font glyphs, destructible terrain, scanned 3D models, and artist-authored polygon meshes. For shapes that do have analytical SDFs, see the full signed distance fields tutorial.
How Baking Works
The core idea is straightforward. Place a regular grid over the source geometry. At each grid point, compute the true signed distance to the nearest surface. Record those values. When you later need the distance at an arbitrary position, read the surrounding grid samples and interpolate between them.
The visualization walks through this process step by step. A polygon shape sits underneath a sampling grid. Each grid point stores the signed distance to the nearest polygon edge, colored red inside, blue outside, and white on the boundary. Press play to watch the per-cell evaluation in scanline order. A dashed line extends from the current grid point to its closest edge, so you can see exactly how each distance is computed.
The color-filled overlay shows bilinear interpolation reconstructing the field from those discrete samples. Notice the dashed polygon outline superimposed on the overlay: it reveals where the interpolation deviates from the true edges. At low resolutions the reconstructed zero-contour rounds off corners and blurs thin features. As you raise the resolution, the field hugs the original edges more tightly and the information loss shrinks.
Resolution and Accuracy
The tradeoff is memory versus accuracy, and it is steep. Doubling grid resolution in 2D multiplies the sample count by 4; in 3D it multiplies by 8. A 32³ volume grid stores 32,768 samples. A 256³ grid stores over 16 million. Most applications settle on a resolution that fits their budget and accept the resulting approximation error.
Hover over any grid point in the visualization to see its coordinates and computed signed distance. The difference between the sampled value at a grid point and the interpolated value at a nearby in-between position is where approximation error lives.
Corners are always the hardest case. The true signed distance to a corner changes slope direction abruptly as you cross the bisector. Bilinear interpolation can only produce smooth blends of the four surrounding sample values, so it inevitably rounds the corner. Higher resolution reduces the round-off region but never eliminates it completely. This is a fundamental limitation of uniform grid sampling.
Sampled Fields and the SDF Pipeline
Once a field is baked, it slots into the same downstream pipeline as an analytical SDF. CSG operations like union, intersection, and subtraction only consume scalar values at each point, so they work identically on sampled fields. Surface normals can still be estimated with finite differences across neighboring grid samples. Ray marching can still step through the field.
The one practical difference is step safety. An analytical SDF guarantees the distance to the nearest surface, which makes sphere tracing safe with step sizes equal to the field value. Bilinear interpolation of grid samples does not preserve that exact-distance guarantee, so ray marchers need wider safety margins when traversing sampled fields. The interpolated distance must be treated as a conservative lower bound rather than an exact value.
Applications
Valve introduced baked signed distance fields to mainstream graphics with their 2007 SIGGRAPH paper on alpha-tested vector texture magnification. Font glyphs are baked into a distance texture once, and hardware bilinear interpolation reconstructs crisp, anti-aliased edges at any magnification without storing high-resolution bitmaps. The same technique is now standard in high-quality text and UI rendering.
In 3D, Unreal Engine 5 generates signed distance fields from static triangle meshes into sparse voxel grids. These mesh distance fields drive distance field shadows, ambient occlusion, and collision detection throughout the engine. The baking step runs offline during content authoring, so the runtime cost is just grid lookups and interpolation.
Physics engines also use baked SDFs for collision queries between complex meshes. The grid is typically baked at a coarser resolution than rendering grids, trading spatial accuracy for computation speed, and re-baked each frame for deformable objects.
Beyond Uniform Grids
Two common extensions address the limitations of uniform sampling.
Adaptively sampled distance fields (ADFs) replace the uniform grid with an octree that concentrates samples near surface features and uses coarser cells in flat regions. This reduces memory waste while preserving detail where it matters. The tradeoff is traversal complexity: querying an ADF requires navigating a tree structure instead of indexing a flat array, which is harder to accelerate on fixed-function GPU hardware.
Multi-channel signed distance fields (MSDFs) store distances to multiple nearby edges per grid cell, using extra color channels in a texture. During interpolation, each channel provides a distance candidate to a different edge, and the final distance is the minimum across channels. This preserves sharp corners that a single-channel SDF would round off, at the cost of 3× or 4× the texture memory. MSDFs are standard in high-quality text rendering and are increasingly used for vector graphics on GPUs.
Both techniques build on the same baking principle: sample the true distance where possible, store the result, and reconstruct at runtime. Once the uniform grid baseline is clear, these extensions are natural next steps.