#version 430 core
in vec2 texPos;
in vec2 texDist;
in float gfactor;
in vec2 vcpos;
out vec4 fColor;
layout (binding = 1) uniform sampler2D screenTexture;
float f ( float x) {
 if (x>1) {return 1;} else {return (1-gfactor)*x + gfactor;}
}
void main()
{
    float t = f(length(texDist));
    fColor = vec4(texture(screenTexture 
                , 0.5+0.5 *( vcpos + t * (texPos - vcpos))
                ) 
                );
}
