rayzee 5.8.0 → 5.8.1

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.
@@ -561,7 +561,10 @@
561
561
  ) -> f32 {
562
562
 
563
563
  let lumW = exp( -abs( centerLum - sLum ) * phiLum );
564
- let normW = pow( max( dot( centerNormal, sNormal ), 0.0 ), phiNorm );
564
+ // clamp dot to [0,1] not just max(., 0): miss-ray normals decode to
565
+ // non-unit (-1,-1,-1) with dot=3, which would saturate pow to +inf
566
+ // and poison output via inf*0 = NaN. See project_tsl_pitfalls memory.
567
+ let normW = pow( clamp( dot( centerNormal, sNormal ), 0.0, 1.0 ), phiNorm );
565
568
  let depW = exp( -abs( centerDepth - sDepth ) / max( phiDep, 0.001 ) );
566
569
  let maxDiff = max( max( abs( centerColor.x - sColor.x ),
567
570
  abs( centerColor.y - sColor.y ) ),