diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-07-17 09:56:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-17 09:56:44 +0200 |
commit | 1d13567345c6966f351437dc901af7ae375016d3 (patch) | |
tree | 6dffa29d58b99138ba2b4a913f84c8808523d5b5 | |
parent | 8abc59b83cdde7602a3fbafaa6173bed3caa759b (diff) | |
parent | 545bf86d39ea3c68ed38e14a5018231295bed922 (diff) |
Merge pull request #30570 from SonerSound/gles2_inconsistent_fix
Fix inconsistent lighting in GLES2
-rw-r--r-- | drivers/gles2/rasterizer_scene_gles2.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gles2/rasterizer_scene_gles2.cpp b/drivers/gles2/rasterizer_scene_gles2.cpp index ea29af7d9e..c8ceca8d97 100644 --- a/drivers/gles2/rasterizer_scene_gles2.cpp +++ b/drivers/gles2/rasterizer_scene_gles2.cpp @@ -1133,8 +1133,8 @@ void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::G LightInstance *li = light_instance_owner.getornull(e->instance->light_instances[i]); - if (li->light_index >= render_light_instance_count) { - continue; // too many + if (li->light_index >= render_light_instance_count || render_light_instances[li->light_index] != li) { + continue; // too many or light_index did not correspond to the light instances to be rendered } if (copy) { |