@threenative/core 0.3.6 → 0.3.8

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.
Files changed (137) hide show
  1. package/README.md +3 -5
  2. package/capabilities.json +739 -50
  3. package/dist/{assets-CqvE429w.d.ts → assets-YUbXa3-Y.d.ts} +101 -2
  4. package/dist/{canvas-layer-C1-5CviZ.d.ts → canvas-layer-vCtanIeB.d.ts} +1 -1
  5. package/dist/{game-Jz4Fdoeb.d.ts → game-cb99J-YE.d.ts} +100 -31
  6. package/dist/hot.d.ts +4 -4
  7. package/dist/hot.js +23 -5
  8. package/dist/index.d.ts +1742 -29
  9. package/dist/index.js +22443 -12423
  10. package/dist/{model-lod-BDAUYgsS.d.ts → model-lod-CTpZ6imz.d.ts} +1 -1
  11. package/dist/net.js +39 -12
  12. package/dist/playtest.d.ts +4 -4
  13. package/dist/playtest.js +48 -9
  14. package/dist/react-css.js +23 -0
  15. package/dist/react.d.ts +2 -2
  16. package/dist/{renderer-9yEo9hPa.d.ts → renderer-rZm0hVqq.d.ts} +178 -5
  17. package/dist/ui-layer.d.ts +11 -2
  18. package/dist/ui-layer.js +76 -4
  19. package/dist/worker.d.ts +36 -0
  20. package/dist/worker.js +1088 -0
  21. package/dist/world.d.ts +11 -3
  22. package/dist/world.js +1117 -197
  23. package/mcp/animation-server.mjs +265 -0
  24. package/mcp/animation.mjs +22 -0
  25. package/mcp/call.mjs +105 -0
  26. package/mcp/devtools.mjs +5 -0
  27. package/mcp/engine-server.mjs +713 -37
  28. package/mcp/launch.mjs +3 -2
  29. package/mcp/servers.d.mts +2 -0
  30. package/mcp/servers.mjs +33 -8
  31. package/package.json +12 -8
  32. package/patches/three@0.185.1-prd269-upgrade.patch +308 -0
  33. package/patches/three@0.185.1.patch +481 -272
  34. package/src/animation-packet-state.ts +88 -0
  35. package/src/animation-pose-packet.ts +537 -0
  36. package/src/animation.ts +779 -31
  37. package/src/asset-cache.ts +719 -0
  38. package/src/assets.ts +521 -152
  39. package/src/audio.ts +29 -3
  40. package/src/auto-batch.ts +792 -0
  41. package/src/config.ts +2 -0
  42. package/src/frame-budget.ts +268 -2
  43. package/src/game.ts +525 -105
  44. package/src/grounding.ts +7 -6
  45. package/src/hot.ts +19 -5
  46. package/src/index.ts +381 -6
  47. package/src/input.ts +21 -2
  48. package/src/interpolation.ts +19 -1
  49. package/src/launch-diagnostics.ts +7 -2
  50. package/src/look/ao-multibounce.ts +29 -0
  51. package/src/look/ao-reach.ts +39 -0
  52. package/src/look/auto-exposure.ts +264 -0
  53. package/src/look/default-tone-mapping.ts +44 -0
  54. package/src/look/exposure-graph.ts +208 -0
  55. package/src/look/exposure-readback.ts +97 -0
  56. package/src/look/exposure-settings.ts +132 -0
  57. package/src/look/filmic-tone-mapping.ts +852 -0
  58. package/src/look/gi-registry.ts +55 -0
  59. package/src/look/local-exposure.ts +507 -0
  60. package/src/look/look-diagnostics.ts +24 -0
  61. package/src/look/motion-blur.ts +42 -0
  62. package/src/look/quality.ts +309 -0
  63. package/src/look/reflection-trace.ts +344 -0
  64. package/src/look/unreal-bloom.ts +295 -0
  65. package/src/look/vignette.ts +14 -0
  66. package/src/look/world-environment.ts +2033 -0
  67. package/src/loop.ts +25 -1
  68. package/src/merge-parts.ts +25 -10
  69. package/src/model-lod.ts +14 -0
  70. package/src/net-session.ts +58 -14
  71. package/src/ocean/spectral.ts +41 -7
  72. package/src/picking.ts +72 -5
  73. package/src/platform.ts +29 -1
  74. package/src/playtest.ts +54 -8
  75. package/src/profiling/FrameCounters.ts +166 -5
  76. package/src/profiling/FrameStages.ts +289 -0
  77. package/src/profiling/Spans.ts +39 -25
  78. package/src/profiling/debug-telemetry.ts +312 -0
  79. package/src/profiling/scene-warning.ts +42 -6
  80. package/src/projection-apply.ts +11 -3
  81. package/src/projection-content.ts +189 -0
  82. package/src/projection-marker.ts +6 -2
  83. package/src/projection-plan.ts +279 -28
  84. package/src/projection-skinned.ts +620 -5
  85. package/src/projection-stability.ts +16 -0
  86. package/src/projection-uniform.ts +5 -1
  87. package/src/quiet-markers.ts +56 -0
  88. package/src/render/budget-ladder.ts +256 -0
  89. package/src/render/chain.ts +89 -7
  90. package/src/render/exposure-units.ts +59 -0
  91. package/src/render/frame-time-budget.ts +162 -0
  92. package/src/render/gi-budget.ts +231 -0
  93. package/src/render/gi-visualize.ts +49 -0
  94. package/src/render/material-key.ts +1 -0
  95. package/src/render/probe-volume.ts +196 -36
  96. package/src/render/rough-diffuse.ts +177 -0
  97. package/src/render/scene-trace.ts +532 -0
  98. package/src/render/shadow-filter-budget.ts +237 -0
  99. package/src/render/sky-capture.ts +194 -0
  100. package/src/render/soft-shadow.ts +607 -0
  101. package/src/render/surface-cache.ts +418 -0
  102. package/src/render/traced-reflections.ts +408 -0
  103. package/src/render/two-sided-foliage.ts +120 -0
  104. package/src/render/virtual-shadow-pages.ts +112 -12
  105. package/src/render/virtual-shadow.ts +386 -38
  106. package/src/render-camera-cull.ts +536 -31
  107. package/src/render-pass-budget.ts +140 -22
  108. package/src/renderProjection.ts +65 -9
  109. package/src/renderer-config.ts +3 -2
  110. package/src/renderer.ts +289 -14
  111. package/src/resolution-scaler.ts +65 -7
  112. package/src/skeletal-mesh.ts +4 -0
  113. package/src/snow-field.ts +46 -0
  114. package/src/softbody.ts +6 -5
  115. package/src/startup-offscreen-bytes.ts +168 -0
  116. package/src/startup-readiness.ts +137 -2
  117. package/src/ui-bridge.ts +38 -0
  118. package/src/ui-hit-regions.ts +6 -2
  119. package/src/ui-layer.ts +1 -0
  120. package/src/ui-state.ts +32 -3
  121. package/src/version.ts +1 -1
  122. package/src/viewport.ts +8 -5
  123. package/src/warmup.ts +76 -10
  124. package/src/worker-audio.ts +579 -0
  125. package/src/worker.ts +842 -0
  126. package/src/world-cells.ts +4 -1
  127. package/gpl/LICENSE.GPL +0 -117
  128. package/gpl/convert.py +0 -192
  129. package/gpl/fixtures/make_world_fixture.py +0 -184
  130. package/gpl/recipes/_common.py +0 -180
  131. package/gpl/recipes/bake_ao.py +0 -111
  132. package/gpl/recipes/decimate.py +0 -70
  133. package/gpl/recipes/export_world.py +0 -699
  134. package/gpl/recipes/retarget.py +0 -131
  135. package/gpl/recipes/unwrap.py +0 -71
  136. package/mcp/blender-server.mjs +0 -689
  137. package/mcp/blender.mjs +0 -26
@@ -25,7 +25,7 @@ index 0bb9262cd029f411933d077fd44197a51ec5e8e9..868a634b4294be5f32664912a50813d5
25
25
  * Constructs a new batched mesh.
26
26
  *
27
27
  diff --git a/build/three.webgpu.js b/build/three.webgpu.js
28
- index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b83561c3c 100644
28
+ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..754d9674a2398367cacecbfaaaca526db6edcf41 100644
29
29
  --- a/build/three.webgpu.js
30
30
  +++ b/build/three.webgpu.js
