diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-26 22:51:30 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-26 22:51:30 +0100 |
commit | db9da06675e2774dda520fb0ce8cbf66f154175c (patch) | |
tree | 3d59017b28aaf2fbb9329afd9aaddc328c42bc75 | |
parent | c250f6eeb6c7c3bd0936cd9c4abc7162d02db5d8 (diff) | |
parent | 653799bb38ac741e4b2df69e5dc56162a94d482d (diff) |
Merge pull request #72125 from bruvzg/aa_lcd_gl
Fix LCD font AA on OpenGL renderer.
-rw-r--r-- | drivers/gles3/rasterizer_canvas_gles3.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 89b1c1889e..fbe00d22af 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -853,18 +853,19 @@ void RasterizerCanvasGLES3::_record_item_commands(const Item *p_item, RID p_rend state.instance_data_array[r_index].flags = base_flags | (state.instance_data_array[r_index == 0 ? 0 : r_index - 1].flags & (FLAGS_DEFAULT_NORMAL_MAP_USED | FLAGS_DEFAULT_SPECULAR_MAP_USED)); //reset on each command for sanity, keep canvastexture binding config - Color blend_color; + Color blend_color = base_color; + GLES3::CanvasShaderData::BlendMode blend_mode = p_blend_mode; if (c->type == Item::Command::TYPE_RECT) { const Item::CommandRect *rect = static_cast<const Item::CommandRect *>(c); if (rect->flags & CANVAS_RECT_LCD) { - p_blend_mode = GLES3::CanvasShaderData::BLEND_MODE_LCD; + blend_mode = GLES3::CanvasShaderData::BLEND_MODE_LCD; blend_color = rect->modulate * base_color; } } - if (p_blend_mode != state.canvas_instance_batches[state.current_batch_index].blend_mode || blend_color != state.canvas_instance_batches[state.current_batch_index].blend_color) { + if (blend_mode != state.canvas_instance_batches[state.current_batch_index].blend_mode || blend_color != state.canvas_instance_batches[state.current_batch_index].blend_color) { _new_batch(r_batch_broken, r_index); - state.canvas_instance_batches[state.current_batch_index].blend_mode = p_blend_mode; + state.canvas_instance_batches[state.current_batch_index].blend_mode = blend_mode; state.canvas_instance_batches[state.current_batch_index].blend_color = blend_color; } |