From 3a29a165a9b79aee5ee7d7f687848da0bc07b33a Mon Sep 17 00:00:00 2001 From: Sebastian Krzyszkowiak Date: Sat, 7 Nov 2026 12:34:01 +0100 Subject: [PATCH] simulationenvironment: Don't multiply fog color by diffuselevel (#229) It can easily make the fog too dark compared to the environment, producing a "fire in the forest" effect. --- simulation/simulationenvironment.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/simulation/simulationenvironment.cpp b/simulation/simulationenvironment.cpp index 14ad2353c..bdc4b0598 100644 --- a/simulation/simulationenvironment.cpp +++ b/simulation/simulationenvironment.cpp @@ -167,9 +167,8 @@ world_environment::update() { // the impact of sun component is reduced proportionally to overcast level, as overcast increases role of ambient light auto const diffuselevel = std::lerp( keylightintensity, intensity * ( 1.0f - twilightfactor ), 1.0f - std::min( 1.f, Global.Overcast ) * 0.75f ); // ...update light colours and intensity. - keylightcolor = keylightcolor * diffuselevel; - Global.DayLight.diffuse = glm::vec4( keylightcolor, Global.DayLight.diffuse.a ); - Global.DayLight.specular = glm::vec4( keylightcolor * 0.85f, diffuselevel ); + Global.DayLight.diffuse = glm::vec4( keylightcolor * diffuselevel, Global.DayLight.diffuse.a ); + Global.DayLight.specular = glm::vec4( keylightcolor * diffuselevel * 0.85f, diffuselevel ); // tonal impact of skydome color is inversely proportional to how high the sun is above the horizon // (this is pure conjecture, aimed more to 'look right' than be accurate)