// Fireflies layer-shader interface: typed uniforms + control descriptor. A // transparent overlay of drifting glowing dots (use blend 'additive'). Shader // source is ./fireflies.frag. // Cost: HEAVY -- ~18 ms/draw, ~61x plasma (shader:view meter // @1920, Intel UHD 770, default uniforms, 2026-06-14). // Rubric + full ranking: ../README.md ("Cost"). import type { RGB } from '../../../src/lib/primitives.types'; import type { UniformControl } from '../_shared/types'; /** Typed uniforms for the `fireflies` layer shader. */ export type FirefliesUniforms = { /** Radius of each firefly's soft glow. */ readonly uGlowSize: number; /** Size of the bright center dot. */ readonly uDotSize: number; /** Drift movement speed. */ readonly uSpeed: number; /** Twinkle (fade in/out) speed. */ readonly uTwinkle: number; /** Firefly tint, RGB each channel 0..1 (the warm default is the amber look). */ readonly uColor: RGB; }; /** The `fireflies` shader's tunable uniforms; defaults are the warm amber look. */ export const FIREFLIES_CONTROLS: readonly UniformControl[] = [ { name: 'uGlowSize', kind: 'float', default: 0.035, min: 0.005, max: 0.1, step: 0.001, doc: 'Glow radius.', }, { name: 'uDotSize', kind: 'float', default: 0.006, min: 0.001, max: 0.02, step: 0.001, doc: 'Bright center size.', }, { name: 'uSpeed', kind: 'float', default: 0.35, min: 0, max: 1, step: 0.01, doc: 'Movement speed.', }, { name: 'uTwinkle', kind: 'float', default: 2.5, min: 0, max: 5, step: 0.1, doc: 'Fade in/out speed.', }, { name: 'uColor', kind: 'color', default: [1.0, 0.82, 0.32], doc: 'Firefly tint.' }, ];