@gnsx/three 0.184.15 → 0.184.17

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 CHANGED
@@ -69243,6 +69243,8 @@ const vertex = "void main() {\n\tgl_Position = vec4( position, 1.0 );\n}";
69243
69243
 
69244
69244
  const fragment = "uniform sampler2D shadow_pass;\nuniform vec2 resolution;\nuniform float radius;\nvoid main() {\n\tconst float samples = float( VSM_SAMPLES );\n\tfloat mean = 0.0;\n\tfloat squared_mean = 0.0;\n\tfloat uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );\n\tfloat uvStart = samples <= 1.0 ? 0.0 : - 1.0;\n\tfor ( float i = 0.0; i < samples; i ++ ) {\n\t\tfloat uvOffset = uvStart + i * uvStride;\n\t\t#ifdef HORIZONTAL_PASS\n\t\t\tvec2 distribution = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ).rg;\n\t\t\tmean += distribution.x;\n\t\t\tsquared_mean += distribution.y * distribution.y + distribution.x * distribution.x;\n\t\t#else\n\t\t\tfloat depth = texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ).r;\n\t\t\tmean += depth;\n\t\t\tsquared_mean += depth * depth;\n\t\t#endif\n\t}\n\tmean = mean / samples;\n\tsquared_mean = squared_mean / samples;\n\tfloat std_dev = sqrt( max( 0.0, squared_mean - mean * mean ) );\n\tgl_FragColor = vec4( mean, std_dev, 0.0, 1.0 );\n}";
69245
69245
 
