◆ Signed Distance

Glossary

The site's vocabulary, each term linked back to where it is taught. Dotted-underlined words throughout the levels land here.

Signed distance function (SDF)
A function returning, for every point, the distance to the nearest point of a shape's boundary — positive outside, negative inside, zero exactly on the surface. The premise of this entire site: the function is the shape.
Level 1 — One number per point
Distance field
The picture of an SDF's values over all of space at once. 2D fields are drawn directly on this site (as heatmaps or stripes); 3D fields are sliced or rendered.
Level 1 — How to read a field
Level set
All points where a field takes one particular value — a ring of constant distance, like a contour line on a hiking map. The stripes in every 2D figure here are level sets.
Level 1 — the probe
Zero level set
The level set at value 0: the set where the field changes sign — which is the shape's boundary itself. Rendering an SDF means finding its zero level set.
Level 1
Exact (field)
A field that returns the true Euclidean distance everywhere. All the primitives in this site's library marked exact are verified numerically against brute-force boundary sampling by scripts/verify-sdfs.ts.
Level 1 — exact vs bound
Bound (field)
A field whose magnitude never exceeds the true distance (and whose sign is correct) but may underestimate — marked bound on this site. Smooth blends, boolean interiors, and fractal estimators are bounds. Sphere tracing only ever needs the bound property.
Level 2 — the honest footnote
Lipschitz continuity
The property that a function changes no faster than some constant per unit of input. Distance fields satisfy it with constant 1: |f(p) − f(q)| ≤ ‖p − q‖. Read backwards, a field value is a certificate of empty space — the guarantee sphere tracing leaps on.
Level 1 — Go deeper
Smooth minimum (smin)
A blend of min that lets two fields negotiate wherever they are within kof each other, replacing the union's crease with a fillet. The gateway to organic, “melted” shapes; costs exactness, keeps the bound property.
Level 2 — the morpher
Domain repetition
Folding all of space into one cell with mod before evaluating the field, so a single shape repeats infinitely at no extra cost. The flagship example of transforming space rather than the shape.
Level 2 — domain tricks
Vector
An arrow with length and direction, written by components. Positions locate points; normalized (length-1) directions aim rays. All the 3D this site needs fits in one expandable primer.
Level 3 — vectors as arrows
Raycasting
Answering “what does this ray see first?” — one ray per pixel for visibility, one ray toward the light for shadows. The question every renderer on this site asks; sphere tracing is our way of answering it.
Level 3 — the problem
Raytracing
Rendering by recursive raycasting with exact, per-shape intersection formulas — and, in its full glory, secondary rays for reflection and refraction. Exact where formulas exist; helpless where shapes have been melted beyond formula. Compared honestly in Level 3, practiced (one mirror bounce) in Level 5.
Level 5 — Go deeper
Sphere tracing (raymarching)
Finding a ray's hit point by repeatedly leaping exactly the field's value — the radius of a guaranteed-empty sphere — until it shrinks to nothing (hit) or the ray escapes (sky). Cheap in open space, expensive along grazing rays.
Level 3 — the golden key
Gradient
The arrow of steepest increase of a field, estimated here by central differences — sample left/right, up/down, near/far, and difference. On an exact distance field it has length 1 and points directly away from the nearest surface.
Level 4 — needles
Normal
The unit arrow perpendicular to a surface at a point — for distance fields, the normalized gradient. The input every lighting computation starts from.
Level 4 — which way does the surface face?
Soft shadow (near-miss trick)
Penumbras computed during a single shadow march by tracking how narrowly the ray misses geometry: min(k·h/t) over the march. An approximation of area-light shadowing that costs nothing beyond the samples already taken.
Level 4 — Go deeper
Ambient occlusion (AO)
Darkening where geometry crowds in. Estimated by walking outward along the normal and accumulating how far the field's answers fall short of the distance walked — distance versus expectation.
Level 4 — Go deeper
Distance estimator (DE)
A computed lower bound on distance for sets with no closed-form SDF — fractals above all, via the escape rate of an iteration. A bound is all the marcher needs, so estimators render infinite detail with the same loop.
Level 5 — the gallery