Skip to content
Swifter edited this page Oct 19, 2024 · 1 revision

Gradient Noise

alt text

rm.gradientNoise lets you input the number of dimensions the noise is in, and the seed to generate the noise.

const mySeed = 1
const myNoise = rm.gradientNoise(3, mySeed) // 3D noise

It returns a function where you input a position and get a value between 0 and 1.

myNoise(0, 0, 0) // some value between 0 and 1

There are also pre-made functions for 1D, 2D, and 3D:

  • rm.gradientNoise1D(seed)
  • rm.gradientNoise2D(seed)
  • rm.gradientNoise3D(seed)

Voronoi Noise

alt text

rm.voronoiNoise lets you input the number of dimensions the noise is in, and the seed to generate the noise.

const mySeed = 1
const myNoise = rm.voronoiNoise(3, mySeed) // 3D noise

It returns a function where you input a position and get a value between 0 and 1.

myNoise(0, 0, 0) // some value between 0 and 1

There are also pre-made functions for 1D, 2D, and 3D:

  • rm.voronoiNoise1D(seed)
  • rm.voronoiNoise2D(seed)
  • rm.voronoiNoise3D(seed)

Clone this wiki locally