From 661cf1f3515ab53c002d2824876dd955b06e9e50 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Thu, 1 Aug 2024 02:19:01 +0200 Subject: [PATCH] Fix LightmapGI not taking environment sky rotation into account when baking The sky rotation now affects the baked environment lighting as it should, making it match how real-time ambient light rendering works. Co-authored-by: Per Melin --- scene/3d/lightmap_gi.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/3d/lightmap_gi.cpp b/scene/3d/lightmap_gi.cpp index 038a78609fc..dd8ac403303 100644 --- a/scene/3d/lightmap_gi.cpp +++ b/scene/3d/lightmap_gi.cpp @@ -1072,6 +1072,7 @@ LightmapGI::BakeError LightmapGI::bake(Node *p_from_node, String p_image_data_pa if (env.is_valid()) { environment_image = RS::get_singleton()->environment_bake_panorama(env->get_rid(), true, Size2i(128, 64)); + environment_transform = Basis::from_euler(env->get_sky_rotation()).inverse(); } } } break;