From 69939028b3145fafb16c4ac2a93522596e5c81d7 Mon Sep 17 00:00:00 2001 From: jfons Date: Wed, 25 Nov 2020 18:03:05 +0100 Subject: [PATCH] Fix regression in baked lights when using GLES2 Lights with bake mode set to "All" were behaving erratically because of a faulty check in the renderer. This should be the correct way to check if a geometry instance is using baked light. --- drivers/gles2/rasterizer_scene_gles2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index b81d651c8a4..bf83af37e03 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -2300,7 +2300,7 @@ void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements, if (!unshaded && e->light_index < RenderList::MAX_LIGHTS) { light = render_light_instances[e->light_index]; - if (e->light_mode == LightMode::LIGHTMODE_LIGHTMAP && light->light_ptr->bake_mode == VS::LIGHT_BAKE_ALL) { + if (e->instance->baked_light && light->light_ptr->bake_mode == VS::LIGHT_BAKE_ALL) { light = NULL; // Don't use this light, it is already included in the lightmap } }