Renderer · function
sampleProbeVolume
Blend what the probes carry, channels floats each, into a target the caller owns.
Explained in Hello world.
function sampleProbeVolume(blend: ProbeBlend, values: Float32Array, channels: number, out: Float32Array): Float32Arrayimport { sampleProbeVolume } from '@driftengine/core';Parameters
| Parameter | Type | Description |
|---|---|---|
blend | ProbeBlend | |
values | Float32Array | |
channels | number | |
out | Float32Array |
In depth
Channel count rather than a fixed three, because what a probe carries is the caller's decision: three for an ambient colour, nine for a spherical-harmonic band, a whole octahedral map for a directional one. The blend is the same arithmetic whatever it is, and writing it once is what stops two of them disagreeing about what the weights mean.