/** * Lighting environment for the main shading pipelines and the procedural * sky pass. * * Every field is optional; the defaults reproduce the renderer's historical * hardcoded look exactly (sun at normalize(0.5, 1, 0.3), hemisphere ambient, * 0.85 exposure), so callers that never pass `RenderOptions.environment` * see no visual change. * * Directions are in viewer/world space (Y-up). `sunDirection` points TOWARD * the sun, matching the shader's `dot(N, sunDirection)` convention. */ export type Vec3Color = [number, number, number]; export interface SkyGradient { /** Colour straight up. */ zenith: Vec3Color; /** Colour at the horizon band. */ horizon: Vec3Color; /** Colour below the horizon. */ ground: Vec3Color; } export interface LightingEnvironment { /** Unit vector toward the sun (Y-up viewer space). Normalized defensively. */ sunDirection?: [number, number, number]; sunColor?: Vec3Color; /** Diffuse strength of the sun term (historic default 0.55). */ sunIntensity?: number; /** Hemisphere-ambient sky colour (historic default [0.3, 0.35, 0.4]). */ skyColor?: Vec3Color; /** Hemisphere-ambient ground colour (historic default [0.15, 0.1, 0.08]). */ groundColor?: Vec3Color; /** Hemisphere ambient strength (historic default 0.25). */ ambientIntensity?: number; /** Fixed fill-light strength (historic default 0.15). */ fillIntensity?: number; /** Rim-light strength (historic default 0.15). */ rimIntensity?: number; /** Pre-tonemap exposure multiplier (historic default 0.85). */ exposure?: number; /** * Draw the procedural sky background. When false (default) the frame * clears to `RenderOptions.clearColor` exactly as before. */ skyEnabled?: boolean; /** * Optional explicit sky gradient for the sky pass. When omitted, a * palette is derived from the sun's altitude (day → golden hour → * twilight → night). */ sky?: Partial; } /** `LightingEnvironment` with every field populated. */ export type ResolvedEnvironment = Required> & { sky: SkyGradient; }; /** * Derive a sky gradient from the sun's elevation (the Y component of the * unit sun direction = sin(altitude)). Four keyed palettes blended smoothly: * night → twilight → golden hour → day. */ export declare function deriveSkyGradient(sunElevation: number): SkyGradient; /** Fill in defaults; the result always renders identically to the legacy look when `env` is undefined/empty. */ export declare function resolveEnvironment(env?: LightingEnvironment): ResolvedEnvironment; /** Byte size of the packed environment UBO (must match the WGSL struct). */ export declare const ENVIRONMENT_UNIFORM_SIZE = 80; /** * Pack the resolved environment into the `Environment` WGSL struct layout: * * sunDirection: vec3 + sunIntensity: f32 → floats 0..3 * sunColor: vec3 + ambientIntensity: f32 → floats 4..7 * skyColor: vec3 + exposure: f32 → floats 8..11 * groundColor: vec3 + fillIntensity: f32 → floats 12..15 * rimIntensity: f32 + 3 pad floats → floats 16..19 */ export declare function packEnvironmentUniforms(env: ResolvedEnvironment, out?: Float32Array): Float32Array; //# sourceMappingURL=environment.d.ts.map