UNPKG

@thi.ng/shader-ast-stdlib

Version:

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

7 lines (6 loc) 234 B
import { add, mul } from "@thi.ng/shader-ast/ast/ops"; import { normalize } from "@thi.ng/shader-ast/builtin/math"; const rayPointAt = (p, dir, t, norm = false) => add(p, mul(norm ? normalize(dir) : dir, t)); export { rayPointAt };