From b3f406c6d340da2f8ea1180c579278be79d78af1 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Fri, 20 Mar 2026 16:50:32 -0700 Subject: [PATCH] fix: sync cloud density with weather intensity and DBC cloud coverage Cloud renderer's density was hardcoded at 0.35 and never updated from the DBC-driven cloudDensity parameter. Now setDensity() is called each frame with the lighting manager's cloud coverage value. Active weather (rain/ snow/storm) additionally boosts cloud density by up to 0.4 so clouds visibly thicken during storms. --- src/rendering/sky_system.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rendering/sky_system.cpp b/src/rendering/sky_system.cpp index 9509cdc2..98e27621 100644 --- a/src/rendering/sky_system.cpp +++ b/src/rendering/sky_system.cpp @@ -135,6 +135,14 @@ void SkySystem::render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, // --- Clouds (DBC-driven colors + sun lighting) --- if (clouds_) { + // Sync cloud density with weather/DBC-driven cloud coverage. + // Active weather (rain/snow/storm) increases cloud density for visual consistency. + float effectiveDensity = params.cloudDensity; + if (params.weatherIntensity > 0.05f) { + float weatherBoost = params.weatherIntensity * 0.4f; // storms add up to 0.4 density + effectiveDensity = glm::min(1.0f, effectiveDensity + weatherBoost); + } + clouds_->setDensity(effectiveDensity); clouds_->render(cmd, perFrameSet, params); }