
uniform float time;
uniform vec2 resolution;
uniform float brightness = 1.0;

void main( void ) {

   // vec2 resolution = ( 400.0, 400.0);
   vec2 position = ( gl_FragCoord.xy / resolution.xy ) ;
   vec2 position2 = ( gl_FragCoord.xy /resolution.xx) ;
   vec2 position3 = ( gl_FragCoord.xy /resolution.yy) ;

   float color = 0.5;
   float lcontr= 0.6;
   float lcontr2= 0.4;
   float lcontr3= 0.5;
   float lcontr4= 0.4;
   float lcontr5= 0.5;
   float lcontr6= 0.5;
   float lcontr7= 0.5;
   
   vec2 _lpos = vec2(sin(time)*(cos(time/2.0)), (cos(time))*sin(time)) + vec2(0.5, 0.5);
   vec2 _lpos2 = vec2(sin(time)*(cos(time/2.0)), (cos(time))*sin(time)) + vec2(0.5, 0.5);
   vec2 _lpos3 = vec2(sin(time)*(cos(time/2.0)), (cos(time))*sin(time)) + vec2(0.5, 0.5);
   vec2 _lpos4 = vec2(sin(time)*(cos(time/2.0)), (cos(time))*sin(time)) + vec2(0.5, 0.5);
   vec2 _lpos5 = vec2(sin(time)*(cos(time/2.0)), (cos(time))*sin(time)) + vec2(0.5, 0.5);
   vec2 _lpos6 = vec2(cos(time)*(sin(time/2.5)), (sin(time))*cos(time)) + vec2(0.5, 0.5);
   vec2 _lpos7 = vec2(cos(time)*(sin(time/1.5)), (sin(time*1.2))*cos(time)) + vec2(0.3, 0.6);
   
   lcontr = 0.3 / distance(_lpos,position)*0.3;
   lcontr2 = 0.3 / distance(_lpos2,position + vec2(0.3, 0.3))*0.3;
   lcontr3 = 0.3 / distance(_lpos3,position + vec2(-0.7, -0.1))*0.3;
   lcontr4 = 0.3 / distance(_lpos4,position)*0.4;
   lcontr5 = 0.3 / distance(_lpos5,position)*0.3;
   lcontr6 = 0.3 / distance(_lpos6,position2 + vec2(0.3, 0.1))*0.5;
   lcontr7 = 0.3 / distance(_lpos4,position3)*0.35;
   
   vec4 comet1 = vec4(0.2 + 1.5*tan(sin(4.0*time)),0.1 + 0.1*cos(time),0.1 + 0.5*sin(time),1.0);
   vec4 comet2 = vec4(0.0 - 1.5*sin(sin(0.1+1.0*time)),0.1 - 0.1*sin(0.1+time),0.1 + 0.5*sin(0.1+time),1.0);
   vec4 comet3 = vec4(0.5 + 1.5*tan(cos(4.0*time)),0.5 + 0.1*tan(sin(time)),0.1 + 0.5*cos(time),1.0);
   vec4 comet4 = vec4(0.0 + 0.5*cos(time),0.3 + 0.6*cos(time),0.3 + 9.5*sin(cos(time)),1.0);
   vec4 comet5 = vec4(0.3 + 1.5*sin(cos(4.0*time)),0.1 + 0.1*sin(-sin(time)),0.1 + -0.5*sin(time),1.0);
   vec4 comet6 = vec4(0.3 + 1.5*cos(cos(8.0*time+5.0)),0.2 + 0.1*sin(-sin(time)),0.1 + -0.5*cos(time*6),1.0);
   vec4 comet7 = vec4(0.3 + 1.5*cos(sin(8.0*time+5.0)),0.2 + 0.1*cos(-sin(time)),0.1 + -0.5*sin(time*6),1.0);
   vec4 comet11 = vec4(0.0, comet1.y, comet1.z, -comet1.w);
 

   //gl_FragColor = lcontr * vec4(0.1 + 1.5*tan(sin(4.0*time)),0.1 + 0.1*cos(time),0.1 + 0.5*sin(time),1.0);
   vec4 result = (lcontr * comet1) + 
                  (lcontr2 * comet2) + 
                  (lcontr3 * comet3) + 
                  (lcontr4 * comet4) + 
                  (lcontr5 * comet5) +
                  (lcontr6 * comet6) +
                  (lcontr7 * comet7) +
                  (lcontr * comet11);
  
  gl_FragColor = result.xyzw * brightness;
   
   /*
   gl_FragColor = (lcontr * comet1) + 
                  (lcontr2 * comet2) + 
                  (lcontr3 * comet3) + 
                  (lcontr4 * comet4) + 
                  (lcontr5 * comet5) +
                  (lcontr6 * comet6) +
                  (lcontr7 * comet7) +
                  (lcontr * comet11);

*/
}