varying vec2 center_vec;
float PI2 = radians(360.0);
void vert ()
{
center_vec = TexCoord - center;
//Multiply by x/y ratio so we see a sphere on the screen
//instead of an ellipse.
center_vec.y *= Texture0Info.y / Texture0Info.x;
}
1.0) {
texc = TexCoord;
} else {
float r = PI2 * (1.0 - dist_to_center);
float distortion = sin(r * (100.0-ripples) + radians(phase));
texc = TexCoord - ( TexCoord - center ) * distortion * height / 800.0;
}
if ( texc.x < 0.0 || texc.x > 1.0 || texc.y < 0.0 || texc.y > 1.0 )
gl_FragColor = vec4(0.0);
else
colorOutput(texture2D_0(texc));
}
]]>