#version 120

varying vec2 pos_out;

uniform float time;

/*
vec3 palette(float t) {
  vec3 a = vec3(0.5, 0.5, 0.5);
  vec3 b = vec3(0.5, 0.5, 0.5);
  vec3 c = vec3(1.0, 1.0, 1.0);
  vec3 d = vec3(0.263, 0.416, 0.557);

  return a + b * cos(6.28318548202514648438 * (c * t + d));
}
*/

void main()
{
  vec2 uv = pos_out;
  //gl_FragColor = vec4(uv, 0, 1);
  //gl_FragColor = gl_Color;
  float d = length(uv);

  //d -= 0.5;
  //d = abs(d);
  //d = step(0.1, d);
  //d = smoothstep(0.0, 0.1, d);

  gl_FragColor = vec4(d, 0, 0, 1);

  /*
  vec3 col = vec3(1.0, 2.0, 3.0);

  d = sin(d * 8.0 + time)/8.0;
  d = abs(d);
  d = 0.02 / d;

  col *= d;

  gl_FragColor = vec4(col, 1);
  */
  /*
  vec3 col = palette(d + time);

  d = sin(d * 8.0 + time)/8.0;
  d = abs(d);
  d = 0.02 / d;

  col *= d;

  gl_FragColor = vec4(col, 1);
  */
}
