fix night shadows

This commit is contained in:
MihailRis
2025-06-11 00:51:42 +03:00
parent 11283f9a33
commit 1a3fb9f5b3
2 changed files with 11 additions and 3 deletions
+6 -1
View File
@@ -370,7 +370,12 @@ void WorldRenderer::generateShadowsMap(
shadowCamera.perspective = false;
shadowCamera.setAspectRatio(1.0f);
float sunAngle = glm::radians(fmod(90.0f - worldInfo.daytime * 360.0f, 180.0f));
float t = worldInfo.daytime - 0.25f;
if (t < 0.0f) {
t += 1.0f;
}
t = fmod(t, 0.5f);
float sunAngle = glm::radians(90.0f - (t + 0.25f) * 360.0f);
shadowCamera.rotate(
sunAngle,
glm::radians(-45.0f),