MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / MainLightChanged

Method MainLightChanged

engine/Poseidon/World/Scene/Scene.cpp:484–502  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482 }
483}
484
485void Scene::MainLightChanged()
486{
487 if (GetLandscape())
488 {
489 Color sunColor = _mainLight->GetColorFull() * (GetLandscape()->SkyThrough() * 0.8f + 0.2f);
490 sunColor.SaturateMinMax();
491 _mainLight->SetDiffuse(sunColor);
492 }
493 // recalculate background color
494 // calculate fog color from sky texture
495 // we should apply some lighting (to have dark fog in the night)
496 Color lighting = _mainLight->SkyColor();
497 lighting = lighting * GEngine->GetAccomodateEye();
498 lighting.SaturateMinMax();
499 Color color = _skyColor * lighting;
500 color.SaturateMinMax();
501 color.SetA(1);
502 GEngine->SetFogColor(color);
503}
504
505const Matrix4& Scene::ScaledInvTransform() const

Callers 9

InitializeWorldMethod · 0.80
SimulateLandscapeMethod · 0.80
SetDateMethod · 0.80
WorldMethod · 0.80
InitGeneralMethod · 0.80
CleanUpInitMethod · 0.80
SerializeMethod · 0.80
SimulateMethod · 0.80
SkipDayTimeFunction · 0.80

Calls 8

GetColorFullMethod · 0.80
SkyThroughMethod · 0.80
SkyColorMethod · 0.80
GetAccomodateEyeMethod · 0.80
SaturateMinMaxMethod · 0.45
SetDiffuseMethod · 0.45
SetAMethod · 0.45
SetFogColorMethod · 0.45

Tested by

no test coverage detected