@gnsx/three 0.186.8 → 0.186.10
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.core.js +9 -1
- package/build/three.webgpu.js +109 -23
- package/build/three.webgpu.nodes.js +109 -23
- package/examples/jsm/inspector/tabs/Settings.js +3 -2
- package/package.json +1 -1
- package/src/materials/nodes/manager/NodeMaterialObserver.js +11 -16
- package/src/nodes/accessors/VelocityNode.js +1 -1
- package/src/nodes/core/NodeBuilder.js +2 -0
- package/src/nodes/display/WireframeDebug.js +60 -0
- package/src/objects/BatchedMesh.js +9 -1
- package/src/renderers/common/Geometries.js +11 -1
- package/src/renderers/common/RenderObject.js +9 -1
- package/src/renderers/common/Renderer.js +1 -1
- package/src/renderers/webgl-fallback/WebGLBackend.js +12 -2
- package/src/renderers/webgpu/utils/WebGPUUtils.js +7 -1
package/build/three.core.js
CHANGED
|
@@ -28570,7 +28570,15 @@ class BatchedMesh extends Mesh {
|
|
|
28570
28570
|
// the vertices to draw (3 lines per triangle) so we multiply the draw counts / starts and make
|
|
28571
28571
|
// assumptions about the index buffer byte size.
|
|
28572
28572
|
let multiDrawMultiplier = 1;
|
|
28573
|
-
|
|
28573
|
+
// WITH_GENESYS
|
|
28574
|
+
// Same rule as materialDrawsWireframe, inlined so this core class does not import the node library.
|
|
28575
|
+
// A legacy renderer has no debug view, so only the material flag applies there.
|
|
28576
|
+
const debugView = renderer !== null && renderer !== undefined && renderer.debug !== undefined ? renderer.debug.view : undefined;
|
|
28577
|
+
const wireframe = material.wireframe === true || ( debugView === 'wireframe' && material.isShadowPassMaterial !== true && material.allowOverride !== false );
|
|
28578
|
+
// !WITH_GENESYS
|
|
28579
|
+
// const wireframe = material.wireframe === true;
|
|
28580
|
+
|
|
28581
|
+
if ( wireframe ) {
|
|
28574
28582
|
|
|
28575
28583
|
multiDrawMultiplier = 2;
|
|
28576
28584
|
bytesPerElement = geometry.attributes.position.count > 65535 ? 4 : 2;
|
package/build/three.webgpu.js
CHANGED
|
@@ -76,7 +76,8 @@ const refreshUniforms = [
|
|
|
76
76
|
'steps',
|
|
77
77
|
'thickness',
|
|
78
78
|
'transmission',
|
|
79
|
-
'transmissionMap'
|
|
79
|
+
'transmissionMap',
|
|
80
|
+
'wireframe'
|
|
80
81
|
];
|
|
81
82
|
|
|
82
83
|
|
|
@@ -271,14 +272,12 @@ class NodeMaterialObserver {
|
|
|
271
272
|
|
|
272
273
|
}
|
|
273
274
|
|
|
274
|
-
|
|
275
|
+
// global data
|
|
275
276
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
data.bufferWidth = width;
|
|
279
|
-
data.bufferHeight = height;
|
|
277
|
+
const { width, height } = renderObject.context;
|
|
280
278
|
|
|
281
|
-
|
|
279
|
+
data.bufferWidth = width;
|
|
280
|
+
data.bufferHeight = height;
|
|
282
281
|
|
|
283
282
|
const { environmentIntensity, environmentRotation } = renderObject.scene;
|
|
284
283
|
|
|
@@ -599,18 +598,14 @@ class NodeMaterialObserver {
|
|
|
599
598
|
|
|
600
599
|
}
|
|
601
600
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
const { width, height } = renderObject.context;
|
|
605
|
-
|
|
606
|
-
if ( renderObjectData.bufferWidth !== width || renderObjectData.bufferHeight !== height ) {
|
|
601
|
+
const { width, height } = renderObject.context;
|
|
607
602
|
|
|
608
|
-
|
|
609
|
-
renderObjectData.bufferHeight = height;
|
|
603
|
+
if ( renderObjectData.bufferWidth !== width || renderObjectData.bufferHeight !== height ) {
|
|
610
604
|
|
|
611
|
-
|
|
605
|
+
renderObjectData.bufferWidth = width;
|
|
606
|
+
renderObjectData.bufferHeight = height;
|
|
612
607
|
|
|
613
|
-
|
|
608
|
+
return false;
|
|
614
609
|
|
|
615
610
|
}
|
|
616
611
|
|
|
@@ -32456,6 +32451,69 @@ class ChainMap {
|
|
|
32456
32451
|
|
|
32457
32452
|
}
|
|
32458
32453
|
|
|
32454
|
+
// WITH_GENESYS
|
|
32455
|
+
// Wireframe debug view. Scene meshes are drawn as lines. Lighting is unchanged.
|
|
32456
|
+
// !WITH_GENESYS
|
|
32457
|
+
|
|
32458
|
+
/**
|
|
32459
|
+
* Wireframe. Each scene mesh is drawn as lines along its triangle edges.
|
|
32460
|
+
* Lighting, color, and tone mapping stay the same as the shaded view.
|
|
32461
|
+
* Shadow passes and fullscreen quads stay triangles.
|
|
32462
|
+
*
|
|
32463
|
+
* @type {string}
|
|
32464
|
+
*/
|
|
32465
|
+
const DEBUG_VIEW_WIREFRAME = 'wireframe';
|
|
32466
|
+
|
|
32467
|
+
/**
|
|
32468
|
+
* Whether the wireframe debug view should take over this draw.
|
|
32469
|
+
* Shadow passes stay triangles so shadows still cover the surface. Fullscreen quads stay
|
|
32470
|
+
* triangles so post-processing still fills the screen. A material with `allowOverride`
|
|
32471
|
+
* false (the renderer skybox) stays shaded behind the edges.
|
|
32472
|
+
*
|
|
32473
|
+
* @param {Material} material - The material being drawn.
|
|
32474
|
+
* @param {?Renderer} renderer - The renderer. May be null.
|
|
32475
|
+
* @param {?Object3D} [object=null] - The object being drawn.
|
|
32476
|
+
* @return {boolean} `true` when the debug view forces a wireframe.
|
|
32477
|
+
*/
|
|
32478
|
+
function debugViewForcesWireframe( material, renderer, object = null ) {
|
|
32479
|
+
|
|
32480
|
+
const debug = renderer !== null && renderer !== undefined ? renderer.debug : undefined;
|
|
32481
|
+
|
|
32482
|
+
if ( debug === undefined || debug.view !== DEBUG_VIEW_WIREFRAME ) return false;
|
|
32483
|
+
|
|
32484
|
+
if ( material.isShadowPassMaterial === true ) return false;
|
|
32485
|
+
|
|
32486
|
+
if ( material.allowOverride === false ) return false;
|
|
32487
|
+
|
|
32488
|
+
// Lines and points already draw as lines. Rewriting their index as triangle edges
|
|
32489
|
+
// would skip vertices. Quad meshes are fullscreen passes.
|
|
32490
|
+
if ( object === null || object === undefined || object.isMesh !== true || object.isQuadMesh === true ) return false;
|
|
32491
|
+
|
|
32492
|
+
return true;
|
|
32493
|
+
|
|
32494
|
+
}
|
|
32495
|
+
|
|
32496
|
+
/**
|
|
32497
|
+
* Whether this draw should use line topology.
|
|
32498
|
+
* A material that already sets `wireframe` stays a wireframe in every view.
|
|
32499
|
+
* The wireframe debug view forces it for scene meshes. A renderer without `debug`
|
|
32500
|
+
* (the legacy WebGL renderer) only honors the material flag.
|
|
32501
|
+
*
|
|
32502
|
+
* @param {Material} material - The material being drawn.
|
|
32503
|
+
* @param {?Renderer} renderer - The renderer. May be null.
|
|
32504
|
+
* @param {?Object3D} [object=null] - The object being drawn.
|
|
32505
|
+
* @return {boolean} `true` when the draw is lines.
|
|
32506
|
+
*/
|
|
32507
|
+
function materialDrawsWireframe( material, renderer, object = null ) {
|
|
32508
|
+
|
|
32509
|
+
if ( material.wireframe === true ) return true;
|
|
32510
|
+
|
|
32511
|
+
return debugViewForcesWireframe( material, renderer, object );
|
|
32512
|
+
|
|
32513
|
+
}
|
|
32514
|
+
|
|
32515
|
+
// !WITH_GENESYS
|
|
32516
|
+
|
|
32459
32517
|
let _id$a = 0;
|
|
32460
32518
|
const _protoKeysCache = new WeakMap();
|
|
32461
32519
|
|
|
@@ -33090,7 +33148,12 @@ class RenderObject {
|
|
|
33090
33148
|
|
|
33091
33149
|
let rangeFactor = 1;
|
|
33092
33150
|
|
|
33093
|
-
|
|
33151
|
+
// WITH_GENESYS
|
|
33152
|
+
const wireframe = materialDrawsWireframe( material, this.renderer, object );
|
|
33153
|
+
// !WITH_GENESYS
|
|
33154
|
+
// const wireframe = material.wireframe === true;
|
|
33155
|
+
|
|
33156
|
+
if ( wireframe === true && ! object.isPoints && ! object.isLineSegments && ! object.isLine && ! object.isLineLoop ) {
|
|
33094
33157
|
|
|
33095
33158
|
rangeFactor = 2;
|
|
33096
33159
|
|
|
@@ -33978,6 +34041,8 @@ class Attributes extends DataMap {
|
|
|
33978
34041
|
|
|
33979
34042
|
}
|
|
33980
34043
|
|
|
34044
|
+
// !WITH_GENESYS
|
|
34045
|
+
|
|
33981
34046
|
/**
|
|
33982
34047
|
* Returns the wireframe version for the given geometry.
|
|
33983
34048
|
*
|
|
@@ -34209,6 +34274,8 @@ class Geometries extends DataMap {
|
|
|
34209
34274
|
|
|
34210
34275
|
this._geometryDisposeListeners.delete( geometry );
|
|
34211
34276
|
|
|
34277
|
+
this.delete( geometry );
|
|
34278
|
+
|
|
34212
34279
|
};
|
|
34213
34280
|
|
|
34214
34281
|
geometry.addEventListener( 'dispose', onDispose );
|
|
@@ -34345,7 +34412,12 @@ class Geometries extends DataMap {
|
|
|
34345
34412
|
|
|
34346
34413
|
let index = geometry.index;
|
|
34347
34414
|
|
|
34348
|
-
|
|
34415
|
+
// WITH_GENESYS
|
|
34416
|
+
const wireframe = materialDrawsWireframe( material, renderObject.renderer, renderObject.object );
|
|
34417
|
+
// !WITH_GENESYS
|
|
34418
|
+
// const wireframe = material.wireframe === true;
|
|
34419
|
+
|
|
34420
|
+
if ( wireframe === true ) {
|
|
34349
34421
|
|
|
34350
34422
|
const wireframes = this.wireframes;
|
|
34351
34423
|
|
|
@@ -43276,7 +43348,7 @@ class VelocityNode extends TempNode {
|
|
|
43276
43348
|
* @type {UniformNode<mat4>}
|
|
43277
43349
|
* @default null
|
|
43278
43350
|
*/
|
|
43279
|
-
this.previousCameraViewMatrix = uniform( new Matrix4() );
|
|
43351
|
+
this.previousCameraViewMatrix = uniform( new Matrix4() ).setGroup( renderGroup );
|
|
43280
43352
|
|
|
43281
43353
|
}
|
|
43282
43354
|
|
|
@@ -56010,6 +56082,8 @@ class NodeBuilder {
|
|
|
56010
56082
|
delete context.getAO;
|
|
56011
56083
|
delete context.getGI;
|
|
56012
56084
|
delete context.getShadow;
|
|
56085
|
+
delete context.nodeLoop;
|
|
56086
|
+
delete context.nodeBlock;
|
|
56013
56087
|
|
|
56014
56088
|
return context;
|
|
56015
56089
|
|
|
@@ -64787,7 +64861,7 @@ class Renderer {
|
|
|
64787
64861
|
* @property {?Function} onNodeBuilderCreated - A callback function that is executed after a node builder has been created and before it is built.
|
|
64788
64862
|
* @property {?Function} onShaderError - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now.
|
|
64789
64863
|
* @property {Function} getShaderAsync - Allows the get the raw shader code for the given scene, camera and 3D object.
|
|
64790
|
-
* @property {string} view - Debug view. `shaderComplexity`, `lightingComplexity`, `overdraw`, and `shaderComplexityAndOverdraw` replace the shaded color with a heatmap. `shaderComplexityAndOverdraw` multiplies the shader cost by the overdraw count. `bufferVisualization` shows one material channel. `lightingOnly` and `detailLighting` light a flat gray surface. `drawCall` lights each submitted draw with its own diffuse color. `frontBackFace` draws both windings and tints the side facing the camera. `shadowCaster` lights a mesh green when it casts shadows and gray when it does not. `doubleSide` lights a single-sided surface gray, a visible double-sided back face blue, and a hidden double-sided back face red.
|
|
64864
|
+
* @property {string} view - Debug view. `shaderComplexity`, `lightingComplexity`, `overdraw`, and `shaderComplexityAndOverdraw` replace the shaded color with a heatmap. `shaderComplexityAndOverdraw` multiplies the shader cost by the overdraw count. `bufferVisualization` shows one material channel. `lightingOnly` and `detailLighting` light a flat gray surface. `drawCall` lights each submitted draw with its own diffuse color. `frontBackFace` draws both windings and tints the side facing the camera. `shadowCaster` lights a mesh green when it casts shadows and gray when it does not. `doubleSide` lights a single-sided surface gray, a visible double-sided back face blue, and a hidden double-sided back face red. `wireframe` draws each mesh as lines along its triangle edges. Lighting stays the same as the shaded view. Shadow passes and fullscreen quads stay triangles.
|
|
64791
64865
|
* @property {string} buffer - Channel drawn by `bufferVisualization`: `baseColor`, `worldNormal`, `roughness`, `metallic`, `ambientOcclusion`, or `emissive`.
|
|
64792
64866
|
* @property {number} shaderComplexityBudget - Proxy budget that fills the shader-complexity ramp.
|
|
64793
64867
|
* @property {number} quadOverdrawBudget - Overlapping fragments that fill the quad-overdraw ramp.
|
|
@@ -77976,9 +78050,16 @@ class WebGLBackend extends Backend {
|
|
|
77976
78050
|
else if ( object.isLineLoop ) renderer.mode = gl.LINE_LOOP;
|
|
77977
78051
|
else {
|
|
77978
78052
|
|
|
77979
|
-
|
|
78053
|
+
// WITH_GENESYS
|
|
78054
|
+
const wireframe = materialDrawsWireframe( material, this.renderer, object );
|
|
78055
|
+
const linewidth = material.wireframeLinewidth !== undefined ? material.wireframeLinewidth : 1;
|
|
78056
|
+
// !WITH_GENESYS
|
|
78057
|
+
// const wireframe = material.wireframe === true;
|
|
78058
|
+
// const linewidth = material.wireframeLinewidth;
|
|
77980
78059
|
|
|
77981
|
-
|
|
78060
|
+
if ( wireframe === true ) {
|
|
78061
|
+
|
|
78062
|
+
state.setLineWidth( linewidth * this.renderer.getPixelRatio() );
|
|
77982
78063
|
renderer.mode = gl.LINES;
|
|
77983
78064
|
|
|
77984
78065
|
} else {
|
|
@@ -80216,6 +80297,8 @@ class NodeStorageBuffer extends StorageBuffer {
|
|
|
80216
80297
|
|
|
80217
80298
|
}
|
|
80218
80299
|
|
|
80300
|
+
// !WITH_GENESYS
|
|
80301
|
+
|
|
80219
80302
|
const _commandList = [ null ];
|
|
80220
80303
|
|
|
80221
80304
|
/**
|
|
@@ -80430,7 +80513,10 @@ class WebGPUUtils {
|
|
|
80430
80513
|
getPrimitiveTopology( object, material ) {
|
|
80431
80514
|
|
|
80432
80515
|
if ( object.isPoints ) return GPUPrimitiveTopology.PointList;
|
|
80433
|
-
|
|
80516
|
+
// WITH_GENESYS
|
|
80517
|
+
else if ( object.isLineSegments || ( object.isMesh && materialDrawsWireframe( material, this.backend.renderer, object ) ) ) return GPUPrimitiveTopology.LineList;
|
|
80518
|
+
// !WITH_GENESYS
|
|
80519
|
+
// else if ( object.isLineSegments || ( object.isMesh && material.wireframe === true ) ) return GPUPrimitiveTopology.LineList;
|
|
80434
80520
|
else if ( object.isLine ) return GPUPrimitiveTopology.LineStrip;
|
|
80435
80521
|
else if ( object.isMesh ) return GPUPrimitiveTopology.TriangleList;
|
|
80436
80522
|
|
|
@@ -76,7 +76,8 @@ const refreshUniforms = [
|
|
|
76
76
|
'steps',
|
|
77
77
|
'thickness',
|
|
78
78
|
'transmission',
|
|
79
|
-
'transmissionMap'
|
|
79
|
+
'transmissionMap',
|
|
80
|
+
'wireframe'
|
|
80
81
|
];
|
|
81
82
|
|
|
82
83
|
|
|
@@ -271,14 +272,12 @@ class NodeMaterialObserver {
|
|
|
271
272
|
|
|
272
273
|
}
|
|
273
274
|
|
|
274
|
-
|
|
275
|
+
// global data
|
|
275
276
|
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
data.bufferWidth = width;
|
|
279
|
-
data.bufferHeight = height;
|
|
277
|
+
const { width, height } = renderObject.context;
|
|
280
278
|
|
|
281
|
-
|
|
279
|
+
data.bufferWidth = width;
|
|
280
|
+
data.bufferHeight = height;
|
|
282
281
|
|
|
283
282
|
const { environmentIntensity, environmentRotation } = renderObject.scene;
|
|
284
283
|
|
|
@@ -599,18 +598,14 @@ class NodeMaterialObserver {
|
|
|
599
598
|
|
|
600
599
|
}
|
|
601
600
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
const { width, height } = renderObject.context;
|
|
605
|
-
|
|
606
|
-
if ( renderObjectData.bufferWidth !== width || renderObjectData.bufferHeight !== height ) {
|
|
601
|
+
const { width, height } = renderObject.context;
|
|
607
602
|
|
|
608
|
-
|
|
609
|
-
renderObjectData.bufferHeight = height;
|
|
603
|
+
if ( renderObjectData.bufferWidth !== width || renderObjectData.bufferHeight !== height ) {
|
|
610
604
|
|
|
611
|
-
|
|
605
|
+
renderObjectData.bufferWidth = width;
|
|
606
|
+
renderObjectData.bufferHeight = height;
|
|
612
607
|
|
|
613
|
-
|
|
608
|
+
return false;
|
|
614
609
|
|
|
615
610
|
}
|
|
616
611
|
|
|
@@ -32456,6 +32451,69 @@ class ChainMap {
|
|
|
32456
32451
|
|
|
32457
32452
|
}
|
|
32458
32453
|
|
|
32454
|
+
// WITH_GENESYS
|
|
32455
|
+
// Wireframe debug view. Scene meshes are drawn as lines. Lighting is unchanged.
|
|
32456
|
+
// !WITH_GENESYS
|
|
32457
|
+
|
|
32458
|
+
/**
|
|
32459
|
+
* Wireframe. Each scene mesh is drawn as lines along its triangle edges.
|
|
32460
|
+
* Lighting, color, and tone mapping stay the same as the shaded view.
|
|
32461
|
+
* Shadow passes and fullscreen quads stay triangles.
|
|
32462
|
+
*
|
|
32463
|
+
* @type {string}
|
|
32464
|
+
*/
|
|
32465
|
+
const DEBUG_VIEW_WIREFRAME = 'wireframe';
|
|
32466
|
+
|
|
32467
|
+
/**
|
|
32468
|
+
* Whether the wireframe debug view should take over this draw.
|
|
32469
|
+
* Shadow passes stay triangles so shadows still cover the surface. Fullscreen quads stay
|
|
32470
|
+
* triangles so post-processing still fills the screen. A material with `allowOverride`
|
|
32471
|
+
* false (the renderer skybox) stays shaded behind the edges.
|
|
32472
|
+
*
|
|
32473
|
+
* @param {Material} material - The material being drawn.
|
|
32474
|
+
* @param {?Renderer} renderer - The renderer. May be null.
|
|
32475
|
+
* @param {?Object3D} [object=null] - The object being drawn.
|
|
32476
|
+
* @return {boolean} `true` when the debug view forces a wireframe.
|
|
32477
|
+
*/
|
|
32478
|
+
function debugViewForcesWireframe( material, renderer, object = null ) {
|
|
32479
|
+
|
|
32480
|
+
const debug = renderer !== null && renderer !== undefined ? renderer.debug : undefined;
|
|
32481
|
+
|
|
32482
|
+
if ( debug === undefined || debug.view !== DEBUG_VIEW_WIREFRAME ) return false;
|
|
32483
|
+
|
|
32484
|
+
if ( material.isShadowPassMaterial === true ) return false;
|
|
32485
|
+
|
|
32486
|
+
if ( material.allowOverride === false ) return false;
|
|
32487
|
+
|
|
32488
|
+
// Lines and points already draw as lines. Rewriting their index as triangle edges
|
|
32489
|
+
// would skip vertices. Quad meshes are fullscreen passes.
|
|
32490
|
+
if ( object === null || object === undefined || object.isMesh !== true || object.isQuadMesh === true ) return false;
|
|
32491
|
+
|
|
32492
|
+
return true;
|
|
32493
|
+
|
|
32494
|
+
}
|
|
32495
|
+
|
|
32496
|
+
/**
|
|
32497
|
+
* Whether this draw should use line topology.
|
|
32498
|
+
* A material that already sets `wireframe` stays a wireframe in every view.
|
|
32499
|
+
* The wireframe debug view forces it for scene meshes. A renderer without `debug`
|
|
32500
|
+
* (the legacy WebGL renderer) only honors the material flag.
|
|
32501
|
+
*
|
|
32502
|
+
* @param {Material} material - The material being drawn.
|
|
32503
|
+
* @param {?Renderer} renderer - The renderer. May be null.
|
|
32504
|
+
* @param {?Object3D} [object=null] - The object being drawn.
|
|
32505
|
+
* @return {boolean} `true` when the draw is lines.
|
|
32506
|
+
*/
|
|
32507
|
+
function materialDrawsWireframe( material, renderer, object = null ) {
|
|
32508
|
+
|
|
32509
|
+
if ( material.wireframe === true ) return true;
|
|
32510
|
+
|
|
32511
|
+
return debugViewForcesWireframe( material, renderer, object );
|
|
32512
|
+
|
|
32513
|
+
}
|
|
32514
|
+
|
|
32515
|
+
// !WITH_GENESYS
|
|
32516
|
+
|
|
32459
32517
|
let _id$a = 0;
|
|
32460
32518
|
const _protoKeysCache = new WeakMap();
|
|
32461
32519
|
|
|
@@ -33090,7 +33148,12 @@ class RenderObject {
|
|
|
33090
33148
|
|
|
33091
33149
|
let rangeFactor = 1;
|
|
33092
33150
|
|
|
33093
|
-
|
|
33151
|
+
// WITH_GENESYS
|
|
33152
|
+
const wireframe = materialDrawsWireframe( material, this.renderer, object );
|
|
33153
|
+
// !WITH_GENESYS
|
|
33154
|
+
// const wireframe = material.wireframe === true;
|
|
33155
|
+
|
|
33156
|
+
if ( wireframe === true && ! object.isPoints && ! object.isLineSegments && ! object.isLine && ! object.isLineLoop ) {
|
|
33094
33157
|
|
|
33095
33158
|
rangeFactor = 2;
|
|
33096
33159
|
|
|
@@ -33978,6 +34041,8 @@ class Attributes extends DataMap {
|
|
|
33978
34041
|
|
|
33979
34042
|
}
|
|
33980
34043
|
|
|
34044
|
+
// !WITH_GENESYS
|
|
34045
|
+
|
|
33981
34046
|
/**
|
|
33982
34047
|
* Returns the wireframe version for the given geometry.
|
|
33983
34048
|
*
|
|
@@ -34209,6 +34274,8 @@ class Geometries extends DataMap {
|
|
|
34209
34274
|
|
|
34210
34275
|
this._geometryDisposeListeners.delete( geometry );
|
|
34211
34276
|
|
|
34277
|
+
this.delete( geometry );
|
|
34278
|
+
|
|
34212
34279
|
};
|
|
34213
34280
|
|
|
34214
34281
|
geometry.addEventListener( 'dispose', onDispose );
|
|
@@ -34345,7 +34412,12 @@ class Geometries extends DataMap {
|
|
|
34345
34412
|
|
|
34346
34413
|
let index = geometry.index;
|
|
34347
34414
|
|
|
34348
|
-
|
|
34415
|
+
// WITH_GENESYS
|
|
34416
|
+
const wireframe = materialDrawsWireframe( material, renderObject.renderer, renderObject.object );
|
|
34417
|
+
// !WITH_GENESYS
|
|
34418
|
+
// const wireframe = material.wireframe === true;
|
|
34419
|
+
|
|
34420
|
+
if ( wireframe === true ) {
|
|
34349
34421
|
|
|
34350
34422
|
const wireframes = this.wireframes;
|
|
34351
34423
|
|
|
@@ -43276,7 +43348,7 @@ class VelocityNode extends TempNode {
|
|
|
43276
43348
|
* @type {UniformNode<mat4>}
|
|
43277
43349
|
* @default null
|
|
43278
43350
|
*/
|
|
43279
|
-
this.previousCameraViewMatrix = uniform( new Matrix4() );
|
|
43351
|
+
this.previousCameraViewMatrix = uniform( new Matrix4() ).setGroup( renderGroup );
|
|
43280
43352
|
|
|
43281
43353
|
}
|
|
43282
43354
|
|
|
@@ -56010,6 +56082,8 @@ class NodeBuilder {
|
|
|
56010
56082
|
delete context.getAO;
|
|
56011
56083
|
delete context.getGI;
|
|
56012
56084
|
delete context.getShadow;
|
|
56085
|
+
delete context.nodeLoop;
|
|
56086
|
+
delete context.nodeBlock;
|
|
56013
56087
|
|
|
56014
56088
|
return context;
|
|
56015
56089
|
|
|
@@ -64787,7 +64861,7 @@ class Renderer {
|
|
|
64787
64861
|
* @property {?Function} onNodeBuilderCreated - A callback function that is executed after a node builder has been created and before it is built.
|
|
64788
64862
|
* @property {?Function} onShaderError - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now.
|
|
64789
64863
|
* @property {Function} getShaderAsync - Allows the get the raw shader code for the given scene, camera and 3D object.
|
|
64790
|
-
* @property {string} view - Debug view. `shaderComplexity`, `lightingComplexity`, `overdraw`, and `shaderComplexityAndOverdraw` replace the shaded color with a heatmap. `shaderComplexityAndOverdraw` multiplies the shader cost by the overdraw count. `bufferVisualization` shows one material channel. `lightingOnly` and `detailLighting` light a flat gray surface. `drawCall` lights each submitted draw with its own diffuse color. `frontBackFace` draws both windings and tints the side facing the camera. `shadowCaster` lights a mesh green when it casts shadows and gray when it does not. `doubleSide` lights a single-sided surface gray, a visible double-sided back face blue, and a hidden double-sided back face red.
|
|
64864
|
+
* @property {string} view - Debug view. `shaderComplexity`, `lightingComplexity`, `overdraw`, and `shaderComplexityAndOverdraw` replace the shaded color with a heatmap. `shaderComplexityAndOverdraw` multiplies the shader cost by the overdraw count. `bufferVisualization` shows one material channel. `lightingOnly` and `detailLighting` light a flat gray surface. `drawCall` lights each submitted draw with its own diffuse color. `frontBackFace` draws both windings and tints the side facing the camera. `shadowCaster` lights a mesh green when it casts shadows and gray when it does not. `doubleSide` lights a single-sided surface gray, a visible double-sided back face blue, and a hidden double-sided back face red. `wireframe` draws each mesh as lines along its triangle edges. Lighting stays the same as the shaded view. Shadow passes and fullscreen quads stay triangles.
|
|
64791
64865
|
* @property {string} buffer - Channel drawn by `bufferVisualization`: `baseColor`, `worldNormal`, `roughness`, `metallic`, `ambientOcclusion`, or `emissive`.
|
|
64792
64866
|
* @property {number} shaderComplexityBudget - Proxy budget that fills the shader-complexity ramp.
|
|
64793
64867
|
* @property {number} quadOverdrawBudget - Overlapping fragments that fill the quad-overdraw ramp.
|
|
@@ -77976,9 +78050,16 @@ class WebGLBackend extends Backend {
|
|
|
77976
78050
|
else if ( object.isLineLoop ) renderer.mode = gl.LINE_LOOP;
|
|
77977
78051
|
else {
|
|
77978
78052
|
|
|
77979
|
-
|
|
78053
|
+
// WITH_GENESYS
|
|
78054
|
+
const wireframe = materialDrawsWireframe( material, this.renderer, object );
|
|
78055
|
+
const linewidth = material.wireframeLinewidth !== undefined ? material.wireframeLinewidth : 1;
|
|
78056
|
+
// !WITH_GENESYS
|
|
78057
|
+
// const wireframe = material.wireframe === true;
|
|
78058
|
+
// const linewidth = material.wireframeLinewidth;
|
|
77980
78059
|
|
|
77981
|
-
|
|
78060
|
+
if ( wireframe === true ) {
|
|
78061
|
+
|
|
78062
|
+
state.setLineWidth( linewidth * this.renderer.getPixelRatio() );
|
|
77982
78063
|
renderer.mode = gl.LINES;
|
|
77983
78064
|
|
|
77984
78065
|
} else {
|
|
@@ -80216,6 +80297,8 @@ class NodeStorageBuffer extends StorageBuffer {
|
|
|
80216
80297
|
|
|
80217
80298
|
}
|
|
80218
80299
|
|
|
80300
|
+
// !WITH_GENESYS
|
|
80301
|
+
|
|
80219
80302
|
const _commandList = [ null ];
|
|
80220
80303
|
|
|
80221
80304
|
/**
|
|
@@ -80430,7 +80513,10 @@ class WebGPUUtils {
|
|
|
80430
80513
|
getPrimitiveTopology( object, material ) {
|
|
80431
80514
|
|
|
80432
80515
|
if ( object.isPoints ) return GPUPrimitiveTopology.PointList;
|
|
80433
|
-
|
|
80516
|
+
// WITH_GENESYS
|
|
80517
|
+
else if ( object.isLineSegments || ( object.isMesh && materialDrawsWireframe( material, this.backend.renderer, object ) ) ) return GPUPrimitiveTopology.LineList;
|
|
80518
|
+
// !WITH_GENESYS
|
|
80519
|
+
// else if ( object.isLineSegments || ( object.isMesh && material.wireframe === true ) ) return GPUPrimitiveTopology.LineList;
|
|
80434
80520
|
else if ( object.isLine ) return GPUPrimitiveTopology.LineStrip;
|
|
80435
80521
|
else if ( object.isMesh ) return GPUPrimitiveTopology.TriangleList;
|
|
80436
80522
|
|
|
@@ -143,6 +143,7 @@ class Settings extends Parameters {
|
|
|
143
143
|
this._bufferState = bufferState;
|
|
144
144
|
this._debugViewControl = modesGroup.add( debugViewState, 'view', {
|
|
145
145
|
'Shaded': 'none',
|
|
146
|
+
'Wireframe': 'wireframe',
|
|
146
147
|
'Draw Call': 'drawCall',
|
|
147
148
|
'Shader Complexity': 'shaderComplexity',
|
|
148
149
|
'Lighting Complexity': 'lightingComplexity',
|
|
@@ -164,7 +165,7 @@ class Settings extends Parameters {
|
|
|
164
165
|
this._syncBufferRow( view );
|
|
165
166
|
window.dispatchEvent( new Event( 'genesys-debug-view' ) );
|
|
166
167
|
|
|
167
|
-
} ).info( 'Shaded color, a cost heatmap, per-pixel overdraw, shader cost times overdraw, one material channel, lighting on a flat gray surface, one lit color per draw, a tint for the front and back of each face, green and gray for objects that do and do not cast shadows, or red where a double-sided back face is hidden. The Overdraw toggle above draws on top when both are enabled.' );
|
|
168
|
+
} ).info( 'Shaded color, mesh edges with the same lighting, a cost heatmap, per-pixel overdraw, shader cost times overdraw, one material channel, lighting on a flat gray surface, one lit color per draw, a tint for the front and back of each face, green and gray for objects that do and do not cast shadows, or red where a double-sided back face is hidden. The Overdraw toggle above draws on top when both are enabled.' );
|
|
168
169
|
|
|
169
170
|
this._bufferControl = modesGroup.add( bufferState, 'buffer', {
|
|
170
171
|
'Base Color': 'baseColor',
|
|
@@ -195,7 +196,7 @@ class Settings extends Parameters {
|
|
|
195
196
|
const renderer = this.inspector.getRenderer();
|
|
196
197
|
const view = renderer !== null && renderer.debug !== undefined ? renderer.debug.view : null;
|
|
197
198
|
|
|
198
|
-
if ( view === 'none' || view === 'shaderComplexity' || view === 'lightingComplexity' || view === 'overdraw' || view === 'shaderComplexityAndOverdraw' || view === 'bufferVisualization' || view === 'lightingOnly' || view === 'detailLighting' || view === 'drawCall' || view === 'frontBackFace' || view === 'shadowCaster' || view === 'doubleSide' ) {
|
|
199
|
+
if ( view === 'none' || view === 'wireframe' || view === 'shaderComplexity' || view === 'lightingComplexity' || view === 'overdraw' || view === 'shaderComplexityAndOverdraw' || view === 'bufferVisualization' || view === 'lightingOnly' || view === 'detailLighting' || view === 'drawCall' || view === 'frontBackFace' || view === 'shadowCaster' || view === 'doubleSide' ) {
|
|
199
200
|
|
|
200
201
|
if ( this._debugViewState.view !== view ) {
|
|
201
202
|
|
package/package.json
CHANGED
|
@@ -70,7 +70,8 @@ const refreshUniforms = [
|
|
|
70
70
|
'steps',
|
|
71
71
|
'thickness',
|
|
72
72
|
'transmission',
|
|
73
|
-
'transmissionMap'
|
|
73
|
+
'transmissionMap',
|
|
74
|
+
'wireframe'
|
|
74
75
|
];
|
|
75
76
|
|
|
76
77
|
|
|
@@ -265,14 +266,12 @@ class NodeMaterialObserver {
|
|
|
265
266
|
|
|
266
267
|
}
|
|
267
268
|
|
|
268
|
-
|
|
269
|
+
// global data
|
|
269
270
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
data.bufferWidth = width;
|
|
273
|
-
data.bufferHeight = height;
|
|
271
|
+
const { width, height } = renderObject.context;
|
|
274
272
|
|
|
275
|
-
|
|
273
|
+
data.bufferWidth = width;
|
|
274
|
+
data.bufferHeight = height;
|
|
276
275
|
|
|
277
276
|
const { environmentIntensity, environmentRotation } = renderObject.scene;
|
|
278
277
|
|
|
@@ -593,18 +592,14 @@ class NodeMaterialObserver {
|
|
|
593
592
|
|
|
594
593
|
}
|
|
595
594
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
const { width, height } = renderObject.context;
|
|
595
|
+
const { width, height } = renderObject.context;
|
|
599
596
|
|
|
600
|
-
|
|
597
|
+
if ( renderObjectData.bufferWidth !== width || renderObjectData.bufferHeight !== height ) {
|
|
601
598
|
|
|
602
|
-
|
|
603
|
-
|
|
599
|
+
renderObjectData.bufferWidth = width;
|
|
600
|
+
renderObjectData.bufferHeight = height;
|
|
604
601
|
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
}
|
|
602
|
+
return false;
|
|
608
603
|
|
|
609
604
|
}
|
|
610
605
|
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// WITH_GENESYS
|
|
2
|
+
// Wireframe debug view. Scene meshes are drawn as lines. Lighting is unchanged.
|
|
3
|
+
// !WITH_GENESYS
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Wireframe. Each scene mesh is drawn as lines along its triangle edges.
|
|
7
|
+
* Lighting, color, and tone mapping stay the same as the shaded view.
|
|
8
|
+
* Shadow passes and fullscreen quads stay triangles.
|
|
9
|
+
*
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
export const DEBUG_VIEW_WIREFRAME = 'wireframe';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Whether the wireframe debug view should take over this draw.
|
|
16
|
+
* Shadow passes stay triangles so shadows still cover the surface. Fullscreen quads stay
|
|
17
|
+
* triangles so post-processing still fills the screen. A material with `allowOverride`
|
|
18
|
+
* false (the renderer skybox) stays shaded behind the edges.
|
|
19
|
+
*
|
|
20
|
+
* @param {Material} material - The material being drawn.
|
|
21
|
+
* @param {?Renderer} renderer - The renderer. May be null.
|
|
22
|
+
* @param {?Object3D} [object=null] - The object being drawn.
|
|
23
|
+
* @return {boolean} `true` when the debug view forces a wireframe.
|
|
24
|
+
*/
|
|
25
|
+
export function debugViewForcesWireframe( material, renderer, object = null ) {
|
|
26
|
+
|
|
27
|
+
const debug = renderer !== null && renderer !== undefined ? renderer.debug : undefined;
|
|
28
|
+
|
|
29
|
+
if ( debug === undefined || debug.view !== DEBUG_VIEW_WIREFRAME ) return false;
|
|
30
|
+
|
|
31
|
+
if ( material.isShadowPassMaterial === true ) return false;
|
|
32
|
+
|
|
33
|
+
if ( material.allowOverride === false ) return false;
|
|
34
|
+
|
|
35
|
+
// Lines and points already draw as lines. Rewriting their index as triangle edges
|
|
36
|
+
// would skip vertices. Quad meshes are fullscreen passes.
|
|
37
|
+
if ( object === null || object === undefined || object.isMesh !== true || object.isQuadMesh === true ) return false;
|
|
38
|
+
|
|
39
|
+
return true;
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Whether this draw should use line topology.
|
|
45
|
+
* A material that already sets `wireframe` stays a wireframe in every view.
|
|
46
|
+
* The wireframe debug view forces it for scene meshes. A renderer without `debug`
|
|
47
|
+
* (the legacy WebGL renderer) only honors the material flag.
|
|
48
|
+
*
|
|
49
|
+
* @param {Material} material - The material being drawn.
|
|
50
|
+
* @param {?Renderer} renderer - The renderer. May be null.
|
|
51
|
+
* @param {?Object3D} [object=null] - The object being drawn.
|
|
52
|
+
* @return {boolean} `true` when the draw is lines.
|
|
53
|
+
*/
|
|
54
|
+
export function materialDrawsWireframe( material, renderer, object = null ) {
|
|
55
|
+
|
|
56
|
+
if ( material.wireframe === true ) return true;
|
|
57
|
+
|
|
58
|
+
return debugViewForcesWireframe( material, renderer, object );
|
|
59
|
+
|
|
60
|
+
}
|
|
@@ -1540,7 +1540,15 @@ class BatchedMesh extends Mesh {
|
|
|
1540
1540
|
// the vertices to draw (3 lines per triangle) so we multiply the draw counts / starts and make
|
|
1541
1541
|
// assumptions about the index buffer byte size.
|
|
1542
1542
|
let multiDrawMultiplier = 1;
|
|
1543
|
-
|
|
1543
|
+
// WITH_GENESYS
|
|
1544
|
+
// Same rule as materialDrawsWireframe, inlined so this core class does not import the node library.
|
|
1545
|
+
// A legacy renderer has no debug view, so only the material flag applies there.
|
|
1546
|
+
const debugView = renderer !== null && renderer !== undefined && renderer.debug !== undefined ? renderer.debug.view : undefined;
|
|
1547
|
+
const wireframe = material.wireframe === true || ( debugView === 'wireframe' && material.isShadowPassMaterial !== true && material.allowOverride !== false );
|
|
1548
|
+
// !WITH_GENESYS
|
|
1549
|
+
// const wireframe = material.wireframe === true;
|
|
1550
|
+
|
|
1551
|
+
if ( wireframe ) {
|
|
1544
1552
|
|
|
1545
1553
|
multiDrawMultiplier = 2;
|
|
1546
1554
|
bytesPerElement = geometry.attributes.position.count > 65535 ? 4 : 2;
|
|
@@ -2,6 +2,9 @@ import DataMap from './DataMap.js';
|
|
|
2
2
|
import { AttributeType } from './Constants.js';
|
|
3
3
|
|
|
4
4
|
import { Uint16BufferAttribute, Uint32BufferAttribute } from '../../core/BufferAttribute.js';
|
|
5
|
+
// WITH_GENESYS
|
|
6
|
+
import { materialDrawsWireframe } from '../../nodes/display/WireframeDebug.js';
|
|
7
|
+
// !WITH_GENESYS
|
|
5
8
|
|
|
6
9
|
/**
|
|
7
10
|
* Returns the wireframe version for the given geometry.
|
|
@@ -234,6 +237,8 @@ class Geometries extends DataMap {
|
|
|
234
237
|
|
|
235
238
|
this._geometryDisposeListeners.delete( geometry );
|
|
236
239
|
|
|
240
|
+
this.delete( geometry );
|
|
241
|
+
|
|
237
242
|
};
|
|
238
243
|
|
|
239
244
|
geometry.addEventListener( 'dispose', onDispose );
|
|
@@ -370,7 +375,12 @@ class Geometries extends DataMap {
|
|
|
370
375
|
|
|
371
376
|
let index = geometry.index;
|
|
372
377
|
|
|
373
|
-
|
|
378
|
+
// WITH_GENESYS
|
|
379
|
+
const wireframe = materialDrawsWireframe( material, renderObject.renderer, renderObject.object );
|
|
380
|
+
// !WITH_GENESYS
|
|
381
|
+
// const wireframe = material.wireframe === true;
|
|
382
|
+
|
|
383
|
+
if ( wireframe === true ) {
|
|
374
384
|
|
|
375
385
|
const wireframes = this.wireframes;
|
|
376
386
|
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { hash, hashString } from '../../nodes/core/NodeUtils.js';
|
|
2
|
+
// WITH_GENESYS
|
|
3
|
+
import { materialDrawsWireframe } from '../../nodes/display/WireframeDebug.js';
|
|
4
|
+
// !WITH_GENESYS
|
|
2
5
|
|
|
3
6
|
let _id = 0;
|
|
4
7
|
const _protoKeysCache = new WeakMap();
|
|
@@ -634,7 +637,12 @@ class RenderObject {
|
|
|
634
637
|
|
|
635
638
|
let rangeFactor = 1;
|
|
636
639
|
|
|
637
|
-
|
|
640
|
+
// WITH_GENESYS
|
|
641
|
+
const wireframe = materialDrawsWireframe( material, this.renderer, object );
|
|
642
|
+
// !WITH_GENESYS
|
|
643
|
+
// const wireframe = material.wireframe === true;
|
|
644
|
+
|
|
645
|
+
if ( wireframe === true && ! object.isPoints && ! object.isLineSegments && ! object.isLine && ! object.isLineLoop ) {
|
|
638
646
|
|
|
639
647
|
rangeFactor = 2;
|
|
640
648
|
|
|
@@ -746,7 +746,7 @@ class Renderer {
|
|
|
746
746
|
* @property {?Function} onNodeBuilderCreated - A callback function that is executed after a node builder has been created and before it is built.
|
|
747
747
|
* @property {?Function} onShaderError - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now.
|
|
748
748
|
* @property {Function} getShaderAsync - Allows the get the raw shader code for the given scene, camera and 3D object.
|
|
749
|
-
* @property {string} view - Debug view. `shaderComplexity`, `lightingComplexity`, `overdraw`, and `shaderComplexityAndOverdraw` replace the shaded color with a heatmap. `shaderComplexityAndOverdraw` multiplies the shader cost by the overdraw count. `bufferVisualization` shows one material channel. `lightingOnly` and `detailLighting` light a flat gray surface. `drawCall` lights each submitted draw with its own diffuse color. `frontBackFace` draws both windings and tints the side facing the camera. `shadowCaster` lights a mesh green when it casts shadows and gray when it does not. `doubleSide` lights a single-sided surface gray, a visible double-sided back face blue, and a hidden double-sided back face red.
|
|
749
|
+
* @property {string} view - Debug view. `shaderComplexity`, `lightingComplexity`, `overdraw`, and `shaderComplexityAndOverdraw` replace the shaded color with a heatmap. `shaderComplexityAndOverdraw` multiplies the shader cost by the overdraw count. `bufferVisualization` shows one material channel. `lightingOnly` and `detailLighting` light a flat gray surface. `drawCall` lights each submitted draw with its own diffuse color. `frontBackFace` draws both windings and tints the side facing the camera. `shadowCaster` lights a mesh green when it casts shadows and gray when it does not. `doubleSide` lights a single-sided surface gray, a visible double-sided back face blue, and a hidden double-sided back face red. `wireframe` draws each mesh as lines along its triangle edges. Lighting stays the same as the shaded view. Shadow passes and fullscreen quads stay triangles.
|
|
750
750
|
* @property {string} buffer - Channel drawn by `bufferVisualization`: `baseColor`, `worldNormal`, `roughness`, `metallic`, `ambientOcclusion`, or `emissive`.
|
|
751
751
|
* @property {number} shaderComplexityBudget - Proxy budget that fills the shader-complexity ramp.
|
|
752
752
|
* @property {number} quadOverdrawBudget - Overlapping fragments that fill the quad-overdraw ramp.
|
|
@@ -12,6 +12,9 @@ import { GLFeatureName } from './utils/WebGLConstants.js';
|
|
|
12
12
|
import { WebGLBufferRenderer } from './WebGLBufferRenderer.js';
|
|
13
13
|
|
|
14
14
|
import { isTypedArray, warnOnce, warn, error } from '../../utils.js';
|
|
15
|
+
// WITH_GENESYS
|
|
16
|
+
import { materialDrawsWireframe } from '../../nodes/display/WireframeDebug.js';
|
|
17
|
+
// !WITH_GENESYS
|
|
15
18
|
import { WebGLCoordinateSystem, TimestampQuery, Compatibility } from '../../constants.js';
|
|
16
19
|
import WebGLTimestampQueryPool from './utils/WebGLTimestampQueryPool.js';
|
|
17
20
|
|
|
@@ -1207,9 +1210,16 @@ class WebGLBackend extends Backend {
|
|
|
1207
1210
|
else if ( object.isLineLoop ) renderer.mode = gl.LINE_LOOP;
|
|
1208
1211
|
else {
|
|
1209
1212
|
|
|
1210
|
-
|
|
1213
|
+
// WITH_GENESYS
|
|
1214
|
+
const wireframe = materialDrawsWireframe( material, this.renderer, object );
|
|
1215
|
+
const linewidth = material.wireframeLinewidth !== undefined ? material.wireframeLinewidth : 1;
|
|
1216
|
+
// !WITH_GENESYS
|
|
1217
|
+
// const wireframe = material.wireframe === true;
|
|
1218
|
+
// const linewidth = material.wireframeLinewidth;
|
|
1219
|
+
|
|
1220
|
+
if ( wireframe === true ) {
|
|
1211
1221
|
|
|
1212
|
-
state.setLineWidth(
|
|
1222
|
+
state.setLineWidth( linewidth * this.renderer.getPixelRatio() );
|
|
1213
1223
|
renderer.mode = gl.LINES;
|
|
1214
1224
|
|
|
1215
1225
|
} else {
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { HalfFloatType, UnsignedByteType } from '../../../constants.js';
|
|
2
2
|
import { GPUPrimitiveTopology, GPUTextureFormat } from './WebGPUConstants.js';
|
|
3
|
+
// WITH_GENESYS
|
|
4
|
+
import { materialDrawsWireframe } from '../../../nodes/display/WireframeDebug.js';
|
|
5
|
+
// !WITH_GENESYS
|
|
3
6
|
|
|
4
7
|
const _commandList = [ null ];
|
|
5
8
|
|
|
@@ -215,7 +218,10 @@ class WebGPUUtils {
|
|
|
215
218
|
getPrimitiveTopology( object, material ) {
|
|
216
219
|
|
|
217
220
|
if ( object.isPoints ) return GPUPrimitiveTopology.PointList;
|
|
218
|
-
|
|
221
|
+
// WITH_GENESYS
|
|
222
|
+
else if ( object.isLineSegments || ( object.isMesh && materialDrawsWireframe( material, this.backend.renderer, object ) ) ) return GPUPrimitiveTopology.LineList;
|
|
223
|
+
// !WITH_GENESYS
|
|
224
|
+
// else if ( object.isLineSegments || ( object.isMesh && material.wireframe === true ) ) return GPUPrimitiveTopology.LineList;
|
|
219
225
|
else if ( object.isLine ) return GPUPrimitiveTopology.LineStrip;
|
|
220
226
|
else if ( object.isMesh ) return GPUPrimitiveTopology.TriangleList;
|
|
221
227
|
|