@gnsx/three 0.186.1 → 0.186.4
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 +610 -17
- package/build/three.webgpu.nodes.js +610 -17
- package/examples/jsm/inspector/Inspector.js +60 -1
- package/examples/jsm/inspector/tabs/Memory.js +60 -1
- package/examples/jsm/inspector/tabs/Settings.js +36 -0
- package/examples/jsm/inspector/ui/Profiler.js +6 -0
- package/examples/jsm/inspector/ui/Style.js +53 -1
- package/examples/jsm/inspector/ui/utils.js +121 -0
- package/package.json +1 -1
- package/src/materials/nodes/NodeMaterial.js +30 -0
- package/src/nodes/core/NodeBuilder.js +74 -0
- package/src/nodes/display/ComplexityDebug.js +278 -0
- package/src/nodes/lighting/LightsNode.js +71 -2
- package/src/nodes/lighting/PointLightNode.js +4 -1
- package/src/nodes/lighting/RectAreaLightNode.js +14 -0
- package/src/nodes/lighting/SpotLightNode.js +10 -2
- package/src/renderers/common/Background.js +17 -1
- package/src/renderers/common/RenderObject.js +5 -0
- package/src/renderers/common/Renderer.js +24 -1
- package/src/renderers/common/nodes/NodeManager.js +22 -7
- package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +8 -0
- package/src/renderers/webgl-fallback/utils/WebGLState.js +19 -3
- package/src/renderers/webgpu/WebGPUBackend.js +14 -2
- package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +16 -0
- package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +20 -0
- package/build/three.cjs +0 -17
|
@@ -2389,6 +2389,9 @@ class WebGPUBackend extends Backend {
|
|
|
2389
2389
|
const depthStencilFormat = utils.getCurrentDepthStencilFormat( renderObject.context );
|
|
2390
2390
|
const primitiveTopology = utils.getPrimitiveTopology( object, material );
|
|
2391
2391
|
const frontFaceCW = ( object.isMesh && object.matrixWorld.determinantAffine() < 0 );
|
|
2392
|
+
// WITH_GENESYS
|
|
2393
|
+
const debugView = renderObject.renderer.debug.view;
|
|
2394
|
+
// !WITH_GENESYS
|
|
2392
2395
|
|
|
2393
2396
|
let needsUpdate = false;
|
|
2394
2397
|
|
|
@@ -2406,7 +2409,10 @@ class WebGPUBackend extends Backend {
|
|
|
2406
2409
|
data.colorFormat !== colorFormat || data.depthStencilFormat !== depthStencilFormat ||
|
|
2407
2410
|
data.primitiveTopology !== primitiveTopology ||
|
|
2408
2411
|
data.frontFaceCW !== frontFaceCW ||
|
|
2409
|
-
data.clippingContextCacheKey !== renderObject.clippingContextCacheKey
|
|
2412
|
+
data.clippingContextCacheKey !== renderObject.clippingContextCacheKey ||
|
|
2413
|
+
// WITH_GENESYS
|
|
2414
|
+
data.debugView !== debugView
|
|
2415
|
+
// !WITH_GENESYS
|
|
2410
2416
|
) {
|
|
2411
2417
|
|
|
2412
2418
|
data.material = material; data.materialVersion = material.version;
|
|
@@ -2427,6 +2433,9 @@ class WebGPUBackend extends Backend {
|
|
|
2427
2433
|
data.primitiveTopology = primitiveTopology;
|
|
2428
2434
|
data.frontFaceCW = frontFaceCW;
|
|
2429
2435
|
data.clippingContextCacheKey = renderObject.clippingContextCacheKey;
|
|
2436
|
+
// WITH_GENESYS
|
|
2437
|
+
data.debugView = debugView;
|
|
2438
|
+
// !WITH_GENESYS
|
|
2430
2439
|
|
|
2431
2440
|
needsUpdate = true;
|
|
2432
2441
|
|
|
@@ -2470,7 +2479,10 @@ class WebGPUBackend extends Backend {
|
|
|
2470
2479
|
utils.getCurrentColorSpace( renderContext ), utils.getCurrentColorFormat( renderContext ), utils.getCurrentDepthStencilFormat( renderContext ),
|
|
2471
2480
|
utils.getPrimitiveTopology( object, material ),
|
|
2472
2481
|
renderObject.getGeometryCacheKey(),
|
|
2473
|
-
renderObject.clippingContextCacheKey
|
|
2482
|
+
renderObject.clippingContextCacheKey,
|
|
2483
|
+
// WITH_GENESYS
|
|
2484
|
+
renderObject.renderer.debug.view
|
|
2485
|
+
// !WITH_GENESYS
|
|
2474
2486
|
].join();
|
|
2475
2487
|
|
|
2476
2488
|
}
|
|
@@ -376,6 +376,10 @@ class WGSLNodeBuilder extends NodeBuilder {
|
|
|
376
376
|
*/
|
|
377
377
|
_generateTextureSample( texture, textureProperty, uvSnippet, depthSnippet, offsetSnippet, shaderStage = this.shaderStage ) {
|
|
378
378
|
|
|
379
|
+
// WITH_GENESYS
|
|
380
|
+
if ( shaderStage === 'fragment' ) this.recordFragmentTextureSample( texture, shaderStage, textureProperty + '|' + uvSnippet );
|
|
381
|
+
// !WITH_GENESYS
|
|
382
|
+
|
|
379
383
|
if ( shaderStage === 'fragment' ) {
|
|
380
384
|
|
|
381
385
|
if ( depthSnippet ) {
|
|
@@ -656,6 +660,10 @@ class WGSLNodeBuilder extends NodeBuilder {
|
|
|
656
660
|
*/
|
|
657
661
|
generateFilteredTexture( texture, textureProperty, uvSnippet, offsetSnippet, levelSnippet = '0u', depthSnippet ) {
|
|
658
662
|
|
|
663
|
+
// WITH_GENESYS
|
|
664
|
+
this.recordFragmentTextureSample( texture, this.shaderStage, textureProperty + '|' + uvSnippet + '|' + levelSnippet );
|
|
665
|
+
// !WITH_GENESYS
|
|
666
|
+
|
|
659
667
|
const wrapFunction = this.generateWrapFunction( texture );
|
|
660
668
|
const textureDimension = this.generateTextureDimension( texture, textureProperty, levelSnippet );
|
|
661
669
|
|
|
@@ -693,6 +701,10 @@ class WGSLNodeBuilder extends NodeBuilder {
|
|
|
693
701
|
*/
|
|
694
702
|
generateTextureLod( texture, textureProperty, uvSnippet, depthSnippet, offsetSnippet, levelSnippet = '0u' ) {
|
|
695
703
|
|
|
704
|
+
// WITH_GENESYS
|
|
705
|
+
this.recordFragmentTextureSample( texture, this.shaderStage, textureProperty + '|' + uvSnippet + '|' + levelSnippet );
|
|
706
|
+
// !WITH_GENESYS
|
|
707
|
+
|
|
696
708
|
// Cube textures cannot use textureLoad in WGSL, must use textureSampleLevel
|
|
697
709
|
if ( texture.isCubeTexture === true ) {
|
|
698
710
|
|
|
@@ -1071,6 +1083,10 @@ class WGSLNodeBuilder extends NodeBuilder {
|
|
|
1071
1083
|
|
|
1072
1084
|
if ( this.isUnfilterable( texture ) === false ) {
|
|
1073
1085
|
|
|
1086
|
+
// WITH_GENESYS
|
|
1087
|
+
this.recordFragmentTextureSample( texture, this.shaderStage, textureProperty + '|' + uvSnippet + '|' + levelSnippet );
|
|
1088
|
+
// !WITH_GENESYS
|
|
1089
|
+
|
|
1074
1090
|
if ( depthSnippet ) {
|
|
1075
1091
|
|
|
1076
1092
|
if ( offsetSnippet ) {
|
|
@@ -106,6 +106,26 @@ class WebGPUPipelineUtils {
|
|
|
106
106
|
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
+
// WITH_GENESYS
|
|
110
|
+
// Accumulate shader cost with One+One. Opaque materials normally disable blending.
|
|
111
|
+
if ( backend.renderer.debug.view === 'shaderComplexity' && material.isShadowPassMaterial !== true && backend.renderer.isOutputTarget !== true ) {
|
|
112
|
+
|
|
113
|
+
materialBlending = {
|
|
114
|
+
color: {
|
|
115
|
+
srcFactor: GPUBlendFactor.One,
|
|
116
|
+
dstFactor: GPUBlendFactor.One,
|
|
117
|
+
operation: GPUBlendOperation.Add
|
|
118
|
+
},
|
|
119
|
+
alpha: {
|
|
120
|
+
srcFactor: GPUBlendFactor.One,
|
|
121
|
+
dstFactor: GPUBlendFactor.One,
|
|
122
|
+
operation: GPUBlendOperation.Add
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
}
|
|
127
|
+
// !WITH_GENESYS
|
|
128
|
+
|
|
109
129
|
// stencil
|
|
110
130
|
|
|
111
131
|
let stencilFront = {};
|
package/build/three.cjs
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright 2010-2026 Three.js Authors
|
|
4
|
-
* SPDX-License-Identifier: MIT
|
|
5
|
-
*
|
|
6
|
-
* The CommonJS build of three is deprecated. three is ESM-only going forward;
|
|
7
|
-
* this entry now re-exports the ES module via require(esm) and will be removed
|
|
8
|
-
* in a future release.
|
|
9
|
-
*
|
|
10
|
-
* Replace `require('three')` with `import * as THREE from 'three'`.
|
|
11
|
-
*/
|
|
12
|
-
process.emitWarning(
|
|
13
|
-
'`require("three")` is deprecated and will be removed.\n' +
|
|
14
|
-
'Replace `const THREE = require("three")` with `import * as THREE from "three"`.',
|
|
15
|
-
{ type: 'DeprecationWarning', code: 'THREE_CJS_DEPRECATED' }
|
|
16
|
-
);
|
|
17
|
-
module.exports = require( './three.module.js' );
|