From b8031bb7d6d0bed33c058db20b58800e615538e3 Mon Sep 17 00:00:00 2001 From: Markus Sauermann <6299227+Sauermann@users.noreply.github.com> Date: Wed, 5 Oct 2022 10:56:19 +0200 Subject: Code simplifications 1. Viewport::get_visible_rect().position is always zero. So Control::get_window_rect is identical to Control::get_global_rect. Remove Control::get_window_rect since it is not used in the source code. 2. sqrt(a * a) = abs(a) for doubles 3. Simplify affine_inverse combination 4. Simplify calculation in shaders --- servers/rendering/renderer_rd/environment/gi.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'servers/rendering/renderer_rd/environment/gi.cpp') diff --git a/servers/rendering/renderer_rd/environment/gi.cpp b/servers/rendering/renderer_rd/environment/gi.cpp index f4a27144d9..550fe27e4c 100644 --- a/servers/rendering/renderer_rd/environment/gi.cpp +++ b/servers/rendering/renderer_rd/environment/gi.cpp @@ -2866,7 +2866,8 @@ void GI::VoxelGIInstance::update(bool p_update_light_instances, const Vectorvoxel_gi_get_to_cell_xform(probe); - Transform3D to_probe_xform = (transform * to_cell.affine_inverse()).affine_inverse(); + Transform3D to_probe_xform = to_cell * transform.affine_inverse(); + //update lights for (uint32_t i = 0; i < light_count; i++) { -- cgit v1.2.3