mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-08 04:08:38 +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:
committed by
GitHub
parent
605a94cf2b
commit
3a29a165a9
@@ -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
|
// 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 );
|
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.
|
// ...update light colours and intensity.
|
||||||
keylightcolor = keylightcolor * diffuselevel;
|
Global.DayLight.diffuse = glm::vec4( keylightcolor * diffuselevel, Global.DayLight.diffuse.a );
|
||||||
Global.DayLight.diffuse = glm::vec4( keylightcolor, Global.DayLight.diffuse.a );
|
Global.DayLight.specular = glm::vec4( keylightcolor * diffuselevel * 0.85f, diffuselevel );
|
||||||
Global.DayLight.specular = glm::vec4( keylightcolor * 0.85f, diffuselevel );
|
|
||||||
|
|
||||||
// tonal impact of skydome color is inversely proportional to how high the sun is above the horizon
|
// 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)
|
// (this is pure conjecture, aimed more to 'look right' than be accurate)
|
||||||
|
|||||||
Reference in New Issue
Block a user