basic: added a color spinner; utilities: added translations of inigo quilez' functions; weird: added psychedelic stars
This commit is contained in:
27
utilities/inigo.glsl
Normal file
27
utilities/inigo.glsl
Normal file
@@ -0,0 +1,27 @@
|
||||
// Translation (from C) of utility functions Inigo Quilez
|
||||
// explains in http://www.iquilezles.org/www/articles/functions/functions.htm
|
||||
float almostIdentity(float x, float m, float n) {
|
||||
if(x > m) return x;
|
||||
|
||||
float a = 2.*n - m;
|
||||
float b = 2.0*m - 3.0*n;
|
||||
float t = x/m;
|
||||
|
||||
return (a*t + b)*t*t + n;
|
||||
}
|
||||
|
||||
float impulse(float k, float x) {
|
||||
float h = k * x;
|
||||
return h*exp(1.0-h);
|
||||
}
|
||||
|
||||
float cubic_pulse(float c, float w, float x) {
|
||||
x = abs(x - c);
|
||||
if(x > w) return .0;
|
||||
x /= w;
|
||||
return 1.0 - x*x*(3.0-2.0*x);
|
||||
}
|
||||
|
||||
float parabola(float x, float k) {
|
||||
return pow(4.0*x*(1.0-x), k);
|
||||
}
|
Reference in New Issue
Block a user