Herteby/simplex-noise/1.1.0

NOTE: the latest version is 1.2.2

Simplex

Permutation tables

type alias PermutationTable =
{ perm : Array Int
, permMod12 : Array Int
}

Permutation table that is needed to generate the noise value.

permutationTableGenerator : Generator PermutationTable

Generate the permutation tables that are needed to calculate the noise value.

permutationTableFromInt : Int -> PermutationTable

Convenience function to generate a PermutationTable using an Int as a seed

Simplex noise

noise2d : PermutationTable -> Float -> Float -> Float

Generates a noise value between -1 and 1 based on the given x and y value and a seeded permutation table.

noise3d : PermutationTable -> Float -> Float -> Float -> Float

Generates a noise value between -1 and 1 based on the given x, y and z value and a seeded permutation table.

noise4d : PermutationTable -> Float -> Float -> Float -> Float -> Float

Generates a noise value between -1 and 1 based on the given x, y, z and w value and a seeded permutation table.

Fractal noise

fractal2d : FractalConfig -> PermutationTable -> Float -> Float -> Float

2-dimensional fractal noise

fractal3d : FractalConfig -> PermutationTable -> Float -> Float -> Float -> Float

3-dimensional fractal noise

FractalConfig
-> PermutationTable
-> Float
-> Float
-> Float
-> Float
-> Float

4-dimensional fractal noise