git.s-ol.nu glsl-view / master shaders / test.frag
master

Tree @master (Download .tar.gz)

test.frag @masterraw · history · blame

#version 330 core

in vec2 uv;
out vec4 color;

uniform float offset;
uniform float r = 1.;

uniform float radius = 0.1;

uniform vec3 ball_color;

void main() {
  vec2 p = uv*2.-1.;
  p.y *= 9./16.;

  color = vec4(mod(p.xyx + offset + vec2(0,0.5).xxy, vec3(1)), 1);
  color.r = r;
  color.rgb = mix(color.rgb, ball_color, smoothstep(1, 0.9, length(p) / radius));
}