in lowp vec4 colorV;
out vec4 fragColor;
in lowp vec2 tc;
in lowp float aspect;
in lowp float phz;
in lowp float dpth;
in lowp float fdbk;

float clip(float x)
{
    return max(0.0, min(1.0, x*8.0));
}   
void main()
{

    vec2 d = tc - vec2(0.5);
    d.y += 0.1;
    d.y *= aspect;
    float a = length(d);

    float angle = atan(d.y, d.x);
    angle -= a*dpth*3.0;
    //float dpth =0.5;
    a = a * (1.0 - dpth) + a * dpth*(0.8 + 0.2* sin(angle*fdbk - phz));
    
    a = clip(sin(a*40.0-phz)) * (1.0 - smoothstep(0.8, 1.2, a));

    fragColor = colorV;
    fragColor.a = a;
}
