diff options
| author | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-26 20:46:58 +0000 |
|---|---|---|
| committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2026-03-26 20:46:58 +0000 |
| commit | 947319e25e49027d77543ae5c6f6c01d451a8926 (patch) | |
| tree | 4e941967521d0b96e3c2ad32eb1545ecb6ed32f7 /gfx/lightDirection.h | |
| parent | Fix warnings in Environment:getSunPos (diff) | |
| download | ilt-947319e25e49027d77543ae5c6f6c01d451a8926.tar.bz2 ilt-947319e25e49027d77543ae5c6f6c01d451a8926.tar.xz ilt-947319e25e49027d77543ae5c6f6c01d451a8926.zip | |
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)
Diffstat (limited to 'gfx/lightDirection.h')
| -rw-r--r-- | gfx/lightDirection.h | 7 |
1 files changed, 7 insertions, 0 deletions
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; }; |
