exhibit ui
[laserbrain_demo] / sdr / dfont.p.glsl
diff --git a/sdr/dfont.p.glsl b/sdr/dfont.p.glsl
new file mode 100644 (file)
index 0000000..dad3080
--- /dev/null
@@ -0,0 +1,12 @@
+uniform sampler2D tex;
+
+void main()
+{
+       const float softness = 0.008;
+
+       float alpha = texture2D(tex, gl_TexCoord[0].st).a;
+       float mask = smoothstep(0.5 - softness, 0.5 + softness, alpha);
+
+       gl_FragColor.rgb = gl_Color.rgb;
+       gl_FragColor.a = mask;
+}