From 0b52a4baa071ddcb6c43470eaafbf267f74463a2 Mon Sep 17 00:00:00 2001 From: Nunuhara Cabbage Date: Thu, 5 May 2022 18:09:51 -0700 Subject: [PATCH] Fix issue with text blend mode The source alpha was being multiplied by itself, making text look thinner than it should. Now we just take the max alpha. --- src/draw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/draw.c b/src/draw.c index 2d14221..d6260c4 100644 --- a/src/draw.c +++ b/src/draw.c @@ -1002,7 +1002,8 @@ void gfx_draw_glyph(Texture *dst, float dx, int dy, Texture *glyph, SDL_Color co fill_data.threshold = 0.001; run_copy_shader(&fill_amap_under_border_shader.s, dst, dst, &fill_data); - glBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glBlendEquationSeparate(GL_FUNC_ADD, GL_MAX); struct copy_data data = STRETCH_DATA( dx, dy, glyph->w * scale_x, glyph->h,