diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-27 09:57:44 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-09-27 09:57:44 +0200 |
commit | 2ad63f68b39717c313022864fce2b831ab41fe1b (patch) | |
tree | 09e24ada4367783449de4eefdd536cda612ab48c /servers/rendering | |
parent | ed65f903ff98172bbd2514511d534197ce768bc1 (diff) | |
parent | 2047be4516890fe12dfc2d2f3fb40048fd1891dc (diff) |
Merge pull request #66370 from bitbrain/fix-light2d-blend-modes
Fix broken 2D light blending, addresses #49922
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/renderer_rd/shaders/canvas.glsl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/servers/rendering/renderer_rd/shaders/canvas.glsl b/servers/rendering/renderer_rd/shaders/canvas.glsl index a3734a7218..f24d90a032 100644 --- a/servers/rendering/renderer_rd/shaders/canvas.glsl +++ b/servers/rendering/renderer_rd/shaders/canvas.glsl @@ -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); #elif !defined(MODE_UNSHADED) @@ -636,6 +638,8 @@ void main() { ); } + light_color.rgb *= original_color.rgb; + light_blend_compute(light_base, light_color, color.rgb); } @@ -732,6 +736,8 @@ void main() { ); } + light_color.rgb *= original_color.rgb; + light_blend_compute(light_base, light_color, color.rgb); } #endif |