diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-08-26 11:59:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-26 11:59:07 +0200 |
commit | 7013c68619dcd42d03497b538f141ad585535e08 (patch) | |
tree | 168fee4498bfc27ca64b4e1e517333b11de89655 /drivers/gles3/shaders | |
parent | 354123a207e737fd6014b6ff17445ab66aa28787 (diff) | |
parent | bcc3643989762a6814f1f0c5a4b63a0e66d6286c (diff) |
Merge pull request #64422 from bruvzg/make_fonts_unbearably_ugly_2.0
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r-- | drivers/gles3/shaders/canvas.glsl | 8 | ||||
-rw-r--r-- | drivers/gles3/shaders/canvas_uniforms_inc.glsl | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gles3/shaders/canvas.glsl b/drivers/gles3/shaders/canvas.glsl index 4df818cd4c..5ec25327be 100644 --- a/drivers/gles3/shaders/canvas.glsl +++ b/drivers/gles3/shaders/canvas.glsl @@ -473,7 +473,13 @@ void main() { float a = clamp(d * px_size + 0.5, 0.0, 1.0); color.a = a * color.a; } - + } else if (bool(draw_data[draw_data_instance].flags & FLAGS_USE_LCD)) { + vec4 lcd_sample = texture(color_texture, uv); + if (lcd_sample.a == 1.0) { + color.rgb = lcd_sample.rgb * color.a; + } else { + color = vec4(0.0, 0.0, 0.0, 0.0); + } } else { #else { diff --git a/drivers/gles3/shaders/canvas_uniforms_inc.glsl b/drivers/gles3/shaders/canvas_uniforms_inc.glsl index 852dccf415..6b61fe9375 100644 --- a/drivers/gles3/shaders/canvas_uniforms_inc.glsl +++ b/drivers/gles3/shaders/canvas_uniforms_inc.glsl @@ -25,6 +25,7 @@ #define FLAGS_DEFAULT_SPECULAR_MAP_USED uint(1 << 27) #define FLAGS_USE_MSDF uint(1 << 28) +#define FLAGS_USE_LCD uint(1 << 29) // must be always 128 bytes long struct DrawData { |