Private GLSL utility functions
Go to file
2022-04-20 20:13:10 +09:00
src clean up. 2022-04-20 20:13:10 +09:00
LICENSE added LICENSE file. 2022-04-20 19:35:24 +09:00
package.json updated package.json 2022-04-20 19:40:42 +09:00
README.md Update README.md 2019-07-08 15:33:04 +09:00

glsl-util

utility functions of glsl.
these functions are dependent by glslify.

install

npm i git://github.com/ykob/glsl-util.git

usage

convertHsvToRgb(vec3 hsv)

convert HSV to RGB.
http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl

#pragma glslify: convertHsvToRgb = require(glsl-util/convertHsvToRgb);

convertRgbToHsv(vec3 rgb)

convert RGB to HSV.
http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl

#pragma glslify: convertRgbToHsv = require(glsl-util/convertRgbToHsv);

random(vec2 p)

calculate white noise.

#pragma glslify: random = require(glsl-util/random);

polar(float radian1, float radian2, float radius)

calculate polar coordinates.

#pragma glslify: polar = require(glsl-util/polar);

gaussianBlur(sampler2D texture, vec2 uv, float radius, vec2 resolution, vec2 direction)

calculate the Gaussian blur.

#pragma glslify: gaussianBlur = require(glsl-util/gaussianBlur);

lookAt(vec3 base, vec3 p1, vec3 p2, vec3 up)

rotate a vector in any direction.

#pragma glslify: lookAt = require(glsl-util/lookAt);

rotateAxisAngle(vec3 p, vec3 axis, float angle)

rotate a vector by any axis and angle.

#pragma glslify: rotateAxisAngle = require(glsl-util/rotateAxisAngle);