Slots
Options
left
center
right
black = vec3(0.0);white = vec3(1.0);red = vec3(0.86,0.22,0.27);orange = vec3(0.92,0.49,0.07);yellow = vec3(0.91,0.89,0.26);green = vec3(0.0,0.71,0.31);blue = vec3(0.05,0.35,0.65);purple = vec3(0.38,0.09,0.64);pink = vec3(.9,0.758,0.798);lime = vec3(0.361,0.969,0.282);teal = vec3(0.396,0.878,0.878);
resolution = vec2(canvas width, canvas height); // value in pixels,// divided by pixel// sizetime = float; // system timemouse = vec4(mouse X, mouse Y, mouse click X, mouse click Y);date = vec4();bands = vec4(low, mid-low, mid-high, high) // FFT resultsbackbuffer = texture2D; // previous render frame
PI = 3.14159;PI2 = 6.28318;uv() = vec2(x, y); // This pixel on screen when// coordinate system is: width// -width/height to width/height//, height -1.0 to 1.0;// center of canvas is originuvN() = vec2(x, y); // this pixel on screen when// coordinate system is: width// 0.0 to 1.0, height 0.0 to 1.0;// bottom-left of canvas is originrand(float x) = float // pseudo-random 0.0 to 1.0rand(vec2 x) = floatnoise( float ) = float // noise 0.0 to 1.0noise( vec2 ) = floatnoise( vec3 ) = floatsnoise( vec2 ) = float // signed noise -1.0 to 0.0snoise( vec3 ) = floatturbulence( vec2,float octaves ) = float //returns random values 0.0 to 1.0voronoi( vec2 ) = float // returns 0.0 to 1.0 with a smooth// voronoi patternvoronoi( vec3 ) = vec3 // returns a vec3 voronoi in three dimensionsfbm(float x, int it) = float // Brownian motion function generator// second parameter is number of iterationsfbm(vec2 x, int it) = floatfbm(vec3 x, int it) = floatrmf(vec2 x, int it) = float // rigid multi-fractal generator// second parameter is number of iterationsvrmf(vec2 x, int it) = float // Voronoi version of rigid multi-fractal// second parameter is number of iterationsvmbf(vec2 x, int it) = float // Voronoi version of Brownian motion// second parameter is number of iterationshsv2rgb( vec3 ) = vec3 // convert hue, saturation, value to// red, green, bluerotate(vec2 pivot,vec2(x, y),float amount)box(vec2(x, y),vec2(width, height),float corner-roundness,float edge-feathering);circle(float x,float y,float radius,float edge-feathering);swirl(float time, vec2 p); //agressive swirling texture
// list of common gles math functionsradians(x) // degrees to radiansdegrees(x) // radians to degreessin(x) // sine of anglecos(x) // cosine of angletan(x) // tangent of angleasin(x) // arc sine of angleacos(x) // arc cosine of angleatan(y, x) // arc tangent of (y, x)atan(y_over_x) // arc tangent of y/xmamatrixCompMult(max, may) // multiply x by y component-wisepow(x, y) // x to y exponent; x^yexp(x) // exlog(x) // natural logexp2(x) // 2xlog2(x) // log base 2sqrt(x) // square root; x^(1/2)inversesqrt(x) // inverse square root; 1/(x^(1/2))abs(x) // absolute valuesign(x) // returns -1.0, 0.0, or 1.0floor(x) // nearest integer less than xceil(x) // nearest integer greater than xfract(x) // x - floor(x)mod(x, y) // modulusmin(x, y) // minimum valuemax(x, y) // maximum valueclamp(x, // keep x between minVal and maxValminVal,maxVal)mix(x, y, a) // linear blend of x and y using a. (lerp)step(edge, x) // 0.0 if x less than edge, else 1.0smoothstep(edge0, // clip and smoothedge1,x)sinN(float) //sin normalized to [0, 1]cosN(float) //cos normalized to [0, 1]
gl_FragCoord = vec4(x, y, z, w) // fragment position within// frame buffer window coordinatesgl_FragColor = vec4(r, g, b, a) // fragment colortexture2D(tex, vec2) = vec4(r, g, b, a) // tex is a texture: channel0 ...// channel3 or backbuffer
forf = for(float i = 0.0; i < float; i++){}fori = for(int i = 0; i < int; i++){}iff = if(false){}vc = vec2vvc = vec3ft = float
// Created by: Shawn Lawson, http://shawnlawson.com// Github Respository: https://github.com/shawnlawson/The_Force