[add] glsl random.

This commit is contained in:
yoichi kobayashi 2016-12-27 01:19:28 +09:00
parent 9c63edd10c
commit 5d5cd17749
2 changed files with 14 additions and 2 deletions

View File

@ -16,6 +16,14 @@ http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl
### usage ### usage
``` ```
#pragma glslify: convertHsvToRgb = require(glsl-convert-color/convertHsvToRgb); #pragma glslify: convertHsvToRgb = require(glsl-util/convertHsvToRgb);
#pragma glslify: convertRgbToHsv = require(glsl-convert-color/convertRgbToHsv); #pragma glslify: convertRgbToHsv = require(glsl-util/convertRgbToHsv);
```
## random
### usage
```
#pragma glslify: random = require(glsl-util/random);
``` ```

4
random.glsl Normal file
View File

@ -0,0 +1,4 @@
float random(vec2 co){
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);
}
#pragma glslify: export(random)