Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #version 410 core
- 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
- uniform sampler2D texTex1;
- uniform sampler2D texTex2;
- uniform sampler2D texTex3;
- uniform sampler2D texTex4;
- uniform sampler2D texNoise;
- uniform sampler2D texChecker;
- layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything
- const float pi = 2 * atan(1);
- void rot (inout vec2 uv, float alpha)
- {
- uv = uv * cos(alpha) + vec2(uv.y, -uv.x) * -sin(alpha);
- }
- void main(void)
- {
- vec2 uv = vec2(gl_FragCoord.x / v2Resolution.x, gl_FragCoord.y / v2Resolution.y);
- uv -= 0.5;
- uv /= vec2(v2Resolution.y / v2Resolution.x, 1);
- vec2 uv2 = uv;
- uv = abs(uv*1.3);
- //uv.y*=smoothstep(0.0, 0.4, length(uv))*(cos(fGlobalTime*0.001)*0.5+1.6);
- uv = vec2(length(uv)- uv.y*0.02, smoothstep(0, 1, uv.y)*(cos(fGlobalTime*0.001)*0.5+1.6));
- rot(uv, cos(fGlobalTime)*pi*2);
- uv *= uv / pi * 2 * (cos(fGlobalTime*0.05)*0.3+0.5);
- uv += uv / pi * 0.2 * (sin(texture(texFFT, 0.3).x*0.05)*0.3+0.5);
- uv -= uv / pi * 0.2 * (cos(texture(texFFT, 0.3).x*0.5)*0.3+0.5);
- rot(uv, texture(texFFTSmoothed, 0.02).x*500 * (sin(fGlobalTime*0.005)*0.5-0.5));
- uv.x*=sin(length(uv));
- out_color = vec4(0);
- vec2 center = vec2(texture(texFFTSmoothed, 0.02).x * 3.5 / (length(uv)*100000000)+sin(texture(texFFT, 0.01).x)*0.2+0.2, texture(texFFTSmoothed, 0.7).x * 140 / length(uv)*0.000000001);
- float c = distance(uv, center);
- out_color += texture(texChecker, vec2(1-c))*0.3 + (sin(fGlobalTime) * 0.1 - 0.5) * 0.6+0.4;
- rot(uv, 0.04);
- c = distance(uv, center);
- out_color += texture(texTex4, vec2(c+.4, c))*0.3+0.3;
- rot(uv, 0.04 * mod(fGlobalTime, 0.1));
- c = distance(uv, center);
- out_color += texture(texTex4, vec2(c+.4, c))*0.3;
- center = vec2(texture(texFFTSmoothed, 0.2).x * 3, texture(texFFTSmoothed, 0.4).x * 30);
- c = distance(uv, center);
- out_color += texture(texTex4, vec2(-c-.1)*0.001)*0.2;
- out_color -= c * 0.75;
- out_color.rgb = pow(out_color.rgb, vec3(0.4));
- out_color.b += 0.5-sin(texture(texFFTSmoothed, 0.03).x)*0.5+0.5*c - uv.x;
- out_color = abs(out_color) * 0.4;
- out_color.rgb -= vec3(length(uv))*0.75;
- float m = max(max(max(out_color.r, out_color.g), out_color.b), 1);
- out_color.rgb = normalize(out_color.rgb)/m;
- vec3 scene2 = vec3(0);
- scene2 += pow((1- length(uv2)), 19)*0.5;
- scene2 += texture(texNoise, uv2+mod(fGlobalTime*0.1,1)).rgb*0.5;
- scene2 = pow(scene2, vec3(2));
- out_color.rgb = mix(out_color.rgb, scene2, smoothstep(1, 0, (length(uv2)*100-30*pow(texture(texFFTSmoothed, 0.0015).x, .5)-5)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement