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.
This commit is contained in:
Kelsi 2026-03-20 16:50:32 -07:00
parent d7d6819855
commit b3f406c6d3

View file

@ -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);
}