Package Exports
- simplex-noise
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (simplex-noise) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
simplex-noise.js
simplex-noise.js is a fast simplex noise implementation in Javascript.
Requirements
It requires typed arrays, if you want to use it in browsers without support you will need to use a polyfill like typedarray.js.
Usage
// initializing a simplex instance
// do this only once it's relatively expensive
var simplex = new SimplexNoise(),
value2d = simplex.noise2D(x, y),
value3d = simplex.noise3D(x, y, z),
value4d = simplex.noise2D(x, y, z, w);
You can also pass an alternative random function to the constructor that is used to build the permutation table:
var simplex = new SimplexNoise(Math.random),
value2d = simplex.noise2D(x, y);
Benchmarks
Comparison between 2D and 3D noise Comparison with simplex implementation in three.js
Changelog
1.0.0
- Initial Release
Credits
This is mostly a direct javascript port of the Java implementation by Stefan Gustavson and Peter Eastman.