Generate 2d perlin noise. Based on code from noisejs by Stefan Gustavson. https://github.com/josephg/noisejs/blob/master/perlin.js
Kind: global class
Create the perlin noise generator.
Param | Type | Description |
---|---|---|
seed | Number |
Seed for perlin noise, or undefined for random. |
Set the perlin noise seed.
Kind: instance method of Perlin
Param | Type | Description |
---|---|---|
seed | Number |
New seed value. May be either a decimal between 0 to 1, or an unsigned short between 0 to 65536. |
Number
Generate a perlin noise value for x,y coordinates.
Kind: instance method of Perlin
Returns: Number
- Perlin noise value for given point.
Param | Type | Description |
---|---|---|
x | Number |
X coordinate to generate perlin noise for. |
y | Number |
Y coordinate to generate perlin noise for. |
blurDistance | Number |
Distance to take neighbors to blur returned value with. Defaults to 0.25. |
contrast | Number |
Optional contrast factor. |
Number
Generate a perlin noise value for x,y coordinates.
Kind: instance method of Perlin
Returns: Number
- Perlin noise value for given point, ranged from 0 to 1.
Param | Type | Description |
---|---|---|
x | Number |
X coordinate to generate perlin noise for. |
y | Number |
Y coordinate to generate perlin noise for. |
contrast | Number |
Optional contrast factor. |