Renderer · class
ProbeGrid
Explained in Hello world.
class ProbeGridimport { ProbeGrid } from '@driftengine/core';Constructor
new
constructor(options: ProbeGridOptions)| Parameter | Type | Description |
|---|---|---|
options | ProbeGridOptions |
Properties
| Name | Type | Description |
|---|---|---|
originreadonly | Vec3 | |
spacingreadonly | Vec3 | |
countsreadonly | Vec3 | |
layersreadonly | number | Probes in total: the array's layer count, or a third of it for a crossfading grid. |
crossfadereadonly | boolean | Whether sweeps blend into one another. See ProbeGridOptions.crossfade. |
invSpacingreadonly | Vec3 | The reciprocal of the spacing, because the shader multiplies and so does everything here. |
Methods
layerAt
layerAt(ix: number, iy: number, iz: number): numberThe layer a probe at whole lattice coordinates occupies.
| Parameter | Type | Description |
|---|---|---|
ix | number | |
iy | number | |
iz | number |
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): Vec3Where a layer's probe stands, filling a vector the caller owns.
| Parameter | Type | Description |
|---|---|---|
layer | number | |
out | Vec3 |