#version 130

uniform vec2 screenSize;

flat in vec2 pos;
flat in vec4 values;

float computeDist(in vec2 scrPos)
{
	vec2 diff=scrPos-pos;
	return dot(diff,diff);
}

void main()
{
    vec2 screenPos=gl_FragCoord.xy;
    float dist=computeDist(screenPos+vec2(0.1294,0.4829));
    dist+=computeDist(screenPos+vec2(0.3535,-0.3535));
    dist+=computeDist(screenPos+vec2(-0.4829,-0.1294));
    gl_FragColor=(3/dist)*values/(256);
}