Options
All
  • Public
  • Public/Protected
  • All
Menu

Generates perlin noise based on the 2002 Siggraph paper http://mrl.nyu.edu/~perlin/noise/ Also https://flafla2.github.io/2014/08/09/perlinnoise.html

Hierarchy

  • PerlinGenerator

Index

Constructors

constructor

Properties

amplitude

amplitude: number

The amplitude determines the relative height of the peaks generated in the noise.

frequency

frequency: number

Frequency to use when generating the noise, the higher the number the more quickly the pattern will oscillate. Another way to think about this is that it is like "zooming" out from an infinite pattern determined by the seed.

octaves

octaves: number

Number of octaves to use when generating the noise, the number of octaves is the number of times the perlin noise is generated and laid on top of itself. Using higher values can increase the curviness of the noise, and make it look more natural.

persistance

persistance: number

The persistance determines how quickly the amplitude will drop off, a high degree of persistance results in smoother patterns, a low degree of persistance generates spiky patterns.

Methods

grid

  • grid(width: number, height: number, step?: number): number[]
  • Generates a 2D grid of perlin noise given a step value packed into a 1D array i = (x + y*width), by default the step will 1/(min(dimension))

    Parameters

    • width: number
    • height: number
    • Optional step: number

    Returns number[]

noise

  • noise(x: number): number
  • noise(x: number, y: number): number
  • noise(x: number, y: number, z: number): number
  • Generates 1-Dimensional perlin noise given an x and generates noises values between [0, 1].

    Parameters

    • x: number

    Returns number

  • Generates 2-Dimensional perlin noise given an (x, y) and generates noise values between [0, 1]

    Parameters

    • x: number
    • y: number

    Returns number

  • Generates 3-Dimensional perlin noise given an (x, y, z) and generates noise values between [0, 1]

    Parameters

    • x: number
    • y: number
    • z: number

    Returns number

sequence

  • sequence(length: number, step?: number): number[]
  • Generates a list starting at 0 and ending at 1 of continuous perlin noise, by default the step is 1/length;

    Parameters

    • length: number
    • Optional step: number

    Returns number[]