Renderer · const

MAX_GLOBAL_MEDIUM_STEPS

The most steps a march may take, which is the shader's own loop bound.

Explained in Hello world.

const MAX_GLOBAL_MEDIUM_STEPS = 64
import { MAX_GLOBAL_MEDIUM_STEPS } from '@driftengine/core';

In depth

Here rather than beside the GLSL, and the reason is bundle size rather than tidiness. renderQuality.ts clamps against this and is imported by everything; importing one integer out of the shader module would carry seventeen kilobytes of shader text into every consumer's bundle, tree-shaken or not. The engine has paid that once already — see docs/IMPROVEMENTS.md on a constant imported from an offline module.

Sixty-four is well past useful: at that count the step is centimetres across a room, and the picture stopped changing somewhere around a third of it.