Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/farazzshaikh/three-noise
Simple gradient noise library for use with Three.js. Now with fBm!
https://github.com/farazzshaikh/three-noise
3d glsl nodejs noise plugin terrain-generation threejs webgl webgl2
Last synced: 3 months ago
JSON representation
Simple gradient noise library for use with Three.js. Now with fBm!
- Host: GitHub
- URL: https://github.com/farazzshaikh/three-noise
- Owner: FarazzShaikh
- License: mit
- Archived: true
- Created: 2021-05-01T22:17:12.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-09T14:40:32.000Z (almost 3 years ago)
- Last Synced: 2024-09-30T15:39:46.777Z (3 months ago)
- Topics: 3d, glsl, nodejs, noise, plugin, terrain-generation, threejs, webgl, webgl2
- Language: JavaScript
- Homepage:
- Size: 1.3 MB
- Stars: 41
- Watchers: 1
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
THREE-Noise
Simple gradient noise library for use with Three.js. Now with fBm!
View Demo
·
Report Bug
·
API Docs
## Installation
Make sure to have ThreeJS installed.
```bash
$ npm i three
```Install through NPM
```bash
$ npm i three-noise
```For Browsers, download `build/three-noise.js`.
## Importing
### Browser
In your HTML
```html```
Then, in your JavaScript you can use the `THREE_Noise` object.
```js
const { Perlin, FBM } = THREE_Noise;
```### NodeJS
In NodeJS, you can import it like you normally do.
```js
import { Perlin, FBM } from 'THREE_Noise';
```## Usage
### Perlin
```js
// Instantiate the class with a seed
const perlin = new Perlin(Math.random())perlin.get2(vector2) // Get 2D Perlin Nosie
perlin.get3(vector3) // Get 3D Perlin Nosie
```### fBm
```js
// Instantiate the class with a seed
const fbm = new FBM({
seed: Math.random()
})fbm.get(vector2) // Get 2D Perlin Nosie with fBm
fbm.get(vector3) // Get 3D Perlin Nosie with fBm
```