#version 120
varying vec2 texCoord;

uniform sampler2D colorMap;
//uniform int abc;
uniform float anim1;
uniform float anim2;
uniform float anim3;
uniform float anim4;
uniform float xs;
uniform float ys;
uniform float zoom;

void main (void)
{
vec4 color;
    float x=(texCoord.x+sin(xs))*1920*zoom/5.0f;
    float y=(texCoord.y+ys)*1080*zoom/5.0f;
    float w=1.0f;
    float h=1.0f;
    float a1=anim1;
    float a2=anim2;
    float a3=anim3;
    float a4=anim4;
    float c1 =
    (
        128.0 + (128.0 * sin(x / 16.0+a1))
      + 128.0 + (128.0 * sin(y / 32.0))
      + 128.0 + (128.0 * sin(sqrt(((x - w / 2.0)* (x - w / 2.0) + (y - h / 2.0) * (y - h / 2.0))) / 8.0 ))
      + 128.0 + (128.0 * cos(sqrt((x * x + y * y)) / 8.0+a2))
    ) / 4 /256.0f;

    float c2=
    (
        128.0 + (128.0 * sin(x / 16.0))
      + 128.0 + (128.0 * sin(y / 8.0+a3))
      + 128.0 + (128.0 * sin((y) / 16.0)+a4)
      + 128.0 + (128.0 * sin(sqrt((x * x + y * y)) / 8.0))
    ) / 4/256.0f;


    //plasma[y][x] = color;
	//gl_FragColor = texture2D(colorMap, texCoord);

	//color=vec4(c,c,c,1.0f);
	color=texture2D(colorMap,vec2(c1,c2));
	gl_FragColor=color;
}
