rayzee 11.2.1 → 11.3.0
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/README.md +58 -29
- package/dist/ArchiveImporter-D735xX-4.js +7860 -0
- package/dist/BidirectionalIntegrator-M89c0AlP.js +954 -0
- package/dist/{BufferLayout-D_IBo2ci.js → BufferLayout-xPRH9jYD.js} +41 -5
- package/dist/{NeuralRetouch-Cr-otSW8.js → NeuralRetouch-DiBH63kz.js} +1 -1
- package/dist/{NeuralSuperRes-B7E3_M0t.js → NeuralSuperRes-CZNQP13W.js} +1 -1
- package/dist/{PathTracer-D6nbknj5.js → PathTracer-BXCCVrPK.js} +4371 -4612
- package/dist/{PhysicalSky-Dq5VSiCQ.js → PhysicalSky-DqmaS0lb.js} +2 -2
- package/dist/{RayzeeRenderer-DbjqO6v-.js → RayzeeRenderer-DUSMFhmc.js} +426 -363
- package/dist/SolarLimb-bZE6y63S.js +762 -0
- package/dist/addons/archives.es.js +1 -1
- package/dist/addons/bidirectional.es.js +1 -1
- package/dist/addons/physical-sky.es.js +1 -1
- package/dist/rayzee-core.es.js +7 -7
- package/dist/rayzee.es.js +472 -468
- package/dist/rayzee.umd.js +106 -105
- package/dist/sceneCachePolicy-BAib5fCp.js +1602 -0
- package/package.json +1 -1
- package/src/PathTracerApp.js +4 -3
- package/src/Processor/ArchiveImporter.js +173 -94
- package/src/Processor/ArchiveReader.js +20 -23
- package/src/Processor/AssetLoader.js +48 -1
- package/src/Processor/BVHRefitter.js +109 -13
- package/src/Processor/BufferLayout.js +115 -0
- package/src/Processor/ChunkedRecords.js +3 -2
- package/src/Processor/EmissiveTriangleBuilder.js +6 -6
- package/src/Processor/GeometryExtractor.js +189 -79
- package/src/Processor/HostMemory.js +39 -9
- package/src/Processor/InstanceTable.js +714 -42
- package/src/Processor/PBRT/PBRTCurves.js +224 -6
- package/src/Processor/PBRT/PBRTMaterials.js +3 -0
- package/src/Processor/PBRT/PBRTSceneBuilder.js +82 -25
- package/src/Processor/PackedRayBuffer.js +5 -2
- package/src/Processor/SceneProcessor.js +747 -141
- package/src/Processor/TLASBuilder.js +32 -17
- package/src/Processor/USD/USDLayer.js +1149 -0
- package/src/Processor/USD/USDScene.js +1655 -0
- package/src/Processor/USD/USDStage.js +682 -0
- package/src/Processor/USD/USDText.js +674 -0
- package/src/Processor/USD/index.js +138 -0
- package/src/Processor/Workers/BVHRefitWorker.js +3 -3
- package/src/RayzeeRenderer.js +167 -26
- package/src/Stages/NormalDepth.js +7 -12
- package/src/Stages/PathTracer.js +12 -17
- package/src/Stages/PathTracerStage.js +273 -96
- package/src/Storage/GeometrySpill.js +46 -14
- package/src/Storage/SceneGraphCodec.js +17 -3
- package/src/Storage/SpillStore.js +9 -0
- package/src/TSL/BVHTraversal.js +183 -7
- package/src/TSL/Common.js +57 -13
- package/src/TSL/ShadeKernel.js +3 -2
- package/src/TSL/TextureSampling.js +11 -8
- package/src/TSL/patches.js +84 -0
- package/src/integrators/BidirectionalIntegrator.js +20 -2
- package/src/managers/DenoisingManager.js +4 -4
- package/src/managers/InteractionManager.js +19 -6
- package/src/managers/MaterialDataManager.js +22 -5
- package/src/managers/UniformManager.js +3 -0
- package/dist/ArchiveImporter-D_x863yu.js +0 -5198
- package/dist/BidirectionalIntegrator-DmkxxEOR.js +0 -946
- package/dist/SolarLimb-CPaeZVwz.js +0 -721
- package/dist/sceneCachePolicy-C4-4qwt6.js +0 -485
|
@@ -94,9 +94,10 @@ export class TLASBuilder {
|
|
|
94
94
|
*/
|
|
95
95
|
build( table ) {
|
|
96
96
|
|
|
97
|
-
const
|
|
98
|
-
table.
|
|
99
|
-
|
|
97
|
+
const clustered = table.clusterCount > 0;
|
|
98
|
+
const aabbs = clustered ? table.clusterBounds : new Float64Array( table.entryCount * 6 );
|
|
99
|
+
if ( ! clustered ) table.writeEntryWorldAABBs( aabbs );
|
|
100
|
+
const built = this.buildStructure( aabbs, clustered ? table.clusterCount : table.entryCount );
|
|
100
101
|
TLASBuilder.fillLeaves( built.data, built.nodeCount, table );
|
|
101
102
|
return built;
|
|
102
103
|
|
|
@@ -235,22 +236,34 @@ export class TLASBuilder {
|
|
|
235
236
|
*/
|
|
236
237
|
static fillLeaves( data, nodeCount, table ) {
|
|
237
238
|
|
|
238
|
-
const world = table.world, src = table.sourceMesh;
|
|
239
|
-
const blasOffset = table.tplBlasOffset, visible = table.visible, leafOf = table.tlasLeafIndex;
|
|
240
239
|
const idx = bvhIndexView( data );
|
|
241
240
|
|
|
241
|
+
if ( table.clusterCount > 0 ) {
|
|
242
|
+
|
|
243
|
+
// Built over clusters: each leaf holds one, its copies' transforms in records (table.writeRecord).
|
|
244
|
+
for ( let node = 0; node < nodeCount; node ++ ) {
|
|
245
|
+
|
|
246
|
+
const o = node * FLOATS_PER_NODE;
|
|
247
|
+
if ( idx[ o + 3 ] === BVH_LEAF_MARKERS.BLAS_POINTER_LEAF ) table.writeClusterLeaf( data, idx, o, idx[ o + 1 ], table.clusterWorld, node );
|
|
248
|
+
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
return;
|
|
252
|
+
|
|
253
|
+
}
|
|
254
|
+
|
|
242
255
|
for ( let node = 0; node < nodeCount; node ++ ) {
|
|
243
256
|
|
|
244
257
|
const o = node * FLOATS_PER_NODE;
|
|
245
258
|
if ( idx[ o + 3 ] !== BVH_LEAF_MARKERS.BLAS_POINTER_LEAF ) continue;
|
|
246
259
|
|
|
247
|
-
const
|
|
248
|
-
idx[ o ] =
|
|
249
|
-
data[ o + 2 ] =
|
|
260
|
+
const e = idx[ o + 1 ] & TLAS_PLACEMENT_MASK;
|
|
261
|
+
idx[ o ] = table.entryRoot( e );
|
|
262
|
+
data[ o + 2 ] = table.entryVisible( e ) ? 1.0 : 0.0;
|
|
250
263
|
|
|
251
|
-
TLASBuilder.writeLeafMatrix( data, idx, o,
|
|
264
|
+
TLASBuilder.writeLeafMatrix( data, idx, o, table, table.repOf( e ), e );
|
|
252
265
|
|
|
253
|
-
|
|
266
|
+
table.setLeafOf( e, node );
|
|
254
267
|
|
|
255
268
|
}
|
|
256
269
|
|
|
@@ -261,25 +274,27 @@ export class TLASBuilder {
|
|
|
261
274
|
* its own whenever a placement moves, so a rigid transform costs a matrix rather than a
|
|
262
275
|
* rewrite of the geometry the placement may be sharing.
|
|
263
276
|
*
|
|
264
|
-
* Slot [1] is rewritten too: the placement
|
|
265
|
-
* the matrix is identity so traversal can skip the ray transform for that leaf.
|
|
277
|
+
* Slot [1] is rewritten too: the TLAS entry (the placement, unless placements are grouped), with
|
|
278
|
+
* {@link TLAS_LEAF_IDENTITY} set when the matrix is identity so traversal can skip the ray transform for that leaf.
|
|
266
279
|
*
|
|
267
280
|
* @param {Float32Array} data - the node buffer, or one chunk of it
|
|
268
281
|
* @param {Uint32Array} idx - u32 view over the same memory as `data`
|
|
269
282
|
* @param {number} off - float offset of the leaf within `data`
|
|
270
|
-
* @param {
|
|
271
|
-
* @param {number} placement
|
|
283
|
+
* @param {import('./InstanceTable.js').InstanceTable} table
|
|
284
|
+
* @param {number} placement - whose transform the leaf carries
|
|
285
|
+
* @param {number} [entry] - the TLAS entry it stands for
|
|
272
286
|
*/
|
|
273
|
-
static writeLeafMatrix( data, idx, off,
|
|
287
|
+
static writeLeafMatrix( data, idx, off, table, placement, entry = placement ) {
|
|
274
288
|
|
|
275
289
|
const inv = _inverseScratch;
|
|
276
|
-
|
|
290
|
+
const row = table.matrixRow( placement ), world = table.rowArray;
|
|
291
|
+
invertAffineInto( world, row, inv );
|
|
277
292
|
|
|
278
293
|
data[ off + 4 ] = inv[ 0 ]; data[ off + 5 ] = inv[ 4 ]; data[ off + 6 ] = inv[ 8 ]; data[ off + 7 ] = inv[ 12 ];
|
|
279
294
|
data[ off + 8 ] = inv[ 1 ]; data[ off + 9 ] = inv[ 5 ]; data[ off + 10 ] = inv[ 9 ]; data[ off + 11 ] = inv[ 13 ];
|
|
280
295
|
data[ off + 12 ] = inv[ 2 ]; data[ off + 13 ] = inv[ 6 ]; data[ off + 14 ] = inv[ 10 ]; data[ off + 15 ] = inv[ 14 ];
|
|
281
296
|
|
|
282
|
-
idx[ off + 1 ] = (
|
|
297
|
+
idx[ off + 1 ] = ( entry | ( isIdentityAt( world, row ) ? TLAS_LEAF_IDENTITY : 0 ) ) >>> 0;
|
|
283
298
|
|
|
284
299
|
}
|
|
285
300
|
|