diff semiconginev2/text.nim @ 1241:a0ed1a918fda

fix: letters sometimes overlapping other letters quad
author sam <sam@basx.dev>
date Mon, 22 Jul 2024 12:51:50 +0700
parents 176383220123
children
line wrap: on
line diff
--- a/semiconginev2/text.nim	Mon Jul 22 12:42:35 2024 +0700
+++ b/semiconginev2/text.nim	Mon Jul 22 12:51:50 2024 +0700
@@ -42,7 +42,11 @@
   fragmentUv = uv;
 }  """
     fragmentCode = """void main() {
-    color = vec4(textbox.color.rgb, textbox.color.a * texture(fontAtlas, fragmentUv).r);
+    float v = texture(fontAtlas, fragmentUv).r;
+    if(v == 0) {
+      discard;
+    }
+    color = vec4(textbox.color.rgb, textbox.color.a * v);
 }"""