import { d } from '../../gpu/kit/index'; /** * A double heartbeat, 0 to 1, driven by the layer's clock. * * Compute it once per pixel and hand the same value to `edgeGlowBand` and every * `orbitSpotsAccum` call, so the band's smoke and the spots beat together. * * @example * ```ts * const beat = asLocal(call(heartbeatPulse, 'heartbeatPulse', [animatedTime(params)]), 'beat') * ``` * @see edgeGlowBand, orbitSpotsAccum */ export declare const heartbeatPulse: import('typegpu').TgpuFn<(animTime: d.F32) => d.F32>; /** * The glowing band around the shape's edge, with drifting smoke, plus the angle around the shape. * * Takes the shape's signed distance (`frame.surf0.member('r')`), the shape-space uv * (`frame.sdfUV`), the viewport size, the `scale` prop, `thickness` (0.01 to 1; 1 is about as * wide as the default shape), `softness` (0 is a crisp ring, 1 a wide gradient), `smokeSize` * and `smokeAmt` (0 to 1), the layer's clock, `pulse` (0 to 1) and the shared `beat`. Returns * `.x` the band (0 to 1) and `.y` the angle around the shape in turns (0 to 1), which * `orbitSpotsAccum` needs. * * @example * ```ts * const band = call(edgeGlowBand, 'edgeGlowBand', [frame.surf0!.member('r'), frame.sdfUV!, params.ctx.viewportSize, uniforms.scale, uniforms.thickness, uniforms.softness, uniforms.smokeSize, uniforms.smoke, t, uniforms.pulse, beat]) * ``` * @see heartbeatPulse, orbitSpotsAccum */ export declare const edgeGlowBand: import('typegpu').TgpuFn<(fieldRaw: d.F32, sdfUV: d.Vec2f, viewport: d.Vec2f, scale: d.F32, thickness: d.F32, softness: d.F32, smokeSize: d.F32, smokeAmt: d.F32, animTime: d.F32, pulse: d.F32, beat: d.F32) => d.Vec2f>; /** * The spots of one color orbiting the band, as coverage at this pixel. * * Call it once per color. Takes the angle and band from `edgeGlowBand`, the layer's clock, the * shared `beat`, `spots` (1 to 5 per color), `spotSize` (0 to 1), `pulse` (0 to 1), * `intensity` (0 to 1), `softness`, `seed` and the color's index. Returns a pair for * `edgeGlowAccumColorFor`: `.x` the layered coverage and `.y` the additive sum used for bloom. * * @example * ```ts * const sectors = call(orbitSpotsAccum, 'orbitSpotsAccum', [band.member('y'), band.member('x'), t, beat, uniforms.spots, uniforms.spotSize, uniforms.pulse, uniforms.intensity, uniforms.softness, uniforms.seed, floatE(colorIndex)]) * ``` * @see edgeGlowBand, edgeGlowAccumColorFor */ export declare const orbitSpotsAccum: import('typegpu').TgpuFn<(angle01: d.F32, border: d.F32, animTime: d.F32, beat: d.F32, spotsF: d.F32, spotSize: d.F32, pulse: d.F32, intensity: d.F32, softness: d.F32, seed: d.F32, colorIdxF: d.F32) => d.Vec2f>; /** @internal The running fold state threaded through the per-color loop. */ export declare const EdgeGlowAccum: d.WgslStruct<{ rgb: d.Vec3f; w: d.F32; ba: d.F32; ac: d.Vec3f; aa: d.F32; }>; /** * The empty state to start folding colors into. * * @example * ```ts * let state = call(edgeGlowAccumZero, 'edgeGlowAccumZero', []) * ``` * @see edgeGlowAccumColorFor, edgeGlowCompose */ export declare const edgeGlowAccumZero: import('typegpu').TgpuFn<() => d.WgslStruct<{ rgb: d.Vec3f; w: d.F32; ba: d.F32; ac: d.Vec3f; aa: d.F32; }>>; /** * The fold step for one color space: adds one color's spots to the running state. * * `mode` is the compile-time value of a `colorSpace` prop (see `transformColorSpace`); where * colors overlap they mix in that space. The returned GPU function takes the state, a color * and the pair from `orbitSpotsAccum`, and returns the new state. Call it once per color, then * close with `edgeGlowCompose`. * * @example * ```ts * const accumColor = edgeGlowAccumColorFor(propValues.colorSpace as number) * state = call(accumColor, 'edgeGlowAccumColor', [state, uniforms.colorA, sectors]) * ``` * @tip OKLCh keeps overlapping lights vivid; linear RGB muddies them. * @see edgeGlowAccumZero, orbitSpotsAccum, edgeGlowCompose */ export declare function edgeGlowAccumColorFor(mode: number): import('typegpu').TgpuFn<(st: d.WgslStruct<{ rgb: d.Vec3f; w: d.F32; ba: d.F32; ac: d.Vec3f; aa: d.F32; }>, color: d.Vec4f, sectors: d.Vec2f) => d.WgslStruct<{ rgb: d.Vec3f; w: d.F32; ba: d.F32; ac: d.Vec3f; aa: d.F32; }>>; /** * One color from a `stops` prop, by index. * * Reads the packed stops array (`uniforms.colorsArray` when the definition uses * `colorStopsPropConfig`). Stop positions are ignored; the stops are a list of orbit colors. * * @example * ```ts * const color = call(colorAtIndex, 'colorAtIndex', [uniforms.colorsArray, floatE(i)]) * ``` * @see edgeGlowAccumColorFor */ export declare const colorAtIndex: import('typegpu').TgpuFn<(colors: d.WgslArray, idx: d.F32) => d.Vec4f>; /** * The final color from the folded state, over a transparent background. * * `bloom` (0 to 1) sets how additively overlapping lights pile up; high values overdrive to * white. Returns straight alpha, ready to return from the surface function. * * @example * ```ts * return call(edgeGlowCompose, 'edgeGlowCompose', [state, uniforms.bloom]) * ``` * @see edgeGlowAccumColorFor */ export declare const edgeGlowCompose: import('typegpu').TgpuFn<(st: d.WgslStruct<{ rgb: d.Vec3f; w: d.F32; ba: d.F32; ac: d.Vec3f; aa: d.F32; }>, bloom: d.F32) => d.Vec4f>; //# sourceMappingURL=edgeGlow.d.ts.map