Fix font shader in WebGL;

This commit is contained in:
bjorn 2017-07-22 16:57:09 -07:00
parent abaecb7f60
commit 12700f9785
1 changed files with 2 additions and 2 deletions

View File

@ -71,8 +71,8 @@ const char* lovrFontFragmentShader = ""
" return max(min(r, g), min(max(r, g), b)); \n"
"} \n"
"vec4 color(vec4 graphicsColor, sampler2D image, vec2 uv) { \n"
" vec3 sample = texture(image, uv).rgb; \n"
" float sdf = median(sample.r, sample.g, sample.b); \n"
" vec3 col = texture(image, uv).rgb; \n"
" float sdf = median(col.r, col.g, col.b); \n"
" float w = fwidth(sdf); \n"
" float alpha = smoothstep(.5 - w, .5 + w, sdf); \n"
" if (alpha < .001) { discard; } \n"