All Projects → jwagner → Simplex Noise.js

jwagner / Simplex Noise.js

Licence: mit
A fast simplex noise implementation in Javascript.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Simplex Noise.js

Bonfire Firebase Sample
An app to discuss your favourite emojis. This is a sample app built with Firebase.
Stars: ✭ 564 (-23.68%)
Mutual labels:  demo
Vue Typescript Dpapp Demo
🔥 Let's start with TypeScript
Stars: ✭ 613 (-17.05%)
Mutual labels:  demo
Polygon Shredder
The polygon shredder that takes many cubes and turns them into confetti
Stars: ✭ 686 (-7.17%)
Mutual labels:  demo
Ocbarrage
iOS 弹幕库 OCBarrage, 同时渲染5000条弹幕也不卡, 轻量, 可拓展, 高度自定义动画, 超高性能, 简单易上手; A barrage render-engine with high performance for iOS. At the same time, rendering 5000 barrages is also very smooth, lightweight, scalable, highly custom animation, ultra high performance, simple and easy to use!
Stars: ✭ 589 (-20.3%)
Mutual labels:  demo
Android Yolo
Real-time object detection on Android using the YOLO network with TensorFlow
Stars: ✭ 604 (-18.27%)
Mutual labels:  demo
Serverless Stack Demo Client
Source for the demo app client in Serverless-Stack.com
Stars: ✭ 629 (-14.88%)
Mutual labels:  demo
Zhuishushenqi
追书神器 接口分析包装
Stars: ✭ 546 (-26.12%)
Mutual labels:  demo
Cyxtenmindemo
十分钟搭建App框架(OC)KIF自动化测试 与系列Demo博文地址
Stars: ✭ 720 (-2.57%)
Mutual labels:  demo
Weapp Vue Eggjs Shop Demo
商城、商店批发或零售,pc管理端 + 微信小程序 + 后端服务
Stars: ✭ 604 (-18.27%)
Mutual labels:  demo
Vscode Plugin Demo
VSCode插件开发全攻略配套demo
Stars: ✭ 647 (-12.45%)
Mutual labels:  demo
Tensorflowandroiddemo
TensorFlow android demo 车道线 车辆 人脸 动作 骨架 识别 检测 抽烟 打电话 闭眼 睁眼
Stars: ✭ 589 (-20.3%)
Mutual labels:  demo
Simplecvreproduction
Reproduce simple cv project including attention module, classification, object detection, segmentation, keypoint detection, tracking 😄 etc.
Stars: ✭ 602 (-18.54%)
Mutual labels:  demo
Wechat Miniprogram Examples
WeChat mini program examples. 微信小程序示例
Stars: ✭ 634 (-14.21%)
Mutual labels:  demo
Tables
Bulma themed, VueJS powered Datatable with server-side loading and JSON template setup
Stars: ✭ 575 (-22.19%)
Mutual labels:  demo
Autolayoutexamplewithmasonry
Different Autolayout examples with Masonry. 用Masonry写的Autolayout案例,持续更新中。详细解答请看tutuge.me
Stars: ✭ 694 (-6.09%)
Mutual labels:  demo
Node Express Mongoose Demo
A simple demo app using node and mongodb for beginners
Stars: ✭ 4,976 (+573.34%)
Mutual labels:  demo
Mapbox Android Demo
Google Play demo app for the Mapbox Maps SDK for Android
Stars: ✭ 624 (-15.56%)
Mutual labels:  demo
Rasa chatbot cn
building a chinese dialogue system based on the newest version of rasa(基于最新版本rasa搭建的对话系统)
Stars: ✭ 723 (-2.17%)
Mutual labels:  demo
Demoit
Live coding demos without Context Switching
Stars: ✭ 717 (-2.98%)
Mutual labels:  demo
Silex Kitchen Edition
This project is a sample or a bootstrap silex application
Stars: ✭ 645 (-12.72%)
Mutual labels:  demo

simplex-noise.js

Build Status

simplex-noise.js is a fast simplex noise implementation in Javascript. It works in the browser and on nodejs.

Demos

Installation

npm i -S simplex-noise

Usage

By default simplex-noise.js will use Math.random() to seed the noise.

// initializing a new simplex instance
// do this only once as it is relatively expensive
var simplex = new SimplexNoise(),
    value2d = simplex.noise2D(x, y),
    value3d = simplex.noise3D(x, y, z),
    value4d = simplex.noise4D(x, y, z, w);

You can also pass in a seed string which will then be used to initialize the noise using the built in alea PRNG.

var simplex = new SimplexNoise('seed'),
    value2d = simplex.noise2D(x, y),
    sameSeed = new SimplexNoise('seed'),
    differentSeed = new SimplexNoise('different seed');

sameSeed.noise2D(x, y) === value2d
differentSeed.noise2D(x, y) !== value2d

You can also pass an alternative random function to the constructor that is used to build the permutation table. This can be used with a custom pseudo random number generator:

var random = new Alea(seed),
    simplex = new SimplexNoise(random),
    value2d = simplex.noise2D(x, y);

The ALEA PRNG can be found on in the npm package alea.

node.js

Node.js is also supported, you can install the package using npm.

var SimplexNoise = require('simplex-noise'),
    simplex = new SimplexNoise(Math.random),
    value2d = simplex.noise2D(x, y);

Benchmarks

For development you can open perf/index.html and watch the console or run node perf/benchmark.js in a shell. There is also a rake task for comparing your current changes can also run make compare. The command works using git stash.

Tests

There are some simple unit tests for this library to run them

npm install && npm test

Changelog

2.4.0

  • Included a PRNG based on ALEA to directly allow seeding
  • Included typescript definitions

2.3.0

⚠️ This release changes the output of the noise functions. ⚠️

In the future such changes will be released as a new major version.

  • Corrected generation of permutation table
  • Moved tests to mocha/chai
  • Cleanup

2.2.0

  • Small performance improvement for 2D noise

2.1.1

  • Increased entropy by fixing a little initialization issue.

2.1.0

  • AMD support

2.0.0

  • Changed node.js api, SimplexNoise is now exported directly.
  • Added unit tests

1.0.0

  • Initial Release

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.

License

Copyright (c) 2015 Jonas Wagner, licensed under the MIT License (enclosed)

Credits

This is mostly a direct javascript port of the Java implementation by Stefan Gustavson and Peter Eastman.

The integrated pseudo random generator is based on code by by Johannes Baagøe.

The typescript definition has been provided by Neonit.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].