| 482 | } |
| 483 | } |
| 484 | |
| 485 | void 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 | |
| 505 | const Matrix4& Scene::ScaledInvTransform() const |
no test coverage detected