uniform float pixel_size;
varying vec2 v_texCoord;
uniform sampler2D u_texture;
uniform float GAME_SCALE;

void main()
{

	vec4 sum = vec4(0.0);

	vec4 current_pixel = texture2D(u_texture, v_texCoord);

	if(current_pixel.a >= 1.0)
	{
		sum = current_pixel;
	}
	else
	{
		sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y - 4.0*pixel_size)) * 0.08;
		sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y - 3.0*pixel_size)) * 0.09;
		sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y - 2.0*pixel_size)) * 0.12;
		sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y - pixel_size)) * 0.15;
		sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y)) * 0.16;
		sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y + pixel_size)) * 0.15;
		sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y + 2.0*pixel_size)) * 0.12;
		sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y + 3.0*pixel_size)) * 0.09;
		sum += texture2D(u_texture, vec2(v_texCoord.x, v_texCoord.y + 4.0*pixel_size)) * 0.08;
	}



	//Amplify glow effect
	sum *= 1.0 + 3.0;// * (1.0 - GAME_SCALE);

	gl_FragColor = sum;
}