diff --git a/servers/rendering/renderer_rd/environment/gi.cpp b/servers/rendering/renderer_rd/environment/gi.cpp index ac445a0c604..fc1a1b1b1dd 100644 --- a/servers/rendering/renderer_rd/environment/gi.cpp +++ b/servers/rendering/renderer_rd/environment/gi.cpp @@ -2943,10 +2943,6 @@ void GI::VoxelGIInstance::update(bool p_update_light_instances, const Vectorvoxel_gi_get_octree_size(probe) / gi->voxel_gi_get_bounds(probe).size; - float cell_size = (1.0 / MAX(MAX(ps.x, ps.y), ps.z)); - if (has_dynamic_object_data || p_update_light_instances || p_dynamic_objects.size()) { // PROCESS MIPMAPS if (mipmaps.size()) { @@ -2954,6 +2950,9 @@ void GI::VoxelGIInstance::update(bool p_update_light_instances, const Vectorvoxel_gi_get_octree_size(probe); + Vector3 ps = probe_size / gi->voxel_gi_get_bounds(probe).size; + float cell_size = (1.0 / MAX(MAX(ps.x, ps.y), ps.z)); // probe size relative to 1 unit in world space + VoxelGIPushConstant push_constant; push_constant.limits[0] = probe_size.x; @@ -3135,6 +3134,9 @@ void GI::VoxelGIInstance::update(bool p_update_light_instances, const Vector_render_material(to_world_xform * xform, cm, true, RendererSceneRenderRD::get_singleton()->cull_argument, dynamic_maps[0].fb, Rect2i(Vector2i(), rect.size), exposure_normalization); + Vector3 ps = octree_size / gi->voxel_gi_get_bounds(probe).size; + float cell_size = (1.0 / MAX(MAX(ps.x, ps.y), ps.z)); // probe size relative to 1 unit in world space + VoxelGIDynamicPushConstant push_constant; memset(&push_constant, 0, sizeof(VoxelGIDynamicPushConstant)); push_constant.limits[0] = octree_size.x;