From 5d5cd177497c9fa6eca4bddf2ed214af9fa65800 Mon Sep 17 00:00:00 2001 From: yoichi kobayashi Date: Tue, 27 Dec 2016 01:19:28 +0900 Subject: [PATCH] [add] glsl random. --- README.md | 12 ++++++++++-- random.glsl | 4 ++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 random.glsl diff --git a/README.md b/README.md index 0b42805..cfd2b05 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,14 @@ http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl ### usage ``` -#pragma glslify: convertHsvToRgb = require(glsl-convert-color/convertHsvToRgb); -#pragma glslify: convertRgbToHsv = require(glsl-convert-color/convertRgbToHsv); +#pragma glslify: convertHsvToRgb = require(glsl-util/convertHsvToRgb); +#pragma glslify: convertRgbToHsv = require(glsl-util/convertRgbToHsv); +``` + +## random + +### usage + +``` +#pragma glslify: random = require(glsl-util/random); ``` diff --git a/random.glsl b/random.glsl new file mode 100644 index 0000000..039e284 --- /dev/null +++ b/random.glsl @@ -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)