mirror of
https://github.com/godotengine/godot.git
synced 2025-01-22 09:51:37 +00:00
Merge pull request #74539 from Ansraer/3.x-fix-shadows
[3.x] Fix shadows when using 2 directional lights
This commit is contained in:
commit
1a4ef34d50
@ -3697,7 +3697,7 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
|
|||||||
} else if (directional_shadow.light_count == 2) {
|
} else if (directional_shadow.light_count == 2) {
|
||||||
light_instance->directional_rect = Rect2(0, 0, directional_shadow.size, directional_shadow.size / 2);
|
light_instance->directional_rect = Rect2(0, 0, directional_shadow.size, directional_shadow.size / 2);
|
||||||
if (light_instance->light_directional_index == 1) {
|
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
|
} else { //3 and 4
|
||||||
light_instance->directional_rect = Rect2(0, 0, directional_shadow.size / 2, directional_shadow.size / 2);
|
light_instance->directional_rect = Rect2(0, 0, directional_shadow.size / 2, directional_shadow.size / 2);
|
||||||
|
@ -4721,7 +4721,7 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
|
|||||||
} else if (directional_shadow.light_count == 2) {
|
} else if (directional_shadow.light_count == 2) {
|
||||||
light_instance->directional_rect = Rect2(0, 0, directional_shadow.size, directional_shadow.size / 2);
|
light_instance->directional_rect = Rect2(0, 0, directional_shadow.size, directional_shadow.size / 2);
|
||||||
if (light_instance->light_directional_index == 1) {
|
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
|
} else { //3 and 4
|
||||||
light_instance->directional_rect = Rect2(0, 0, directional_shadow.size / 2, directional_shadow.size / 2);
|
light_instance->directional_rect = Rect2(0, 0, directional_shadow.size / 2, directional_shadow.size / 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user