From 0889f3f6d7b96c6f6d186ca8fa7f4e9e0ec9c701 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 24 Oct 2024 03:10:08 +0100 Subject: Improve sun illumination based on angular size and astronomical twilight --- game/environment.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'game/environment.cpp') diff --git a/game/environment.cpp b/game/environment.cpp index 5aa1f09..acb4f21 100644 --- a/game/environment.cpp +++ b/game/environment.cpp @@ -18,8 +18,8 @@ Environment::render(const SceneRenderer & renderer, const SceneProvider & scene) constexpr RGB relativeAmbient {0.3F, 0.3F, 0.4F}, relativeDirectional {0.6F, 0.6F, 0.5F}; const LightDirection sunPos = getSunPos({}, worldTime); - const auto ambient = baseAmbient + relativeAmbient * sunPos.vertical(); - const auto directional = baseDirectional + relativeDirectional * sunPos.vertical(); + const auto ambient = baseAmbient + relativeAmbient * sunPos.ambient(); + const auto directional = baseDirectional + relativeDirectional * sunPos.directional(); renderer.setAmbientLight(ambient); renderer.setDirectionalLight(directional, sunPos, scene); -- cgit v1.2.3