import { Expr, GpuFragmentParams } from '../../gpu/contract'; import { FilterParams } from '../../gpu/scaffolds/pointwiseFilter'; import { PointwiseEffect } from '../types'; import { PropRef } from '../values'; import { ArgSpec } from '../invoke'; /** A lowered light value — evaluate against the composition params. */ export type LightValue = (params: GpuFragmentParams) => Expr; /** * `rayBands` — banded shimmer along an axis: a traveling sine over `along`, lifted to * [0, 1] and sharpened by a power curve. Higher `sharpness` narrows the bright bands. * Feed a noise-warped `along` for organic rays (aurora curtains, godray shimmer, fabric). */ export declare function rayBands(opts: { along: Expr; frequency: Expr | number; time: Expr | number; speed: Expr | number; phase?: Expr | number; sharpness: Expr | number; }): Expr; /** * `emitterFalloff` — how light spilling from an emitter dims with distance `d` from it: * `(radius / (radius + d))^power` — 1 at the emitter, softened over `radius`, then a 1/d * line-emitter tail at power 1 tightening toward a 1/d² point-emitter tail at power 2. The * long-tailed cousin of the gaussian {@link glowSpot}: real irradiance, not a soft blob. */ export declare function emitterFalloff(d: Expr, opts: { radius: Expr | number; power: Expr | number; }): Expr; /** * `glowAt` — a round gaussian glow at a position in aspect-corrected UV space: * `exp(−0.5·dist²/sizeSq)`. Takes the SQUARED radius (callers usually drive several glows from * CPU-computed data). The positional cousin of {@link glowSpot}. */ export declare function glowAt(opts: { uv: Expr; aspect: Expr | number; x: Expr | number; y: Expr | number; sizeSq: Expr | number; }): Expr; /** * `domeNormal` — a fake surface: the normal field of a flat disc treated as a bulging dome * ("make it look puffy" — the Bevel & Emboss family's opening move). Geometry only; light * it with {@link shine}. `bulge.tilt` sets how far normals lean outward at the rim, * `bulge.drop` how much the dome flattens toward the edge. Defaults are the house dome. */ export declare function domeNormal(opts: { delta: Expr; dist: Expr; radius: Expr | number; bulge?: { tilt?: number; drop?: number; }; }): Expr; /** * `shine` — light a normal field: the specular lobe of a unit light direction against * `normal`, viewed along +z (the 2.5D worldview). Returns the RAW lobe — scale by * intensity × coverage at the call site. Shines anything that yields a normal: a * {@link domeNormal}, a bevel, a heightfield slope, a material surface. */ export declare function shine(opts: { normal: Expr; light: Expr; gloss: Expr | number; }): Expr; /** * A light part over a frame's local coordinates. Radial-frame parts read * `vec2(dist, angle)`; beam-frame parts read `vec2(u, v)`. */ export type LightPart = (frame: Expr, params: GpuFragmentParams) => Expr; /** * Distance + angle (`vec2(dist, angle)`) around an unflipped centre prop in aspect-corrected * space — the radial frame of a burst, halo or sweep. */ export declare function radialFrame(center: PropRef): LightValue; /** * The seam-free radial frame volumetric rays march in — distance plus a wrap-free angular * coordinate around `center`. */ export declare function seamlessRadialFrame(center: PropRef): LightValue; /** * The local frame of a beam anchored at a point and aimed at the canvas centre: * `vec2(u, v)` — distance along the beam and lateral offset — in aspect-corrected space. * Reads the raw filter context (a pointwise effect's frame, not a generator's). */ export declare function beamFrame(anchor: PropRef): LightValue; /** * Evaluate a light part in a frame — the composition root of a framed light recipe. A `hint` * names the stage and binds the frame as a WGSL local (required when the part reads the frame * more than once). */ export declare function withFrame(frame: LightValue, part: LightPart, hint?: string): LightValue; /** Multiply light parts over one frame (a mask over a pattern). */ export declare function modulate(first: LightPart, ...rest: LightPart[]): LightPart; /** Rotating sine ray lobes around the frame angle — `count` lobes, spun by the animated clock × `spin`, narrowed by `sharpness`. */ export declare function rayLobes(slots: { count: ArgSpec; spin: number; sharpness: ArgSpec; }): LightPart; /** * {@link rayLobes} driven by a designer-facing softness slider (softness inverts into the lobe * exponent, so soft rays widen without moving their centres). `spin` scales the animated clock * (negative = clockwise). */ export declare function softRayLobes(slots: { count: ArgSpec; softness: ArgSpec; spin: number; }): LightPart; /** Diffraction-style spikes with hard nulls — pass `blades / 2` as `halfCount`; high power thins. */ export declare function raySpikes(slots: { halfCount: ArgSpec; power: ArgSpec; }): LightPart; /** Three concentric chromatic ring bands (R outside, B inside for positive spread) as an RGB. */ export declare function ringBand(slots: { center: ArgSpec; spread: ArgSpec; width: ArgSpec; }): LightPart; /** An isotropic Gaussian falloff over the frame distance: `exp(-(dist² · sharpness))`. */ export declare function glowPoint(slots: { sharpness: ArgSpec; }): LightPart; /** The outer fade of a bounded radial light: 1 inside `radius`, fading over the last `feather` fraction. */ export declare function featherMask(slots: { radius: ArgSpec; feather: ArgSpec; }): LightPart; /** * Two seam-free noise layers accumulated into a volumetric ray coverage over the frame, * animated on the definition's clock: `density` sets sector frequency, `intensity` ray * visibility, `spotty` the spot density along each ray. */ export declare function noiseRays(slots: { density: ArgSpec; intensity: ArgSpec; spotty: ArgSpec; }): LightPart; /** * The slow drift/breathing signal pack of a bleeding light: breath gain in `.x`, streak drift * offsets in the rest. `flicker` sets the breathing depth, `seed` re-rolls the pattern. */ export declare function slowDrift(slots: { seed: ArgSpec; flicker: ArgSpec; }): (clock: Expr, params: GpuFragmentParams) => Expr; /** The main anisotropic glow pool (`.x`) and its wider shoulder (`.y`) along a beam frame. */ export declare function beamBloom(slots: { spread: ArgSpec; }): (frame: Expr, drift: Expr, params: GpuFragmentParams) => Expr; /** Drifting parallel streak bands further into the frame along the beam. */ export declare function beamStreaks(slots: { spread: ArgSpec; strength: ArgSpec; }): (frame: Expr, drift: Expr, params: GpuFragmentParams) => Expr; /** Hash dither over a heat field to hide ramp banding. */ export declare function dithered(heat: Expr, uv: Expr, clock: Expr): Expr; /** * An elliptical Gaussian glow over a pre-normalized 2D offset (each axis already divided by its * own radius): `exp(-(du² + dv²) · sharpness)`. The core of a bloom, a glare, or a soft pool. */ export declare function glowSpot(du: Expr, dv: Expr, sharpness: Expr): Expr; /** One soft Gaussian band across a 1D coordinate, peaking at `center` with the given `width`. */ export declare function streakBand(u: Expr, center: Expr, width: Expr): Expr; /** Project a point onto a segment: `vec2(t, distance)` with `t` clamped to [0,1]. */ export declare function segmentProject(p: Expr, a: Expr, b: Expr): Expr; /** * The glow cross-section of a tapered beam: thickness/softness interpolate end-to-end along the * segment parameter; returns `vec2(colorT, alpha)`. */ export declare function lightBeam(dist: Expr, t: Expr, thickness: { start: Expr; end: Expr; }, softness: { start: Expr; end: Expr; }): Expr; /** * The shared frame of a camera flare: light position, flare axis, master fade (intensity × * edge fade × shimmer), and the pixel's polar coordinates about the light. */ export declare function flareFrame(slots: { position: PropRef; intensity: ArgSpec; edgeFade: ArgSpec; }): LightValue; /** * One internal-reflection ghost disc along the flare axis: `disc` = offset/size/bright/hollow, * `tint` = r/g/b/gPhase. */ export declare function lensGhost(slots: { intensity: ArgSpec; spread: ArgSpec; chroma: ArgSpec; }): (flare: Expr, disc: [number, number, number, number], tint: [number, number, number, number], params: GpuFragmentParams) => Expr; /** The chromatic halo ring about the light. */ export declare function flareHalo(slots: { intensity: ArgSpec; radius: ArgSpec; chroma: ArgSpec; softness: ArgSpec; }): (flare: Expr, params: GpuFragmentParams) => Expr; /** The diffraction-spike starburst about the light. */ export declare function flareStarburst(slots: { intensity: ArgSpec; points: ArgSpec; }): (flare: Expr, params: GpuFragmentParams) => Expr; /** The anamorphic horizontal streak through the light. */ export declare function flareStreak(slots: { intensity: ArgSpec; length: ArgSpec; }): (flare: Expr, params: GpuFragmentParams) => Expr; /** The broad veiling glare about the light. */ export declare function flareGlare(slots: { intensity: ArgSpec; size: ArgSpec; }): (flare: Expr, params: GpuFragmentParams) => Expr; /** The bright core at the light itself. */ export declare function flareCore(slots: { intensity: ArgSpec; }): (flare: Expr, params: GpuFragmentParams) => Expr; /** Finish an additive light stack: scale by the frame's master fade with a luminance-derived alpha. */ export declare function flareComposite(total: Expr, flare: Expr): Expr; /** * Quadratic corner-darkening mask about the frame centre, aspect-corrected from the effective * viewport. `strength` 0 disables it; `scale` remaps a designer-range slider into mask units. */ export declare function vignetteMask(slots: { strength: ArgSpec; scale?: number; }): LightValue; /** Sum additive light contributions: `a + b + c + …` in the given order. */ export declare function additive(first: Expr, ...rest: Expr[]): Expr; /** * A slot-bound overexposure ramp (fringe → mid → hot, with chromatic per-channel taps): binds the * three ramp colour props and yields the RGB of any heat field. The visible "colour story" part * of a light leak or glow. */ export declare function heatRamp(colors: { hot: PropRef; mid: PropRef; fringe: PropRef; }): { kind: "heatRamp"; /** The chromatic RGB of a heat field (three offset ramp taps). */ taps: (heat: Expr, params: { uniforms: Record; }) => Expr; }; export type HeatRamp = ReturnType; /** * Mix `color` over `background` component-wise (rgb AND alpha) by a coverage field; `hint` * names the coverage stage's WGSL local. */ export declare function coverageMix(slots: { color: PropRef; background: PropRef; coverage: LightValue; hint?: string; }): LightValue; /** Straight-alpha composite of `color` over `background` by a coverage field (linear RGB). */ export declare function coverageOver(slots: { color: PropRef; background: PropRef; coverage: LightValue; }): LightValue; /** * Screen-composite an emitted glow RGB over the child, exposure-style: screen blend + * overexposure push + a slight halation lift; emitted light raises alpha over transparent * areas too. The pointwise composition root of a light-bleed filter. */ export declare function screenGlow(glow: (params: FilterParams) => Expr): PointwiseEffect; //# sourceMappingURL=light.d.ts.map