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:
parent
b8cfee6d08
commit
91084b9a83
4 changed files with 8 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -316,7 +316,7 @@
|
|||
},
|
||||
{
|
||||
"stage": "frag",
|
||||
"sourceSha256": "a6efd09f396b17ae6a19ffc4be400ac9b035056cbad26aee3447459cd98341f0",
|
||||
"sourceSha256": "e7ccdb4d5fece2ceeb48eb43aaa827424df2b68614987eeb3dfb7880dff8ea83",
|
||||
"compiled": true
|
||||
}
|
||||
]
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue