@thi.ng/shader-ast-stdlib
Version:
Function collection for modular GPGPU / shader programming with @thi.ng/shader-ast
31 lines • 1.06 kB
TypeScript
import type { FloatTerm, Vec3Term } from "@thi.ng/shader-ast";
/**
* Inline function. Computes Lambert term, i.e. `max(dot(n, l), 0)`. Both
* vectors must be pre-normalized.
*
* @param surfNormal - vec3
* @param lightDir - vec3
*/
export declare const lambert: (n: Vec3Term, ldir: Vec3Term) => import("@thi.ng/shader-ast").FnCall<"float">;
/**
* Inline function. Computes Half-Lambertian term. Both vectors must be
* pre-normalized.
*
* https://developer.valvesoftware.com/wiki/Half_Lambert
*
* @param n -
* @param ldir -
*/
export declare const halfLambert: (n: Vec3Term, ldir: Vec3Term) => import("@thi.ng/shader-ast").Term<"float">;
/**
* Inline function. Computes:
*
* col = lambert * lightCol * diffuseCol + ambientCol
*
* @param lambertian - float
* @param diffuseCol - vec3
* @param lightCol - vec3
* @param ambientCol - vec3
*/
export declare const diffuseLighting: (lambertian: FloatTerm, diffuse: Vec3Term, light: Vec3Term, ambient: Vec3Term) => import("@thi.ng/shader-ast").Term<"vec3">;
//# sourceMappingURL=lambert.d.ts.map