summaryrefslogtreecommitdiff
path: root/gfx/lightDirection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/lightDirection.cpp')
-rw-r--r--gfx/lightDirection.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/gfx/lightDirection.cpp b/gfx/lightDirection.cpp
index 6d7d1ea..3932872 100644
--- a/gfx/lightDirection.cpp
+++ b/gfx/lightDirection.cpp
@@ -1,8 +1,12 @@
#include "lightDirection.h"
#include "maths.h"
+constexpr auto ASTRONOMICAL_TWILIGHT = 18.0_degrees;
+constexpr auto SUN_ANGLUAR_SIZE = 0.5_degrees;
+
LightDirection::LightDirection(const Direction2D sunPos) :
pos {sunPos}, vec {glm::mat3 {rotate_yp(pi + sunPos.x, -sunPos.y)} * north},
- vert {-glm::clamp(-1.F, 0.F, vec.z - 0.1F)}
+ amb {glm::clamp(sunPos.y + ASTRONOMICAL_TWILIGHT, 0.F, 1.F)},
+ dir {glm::clamp(sunPos.y + SUN_ANGLUAR_SIZE, 0.F, 1.F)}
{
}