Perlin
An implementation of Ken Perlin's improved Perlin noise algorithm in Elixir.
This library provides functions to generate 3D Perlin noise, which can be used for procedural generation of textures, terrains, and other natural-looking patterns. It includes both single-octave noise generation and multi-octave noise for more complex and detailed results.
The implementation is based on Ken Perlin's improved noise function from 2002, which addressed some of the visual artifacts present in his original 1985 algorithm.
Features
- 🌐 3D noise generation
- 🔁 Optional repetition of noise pattern
- 🏔️ Multi-octave noise for more natural-looking results
- 🎛️ Configurable persistence for octave-based noise
Installation
The package can be installed by adding perlin to your list of dependencies in
mix.exs:
def deps do
[
{:perlin, "~> 0.1.0"}
]
endUsage
Generate noise
iex> Perlin.noise(3.14, 42.0, 7.0)
0.5684599793920001Generate multi-octave noise
iex> Perlin.octave(3.14, 42.0, 7.0, 4, 0.5)
0.5530014285141335License
Perlin is released under the Apache License 2.0.
About
This package was written by Elliot Jackson.
- Blog: https://elliotekj.com
- Email: elliot@elliotekj.com