Skip to content

Commit

Permalink
Merge pull request godotengine#30570 from SonerSound/gles2_inconsiste…
Browse files Browse the repository at this point in the history
…nt_fix

Fix inconsistent lighting in GLES2
  • Loading branch information
akien-mga authored Jul 17, 2019
2 parents 8abc59b + 545bf86 commit 1d13567
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gles2/rasterizer_scene_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 1d13567

Please sign in to comment.