/** * HDR environment map light source detection. * * Analyzes equirectangular HDR pixel data to find dominant light sources * (softboxes in studio HDRs, sun in outdoor HDRs). Returns direction, * intensity, and color for up to 2 lights, used to create shadow-casting * DirectionalLights in Studio mode. * * Algorithm: downsample to 128x64 luminance grid → threshold at 10x median * → flood-fill cluster → convert centroids to 3D direction vectors. * Runs ~5-10ms on CPU, no GPU readback needed. */ /** A detected dominant light source from HDR analysis. */ export interface DetectedLight { /** Unit direction vector toward the light source (Y-up, before Z-up rotation). */ direction: [number, number, number]; /** Relative intensity (normalized, 0-1 range). */ intensity: number; /** Linear RGB color of the light source (0-1 range). */ color: [number, number, number]; } /** Result of light detection analysis. */ export interface LightDetectionResult { /** Detected light sources (0-2 entries). */ lights: DetectedLight[]; /** Whether the result came from actual HDR analysis (true) or a fallback (false). */ wasAnalyzed: boolean; } /** * Detect dominant light sources from equirectangular HDR pixel data. * * @param data - Raw pixel data (Uint16Array for HalfFloat, or Float32Array) * @param width - HDR image width in pixels * @param height - HDR image height in pixels * @returns Detection result with up to 2 lights */ export declare function detectDominantLights(data: Uint16Array | Float32Array, width: number, height: number): LightDetectionResult; /** * Return hardcoded fallback lights for procedural RoomEnvironment. * * The RoomEnvironment has no raw HDR data to analyze. A single top-front * light direction approximates its primary illumination. */ export declare function getDefaultLights(): LightDetectionResult;