mirror of
https://github.com/CookieCollective/Live-Coding-Sources.git
synced 2025-07-15 05:55:03 +02:00
39 lines
1.1 KiB
GLSL
39 lines
1.1 KiB
GLSL
#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 cookie;
|
|
uniform sampler2D texChecker;
|
|
uniform sampler2D texNoise;
|
|
uniform sampler2D texTex1;
|
|
uniform sampler2D texTex2;
|
|
uniform sampler2D texTex3;
|
|
uniform sampler2D texTex4;
|
|
|
|
layout(location = 0) out vec4 out_color; // out_color must be written in order to see anything
|
|
|
|
#define time fGlobalTime
|
|
|
|
mat2 rot (float a) { float c=cos(a),s=sin(a); return mat2(c,-s,s,c); }
|
|
|
|
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);
|
|
uv.y *= -1.0;
|
|
float d = length(uv);
|
|
uv *= 2. + 0.2 * sin(time + d*4.);
|
|
uv *= rot(sin(time*2.-d*2.)*.2);
|
|
uv += 0.5;
|
|
|
|
|
|
vec4 color = texture(cookie, uv);
|
|
color.rgb = mix(vec3(0), vec3(1), color.a);
|
|
|
|
out_color = color;
|
|
} |