You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
530 B
GLSL

#version 330 core
in vec2 uv;
out vec4 color;
// provided by default
uniform float iTime; // seconds since start
uniform vec2 iResolution;
// modifiable via OSC
uniform float offset;
uniform float r = 1.0;
uniform float radius = 0.2;
uniform vec4 ball_color = vec4(.1,.1,.1,.9);
void main() {
vec2 p = uv*2.-1.;
p.y *= iResolution.y / iResolution.x;
color = vec4(mod(p.xyx + vec3(0, sin(iTime)/6, offset), vec3(1)), 0.4);
color.r = r;
color.rgba = mix(color, ball_color, smoothstep(1, 0.99, length(p) / radius));
}