Files
cudoku/shaders/font.frag
T

22 lines
695 B
GLSL
Raw Normal View History

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;
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() {
//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);
FragColor = textColor * sampled;
//FragColor = vec4(color.rgb, textColor.a * alpha);
2023-09-12 03:21:18 +02:00
}