perf(sky): skip the night-sky lattice entirely while the day fade is zero

The enhanced sky multiplied the full 4-tier star lattice by a night
factor of 0.0 all day long. Early-out when the star layer's lighting
product says daytime, so the pack's night sky costs nothing outside
dusk-to-dawn. sky.frag.spv re-pinned.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-23 18:09:04 +02:00
parent b8cfee6d08
commit 91084b9a83
4 changed files with 8 additions and 2 deletions

View file

@ -191,6 +191,12 @@ void main() {
// ~1.0 at noon. Stars at full strength only under a dark sky.
float dayL = dot(vTint, vec3(0.299, 0.587, 0.114));
float night = 1.0 - smoothstep(0.18, 0.45, dayL);
if (night < 0.004) {
// Daytime: the whole lattice would multiply to zero — skip it
// so the enhanced sky costs nothing outside dusk-to-dawn.
fragColor = vec4(0.0, 0.0, 0.0, 1.0);
return;
}
vec3 sky = nightSky(normalize(vDir), uint(uParamB));
// Additive pipeline (forced for this draw): rgb adds over the dome.
fragColor = vec4(sky * night, 1.0);

View file

@ -316,7 +316,7 @@
},
{
"stage": "frag",
"sourceSha256": "a6efd09f396b17ae6a19ffc4be400ac9b035056cbad26aee3447459cd98341f0",
"sourceSha256": "e7ccdb4d5fece2ceeb48eb43aaa827424df2b68614987eeb3dfb7880dff8ea83",
"compiled": true
}
]

View file

@ -52,7 +52,7 @@ public sealed class VulkanShaderManifestTests
// override, retail's GameSky::Draw @0x00506FF0 rule (see
// SkyFogRuleTests). A deliberate default-path change, reviewed
// with the world-fog-range fix in the same commit.
["sky.frag.spv"] = "2d2de4080c7f4b0885aee4441e37a1725d3f30661b45773bcb39383674b1718b",
["sky.frag.spv"] = "e307a7f3cf84aada86db7c2859c55841a650b46732f12149986562cef0a90ca8",
["sky.vert.spv"] = "3b51945fa4ff1be1604144df92866bdd47aade22f9dd90267591ef36adb28cde",
["terrain_modern.frag.spv"] = "7b3cdb01b837ed77ee20559a81c1ce5c9d5395300efcc072560ab0be3c5a1af9",
["terrain_modern.vert.spv"] = "9f4cb221ea6aed94a8d23af6cb8e3f3ed96c3cce6e50d135a72d3b55667b1557",