@gnsx/three 0.185.3 → 0.185.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/examples/jsm/Addons.js
CHANGED
|
@@ -104,7 +104,12 @@ export * from './loaders/LUT3dlLoader.js';
|
|
|
104
104
|
export * from './loaders/LUTCubeLoader.js';
|
|
105
105
|
export * from './loaders/LUTImageLoader.js';
|
|
106
106
|
export * from './loaders/LWOLoader.js';
|
|
107
|
-
|
|
107
|
+
// WITH_GENESYS
|
|
108
|
+
// LottieLoader is excluded from the Addons barrel because it imports lottie-web from a CDN URL
|
|
109
|
+
// (https://cdn.jsdelivr.net/npm/lottie-web@5.13.0/+esm), which Node.js/TSX cannot resolve in test
|
|
110
|
+
// environments. The loader is also deprecated in r185 and scheduled for removal in r186.
|
|
111
|
+
// export * from './loaders/LottieLoader.js';
|
|
112
|
+
// !WITH_GENESYS
|
|
108
113
|
export * from './loaders/MD2Loader.js';
|
|
109
114
|
export * from './loaders/MDDLoader.js';
|
|
110
115
|
export * from './loaders/MTLLoader.js';
|
|
@@ -102,11 +102,11 @@ const ATLAS_PADDING = 1;
|
|
|
102
102
|
* Atlas layout (nz = resolution.z, PADDING = 1):
|
|
103
103
|
* ```
|
|
104
104
|
* slice 0 : padding (copy of sub-volume 0, data slice 0)
|
|
105
|
-
* slices 1
|
|
105
|
+
* slices 1 to nz : sub-volume 0 data
|
|
106
106
|
* slice nz + 1 : padding (copy of sub-volume 0, data slice nz-1)
|
|
107
107
|
* slice nz + 2 : padding (copy of sub-volume 1, data slice 0)
|
|
108
|
-
* slices nz+3
|
|
109
|
-
*
|
|
108
|
+
* slices nz+3 to 2*nz+2 : sub-volume 1 data
|
|
109
|
+
* ...
|
|
110
110
|
* ```
|
|
111
111
|
* Total atlas depth = `7 * ( nz + 2 )`.
|
|
112
112
|
*
|
|
@@ -279,7 +279,7 @@ class LightProbeGrid extends Object3D {
|
|
|
279
279
|
/**
|
|
280
280
|
* Bakes all probes by rendering cubemaps at each probe position
|
|
281
281
|
* and projecting to L2 SH. Optionally iterates additional passes to
|
|
282
|
-
* capture indirect bounces
|
|
282
|
+
* capture indirect bounces - each extra pass samples the previous pass's
|
|
283
283
|
* atlas as indirect light, so a grid added to the scene before baking
|
|
284
284
|
* accumulates one bounce per extra pass.
|
|
285
285
|
*
|
|
@@ -328,7 +328,7 @@ class LightProbeGrid extends Object3D {
|
|
|
328
328
|
renderer.getScissor( _currentScissor );
|
|
329
329
|
const currentScissorTest = renderer.getScissorTest();
|
|
330
330
|
|
|
331
|
-
// Scene is static across the bake
|
|
331
|
+
// Scene is static across the bake - update once and disable per-render auto updates.
|
|
332
332
|
const currentMatrixWorldAutoUpdate = scene.matrixWorldAutoUpdate;
|
|
333
333
|
if ( currentMatrixWorldAutoUpdate === true ) {
|
|
334
334
|
|
|
@@ -337,7 +337,7 @@ class LightProbeGrid extends Object3D {
|
|
|
337
337
|
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
// Disable shadow map auto-update across all passes
|
|
340
|
+
// Disable shadow map auto-update across all passes - lights don't move.
|
|
341
341
|
// Force a single shadow update on the first render so maps are initialized.
|
|
342
342
|
const currentShadowAutoUpdate = renderer.shadowMap.autoUpdate;
|
|
343
343
|
renderer.shadowMap.autoUpdate = false;
|
|
@@ -351,7 +351,7 @@ class LightProbeGrid extends Object3D {
|
|
|
351
351
|
// const t0 = performance.now();
|
|
352
352
|
|
|
353
353
|
// Pass 0 captures direct light only (grid hidden, so probesSH is not sampled
|
|
354
|
-
//
|
|
354
|
+
// the atlas at this point may be uninitialized or hold a prior bake).
|
|
355
355
|
// Each subsequent pass keeps the grid visible so the cube cameras read the
|
|
356
356
|
// previous pass's atlas as indirect light, accumulating one bounce per pass.
|
|
357
357
|
// Phase 1 writes to the batch target and Phase 2 only swaps it into the atlas
|
|
@@ -439,11 +439,11 @@ class LightProbeGrid extends Object3D {
|
|
|
439
439
|
|
|
440
440
|
}
|
|
441
441
|
|
|
442
|
-
// Phase 2: Repack SH data from batch target into the atlas 3D texture
|
|
442
|
+
// Phase 2: Repack SH data from batch target into the atlas 3D texture on the GPU.
|
|
443
443
|
//
|
|
444
444
|
// For each of the 7 packed sub-volumes (texture index t) we write:
|
|
445
445
|
// - A leading padding slice (copy of data slice iz = 0)
|
|
446
|
-
// - All nz data slices (iz = 0
|
|
446
|
+
// - All nz data slices (iz = 0 to nz-1)
|
|
447
447
|
// - A trailing padding slice (copy of data slice iz = nz-1)
|
|
448
448
|
//
|
|
449
449
|
// In the atlas the slices for sub-volume t occupy the range:
|
|
@@ -675,7 +675,7 @@ class LightProbeGrid extends Object3D {
|
|
|
675
675
|
|
|
676
676
|
renderer.shadowMap.autoUpdate = savedShadowAutoUpdate;
|
|
677
677
|
|
|
678
|
-
// Padding slices
|
|
678
|
+
// Padding slices copy the nearest edge data slices on the GPU.
|
|
679
679
|
const atlas = this.texture;
|
|
680
680
|
|
|
681
681
|
for ( let textureIndex = 0; textureIndex < 7; textureIndex ++ ) {
|
|
@@ -1142,7 +1142,7 @@ function _ensureWebGPUComputeResources( cubemapSize, envMapTexture, atlasTexture
|
|
|
1142
1142
|
totalWeight.addAssign( weight );
|
|
1143
1143
|
|
|
1144
1144
|
const dir = coord.normalize();
|
|
1145
|
-
// Pass explicit direction
|
|
1145
|
+
// Pass explicit direction; omitting UV would default to reflectVector (needs camera).
|
|
1146
1146
|
const cw = cubeTexture( envMapTexture, coord ).rgb.mul( weight );
|
|
1147
1147
|
|
|
1148
1148
|
accum0.addAssign( cw.mul( 0.282095 ) );
|