1
0
Fork 0
mirror of https://github.com/bjornbytes/lovr.git synced 2024-07-02 12:33:52 +00:00

Fix font shader in WebGL;

This commit is contained in:
bjorn 2017-07-22 16:57:09 -07:00
parent abaecb7f60
commit 12700f9785

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"