Engine as library (both static & shared) #1

Merged
admin merged 9 commits from engine-structure into main 2025-10-17 13:25:48 +02:00
43 changed files with 233 additions and 177 deletions
Showing only changes of commit ab917089b5 - Show all commits

View File

@ -3,6 +3,11 @@
#include <glm/glm.hpp>
#include <glm/gtc/constants.hpp>
#ifdef _WIN32
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/gtx/extended_min_max.hpp>
#endif
#include "engine/renderer/wavefront.h"
#include "engine/renderer/renderer.h"
@ -157,7 +162,7 @@ public:
glm::vec3 sunDir = glm::normalize(glm::vec3(0.0f, sin(sunAngle), cos(sunAngle)));
// Compute intensity: bright at noon, dim at dusk/dawn, dark at night
float intensity = glm::max(sin(sunAngle), (double)0.0f); // 0 at night, 1 at noon
float intensity = glm::max(static_cast<double>(sin(sunAngle)), static_cast<double>(0.0f)); // 0 at night, 1 at noon
intensity = glm::mix(0.05f, 1.5f, intensity); // keep some ambient even at night
// Optional: tint color (warm at sunrise/sunset)