Fixed lights.

This commit is contained in:
Relintai 2022-07-31 01:32:43 +02:00
parent ec789f1b87
commit bb323b5bee

View File

@ -2319,6 +2319,13 @@ void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements,
prev_base_pass = base_pass; prev_base_pass = base_pass;
} }
if (!unshaded && e->light_index < RenderList::MAX_LIGHTS) {
light = render_light_instances[e->light_index];
if ((e->instance->layer_mask & light->light_ptr->cull_mask) == 0) {
light = nullptr; // Don't use this light, it is culled
}
}
if (light != prev_light) { if (light != prev_light) {
_setup_light_type(light, shadow_atlas); _setup_light_type(light, shadow_atlas);
rebind = true; rebind = true;