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

@@ -209,7 +209,7 @@ function additive(billboard: boolean) {
varying vec4 vGlow;
void main() {
float r = 1.0 - min(1.0, length(vUv - 0.5) * 2.0);
float shape = ${billboard ? 'pow(r, 3.0) * 1.3 + pow(r, 1.2) * 0.22' : 'pow(r, 1.8) * 0.7'};
float shape = ${billboard ? 'pow(max(r, 0.0), 3.0) * 1.3 + pow(max(r, 0.0), 1.2) * 0.22' : 'pow(max(r, 0.0), 1.8) * 0.7'};
gl_FragColor = vec4(vGlow.rgb * shape * vGlow.w, 1.0);
#include <tonemapping_fragment>
#include <colorspace_fragment>