rayzee 7.9.0 → 7.9.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayzee",
3
- "version": "7.9.0",
3
+ "version": "7.9.1",
4
4
  "type": "module",
5
5
  "description": "Real-time WebGPU path tracing engine built on Three.js",
6
6
  "main": "dist/rayzee.umd.js",
@@ -1,4 +1,4 @@
1
- import { Fn, vec3, vec4, float, int, uint, uvec2, uniform, normalize, mat3, storage, If,
1
+ import { Fn, vec3, vec4, float, int, uint, uvec2, uniform, normalize, mat3, min, storage, If,
2
2
  textureStore, workgroupId, localId } from 'three/tsl';
3
3
  import { RenderTarget, StorageTexture } from 'three/webgpu';
4
4
  import { HalfFloatType, RGBAFormat, NearestFilter, Matrix4, Box2, Vector2 } from 'three';
@@ -234,7 +234,10 @@ export class NormalDepth extends RenderStage {
234
234
  const hit = HitInfo.wrap( traverseBVH( ray, bvhStorage, triStorage ) );
235
235
 
236
236
  const encodedNormal = hit.normal.mul( 0.5 ).add( 0.5 );
237
- const depth = hit.dst;
237
+ // Clamp to the max finite HalfFloat: a hit farther than 65504 units would otherwise
238
+ // round to +Inf in the f16 texture (on backends that don't clamp), reintroducing the
239
+ // Inf-Inf=NaN in the denoiser depth weights that the finite miss-sentinel avoids.
240
+ const depth = min( hit.dst, float( 65504.0 ) );
238
241
 
239
242
  const result = hit.didHit.select(
240
243
  vec4( encodedNormal, depth ),