Added dawn

This commit is contained in:
Vladislav Khorev committed 2026-06-04 18:01:51 +03:00
1 parent 83b92e9881
commit c8d743b932
13 files changed
+88 -40

No files matched your search

+14 -4
View File
@@ -1017,6 +1017,14 @@ namespace ZL
}
const bool hasShadows = (shadowMap != nullptr && shadowLight != nullptr);
// Ambient and fog color: different for plain night vs dawn
static const float kNightAmbient[3] = { 0.37f, 0.37f, 0.37f };
static const float kDawnAmbient[3] = { 0.72f, 0.52f, 0.62f }; // brighter warm pink
static const float kNightFogColor[3] = { 0.01f, 0.01f, 0.05f };
static const float kDawnFogColor[3] = { 0.50f, 0.44f, 0.47f }; // grey with slight pink
const float* ambientColor = isDawn ? kDawnAmbient : kNightAmbient;
const float* fogColor = isDawn ? kDawnFogColor : kNightFogColor;
if (hasShadows) {
drawNightShadowDepthPass(*shadowLight);
}
@@ -1038,6 +1046,8 @@ namespace ZL
const float playerEyePos[3] = { 0.0f, 0.0f, -Environment::zoom };
renderer.RenderUniform3fv("uPlayerEyePos", playerEyePos);
renderer.RenderUniform3fv("uAmbientColor", ambientColor);
renderer.RenderUniform3fv("uFogColor", fogColor);
renderer.PushPerspectiveProjectionMatrix(1.0 / 1.5,
static_cast<float>(Environment::width) / static_cast<float>(Environment::height),
@@ -1111,11 +1121,11 @@ namespace ZL
for (auto& tz : teleportZones) tz.prepareForDraw(cameraViewMatrix);
if (hasShadows) {
if (player) player->drawNightWithShadow(renderer, plPosEye, plDirEye, plColors, lightCount, lightFromCamera, shadowMap->getDepthTexture());
for (auto& npc : npcs) npc->drawNightWithShadow(renderer, plPosEye, plDirEye, plColors, lightCount, lightFromCamera, shadowMap->getDepthTexture());
if (player) player->drawNightWithShadow(renderer, plPosEye, plDirEye, plColors, lightCount, lightFromCamera, shadowMap->getDepthTexture(), ambientColor, fogColor);
for (auto& npc : npcs) npc->drawNightWithShadow(renderer, plPosEye, plDirEye, plColors, lightCount, lightFromCamera, shadowMap->getDepthTexture(), ambientColor, fogColor);
} else {
if (player) player->drawNight(renderer, plPosEye, plDirEye, plColors, lightCount);
for (auto& npc : npcs) npc->drawNight(renderer, plPosEye, plDirEye, plColors, lightCount);
if (player) player->drawNight(renderer, plPosEye, plDirEye, plColors, lightCount, ambientColor, fogColor);
for (auto& npc : npcs) npc->drawNight(renderer, plPosEye, plDirEye, plColors, lightCount, ambientColor, fogColor);
}
for (auto& tz : teleportZones) tz.draw(renderer, Environment::zoom, Environment::width, Environment::height);