#version 330
in  vec2 tc;
out vec4 oc;
uniform sampler2D tx;
uniform float t, tt;
void main(void) {
  float it=2048.0*(1.-pow(t,0.5));
  vec2  d=tc-vec2(0.5);
  //vec2  ti=vec2(ivec2(tc*it))/it;
         d=vec2(ivec2( d*it))/it;
  float ld=length(d),a=atan(d.y, d.x)+tt/(1.+ld);
  vec2  ct=vec2(0.5+ld*cos(a),0.5+ld*sin(a));
  //ct=vec2(ivec2(ct*it))/it;
  oc=texture(tx,ct);
  oc=vec4(oc.r,oc.r*t,oc.r*t,1.);
}