69246
+ // !WITH_GENESYS
69247
+
69246
69248
  const _cubeDirections = [
69247
69249
  /*@__PURE__*/ new Vector3( 1, 0, 0 ), /*@__PURE__*/ new Vector3( -1, 0, 0 ), /*@__PURE__*/ new Vector3( 0, 1, 0 ),
69248
69250
  /*@__PURE__*/ new Vector3( 0, -1, 0 ), /*@__PURE__*/ new Vector3( 0, 0, 1 ), /*@__PURE__*/ new Vector3( 0, 0, -1 )
@@ -69358,6 +69360,10 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
69358
69360
  // (sampler2DShadow for PCF vs sampler2D for Basic)
69359
69361
  if ( typeChanged ) {
69360
69362
 
69363
+ // WITH_GENESYS
69364
+ ProfilerService.begin( 'shadowMap.render.typeChangeMaterialUpdate' );
69365
+ // !WITH_GENESYS
69366
+
69361
69367
  scene.traverse( function ( object ) {
69362
69368
 
69363
69369
  if ( object.material ) {
@@ -69376,6 +69382,10 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
69376
69382
 
69377
69383
  } );
69378
69384
 
69385
+ // WITH_GENESYS
69386
+ ProfilerService.end( 'shadowMap.render.typeChangeMaterialUpdate' );
69387
+ // !WITH_GENESYS
69388
+
69379
69389
  }
69380
69390
 
69381
69391
  // render depth map
@@ -69385,14 +69395,29 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
69385
69395
  const light = lights[ i ];
69386
69396
  const shadow = light.shadow;
69387
69397
 
69398
+ // WITH_GENESYS
69399
+ const lightLabel = `shadowMap.render.light (${light.name || light.type})`;
69400
+ ProfilerService.begin( lightLabel );
69401
+ // !WITH_GENESYS
69402
+
69388
69403
  if ( shadow === undefined ) {
69389
69404
 
69390
69405
  warn( 'WebGLShadowMap:', light, 'has no shadow.' );
69406
+ // WITH_GENESYS
69407
+ ProfilerService.end( lightLabel );
69408
+ // !WITH_GENESYS
69391
69409
  continue;
69392
69410
 
69393
69411
  }
69394
69412
 
69395
- if ( shadow.autoUpdate === false && shadow.needsUpdate === false ) continue;
69413
+ if ( shadow.autoUpdate === false && shadow.needsUpdate === false ) {
69414
+
69415
+ // WITH_GENESYS
69416
+ ProfilerService.end( lightLabel );
69417
+ // !WITH_GENESYS
69418
+ continue;
69419
+
69420
+ }
69396
69421
 
69397
69422
  _shadowMapSize.copy( shadow.mapSize );
69398
69423
 
@@ -69427,6 +69452,10 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
69427
69452
 
69428
69453
  if ( shadow.map === null || typeChanged === true ) {
69429
69454
 
69455
+ // WITH_GENESYS
69456
+ ProfilerService.begin( 'shadowMap.render.setupMap' );
69457
+ // !WITH_GENESYS
69458
+
69430
69459
  if ( shadow.map !== null ) {
69431
69460
 
69432
69461
  if ( shadow.map.depthTexture !== null ) {
@@ -69445,6 +69474,10 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
69445
69474
  if ( light.isPointLight ) {
69446
69475
 
69447
69476
  warn( 'WebGLShadowMap: VSM shadow maps are not supported for PointLights. Use PCF or BasicShadowMap instead.' );
69477
+ // WITH_GENESYS
69478
+ ProfilerService.end( 'shadowMap.render.setupMap' );
69479
+ ProfilerService.end( lightLabel );
69480
+ // !WITH_GENESYS
69448
69481
  continue;
69449
69482
 
69450
69483
  }
@@ -69501,6 +69534,10 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
69501
69534
 
69502
69535
  shadow.camera.updateProjectionMatrix();
69503
69536
 
69537
+ // WITH_GENESYS
69538
+ ProfilerService.end( 'shadowMap.render.setupMap' );
69539
+ // !WITH_GENESYS
69540
+
69504
69541
  }
69505
69542
 
69506
69543
  // For cube render targets (PointLights), render all 6 faces. Otherwise, render once.
@@ -69508,6 +69545,10 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
69508
69545
 
69509
69546
  for ( let face = 0; face < faceCount; face ++ ) {
69510
69547
 
69548
+ // WITH_GENESYS
69549
+ const faceLabel = faceCount > 1 ? `shadowMap.render.depthPass (face ${face})` : 'shadowMap.render.depthPass';
69550
+ // !WITH_GENESYS
69551
+
69511
69552
  // For cube render targets, render to each face separately
69512
69553
  if ( shadow.map.isWebGLCubeRenderTarget ) {
69513
69554
 
@@ -69537,6 +69578,10 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
69537
69578
 
69538
69579
  }
69539
69580
 
69581
+ // WITH_GENESYS
69582
+ ProfilerService.begin( 'shadowMap.render.updateMatrices' );
69583
+ // !WITH_GENESYS
69584
+
69540
69585
  if ( light.isPointLight ) {
69541
69586
 
69542
69587
  const camera = shadow.camera;
@@ -69571,9 +69616,19 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
69571
69616
 
69572
69617
  }
69573
69618
 
69619
+ // WITH_GENESYS
69620
+ ProfilerService.end( 'shadowMap.render.updateMatrices' );
69621
+ // !WITH_GENESYS
69622
+
69574
69623
  _frustum = shadow.getFrustum();
69575
69624
 
69625
+ // WITH_GENESYS
69626
+ ProfilerService.begin( faceLabel );
69627
+ // !WITH_GENESYS
69576
69628
  renderObject( scene, camera, shadow.camera, light, this.type );
69629
+ // WITH_GENESYS
69630
+ ProfilerService.end( faceLabel );
69631
+ // !WITH_GENESYS
69577
69632
 
69578
69633
  }
69579
69634
 
@@ -69581,12 +69636,22 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
69581
69636
 
69582
69637
  if ( shadow.isPointLightShadow !== true && this.type === VSMShadowMap ) {
69583
69638
 
69639
+ // WITH_GENESYS
69640
+ ProfilerService.begin( 'shadowMap.render.vsmPass' );
69641
+ // !WITH_GENESYS
69584
69642
  VSMPass( shadow, camera );
69643
+ // WITH_GENESYS
69644
+ ProfilerService.end( 'shadowMap.render.vsmPass' );
69645
+ // !WITH_GENESYS
69585
69646
 
69586
69647
  }
69587
69648
 
69588
69649
  shadow.needsUpdate = false;
69589
69650
 
69651
+ // WITH_GENESYS
69652
+ ProfilerService.end( lightLabel );
69653
+ // !WITH_GENESYS
69654
+
69590
69655
  }
69591
69656
 
69592
69657
  _previousType = this.type;
@@ -69622,21 +69687,33 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
69622
69687
 
69623
69688
  // vertical pass - read from native depth texture
69624
69689
 
69690
+ // WITH_GENESYS
69691
+ ProfilerService.begin( 'shadowMap.vsmPass.vertical' );
69692
+ // !WITH_GENESYS
69625
69693
  shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.depthTexture;
69626
69694
  shadowMaterialVertical.uniforms.resolution.value = shadow.mapSize;
69627
69695
  shadowMaterialVertical.uniforms.radius.value = shadow.radius;
69628
69696
  renderer.setRenderTarget( shadow.mapPass );
69629
69697
  renderer.clear();
69630
69698
  renderer.renderBufferDirect( camera, null, geometry, shadowMaterialVertical, fullScreenMesh, null );
69699
+ // WITH_GENESYS
69700
+ ProfilerService.end( 'shadowMap.vsmPass.vertical' );
69701
+ // !WITH_GENESYS
69631
69702
 
69632
69703
  // horizontal pass
69633
69704
 
69705
+ // WITH_GENESYS
69706
+ ProfilerService.begin( 'shadowMap.vsmPass.horizontal' );
69707
+ // !WITH_GENESYS
69634
69708
  shadowMaterialHorizontal.uniforms.shadow_pass.value = shadow.mapPass.texture;
69635
69709
  shadowMaterialHorizontal.uniforms.resolution.value = shadow.mapSize;
69636
69710
  shadowMaterialHorizontal.uniforms.radius.value = shadow.radius;
69637
69711
  renderer.setRenderTarget( shadow.map );
69638
69712
  renderer.clear();
69639
69713
  renderer.renderBufferDirect( camera, null, geometry, shadowMaterialHorizontal, fullScreenMesh, null );
69714
+ // WITH_GENESYS
69715
+ ProfilerService.end( 'shadowMap.vsmPass.horizontal' );
69716
+ // !WITH_GENESYS
69640
69717
 
69641
69718
  }
69642
69719
 
@@ -76184,6 +76261,8 @@ function getDFGLUT() {
76184
76261
 
76185
76262
  }
76186
76263
 
76264
+ // !WITH_GENESYS
76265
+
76187
76266
  /**
76188
76267
  * This renderer uses WebGL 2 to display scenes.
76189
76268
  *
@@ -77729,14 +77808,28 @@ class WebGLRenderer {
77729
77808
  */
77730
77809
  this.render = function ( scene, camera ) {
77731
77810
 
77811
+ // WITH_GENESYS
77812
+ ProfilerService.begin( 'WebGLRenderer.render' );
77813
+ // !WITH_GENESYS
77814
+
77732
77815
  if ( camera !== undefined && camera.isCamera !== true ) {
77733
77816
 
77734
77817
  error( 'WebGLRenderer.render: camera is not an instance of THREE.Camera.' );
77818
+ // WITH_GENESYS
77819
+ ProfilerService.end( 'WebGLRenderer.render' );
77820
+ // !WITH_GENESYS
77735
77821
  return;
77736
77822
 
77737
77823
  }
77738
77824
 
77739
- if ( _isContextLost === true ) return;
77825
+ if ( _isContextLost === true ) {
77826
+
77827
+ // WITH_GENESYS
77828
+ ProfilerService.end( 'WebGLRenderer.render' );
77829
+ // !WITH_GENESYS
77830
+ return;
77831
+
77832
+ }
77740
77833
 
77741
77834
  // update node builder if available
77742
77835
  if ( _nodesHandler !== null ) {
@@ -77753,7 +77846,13 @@ class WebGLRenderer {
77753
77846
 
77754
77847
  // update scene graph
77755
77848
 
77849
+ // WITH_GENESYS
77850
+ ProfilerService.begin( 'scene.updateMatrixWorld' );
77851
+ // !WITH_GENESYS
77756
77852
  if ( scene.matrixWorldAutoUpdate === true ) scene.updateMatrixWorld();
77853
+ // WITH_GENESYS
77854
+ ProfilerService.end( 'scene.updateMatrixWorld' );
77855
+ // !WITH_GENESYS
77757
77856
 
77758
77857
  // update camera matrices and frustum
77759
77858
 
@@ -77787,6 +77886,10 @@ class WebGLRenderer {
77787
77886
 
77788
77887
  renderListStack.push( currentRenderList );
77789
77888
 
77889
+ // WITH_GENESYS
77890
+ ProfilerService.begin( 'buildRenderList' );
77891
+ // !WITH_GENESYS
77892
+
77790
77893
  if ( xr.enabled === true && xr.isPresenting === true ) {
77791
77894
 
77792
77895
  const depthSensingMesh = _this.xr.getDepthSensingMesh();
@@ -77799,16 +77902,34 @@ class WebGLRenderer {
77799
77902
 
77800
77903
  }
77801
77904
 
77905
+ // WITH_GENESYS
77906
+ ProfilerService.begin( 'projectObject' );
77907
+ // !WITH_GENESYS
77908
+
77802
77909
  projectObject( scene, camera, 0, _this.sortObjects );
77803
77910
 
77911
+ // WITH_GENESYS
77912
+ ProfilerService.end( 'projectObject' );
77913
+ // !WITH_GENESYS
77914
+
77804
77915
  currentRenderList.finish();
77805
77916
 
77806
77917
  if ( _this.sortObjects === true ) {
77807
77918
 
77919
+ // WITH_GENESYS
77920
+ ProfilerService.begin( 'sortRenderList' );
77921
+ // !WITH_GENESYS
77808
77922
  currentRenderList.sort( _opaqueSort, _transparentSort );
77923
+ // WITH_GENESYS
77924
+ ProfilerService.end( 'sortRenderList' );
77925
+ // !WITH_GENESYS
77809
77926
 
77810
77927
  }
77811
77928
 
77929
+ // WITH_GENESYS
77930
+ ProfilerService.end( 'buildRenderList' );
77931
+ // !WITH_GENESYS
77932
+
77812
77933
  _renderBackground = xr.enabled === false || xr.isPresenting === false || xr.hasDepthSensing() === false;
77813
77934
  if ( _renderBackground ) {
77814
77935
 
@@ -77824,7 +77945,13 @@ class WebGLRenderer {
77824
77945
 
77825
77946
  const shadowsArray = currentRenderState.state.shadowsArray;
77826
77947
 
77948
+ // WITH_GENESYS
77949
+ ProfilerService.begin( 'shadowMap.render' );
77950
+ // !WITH_GENESYS
77827
77951
  shadowMap.render( shadowsArray, scene, camera );
77952
+ // WITH_GENESYS
77953
+ ProfilerService.end( 'shadowMap.render' );
77954
+ // !WITH_GENESYS
77828
77955
 
77829
77956
  if ( _clippingEnabled === true ) clipping.endShadows();
77830
77957
 
@@ -77838,6 +77965,10 @@ class WebGLRenderer {
77838
77965
 
77839
77966
  if ( skipSceneRender === false ) {
77840
77967
 
77968
+ // WITH_GENESYS
77969
+ ProfilerService.begin( 'WebGLRenderer.renderScene' );
77970
+ // !WITH_GENESYS
77971
+
77841
77972
  const opaqueObjects = currentRenderList.opaque;
77842
77973
  const transmissiveObjects = currentRenderList.transmissive;
77843
77974
 
@@ -77879,6 +78010,10 @@ class WebGLRenderer {
77879
78010
 
77880
78011
  }
77881
78012
 
78013
+ // WITH_GENESYS
78014
+ ProfilerService.end( 'WebGLRenderer.renderScene' );
78015
+ // !WITH_GENESYS
78016
+
77882
78017
  }
77883
78018
 
77884
78019
  //
@@ -77899,7 +78034,13 @@ class WebGLRenderer {
77899
78034
 
77900
78035
  if ( useOutput ) {
77901
78036
 
78037
+ // WITH_GENESYS
78038
+ ProfilerService.begin( 'WebGLOutput.end' );
78039
+ // !WITH_GENESYS
77902
78040
  output.end( _this );
78041
+ // WITH_GENESYS
78042
+ ProfilerService.end( 'WebGLOutput.end' );
78043
+ // !WITH_GENESYS
77903
78044
 
77904
78045
  }
77905
78046
 
@@ -77947,6 +78088,10 @@ class WebGLRenderer {
77947
78088
 
77948
78089
  }
77949
78090
 
78091
+ // WITH_GENESYS
78092
+ ProfilerService.end( 'WebGLRenderer.render' );
78093
+ // !WITH_GENESYS
78094
+
77950
78095
  };
77951
78096
 
77952
78097
  function projectObject( object, camera, groupOrder, sortObjects ) {
@@ -78093,10 +78238,17 @@ class WebGLRenderer {
78093
78238
 
78094
78239
  function renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ) {
78095
78240
 
78241
+ // WITH_GENESYS
78242
+ ProfilerService.begin( 'WebGLRenderer.renderTransmissionPass' );
78243
+ // !WITH_GENESYS
78244
+
78096
78245
  const overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;
78097
78246
 
78098
78247
  if ( overrideMaterial !== null ) {
78099
78248
 
78249
+ // WITH_GENESYS
78250
+ ProfilerService.end( 'WebGLRenderer.renderTransmissionPass' );
78251
+ // !WITH_GENESYS
78100
78252
  return;
78101
78253
 
78102
78254
  }
@@ -78213,10 +78365,19 @@ class WebGLRenderer {
78213
78365
 
78214
78366
  _this.toneMapping = currentToneMapping;
78215
78367
 
78368
+ // WITH_GENESYS
78369
+ ProfilerService.end( 'WebGLRenderer.renderTransmissionPass' );
78370
+ // !WITH_GENESYS
78371
+
78216
78372
  }
78217
78373
 
78218
78374
  function renderObjects( renderList, scene, camera ) {
78219
78375
 
78376
+ // WITH_GENESYS
78377
+ const renderObjectsLabel = `renderObjects (${renderList.length})`;
78378
+ ProfilerService.begin( renderObjectsLabel );
78379
+ // !WITH_GENESYS
78380
+
78220
78381
  const overrideMaterial = scene.isScene === true ? scene.overrideMaterial : null;
78221
78382
 
78222
78383
  for ( let i = 0, l = renderList.length; i < l; i ++ ) {
@@ -78240,6 +78401,10 @@ class WebGLRenderer {
78240
78401
 
78241
78402
  }
78242
78403
 
78404
+ // WITH_GENESYS
78405
+ ProfilerService.end( renderObjectsLabel );
78406
+ // !WITH_GENESYS
78407
+
78243
78408
  }
78244
78409
 
78245
78410
  function renderObject( object, scene, camera, geometry, material, group ) {