#version 130

uniform sampler2D tex;
uniform vec2 shipPos;

void main()
{
    vec4 pixel=texture(tex,gl_TexCoord[0].xy);
    vec2 dPos=shipPos-gl_TexCoord[0].xy*vec2(240,320);
    float alpha=max(0.2,1-1024/dot(dPos,dPos));
    pixel.a*=alpha;
    gl_FragColor=gl_Color*pixel;
}