precision mediump float;
uniform sampler2D Texture;
varying vec2 texCoord;
varying float fogDistance;

void main()
{
	vec4 color = texture2D(Texture,texCoord).rgba;

	if(color.a < 0.1)
        discard;

	vec3 fogColor = vec3(0.53, 0.81, 0.92);
	float fogFactor = clamp((fogDistance - 30.0) / 10.0, 0.0, 1.0);
	vec3 finalColor = mix(color.rgb, fogColor, fogFactor);

	gl_FragColor = vec4(finalColor, color.a);
}
