UNPKG

@thi.ng/shader-ast-stdlib

Version:

Function collection for modular GPGPU / shader programming with @thi.ng/shader-ast

22 lines 885 B
import type { Fn } from "@thi.ng/api"; import type { FloatTerm, Prim, Term } from "@thi.ng/shader-ast"; /** * Higher order function. Takes an AST type ID, a single-arg scalar function * `fn`, number of octaves (default: 4) and an optional function name. Returns a * new function which computes the summed value of `fn` over the given number * octaves and accepts 3 args: * * - position (float) * - octave shift (float) * - octave decay (usually 0.5) * * For each octave `i` `[0,oct)`, the function is (in principle) evaluated as: * * n += decay / exp2(i) * fn(pos * exp2(i) + i * shift) * * @param fn - * @param oct - * @param name - */ export declare const additive: <T extends Prim>(type: T, fn: Fn<Term<T>, FloatTerm>, oct?: number | FloatTerm, name?: string) => import("@thi.ng/shader-ast").TaggedFn3<T, T, "float", "float">; //# sourceMappingURL=additive.d.ts.map