diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-08-12 14:03:28 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-08-23 08:47:21 +0300 |
commit | bcc3643989762a6814f1f0c5a4b63a0e66d6286c (patch) | |
tree | 186cddd06e0dcadddc04214954fe8e19f6f3f2ba /drivers/gles3/shaders/canvas.glsl | |
parent | 230225d360ee152e9ed6120b62af915e9a844d04 (diff) |
Add font LCD sub-pixel anti-aliasing support.
Diffstat (limited to 'drivers/gles3/shaders/canvas.glsl')
-rw-r--r-- | drivers/gles3/shaders/canvas.glsl | 8 |
1 files changed, 7 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 { |