Disable DepthTest when drawing glyphs+move shared glyph draw logic

With depth testing enabled nearby glyphs can z-fight
and so some pixels might be discarded before fragment shader
even runs, which causes us to see only part of a letter.

As such we always draw with blending enabled and depth testing
disabled so that any overlaps simply causes the char pixels to show.
This commit is contained in:
bloeys
2022-07-08 06:33:20 +04:00
parent 2b71337c4a
commit 2da4b7a53d
5 changed files with 101 additions and 166 deletions

View File

@ -46,7 +46,7 @@ uniform sampler2D diffTex;
void main()
{
vec4 texColor = texelFetch(diffTex, ivec2(v2fUV0), 0);
// vec4 texColor = texture(diffTex, v2fUV0);
// This commented out part highlights the full region of the char
// if (texColor.r == 0)
// {
// fragColor = vec4(0,1,0,0.25);