import { Vector3, type Object3D, type WebGPURenderer } from 'three/webgpu'; import type { Vec3 } from '../engine/types.ts'; import type { RenderSource, VolumeLighting } from '../engine/VolumeLighting.ts'; /** Where flames light the scene from: an emitter, or an explosion while it burns. */ export interface LightAnchor { id: string; position: Vec3; /** An explosion's light, which ends once its flames die down. */ transient: boolean; } /** A collection in flight. */ interface Request { simulation: RenderSource; lighting: VolumeLighting; params: GPUBuffer; sampler: GPUSampler; lut: GPUTexture; anchors: readonly LightAnchor[]; intensity: number; voxelSize: number; } /** * Lights for the scene's surfaces: one per anchor, at the centroid of the flames nearest * it, colored and as bright as they are. Every brick's flames go to its nearest anchor on * the GPU (scene-lights.wgsl); the totals come back asynchronously, so the application's * update never waits. */ export declare class SceneLights { private readonly device; private readonly parent; private readonly renderer; private readonly measured; private readonly fixed; private pipeline; private anchors?; private sums?; private readback?; private pending; private deferred?; private disposed; private generation; /** Where the camera that last drew the simulation stood. */ readonly viewer: Vector3; private constructor(); static create(device: GPUDevice, parent: Object3D, renderer: WebGPURenderer): Promise; /** Whether the application lights its scene with ClusteredLighting, which takes any * number of point lights without recompiling materials. */ private get clustered(); /** Native reduction and readback buffers, including growth headroom. */ get memoryBytes(): number; /** Whether an explosion's light has died down, so its anchor can go. */ finished(id: string): boolean; /** Collect the light of the simulation's latest step by anchor. A collection still in * flight defers this one until it lands. */ sample(request: Request): void; /** Measure each anchor's light from its totals, then light the scene. */ private apply; /** Give the measured lights to point lights: one each with ClusteredLighting, otherwise * the fixed few to the anchors that light the camera's surroundings most. */ private place; private copy; private add; private remove; /** Remove an anchor's own light. */ private release; /** Turn every light off, and drop measurements in flight. */ reset(): void; dispose(): void; } export {};