#version 330 core
in vec2 vUV; out vec4 FragColor; uniform float uTime; uniform float uAlpha; void main(){ vec2 uv = vUV * 2.0 - 1.0; float t = uTime; vec2 ball1 = vec2(sin(t * 1.2) * 0.3, cos(t * 1.5) * 0.3); vec2 ball2 = vec2(cos(t * 0.8) * 0.4, sin(t * 1.1) * 0.2); vec2 ball3 = vec2(sin(t * 1.5 + 2.0) * 0.25, cos(t * 0.9) * 0.35); vec2 ball4 = vec2(cos(t * 1.3 + 3.0) * 0.35, sin(t * 1.4) * 0.25); vec2 ball5 = vec2(sin(t * 0.7) * 0.2, cos(t * 1.6) * 0.3); float m = 0.0; m += 0.15 / length(uv - ball1); m += 0.12 / length(uv - ball2); m += 0.18 / length(uv - ball3); m += 0.14 / length(uv - ball4); m += 0.16 / length(uv - ball5); vec3 color1 = vec3(0.1, 0.2, 0.8); vec3 color2 = vec3(1.0, 0.3, 0.2); vec3 color3 = vec3(1.0, 1.0, 1.0); vec3 col = mix(color1, color2, smoothstep(0.8, 1.5, m)); col = mix(col, color3, smoothstep(1.5, 2.5, m)); col += vec3(0.2, 0.1, 0.05) * m * 0.5; col = clamp(col, 0.0, 1.0); FragColor = vec4(col, uAlpha); }