31
31
  @@ -141,6 +141,15 @@ class NodeMaterialObserver {
@@ -329,20 +329,20 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
329
329
 
330
330
  - OnObjectUpdate( ( { object } ) => {
331
331
  + const updatePrevious = ( object, array ) => {
332
-
333
- - const previousInstanceData = _previousInstanceMatrices.get( object );
332
+ +
334
333
  + const { previousInstanceMatrix } = _previousInstanceMatrices.get( object );
335
334
  + previousInstanceMatrix.array.set( array );
336
335
  + previousInstanceMatrix.needsUpdate = true;
337
336
  + const interleaved = _matrixBuffers.get( previousInstanceMatrix );
338
337
  + if ( interleaved !== undefined ) interleaved.needsUpdate = true;
339
-
340
- - previousInstanceData.previousInstanceMatrix.array.set( matrices.array );
341
- + };
342
338
  +
339
+ + };
340
+
341
+ - const previousInstanceData = _previousInstanceMatrices.get( object );
343
342
  + // Scheduled history must reach the GPU in this draw, before the geometry uploads.
344
343
  + OnBeforeObjectUpdate( ( { object } ) => {
345
- +
344
+
345
+ - previousInstanceData.previousInstanceMatrix.array.set( matrices.array );
346
346
  + const scheduledPrevious = object[ Symbol.for( 'threenative.velocity.previousInstanceMatrices' ) ];
347
347
  + if ( scheduledPrevious !== undefined ) updatePrevious( object, scheduledPrevious );
348
348
  +
@@ -383,34 +383,96 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
383
383
  const transformedNormal = normalLocal.div( vec3( bm[ 0 ].dot( bm[ 0 ] ), bm[ 1 ].dot( bm[ 1 ] ), bm[ 2 ].dot( bm[ 2 ] ) ) );
384
384
 
385
385
  const batchingNormal = bm.mul( transformedNormal ).xyz;
386
- @@ -18745,7 +18861,15 @@ function getPreviousSkinnedPosition( skinnedMesh, bindMatrixNode, bindMatrixInve
386
+ @@ -18713,6 +18829,31 @@ function getSkinnedNormalAndTangent( boneMatrices, normal, tangent, bindMatrix,
387
387
 
388
- }
388
+ }
389
389
 
390
- - return getSkinnedPosition( data.node, positionPrevious, bindMatrixNode, bindMatrixInverseNode, skinIndexNode, skinWeightNode );
390
+ +/**
391
+ + * The previous frame's bone matrices for one skeleton, created on first use at the current pose
392
+ + * so a skeleton's first frame has zero skin motion.
393
+ + *
394
+ + * @param {Skeleton} skeleton - The skeleton.
395
+ + * @returns {{previousBoneMatrices: Float32Array}} The skeleton's bone history.
396
+ + */
397
+ +function previousBoneMatricesData( skeleton ) {
398
+ +
399
+ + let data = _previousBoneMatricesData.get( skeleton );
400
+ +
401
+ + if ( data === undefined ) {
402
+ +
403
+ + skeleton.update();
404
+ +
405
+ + data = { previousBoneMatrices: new Float32Array( skeleton.boneMatrices ) };
406
+ +
407
+ + _previousBoneMatricesData.set( skeleton, data );
408
+ +
409
+ + }
410
+ +
411
+ + return data;
412
+ +
413
+ +}
414
+ +
415
+ /**
416
+ * Retrieves or initializes the previous frame skinned position node for motion vectors.
417
+ * Uses a WeakMap to cache previous frame bone matrix arrays and their TSL buffer nodes.
418
+ @@ -18726,26 +18867,25 @@ function getSkinnedNormalAndTangent( boneMatrices, normal, tangent, bindMatrix,
419
+ */
420
+ function getPreviousSkinnedPosition( skinnedMesh, bindMatrixNode, bindMatrixInverseNode, skinIndexNode, skinWeightNode ) {
421
+
422
+ - const skeleton = skinnedMesh.skeleton;
423
+ -
424
+ - let data = _previousBoneMatricesData.get( skeleton );
425
+ -
426
+ - if ( data === undefined ) {
427
+ + // Meshes that share a material and geometry share this program, so the bone history is the
428
+ + // drawn object's own skeleton's, resolved per object like the current bones, never the
429
+ + // skeleton the program happened to be built for.
430
+ + const previousBoneMatricesNode = buffer( previousBoneMatricesData( skinnedMesh.skeleton ).previousBoneMatrices, 'mat4', skinnedMesh.skeleton.bones.length ).onObjectUpdate( ( { object } ) => {
431
+
432
+ - skeleton.update();
433
+ + const mesh = object?.isSkinnedMesh === true ? object : skinnedMesh;
434
+ + return previousBoneMatricesData( mesh.skeleton ).previousBoneMatrices;
435
+
436
+ - const previousBoneMatrices = new Float32Array( skeleton.boneMatrices );
437
+ + } );
438
+
439
+ - data = {
440
+ - previousBoneMatrices,
441
+ - node: buffer( previousBoneMatrices, 'mat4', skeleton.bones.length )
442
+ - };
391
443
  + // The previous bones and world matrix must use the same frame's bind inverse.
392
444
  + const previousBindMatrixInverse = uniform( skinnedMesh.bindMatrixInverse, 'mat4' ).onObjectUpdate( ( { object } ) => {
393
- +
445
+
446
+ - _previousBoneMatricesData.set( skeleton, data );
394
447
  + const mesh = object?.isSkinnedMesh === true ? object : skinnedMesh;
395
448
  + return mesh[ Symbol.for( 'threenative.velocity.previousBindMatrixInverse' ) ] ?? mesh.bindMatrixInverse;
396
- +
449
+
450
+ - }
397
451
  + } );
398
- +
399
- + return getSkinnedPosition( data.node, positionPrevious, bindMatrixNode, previousBindMatrixInverse, skinIndexNode, skinWeightNode );
452
+
453
+ - return getSkinnedPosition( data.node, positionPrevious, bindMatrixNode, bindMatrixInverseNode, skinIndexNode, skinWeightNode );
454
+ + return getSkinnedPosition( previousBoneMatricesNode, positionPrevious, bindMatrixNode, previousBindMatrixInverse, skinIndexNode, skinWeightNode );
400
455
 
401
456
  }
402
457
 
403
- @@ -18777,7 +18901,8 @@ const skinning = /*@__PURE__*/ Fn( ( [ skinnedMesh ], builder ) => {
458
+ @@ -18773,11 +18913,14 @@ const skinning = /*@__PURE__*/ Fn( ( [ skinnedMesh ], builder ) => {
459
+
460
+ _skeletonsUpdated.set( skeleton, frameId );
461
+
462
+ - const skeletonData = _previousBoneMatricesData.get( skeleton );
463
+ + // A scheduled history means velocity is on: the skeleton gets its own history even when
464
+ + // the program was built for another skeleton.
465
+ + const scheduledPrevious = object[ Symbol.for( 'threenative.velocity.previousBoneMatrices' ) ];
466
+ + const skeletonData = scheduledPrevious !== undefined ? previousBoneMatricesData( skeleton ) : _previousBoneMatricesData.get( skeleton );
404
467
 
405
468
  if ( skeletonData !== undefined ) {
406
469
 
407
470
  - skeletonData.previousBoneMatrices.set( skeleton.boneMatrices );
408
- + const scheduledPrevious = object[ Symbol.for( 'threenative.velocity.previousBoneMatrices' ) ];
409
471
  + skeletonData.previousBoneMatrices.set( scheduledPrevious ?? skeleton.boneMatrices );
410
472
 
411
473
  }
412
474
 
413
- @@ -18844,7 +18969,8 @@ const computeSkinning = /*@__PURE__*/ Fn( ( [ skinnedMesh, toPosition = null ],
475
+ @@ -18844,7 +18987,8 @@ const computeSkinning = /*@__PURE__*/ Fn( ( [ skinnedMesh, toPosition = null ],
414
476
 
415
477
  if ( state !== undefined ) {
416
478
 
@@ -420,7 +482,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
420
482
 
421
483
  }
422
484
 
423
- @@ -23151,6 +23277,31 @@ class CubeRenderTarget extends RenderTarget {
485
+ @@ -23151,6 +23295,31 @@ class CubeRenderTarget extends RenderTarget {
424
486
  }
425
487
 
426
488
  const _cache$1 = new WeakMap();
@@ -452,7 +514,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
452
514
 
453
515
  /**
454
516
  * This node can be used to automatically convert environment maps in the
455
- @@ -26107,11 +26258,11 @@ class PMREMGenerator {
517
+ @@ -26107,11 +26276,11 @@ class PMREMGenerator {
456
518
  */
457
519
  async fromEquirectangularAsync( equirectangular, renderTarget = null ) {
458
520
 
@@ -467,7 +529,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
467
529
 
468
530
  }
469
531
 
470
- @@ -26151,11 +26302,11 @@ class PMREMGenerator {
532
+ @@ -26151,11 +26320,11 @@ class PMREMGenerator {
471
533
  */
472
534
  async fromCubemapAsync( cubemap, renderTarget = null ) {
473
535
 
@@ -482,7 +544,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
482
544
 
483
545
  }
484
546
 
485
- @@ -26277,6 +26428,171 @@ class PMREMGenerator {
547
+ @@ -26277,6 +26446,171 @@ class PMREMGenerator {
486
548
 
487
549
  }
488
550
 
@@ -496,8 +558,8 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
496
558
  + try {
497
559
  +
498
560
  + this._init( cubeUVRenderTarget );
499
- + // One fence covers as much queued work as the heaviest single face (the first GGX filter pass).
500
- + this._fenceBudget = this._sizeLods[ 1 ] * this._sizeLods[ 1 ] * GGX_SAMPLES;
561
+ + // One fence covers the heaviest single face (the first GGX filter pass), never less than a 256 cube's: a fence waits behind every queued frame.
562
+ + this._fenceBudget = Math.max( 128 * 128, this._sizeLods[ 1 ] * this._sizeLods[ 1 ] ) * GGX_SAMPLES;
501
563
  + this._fencePending = 0;
502
564
  + await this._textureToCubeUVAsync( texture, cubeUVRenderTarget );
503
565
  + await this._applyPMREMAsync( cubeUVRenderTarget );
@@ -654,7 +716,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
654
716
  _allocateTarget( depthBuffer ) {
655
717
 
656
718
  const width = 3 * Math.max( this._cubeSize, 16 * 7 );
657
- @@ -26917,6 +27233,14 @@ function _generateCubeUVSize( imageHeight ) {
719
+ @@ -26917,6 +27251,14 @@ function _generateCubeUVSize( imageHeight ) {
658
720
  function _getPMREMFromTexture( texture, renderer, generator ) {
659
721
 
660
722
  const cache = _getCache( renderer );
@@ -669,7 +731,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
669
731
 
670
732
  let cacheTexture = cache.get( texture );
671
733
 
672
- @@ -26925,6 +27249,25 @@ function _getPMREMFromTexture( texture, renderer, generator ) {
734
+ @@ -26925,6 +27267,25 @@ function _getPMREMFromTexture( texture, renderer, generator ) {
673
735
  if ( pmremVersion !== texture.pmremVersion ) {
674
736
 
675
737
  const image = texture.image;
@@ -695,7 +757,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
695
757
 
696
758
  if ( texture.isCubeTexture ) {
697
759
 
698
- @@ -26955,28 +27298,7 @@ function _getPMREMFromTexture( texture, renderer, generator ) {
760
+ @@ -26955,28 +27316,7 @@ function _getPMREMFromTexture( texture, renderer, generator ) {
699
761
 
700
762
  cacheTexture.pmremVersion = texture.pmremVersion;
701
763
 
@@ -725,7 +787,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
725
787
 
726
788
  //
727
789
 
728
- @@ -27031,6 +27353,95 @@ class PMREMNode extends TempNode {
790
+ @@ -27031,6 +27371,95 @@ class PMREMNode extends TempNode {
729
791
 
730
792
  }
731
793
 
@@ -821,7 +883,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
821
883
  /**
822
884
  * Constructs a new function overloading node.
823
885
  *
824
- @@ -27217,7 +27628,7 @@ class PMREMNode extends TempNode {
886
+ @@ -27217,7 +27646,7 @@ class PMREMNode extends TempNode {
825
887
  // PMREMGenerator renders into a render target with inverted Y, so its output needs the Y
826
888
  // flip on sampling. Externally authored PMREMs follow the standard convention and don't.
827
889
 
@@ -830,7 +892,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
830
892
  ? materialEnvRotation.mul( vec3( uvNode.x, uvNode.y.negate(), uvNode.z ) )
831
893
  : materialEnvRotation.mul( uvNode );
832
894
 
833
- @@ -29911,6 +30322,18 @@ class RenderObject {
895
+ @@ -29911,6 +30340,18 @@ class RenderObject {
834
896
  */
835
897
  this._sourceMaterial = renderer._currentSourceMaterial;
836
898
 
@@ -849,7 +911,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
849
911
  /**
850
912
  * An event listener which is defined by `RenderObjects`. It performs
851
913
  * clean up tasks when `dispose()` on this render object.
852
- @@ -30098,7 +30521,7 @@ class RenderObject {
914
+ @@ -30098,7 +30539,7 @@ class RenderObject {
853
915
  */
854
916
  getChainArray() {
855
917
 
@@ -858,7 +920,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
858
920
 
859
921
  }
860
922
 
861
- @@ -30283,7 +30706,7 @@ class RenderObject {
923
+ @@ -30283,7 +30724,7 @@ class RenderObject {
862
924
  *
863
925
  * @return {string} The geometry cache key.
864
926
  */
@@ -867,7 +929,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
867
929
 
868
930
  const { geometry } = this;
869
931
 
870
- @@ -30311,12 +30734,14 @@ class RenderObject {
932
+ @@ -30311,12 +30752,14 @@ class RenderObject {
871
933
  const targets = geometry.morphAttributes[ name ];
872
934
 
873
935
  cacheKey += 'morph-' + name + ',';
@@ -883,7 +945,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
883
945
 
884
946
  }
885
947
 
886
- @@ -30548,6 +30973,7 @@ class RenderObject {
948
+ @@ -30548,6 +30991,7 @@ class RenderObject {
887
949
  }
888
950
 
889
951
  cacheKey = hash$1( cacheKey, this.renderer.contextNode.id, this.renderer.contextNode.version );
@@ -891,7 +953,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
891
953
 
892
954
  return cacheKey;
893
955
 
894
- @@ -30680,6 +31106,8 @@ class RenderObjects {
956
+ @@ -30680,6 +31124,8 @@ class RenderObjects {
895
957
  _chainKeys$3[ 1 ] = material;
896
958
  _chainKeys$3[ 2 ] = renderContext;
897
959
  _chainKeys$3[ 3 ] = lightsNode;
@@ -900,7 +962,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
900
962
 
901
963
  //
902
964
 
903
- @@ -30707,9 +31135,18 @@ class RenderObjects {
965
+ @@ -30707,9 +31153,18 @@ class RenderObjects {
904
966
 
905
967
  }
906
968
 
@@ -908,20 +970,20 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
908
970
  + // When the renderer is drawing through an override material, that material is shared by
909
971
  + // the whole pass and mutated per object, so its `version` alone answers the wrong
910
972
  + // question. The source material this object actually carries answers the right one.
911
- +
973
+
974
+ - if ( renderObject.initialCacheKey !== renderObject.getCacheKey() ) {
912
975
  + const sourceMaterial = this.renderer._currentSourceMaterial;
913
976
  + const sourceTracked = sourceMaterial !== null && sourceMaterial !== undefined;
914
977
  + const sourceReplaced = sourceTracked && renderObject._sourceMaterial !== sourceMaterial;
915
978
  + const sourceChanged = sourceTracked && ( sourceReplaced || renderObject.sourceVersion !== sourceMaterial.version );
916
979
  +
917
980
  + if ( renderObject.version !== material.version || sourceChanged || renderObject.needsUpdate ) {
918
-
919
- - if ( renderObject.initialCacheKey !== renderObject.getCacheKey() ) {
981
+ +
920
982
  + if ( sourceReplaced || renderObject.initialCacheKey !== renderObject.getCacheKey() ) {
921
983
 
922
984
  renderObject.dispose();
923
985
 
924
- @@ -30719,6 +31156,8 @@ class RenderObjects {
986
+ @@ -30719,6 +31174,8 @@ class RenderObjects {
925
987
 
926
988
  renderObject.version = material.version;
927
989
 
@@ -930,7 +992,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
930
992
  }
931
993
 
932
994
  }
933
- @@ -30731,6 +31170,7 @@ class RenderObjects {
995
+ @@ -30731,6 +31188,7 @@ class RenderObjects {
934
996
  _chainKeys$3[ 1 ] = null;
935
997
  _chainKeys$3[ 2 ] = null;
936
998
  _chainKeys$3[ 3 ] = null;
@@ -938,7 +1000,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
938
1000
 
939
1001
  //
940
1002
 
941
- @@ -31165,6 +31605,14 @@ class Geometries extends DataMap {
1003
+ @@ -31165,6 +31623,14 @@ class Geometries extends DataMap {
942
1004
  */
943
1005
  this._geometryDisposeListeners = new Map();
944
1006
 
@@ -953,7 +1015,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
953
1015
  }
954
1016
 
955
1017
  /**
956
- @@ -31190,10 +31638,69 @@ class Geometries extends DataMap {
1018
+ @@ -31190,10 +31656,69 @@ class Geometries extends DataMap {
957
1019
 
958
1020
  if ( this.has( renderObject ) === false ) this.initGeometry( renderObject );
959
1021
 
@@ -1023,7 +1085,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1023
1085
  /**
1024
1086
  * Initializes the geometry of the given render object.
1025
1087
  *
1026
- @@ -32771,7 +33278,7 @@ class Bindings extends DataMap {
1088
+ @@ -32771,7 +33296,7 @@ class Bindings extends DataMap {
1027
1089
  */
1028
1090
  updateForRender( renderObject ) {
1029
1091
 
@@ -1032,7 +1094,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1032
1094
 
1033
1095
  }
1034
1096
 
1035
- @@ -32918,12 +33425,13 @@ class Bindings extends DataMap {
1097
+ @@ -32918,12 +33443,13 @@ class Bindings extends DataMap {
1036
1098
  * Updates the given array of bindings.
1037
1099
  *
1038
1100
  * @param {Array<BindGroup>} bindings - The bind groups.
@@ -1048,7 +1110,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1048
1110
 
1049
1111
  }
1050
1112
 
1051
- @@ -32934,11 +33442,27 @@ class Bindings extends DataMap {
1113
+ @@ -32934,11 +33460,27 @@ class Bindings extends DataMap {
1052
1114
  *
1053
1115
  * @param {BindGroup} bindGroup - The bind group to update.
1054
1116
  * @param {Array<BindGroup>} bindings - The bind groups.
@@ -1077,7 +1139,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1077
1139
  let needsBindingsUpdate = false;
1078
1140
  let cacheBindings = true;
1079
1141
  let cacheIndex = 0;
1080
- @@ -32948,12 +33472,32 @@ class Bindings extends DataMap {
1142
+ @@ -32948,12 +33490,32 @@ class Bindings extends DataMap {
1081
1143
 
1082
1144
  for ( const binding of bindGroup.bindings ) {
1083
1145
 
@@ -1112,7 +1174,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1112
1174
 
1113
1175
  //
1114
1176
 
1115
- @@ -33952,7 +34496,8 @@ class RenderContexts {
1177
+ @@ -33952,7 +34514,8 @@ class RenderContexts {
1116
1178
 
1117
1179
  }
1118
1180
 
@@ -1122,7 +1184,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1122
1184
 
1123
1185
  renderState.clearDepthValue = this.renderer.getClearDepth();
1124
1186
  renderState.clearStencilValue = this.renderer.getClearStencil();
1125
- @@ -34020,6 +34565,10 @@ class Textures extends DataMap {
1187
+ @@ -34020,6 +34583,10 @@ class Textures extends DataMap {
1126
1188
  * @type {Set<HTMLTexture>}
1127
1189
  */
1128
1190
  this._htmlTextures = new Set();
@@ -1133,7 +1195,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1133
1195
 
1134
1196
  }
1135
1197
 
1136
- @@ -34169,7 +34718,16 @@ class Textures extends DataMap {
1198
+ @@ -34169,7 +34736,16 @@ class Textures extends DataMap {
1137
1199
  */
1138
1200
  updateTexture( texture, options = {} ) {
1139
1201
 
@@ -1150,7 +1212,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1150
1212
  if ( textureData.initialized === true && textureData.version === texture.version ) return;
1151
1213
 
1152
1214
  const isRenderTarget = texture.isRenderTargetTexture || texture.isDepthTexture || texture.isFramebufferTexture;
1153
- @@ -34181,6 +34739,21 @@ class Textures extends DataMap {
1215
+ @@ -34181,6 +34757,21 @@ class Textures extends DataMap {
1154
1216
 
1155
1217
  backend.destroyTexture( texture );
1156
1218
 
@@ -1172,7 +1234,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1172
1234
  }
1173
1235
 
1174
1236
  //
1175
- @@ -34318,7 +34891,16 @@ class Textures extends DataMap {
1237
+ @@ -34318,7 +34909,16 @@ class Textures extends DataMap {
1176
1238
 
1177
1239
  }
1178
1240
 
@@ -1190,7 +1252,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1190
1252
 
1191
1253
  const skipAutoGeneration = texture.isStorageTexture === true && texture.mipmapsAutoUpdate === false;
1192
1254
 
1193
- @@ -34328,7 +34910,7 @@ class Textures extends DataMap {
1255
+ @@ -34328,7 +34928,7 @@ class Textures extends DataMap {
1194
1256
 
1195
1257
  }
1196
1258
 
@@ -1199,7 +1261,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1199
1261
 
1200
1262
  }
1201
1263
 
1202
- @@ -34345,6 +34927,17 @@ class Textures extends DataMap {
1264
+ @@ -34345,6 +34945,17 @@ class Textures extends DataMap {
1203
1265
 
1204
1266
  }
1205
1267
 
@@ -1217,7 +1279,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1217
1279
  // dispose handler
1218
1280
 
1219
1281
  if ( textureData.initialized !== true ) {
1220
- @@ -34377,9 +34970,134 @@ class Textures extends DataMap {
1282
+ @@ -34377,9 +34988,134 @@ class Textures extends DataMap {
1221
1283
 
1222
1284
  }
1223
1285
 
@@ -1354,7 +1416,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1354
1416
 
1355
1417
  }
1356
1418
 
1357
- @@ -34557,6 +35275,8 @@ class Textures extends DataMap {
1419
+ @@ -34557,6 +35293,8 @@ class Textures extends DataMap {
1358
1420
  */
1359
1421
  _destroyTexture( texture ) {
1360
1422
 
@@ -1363,7 +1425,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1363
1425
  if ( this.has( texture ) === true ) {
1364
1426
 
1365
1427
  const textureData = this.get( texture );
1366
- @@ -39725,7 +40445,8 @@ class VelocityNode extends TempNode {
1428
+ @@ -39725,7 +40463,8 @@ class VelocityNode extends TempNode {
1367
1429
 
1368
1430
  const previousModelMatrix = getPreviousMatrix( object );
1369
1431
 
@@ -1373,7 +1435,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1373
1435
 
1374
1436
  //
1375
1437
 
1376
- @@ -40270,7 +40991,7 @@ class PassMultipleTextureNode extends PassTextureNode {
1438
+ @@ -40270,7 +41009,7 @@ class PassMultipleTextureNode extends PassTextureNode {
1377
1439
  * @param {string} textureName - The output texture name.
1378
1440
  * @param {boolean} [previousTexture=false] - Whether previous frame data should be used or not.
1379
1441
  */
@@ -1382,7 +1444,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1382
1444
 
1383
1445
  // null is passed to the super call since this class does not
1384
1446
  // use an external texture for rendering pass data into. Instead
1385
- @@ -40291,6 +41012,8 @@ class PassMultipleTextureNode extends PassTextureNode {
1447
+ @@ -40291,6 +41030,8 @@ class PassMultipleTextureNode extends PassTextureNode {
1386
1448
  * @type {boolean}
1387
1449
  */
1388
1450
  this.previousTexture = previousTexture;
@@ -1391,7 +1453,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1391
1453
 
1392
1454
  /**
1393
1455
  * This flag can be used for type testing.
1394
- @@ -40312,17 +41035,33 @@ class PassMultipleTextureNode extends PassTextureNode {
1456
+ @@ -40312,17 +41053,33 @@ class PassMultipleTextureNode extends PassTextureNode {
1395
1457
 
1396
1458
  }
1397
1459
 
@@ -1426,7 +1488,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1426
1488
  newNode.uvNode = this.uvNode;
1427
1489
  newNode.levelNode = this.levelNode;
1428
1490
  newNode.biasNode = this.biasNode;
1429
- @@ -40503,6 +41242,8 @@ class PassNode extends TempNode {
1491
+ @@ -40503,6 +41260,8 @@ class PassNode extends TempNode {
1430
1492
  * @type {Object<string, TextureNode>}
1431
1493
  */
1432
1494
  this._textureNodes = {};
@@ -1435,7 +1497,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1435
1497
 
1436
1498
  /**
1437
1499
  * A dictionary holding the internal depth nodes.
1438
- @@ -40809,6 +41550,7 @@ class PassNode extends TempNode {
1500
+ @@ -40809,6 +41568,7 @@ class PassNode extends TempNode {
1439
1501
  this._previousTextures[ name ] = texture;
1440
1502
 
1441
1503
  this._textureNodes[ name ].updateTexture();
@@ -1443,7 +1505,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1443
1505
  this._previousTextureNodes[ name ].updateTexture();
1444
1506
 
1445
1507
  }
1446
- @@ -40821,6 +41563,17 @@ class PassNode extends TempNode {
1508
+ @@ -40821,6 +41581,17 @@ class PassNode extends TempNode {
1447
1509
  * @param {string} [name='output'] - The output name to get the texture node for.
1448
1510
  * @return {TextureNode} The texture node.
1449
1511
  */
@@ -1461,7 +1523,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1461
1523
  getTextureNode( name = 'output' ) {
1462
1524
 
1463
1525
  let textureNode = this._textureNodes[ name ];
1464
- @@ -41163,6 +41916,7 @@ class PassNode extends TempNode {
1526
+ @@ -41163,6 +41934,7 @@ class PassNode extends TempNode {
1465
1527
  */
1466
1528
  dispose() {
1467
1529
 
@@ -1469,7 +1531,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1469
1531
  this.renderTarget.dispose();
1470
1532
 
1471
1533
  }
1472
- @@ -44431,6 +45185,46 @@ var RendererUtils = /*#__PURE__*/Object.freeze({
1534
+ @@ -44431,6 +45203,46 @@ var RendererUtils = /*#__PURE__*/Object.freeze({
1473
1535
 
1474
1536
  const shadowMaterialLib = /*@__PURE__*/ new WeakMap();
1475
1537
 
@@ -1516,7 +1578,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1516
1578
  /**
1517
1579
  * A shadow filtering function performing basic filtering. This is in fact an unfiltered version of the shadow map
1518
1580
  * with a binary `[0,1]` result.
1519
- @@ -44485,8 +45279,8 @@ const PCFShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, shadowCoord, shadow,
1581
+ @@ -44485,8 +45297,8 @@ const PCFShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, shadowCoord, shadow,
1520
1582
 
1521
1583
  };
1522
1584
 
@@ -1527,7 +1589,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1527
1589
 
1528
1590
  const texelSize = vec2( 1 ).div( mapSize );
1529
1591
  const radiusScaled = radius.mul( texelSize.x );
1530
- @@ -44517,7 +45311,7 @@ const PCFShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, shadowCoord, shadow,
1592
+ @@ -44517,7 +45329,7 @@ const PCFShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, shadowCoord, shadow,
1531
1593
  */
1532
1594
  const PCFSoftShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, shadowCoord, shadow, depthLayer } ) => {
1533
1595
 
@@ -1536,7 +1598,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1536
1598
 
1537
1599
  const texelSize = vec2( 1 ).div( mapSize );
1538
1600
 
1539
- @@ -45586,8 +46380,8 @@ const BasicPointShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, bd3D, dp } )
1601
+ @@ -45586,8 +46398,8 @@ const BasicPointShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, bd3D, dp } )
1540
1602
  */
1541
1603
  const PointShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, bd3D, dp, shadow } ) => {
1542
1604
 
@@ -1547,7 +1609,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1547
1609
 
1548
1610
  const texelSize = radius.div( mapSize.x );
1549
1611
 
1550
- @@ -45623,9 +46417,9 @@ const pointShadowFilter = /*@__PURE__*/ Fn( ( { filterFn, depthTexture, shadowCo
1612
+ @@ -45623,9 +46435,9 @@ const pointShadowFilter = /*@__PURE__*/ Fn( ( { filterFn, depthTexture, shadowCo
1551
1613
  const shadowPositionAbs = shadowPosition.abs().toConst();
1552
1614
  const viewZ = shadowPositionAbs.x.max( shadowPositionAbs.y ).max( shadowPositionAbs.z );
1553
1615
 
@@ -1560,7 +1622,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1560
1622
 
1561
1623
  const result = float( 1.0 ).toVar();
1562
1624
 
1563
- @@ -53841,7 +54635,7 @@ class NodeBuilder {
1625
+ @@ -53841,7 +54653,7 @@ class NodeBuilder {
1564
1626
 
1565
1627
  const mrt = this.renderer.getMRT();
1566
1628
 
@@ -1569,7 +1631,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1569
1631
 
1570
1632
  }
1571
1633
 
1572
- @@ -55244,15 +56038,17 @@ class NodeManager extends DataMap {
1634
+ @@ -55244,15 +56056,17 @@ class NodeManager extends DataMap {
1573
1635
  * Returns `true` if the given node uniforms group must be updated or not.
1574
1636
  *
1575
1637
  * @param {NodeUniformsGroup} nodeUniformsGroup - The node uniforms group.
@@ -1590,7 +1652,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1590
1652
 
1591
1653
  // check for update
1592
1654
 
1593
- @@ -56056,6 +56852,21 @@ class NodeManager extends DataMap {
1655
+ @@ -56056,6 +56870,21 @@ class NodeManager extends DataMap {
1594
1656
 
1595
1657
  }
1596
1658
 
@@ -1612,7 +1674,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1612
1674
  /**
1613
1675
  * Triggers the call of `updateBefore()` methods
1614
1676
  * for all nodes of the given render object.
1615
- @@ -56065,9 +56876,14 @@ class NodeManager extends DataMap {
1677
+ @@ -56065,9 +56894,14 @@ class NodeManager extends DataMap {
1616
1678
  updateBefore( renderObject ) {
1617
1679
 
1618
1680
  const nodeBuilder = renderObject.getNodeBuilderState();
@@ -1627,7 +1689,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1627
1689
  // update frame state for each node
1628
1690
 
1629
1691
  this.getNodeFrameForRender( renderObject ).updateBeforeNode( node );
1630
- @@ -56085,10 +56901,11 @@ class NodeManager extends DataMap {
1692
+ @@ -56085,10 +56919,11 @@ class NodeManager extends DataMap {
1631
1693
  updateAfter( renderObject ) {
1632
1694
 
1633
1695
  const nodeBuilder = renderObject.getNodeBuilderState();
@@ -1640,7 +1702,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1640
1702
 
1641
1703
  this.getNodeFrameForRender( renderObject ).updateAfterNode( node );
1642
1704
 
1643
- @@ -56125,9 +56942,14 @@ class NodeManager extends DataMap {
1705
+ @@ -56125,9 +56960,14 @@ class NodeManager extends DataMap {
1644
1706
 
1645
1707
  const nodeFrame = this.getNodeFrameForRender( renderObject );
1646
1708
  const nodeBuilder = renderObject.getNodeBuilderState();
@@ -1655,7 +1717,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1655
1717
  nodeFrame.updateNode( node );
1656
1718
 
1657
1719
  }
1658
- @@ -60919,6 +61741,7 @@ class Renderer {
1720
+ @@ -60919,6 +61759,7 @@ class Renderer {
1659
1721
  //
1660
1722
 
1661
1723
  renderContext.camera = camera;
@@ -1663,7 +1725,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1663
1725
  this.backend.beginRender( renderContext );
1664
1726
 
1665
1727
  // process render lists
1666
- @@ -60931,13 +61754,23 @@ class Renderer {
1728
+ @@ -60931,13 +61772,23 @@ class Renderer {
1667
1729
  opaque: opaqueObjects
1668
1730
  } = renderList;
1669
1731
 
@@ -1676,20 +1738,20 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1676
1738
 
1677
1739
  - // finish render pass
1678
1740
  + renderComplete = true;
1679
-
1680
- - this.backend.finishRender( renderContext );
1741
+ +
1681
1742
  + } finally {
1682
1743
  +
1683
1744
  + try {
1684
1745
  +
1685
1746
  + if ( renderComplete ) this.backend.finishRender( renderContext );
1686
1747
  + else if ( this.backend.get( renderContext )._tnDepth ) this.backend._abortTransientDepth( renderContext );
1687
- +
1748
+
1749
+ - this.backend.finishRender( renderContext );
1688
1750
  + } finally {
1689
1751
 
1690
1752
  // restore render tree
1691
1753
 
1692
- @@ -60952,6 +61785,9 @@ class Renderer {
1754
+ @@ -60952,6 +61803,9 @@ class Renderer {
1693
1755
 
1694
1756
  this._callDepth --;
1695
1757
 
@@ -1699,7 +1761,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1699
1761
  if ( frameBufferTarget !== null ) {
1700
1762
 
1701
1763
  this.setRenderTarget( outputRenderTarget, activeCubeFace, activeMipmapLevel );
1702
- @@ -61118,6 +61954,18 @@ class Renderer {
1764
+ @@ -61118,6 +61972,18 @@ class Renderer {
1703
1765
 
1704
1766
  }
1705
1767
 
@@ -1718,7 +1780,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1718
1780
  /**
1719
1781
  * Can be used to transfer buffer data from a storage buffer attribute
1720
1782
  * from the GPU to the CPU in context of compute shaders.
1721
- @@ -62111,6 +62959,14 @@ class Renderer {
1783
+ @@ -62111,6 +62977,14 @@ class Renderer {
1722
1784
 
1723
1785
  }
1724
1786
 
@@ -1733,7 +1795,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1733
1795
  /**
1734
1796
  * Initializes the given render target.
1735
1797
  *
1736
- @@ -62604,7 +63460,8 @@ class Renderer {
1798
+ @@ -62604,7 +63478,8 @@ class Renderer {
1737
1799
  version,
1738
1800
  colorNode,
1739
1801
  depthNode,
@@ -1743,7 +1805,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1743
1805
  };
1744
1806
 
1745
1807
  this._cacheShadowNodes.set( material, cache );
1746
- @@ -62731,6 +63588,8 @@ class Renderer {
1808
+ @@ -62731,6 +63606,8 @@ class Renderer {
1747
1809
  let materialDisplacementMap;
1748
1810
  let materialDisplacementScale;
1749
1811
  let materialDisplacementBias;
@@ -1752,7 +1814,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1752
1814
 
1753
1815
  const previousSourceMaterial = this._currentSourceMaterial;
1754
1816
 
1755
- @@ -62756,6 +63615,8 @@ class Renderer {
1817
+ @@ -62756,6 +63633,8 @@ class Renderer {
1756
1818
  materialDisplacementMap = overrideMaterial.displacementMap;
1757
1819
  materialDisplacementScale = overrideMaterial.displacementScale;
1758
1820
  materialDisplacementBias = overrideMaterial.displacementBias;
@@ -1761,7 +1823,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1761
1823
 
1762
1824
  if ( material.positionNode && material.positionNode.isNode ) {
1763
1825
 
1764
- @@ -62763,7 +63624,15 @@ class Renderer {
1826
+ @@ -62763,7 +63642,15 @@ class Renderer {
1765
1827
 
1766
1828
  }
1767
1829
 
@@ -1778,7 +1840,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1778
1840
  overrideMaterial.alphaMap = material.alphaMap;
1779
1841
  overrideMaterial.displacementMap = material.displacementMap;
1780
1842
  overrideMaterial.displacementScale = material.displacementScale;
1781
- @@ -62774,7 +63643,7 @@ class Renderer {
1843
+ @@ -62774,7 +63661,7 @@ class Renderer {
1782
1844
 
1783
1845
  if ( overrideMaterial.isShadowPassMaterial ) {
1784
1846
 
@@ -1787,7 +1849,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1787
1849
 
1788
1850
  if ( this.shadowMap.type === VSMShadowMap ) {
1789
1851
 
1790
- @@ -62786,6 +63655,7 @@ class Renderer {
1852
+ @@ -62786,6 +63673,7 @@ class Renderer {
1791
1853
 
1792
1854
  }
1793
1855
 
@@ -1795,7 +1857,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1795
1857
  if ( colorNode !== null ) overrideMaterial.colorNode = colorNode;
1796
1858
  if ( depthNode !== null ) overrideMaterial.depthNode = depthNode;
1797
1859
  if ( positionNode !== null ) overrideMaterial.positionNode = positionNode;
1798
- @@ -62825,6 +63695,8 @@ class Renderer {
1860
+ @@ -62825,6 +63713,8 @@ class Renderer {
1799
1861
  scene.overrideMaterial.displacementMap = materialDisplacementMap;
1800
1862
  scene.overrideMaterial.displacementScale = materialDisplacementScale;
1801
1863
  scene.overrideMaterial.displacementBias = materialDisplacementBias;
@@ -1804,7 +1866,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1804
1866
 
1805
1867
  }
1806
1868
 
1807
- @@ -62886,18 +63758,17 @@ class Renderer {
1869
+ @@ -62886,18 +63776,17 @@ class Renderer {
1808
1870
 
1809
1871
  //
1810
1872
 
@@ -1833,7 +1895,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1833
1895
 
1834
1896
  this._pipelines.updateForRender( renderObject );
1835
1897
 
1836
- @@ -62907,7 +63778,7 @@ class Renderer {
1898
+ @@ -62907,7 +63796,7 @@ class Renderer {
1837
1899
 
1838
1900
  this.backend.draw( renderObject, this.info );
1839
1901
 
@@ -1842,7 +1904,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1842
1904
 
1843
1905
  }
1844
1906
 
1845
- @@ -76397,6 +77268,9 @@ class WebGPUTextureUtils {
1907
+ @@ -76397,6 +77286,9 @@ class WebGPUTextureUtils {
1846
1908
  */
1847
1909
  this._samplerCache = new Map();
1848
1910
 
@@ -1852,7 +1914,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1852
1914
  }
1853
1915
 
1854
1916
  /**
1855
- @@ -76613,7 +77487,12 @@ class WebGPUTextureUtils {
1917
+ @@ -76613,7 +77505,12 @@ class WebGPUTextureUtils {
1856
1918
 
1857
1919
  }
1858
1920
 
@@ -1866,7 +1928,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1866
1928
 
1867
1929
  usage |= GPUTextureUsage.RENDER_ATTACHMENT;
1868
1930
 
1869
- @@ -76686,6 +77565,23 @@ class WebGPUTextureUtils {
1931
+ @@ -76686,6 +77583,23 @@ class WebGPUTextureUtils {
1870
1932
  destroyTexture( texture, isDefaultTexture = false ) {
1871
1933
 
1872
1934
  const backend = this.backend;
@@ -1890,7 +1952,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1890
1952
  const textureData = backend.get( texture );
1891
1953
 
1892
1954
  if ( textureData.texture !== undefined && isDefaultTexture === false && texture.isExternalTexture !== true ) textureData.texture.destroy();
1893
- @@ -76726,7 +77622,7 @@ class WebGPUTextureUtils {
1955
+ @@ -76726,7 +77640,7 @@ class WebGPUTextureUtils {
1894
1956
  const colorTexture = canvasTarget.colorTexture;
1895
1957
  const colorTextureData = backend.get( colorTexture );
1896
1958
 
@@ -1899,7 +1961,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1899
1961
 
1900
1962
  return colorTextureData.texture;
1901
1963
 
1902
- @@ -76751,8 +77647,8 @@ class WebGPUTextureUtils {
1964
+ @@ -76751,8 +77665,8 @@ class WebGPUTextureUtils {
1903
1965
 
1904
1966
  //
1905
1967
 
@@ -1910,7 +1972,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
1910
1972
  colorTexture.samples = samples;
1911
1973
 
1912
1974
  colorTextureData.texture = colorBuffer;
1913
- @@ -76775,64 +77671,59 @@ class WebGPUTextureUtils {
1975
+ @@ -76775,64 +77689,59 @@ class WebGPUTextureUtils {
1914
1976
  const canvasTarget = backend.renderer.getCanvasTarget();
1915
1977
  const { width, height } = backend.getDrawingBufferSize();
1916
1978
  const samples = backend.renderer.currentSamples;
@@ -2003,7 +2065,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2003
2065
  /**
2004
2066
  * Uploads the updated texture data to the GPU.
2005
2067
  *
2006
- @@ -76987,6 +77878,143 @@ class WebGPUTextureUtils {
2068
+ @@ -76987,6 +77896,143 @@ class WebGPUTextureUtils {
2007
2069
 
2008
2070
  }
2009
2071
 
@@ -2147,7 +2209,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2147
2209
  /**
2148
2210
  * Returns texture data as a typed array.
2149
2211
  *
2150
- @@ -77060,6 +78088,8 @@ class WebGPUTextureUtils {
2212
+ @@ -77060,6 +78106,8 @@ class WebGPUTextureUtils {
2151
2213
  */
2152
2214
  dispose() {
2153
2215
 
@@ -2156,7 +2218,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2156
2218
  this._samplerCache.clear();
2157
2219
 
2158
2220
  }
2159
- @@ -78986,7 +80016,7 @@ class WGSLNodeBuilder extends NodeBuilder {
2221
+ @@ -78986,7 +80034,7 @@ class WGSLNodeBuilder extends NodeBuilder {
2160
2222
  * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture.
2161
2223
  * @return {string} The WGSL snippet.
2162
2224
  */
@@ -2165,7 +2227,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2165
2227
 
2166
2228
  if ( levelSnippet === null ) levelSnippet = '0u';
2167
2229
 
2168
- @@ -79004,7 +80034,14 @@ class WGSLNodeBuilder extends NodeBuilder {
2230
+ @@ -79004,7 +80052,14 @@ class WGSLNodeBuilder extends NodeBuilder {
2169
2231
 
2170
2232
  } else {
2171
2233
 
@@ -2181,7 +2243,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2181
2243
 
2182
2244
  if ( this.renderer.backend.compatibilityMode && texture.isDepthTexture ) {
2183
2245
 
2184
- @@ -79545,7 +80582,7 @@ class WGSLNodeBuilder extends NodeBuilder {
2246
+ @@ -79545,7 +80600,7 @@ class WGSLNodeBuilder extends NodeBuilder {
2185
2247
 
2186
2248
  // Cube textures always need samplers (they use textureSampleLevel, not textureLoad)
2187
2249
  // Also textureGather always need sampler.
@@ -2190,7 +2252,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2190
2252
 
2191
2253
  if ( needsSampler ) {
2192
2254
 
2193
- @@ -79586,7 +80623,8 @@ class WGSLNodeBuilder extends NodeBuilder {
2255
+ @@ -79586,7 +80641,8 @@ class WGSLNodeBuilder extends NodeBuilder {
2194
2256
 
2195
2257
  uniformGPU = buffer;
2196
2258
 
@@ -2200,7 +2262,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2200
2262
 
2201
2263
  } else {
2202
2264
 
2203
- @@ -79974,7 +81012,8 @@ ${ flowData.code }
2265
+ @@ -79974,7 +81030,8 @@ ${ flowData.code }
2204
2266
 
2205
2267
  for ( const { name, property, type } of builtins.values() ) {
2206
2268
 
@@ -2210,7 +2272,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2210
2272
 
2211
2273
  }
2212
2274
 
2213
- @@ -80230,6 +81269,8 @@ ${ flowData.code }
2275
+ @@ -80230,6 +81287,8 @@ ${ flowData.code }
2214
2276
  getVaryings( shaderStage ) {
2215
2277
 
2216
2278
  const snippets = [];
@@ -2219,7 +2281,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2219
2281
 
2220
2282
  if ( shaderStage === 'vertex' ) {
2221
2283
 
2222
- @@ -80252,7 +81293,12 @@ ${ flowData.code }
2284
+ @@ -80252,7 +81311,12 @@ ${ flowData.code }
2223
2285
 
2224
2286
  let attributesSnippet = `@location( ${ varyingIndex ++ } )`;
2225
2287
 
@@ -2233,7 +2295,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2233
2295
 
2234
2296
  const samplingSnippet = varying.interpolationSampling !== null ? `, ${ varying.interpolationSampling } )` : ' )';
2235
2297
 
2236
- @@ -80329,9 +81375,12 @@ ${ flowData.code }
2298
+ @@ -80329,9 +81393,12 @@ ${ flowData.code }
2237
2299
  const textureNode = uniform.node;
2238
2300
  const texture = textureNode.value;
2239
2301
 
@@ -2249,7 +2311,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2249
2311
 
2250
2312
  if ( needsSampler ) {
2251
2313
 
2252
- @@ -80353,7 +81402,7 @@ ${ flowData.code }
2314
+ @@ -80353,7 +81420,7 @@ ${ flowData.code }
2253
2315
 
2254
2316
  const { primarySamples } = backend.utils.getTextureSampleData( texture );
2255
2317
 
@@ -2258,7 +2320,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2258
2320
 
2259
2321
  multisampled = '_multisampled';
2260
2322
 
2261
- @@ -81107,7 +82156,19 @@ class WebGPUAttributeUtils {
2323
+ @@ -81107,7 +82174,19 @@ class WebGPUAttributeUtils {
2262
2324
 
2263
2325
  buffer.unmap();
2264
2326
 
@@ -2278,7 +2340,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2278
2340
 
2279
2341
  }
2280
2342
 
2281
- @@ -81128,6 +82189,13 @@ class WebGPUAttributeUtils {
2343
+ @@ -81128,6 +82207,13 @@ class WebGPUAttributeUtils {
2282
2344
  const bufferData = backend.get( bufferAttribute );
2283
2345
  const buffer = backend.get( bufferAttribute ).buffer;
2284
2346
 
@@ -2292,7 +2354,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2292
2354
  let array = bufferAttribute.array;
2293
2355
 
2294
2356
  const itemSize = bufferData._itemSize;
2295
- @@ -81209,6 +82277,9 @@ class WebGPUAttributeUtils {
2357
+ @@ -81209,6 +82295,9 @@ class WebGPUAttributeUtils {
2296
2358
 
2297
2359
  }
2298
2360
 
@@ -2302,7 +2364,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2302
2364
  }
2303
2365
 
2304
2366
  /**
2305
- @@ -81295,9 +82366,15 @@ class WebGPUAttributeUtils {
2367
+ @@ -81295,9 +82384,15 @@ class WebGPUAttributeUtils {
2306
2368
  destroyAttribute( attribute ) {
2307
2369
 
2308
2370
  const backend = this.backend;
@@ -2320,7 +2382,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2320
2382
 
2321
2383
  backend.delete( attribute );
2322
2384
 
2323
- @@ -81598,18 +82675,16 @@ class WebGPUBindingUtils {
2385
+ @@ -81598,18 +82693,16 @@ class WebGPUBindingUtils {
2324
2386
 
2325
2387
  const bindingsData = backend.get( bindGroup );
2326
2388
 
@@ -2344,7 +2406,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2344
2406
 
2345
2407
  // try to find an existing layout in the cache
2346
2408
 
2347
- @@ -81682,6 +82757,7 @@ class WebGPUBindingUtils {
2409
+ @@ -81682,6 +82775,7 @@ class WebGPUBindingUtils {
2348
2410
 
2349
2411
  }
2350
2412
 
@@ -2352,7 +2414,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2352
2414
  bindingsData.group = bindGroupGPU;
2353
2415
 
2354
2416
  }
2355
- @@ -81701,6 +82777,7 @@ class WebGPUBindingUtils {
2417
+ @@ -81701,6 +82795,7 @@ class WebGPUBindingUtils {
2356
2418
 
2357
2419
  const updateRanges = binding.updateRanges;
2358
2420
 
@@ -2360,7 +2422,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2360
2422
  if ( updateRanges.length === 0 ) {
2361
2423
 
2362
2424
  device.queue.writeBuffer(
2363
- @@ -81754,6 +82831,15 @@ class WebGPUBindingUtils {
2425
+ @@ -81754,6 +82849,15 @@ class WebGPUBindingUtils {
2364
2426
 
2365
2427
  }
2366
2428
 
@@ -2376,7 +2438,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2376
2438
  }
2377
2439
 
2378
2440
  /**
2379
- @@ -81830,7 +82916,20 @@ class WebGPUBindingUtils {
2441
+ @@ -81830,7 +82934,20 @@ class WebGPUBindingUtils {
2380
2442
 
2381
2443
  let resourceGPU;
2382
2444
 
@@ -2398,7 +2460,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2398
2460
 
2399
2461
  resourceGPU = device.importExternalTexture( { source: textureData.externalTexture } );
2400
2462
 
2401
- @@ -81904,6 +83003,12 @@ class WebGPUBindingUtils {
2463
+ @@ -81904,6 +83021,12 @@ class WebGPUBindingUtils {
2402
2464
  }
2403
2465
 
2404
2466
  const bindGroupGPU = device.createBindGroup( _bindGroupDescriptor );
@@ -2411,7 +2473,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2411
2473
 
2412
2474
  _bindGroupDescriptor.reset();
2413
2475
 
2414
- @@ -82001,7 +83106,7 @@ class WebGPUBindingUtils {
2476
+ @@ -82001,7 +83124,7 @@ class WebGPUBindingUtils {
2415
2477
 
2416
2478
  const { primarySamples } = backend.utils.getTextureSampleData( binding.texture );
2417
2479
 
@@ -2420,7 +2482,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2420
2482
 
2421
2483
  texture.multisampled = true;
2422
2484
 
2423
- @@ -82039,7 +83144,7 @@ class WebGPUBindingUtils {
2485
+ @@ -82039,7 +83162,7 @@ class WebGPUBindingUtils {
2424
2486
 
2425
2487
  } else if ( type === FloatType ) {
2426
2488
 
@@ -2429,7 +2491,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2429
2491
 
2430
2492
  texture.sampleType = GPUTextureSampleType.Float;
2431
2493
 
2432
- @@ -82131,6 +83236,9 @@ class WebGPUBindingUtils {
2494
+ @@ -82131,6 +83254,9 @@ class WebGPUBindingUtils {
2433
2495
 
2434
2496
  }
2435
2497
 
@@ -2439,7 +2501,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2439
2501
  }
2440
2502
 
2441
2503
  /**
2442
- @@ -82502,6 +83610,16 @@ class WebGPUPipelineUtils {
2504
+ @@ -82502,6 +83628,16 @@ class WebGPUPipelineUtils {
2443
2505
 
2444
2506
  }
2445
2507
 
@@ -2456,7 +2518,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2456
2518
  // create pipeline
2457
2519
 
2458
2520
  device.pushErrorScope( 'validation' );
2459
- @@ -82515,6 +83633,7 @@ class WebGPUPipelineUtils {
2521
+ @@ -82515,6 +83651,7 @@ class WebGPUPipelineUtils {
2460
2522
  if ( promises === null ) {
2461
2523
 
2462
2524
  pipelineData.pipeline = device.createRenderPipeline( _renderPipelineDescriptor );
@@ -2464,7 +2526,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2464
2526
 
2465
2527
  _renderPipelineDescriptor.reset();
2466
2528
 
2467
- @@ -82553,6 +83672,15 @@ class WebGPUPipelineUtils {
2529
+ @@ -82553,6 +83690,15 @@ class WebGPUPipelineUtils {
2468
2530
 
2469
2531
  _renderPipelineDescriptor.reset();
2470
2532
 
@@ -2480,7 +2542,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2480
2542
  if ( pipelinePromise !== null ) {
2481
2543
 
2482
2544
  try {
2483
- @@ -82567,7 +83695,7 @@ class WebGPUPipelineUtils {
2545
+ @@ -82567,7 +83713,7 @@ class WebGPUPipelineUtils {
2484
2546
 
2485
2547
  }
2486
2548
 
@@ -2489,7 +2551,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2489
2551
 
2490
2552
  if ( errorScope !== null || asyncError !== null ) {
2491
2553
 
2492
- @@ -83814,6 +84942,27 @@ class WebGPUBackend extends Backend {
2554
+ @@ -83814,6 +84960,27 @@ class WebGPUBackend extends Backend {
2493
2555
  */
2494
2556
  this.compatibilityMode = null;
2495
2557
 
@@ -2517,7 +2579,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2517
2579
  /**
2518
2580
  * A reference to the device.
2519
2581
  *
2520
- @@ -83926,7 +85075,11 @@ class WebGPUBackend extends Backend {
2582
+ @@ -83926,7 +85093,11 @@ class WebGPUBackend extends Backend {
2521
2583
  xrCompatible: renderer.xr.enabled
2522
2584
  };
2523
2585
 
@@ -2530,7 +2592,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2530
2592
 
2531
2593
  if ( adapter === null ) {
2532
2594
 
2533
- @@ -84153,7 +85306,9 @@ class WebGPUBackend extends Backend {
2595
+ @@ -84153,7 +85324,9 @@ class WebGPUBackend extends Backend {
2534
2596
 
2535
2597
  let descriptor = canvasData.descriptor;
2536
2598
 
@@ -2541,7 +2603,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2541
2603
 
2542
2604
  descriptor = new GPURenderPassDescriptor();
2543
2605
  descriptor.colorAttachments.push( new GPURenderPassColorAttachment() );
2544
- @@ -84180,6 +85335,9 @@ class WebGPUBackend extends Backend {
2606
+ @@ -84180,6 +85353,9 @@ class WebGPUBackend extends Backend {
2545
2607
 
2546
2608
  canvasData.descriptor = descriptor;
2547
2609
  canvasData.samples = samples;
@@ -2551,7 +2613,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2551
2613
 
2552
2614
  }
2553
2615
 
2554
- @@ -84496,6 +85654,150 @@ class WebGPUBackend extends Backend {
2616
+ @@ -84496,6 +85672,150 @@ class WebGPUBackend extends Backend {
2555
2617
  *
2556
2618
  * @param {RenderContext} renderContext - The render context.
2557
2619
  */
@@ -2702,7 +2764,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2702
2764
  beginRender( renderContext ) {
2703
2765
 
2704
2766
  const renderContextData = this.get( renderContext );
2705
- @@ -84648,10 +85950,15 @@ class WebGPUBackend extends Backend {
2767
+ @@ -84648,10 +85968,15 @@ class WebGPUBackend extends Backend {
2706
2768
 
2707
2769
  //
2708
2770
 
@@ -2718,7 +2780,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2718
2780
  // Layered render targets: prepare bundle encoders for each camera in the array camera.
2719
2781
 
2720
2782
  if ( this._isRenderCameraDepthArray( renderContext ) === true ) {
2721
- @@ -84945,6 +86252,8 @@ class WebGPUBackend extends Backend {
2783
+ @@ -84945,6 +86270,8 @@ class WebGPUBackend extends Backend {
2722
2784
 
2723
2785
  }
2724
2786
 
@@ -2727,7 +2789,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2727
2789
  if ( occlusionQueryCount > 0 ) {
2728
2790
 
2729
2791
  const bufferSize = occlusionQueryCount * 8; // 8 byte entries for query results
2730
- @@ -84987,7 +86296,16 @@ class WebGPUBackend extends Backend {
2792
+ @@ -84987,7 +86314,16 @@ class WebGPUBackend extends Backend {
2731
2793
 
2732
2794
  }
2733
2795
 
@@ -2745,7 +2807,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2745
2807
 
2746
2808
 
2747
2809
  //
2748
- @@ -85081,6 +86399,8 @@ class WebGPUBackend extends Backend {
2810
+ @@ -85081,6 +86417,8 @@ class WebGPUBackend extends Backend {
2749
2811
  */
2750
2812
  updateViewport( renderContext ) {
2751
2813
 
@@ -2754,7 +2816,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2754
2816
  const { currentPass } = this.get( renderContext );
2755
2817
  const { x, y, width, height, minDepth, maxDepth } = renderContext.viewportValue;
2756
2818
 
2757
- @@ -85095,6 +86415,8 @@ class WebGPUBackend extends Backend {
2819
+ @@ -85095,6 +86433,8 @@ class WebGPUBackend extends Backend {
2758
2820
  */
2759
2821
  updateScissor( renderContext ) {
2760
2822
 
@@ -2763,7 +2825,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2763
2825
  const { currentPass } = this.get( renderContext );
2764
2826
  const { x, y, width, height } = renderContext.scissorValue;
2765
2827
 
2766
- @@ -85461,13 +86783,12 @@ class WebGPUBackend extends Backend {
2828
+ @@ -85461,13 +86801,12 @@ class WebGPUBackend extends Backend {
2767
2829
  for ( let i = 0, l = bindings.length; i < l; i ++ ) {
2768
2830
 
2769
2831
  const bindGroup = bindings[ i ];
@@ -2780,7 +2842,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2780
2842
 
2781
2843
  }
2782
2844
 
2783
- @@ -85593,6 +86914,11 @@ class WebGPUBackend extends Backend {
2845
+ @@ -85593,6 +86932,11 @@ class WebGPUBackend extends Backend {
2784
2846
  } else {
2785
2847
 
2786
2848
  passEncoderGPU.draw( vertexCount, instanceCount, firstVertex, 0 );
@@ -2792,7 +2854,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2792
2854
 
2793
2855
  }
2794
2856
 
2795
- @@ -85628,6 +86954,19 @@ class WebGPUBackend extends Backend {
2857
+ @@ -85628,6 +86972,19 @@ class WebGPUBackend extends Backend {
2796
2858
  // vertex buffers
2797
2859
 
2798
2860
  const vertexBuffers = renderObject.getVertexBuffers();
@@ -2812,7 +2874,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2812
2874
 
2813
2875
  if ( renderObject.camera.isArrayCamera && renderObject.camera.cameras.length > 0 ) {
2814
2876
 
2815
- @@ -85766,6 +87105,7 @@ class WebGPUBackend extends Backend {
2877
+ @@ -85766,6 +87123,7 @@ class WebGPUBackend extends Backend {
2816
2878
  const utils = this.utils;
2817
2879
 
2818
2880
  const sampleCount = utils.getSampleCountRenderContext( renderObject.context );
@@ -2820,7 +2882,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2820
2882
  const colorSpace = utils.getCurrentColorSpace( renderObject.context );
2821
2883
  const colorFormat = utils.getCurrentColorFormat( renderObject.context );
2822
2884
  const depthStencilFormat = utils.getCurrentDepthStencilFormat( renderObject.context );
2823
- @@ -85787,7 +87127,8 @@ class WebGPUBackend extends Backend {
2885
+ @@ -85787,7 +87145,8 @@ class WebGPUBackend extends Backend {
2824
2886
  data.colorFormat !== colorFormat || data.depthStencilFormat !== depthStencilFormat ||
2825
2887
  data.primitiveTopology !== primitiveTopology ||
2826
2888
  data.frontFaceCW !== frontFaceCW ||
@@ -2830,7 +2892,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2830
2892
  ) {
2831
2893
 
2832
2894
  data.material = material; data.materialVersion = material.version;
2833
- @@ -85807,6 +87148,7 @@ class WebGPUBackend extends Backend {
2895
+ @@ -85807,6 +87166,7 @@ class WebGPUBackend extends Backend {
2834
2896
  data.primitiveTopology = primitiveTopology;
2835
2897
  data.frontFaceCW = frontFaceCW;
2836
2898
  data.clippingContextCacheKey = renderObject.clippingContextCacheKey;
@@ -2838,7 +2900,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2838
2900
 
2839
2901
  needsUpdate = true;
2840
2902
 
2841
- @@ -85828,6 +87170,7 @@ class WebGPUBackend extends Backend {
2903
+ @@ -85828,6 +87188,7 @@ class WebGPUBackend extends Backend {
2842
2904
 
2843
2905
  const utils = this.utils;
2844
2906
  const renderContext = renderObject.context;
@@ -2846,7 +2908,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2846
2908
 
2847
2909
  // meshes with negative scale have a different frontFace render pipeline
2848
2910
  // descriptor value so the following must be honored in the cache key
2849
- @@ -85846,9 +87189,10 @@ class WebGPUBackend extends Backend {
2911
+ @@ -85846,9 +87207,10 @@ class WebGPUBackend extends Backend {
2850
2912
  material.side,
2851
2913
  frontFaceCW,
2852
2914
  utils.getSampleCountRenderContext( renderContext ),
@@ -2858,7 +2920,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2858
2920
  renderObject.clippingContextCacheKey
2859
2921
  ].join();
2860
2922
 
2861
- @@ -85916,6 +87260,12 @@ class WebGPUBackend extends Backend {
2923
+ @@ -85916,6 +87278,12 @@ class WebGPUBackend extends Backend {
2862
2924
 
2863
2925
  }
2864
2926
 
@@ -2871,7 +2933,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2871
2933
  /**
2872
2934
  * Generates mipmaps for the given texture.
2873
2935
  *
2874
- @@ -86017,6 +87367,8 @@ class WebGPUBackend extends Backend {
2936
+ @@ -86017,6 +87385,8 @@ class WebGPUBackend extends Backend {
2875
2937
  _shaderModuleDescriptor.label = program.stage + ( program.name !== '' ? `_${ program.name }` : '' );
2876
2938
  _shaderModuleDescriptor.code = program.code;
2877
2939
 
@@ -2880,7 +2942,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2880
2942
  programGPU.module = {
2881
2943
  module: this.device.createShaderModule( _shaderModuleDescriptor ),
2882
2944
  entryPoint: 'main'
2883
- @@ -86164,6 +87516,7 @@ class WebGPUBackend extends Backend {
2945
+ @@ -86164,6 +87534,7 @@ class WebGPUBackend extends Backend {
2884
2946
  _bufferDescriptor.reset();
2885
2947
 
2886
2948
  uniformBufferData.buffer = bufferGPU;
@@ -2888,7 +2950,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2888
2950
 
2889
2951
  }
2890
2952
 
2891
- @@ -86430,6 +87783,7 @@ class WebGPUBackend extends Backend {
2953
+ @@ -86430,6 +87801,7 @@ class WebGPUBackend extends Backend {
2892
2954
 
2893
2955
  submit( this.device, encoder.finish() );
2894
2956
 
@@ -2896,7 +2958,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2896
2958
  if ( dstLevel === 0 && dstTexture.generateMipmaps ) {
2897
2959
 
2898
2960
  this.textureUtils.generateMipmaps( dstTexture );
2899
- @@ -86447,6 +87801,8 @@ class WebGPUBackend extends Backend {
2961
+ @@ -86447,6 +87819,8 @@ class WebGPUBackend extends Backend {
2900
2962
  */
2901
2963
  copyFramebufferToTexture( texture, renderContext, rectangle ) {
2902
2964
 
@@ -2905,7 +2967,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2905
2967
  const renderContextData = this.get( renderContext );
2906
2968
 
2907
2969
  let sourceGPU = null;
2908
- @@ -87073,7 +88429,20 @@ class RenderPipeline {
2970
+ @@ -87073,7 +88447,20 @@ class RenderPipeline {
2909
2971
  const currentXR = renderer.xr.enabled;
2910
2972
  renderer.xr.enabled = false;
2911
2973
 
@@ -2928,7 +2990,7 @@ index 2e490796d4d4aa9479b04a5c46ddbf31cc05b1a1..d835e23ec85acea5fd8ba15a2b76c83b
2928
2990
  renderer.xr.enabled = currentXR;
2929
2991
 
2930
2992
  diff --git a/build/three.webgpu.nodes.js b/build/three.webgpu.nodes.js
2931
- index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e3a06c0d0 100644
2993
+ index f707acc24f5711fdae065ce920b08435b0869c1b..46b9864470ab0489d095513c7ab6493e25ae5c17 100644
2932
2994
  --- a/build/three.webgpu.nodes.js
2933
2995
  +++ b/build/three.webgpu.nodes.js
2934
2996
  @@ -141,6 +141,15 @@ class NodeMaterialObserver {
@@ -3238,14 +3300,14 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3238
3300
  + previousInstanceMatrix.needsUpdate = true;
3239
3301
  + const interleaved = _matrixBuffers.get( previousInstanceMatrix );
3240
3302
  + if ( interleaved !== undefined ) interleaved.needsUpdate = true;
3241
- +
3242
- + };
3243
3303
 
3244
3304
  - const previousInstanceData = _previousInstanceMatrices.get( object );
3245
- + // Scheduled history must reach the GPU in this draw, before the geometry uploads.
3246
- + OnBeforeObjectUpdate( ( { object } ) => {
3305
+ + };
3247
3306
 
3248
3307
  - previousInstanceData.previousInstanceMatrix.array.set( matrices.array );
3308
+ + // Scheduled history must reach the GPU in this draw, before the geometry uploads.
3309
+ + OnBeforeObjectUpdate( ( { object } ) => {
3310
+ +
3249
3311
  + const scheduledPrevious = object[ Symbol.for( 'threenative.velocity.previousInstanceMatrices' ) ];
3250
3312
  + if ( scheduledPrevious !== undefined ) updatePrevious( object, scheduledPrevious );
3251
3313
  +
@@ -3258,24 +3320,79 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3258
3320
 
3259
3321
  } );
3260
3322
 
3261
- @@ -18745,7 +18847,15 @@ function getPreviousSkinnedPosition( skinnedMesh, bindMatrixNode, bindMatrixInve
3323
+ @@ -18713,6 +18815,31 @@ function getSkinnedNormalAndTangent( boneMatrices, normal, tangent, bindMatrix,
3262
3324
 
3263
- }
3325
+ }
3264
3326
 
3265
- - return getSkinnedPosition( data.node, positionPrevious, bindMatrixNode, bindMatrixInverseNode, skinIndexNode, skinWeightNode );
3327
+ +/**
3328
+ + * The previous frame's bone matrices for one skeleton, created on first use at the current pose
3329
+ + * so a skeleton's first frame has zero skin motion.
3330
+ + *
3331
+ + * @param {Skeleton} skeleton - The skeleton.
3332
+ + * @returns {{previousBoneMatrices: Float32Array}} The skeleton's bone history.
3333
+ + */
3334
+ +function previousBoneMatricesData( skeleton ) {
3335
+ +
3336
+ + let data = _previousBoneMatricesData.get( skeleton );
3337
+ +
3338
+ + if ( data === undefined ) {
3339
+ +
3340
+ + skeleton.update();
3341
+ +
3342
+ + data = { previousBoneMatrices: new Float32Array( skeleton.boneMatrices ) };
3343
+ +
3344
+ + _previousBoneMatricesData.set( skeleton, data );
3345
+ +
3346
+ + }
3347
+ +
3348
+ + return data;
3349
+ +
3350
+ +}
3351
+ +
3352
+ /**
3353
+ * Retrieves or initializes the previous frame skinned position node for motion vectors.
3354
+ * Uses a WeakMap to cache previous frame bone matrix arrays and their TSL buffer nodes.
3355
+ @@ -18726,26 +18853,25 @@ function getSkinnedNormalAndTangent( boneMatrices, normal, tangent, bindMatrix,
3356
+ */
3357
+ function getPreviousSkinnedPosition( skinnedMesh, bindMatrixNode, bindMatrixInverseNode, skinIndexNode, skinWeightNode ) {
3358
+
3359
+ - const skeleton = skinnedMesh.skeleton;
3360
+ -
3361
+ - let data = _previousBoneMatricesData.get( skeleton );
3362
+ -
3363
+ - if ( data === undefined ) {
3364
+ + // Meshes that share a material and geometry share this program, so the bone history is the
3365
+ + // drawn object's own skeleton's, resolved per object like the current bones, never the
3366
+ + // skeleton the program happened to be built for.
3367
+ + const previousBoneMatricesNode = buffer( previousBoneMatricesData( skinnedMesh.skeleton ).previousBoneMatrices, 'mat4', skinnedMesh.skeleton.bones.length ).onObjectUpdate( ( { object } ) => {
3368
+
3369
+ - skeleton.update();
3370
+ + const mesh = object?.isSkinnedMesh === true ? object : skinnedMesh;
3371
+ + return previousBoneMatricesData( mesh.skeleton ).previousBoneMatrices;
3372
+
3373
+ - const previousBoneMatrices = new Float32Array( skeleton.boneMatrices );
3374
+ + } );
3375
+
3376
+ - data = {
3377
+ - previousBoneMatrices,
3378
+ - node: buffer( previousBoneMatrices, 'mat4', skeleton.bones.length )
3379
+ - };
3266
3380
  + // The previous bones and world matrix must use the same frame's bind inverse.
3267
3381
  + const previousBindMatrixInverse = uniform( skinnedMesh.bindMatrixInverse, 'mat4' ).onObjectUpdate( ( { object } ) => {
3268
- +
3382
+
3383
+ - _previousBoneMatricesData.set( skeleton, data );
3269
3384
  + const mesh = object?.isSkinnedMesh === true ? object : skinnedMesh;
3270
3385
  + return mesh[ Symbol.for( 'threenative.velocity.previousBindMatrixInverse' ) ] ?? mesh.bindMatrixInverse;
3271
- +
3386
+
3387
+ - }
3272
3388
  + } );
3273
- +
3274
- + return getSkinnedPosition( data.node, positionPrevious, bindMatrixNode, previousBindMatrixInverse, skinIndexNode, skinWeightNode );
3389
+
3390
+ - return getSkinnedPosition( data.node, positionPrevious, bindMatrixNode, bindMatrixInverseNode, skinIndexNode, skinWeightNode );
3391
+ + return getSkinnedPosition( previousBoneMatricesNode, positionPrevious, bindMatrixNode, previousBindMatrixInverse, skinIndexNode, skinWeightNode );
3275
3392
 
3276
3393
  }
3277
3394
 
3278
- @@ -23151,6 +23261,31 @@ class CubeRenderTarget extends RenderTarget {
3395
+ @@ -23151,6 +23277,31 @@ class CubeRenderTarget extends RenderTarget {
3279
3396
  }
3280
3397
 
3281
3398
  const _cache$1 = new WeakMap();
@@ -3307,7 +3424,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3307
3424
 
3308
3425
  /**
3309
3426
  * This node can be used to automatically convert environment maps in the
3310
- @@ -26107,11 +26242,11 @@ class PMREMGenerator {
3427
+ @@ -26107,11 +26258,11 @@ class PMREMGenerator {
3311
3428
  */
3312
3429
  async fromEquirectangularAsync( equirectangular, renderTarget = null ) {
3313
3430
 
@@ -3322,7 +3439,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3322
3439
 
3323
3440
  }
3324
3441
 
3325
- @@ -26151,11 +26286,11 @@ class PMREMGenerator {
3442
+ @@ -26151,11 +26302,11 @@ class PMREMGenerator {
3326
3443
  */
3327
3444
  async fromCubemapAsync( cubemap, renderTarget = null ) {
3328
3445
 
@@ -3337,7 +3454,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3337
3454
 
3338
3455
  }
3339
3456
 
3340
- @@ -26277,6 +26412,171 @@ class PMREMGenerator {
3457
+ @@ -26277,6 +26428,171 @@ class PMREMGenerator {
3341
3458
 
3342
3459
  }
3343
3460
 
@@ -3351,8 +3468,8 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3351
3468
  + try {
3352
3469
  +
3353
3470
  + this._init( cubeUVRenderTarget );
3354
- + // One fence covers as much queued work as the heaviest single face (the first GGX filter pass).
3355
- + this._fenceBudget = this._sizeLods[ 1 ] * this._sizeLods[ 1 ] * GGX_SAMPLES;
3471
+ + // One fence covers the heaviest single face (the first GGX filter pass), never less than a 256 cube's: a fence waits behind every queued frame.
3472
+ + this._fenceBudget = Math.max( 128 * 128, this._sizeLods[ 1 ] * this._sizeLods[ 1 ] ) * GGX_SAMPLES;
3356
3473
  + this._fencePending = 0;
3357
3474
  + await this._textureToCubeUVAsync( texture, cubeUVRenderTarget );
3358
3475
  + await this._applyPMREMAsync( cubeUVRenderTarget );
@@ -3509,7 +3626,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3509
3626
  _allocateTarget( depthBuffer ) {
3510
3627
 
3511
3628
  const width = 3 * Math.max( this._cubeSize, 16 * 7 );
3512
- @@ -26917,6 +27217,14 @@ function _generateCubeUVSize( imageHeight ) {
3629
+ @@ -26917,6 +27233,14 @@ function _generateCubeUVSize( imageHeight ) {
3513
3630
  function _getPMREMFromTexture( texture, renderer, generator ) {
3514
3631
 
3515
3632
  const cache = _getCache( renderer );
@@ -3524,7 +3641,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3524
3641
 
3525
3642
  let cacheTexture = cache.get( texture );
3526
3643
 
3527
- @@ -26925,6 +27233,25 @@ function _getPMREMFromTexture( texture, renderer, generator ) {
3644
+ @@ -26925,6 +27249,25 @@ function _getPMREMFromTexture( texture, renderer, generator ) {
3528
3645
  if ( pmremVersion !== texture.pmremVersion ) {
3529
3646
 
3530
3647
  const image = texture.image;
@@ -3550,7 +3667,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3550
3667
 
3551
3668
  if ( texture.isCubeTexture ) {
3552
3669
 
3553
- @@ -26955,28 +27282,7 @@ function _getPMREMFromTexture( texture, renderer, generator ) {
3670
+ @@ -26955,28 +27298,7 @@ function _getPMREMFromTexture( texture, renderer, generator ) {
3554
3671
 
3555
3672
  cacheTexture.pmremVersion = texture.pmremVersion;
3556
3673
 
@@ -3580,7 +3697,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3580
3697
 
3581
3698
  //
3582
3699
 
3583
- @@ -27031,6 +27337,95 @@ class PMREMNode extends TempNode {
3700
+ @@ -27031,6 +27353,95 @@ class PMREMNode extends TempNode {
3584
3701
 
3585
3702
  }
3586
3703
 
@@ -3676,7 +3793,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3676
3793
  /**
3677
3794
  * Constructs a new function overloading node.
3678
3795
  *
3679
- @@ -27217,7 +27612,7 @@ class PMREMNode extends TempNode {
3796
+ @@ -27217,7 +27628,7 @@ class PMREMNode extends TempNode {
3680
3797
  // PMREMGenerator renders into a render target with inverted Y, so its output needs the Y
3681
3798
  // flip on sampling. Externally authored PMREMs follow the standard convention and don't.
3682
3799
 
@@ -3685,7 +3802,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3685
3802
  ? materialEnvRotation.mul( vec3( uvNode.x, uvNode.y.negate(), uvNode.z ) )
3686
3803
  : materialEnvRotation.mul( uvNode );
3687
3804
 
3688
- @@ -31165,6 +31560,14 @@ class Geometries extends DataMap {
3805
+ @@ -31165,6 +31576,14 @@ class Geometries extends DataMap {
3689
3806
  */
3690
3807
  this._geometryDisposeListeners = new Map();
3691
3808
 
@@ -3700,7 +3817,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3700
3817
  }
3701
3818
 
3702
3819
  /**
3703
- @@ -31190,10 +31593,69 @@ class Geometries extends DataMap {
3820
+ @@ -31190,10 +31609,69 @@ class Geometries extends DataMap {
3704
3821
 
3705
3822
  if ( this.has( renderObject ) === false ) this.initGeometry( renderObject );
3706
3823
 
@@ -3770,7 +3887,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3770
3887
  /**
3771
3888
  * Initializes the geometry of the given render object.
3772
3889
  *
3773
- @@ -32771,7 +33233,7 @@ class Bindings extends DataMap {
3890
+ @@ -32771,7 +33249,7 @@ class Bindings extends DataMap {
3774
3891
  */
3775
3892
  updateForRender( renderObject ) {
3776
3893
 
@@ -3779,7 +3896,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3779
3896
 
3780
3897
  }
3781
3898
 
3782
- @@ -32918,12 +33380,13 @@ class Bindings extends DataMap {
3899
+ @@ -32918,12 +33396,13 @@ class Bindings extends DataMap {
3783
3900
  * Updates the given array of bindings.
3784
3901
  *
3785
3902
  * @param {Array<BindGroup>} bindings - The bind groups.
@@ -3795,7 +3912,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3795
3912
 
3796
3913
  }
3797
3914
 
3798
- @@ -32934,11 +33397,27 @@ class Bindings extends DataMap {
3915
+ @@ -32934,11 +33413,27 @@ class Bindings extends DataMap {
3799
3916
  *
3800
3917
  * @param {BindGroup} bindGroup - The bind group to update.
3801
3918
  * @param {Array<BindGroup>} bindings - The bind groups.
@@ -3824,7 +3941,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3824
3941
  let needsBindingsUpdate = false;
3825
3942
  let cacheBindings = true;
3826
3943
  let cacheIndex = 0;
3827
- @@ -32948,12 +33427,32 @@ class Bindings extends DataMap {
3944
+ @@ -32948,12 +33443,32 @@ class Bindings extends DataMap {
3828
3945
 
3829
3946
  for ( const binding of bindGroup.bindings ) {
3830
3947
 
@@ -3859,7 +3976,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3859
3976
 
3860
3977
  //
3861
3978
 
3862
- @@ -34020,6 +34519,10 @@ class Textures extends DataMap {
3979
+ @@ -34020,6 +34535,10 @@ class Textures extends DataMap {
3863
3980
  * @type {Set<HTMLTexture>}
3864
3981
  */
3865
3982
  this._htmlTextures = new Set();
@@ -3870,7 +3987,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3870
3987
 
3871
3988
  }
3872
3989
 
3873
- @@ -34169,7 +34672,16 @@ class Textures extends DataMap {
3990
+ @@ -34169,7 +34688,16 @@ class Textures extends DataMap {
3874
3991
  */
3875
3992
  updateTexture( texture, options = {} ) {
3876
3993
 
@@ -3887,7 +4004,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3887
4004
  if ( textureData.initialized === true && textureData.version === texture.version ) return;
3888
4005
 
3889
4006
  const isRenderTarget = texture.isRenderTargetTexture || texture.isDepthTexture || texture.isFramebufferTexture;
3890
- @@ -34181,6 +34693,21 @@ class Textures extends DataMap {
4007
+ @@ -34181,6 +34709,21 @@ class Textures extends DataMap {
3891
4008
 
3892
4009
  backend.destroyTexture( texture );
3893
4010
 
@@ -3909,7 +4026,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3909
4026
  }
3910
4027
 
3911
4028
  //
3912
- @@ -34318,7 +34845,16 @@ class Textures extends DataMap {
4029
+ @@ -34318,7 +34861,16 @@ class Textures extends DataMap {
3913
4030
 
3914
4031
  }
3915
4032
 
@@ -3927,7 +4044,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3927
4044
 
3928
4045
  const skipAutoGeneration = texture.isStorageTexture === true && texture.mipmapsAutoUpdate === false;
3929
4046
 
3930
- @@ -34328,7 +34864,7 @@ class Textures extends DataMap {
4047
+ @@ -34328,7 +34880,7 @@ class Textures extends DataMap {
3931
4048
 
3932
4049
  }
3933
4050
 
@@ -3936,7 +4053,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3936
4053
 
3937
4054
  }
3938
4055
 
3939
- @@ -34345,6 +34881,17 @@ class Textures extends DataMap {
4056
+ @@ -34345,6 +34897,17 @@ class Textures extends DataMap {
3940
4057
 
3941
4058
  }
3942
4059
 
@@ -3954,7 +4071,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
3954
4071
  // dispose handler
3955
4072
 
3956
4073
  if ( textureData.initialized !== true ) {
3957
- @@ -34377,9 +34924,134 @@ class Textures extends DataMap {
4074
+ @@ -34377,9 +34940,134 @@ class Textures extends DataMap {
3958
4075
 
3959
4076
  }
3960
4077
 
@@ -4091,7 +4208,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4091
4208
 
4092
4209
  }
4093
4210
 
4094
- @@ -34557,6 +35229,8 @@ class Textures extends DataMap {
4211
+ @@ -34557,6 +35245,8 @@ class Textures extends DataMap {
4095
4212
  */
4096
4213
  _destroyTexture( texture ) {
4097
4214
 
@@ -4100,7 +4217,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4100
4217
  if ( this.has( texture ) === true ) {
4101
4218
 
4102
4219
  const textureData = this.get( texture );
4103
- @@ -40270,7 +40944,7 @@ class PassMultipleTextureNode extends PassTextureNode {
4220
+ @@ -40270,7 +40960,7 @@ class PassMultipleTextureNode extends PassTextureNode {
4104
4221
  * @param {string} textureName - The output texture name.
4105
4222
  * @param {boolean} [previousTexture=false] - Whether previous frame data should be used or not.
4106
4223
  */
@@ -4109,7 +4226,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4109
4226
 
4110
4227
  // null is passed to the super call since this class does not
4111
4228
  // use an external texture for rendering pass data into. Instead
4112
- @@ -40291,6 +40965,8 @@ class PassMultipleTextureNode extends PassTextureNode {
4229
+ @@ -40291,6 +40981,8 @@ class PassMultipleTextureNode extends PassTextureNode {
4113
4230
  * @type {boolean}
4114
4231
  */
4115
4232
  this.previousTexture = previousTexture;
@@ -4118,7 +4235,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4118
4235
 
4119
4236
  /**
4120
4237
  * This flag can be used for type testing.
4121
- @@ -40312,17 +40988,33 @@ class PassMultipleTextureNode extends PassTextureNode {
4238
+ @@ -40312,17 +41004,33 @@ class PassMultipleTextureNode extends PassTextureNode {
4122
4239
 
4123
4240
  }
4124
4241
 
@@ -4153,7 +4270,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4153
4270
  newNode.uvNode = this.uvNode;
4154
4271
  newNode.levelNode = this.levelNode;
4155
4272
  newNode.biasNode = this.biasNode;
4156
- @@ -40503,6 +41195,8 @@ class PassNode extends TempNode {
4273
+ @@ -40503,6 +41211,8 @@ class PassNode extends TempNode {
4157
4274
  * @type {Object<string, TextureNode>}
4158
4275
  */
4159
4276
  this._textureNodes = {};
@@ -4162,7 +4279,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4162
4279
 
4163
4280
  /**
4164
4281
  * A dictionary holding the internal depth nodes.
4165
- @@ -40809,6 +41503,7 @@ class PassNode extends TempNode {
4282
+ @@ -40809,6 +41519,7 @@ class PassNode extends TempNode {
4166
4283
  this._previousTextures[ name ] = texture;
4167
4284
 
4168
4285
  this._textureNodes[ name ].updateTexture();
@@ -4170,7 +4287,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4170
4287
  this._previousTextureNodes[ name ].updateTexture();
4171
4288
 
4172
4289
  }
4173
- @@ -40821,6 +41516,17 @@ class PassNode extends TempNode {
4290
+ @@ -40821,6 +41532,17 @@ class PassNode extends TempNode {
4174
4291
  * @param {string} [name='output'] - The output name to get the texture node for.
4175
4292
  * @return {TextureNode} The texture node.
4176
4293
  */
@@ -4188,7 +4305,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4188
4305
  getTextureNode( name = 'output' ) {
4189
4306
 
4190
4307
  let textureNode = this._textureNodes[ name ];
4191
- @@ -41163,6 +41869,7 @@ class PassNode extends TempNode {
4308
+ @@ -41163,6 +41885,7 @@ class PassNode extends TempNode {
4192
4309
  */
4193
4310
  dispose() {
4194
4311
 
@@ -4196,7 +4313,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4196
4313
  this.renderTarget.dispose();
4197
4314
 
4198
4315
  }
4199
- @@ -44431,6 +45138,46 @@ var RendererUtils = /*#__PURE__*/Object.freeze({
4316
+ @@ -44431,6 +45154,46 @@ var RendererUtils = /*#__PURE__*/Object.freeze({
4200
4317
 
4201
4318
  const shadowMaterialLib = /*@__PURE__*/ new WeakMap();
4202
4319
 
@@ -4243,7 +4360,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4243
4360
  /**
4244
4361
  * A shadow filtering function performing basic filtering. This is in fact an unfiltered version of the shadow map
4245
4362
  * with a binary `[0,1]` result.
4246
- @@ -44485,8 +45232,8 @@ const PCFShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, shadowCoord, shadow,
4363
+ @@ -44485,8 +45248,8 @@ const PCFShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, shadowCoord, shadow,
4247
4364
 
4248
4365
  };
4249
4366
 
@@ -4254,7 +4371,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4254
4371
 
4255
4372
  const texelSize = vec2( 1 ).div( mapSize );
4256
4373
  const radiusScaled = radius.mul( texelSize.x );
4257
- @@ -44517,7 +45264,7 @@ const PCFShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, shadowCoord, shadow,
4374
+ @@ -44517,7 +45280,7 @@ const PCFShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, shadowCoord, shadow,
4258
4375
  */
4259
4376
  const PCFSoftShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, shadowCoord, shadow, depthLayer } ) => {
4260
4377
 
@@ -4263,7 +4380,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4263
4380
 
4264
4381
  const texelSize = vec2( 1 ).div( mapSize );
4265
4382
 
4266
- @@ -45586,8 +46333,8 @@ const BasicPointShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, bd3D, dp } )
4383
+ @@ -45586,8 +46349,8 @@ const BasicPointShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, bd3D, dp } )
4267
4384
  */
4268
4385
  const PointShadowFilter = /*@__PURE__*/ Fn( ( { depthTexture, bd3D, dp, shadow } ) => {
4269
4386
 
@@ -4274,7 +4391,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4274
4391
 
4275
4392
  const texelSize = radius.div( mapSize.x );
4276
4393
 
4277
- @@ -45623,9 +46370,9 @@ const pointShadowFilter = /*@__PURE__*/ Fn( ( { filterFn, depthTexture, shadowCo
4394
+ @@ -45623,9 +46386,9 @@ const pointShadowFilter = /*@__PURE__*/ Fn( ( { filterFn, depthTexture, shadowCo
4278
4395
  const shadowPositionAbs = shadowPosition.abs().toConst();
4279
4396
  const viewZ = shadowPositionAbs.x.max( shadowPositionAbs.y ).max( shadowPositionAbs.z );
4280
4397
 
@@ -4287,7 +4404,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4287
4404
 
4288
4405
  const result = float( 1.0 ).toVar();
4289
4406
 
4290
- @@ -55244,15 +55991,17 @@ class NodeManager extends DataMap {
4407
+ @@ -55244,15 +56007,17 @@ class NodeManager extends DataMap {
4291
4408
  * Returns `true` if the given node uniforms group must be updated or not.
4292
4409
  *
4293
4410
  * @param {NodeUniformsGroup} nodeUniformsGroup - The node uniforms group.
@@ -4308,7 +4425,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4308
4425
 
4309
4426
  // check for update
4310
4427
 
4311
- @@ -56056,6 +56805,21 @@ class NodeManager extends DataMap {
4428
+ @@ -56056,6 +56821,21 @@ class NodeManager extends DataMap {
4312
4429
 
4313
4430
  }
4314
4431
 
@@ -4330,7 +4447,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4330
4447
  /**
4331
4448
  * Triggers the call of `updateBefore()` methods
4332
4449
  * for all nodes of the given render object.
4333
- @@ -56065,9 +56829,14 @@ class NodeManager extends DataMap {
4450
+ @@ -56065,9 +56845,14 @@ class NodeManager extends DataMap {
4334
4451
  updateBefore( renderObject ) {
4335
4452
 
4336
4453
  const nodeBuilder = renderObject.getNodeBuilderState();
@@ -4345,7 +4462,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4345
4462
  // update frame state for each node
4346
4463
 
4347
4464
  this.getNodeFrameForRender( renderObject ).updateBeforeNode( node );
4348
- @@ -56085,10 +56854,11 @@ class NodeManager extends DataMap {
4465
+ @@ -56085,10 +56870,11 @@ class NodeManager extends DataMap {
4349
4466
  updateAfter( renderObject ) {
4350
4467
 
4351
4468
  const nodeBuilder = renderObject.getNodeBuilderState();
@@ -4358,7 +4475,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4358
4475
 
4359
4476
  this.getNodeFrameForRender( renderObject ).updateAfterNode( node );
4360
4477
 
4361
- @@ -56125,9 +56895,14 @@ class NodeManager extends DataMap {
4478
+ @@ -56125,9 +56911,14 @@ class NodeManager extends DataMap {
4362
4479
 
4363
4480
  const nodeFrame = this.getNodeFrameForRender( renderObject );
4364
4481
  const nodeBuilder = renderObject.getNodeBuilderState();
@@ -4373,7 +4490,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4373
4490
  nodeFrame.updateNode( node );
4374
4491
 
4375
4492
  }
4376
- @@ -60919,6 +61694,7 @@ class Renderer {
4493
+ @@ -60919,6 +61710,7 @@ class Renderer {
4377
4494
  //
4378
4495
 
4379
4496
  renderContext.camera = camera;
@@ -4381,7 +4498,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4381
4498
  this.backend.beginRender( renderContext );
4382
4499
 
4383
4500
  // process render lists
4384
- @@ -60931,13 +61707,23 @@ class Renderer {
4501
+ @@ -60931,13 +61723,23 @@ class Renderer {
4385
4502
  opaque: opaqueObjects
4386
4503
  } = renderList;
4387
4504
 
@@ -4407,7 +4524,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4407
4524
 
4408
4525
  // restore render tree
4409
4526
 
4410
- @@ -60952,6 +61738,9 @@ class Renderer {
4527
+ @@ -60952,6 +61754,9 @@ class Renderer {
4411
4528
 
4412
4529
  this._callDepth --;
4413
4530
 
@@ -4417,7 +4534,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4417
4534
  if ( frameBufferTarget !== null ) {
4418
4535
 
4419
4536
  this.setRenderTarget( outputRenderTarget, activeCubeFace, activeMipmapLevel );
4420
- @@ -61118,6 +61907,18 @@ class Renderer {
4537
+ @@ -61118,6 +61923,18 @@ class Renderer {
4421
4538
 
4422
4539
  }
4423
4540
 
@@ -4436,7 +4553,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4436
4553
  /**
4437
4554
  * Can be used to transfer buffer data from a storage buffer attribute
4438
4555
  * from the GPU to the CPU in context of compute shaders.
4439
- @@ -62111,6 +62912,14 @@ class Renderer {
4556
+ @@ -62111,6 +62928,14 @@ class Renderer {
4440
4557
 
4441
4558
  }
4442
4559
 
@@ -4451,7 +4568,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4451
4568
  /**
4452
4569
  * Initializes the given render target.
4453
4570
  *
4454
- @@ -62604,7 +63413,8 @@ class Renderer {
4571
+ @@ -62604,7 +63429,8 @@ class Renderer {
4455
4572
  version,
4456
4573
  colorNode,
4457
4574
  depthNode,
@@ -4461,7 +4578,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4461
4578
  };
4462
4579
 
4463
4580
  this._cacheShadowNodes.set( material, cache );
4464
- @@ -62774,7 +63584,7 @@ class Renderer {
4581
+ @@ -62774,7 +63600,7 @@ class Renderer {
4465
4582
 
4466
4583
  if ( overrideMaterial.isShadowPassMaterial ) {
4467
4584
 
@@ -4470,7 +4587,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4470
4587
 
4471
4588
  if ( this.shadowMap.type === VSMShadowMap ) {
4472
4589
 
4473
- @@ -62786,6 +63596,7 @@ class Renderer {
4590
+ @@ -62786,6 +63612,7 @@ class Renderer {
4474
4591
 
4475
4592
  }
4476
4593
 
@@ -4478,7 +4595,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4478
4595
  if ( colorNode !== null ) overrideMaterial.colorNode = colorNode;
4479
4596
  if ( depthNode !== null ) overrideMaterial.depthNode = depthNode;
4480
4597
  if ( positionNode !== null ) overrideMaterial.positionNode = positionNode;
4481
- @@ -62886,18 +63697,17 @@ class Renderer {
4598
+ @@ -62886,18 +63713,17 @@ class Renderer {
4482
4599
 
4483
4600
  //
4484
4601
 
@@ -4507,7 +4624,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4507
4624
 
4508
4625
  this._pipelines.updateForRender( renderObject );
4509
4626
 
4510
- @@ -62907,7 +63717,7 @@ class Renderer {
4627
+ @@ -62907,7 +63733,7 @@ class Renderer {
4511
4628
 
4512
4629
  this.backend.draw( renderObject, this.info );
4513
4630
 
@@ -4516,7 +4633,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4516
4633
 
4517
4634
  }
4518
4635
 
4519
- @@ -76397,6 +77207,9 @@ class WebGPUTextureUtils {
4636
+ @@ -76397,6 +77223,9 @@ class WebGPUTextureUtils {
4520
4637
  */
4521
4638
  this._samplerCache = new Map();
4522
4639
 
@@ -4526,7 +4643,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4526
4643
  }
4527
4644
 
4528
4645
  /**
4529
- @@ -76613,7 +77426,12 @@ class WebGPUTextureUtils {
4646
+ @@ -76613,7 +77442,12 @@ class WebGPUTextureUtils {
4530
4647
 
4531
4648
  }
4532
4649
 
@@ -4540,7 +4657,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4540
4657
 
4541
4658
  usage |= GPUTextureUsage.RENDER_ATTACHMENT;
4542
4659
 
4543
- @@ -76686,6 +77504,23 @@ class WebGPUTextureUtils {
4660
+ @@ -76686,6 +77520,23 @@ class WebGPUTextureUtils {
4544
4661
  destroyTexture( texture, isDefaultTexture = false ) {
4545
4662
 
4546
4663
  const backend = this.backend;
@@ -4564,7 +4681,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4564
4681
  const textureData = backend.get( texture );
4565
4682
 
4566
4683
  if ( textureData.texture !== undefined && isDefaultTexture === false && texture.isExternalTexture !== true ) textureData.texture.destroy();
4567
- @@ -76726,7 +77561,7 @@ class WebGPUTextureUtils {
4684
+ @@ -76726,7 +77577,7 @@ class WebGPUTextureUtils {
4568
4685
  const colorTexture = canvasTarget.colorTexture;
4569
4686
  const colorTextureData = backend.get( colorTexture );
4570
4687
 
@@ -4573,7 +4690,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4573
4690
 
4574
4691
  return colorTextureData.texture;
4575
4692
 
4576
- @@ -76751,8 +77586,8 @@ class WebGPUTextureUtils {
4693
+ @@ -76751,8 +77602,8 @@ class WebGPUTextureUtils {
4577
4694
 
4578
4695
  //
4579
4696
 
@@ -4584,7 +4701,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4584
4701
  colorTexture.samples = samples;
4585
4702
 
4586
4703
  colorTextureData.texture = colorBuffer;
4587
- @@ -76775,64 +77610,59 @@ class WebGPUTextureUtils {
4704
+ @@ -76775,64 +77626,59 @@ class WebGPUTextureUtils {
4588
4705
  const canvasTarget = backend.renderer.getCanvasTarget();
4589
4706
  const { width, height } = backend.getDrawingBufferSize();
4590
4707
  const samples = backend.renderer.currentSamples;
@@ -4677,7 +4794,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4677
4794
  /**
4678
4795
  * Uploads the updated texture data to the GPU.
4679
4796
  *
4680
- @@ -76987,6 +77817,143 @@ class WebGPUTextureUtils {
4797
+ @@ -76987,6 +77833,143 @@ class WebGPUTextureUtils {
4681
4798
 
4682
4799
  }
4683
4800
 
@@ -4821,7 +4938,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4821
4938
  /**
4822
4939
  * Returns texture data as a typed array.
4823
4940
  *
4824
- @@ -77060,6 +78027,8 @@ class WebGPUTextureUtils {
4941
+ @@ -77060,6 +78043,8 @@ class WebGPUTextureUtils {
4825
4942
  */
4826
4943
  dispose() {
4827
4944
 
@@ -4830,7 +4947,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4830
4947
  this._samplerCache.clear();
4831
4948
 
4832
4949
  }
4833
- @@ -78986,7 +79955,7 @@ class WGSLNodeBuilder extends NodeBuilder {
4950
+ @@ -78986,7 +79971,7 @@ class WGSLNodeBuilder extends NodeBuilder {
4834
4951
  * @param {?string} offsetSnippet - A WGSL snippet that represents the offset that will be applied to the unnormalized texture coordinate before sampling the texture.
4835
4952
  * @return {string} The WGSL snippet.
4836
4953
  */
@@ -4839,7 +4956,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4839
4956
 
4840
4957
  if ( levelSnippet === null ) levelSnippet = '0u';
4841
4958
 
4842
- @@ -79004,7 +79973,14 @@ class WGSLNodeBuilder extends NodeBuilder {
4959
+ @@ -79004,7 +79989,14 @@ class WGSLNodeBuilder extends NodeBuilder {
4843
4960
 
4844
4961
  } else {
4845
4962
 
@@ -4855,7 +4972,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4855
4972
 
4856
4973
  if ( this.renderer.backend.compatibilityMode && texture.isDepthTexture ) {
4857
4974
 
4858
- @@ -79545,7 +80521,7 @@ class WGSLNodeBuilder extends NodeBuilder {
4975
+ @@ -79545,7 +80537,7 @@ class WGSLNodeBuilder extends NodeBuilder {
4859
4976
 
4860
4977
  // Cube textures always need samplers (they use textureSampleLevel, not textureLoad)
4861
4978
  // Also textureGather always need sampler.
@@ -4864,7 +4981,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4864
4981
 
4865
4982
  if ( needsSampler ) {
4866
4983
 
4867
- @@ -79974,7 +80950,8 @@ ${ flowData.code }
4984
+ @@ -79974,7 +80966,8 @@ ${ flowData.code }
4868
4985
 
4869
4986
  for ( const { name, property, type } of builtins.values() ) {
4870
4987
 
@@ -4874,7 +4991,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4874
4991
 
4875
4992
  }
4876
4993
 
4877
- @@ -80230,6 +81207,8 @@ ${ flowData.code }
4994
+ @@ -80230,6 +81223,8 @@ ${ flowData.code }
4878
4995
  getVaryings( shaderStage ) {
4879
4996
 
4880
4997
  const snippets = [];
@@ -4883,7 +5000,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4883
5000
 
4884
5001
  if ( shaderStage === 'vertex' ) {
4885
5002
 
4886
- @@ -80252,7 +81231,12 @@ ${ flowData.code }
5003
+ @@ -80252,7 +81247,12 @@ ${ flowData.code }
4887
5004
 
4888
5005
  let attributesSnippet = `@location( ${ varyingIndex ++ } )`;
4889
5006
 
@@ -4897,7 +5014,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4897
5014
 
4898
5015
  const samplingSnippet = varying.interpolationSampling !== null ? `, ${ varying.interpolationSampling } )` : ' )';
4899
5016
 
4900
- @@ -80353,7 +81337,7 @@ ${ flowData.code }
5017
+ @@ -80353,7 +81353,7 @@ ${ flowData.code }
4901
5018
 
4902
5019
  const { primarySamples } = backend.utils.getTextureSampleData( texture );
4903
5020
 
@@ -4906,7 +5023,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4906
5023
 
4907
5024
  multisampled = '_multisampled';
4908
5025
 
4909
- @@ -81107,7 +82091,19 @@ class WebGPUAttributeUtils {
5026
+ @@ -81107,7 +82107,19 @@ class WebGPUAttributeUtils {
4910
5027
 
4911
5028
  buffer.unmap();
4912
5029
 
@@ -4926,7 +5043,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4926
5043
 
4927
5044
  }
4928
5045
 
4929
- @@ -81128,6 +82124,13 @@ class WebGPUAttributeUtils {
5046
+ @@ -81128,6 +82140,13 @@ class WebGPUAttributeUtils {
4930
5047
  const bufferData = backend.get( bufferAttribute );
4931
5048
  const buffer = backend.get( bufferAttribute ).buffer;
4932
5049
 
@@ -4940,7 +5057,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4940
5057
  let array = bufferAttribute.array;
4941
5058
 
4942
5059
  const itemSize = bufferData._itemSize;
4943
- @@ -81209,6 +82212,9 @@ class WebGPUAttributeUtils {
5060
+ @@ -81209,6 +82228,9 @@ class WebGPUAttributeUtils {
4944
5061
 
4945
5062
  }
4946
5063
 
@@ -4950,7 +5067,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4950
5067
  }
4951
5068
 
4952
5069
  /**
4953
- @@ -81295,9 +82301,15 @@ class WebGPUAttributeUtils {
5070
+ @@ -81295,9 +82317,15 @@ class WebGPUAttributeUtils {
4954
5071
  destroyAttribute( attribute ) {
4955
5072
 
4956
5073
  const backend = this.backend;
@@ -4968,7 +5085,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4968
5085
 
4969
5086
  backend.delete( attribute );
4970
5087
 
4971
- @@ -81682,6 +82694,7 @@ class WebGPUBindingUtils {
5088
+ @@ -81682,6 +82710,7 @@ class WebGPUBindingUtils {
4972
5089
 
4973
5090
  }
4974
5091
 
@@ -4976,7 +5093,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4976
5093
  bindingsData.group = bindGroupGPU;
4977
5094
 
4978
5095
  }
4979
- @@ -81701,6 +82714,7 @@ class WebGPUBindingUtils {
5096
+ @@ -81701,6 +82730,7 @@ class WebGPUBindingUtils {
4980
5097
 
4981
5098
  const updateRanges = binding.updateRanges;
4982
5099
 
@@ -4984,7 +5101,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
4984
5101
  if ( updateRanges.length === 0 ) {
4985
5102
 
4986
5103
  device.queue.writeBuffer(
4987
- @@ -81754,6 +82768,15 @@ class WebGPUBindingUtils {
5104
+ @@ -81754,6 +82784,15 @@ class WebGPUBindingUtils {
4988
5105
 
4989
5106
  }
4990
5107
 
@@ -5000,7 +5117,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5000
5117
  }
5001
5118
 
5002
5119
  /**
5003
- @@ -81830,7 +82853,20 @@ class WebGPUBindingUtils {
5120
+ @@ -81830,7 +82869,20 @@ class WebGPUBindingUtils {
5004
5121
 
5005
5122
  let resourceGPU;
5006
5123
 
@@ -5022,7 +5139,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5022
5139
 
5023
5140
  resourceGPU = device.importExternalTexture( { source: textureData.externalTexture } );
5024
5141
 
5025
- @@ -81904,6 +82940,12 @@ class WebGPUBindingUtils {
5142
+ @@ -81904,6 +82956,12 @@ class WebGPUBindingUtils {
5026
5143
  }
5027
5144
 
5028
5145
  const bindGroupGPU = device.createBindGroup( _bindGroupDescriptor );
@@ -5035,7 +5152,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5035
5152
 
5036
5153
  _bindGroupDescriptor.reset();
5037
5154
 
5038
- @@ -82001,7 +83043,7 @@ class WebGPUBindingUtils {
5155
+ @@ -82001,7 +83059,7 @@ class WebGPUBindingUtils {
5039
5156
 
5040
5157
  const { primarySamples } = backend.utils.getTextureSampleData( binding.texture );
5041
5158
 
@@ -5044,7 +5161,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5044
5161
 
5045
5162
  texture.multisampled = true;
5046
5163
 
5047
- @@ -82039,7 +83081,7 @@ class WebGPUBindingUtils {
5164
+ @@ -82039,7 +83097,7 @@ class WebGPUBindingUtils {
5048
5165
 
5049
5166
  } else if ( type === FloatType ) {
5050
5167
 
@@ -5053,7 +5170,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5053
5170
 
5054
5171
  texture.sampleType = GPUTextureSampleType.Float;
5055
5172
 
5056
- @@ -82502,6 +83544,16 @@ class WebGPUPipelineUtils {
5173
+ @@ -82502,6 +83560,16 @@ class WebGPUPipelineUtils {
5057
5174
 
5058
5175
  }
5059
5176
 
@@ -5070,7 +5187,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5070
5187
  // create pipeline
5071
5188
 
5072
5189
  device.pushErrorScope( 'validation' );
5073
- @@ -82515,6 +83567,7 @@ class WebGPUPipelineUtils {
5190
+ @@ -82515,6 +83583,7 @@ class WebGPUPipelineUtils {
5074
5191
  if ( promises === null ) {
5075
5192
 
5076
5193
  pipelineData.pipeline = device.createRenderPipeline( _renderPipelineDescriptor );
@@ -5078,7 +5195,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5078
5195
 
5079
5196
  _renderPipelineDescriptor.reset();
5080
5197
 
5081
- @@ -82553,6 +83606,15 @@ class WebGPUPipelineUtils {
5198
+ @@ -82553,6 +83622,15 @@ class WebGPUPipelineUtils {
5082
5199
 
5083
5200
  _renderPipelineDescriptor.reset();
5084
5201
 
@@ -5094,7 +5211,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5094
5211
  if ( pipelinePromise !== null ) {
5095
5212
 
5096
5213
  try {
5097
- @@ -82567,7 +83629,7 @@ class WebGPUPipelineUtils {
5214
+ @@ -82567,7 +83645,7 @@ class WebGPUPipelineUtils {
5098
5215
 
5099
5216
  }
5100
5217
 
@@ -5103,7 +5220,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5103
5220
 
5104
5221
  if ( errorScope !== null || asyncError !== null ) {
5105
5222
 
5106
- @@ -84153,7 +85215,9 @@ class WebGPUBackend extends Backend {
5223
+ @@ -84153,7 +85231,9 @@ class WebGPUBackend extends Backend {
5107
5224
 
5108
5225
  let descriptor = canvasData.descriptor;
5109
5226
 
@@ -5114,7 +5231,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5114
5231
 
5115
5232
  descriptor = new GPURenderPassDescriptor();
5116
5233
  descriptor.colorAttachments.push( new GPURenderPassColorAttachment() );
5117
- @@ -84180,6 +85244,9 @@ class WebGPUBackend extends Backend {
5234
+ @@ -84180,6 +85260,9 @@ class WebGPUBackend extends Backend {
5118
5235
 
5119
5236
  canvasData.descriptor = descriptor;
5120
5237
  canvasData.samples = samples;
@@ -5124,7 +5241,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5124
5241
 
5125
5242
  }
5126
5243
 
5127
- @@ -84496,6 +85563,150 @@ class WebGPUBackend extends Backend {
5244
+ @@ -84496,6 +85579,150 @@ class WebGPUBackend extends Backend {
5128
5245
  *
5129
5246
  * @param {RenderContext} renderContext - The render context.
5130
5247
  */
@@ -5275,7 +5392,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5275
5392
  beginRender( renderContext ) {
5276
5393
 
5277
5394
  const renderContextData = this.get( renderContext );
5278
- @@ -84648,10 +85859,15 @@ class WebGPUBackend extends Backend {
5395
+ @@ -84648,10 +85875,15 @@ class WebGPUBackend extends Backend {
5279
5396
 
5280
5397
  //
5281
5398
 
@@ -5291,7 +5408,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5291
5408
  // Layered render targets: prepare bundle encoders for each camera in the array camera.
5292
5409
 
5293
5410
  if ( this._isRenderCameraDepthArray( renderContext ) === true ) {
5294
- @@ -84945,6 +86161,8 @@ class WebGPUBackend extends Backend {
5411
+ @@ -84945,6 +86177,8 @@ class WebGPUBackend extends Backend {
5295
5412
 
5296
5413
  }
5297
5414
 
@@ -5300,7 +5417,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5300
5417
  if ( occlusionQueryCount > 0 ) {
5301
5418
 
5302
5419
  const bufferSize = occlusionQueryCount * 8; // 8 byte entries for query results
5303
- @@ -84987,7 +86205,16 @@ class WebGPUBackend extends Backend {
5420
+ @@ -84987,7 +86221,16 @@ class WebGPUBackend extends Backend {
5304
5421
 
5305
5422
  }
5306
5423
 
@@ -5318,7 +5435,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5318
5435
 
5319
5436
 
5320
5437
  //
5321
- @@ -85081,6 +86308,8 @@ class WebGPUBackend extends Backend {
5438
+ @@ -85081,6 +86324,8 @@ class WebGPUBackend extends Backend {
5322
5439
  */
5323
5440
  updateViewport( renderContext ) {
5324
5441
 
@@ -5327,7 +5444,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5327
5444
  const { currentPass } = this.get( renderContext );
5328
5445
  const { x, y, width, height, minDepth, maxDepth } = renderContext.viewportValue;
5329
5446
 
5330
- @@ -85095,6 +86324,8 @@ class WebGPUBackend extends Backend {
5447
+ @@ -85095,6 +86340,8 @@ class WebGPUBackend extends Backend {
5331
5448
  */
5332
5449
  updateScissor( renderContext ) {
5333
5450
 
@@ -5336,7 +5453,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5336
5453
  const { currentPass } = this.get( renderContext );
5337
5454
  const { x, y, width, height } = renderContext.scissorValue;
5338
5455
 
5339
- @@ -85593,6 +86824,11 @@ class WebGPUBackend extends Backend {
5456
+ @@ -85593,6 +86840,11 @@ class WebGPUBackend extends Backend {
5340
5457
  } else {
5341
5458
 
5342
5459
  passEncoderGPU.draw( vertexCount, instanceCount, firstVertex, 0 );
@@ -5348,7 +5465,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5348
5465
 
5349
5466
  }
5350
5467
 
5351
- @@ -85628,6 +86864,19 @@ class WebGPUBackend extends Backend {
5468
+ @@ -85628,6 +86880,19 @@ class WebGPUBackend extends Backend {
5352
5469
  // vertex buffers
5353
5470
 
5354
5471
  const vertexBuffers = renderObject.getVertexBuffers();
@@ -5368,7 +5485,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5368
5485
 
5369
5486
  if ( renderObject.camera.isArrayCamera && renderObject.camera.cameras.length > 0 ) {
5370
5487
 
5371
- @@ -85916,6 +87165,12 @@ class WebGPUBackend extends Backend {
5488
+ @@ -85916,6 +87181,12 @@ class WebGPUBackend extends Backend {
5372
5489
 
5373
5490
  }
5374
5491
 
@@ -5381,7 +5498,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5381
5498
  /**
5382
5499
  * Generates mipmaps for the given texture.
5383
5500
  *
5384
- @@ -86017,6 +87272,8 @@ class WebGPUBackend extends Backend {
5501
+ @@ -86017,6 +87288,8 @@ class WebGPUBackend extends Backend {
5385
5502
  _shaderModuleDescriptor.label = program.stage + ( program.name !== '' ? `_${ program.name }` : '' );
5386
5503
  _shaderModuleDescriptor.code = program.code;
5387
5504
 
@@ -5390,7 +5507,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5390
5507
  programGPU.module = {
5391
5508
  module: this.device.createShaderModule( _shaderModuleDescriptor ),
5392
5509
  entryPoint: 'main'
5393
- @@ -86164,6 +87421,7 @@ class WebGPUBackend extends Backend {
5510
+ @@ -86164,6 +87437,7 @@ class WebGPUBackend extends Backend {
5394
5511
  _bufferDescriptor.reset();
5395
5512
 
5396
5513
  uniformBufferData.buffer = bufferGPU;
@@ -5398,7 +5515,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5398
5515
 
5399
5516
  }
5400
5517
 
5401
- @@ -86430,6 +87688,7 @@ class WebGPUBackend extends Backend {
5518
+ @@ -86430,6 +87704,7 @@ class WebGPUBackend extends Backend {
5402
5519
 
5403
5520
  submit( this.device, encoder.finish() );
5404
5521
 
@@ -5406,7 +5523,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5406
5523
  if ( dstLevel === 0 && dstTexture.generateMipmaps ) {
5407
5524
 
5408
5525
  this.textureUtils.generateMipmaps( dstTexture );
5409
- @@ -86447,6 +87706,8 @@ class WebGPUBackend extends Backend {
5526
+ @@ -86447,6 +87722,8 @@ class WebGPUBackend extends Backend {
5410
5527
  */
5411
5528
  copyFramebufferToTexture( texture, renderContext, rectangle ) {
5412
5529
 
@@ -5415,7 +5532,7 @@ index f707acc24f5711fdae065ce920b08435b0869c1b..d030da8cf893d8f222330d437b45297e
5415
5532
  const renderContextData = this.get( renderContext );
5416
5533
 
5417
5534
  let sourceGPU = null;
5418
- @@ -87020,7 +88281,20 @@ class RenderPipeline {
5535
+ @@ -87020,7 +88297,20 @@ class RenderPipeline {
5419
5536
  const currentXR = renderer.xr.enabled;
5420
5537
  renderer.xr.enabled = false;
5421
5538
 
@@ -5451,6 +5568,36 @@ index 7b550223936eedcbbe782ce0f7cef8d11388181e..0bb036147379173ea3eb51774be72d45
5451
5568
 
5452
5569
  /**
5453
5570
  * A uniform texture node representing the weights pass.
5571
+ diff --git a/examples/jsm/tsl/display/SSRNode.js b/examples/jsm/tsl/display/SSRNode.js
5572
+ index e7905c59434ca3917b13ebb917051f7c5ea0d69b..0188f96aeb1c4255b62d31598afb4a1def1b3a88 100644
5573
+ --- a/examples/jsm/tsl/display/SSRNode.js
5574
+ +++ b/examples/jsm/tsl/display/SSRNode.js
5575
+ @@ -228,6 +228,16 @@ class SSRNode extends TempNode {
5576
+ */
5577
+ this.quality = uniform( 0.5 );
5578
+
5579
+ + /**
5580
+ + * The most raymarching steps the mirror trace (`stochastic: false`) takes. ThreeNative patch: Unreal
5581
+ + * caps SSR steps per tier (UE 5.8.3 SSRTReflections.usf:198-216, BaseScalability.ini ReflectionQuality);
5582
+ + * `quality` only scales the step count with the ray's screen length, so no setting gives a fixed cap.
5583
+ + * The default leaves the stock count unbounded.
5584
+ + *
5585
+ + * @type {UniformNode<float>}
5586
+ + */
5587
+ + this.maxSteps = uniform( 1e6 );
5588
+ +
5589
+ /**
5590
+ * Mirror bias for the stochastic GGX sampling. Concentrates the reflected rays toward
5591
+ * the lobe's narrow (near-mirror) core, trading a small amount of bias for less noise.
5592
+ @@ -1057,7 +1067,7 @@ class SSRNode extends TempNode {
5593
+ // length (cheap for the short rays that dominate). Scatter needs a fixed, bounded count for
5594
+ // coherent stochastic sampling; each step then spans the whole ray as rayVec / totalStep.
5595
+ const totalStep = int( this.stochastic === false
5596
+ - ? trunc( max( abs( xLen ), abs( yLen ) ).mul( this.quality.clamp() ) ).max( int( 1 ) ).toConst()
5597
+ + ? trunc( max( abs( xLen ), abs( yLen ) ).mul( this.quality.clamp() ).min( this.maxSteps ) ).max( int( 1 ) ).toConst()
5598
+ : this.quality.clamp().mul( MAX_STEPS ).max( float( 1 ) ) ).toConst();
5599
+
5600
+ const xSpan = xLen.div( totalStep ).toVar();
5454
5601
  diff --git a/src/materials/nodes/manager/NodeMaterialObserver.js b/src/materials/nodes/manager/NodeMaterialObserver.js
5455
5602
  index 1f4c2546c937c70f013fec3a0580b66ac501ebbb..7e2cb9926878b43aa2b8b3a146e3427711be7210 100644
5456
5603
  --- a/src/materials/nodes/manager/NodeMaterialObserver.js
@@ -5822,37 +5969,99 @@ index b89834b9166c75fd946ade24db265bf8c367d244..18e2b7943393fd07b7989b1e3a5231a6
5822
5969
  } );
5823
5970
 
5824
5971
  diff --git a/src/nodes/accessors/Skinning.js b/src/nodes/accessors/Skinning.js
5825
- index 2356aed8656dceb1ea74b73ea2e739371a960484..76303e765bc29853cfd7f139dd3ec76545b70798 100644
5972
+ index 2356aed8656dceb1ea74b73ea2e739371a960484..7e77f7559b7e988777d22585c64f37f72aa1f666 100644
5826
5973
  --- a/src/nodes/accessors/Skinning.js
5827
5974
  +++ b/src/nodes/accessors/Skinning.js
5828
- @@ -117,7 +117,15 @@ function getPreviousSkinnedPosition( skinnedMesh, bindMatrixNode, bindMatrixInve
5975
+ @@ -85,6 +85,31 @@ function getSkinnedNormalAndTangent( boneMatrices, normal, tangent, bindMatrix,
5829
5976
 
5830
- }
5977
+ }
5831
5978
 
5832
- - return getSkinnedPosition( data.node, positionPrevious, bindMatrixNode, bindMatrixInverseNode, skinIndexNode, skinWeightNode );
5979
+ +/**
5980
+ + * The previous frame's bone matrices for one skeleton, created on first use at the current pose
5981
+ + * so a skeleton's first frame has zero skin motion.
5982
+ + *
5983
+ + * @param {Skeleton} skeleton - The skeleton.
5984
+ + * @returns {{previousBoneMatrices: Float32Array}} The skeleton's bone history.
5985
+ + */
5986
+ +function previousBoneMatricesData( skeleton ) {
5987
+ +
5988
+ + let data = _previousBoneMatricesData.get( skeleton );
5989
+ +
5990
+ + if ( data === undefined ) {
5991
+ +
5992
+ + skeleton.update();
5993
+ +
5994
+ + data = { previousBoneMatrices: new Float32Array( skeleton.boneMatrices ) };
5995
+ +
5996
+ + _previousBoneMatricesData.set( skeleton, data );
5997
+ +
5998
+ + }
5999
+ +
6000
+ + return data;
6001
+ +
6002
+ +}
6003
+ +
6004
+ /**
6005
+ * Retrieves or initializes the previous frame skinned position node for motion vectors.
6006
+ * Uses a WeakMap to cache previous frame bone matrix arrays and their TSL buffer nodes.
6007
+ @@ -98,26 +123,25 @@ function getSkinnedNormalAndTangent( boneMatrices, normal, tangent, bindMatrix,
6008
+ */
6009
+ function getPreviousSkinnedPosition( skinnedMesh, bindMatrixNode, bindMatrixInverseNode, skinIndexNode, skinWeightNode ) {
6010
+
6011
+ - const skeleton = skinnedMesh.skeleton;
6012
+ -
6013
+ - let data = _previousBoneMatricesData.get( skeleton );
6014
+ -
6015
+ - if ( data === undefined ) {
6016
+ + // Meshes that share a material and geometry share this program, so the bone history is the
6017
+ + // drawn object's own skeleton's, resolved per object like the current bones, never the
6018
+ + // skeleton the program happened to be built for.
6019
+ + const previousBoneMatricesNode = buffer( previousBoneMatricesData( skinnedMesh.skeleton ).previousBoneMatrices, 'mat4', skinnedMesh.skeleton.bones.length ).onObjectUpdate( ( { object } ) => {
6020
+
6021
+ - skeleton.update();
6022
+ + const mesh = object?.isSkinnedMesh === true ? object : skinnedMesh;
6023
+ + return previousBoneMatricesData( mesh.skeleton ).previousBoneMatrices;
6024
+
6025
+ - const previousBoneMatrices = new Float32Array( skeleton.boneMatrices );
6026
+ + } );
6027
+
6028
+ - data = {
6029
+ - previousBoneMatrices,
6030
+ - node: buffer( previousBoneMatrices, 'mat4', skeleton.bones.length )
6031
+ - };
5833
6032
  + // The previous bones and world matrix must use the same frame's bind inverse.
5834
6033
  + const previousBindMatrixInverse = uniform( skinnedMesh.bindMatrixInverse, 'mat4' ).onObjectUpdate( ( { object } ) => {
5835
- +
6034
+
6035
+ - _previousBoneMatricesData.set( skeleton, data );
5836
6036
  + const mesh = object?.isSkinnedMesh === true ? object : skinnedMesh;
5837
6037
  + return mesh[ Symbol.for( 'threenative.velocity.previousBindMatrixInverse' ) ] ?? mesh.bindMatrixInverse;
5838
- +
6038
+
6039
+ - }
5839
6040
  + } );
5840
- +
5841
- + return getSkinnedPosition( data.node, positionPrevious, bindMatrixNode, previousBindMatrixInverse, skinIndexNode, skinWeightNode );
6041
+
6042
+ - return getSkinnedPosition( data.node, positionPrevious, bindMatrixNode, bindMatrixInverseNode, skinIndexNode, skinWeightNode );
6043
+ + return getSkinnedPosition( previousBoneMatricesNode, positionPrevious, bindMatrixNode, previousBindMatrixInverse, skinIndexNode, skinWeightNode );
5842
6044
 
5843
6045
  }
5844
6046
 
5845
- @@ -149,7 +157,8 @@ export const skinning = /*@__PURE__*/ Fn( ( [ skinnedMesh ], builder ) => {
6047
+ @@ -145,11 +169,14 @@ export const skinning = /*@__PURE__*/ Fn( ( [ skinnedMesh ], builder ) => {
6048
+
6049
+ _skeletonsUpdated.set( skeleton, frameId );
6050
+
6051
+ - const skeletonData = _previousBoneMatricesData.get( skeleton );
6052
+ + // A scheduled history means velocity is on: the skeleton gets its own history even when
6053
+ + // the program was built for another skeleton.
6054
+ + const scheduledPrevious = object[ Symbol.for( 'threenative.velocity.previousBoneMatrices' ) ];
6055
+ + const skeletonData = scheduledPrevious !== undefined ? previousBoneMatricesData( skeleton ) : _previousBoneMatricesData.get( skeleton );
5846
6056
 
5847
6057
  if ( skeletonData !== undefined ) {
5848
6058
 
5849
6059
  - skeletonData.previousBoneMatrices.set( skeleton.boneMatrices );
5850
- + const scheduledPrevious = object[ Symbol.for( 'threenative.velocity.previousBoneMatrices' ) ];
5851
6060
  + skeletonData.previousBoneMatrices.set( scheduledPrevious ?? skeleton.boneMatrices );
5852
6061
 
5853
6062
  }
5854
6063
 
5855
- @@ -216,7 +225,8 @@ export const computeSkinning = /*@__PURE__*/ Fn( ( [ skinnedMesh, toPosition = n
6064
+ @@ -216,7 +243,8 @@ export const computeSkinning = /*@__PURE__*/ Fn( ( [ skinnedMesh, toPosition = n
5856
6065
 
5857
6066
  if ( state !== undefined ) {
5858
6067
 
@@ -7186,8 +7395,8 @@ index 27df07dd99b46ac85a69f3249d9934334ff10dae..ace19db76fab3f08ed4d581d1e272066
7186
7395
  + try {
7187
7396
  +
7188
7397
  + this._init( cubeUVRenderTarget );
7189
- + // One fence covers as much queued work as the heaviest single face (the first GGX filter pass).
7190
- + this._fenceBudget = this._sizeLods[ 1 ] * this._sizeLods[ 1 ] * GGX_SAMPLES;
7398
+ + // One fence covers the heaviest single face (the first GGX filter pass), never less than a 256 cube's: a fence waits behind every queued frame.
7399
+ + this._fenceBudget = Math.max( 128 * 128, this._sizeLods[ 1 ] * this._sizeLods[ 1 ] ) * GGX_SAMPLES;
7191
7400
  + this._fencePending = 0;
7192
7401
  + await this._textureToCubeUVAsync( texture, cubeUVRenderTarget );
7193
7402
  + await this._applyPMREMAsync( cubeUVRenderTarget );