implemented unicode support and generation of font atlas texture

This commit is contained in:
2023-11-23 04:05:15 +02:00
parent 9b5b8847e6
commit 11bca0e5a4
11 changed files with 2064 additions and 59 deletions
+10
View File
@@ -5,7 +5,17 @@ out vec4 FragColor;
uniform sampler2D text;
uniform vec4 textColor;
const float smoothness = 0.05;
const float outlineDistance = 0.50;
const vec4 outlineColor = vec4(0.0, 0.0, 0.0, 1.0);
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);
vec4 sampled = vec4(1.0, 1.0, 1.0, texture(text, v_TexCoords).r);
FragColor = textColor * sampled;
//FragColor = vec4(color.rgb, textColor.a * alpha);
}