@gnsx/three 0.184.7 → 0.184.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.
- package/build/three.webgpu.js +54 -0
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +54 -0
- package/build/three.webgpu.nodes.min.js +1 -1
- package/examples/jsm/inspector/Inspector.js +2 -0
- package/examples/jsm/inspector/tabs/Settings.js +2 -0
- package/package.json +1 -1
- package/src/nodes/accessors/RendererReferenceNode.js +26 -0
- package/src/renderers/common/RenderObjects.js +8 -0
- package/src/renderers/common/Renderer.js +11 -0
- package/src/renderers/common/Textures.js +12 -0
|
@@ -514,6 +514,7 @@ class Inspector extends RendererInspector {
|
|
|
514
514
|
|
|
515
515
|
}
|
|
516
516
|
|
|
517
|
+
// WITH_GENESYS
|
|
517
518
|
const STORAGE_KEY_THREE_INSPECTOR = 'threejs-inspector';
|
|
518
519
|
|
|
519
520
|
function getStorageOrNull() {
|
|
@@ -581,5 +582,6 @@ function setItem( id, state ) {
|
|
|
581
582
|
}
|
|
582
583
|
|
|
583
584
|
}
|
|
585
|
+
// !WITH_GENESYS
|
|
584
586
|
|
|
585
587
|
export { Inspector, getItem, setItem };
|
|
@@ -232,7 +232,9 @@ class Settings extends Parameters {
|
|
|
232
232
|
|
|
233
233
|
const extUrl = new URL( extension.url, new URL( _EXTENSIONS_PATH, import.meta.url ) ).href;
|
|
234
234
|
|
|
235
|
+
// WITH_GENESYS
|
|
235
236
|
const module = await import( /* webpackIgnore: true */ extUrl );
|
|
237
|
+
// !WITH_GENESYS
|
|
236
238
|
|
|
237
239
|
const keys = Object.keys( module );
|
|
238
240
|
const ExtensionClass = module[ keys[ 0 ] ];
|
package/package.json
CHANGED
|
@@ -76,3 +76,29 @@ export default RendererReferenceNode;
|
|
|
76
76
|
* @returns {RendererReferenceNode}
|
|
77
77
|
*/
|
|
78
78
|
export const rendererReference = ( name, type, renderer = null ) => new RendererReferenceNode( name, type, renderer );
|
|
79
|
+
|
|
80
|
+
// WITH_GENESYS
|
|
81
|
+
/**
|
|
82
|
+
* Clears strong links from a {@link RendererReferenceNode} to a disposed renderer.
|
|
83
|
+
* Module-level nodes (e.g. `toneMappingExposure`) set `.reference` each frame via
|
|
84
|
+
* `updateReference()` and are not cleared by {@link Renderer#dispose} otherwise.
|
|
85
|
+
*
|
|
86
|
+
* @param {RendererReferenceNode} node - The reference node to detach.
|
|
87
|
+
* @param {Renderer} renderer - The renderer being disposed.
|
|
88
|
+
*/
|
|
89
|
+
export function detachRendererReference( node, renderer ) {
|
|
90
|
+
|
|
91
|
+
if ( node.reference === renderer ) {
|
|
92
|
+
|
|
93
|
+
node.reference = null;
|
|
94
|
+
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if ( node.renderer === renderer ) {
|
|
98
|
+
|
|
99
|
+
node.renderer = null;
|
|
100
|
+
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
}
|
|
104
|
+
// !WITH_GENESYS
|
|
@@ -72,6 +72,7 @@ class RenderObjects {
|
|
|
72
72
|
*/
|
|
73
73
|
this.chainMaps = {};
|
|
74
74
|
|
|
75
|
+
// WITH_GENESYS
|
|
75
76
|
/**
|
|
76
77
|
* Strongly tracks every render object created through {@link createRenderObject}
|
|
77
78
|
* so {@link dispose} can iterate them. ChainMap is `WeakMap`-backed and not
|
|
@@ -86,6 +87,7 @@ class RenderObjects {
|
|
|
86
87
|
* @type {Set<RenderObject>}
|
|
87
88
|
*/
|
|
88
89
|
this._renderObjects = new Set();
|
|
90
|
+
// !WITH_GENESYS
|
|
89
91
|
|
|
90
92
|
}
|
|
91
93
|
|
|
@@ -187,6 +189,7 @@ class RenderObjects {
|
|
|
187
189
|
*/
|
|
188
190
|
dispose() {
|
|
189
191
|
|
|
192
|
+
// WITH_GENESYS
|
|
190
193
|
// Snapshot first: `RenderObject.dispose()` fires `onDispose` which
|
|
191
194
|
// mutates `_renderObjects` (and the chain map). Iterating the live set
|
|
192
195
|
// would skip entries.
|
|
@@ -199,6 +202,7 @@ class RenderObjects {
|
|
|
199
202
|
|
|
200
203
|
}
|
|
201
204
|
|
|
205
|
+
// !WITH_GENESYS
|
|
202
206
|
this.chainMaps = {};
|
|
203
207
|
|
|
204
208
|
}
|
|
@@ -225,7 +229,9 @@ class RenderObjects {
|
|
|
225
229
|
|
|
226
230
|
const renderObject = new RenderObject( nodes, geometries, renderer, object, material, scene, camera, lightsNode, renderContext, clippingContext );
|
|
227
231
|
|
|
232
|
+
// WITH_GENESYS
|
|
228
233
|
this._renderObjects.add( renderObject );
|
|
234
|
+
// !WITH_GENESYS
|
|
229
235
|
|
|
230
236
|
renderObject.onDispose = () => {
|
|
231
237
|
|
|
@@ -235,7 +241,9 @@ class RenderObjects {
|
|
|
235
241
|
|
|
236
242
|
chainMap.delete( renderObject.getChainArray() );
|
|
237
243
|
|
|
244
|
+
// WITH_GENESYS
|
|
238
245
|
this._renderObjects.delete( renderObject );
|
|
246
|
+
// !WITH_GENESYS
|
|
239
247
|
|
|
240
248
|
};
|
|
241
249
|
|
|
@@ -33,6 +33,10 @@ import { RenderTarget } from '../../core/RenderTarget.js';
|
|
|
33
33
|
import { DoubleSide, BackSide, FrontSide, SRGBColorSpace, NoToneMapping, LinearFilter, HalfFloatType, RGBAFormat, PCFShadowMap, VSMShadowMap } from '../../constants.js';
|
|
34
34
|
|
|
35
35
|
import { float, vec3, vec4, Fn } from '../../nodes/tsl/TSLCore.js';
|
|
36
|
+
// WITH_GENESYS
|
|
37
|
+
import { detachRendererReference } from '../../nodes/accessors/RendererReferenceNode.js';
|
|
38
|
+
import { toneMappingExposure } from '../../nodes/display/ToneMappingNode.js';
|
|
39
|
+
// !WITH_GENESYS
|
|
36
40
|
import { reference } from '../../nodes/accessors/ReferenceNode.js';
|
|
37
41
|
import { highpModelNormalViewMatrix, highpModelViewMatrix } from '../../nodes/accessors/ModelNode.js';
|
|
38
42
|
import { context } from '../../nodes/core/ContextNode.js';
|
|
@@ -2529,13 +2533,20 @@ class Renderer {
|
|
|
2529
2533
|
|
|
2530
2534
|
} );
|
|
2531
2535
|
|
|
2536
|
+
// WITH_GENESYS
|
|
2532
2537
|
// Drop the strong reference to the active `RenderContext` so module-level
|
|
2533
2538
|
// `WeakMap<RenderContext, …>` caches can release entries once
|
|
2534
2539
|
// `_renderContexts.dispose()` has cleared its dictionary.
|
|
2535
2540
|
this._currentRenderContext = null;
|
|
2541
|
+
// !WITH_GENESYS
|
|
2536
2542
|
|
|
2537
2543
|
}
|
|
2538
2544
|
|
|
2545
|
+
// WITH_GENESYS
|
|
2546
|
+
// Module-level TSL `toneMappingExposure` retains the last renderer in `.reference`.
|
|
2547
|
+
detachRendererReference( toneMappingExposure, this );
|
|
2548
|
+
// !WITH_GENESYS
|
|
2549
|
+
|
|
2539
2550
|
this.setRenderTarget( null );
|
|
2540
2551
|
this.setAnimationLoop( null );
|
|
2541
2552
|
|
|
@@ -55,6 +55,7 @@ class Textures extends DataMap {
|
|
|
55
55
|
*/
|
|
56
56
|
this._htmlTextures = new Set();
|
|
57
57
|
|
|
58
|
+
// WITH_GENESYS
|
|
58
59
|
/**
|
|
59
60
|
* Strongly tracks every texture that has had a `'dispose'` listener
|
|
60
61
|
* installed by {@link updateTexture}. `DataMap` is `WeakMap`-backed and
|
|
@@ -76,6 +77,7 @@ class Textures extends DataMap {
|
|
|
76
77
|
* @type {Set<RenderTarget>}
|
|
77
78
|
*/
|
|
78
79
|
this._renderTargets = new Set();
|
|
80
|
+
// !WITH_GENESYS
|
|
79
81
|
|
|
80
82
|
}
|
|
81
83
|
|
|
@@ -203,7 +205,9 @@ class Textures extends DataMap {
|
|
|
203
205
|
|
|
204
206
|
renderTarget.addEventListener( 'dispose', renderTargetData.onDispose );
|
|
205
207
|
|
|
208
|
+
// WITH_GENESYS
|
|
206
209
|
this._renderTargets.add( renderTarget );
|
|
210
|
+
// !WITH_GENESYS
|
|
207
211
|
|
|
208
212
|
}
|
|
209
213
|
|
|
@@ -425,7 +429,9 @@ class Textures extends DataMap {
|
|
|
425
429
|
|
|
426
430
|
texture.addEventListener( 'dispose', textureData.onDispose );
|
|
427
431
|
|
|
432
|
+
// WITH_GENESYS
|
|
428
433
|
this._textures.add( texture );
|
|
434
|
+
// !WITH_GENESYS
|
|
429
435
|
|
|
430
436
|
}
|
|
431
437
|
|
|
@@ -595,7 +601,9 @@ class Textures extends DataMap {
|
|
|
595
601
|
this.delete( renderTarget );
|
|
596
602
|
this.backend.delete( renderTarget );
|
|
597
603
|
|
|
604
|
+
// WITH_GENESYS
|
|
598
605
|
this._renderTargets.delete( renderTarget );
|
|
606
|
+
// !WITH_GENESYS
|
|
599
607
|
|
|
600
608
|
this.info.memory.renderTargets --;
|
|
601
609
|
|
|
@@ -646,7 +654,9 @@ class Textures extends DataMap {
|
|
|
646
654
|
|
|
647
655
|
this.delete( texture );
|
|
648
656
|
|
|
657
|
+
// WITH_GENESYS
|
|
649
658
|
this._textures.delete( texture );
|
|
659
|
+
// !WITH_GENESYS
|
|
650
660
|
|
|
651
661
|
this.info.destroyTexture( texture );
|
|
652
662
|
|
|
@@ -654,6 +664,7 @@ class Textures extends DataMap {
|
|
|
654
664
|
|
|
655
665
|
}
|
|
656
666
|
|
|
667
|
+
// WITH_GENESYS
|
|
657
668
|
/**
|
|
658
669
|
* Frees internal resources. Destroys every tracked render target and
|
|
659
670
|
* texture so the `'dispose'` listeners installed by {@link updateTexture}
|
|
@@ -689,6 +700,7 @@ class Textures extends DataMap {
|
|
|
689
700
|
super.dispose();
|
|
690
701
|
|
|
691
702
|
}
|
|
703
|
+
// !WITH_GENESYS
|
|
692
704
|
|
|
693
705
|
}
|
|
694
706
|
|