/** * Baked irradiance volume: a grid of second-order (9-coefficient, RGB) spherical-harmonic probes * over a box region, sampled at runtime for ambient lighting. It is the datum an interior has that * a hemisphere light cannot: a room's fill is its own, not the sky's, and it varies across the space. * * Serializable and pure; the bake is deterministic heuristics (sky visibility, authored lamps and * bounce colours), not a path tracer. */ /** SH coefficients per channel for the second band — 3 bands, real basis. */ export declare const SH_COEFFICIENTS = 9; /** Floats stored per probe: {@link SH_COEFFICIENTS} × RGB. */ export declare const PROBE_STRIDE: number; /** One irradiance volume authored on a scene document. */ export interface IrradianceVolume { id: string; /** World-space centre of the grid. */ center: readonly [number, number, number]; /** World-space extent of the grid. */ size: readonly [number, number, number]; /** Probe count per axis; at least 1. */ resolution: readonly [number, number, number]; /** * `PROBE_STRIDE` floats per probe, row-major (x fastest, then y, then z). Absent until baked, so a * freshly authored volume renders nothing rather than a fabricated ambient. */ samples?: readonly number[]; } /** Authored bake inputs stored beside the samples so a volume can be re-baked without the editor. */ export interface IrradianceBakeSettings { /** How much sky reaches the region: 0 fully enclosed, 1 fully open. */ skyVisibility: number; /** Radiance above the horizon for an open region. Default the sky's own horizon colour. */ skyColor?: string; /** Radiance below the horizon (ground bounce). */ groundColor?: string; /** Fill colour of an enclosed region's ceiling; keeps a room from baking to black. */ ceilingColor?: string; /** Fill colour of an enclosed region's floor. */ floorColor?: string; /** Multiplier on the enclosed fill. Default 1. */ fillIntensity?: number; /** Authored lamps folded into the bake. */ lights?: readonly { position: readonly [number, number, number]; color?: string; intensity?: number; distance?: number; }[]; } /** * Real-basis SH values for a unit direction, into `out` (length 9): * `[Y00, Y1-1, Y10, Y11, Y2-2, Y2-1, Y20, Y21, Y22]`. * @internal */ export declare function shDirection(x: number, y: number, z: number, out: Float64Array | number[]): void; /** World-space position of probe `(ix, iy, iz)`; the outer probes sit on the box faces. * @internal */ export declare function probePosition(volume: Pick, ix: number, iy: number, iz: number): [number, number, number]; /** Everything a bake needs for one volume: where the grid sits, how much sky reaches it, and what fills the dark. */ export interface IrradianceBakeInput { /** Stable volume id, copied onto the baked volume. */ id: string; center: readonly [number, number, number]; size: readonly [number, number, number]; resolution: readonly [number, number, number]; settings: IrradianceBakeSettings; /** Direction samples per probe. Default 64. */ samples?: number; } /** * Bakes an irradiance volume from authored inputs: sky radiance where the region is open, an * authored ceiling/floor fill where it is enclosed, plus inverse-square lamp radiance. Each probe * projects its directional radiance into L2 SH, so ambient varies across the grid and keeps a lit * side instead of flattening to one number. * @capability light-probes bake an irradiance volume from authored sky, fill and lamp inputs */ export declare function bakeIrradianceVolume(input: IrradianceBakeInput): IrradianceVolume; /** * The volume that governs a world position: the one whose box contains it, else the nearest by * centre. A scene usually authors one volume per interior plus one for the exterior shell. * @internal */ export declare function selectIrradianceVolume(volumes: readonly IrradianceVolume[], position: readonly [number, number, number]): IrradianceVolume | undefined; /** * Trilinearly samples the volume's SH at a world position, writing {@link PROBE_STRIDE} floats into * `out`. Positions outside the grid clamp to its faces, so a probe volume never pops to black at its * edge. Returns false when the volume has no baked samples. * @internal */ export declare function sampleIrradianceVolume(volume: IrradianceVolume, position: readonly [number, number, number], out: Float32Array): boolean; /** * Radiance along a direction from the SH, `Σ coeff·basis` clamped at zero. Used by tests and by * tooling that previews a volume without a renderer. * @internal */ export declare function radianceAlong(sh: ArrayLike, normal: readonly [number, number, number]): [number, number, number];