From 46610117d383bf04a5bfa1a2ea5cf072d42061d4 Mon Sep 17 00:00:00 2001 From: Per Melin Date: Fri, 8 Mar 2024 12:17:50 +0100 Subject: [PATCH] Fix lightmap capture not applied in one octant GI from probe captures was not applied to dynamic objects in the (-,-,-) octant of the lightmap. If the object had traveled from a different part of the lightmap, it would simply not update anymore and kept whatever ambient light it had from before. If the object on the other hand came from outside of the lightmap into this octant, it would receive no ambient light at all. --- servers/rendering/renderer_scene_cull.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servers/rendering/renderer_scene_cull.cpp b/servers/rendering/renderer_scene_cull.cpp index 4e5539e6a4..aa69cd8539 100644 --- a/servers/rendering/renderer_scene_cull.cpp +++ b/servers/rendering/renderer_scene_cull.cpp @@ -2053,7 +2053,7 @@ void RendererSceneCull::_update_instance_lightmap_captures(Instance *p_instance) Vector3 inner_pos = ((lm_pos - bounds.position) / bounds.size) * 2.0 - Vector3(1.0, 1.0, 1.0); - real_t blend = MAX(inner_pos.x, MAX(inner_pos.y, inner_pos.z)); + real_t blend = MAX(ABS(inner_pos.x), MAX(ABS(inner_pos.y), ABS(inner_pos.z))); //make blend more rounded blend = Math::lerp(inner_pos.length(), blend, blend); blend *= blend;