uniform float fGlobalTime; // in seconds
uniform vec2 v2Resolution; // viewport resolution (in pixels)
uniform sampler1D texFFT; // towards 0.0 is bass / lower freq, towards 1.0 is higher / treble freq
uniform sampler1D texFFTSmoothed; // this one has longer falloff and less harsh transients
uniform sampler1D texFFTIntegrated; // this is continually increasing
layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything
#define FK(k) floatBitsToInt(cos(k))^floatBitsToInt(k)
float hash(vec2 p) {
int x = FK(p.x);int y = FK(p.y);
return float((x*x-y)*(y*y+x)-x)/2.14e9;
}
float maze(vec2 p) {
vec2 id = floor(p);
float sgn = sign(hash(id));
p = fract(p)-0.5;
return abs(abs(p.x+p.y*sgn)-0.5)/sqrt(2);
}
float linedist(vec2 p, vec2 a, vec2 b) {
return distance(p, mix(a, b, clamp(dot(p-a,b-a)/dot(b-a,b-a),0,1)));
}