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
vec4 plas( vec2 v, float time )
{
float c = 0.5 + tan( v.x * 10.0 ) + tan( sin( time + v.y ) * 20.0 );
return vec4( sin(c * 0.2 + cos(time)), c * 0.15, cos( c * 0.1 + time / .4 ) * .25, 1.0 );
}
float scene (vec3 p ){
float c = 2;
p = mod(p , c) - (c * 0.5);
float s = length(p) - texture(texFFTIntegrated, p.x).x;
float g = p.y + sin(p.y * 4);
return min(s,g);
}
vec4 trace(vec3 ro, vec3 dir ){
float d = 0;
vec3 p = ro;
float td = 0;
for (int i = 0 ; i < 8 ; i++){
d = scene(p);
p = p + dir * d;
if (d < 0.004){
return vec4(td/10);