Const worleyDist
worleyDist: TaggedFn2<"vec3", "vec3", "vec3"> = defn("vec3","worleyDist",["vec3", "vec3"],(a, b) => [ret(add(mul(a, a), mul(b, b)))])
Const worleyDistManhattan
worleyDistManhattan: TaggedFn2<"vec3", "vec3", "vec3"> = defn("vec3","worleyDistManhatten",["vec3", "vec3"],(a, b) => [ret(add(abs(a), abs(b)))])
Higher order function. Computes 2D Worley noise using provided distance function. The returned function takes 2 args: position and jitter amount, the latter in [0..1] interval. Returns noise components as vec2, with the x component containing the distance from closest simplex center and y the noise value. The vector components can be used individually or combined (e.g.
noise.y - noise.x
)...Based on implementation by Stefan Gustavson: http://webstaff.itn.liu.se/~stegu/GLSL-cellular/GLSL-cellular-notes.pdf