#version 430 core in vec2 cenPos; in vec2 texPos; in vec2 texDist; in float factor; out vec4 fColor; layout (binding = 1) uniform sampler2D screenTexture; float f ( float x) { return max (1, 1 / (2 * x + 0.5)) ; // return min (1, x) ; } void main() { vec4 tColor = vec4(texture(screenTexture , texPos) ); float t = distance(cenPos,texDist); fColor = vec4(tColor.xy,t,tColor.w); //, cenPos + f(distance(cenPos,texDist)) * (texPos - cenPos))) ; }