fix: guard shader pow() bases so a NaN pixel can no longer black out the frame

This commit is contained in:
2026-10-12 04:23:25 +03:00
parent 50da616a46
commit 06e6a59b6f
18 changed files with 165 additions and 34 deletions

View File

@@ -275,7 +275,7 @@ export function createMaintenanceWindow(resources: SceneResourceBag) {
varying float vReturn;
void main() {
float across = abs(vUv.y);
float body = (1.0 - smoothstep(0.0, 1.0, across)) * pow(vUv.x, 1.6);
float body = (1.0 - smoothstep(0.0, 1.0, across)) * pow(clamp(vUv.x, 0.0, 1.0), 1.6);
float head = 1.0 - smoothstep(0.0, 1.0, length(vec2((vUv.x - 0.9) * 5.0, across)));
float alpha = max(body * 0.7, head) * vAlpha;
if (alpha < 0.004) discard;