/** * Per-tile paint pipeline for the atmosphere shell. * * The shell carries a vertex `color` attribute that the shader masks on * `max(r, g, b)` to decide between procedural tint and caller-supplied * tile paint. The painter pre-computes the K nearest tiles (and their * normalised blend weights) for every shell vertex once at build time, * so the runtime paint loop is a single allocation-free pass over the * vertex buffer. * * Smooth dégradés between adjacent painted tiles come from K=3: the * weighted average of the three nearest tiles produces a soft edge that * the procedural FBm pattern then breaks up — no visible polygon * boundaries on the icosphere even at low subdivisions. */ import * as THREE from 'three'; import type { Tile } from '../../geometry/hexasphere.types'; /** Per-tile RGB triple consumed by `AtmoShellPainter.paintFromTiles`. */ export interface AtmoShellRGB { r: number; g: number; b: number; } /** * Maximum number of tiles blended into each shell vertex. K=3 gives smooth * edges between adjacent hex centres; raising it would only smear the * paint further at no visible benefit on the ~2.5k shell vertices. */ export declare const SHELL_PAINT_K = 3; /** Painter handle returned by {@link createAtmoShellPainter}. */ export interface AtmoShellPainter { /** * Stamps per-tile RGB into the shell's vertex colour buffer using a * K-nearest blend. Tiles missing from `colors` simply don't contribute; * vertices whose K-nearest neighbourhood is fully unpainted are reset * to `(0, 0, 0)` so the shader falls back to the procedural tint. * * No-op when the painter was built without `tiles` (decorative shell * with no gameplay link). */ paintFromTiles: (colors: Map) => void; } /** * Builds the painter for an atmosphere shell. When `tiles` is empty or * undefined, the returned `paintFromTiles` is a no-op — the shell stays * purely procedural. * * The colour attribute is mutated in place; the painter flips * `needsUpdate` on the attribute so Three.js re-uploads it on the next * frame. */ export declare function createAtmoShellPainter(input: { pos: THREE.BufferAttribute; colorAttr: THREE.BufferAttribute; tiles: readonly Tile[] | undefined; }): AtmoShellPainter; //# sourceMappingURL=atmoShellPaint.d.ts.map