Home > @gglib/noise

noise package

Classes

Class Description
Noise The noise builder

Functions

Function Description
abs(src) Generates a Sampler that always returns an absolute value
add(src) Generates a sampler that sums the results of all source samplers
cellNoise(distance) Generates a sampler that generates cell noise values
clamp(src, min, max) Generates a sampler that clamps the result of the source
constant(value) Generates a sampler that always returns a constant value
easeCosine(t) Applies cosine easing on a value
easeCubic(t) Applies cubic easing on a value
easeLinear(t) Applies linear easing on a value (simply returns the value)
easeNearest(t) Return either 0 or 1
easePoint(t) Always returns 0
easeQuintic(t) Applies quintic easing on a value (simply returns the value)
euclideanDistance(v) Calculates euclidean distance of a vector
fractal(src, { octaves, frequency, lacunarity, persistence, }) Generates a fractal sampler
hybridMultifractal(src, { octaves, frequency, lacunarity, persistence, offset, }) Generates a hybrid multi fractal sampler
latticeNoise({ prime1, prime2, prime3, primeX, primeY, primeZ, }) Generates a lattice noise sampler
manhattanDistance(v) Calculates manhattan distance of a vector
max(src) Generates a sampler that returns the maximum value
min(src) Generates a sampler that returns a minimum value
multifractal(src, { octaves, frequency, lacunarity, persistence, offset, }) Generates a multi fractal sampler
multiply(src) Generates a sampler that multiplies all values
negate(src) Generates a sampler that negates the source value
perlinNoise(ease) Generates a perlin noise sampler
power(base, exp) Generates a sampler that powers the base value
ridgedMultifractal(src, { octaves, frequency, lacunarity, persistence, offset, gain, }) Generates a ridged multi fractal sampler
scale(src, scalar) Generates a sampler that scales the input values
shift(src, s) Generates a sampler that shifts the input values
simplexNoise() Generates a simplex noise sampler
sinus(src, offset) Generates a sampler that utilizes the sinus function
smoothStep(src, threshold1, threshold2, min, max) Generates a sampler that steps between values
step(src, threshold, min, max) Generates a sampler that steps between values
subtract(src) Generates a sampler that subtracts all values
valueNoise(src) Generates a value noise sampler

Interfaces

Interface Description
FractalOptions Common fractal options
LatticeNoiseOptions Options for the latticeNoise() sampler

Type Aliases

Type Alias Description
DistanceFunc A function that calculates a distance for a vector
Ease An easing function
FractalParams A sub set of FractalOptions
Sampler A sampler function that takes a multi dimensional input value and returns a single value