From 35c5ccce9e3f098de1a305027899c36074089b06 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Sat, 24 Apr 2021 10:21:33 +0100 Subject: [PATCH] Batching - GLES3 fix light pass modulates The final_modulate was incorrectly being set in the uniform on light passes in GLES3 in situations where color was baked in the vertices. This was already correct in GLES2. This PR makes prevents setting final_modulate in this situation. --- drivers/gles3/rasterizer_canvas_gles3.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp index 0b480e43e77..967149ae557 100644 --- a/drivers/gles3/rasterizer_canvas_gles3.cpp +++ b/drivers/gles3/rasterizer_canvas_gles3.cpp @@ -1493,7 +1493,11 @@ void RasterizerCanvasGLES3::render_joined_item(const BItemJoined &p_bij, RenderI Light *light = r_ris.item_group_light; bool light_used = false; VS::CanvasLightMode mode = VS::CANVAS_LIGHT_MODE_ADD; - state.canvas_item_modulate = p_ci->final_modulate; // remove the canvas modulate + + // we leave this set to 1, 1, 1, 1 if using software because the colors are baked into the vertices + if (p_bij.is_single_item()) { + state.canvas_item_modulate = p_ci->final_modulate; // remove the canvas modulate + } while (light) {