faros initial commit
[faros-demo] / glsl-noise / README.md
1 # glsl-noise [![frozen](http://hughsk.github.io/stability-badges/dist/frozen.svg)](http://github.com/hughsk/stability-badges) #
2
3 [webgl-noise](http://github.com/ashima/webgl-noise) ported to an NPM package
4 so that you can require it from
5 [glslify](http://github.com/chrisdickinson/glslify).
6
7 [![glsl-noise](https://nodei.co/npm/glsl-noise.png?mini=true)](https://nodei.co/npm/glsl-noise)
8
9 ## Usage ##
10
11 ``` glsl
12 // Require as many or as little as you need:
13 #pragma glslify: snoise2 = require(glsl-noise/simplex/2d)
14 #pragma glslify: snoise3 = require(glsl-noise/simplex/3d)
15 #pragma glslify: snoise4 = require(glsl-noise/simplex/4d)
16 #pragma glslify: cnoise2 = require(glsl-noise/classic/2d)
17 #pragma glslify: cnoise3 = require(glsl-noise/classic/3d)
18 #pragma glslify: cnoise4 = require(glsl-noise/classic/4d)
19 #pragma glslify: pnoise2 = require(glsl-noise/periodic/2d)
20 #pragma glslify: pnoise3 = require(glsl-noise/periodic/3d)
21 #pragma glslify: pnoise4 = require(glsl-noise/periodic/4d)
22
23 attribute vec3 position;
24
25 // And just treat them as functions like
26 // you normally would:
27 void main() {
28   gl_FragColor = vec4(snoise3(position), 1.0);
29 }
30 ```