Renderer · interface

FieldMarch

How the march is shaped.

Explained in Hello world.

interface FieldMarch
import type { FieldMarch } from '@driftengine/core';

Properties

NameTypeDescription
stepsreadonlynumberThe most samples one ray may take. A converging march uses a fraction of this.
reachMreadonlynumberHow far the ray travels in world metres before it gives up.
coneAnglereadonlynumberHalf-angle of the cone, in radians. Zero is a pencil ray.
More

A rough surface reflects a lobe rather than a ray, and a cone is how a distance field traces one: the radius grows with the distance travelled and a hit is where the field falls below that rather than below a constant. The blur is then correct by construction — a wide cone stops further from a surface, so what it gathers is a broader patch of it — instead of being a filter applied to a sharp answer afterwards.

hitEpsilonMreadonlynumberHow close to a surface counts as arriving, in metres, before the cone's own radius.