#version 330 core
in vec2 TexCoord;
out vec4 FragColor;
uniform sampler2D uText;
uniform vec4 uColor;
uniform vec4 uOutlineColor;
uniform float uOutlineWidth = 0.7;
void main() {
	float dist = texture(uText, TexCoord).r;
	float outline = smoothstep(0.5 - uOutlineWidth, 0.5 + uOutlineWidth, dist);
	float text = smoothstep(0.5, 0.5 + 0.1, dist);
	float glow = exp(-pow(dist - 0.5, 2.0) / 0.02);
	FragColor = vec4(uColor.rgb * (text + glow * 0.6), uColor.a * outline);
}