Renderer · interface
ProbeGridOptions
A lattice, and the reason it is one.
Explained in Hello world.
interface ProbeGridOptionsimport type { ProbeGridOptions } from '@driftengine/core';In depth
A list of probes is what the shader cannot afford. Free placement wants a position and an
extent per probe, and flatFrag already declares 35 array uniforms totalling 385 uniform
vectors against WebGL2's guaranteed MAX_FRAGMENT_UNIFORM_VECTORS of 224 — the widest
permutation is 1.7x over the guarantee already and runs because real parts offer more. Sixteen
probes of position and extent would add about 48 vectors to that, on a budget nobody can raise.
A lattice needs four uniforms whatever the probe count: an origin, the reciprocal of the spacing, the counts, and whether the grid supplies ambient. The layer index is arithmetic and the blend is three lerps, so nothing here scales with how many probes a world has.
What it costs is that probes cannot be placed where a room is. A world whose interesting
volume is not a box spends layers on probes standing in walls, and the answer to that is a
coarser grid rather than a list. What would make it wrong is the flat shader's uniform
pressure falling far enough for per-probe data to fit, or probe data moving into a texture —
which needs the last texture unit, and lightBudget.ts records why that one is being kept.
Properties
| Name | Type | Description |
|---|---|---|
originreadonly | Vec3 | Where probe (0, 0, 0) stands. Every other probe is offset from it by whole steps. |
spacingreadonly | Vec3 | Metres between neighbouring probes on each axis. Every component must be positive. |
countsreadonly | Vec3 | How many probes on each axis.More
|
crossfadereadonlyoptional | boolean | Blend each sweep of bakes into the next rather than showing each probe's bake the moment it
lands. For a grid re-baked a probe a frame under a moving light, where each probe otherwise
jumps once a sweep and the jumps travel across the scene as a pass of light. Costs three times
the layers and a sweep of lag; ignored where indirect light is traced, which writes the grid's
layers itself. See probeSweeps.ts. Off by default. |