Renderer · class

ProbeGrid

Explained in Hello world.

class ProbeGrid
import { ProbeGrid } from '@driftengine/core';

Constructor

new

constructor(options: ProbeGridOptions)
ParameterTypeDescription
optionsProbeGridOptions

Properties

NameTypeDescription
originreadonlyVec3
spacingreadonlyVec3
countsreadonlyVec3
layersreadonlynumberProbes in total: the array's layer count, or a third of it for a crossfading grid.
crossfadereadonlybooleanWhether sweeps blend into one another. See ProbeGridOptions.crossfade.
invSpacingreadonlyVec3The reciprocal of the spacing, because the shader multiplies and so does everything here.

Methods

layerAt

layerAt(ix: number, iy: number, iz: number): number

The layer a probe at whole lattice coordinates occupies.

ParameterTypeDescription
ixnumber
iynumber
iznumber
More

x fastest, then y, then z, and the order is written down because the shader computes the same expression and the two disagreeing would put every fragment's reflection in a different room. Out-of-range coordinates clamp; see nearestProbes for why clamping rather than wrapping is the behaviour at a grid's edge.

positionOf

positionOf(layer: number, out: Vec3): Vec3

Where a layer's probe stands, filling a vector the caller owns.

ParameterTypeDescription
layernumber
outVec3