I wrote two articles on my blog about this project, the first one is about the generation of 2D noise while the second one is about the generation of 3D noise, feel free to read them!
A fast and simple perlin noise generator using numpy.
The function generate_perlin_noise_2d
generates a 2D texture of perlin noise. Its parameters are:
shape
: shape of the generated array (tuple of 2 ints)res
: number of periods of noise to generate along each axis (tuple of 2 ints)
Note: shape
must be a multiple of res
The function generate_fractal_noise_2d
combines several octaves of 2D perlin noise to make 2D fractal noise. Its parameters are:
shape
: shape of the generated array (tuple of 2 ints)res
: number of periods of noise to generate along each axis (tuple of 2 ints)octaves
: number of octaves in the noise (int)persistence
: scaling factor between two octaves (float)
Note: shape
must be a multiple of 2^(octaves-1)*res
The function generate_perlin_noise_3d
generates a 3D texture of perlin noise. Its parameters are:
shape
: shape of the generated array (tuple of 3 ints)res
: number of periods of noise to generate along each axis (tuple of 3 ints)
Note: shape
must be a multiple of res
The function generate_fractal_noise_2d
combines several octaves of 3D perlin noise to make 3D fractal noise. Its parameters are:
shape
: shape of the generated array (tuple of 3 ints)res
: number of periods of noise to generate along each axis (tuple of 3 ints)octaves
: number of octaves in the noise (int)persistence
: scaling factor between two octaves (float)
Note: shape
must be a multiple of 2^(octaves-1)*res