Skip to content

Commit

Permalink
fix broken 2D light blending, addresses godotengine#49922
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbrain committed Sep 24, 2022
1 parent f74491f commit 2047be4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions servers/rendering/renderer_rd/shaders/canvas.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,8 @@ void main() {
color = vec4(0.0); //invisible by default due to using light mask
}

vec4 original_color = color;

#ifdef MODE_LIGHT_ONLY
color = vec4(0.0);
#else
Expand Down Expand Up @@ -636,6 +638,8 @@ void main() {
);
}

light_color.rgb *= original_color.rgb;

light_blend_compute(light_base, light_color, color.rgb);
}

Expand Down Expand Up @@ -732,6 +736,8 @@ void main() {
);
}

light_color.rgb *= original_color.rgb;

light_blend_compute(light_base, light_color, color.rgb);
}
#endif
Expand Down

0 comments on commit 2047be4

Please sign in to comment.