The white outline is the shape. Inside is colored red-orange, outside is green-blue. Shade intensity grows with distance from the surface.
The pink dot is your cursor position. The dashed circle has radius equal to |sdf(p)|. It always just touches the surface, never crosses it. The arrow points to the nearest surface point.
That "largest safe step" property is exactly what sphere tracing uses. Stand anywhere, and you know how far you can walk before hitting something.
··
For each pixel: cast a ray from the camera through it, find what it hits, color the pixel. Done.
function trace(p, dir): for i in 1..MAX_STEPS: d = sdf(p) if |d| < eps: return HIT p = p + dir * d return MISS
That's the whole algorithm. Five lines, no mesh, no acceleration structures. A polygon ray tracer needs hundreds of lines and a textbook chapter of edge cases.
Two shapes, A and B, each with its own SDF. Drag either to move it. The white outline is the SDF of their combination.
Union: min(A, B).
Intersection: max(A, B).
Subtraction: max(A, -B).
Smooth union: blended variant, differentiable everywhere.
Modeling with polygon meshes needs brittle boolean solvers. SDFs give you the same operations as single-line functions. And every expression is differentiable, so gradient-based optimization works directly on shape.