Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "noise/worley2"

Index

Variables

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)))])

Functions

Const worley2

  • worley2(distFn: Func2<"vec3", "vec3", "vec3">): TaggedFn2<"vec2", "float", "vec2">
  • 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

    Parameters

    • distFn: Func2<"vec3", "vec3", "vec3">

      -

    Returns TaggedFn2<"vec2", "float", "vec2">

Generated using TypeDoc