rayzee 5.8.0 → 5.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,7 +24,10 @@ const bilateralWeight = /*@__PURE__*/ wgslFn( `
24
24
  ) -> f32 {
25
25
 
26
26
  let lumW = exp( -abs( centerLum - sLum ) * phiLum );
27
- let normW = pow( max( dot( centerNormal, sNormal ), 0.0 ), phiNorm );
27
+ // clamp dot to [0,1] not just max(., 0): miss-ray normals decode to
28
+ // non-unit (-1,-1,-1) with dot=3, which would saturate pow to +inf
29
+ // and poison output via inf*0 = NaN. See project_tsl_pitfalls memory.
30
+ let normW = pow( clamp( dot( centerNormal, sNormal ), 0.0, 1.0 ), phiNorm );
28
31
  let depW = exp( -abs( centerDepth - sDepth ) / max( phiDep, 0.001 ) );
29
32
  let maxDiff = max( max( abs( centerColor.x - sColor.x ),
30
33
  abs( centerColor.y - sColor.y ) ),