2023-09-12 03:21:18 +02:00
|
|
|
#version 330 core
|
2023-11-21 06:45:54 +02:00
|
|
|
in vec2 v_TexCoords;
|
2023-11-26 21:32:19 +02:00
|
|
|
in vec4 textColor;
|
2023-09-12 03:21:18 +02:00
|
|
|
out vec4 FragColor;
|
|
|
|
|
|
|
|
|
|
uniform sampler2D text;
|
|
|
|
|
|
2023-11-23 04:05:15 +02:00
|
|
|
const float smoothness = 0.05;
|
|
|
|
|
const float outlineDistance = 0.50;
|
|
|
|
|
const vec4 outlineColor = vec4(0.0, 0.0, 0.0, 1.0);
|
|
|
|
|
|
2023-09-12 03:21:18 +02:00
|
|
|
void main() {
|
2023-11-23 04:05:15 +02:00
|
|
|
//float distance = texture(text, v_TexCoords).r;
|
|
|
|
|
//float outlineFactor = smoothstep(0.5 - smoothness, 0.5 + smoothness, distance);
|
|
|
|
|
//vec4 color = mix(outlineColor, textColor, outlineFactor);
|
|
|
|
|
//float alpha = smoothstep(outlineDistance - smoothness, outlineDistance + smoothness, distance);
|
|
|
|
|
|
2023-11-21 06:45:54 +02:00
|
|
|
vec4 sampled = vec4(1.0, 1.0, 1.0, texture(text, v_TexCoords).r);
|
2023-11-21 02:52:15 +02:00
|
|
|
FragColor = textColor * sampled;
|
2023-11-23 04:05:15 +02:00
|
|
|
//FragColor = vec4(color.rgb, textColor.a * alpha);
|
2023-09-12 03:21:18 +02:00
|
|
|
}
|