Simplex noise generation. A combination of algorithms for very fast noise generation: http://weber.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf, http://www.google.com/patents/US6867776, and http://www.jgallant.com/procedurally-generating-wrapping-world-maps-in-unity-csharp-part-2/#wrap2.

Static methods

staticinlinesimplex(x:Float, y:Float):Float

Calculates the simplex noise at a given 2D coordinate.

Parameters:

x

The x coordinate at which the noise value should be obtained.

y

The y coordinate at which the noise value should be obtained.

Returns:

The value of noise at the input coordinate, ranging from -1 to 1, inclusive.

staticinlinesimplex4D(x:Float, y:Float, z:Float, w:Float):Float

Calculates the simplex noise at a given 4D coordinate. Used internally to generate tileable 2D noise, but it might as well be public.

Parameters:

x

The x coordinate at which the noise value should be obtained.

y

The y coordinate at which the noise value should be obtained.

z

The z coordinate at which the noise value should be obtained.

w

The w coordinate at which the noise value should be obtained.

Returns:

The value of noise at the input coordinate, ranging from -1 to 1, inclusive.

@:value({ octaves : 1, persistence : 1, scale : 1 })staticsimplexOctaves(x:Float, y:Float, scale:Float = 1, persistence:Float = 1, octaves:Int = 1):Float

Generates noise by combining multiple octaves of simplex noise at a given 2D coordinate.

Parameters:

x

The x coordinate at which the noise value should be obtained.

y

The y coordinate at which the noise value should be obtained.

scale

A multiplier that "zooms" into or out of the noise distribution. Smaller values zoom out.

persistence

A multiplier that determines how much effect past octaves have. Typical values are 0 < x <= 1.

octaves

The number of noise functions that get added together. Higher numbers provide more detail but take longer to run.

Returns:

The combined value of noise at the input coordinate, ranging from -1 to 1, inclusive.

@:value({ octaves : 1, persistence : 1, scale : 1 })staticsimplexTiles(x:Float, y:Float, baseX:Float, baseY:Float, seed:Float, scale:Float = 1, persistence:Float = 1, octaves:Int = 1):Float

Generates repeating simplex noise at a given frequency, which can be used for tiling. Note: simplexTiles is more expensive than simplexOctaves. Generate one tile and copy it around instead of calling this function for every pixel.

Parameters:

x

The x coordinate at which the noise value should be obtained.

y

The y coordinate at which the noise value should be obtained.

baseX

How often the noise pattern repeats itself in the x direction, in pixels.

baseY

How often the noise pattern repeats itself in the y direction, in pixels.

seed

A random number used to vary the tiling pattern, even if all other parameters are the same.

scale

A multiplier that "zooms" into or out of the noise distribution. Smaller values zoom out.

persistence

A multiplier that determines how much effect past octaves have. Typical values are 0 < x <= 1.

octaves

The number of noise functions that get added together. Higher numbers provide more detail but take longer to run.

Returns:

The combined, repeating value of noise at the input coordinate, ranging from -1 to 1, inclusive.