@gnsx/three 0.184.14 → 0.184.16
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.cjs +169 -24
- package/build/three.core.js +2 -22
- package/build/three.core.min.js +1 -1
- package/build/three.module.js +170 -5
- package/build/three.module.min.js +1 -1
- package/build/three.webgpu.js +63 -14
- package/build/three.webgpu.min.js +1 -1
- package/build/three.webgpu.nodes.js +63 -14
- package/build/three.webgpu.nodes.min.js +1 -1
- package/package.json +1 -1
- package/src/nodes/lighting/PointShadowNode.js +21 -0
- package/src/nodes/lighting/ShadowNode.js +43 -14
- package/src/profiler/ProfilerService.js +2 -22
- package/src/renderers/WebGLRenderer.js +90 -1
- package/src/renderers/webgl/WebGLShadowMap.js +79 -1
|
@@ -45190,29 +45190,33 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
45190
45190
|
*/
|
|
45191
45191
|
renderShadow( frame ) {
|
|
45192
45192
|
|
|
45193
|
-
// WITH_GENESYS
|
|
45194
|
-
ProfilerService.begin( 'ShadowNode.renderShadow' );
|
|
45195
|
-
// !WITH_GENESYS
|
|
45196
|
-
|
|
45197
45193
|
const { shadow, shadowMap, light } = this;
|
|
45198
45194
|
const { renderer, scene } = frame;
|
|
45199
45195
|
|
|
45196
|
+
// WITH_GENESYS
|
|
45197
|
+
ProfilerService.begin( 'shadowMap.render.updateMatrices' );
|
|
45198
|
+
// !WITH_GENESYS
|
|
45200
45199
|
shadow.updateMatrices( light );
|
|
45201
45200
|
|
|
45202
45201
|
shadowMap.setSize( shadow.mapSize.width, shadow.mapSize.height, shadowMap.depth );
|
|
45202
|
+
// WITH_GENESYS
|
|
45203
|
+
ProfilerService.end( 'shadowMap.render.updateMatrices' );
|
|
45204
|
+
// !WITH_GENESYS
|
|
45203
45205
|
|
|
45204
45206
|
const currentSceneName = scene.name;
|
|
45205
45207
|
|
|
45206
45208
|
scene.name = `Shadow Map [ ${ light.name || 'ID: ' + light.id } ]`;
|
|
45207
45209
|
|
|
45210
|
+
// WITH_GENESYS
|
|
45211
|
+
ProfilerService.begin( 'shadowMap.render.depthPass' );
|
|
45212
|
+
// !WITH_GENESYS
|
|
45208
45213
|
renderer.render( scene, shadow.camera );
|
|
45209
|
-
|
|
45210
|
-
scene.name = currentSceneName;
|
|
45211
|
-
|
|
45212
45214
|
// WITH_GENESYS
|
|
45213
|
-
ProfilerService.end( '
|
|
45215
|
+
ProfilerService.end( 'shadowMap.render.depthPass' );
|
|
45214
45216
|
// !WITH_GENESYS
|
|
45215
45217
|
|
|
45218
|
+
scene.name = currentSceneName;
|
|
45219
|
+
|
|
45216
45220
|
}
|
|
45217
45221
|
|
|
45218
45222
|
/**
|
|
@@ -45225,6 +45229,11 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
45225
45229
|
const { shadowMap, light, shadow } = this;
|
|
45226
45230
|
const { renderer, scene, camera } = frame;
|
|
45227
45231
|
|
|
45232
|
+
// WITH_GENESYS
|
|
45233
|
+
const lightLabel = `shadowMap.render.light (${light.name || light.type})`;
|
|
45234
|
+
ProfilerService.begin( lightLabel );
|
|
45235
|
+
// !WITH_GENESYS
|
|
45236
|
+
|
|
45228
45237
|
const shadowType = renderer.shadowMap.type;
|
|
45229
45238
|
|
|
45230
45239
|
const depthVersion = shadowMap.depthTexture.version;
|
|
@@ -45243,6 +45252,9 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
45243
45252
|
const currentMRT = renderer.getMRT();
|
|
45244
45253
|
const useVelocity = currentMRT ? currentMRT.has( 'velocity' ) : false;
|
|
45245
45254
|
|
|
45255
|
+
// WITH_GENESYS
|
|
45256
|
+
ProfilerService.begin( 'shadowMap.render.setupPass' );
|
|
45257
|
+
// !WITH_GENESYS
|
|
45246
45258
|
_rendererState = resetRendererAndSceneState( renderer, scene, _rendererState );
|
|
45247
45259
|
|
|
45248
45260
|
scene.overrideMaterial = getShadowMaterial( light );
|
|
@@ -45252,6 +45264,9 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
45252
45264
|
renderer.setClearColor( 0x000000, 0 );
|
|
45253
45265
|
|
|
45254
45266
|
renderer.setRenderTarget( shadowMap );
|
|
45267
|
+
// WITH_GENESYS
|
|
45268
|
+
ProfilerService.end( 'shadowMap.render.setupPass' );
|
|
45269
|
+
// !WITH_GENESYS
|
|
45255
45270
|
|
|
45256
45271
|
this.renderShadow( frame );
|
|
45257
45272
|
|
|
@@ -45261,7 +45276,13 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
45261
45276
|
|
|
45262
45277
|
if ( shadowType === VSMShadowMap && shadow.isPointLightShadow !== true ) {
|
|
45263
45278
|
|
|
45279
|
+
// WITH_GENESYS
|
|
45280
|
+
ProfilerService.begin( 'shadowMap.render.vsmPass' );
|
|
45281
|
+
// !WITH_GENESYS
|
|
45264
45282
|
this.vsmPass( renderer );
|
|
45283
|
+
// WITH_GENESYS
|
|
45284
|
+
ProfilerService.end( 'shadowMap.render.vsmPass' );
|
|
45285
|
+
// !WITH_GENESYS
|
|
45265
45286
|
|
|
45266
45287
|
}
|
|
45267
45288
|
|
|
@@ -45269,6 +45290,10 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
45269
45290
|
|
|
45270
45291
|
restoreRendererAndSceneState( renderer, scene, _rendererState );
|
|
45271
45292
|
|
|
45293
|
+
// WITH_GENESYS
|
|
45294
|
+
ProfilerService.end( lightLabel );
|
|
45295
|
+
// !WITH_GENESYS
|
|
45296
|
+
|
|
45272
45297
|
}
|
|
45273
45298
|
|
|
45274
45299
|
/**
|
|
@@ -45278,26 +45303,30 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
45278
45303
|
*/
|
|
45279
45304
|
vsmPass( renderer ) {
|
|
45280
45305
|
|
|
45281
|
-
// WITH_GENESYS
|
|
45282
|
-
ProfilerService.begin( 'ShadowNode.vsmPass' );
|
|
45283
|
-
// !WITH_GENESYS
|
|
45284
|
-
|
|
45285
45306
|
const { shadow } = this;
|
|
45286
45307
|
|
|
45287
45308
|
const depth = this.shadowMap.depth;
|
|
45288
45309
|
this.vsmShadowMapVertical.setSize( shadow.mapSize.width, shadow.mapSize.height, depth );
|
|
45289
45310
|
this.vsmShadowMapHorizontal.setSize( shadow.mapSize.width, shadow.mapSize.height, depth );
|
|
45290
45311
|
|
|
45312
|
+
// WITH_GENESYS
|
|
45313
|
+
ProfilerService.begin( 'shadowMap.vsmPass.vertical' );
|
|
45314
|
+
// !WITH_GENESYS
|
|
45291
45315
|
renderer.setRenderTarget( this.vsmShadowMapVertical );
|
|
45292
45316
|
_quadMesh.material = this.vsmMaterialVertical;
|
|
45293
45317
|
_quadMesh.render( renderer );
|
|
45318
|
+
// WITH_GENESYS
|
|
45319
|
+
ProfilerService.end( 'shadowMap.vsmPass.vertical' );
|
|
45320
|
+
// !WITH_GENESYS
|
|
45294
45321
|
|
|
45322
|
+
// WITH_GENESYS
|
|
45323
|
+
ProfilerService.begin( 'shadowMap.vsmPass.horizontal' );
|
|
45324
|
+
// !WITH_GENESYS
|
|
45295
45325
|
renderer.setRenderTarget( this.vsmShadowMapHorizontal );
|
|
45296
45326
|
_quadMesh.material = this.vsmMaterialHorizontal;
|
|
45297
45327
|
_quadMesh.render( renderer );
|
|
45298
|
-
|
|
45299
45328
|
// WITH_GENESYS
|
|
45300
|
-
ProfilerService.end( '
|
|
45329
|
+
ProfilerService.end( 'shadowMap.vsmPass.horizontal' );
|
|
45301
45330
|
// !WITH_GENESYS
|
|
45302
45331
|
|
|
45303
45332
|
}
|
|
@@ -45416,6 +45445,8 @@ class ShadowNode extends ShadowBaseNode {
|
|
|
45416
45445
|
*/
|
|
45417
45446
|
const shadow = ( light, shadow ) => new ShadowNode( light, shadow );
|
|
45418
45447
|
|
|
45448
|
+
// !WITH_GENESYS
|
|
45449
|
+
|
|
45419
45450
|
const _clearColor$1 = /*@__PURE__*/ new Color();
|
|
45420
45451
|
const _projScreenMatrix$1 = /*@__PURE__*/ new Matrix4();
|
|
45421
45452
|
const _lightPositionWorld = /*@__PURE__*/ new Vector3();
|
|
@@ -45663,12 +45694,20 @@ class PointShadowNode extends ShadowNode {
|
|
|
45663
45694
|
// Render each cube face
|
|
45664
45695
|
for ( let face = 0; face < 6; face ++ ) {
|
|
45665
45696
|
|
|
45697
|
+
// WITH_GENESYS
|
|
45698
|
+
const faceLabel = `shadowMap.render.depthPass (face ${face})`;
|
|
45699
|
+
// !WITH_GENESYS
|
|
45700
|
+
|
|
45666
45701
|
// Set render target to the specific cube face
|
|
45667
45702
|
renderer.setRenderTarget( shadowMap, face );
|
|
45668
45703
|
renderer.clear();
|
|
45669
45704
|
|
|
45670
45705
|
// Update shadow camera matrices for this face
|
|
45671
45706
|
|
|
45707
|
+
// WITH_GENESYS
|
|
45708
|
+
ProfilerService.begin( 'shadowMap.render.updateMatrices' );
|
|
45709
|
+
// !WITH_GENESYS
|
|
45710
|
+
|
|
45672
45711
|
const far = light.distance || camera.far;
|
|
45673
45712
|
|
|
45674
45713
|
if ( far !== camera.far ) {
|
|
@@ -45692,13 +45731,23 @@ class PointShadowNode extends ShadowNode {
|
|
|
45692
45731
|
_projScreenMatrix$1.multiplyMatrices( camera.projectionMatrix, camera.matrixWorldInverse );
|
|
45693
45732
|
shadow._frustum.setFromProjectionMatrix( _projScreenMatrix$1, camera.coordinateSystem, camera.reversedDepth );
|
|
45694
45733
|
|
|
45734
|
+
// WITH_GENESYS
|
|
45735
|
+
ProfilerService.end( 'shadowMap.render.updateMatrices' );
|
|
45736
|
+
// !WITH_GENESYS
|
|
45737
|
+
|
|
45695
45738
|
//
|
|
45696
45739
|
|
|
45697
45740
|
const currentSceneName = scene.name;
|
|
45698
45741
|
|
|
45699
45742
|
scene.name = `Point Light Shadow [ ${ light.name || 'ID: ' + light.id } ] - Face ${ face + 1 }`;
|
|
45700
45743
|
|
|
45744
|
+
// WITH_GENESYS
|
|
45745
|
+
ProfilerService.begin( faceLabel );
|
|
45746
|
+
// !WITH_GENESYS
|
|
45701
45747
|
renderer.render( scene, camera );
|
|
45748
|
+
// WITH_GENESYS
|
|
45749
|
+
ProfilerService.end( faceLabel );
|
|
45750
|
+
// !WITH_GENESYS
|
|
45702
45751
|
|
|
45703
45752
|
scene.name = currentSceneName;
|
|
45704
45753
|
|