Never overshoot, never miss
Sphere tracing, one step at a time
The marcher has no idea where the surface is. All it can ask is “how far is the nearest surface from here?” — and then it may safely travel exactly that far, because nothing can be closer. Press Step to advance the ray one iteration; each circle is the empty space the SDF just guaranteed. Drag the two handles to re-aim, then push the step multiplier above 1.0 and watch the guarantee break.
A multiplier of 1.0 is the sphere tracing guarantee: step exactly the distance returned, and the ray can never pass through anything.
A ray heading straight at the middle of a sphere converges in a handful of steps — each answer is large, so each stride is long. A ray that just grazes the edge is a different story: it spends its whole journey close to the surface, so the SDF keeps returning small numbers and the ray keeps taking tiny steps, often exhausting the iteration budget without ever hitting anything.
That is why the cost strip lights up along every silhouette. Sphere tracing is cheap in open space and expensive near surfaces — the exact opposite of the cost profile you get from intersecting triangles, and the reason a raymarched scene can be fast to write and slow to render.
Drop max steps until the far geometry starts to dissolve, and you are watching the iteration budget run out mid‑flight. Raise ε instead and the surfaces stay, but they thicken and soften — the ray now calls it a hit while it is still short of the real surface.