@thi.ng/shader-ast-stdlib
Version:
Function collection for modular GPGPU / shader programming with @thi.ng/shader-ast
18 lines (17 loc) • 447 B
JavaScript
import { V3 } from "@thi.ng/shader-ast/api/types";
import { defn, ret } from "@thi.ng/shader-ast/ast/function";
import { add, div, mul } from "@thi.ng/shader-ast/ast/ops";
import { clamp01 } from "../math/clamp.js";
const ACESFilm = defn(V3, "ACESFilm", [V3], (col) => [
ret(
clamp01(
div(
mul(col, add(mul(col, 2.51), 0.03)),
add(mul(col, add(mul(col, 2.43), 0.59)), 0.14)
)
)
)
]);
export {
ACESFilm
};