Ported: fix shadows pass viewport calculation.

([3.x] Fix shadows when using 2 directional lights)
- Ansraer
0227fcc4cc
This commit is contained in:
Relintai 2023-03-12 19:48:33 +01:00
parent a8137bb4c1
commit 43d1126b73

View File

@ -3556,7 +3556,7 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
} else if (directional_shadow.light_count == 2) {
light_instance->directional_rect = Rect2(0, 0, directional_shadow.size, directional_shadow.size / 2);
if (light_instance->light_directional_index == 1) {
light_instance->directional_rect.position.x += light_instance->directional_rect.size.x;
light_instance->directional_rect.position.y += light_instance->directional_rect.size.y;
}
} else { //3 and 4
light_instance->directional_rect = Rect2(0, 0, directional_shadow.size / 2, directional_shadow.size / 2);