rayzee 5.10.1 → 5.10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rayzee",
3
- "version": "5.10.1",
3
+ "version": "5.10.2",
4
4
  "type": "module",
5
5
  "description": "Real-time WebGPU path tracing engine built on Three.js",
6
6
  "main": "dist/rayzee.umd.js",
@@ -608,6 +608,10 @@ export const Trace = Fn( ( [
608
608
  const objectID = float( - 1000.0 ).toVar();
609
609
  const firstHitPoint = ray.origin.toVar();
610
610
  const firstHitDistance = float( 1e10 ).toVar();
611
+ // OIDN clean-aux: extend albedo/normal capture through specular/transmissive
612
+ // surfaces so aux features describe what's actually visible (e.g. scenery
613
+ // behind glass), not the glass surface itself.
614
+ const auxLocked = tslBool( false ).toVar();
611
615
 
612
616
  // Medium stack for transmission (per-slot IOR, slots 1-3 for nested media, depth 0 = air)
613
617
  const mediumStackDepth = int( 0 ).toVar();
@@ -1148,14 +1152,31 @@ export const Trace = Fn( ( [
1148
1152
 
1149
1153
  } );
1150
1154
 
1151
- // Store first hit data for G-buffer
1155
+ // firstHitPoint / firstHitDistance reflect the actual primary-ray hit
1156
+ // (used for depth + temporal reprojection — must not skip transparent surfaces)
1152
1157
  If( bounceIndex.equal( int( 0 ) ).and( hitInfo.didHit ), () => {
1153
1158
 
1159
+ firstHitPoint.assign( hitInfo.hitPoint );
1160
+ firstHitDistance.assign( hitInfo.dst );
1161
+
1162
+ } );
1163
+
1164
+ // objectNormal / objectColor / objectID feed OIDN's aux inputs. Overwrite
1165
+ // at each bounce until we land on a non-specular surface, then lock.
1166
+ // Falls back to the last specular hit if the path never hits diffuse.
1167
+ If( auxLocked.not().and( hitInfo.didHit ), () => {
1168
+
1154
1169
  objectNormal.assign( N );
1155
1170
  objectColor.assign( material.color.xyz );
1156
1171
  objectID.assign( float( hitInfo.materialIndex ) );
1157
- firstHitPoint.assign( hitInfo.hitPoint );
1158
- firstHitDistance.assign( hitInfo.dst );
1172
+
1173
+ const isMirror = material.metalness.greaterThan( 0.7 ).and( material.roughness.lessThan( 0.3 ) );
1174
+ const isTransmissive = material.transmission.greaterThan( 0.5 );
1175
+ If( isMirror.or( isTransmissive ).not(), () => {
1176
+
1177
+ auxLocked.assign( tslBool( true ) );
1178
+
1179
+ } );
1159
1180
 
1160
1181
  } );
1161
1182