
#version 120
uniform sampler2D tex0;
uniform float line_size;
uniform float time;
uniform float arc_x;
uniform float noise_scale;
uniform vec4 bkgcolor;
uniform vec4 arc_color1;
uniform vec4 arc_color2;


void main (void)
{
  vec2 uv = gl_TexCoord[0].xy;
  vec3 c = bkgcolor.rgb;

  vec2 uv2 = uv*vec2(1.0, 2.0) + vec2(time*0.8, time*0.8);
  float noise = texture2D(tex0,uv2).r;

  float lsize =  ((noise*2.0) - 1.0) * noise_scale;

  if ((uv.x > arc_x - (line_size + lsize)) && (uv.x < arc_x + (line_size - lsize)))
  {
    c = mix(arc_color1.rgb, arc_color2.rgb, uv.y);
  }

  gl_FragColor = vec4(c, 1.0);
}

