Skip to content

Commit

Permalink
Fix clear color's alpha value will affects 2D editor in Compatibility…
Browse files Browse the repository at this point in the history
… mode

When the rt's transparency is false, force the alpha of the clear color to one
  • Loading branch information
jsjtxietian committed Sep 7, 2023
1 parent f7c48cf commit e21a485
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gles3/rasterizer_canvas_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2115,7 +2115,7 @@ void RasterizerCanvasGLES3::canvas_begin(RID p_to_render_target, bool p_to_backb

if (render_target && render_target->clear_requested) {
const Color &col = render_target->clear_color;
glClearColor(col.r, col.g, col.b, col.a);
glClearColor(col.r, col.g, col.b, render_target->is_transparent ? col.a : 1.0f);

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
render_target->clear_requested = false;
Expand Down

0 comments on commit e21a485

Please sign in to comment.