17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-08 19:52:47 +01:00

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.
This commit is contained in:
Sebastian Krzyszkowiak
2026-11-07 12:34:01 +01:00
committed by GitHub
parent 605a94cf2b
commit 3a29a165a9

View File

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