From 947319e25e49027d77543ae5c6f6c01d451a8926 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 26 Mar 2026 20:46:58 +0000 Subject: Improve light approximations in LightDirection Twilight replaces astronomical twilight to give a longer fade. Astronomical twilight is only the darkest part of twilight, which we had skipped right to. Fixes directional light amount to only be affected by the sun's passing below th horizon, not it's whole height above it. Adds a rough approximation of the amount of atmosphere scattering of directional light (I made this calculation up) --- gfx/lightDirection.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gfx/lightDirection.h') diff --git a/gfx/lightDirection.h b/gfx/lightDirection.h index 789830b..296f497 100644 --- a/gfx/lightDirection.h +++ b/gfx/lightDirection.h @@ -31,9 +31,16 @@ public: return dir; } + [[nodiscard]] float + atmosphericScattering() const noexcept + { + return atmosScatter; + } + private: Direction2D pos; Direction3D vec; float amb; float dir; + float atmosScatter; }; -- cgit v1.3