globe.gl 2.26.2 → 2.26.5

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/dist/globe.gl.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version 2.26.2 globe.gl - https://github.com/vasturiano/globe.gl
1
+ // Version 2.26.5 globe.gl - https://github.com/vasturiano/globe.gl
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -150,7 +150,7 @@
150
150
  * Copyright 2010-2022 Three.js Authors
151
151
  * SPDX-License-Identifier: MIT
152
152
  */
153
- const REVISION = '141';
153
+ const REVISION = '143';
154
154
  const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
155
155
  const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
156
156
  const CullFaceNone = 0;
@@ -372,13 +372,7 @@
372
372
 
373
373
  }
374
374
 
375
- const _lut = [];
376
-
377
- for ( let i = 0; i < 256; i ++ ) {
378
-
379
- _lut[ i ] = ( i < 16 ? '0' : '' ) + ( i ).toString( 16 );
380
-
381
- }
375
+ const _lut = [ '00', '01', '02', '03', '04', '05', '06', '07', '08', '09', '0a', '0b', '0c', '0d', '0e', '0f', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '1a', '1b', '1c', '1d', '1e', '1f', '20', '21', '22', '23', '24', '25', '26', '27', '28', '29', '2a', '2b', '2c', '2d', '2e', '2f', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '3a', '3b', '3c', '3d', '3e', '3f', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '4a', '4b', '4c', '4d', '4e', '4f', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '5a', '5b', '5c', '5d', '5e', '5f', '60', '61', '62', '63', '64', '65', '66', '67', '68', '69', '6a', '6b', '6c', '6d', '6e', '6f', '70', '71', '72', '73', '74', '75', '76', '77', '78', '79', '7a', '7b', '7c', '7d', '7e', '7f', '80', '81', '82', '83', '84', '85', '86', '87', '88', '89', '8a', '8b', '8c', '8d', '8e', '8f', '90', '91', '92', '93', '94', '95', '96', '97', '98', '99', '9a', '9b', '9c', '9d', '9e', '9f', 'a0', 'a1', 'a2', 'a3', 'a4', 'a5', 'a6', 'a7', 'a8', 'a9', 'aa', 'ab', 'ac', 'ad', 'ae', 'af', 'b0', 'b1', 'b2', 'b3', 'b4', 'b5', 'b6', 'b7', 'b8', 'b9', 'ba', 'bb', 'bc', 'bd', 'be', 'bf', 'c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9', 'ca', 'cb', 'cc', 'cd', 'ce', 'cf', 'd0', 'd1', 'd2', 'd3', 'd4', 'd5', 'd6', 'd7', 'd8', 'd9', 'da', 'db', 'dc', 'dd', 'de', 'df', 'e0', 'e1', 'e2', 'e3', 'e4', 'e5', 'e6', 'e7', 'e8', 'e9', 'ea', 'eb', 'ec', 'ed', 'ee', 'ef', 'f0', 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'fa', 'fb', 'fc', 'fd', 'fe', 'ff' ];
382
376
 
383
377
  let _seed = 1234567;
384
378
 
@@ -703,7 +697,7 @@
703
697
 
704
698
  constructor( x = 0, y = 0 ) {
705
699
 
706
- this.isVector2 = true;
700
+ Vector2.prototype.isVector2 = true;
707
701
 
708
702
  this.x = x;
709
703
  this.y = y;
@@ -809,14 +803,7 @@
809
803
 
810
804
  }
811
805
 
812
- add( v, w ) {
813
-
814
- if ( w !== undefined ) {
815
-
816
- console.warn( 'THREE.Vector2: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );
817
- return this.addVectors( v, w );
818
-
819
- }
806
+ add( v ) {
820
807
 
821
808
  this.x += v.x;
822
809
  this.y += v.y;
@@ -852,14 +839,7 @@
852
839
 
853
840
  }
854
841
 
855
- sub( v, w ) {
856
-
857
- if ( w !== undefined ) {
858
-
859
- console.warn( 'THREE.Vector2: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );
860
- return this.subVectors( v, w );
861
-
862
- }
842
+ sub( v ) {
863
843
 
864
844
  this.x -= v.x;
865
845
  this.y -= v.y;
@@ -1135,13 +1115,7 @@
1135
1115
 
1136
1116
  }
1137
1117
 
1138
- fromBufferAttribute( attribute, index, offset ) {
1139
-
1140
- if ( offset !== undefined ) {
1141
-
1142
- console.warn( 'THREE.Vector2: offset has been removed from .fromBufferAttribute().' );
1143
-
1144
- }
1118
+ fromBufferAttribute( attribute, index ) {
1145
1119
 
1146
1120
  this.x = attribute.getX( index );
1147
1121
  this.y = attribute.getY( index );
@@ -1186,7 +1160,7 @@
1186
1160
 
1187
1161
  constructor() {
1188
1162
 
1189
- this.isMatrix3 = true;
1163
+ Matrix3.prototype.isMatrix3 = true;
1190
1164
 
1191
1165
  this.elements = [
1192
1166
 
@@ -1196,12 +1170,6 @@
1196
1170
 
1197
1171
  ];
1198
1172
 
1199
- if ( arguments.length > 0 ) {
1200
-
1201
- console.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' );
1202
-
1203
- }
1204
-
1205
1173
  }
1206
1174
 
1207
1175
  set( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {
@@ -2450,7 +2418,7 @@
2450
2418
  // images of DataTexture
2451
2419
 
2452
2420
  return {
2453
- data: Array.prototype.slice.call( image.data ),
2421
+ data: Array.from( image.data ),
2454
2422
  width: image.width,
2455
2423
  height: image.height,
2456
2424
  type: image.data.constructor.name
@@ -2761,7 +2729,7 @@
2761
2729
 
2762
2730
  constructor( x = 0, y = 0, z = 0, w = 1 ) {
2763
2731
 
2764
- this.isVector4 = true;
2732
+ Vector4.prototype.isVector4 = true;
2765
2733
 
2766
2734
  this.x = x;
2767
2735
  this.y = y;
@@ -2895,14 +2863,7 @@
2895
2863
 
2896
2864
  }
2897
2865
 
2898
- add( v, w ) {
2899
-
2900
- if ( w !== undefined ) {
2901
-
2902
- console.warn( 'THREE.Vector4: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );
2903
- return this.addVectors( v, w );
2904
-
2905
- }
2866
+ add( v ) {
2906
2867
 
2907
2868
  this.x += v.x;
2908
2869
  this.y += v.y;
@@ -2946,14 +2907,7 @@
2946
2907
 
2947
2908
  }
2948
2909
 
2949
- sub( v, w ) {
2950
-
2951
- if ( w !== undefined ) {
2952
-
2953
- console.warn( 'THREE.Vector4: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );
2954
- return this.subVectors( v, w );
2955
-
2956
- }
2910
+ sub( v ) {
2957
2911
 
2958
2912
  this.x -= v.x;
2959
2913
  this.y -= v.y;
@@ -3381,13 +3335,7 @@
3381
3335
 
3382
3336
  }
3383
3337
 
3384
- fromBufferAttribute( attribute, index, offset ) {
3385
-
3386
- if ( offset !== undefined ) {
3387
-
3388
- console.warn( 'THREE.Vector4: offset has been removed from .fromBufferAttribute().' );
3389
-
3390
- }
3338
+ fromBufferAttribute( attribute, index ) {
3391
3339
 
3392
3340
  this.x = attribute.getX( index );
3393
3341
  this.y = attribute.getY( index );
@@ -3590,13 +3538,6 @@
3590
3538
 
3591
3539
  }
3592
3540
 
3593
- static slerp( qa, qb, qm, t ) {
3594
-
3595
- console.warn( 'THREE.Quaternion: Static .slerp() has been deprecated. Use qm.slerpQuaternions( qa, qb, t ) instead.' );
3596
- return qm.slerpQuaternions( qa, qb, t );
3597
-
3598
- }
3599
-
3600
3541
  static slerpFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) {
3601
3542
 
3602
3543
  // fuzz-free, array-based Quaternion SLERP operation
@@ -4074,14 +4015,7 @@
4074
4015
 
4075
4016
  }
4076
4017
 
4077
- multiply( q, p ) {
4078
-
4079
- if ( p !== undefined ) {
4080
-
4081
- console.warn( 'THREE.Quaternion: .multiply() now only accepts one argument. Use .multiplyQuaternions( a, b ) instead.' );
4082
- return this.multiplyQuaternions( q, p );
4083
-
4084
- }
4018
+ multiply( q ) {
4085
4019
 
4086
4020
  return this.multiplyQuaternions( this, q );
4087
4021
 
@@ -4276,7 +4210,7 @@
4276
4210
 
4277
4211
  constructor( x = 0, y = 0, z = 0 ) {
4278
4212
 
4279
- this.isVector3 = true;
4213
+ Vector3.prototype.isVector3 = true;
4280
4214
 
4281
4215
  this.x = x;
4282
4216
  this.y = y;
@@ -4374,14 +4308,7 @@
4374
4308
 
4375
4309
  }
4376
4310
 
4377
- add( v, w ) {
4378
-
4379
- if ( w !== undefined ) {
4380
-
4381
- console.warn( 'THREE.Vector3: .add() now only accepts one argument. Use .addVectors( a, b ) instead.' );
4382
- return this.addVectors( v, w );
4383
-
4384
- }
4311
+ add( v ) {
4385
4312
 
4386
4313
  this.x += v.x;
4387
4314
  this.y += v.y;
@@ -4421,14 +4348,7 @@
4421
4348
 
4422
4349
  }
4423
4350
 
4424
- sub( v, w ) {
4425
-
4426
- if ( w !== undefined ) {
4427
-
4428
- console.warn( 'THREE.Vector3: .sub() now only accepts one argument. Use .subVectors( a, b ) instead.' );
4429
- return this.subVectors( v, w );
4430
-
4431
- }
4351
+ sub( v ) {
4432
4352
 
4433
4353
  this.x -= v.x;
4434
4354
  this.y -= v.y;
@@ -4458,14 +4378,7 @@
4458
4378
 
4459
4379
  }
4460
4380
 
4461
- multiply( v, w ) {
4462
-
4463
- if ( w !== undefined ) {
4464
-
4465
- console.warn( 'THREE.Vector3: .multiply() now only accepts one argument. Use .multiplyVectors( a, b ) instead.' );
4466
- return this.multiplyVectors( v, w );
4467
-
4468
- }
4381
+ multiply( v ) {
4469
4382
 
4470
4383
  this.x *= v.x;
4471
4384
  this.y *= v.y;
@@ -4497,12 +4410,6 @@
4497
4410
 
4498
4411
  applyEuler( euler ) {
4499
4412
 
4500
- if ( ! ( euler && euler.isEuler ) ) {
4501
-
4502
- console.error( 'THREE.Vector3: .applyEuler() now expects an Euler rotation rather than a Vector3 and order.' );
4503
-
4504
- }
4505
-
4506
4413
  return this.applyQuaternion( _quaternion$4.setFromEuler( euler ) );
4507
4414
 
4508
4415
  }
@@ -4771,14 +4678,7 @@
4771
4678
 
4772
4679
  }
4773
4680
 
4774
- cross( v, w ) {
4775
-
4776
- if ( w !== undefined ) {
4777
-
4778
- console.warn( 'THREE.Vector3: .cross() now only accepts one argument. Use .crossVectors( a, b ) instead.' );
4779
- return this.crossVectors( v, w );
4780
-
4781
- }
4681
+ cross( v ) {
4782
4682
 
4783
4683
  return this.crossVectors( this, v );
4784
4684
 
@@ -4968,13 +4868,7 @@
4968
4868
 
4969
4869
  }
4970
4870
 
4971
- fromBufferAttribute( attribute, index, offset ) {
4972
-
4973
- if ( offset !== undefined ) {
4974
-
4975
- console.warn( 'THREE.Vector3: offset has been removed from .fromBufferAttribute().' );
4976
-
4977
- }
4871
+ fromBufferAttribute( attribute, index ) {
4978
4872
 
4979
4873
  this.x = attribute.getX( index );
4980
4874
  this.y = attribute.getY( index );
@@ -6273,7 +6167,7 @@
6273
6167
 
6274
6168
  constructor() {
6275
6169
 
6276
- this.isMatrix4 = true;
6170
+ Matrix4.prototype.isMatrix4 = true;
6277
6171
 
6278
6172
  this.elements = [
6279
6173
 
@@ -6284,12 +6178,6 @@
6284
6178
 
6285
6179
  ];
6286
6180
 
6287
- if ( arguments.length > 0 ) {
6288
-
6289
- console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' );
6290
-
6291
- }
6292
-
6293
6181
  }
6294
6182
 
6295
6183
  set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {
@@ -6429,12 +6317,6 @@
6429
6317
 
6430
6318
  makeRotationFromEuler( euler ) {
6431
6319
 
6432
- if ( ! ( euler && euler.isEuler ) ) {
6433
-
6434
- console.error( 'THREE.Matrix4: .makeRotationFromEuler() now expects a Euler rotation rather than a Vector3 and order.' );
6435
-
6436
- }
6437
-
6438
6320
  const te = this.elements;
6439
6321
 
6440
6322
  const x = euler.x, y = euler.y, z = euler.z;
@@ -6608,14 +6490,7 @@
6608
6490
 
6609
6491
  }
6610
6492
 
6611
- multiply( m, n ) {
6612
-
6613
- if ( n !== undefined ) {
6614
-
6615
- console.warn( 'THREE.Matrix4: .multiply() now only accepts one argument. Use .multiplyMatrices( a, b ) instead.' );
6616
- return this.multiplyMatrices( m, n );
6617
-
6618
- }
6493
+ multiply( m ) {
6619
6494
 
6620
6495
  return this.multiplyMatrices( this, m );
6621
6496
 
@@ -7042,12 +6917,6 @@
7042
6917
 
7043
6918
  makePerspective( left, right, top, bottom, near, far ) {
7044
6919
 
7045
- if ( far === undefined ) {
7046
-
7047
- console.warn( 'THREE.Matrix4: .makePerspective() has been redefined and has a new signature. Please check the docs.' );
7048
-
7049
- }
7050
-
7051
6920
  const te = this.elements;
7052
6921
  const x = 2 * near / ( right - left );
7053
6922
  const y = 2 * near / ( top - bottom );
@@ -8242,7 +8111,7 @@
8242
8111
 
8243
8112
  }
8244
8113
 
8245
- if ( this.environment && this.environment.isTexture ) {
8114
+ if ( this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== true ) {
8246
8115
 
8247
8116
  object.environment = this.environment.toJSON( meta ).uuid;
8248
8117
 
@@ -8442,7 +8311,7 @@
8442
8311
 
8443
8312
  }
8444
8313
 
8445
- Object3D.DefaultUp = new Vector3( 0, 1, 0 );
8314
+ Object3D.DefaultUp = /*@__PURE__*/ new Vector3( 0, 1, 0 );
8446
8315
  Object3D.DefaultMatrixAutoUpdate = true;
8447
8316
 
8448
8317
  const _v0$1 = /*@__PURE__*/ new Vector3();
@@ -9236,31 +9105,8 @@
9236
9105
 
9237
9106
  }
9238
9107
 
9239
- // @deprecated since r131, f5803c62cc4a29d90744e9dc7811d086e354c1d8
9240
-
9241
- get vertexTangents() {
9242
-
9243
- console.warn( 'THREE.' + this.type + ': .vertexTangents has been removed.' );
9244
- return false;
9245
-
9246
- }
9247
-
9248
- set vertexTangents( value ) {
9249
-
9250
- console.warn( 'THREE.' + this.type + ': .vertexTangents has been removed.' );
9251
-
9252
- }
9253
-
9254
9108
  }
9255
9109
 
9256
- Material.fromType = function ( /*type*/ ) {
9257
-
9258
- // TODO: Behavior added in Materials.js
9259
-
9260
- return null;
9261
-
9262
- };
9263
-
9264
9110
  class MeshBasicMaterial extends Material {
9265
9111
 
9266
9112
  constructor( parameters ) {
@@ -9720,7 +9566,7 @@
9720
9566
  const data = {
9721
9567
  itemSize: this.itemSize,
9722
9568
  type: this.array.constructor.name,
9723
- array: Array.prototype.slice.call( this.array ),
9569
+ array: Array.from( this.array ),
9724
9570
  normalized: this.normalized
9725
9571
  };
9726
9572
 
@@ -11493,6 +11339,20 @@
11493
11339
 
11494
11340
  }
11495
11341
 
11342
+ function cloneUniformsGroups( src ) {
11343
+
11344
+ const dst = [];
11345
+
11346
+ for ( let u = 0; u < src.length; u ++ ) {
11347
+
11348
+ dst.push( src[ u ].clone() );
11349
+
11350
+ }
11351
+
11352
+ return dst;
11353
+
11354
+ }
11355
+
11496
11356
  // Legacy
11497
11357
 
11498
11358
  const UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms };
@@ -11513,6 +11373,7 @@
11513
11373
 
11514
11374
  this.defines = {};
11515
11375
  this.uniforms = {};
11376
+ this.uniformsGroups = [];
11516
11377
 
11517
11378
  this.vertexShader = default_vertex;
11518
11379
  this.fragmentShader = default_fragment;
@@ -11568,6 +11429,7 @@
11568
11429
  this.vertexShader = source.vertexShader;
11569
11430
 
11570
11431
  this.uniforms = cloneUniforms( source.uniforms );
11432
+ this.uniformsGroups = cloneUniformsGroups( source.uniformsGroups );
11571
11433
 
11572
11434
  this.defines = Object.assign( {}, source.defines );
11573
11435
 
@@ -12851,6 +12713,7 @@
12851
12713
  constructor( width = 1, height = 1, widthSegments = 1, heightSegments = 1 ) {
12852
12714
 
12853
12715
  super();
12716
+
12854
12717
  this.type = 'PlaneGeometry';
12855
12718
 
12856
12719
  this.parameters = {
@@ -12945,11 +12808,11 @@
12945
12808
 
12946
12809
  var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif";
12947
12810
 
12948
- var bsdfs = "vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#ifdef USE_IRIDESCENCE\nvec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = mix(F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence);\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#endif\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif";
12811
+ var bsdfs = "vec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float roughness ) {\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\n\treturn F * ( V * D );\n}\n#ifdef USE_IRIDESCENCE\n\tvec3 BRDF_GGX_Iridescence( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 f0, const in float f90, const in float iridescence, const in vec3 iridescenceFresnel, const in float roughness ) {\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = mix( F_Schlick( f0, f90, dotVH ), iridescenceFresnel, iridescence );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\nfloat G_BlinnPhong_Implicit( ) {\n\treturn 0.25;\n}\nfloat D_BlinnPhong( const in float shininess, const in float dotNH ) {\n\treturn RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );\n}\nvec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( specularColor, 1.0, dotVH );\n\tfloat G = G_BlinnPhong_Implicit( );\n\tfloat D = D_BlinnPhong( shininess, dotNH );\n\treturn F * ( G * D );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif";
12949
12812
 
12950
- var iridescence_fragment = "#ifdef USE_IRIDESCENCE\nconst mat3 XYZ_TO_REC709 = mat3(\n 3.2404542, -0.9692660, 0.0556434,\n -1.5371385, 1.8760108, -0.2040259,\n -0.4985314, 0.0415560, 1.0572252\n);\nvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n vec3 sqrtF0 = sqrt( fresnel0 );\n return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n}\nvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n}\nfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n}\nvec3 evalSensitivity( float OPD, vec3 shift ) {\n float phase = 2.0 * PI * OPD * 1.0e-9;\n vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( -pow2( phase ) * var );\n xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[0] ) * exp( -4.5282e+09 * pow2( phase ) );\n xyz /= 1.0685e-7;\n vec3 srgb = XYZ_TO_REC709 * xyz;\n return srgb;\n}\nvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n vec3 I;\n float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n float cosTheta2Sq = 1.0 - sinTheta2Sq;\n if ( cosTheta2Sq < 0.0 ) {\n return vec3( 1.0 );\n }\n float cosTheta2 = sqrt( cosTheta2Sq );\n float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n float R12 = F_Schlick( R0, 1.0, cosTheta1 );\n float R21 = R12;\n float T121 = 1.0 - R12;\n float phi12 = 0.0;\n if ( iridescenceIOR < outsideIOR ) phi12 = PI;\n float phi21 = PI - phi12;\n vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n vec3 phi23 = vec3( 0.0 );\n if ( baseIOR[0] < iridescenceIOR ) phi23[0] = PI;\n if ( baseIOR[1] < iridescenceIOR ) phi23[1] = PI;\n if ( baseIOR[2] < iridescenceIOR ) phi23[2] = PI;\n float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n vec3 phi = vec3( phi21 ) + phi23;\n vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n vec3 r123 = sqrt( R123 );\n vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n vec3 C0 = R12 + Rs;\n I = C0;\n vec3 Cm = Rs - T121;\n for ( int m = 1; m <= 2; ++m ) {\n Cm *= r123;\n vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n I += Cm * Sm;\n }\n return max( I, vec3( 0.0 ) );\n}\n#endif";
12813
+ var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 = mat3(\n\t\t 3.2404542, -0.9692660, 0.0556434,\n\t\t-1.5371385, 1.8760108, -0.2040259,\n\t\t-0.4985314, 0.0415560, 1.0572252\n\t);\n\tvec3 Fresnel0ToIor( vec3 fresnel0 ) {\n\t\tvec3 sqrtF0 = sqrt( fresnel0 );\n\t\treturn ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );\n\t}\n\tvec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );\n\t}\n\tfloat IorToFresnel0( float transmittedIor, float incidentIor ) {\n\t\treturn pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));\n\t}\n\tvec3 evalSensitivity( float OPD, vec3 shift ) {\n\t\tfloat phase = 2.0 * PI * OPD * 1.0e-9;\n\t\tvec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );\n\t\tvec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );\n\t\tvec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );\n\t\tvec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );\n\t\txyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );\n\t\txyz /= 1.0685e-7;\n\t\tvec3 rgb = XYZ_TO_REC709 * xyz;\n\t\treturn rgb;\n\t}\n\tvec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {\n\t\tvec3 I;\n\t\tfloat iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );\n\t\tfloat sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );\n\t\tfloat cosTheta2Sq = 1.0 - sinTheta2Sq;\n\t\tif ( cosTheta2Sq < 0.0 ) {\n\t\t\t return vec3( 1.0 );\n\t\t}\n\t\tfloat cosTheta2 = sqrt( cosTheta2Sq );\n\t\tfloat R0 = IorToFresnel0( iridescenceIOR, outsideIOR );\n\t\tfloat R12 = F_Schlick( R0, 1.0, cosTheta1 );\n\t\tfloat R21 = R12;\n\t\tfloat T121 = 1.0 - R12;\n\t\tfloat phi12 = 0.0;\n\t\tif ( iridescenceIOR < outsideIOR ) phi12 = PI;\n\t\tfloat phi21 = PI - phi12;\n\t\tvec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );\t\tvec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );\n\t\tvec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );\n\t\tvec3 phi23 = vec3( 0.0 );\n\t\tif ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;\n\t\tif ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;\n\t\tif ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;\n\t\tfloat OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;\n\t\tvec3 phi = vec3( phi21 ) + phi23;\n\t\tvec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );\n\t\tvec3 r123 = sqrt( R123 );\n\t\tvec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );\n\t\tvec3 C0 = R12 + Rs;\n\t\tI = C0;\n\t\tvec3 Cm = Rs - T121;\n\t\tfor ( int m = 1; m <= 2; ++ m ) {\n\t\t\tCm *= r123;\n\t\t\tvec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );\n\t\t\tI += Cm * Sm;\n\t\t}\n\t\treturn max( I, vec3( 0.0 ) );\n\t}\n#endif";
12951
12814
 
12952
- var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = vec3( dFdx( surf_pos.x ), dFdx( surf_pos.y ), dFdx( surf_pos.z ) );\n\t\tvec3 vSigmaY = vec3( dFdy( surf_pos.x ), dFdy( surf_pos.y ), dFdy( surf_pos.z ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif";
12815
+ var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vUv );\n\t\tvec2 dSTdy = dFdy( vUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = dFdx( surf_pos.xyz );\n\t\tvec3 vSigmaY = dFdy( surf_pos.xyz );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif";
12953
12816
 
12954
12817
  var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif";
12955
12818
 
@@ -12967,7 +12830,7 @@
12967
12830
 
12968
12831
  var color_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif";
12969
12832
 
12970
- var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 color ) { return dot( color, vec3( 0.3333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat linearToRelativeLuminance( const in vec3 color ) {\n\tvec3 weights = vec3( 0.2126, 0.7152, 0.0722 );\n\treturn dot( weights, color.rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}";
12833
+ var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}";
12971
12834
 
12972
12835
  var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\tvec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define r0 1.0\n\t#define v0 0.339\n\t#define m0 - 2.0\n\t#define r1 0.8\n\t#define v1 0.276\n\t#define m1 - 1.0\n\t#define r4 0.4\n\t#define v4 0.046\n\t#define m4 2.0\n\t#define r5 0.305\n\t#define v5 0.016\n\t#define m5 3.0\n\t#define r6 0.21\n\t#define v6 0.0038\n\t#define m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= r1 ) {\n\t\t\tmip = ( r0 - roughness ) * ( m1 - m0 ) / ( r0 - r1 ) + m0;\n\t\t} else if ( roughness >= r4 ) {\n\t\t\tmip = ( r1 - roughness ) * ( m4 - m1 ) / ( r1 - r4 ) + m1;\n\t\t} else if ( roughness >= r5 ) {\n\t\t\tmip = ( r4 - roughness ) * ( m5 - m4 ) / ( r4 - r5 ) + m4;\n\t\t} else if ( roughness >= r6 ) {\n\t\t\tmip = ( r5 - roughness ) * ( m6 - m5 ) / ( r5 - r6 ) + m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif";
12973
12836
 
@@ -13027,7 +12890,7 @@
13027
12890
 
13028
12891
  var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = vec3( 0.0 );\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX_Iridescence( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness );\n\t#else\n\t\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularF90, material.roughness );\n\t#endif\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";
13029
12892
 
13030
- var lights_fragment_begin = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\nfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\nif ( material.iridescenceThickness == 0.0 ) {\n\tmaterial.iridescence = 0.0;\n} else {\n\tmaterial.iridescence = saturate( material.iridescence );\n}\nif ( material.iridescence > 0.0 ) {\n\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif";
12893
+ var lights_fragment_begin = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, geometry, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= all( bvec2( directLight.visible, receiveShadow ) ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometry, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometry.normal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif";
13031
12894
 
13032
12895
  var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vUv2 );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif";
13033
12896
 
@@ -13071,7 +12934,7 @@
13071
12934
 
13072
12935
  var normal_vertex = "#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif";
13073
12936
 
13074
- var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = vec3( dFdx( eye_pos.x ), dFdx( eye_pos.y ), dFdx( eye_pos.z ) );\n\t\tvec3 q1 = vec3( dFdy( eye_pos.x ), dFdy( eye_pos.y ), dFdy( eye_pos.z ) );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif";
12937
+ var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef OBJECTSPACE_NORMALMAP\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( TANGENTSPACE_NORMALMAP ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tvec3 perturbNormal2Arb( vec3 eye_pos, vec3 surf_norm, vec3 mapN, float faceDirection ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( vUv.st );\n\t\tvec2 st1 = dFdy( vUv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : faceDirection * inversesqrt( det );\n\t\treturn normalize( T * ( mapN.x * scale ) + B * ( mapN.y * scale ) + N * mapN.z );\n\t}\n#endif";
13075
12938
 
13076
12939
  var clearcoat_normal_fragment_begin = "#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif";
13077
12940
 
@@ -13352,12 +13215,12 @@
13352
13215
 
13353
13216
  common: {
13354
13217
 
13355
- diffuse: { value: new Color$1( 0xffffff ) },
13218
+ diffuse: { value: /*@__PURE__*/ new Color$1( 0xffffff ) },
13356
13219
  opacity: { value: 1.0 },
13357
13220
 
13358
13221
  map: { value: null },
13359
- uvTransform: { value: new Matrix3() },
13360
- uv2Transform: { value: new Matrix3() },
13222
+ uvTransform: { value: /*@__PURE__*/ new Matrix3() },
13223
+ uv2Transform: { value: /*@__PURE__*/ new Matrix3() },
13361
13224
 
13362
13225
  alphaMap: { value: null },
13363
13226
  alphaTest: { value: 0 }
@@ -13410,7 +13273,7 @@
13410
13273
  normalmap: {
13411
13274
 
13412
13275
  normalMap: { value: null },
13413
- normalScale: { value: new Vector2( 1, 1 ) }
13276
+ normalScale: { value: /*@__PURE__*/ new Vector2( 1, 1 ) }
13414
13277
 
13415
13278
  },
13416
13279
 
@@ -13445,7 +13308,7 @@
13445
13308
  fogDensity: { value: 0.00025 },
13446
13309
  fogNear: { value: 1 },
13447
13310
  fogFar: { value: 2000 },
13448
- fogColor: { value: new Color$1( 0xffffff ) }
13311
+ fogColor: { value: /*@__PURE__*/ new Color$1( 0xffffff ) }
13449
13312
 
13450
13313
  },
13451
13314
 
@@ -13530,27 +13393,27 @@
13530
13393
 
13531
13394
  points: {
13532
13395
 
13533
- diffuse: { value: new Color$1( 0xffffff ) },
13396
+ diffuse: { value: /*@__PURE__*/ new Color$1( 0xffffff ) },
13534
13397
  opacity: { value: 1.0 },
13535
13398
  size: { value: 1.0 },
13536
13399
  scale: { value: 1.0 },
13537
13400
  map: { value: null },
13538
13401
  alphaMap: { value: null },
13539
13402
  alphaTest: { value: 0 },
13540
- uvTransform: { value: new Matrix3() }
13403
+ uvTransform: { value: /*@__PURE__*/ new Matrix3() }
13541
13404
 
13542
13405
  },
13543
13406
 
13544
13407
  sprite: {
13545
13408
 
13546
- diffuse: { value: new Color$1( 0xffffff ) },
13409
+ diffuse: { value: /*@__PURE__*/ new Color$1( 0xffffff ) },
13547
13410
  opacity: { value: 1.0 },
13548
- center: { value: new Vector2( 0.5, 0.5 ) },
13411
+ center: { value: /*@__PURE__*/ new Vector2( 0.5, 0.5 ) },
13549
13412
  rotation: { value: 0.0 },
13550
13413
  map: { value: null },
13551
13414
  alphaMap: { value: null },
13552
13415
  alphaTest: { value: 0 },
13553
- uvTransform: { value: new Matrix3() }
13416
+ uvTransform: { value: /*@__PURE__*/ new Matrix3() }
13554
13417
 
13555
13418
  }
13556
13419
 
@@ -13560,7 +13423,7 @@
13560
13423
 
13561
13424
  basic: {
13562
13425
 
13563
- uniforms: mergeUniforms( [
13426
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13564
13427
  UniformsLib.common,
13565
13428
  UniformsLib.specularmap,
13566
13429
  UniformsLib.envmap,
@@ -13576,7 +13439,7 @@
13576
13439
 
13577
13440
  lambert: {
13578
13441
 
13579
- uniforms: mergeUniforms( [
13442
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13580
13443
  UniformsLib.common,
13581
13444
  UniformsLib.specularmap,
13582
13445
  UniformsLib.envmap,
@@ -13586,7 +13449,7 @@
13586
13449
  UniformsLib.fog,
13587
13450
  UniformsLib.lights,
13588
13451
  {
13589
- emissive: { value: new Color$1( 0x000000 ) }
13452
+ emissive: { value: /*@__PURE__*/ new Color$1( 0x000000 ) }
13590
13453
  }
13591
13454
  ] ),
13592
13455
 
@@ -13597,7 +13460,7 @@
13597
13460
 
13598
13461
  phong: {
13599
13462
 
13600
- uniforms: mergeUniforms( [
13463
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13601
13464
  UniformsLib.common,
13602
13465
  UniformsLib.specularmap,
13603
13466
  UniformsLib.envmap,
@@ -13610,8 +13473,8 @@
13610
13473
  UniformsLib.fog,
13611
13474
  UniformsLib.lights,
13612
13475
  {
13613
- emissive: { value: new Color$1( 0x000000 ) },
13614
- specular: { value: new Color$1( 0x111111 ) },
13476
+ emissive: { value: /*@__PURE__*/ new Color$1( 0x000000 ) },
13477
+ specular: { value: /*@__PURE__*/ new Color$1( 0x111111 ) },
13615
13478
  shininess: { value: 30 }
13616
13479
  }
13617
13480
  ] ),
@@ -13623,7 +13486,7 @@
13623
13486
 
13624
13487
  standard: {
13625
13488
 
13626
- uniforms: mergeUniforms( [
13489
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13627
13490
  UniformsLib.common,
13628
13491
  UniformsLib.envmap,
13629
13492
  UniformsLib.aomap,
@@ -13637,7 +13500,7 @@
13637
13500
  UniformsLib.fog,
13638
13501
  UniformsLib.lights,
13639
13502
  {
13640
- emissive: { value: new Color$1( 0x000000 ) },
13503
+ emissive: { value: /*@__PURE__*/ new Color$1( 0x000000 ) },
13641
13504
  roughness: { value: 1.0 },
13642
13505
  metalness: { value: 0.0 },
13643
13506
  envMapIntensity: { value: 1 } // temporary
@@ -13651,7 +13514,7 @@
13651
13514
 
13652
13515
  toon: {
13653
13516
 
13654
- uniforms: mergeUniforms( [
13517
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13655
13518
  UniformsLib.common,
13656
13519
  UniformsLib.aomap,
13657
13520
  UniformsLib.lightmap,
@@ -13663,7 +13526,7 @@
13663
13526
  UniformsLib.fog,
13664
13527
  UniformsLib.lights,
13665
13528
  {
13666
- emissive: { value: new Color$1( 0x000000 ) }
13529
+ emissive: { value: /*@__PURE__*/ new Color$1( 0x000000 ) }
13667
13530
  }
13668
13531
  ] ),
13669
13532
 
@@ -13674,7 +13537,7 @@
13674
13537
 
13675
13538
  matcap: {
13676
13539
 
13677
- uniforms: mergeUniforms( [
13540
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13678
13541
  UniformsLib.common,
13679
13542
  UniformsLib.bumpmap,
13680
13543
  UniformsLib.normalmap,
@@ -13692,7 +13555,7 @@
13692
13555
 
13693
13556
  points: {
13694
13557
 
13695
- uniforms: mergeUniforms( [
13558
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13696
13559
  UniformsLib.points,
13697
13560
  UniformsLib.fog
13698
13561
  ] ),
@@ -13704,7 +13567,7 @@
13704
13567
 
13705
13568
  dashed: {
13706
13569
 
13707
- uniforms: mergeUniforms( [
13570
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13708
13571
  UniformsLib.common,
13709
13572
  UniformsLib.fog,
13710
13573
  {
@@ -13721,7 +13584,7 @@
13721
13584
 
13722
13585
  depth: {
13723
13586
 
13724
- uniforms: mergeUniforms( [
13587
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13725
13588
  UniformsLib.common,
13726
13589
  UniformsLib.displacementmap
13727
13590
  ] ),
@@ -13733,7 +13596,7 @@
13733
13596
 
13734
13597
  normal: {
13735
13598
 
13736
- uniforms: mergeUniforms( [
13599
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13737
13600
  UniformsLib.common,
13738
13601
  UniformsLib.bumpmap,
13739
13602
  UniformsLib.normalmap,
@@ -13750,7 +13613,7 @@
13750
13613
 
13751
13614
  sprite: {
13752
13615
 
13753
- uniforms: mergeUniforms( [
13616
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13754
13617
  UniformsLib.sprite,
13755
13618
  UniformsLib.fog
13756
13619
  ] ),
@@ -13763,7 +13626,7 @@
13763
13626
  background: {
13764
13627
 
13765
13628
  uniforms: {
13766
- uvTransform: { value: new Matrix3() },
13629
+ uvTransform: { value: /*@__PURE__*/ new Matrix3() },
13767
13630
  t2D: { value: null },
13768
13631
  },
13769
13632
 
@@ -13771,13 +13634,10 @@
13771
13634
  fragmentShader: ShaderChunk.background_frag
13772
13635
 
13773
13636
  },
13774
- /* -------------------------------------------------------------------------
13775
- // Cube map shader
13776
- ------------------------------------------------------------------------- */
13777
13637
 
13778
13638
  cube: {
13779
13639
 
13780
- uniforms: mergeUniforms( [
13640
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13781
13641
  UniformsLib.envmap,
13782
13642
  {
13783
13643
  opacity: { value: 1.0 }
@@ -13802,11 +13662,11 @@
13802
13662
 
13803
13663
  distanceRGBA: {
13804
13664
 
13805
- uniforms: mergeUniforms( [
13665
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13806
13666
  UniformsLib.common,
13807
13667
  UniformsLib.displacementmap,
13808
13668
  {
13809
- referencePosition: { value: new Vector3() },
13669
+ referencePosition: { value: /*@__PURE__*/ new Vector3() },
13810
13670
  nearDistance: { value: 1 },
13811
13671
  farDistance: { value: 1000 }
13812
13672
  }
@@ -13819,11 +13679,11 @@
13819
13679
 
13820
13680
  shadow: {
13821
13681
 
13822
- uniforms: mergeUniforms( [
13682
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13823
13683
  UniformsLib.lights,
13824
13684
  UniformsLib.fog,
13825
13685
  {
13826
- color: { value: new Color$1( 0x00000 ) },
13686
+ color: { value: /*@__PURE__*/ new Color$1( 0x00000 ) },
13827
13687
  opacity: { value: 1.0 }
13828
13688
  },
13829
13689
  ] ),
@@ -13837,14 +13697,14 @@
13837
13697
 
13838
13698
  ShaderLib.physical = {
13839
13699
 
13840
- uniforms: mergeUniforms( [
13700
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13841
13701
  ShaderLib.standard.uniforms,
13842
13702
  {
13843
13703
  clearcoat: { value: 0 },
13844
13704
  clearcoatMap: { value: null },
13845
13705
  clearcoatRoughness: { value: 0 },
13846
13706
  clearcoatRoughnessMap: { value: null },
13847
- clearcoatNormalScale: { value: new Vector2( 1, 1 ) },
13707
+ clearcoatNormalScale: { value: /*@__PURE__*/ new Vector2( 1, 1 ) },
13848
13708
  clearcoatNormalMap: { value: null },
13849
13709
  iridescence: { value: 0 },
13850
13710
  iridescenceMap: { value: null },
@@ -13853,21 +13713,21 @@
13853
13713
  iridescenceThicknessMaximum: { value: 400 },
13854
13714
  iridescenceThicknessMap: { value: null },
13855
13715
  sheen: { value: 0 },
13856
- sheenColor: { value: new Color$1( 0x000000 ) },
13716
+ sheenColor: { value: /*@__PURE__*/ new Color$1( 0x000000 ) },
13857
13717
  sheenColorMap: { value: null },
13858
13718
  sheenRoughness: { value: 1 },
13859
13719
  sheenRoughnessMap: { value: null },
13860
13720
  transmission: { value: 0 },
13861
13721
  transmissionMap: { value: null },
13862
- transmissionSamplerSize: { value: new Vector2() },
13722
+ transmissionSamplerSize: { value: /*@__PURE__*/ new Vector2() },
13863
13723
  transmissionSamplerMap: { value: null },
13864
13724
  thickness: { value: 0 },
13865
13725
  thicknessMap: { value: null },
13866
13726
  attenuationDistance: { value: 0 },
13867
- attenuationColor: { value: new Color$1( 0x000000 ) },
13727
+ attenuationColor: { value: /*@__PURE__*/ new Color$1( 0x000000 ) },
13868
13728
  specularIntensity: { value: 1 },
13869
13729
  specularIntensityMap: { value: null },
13870
- specularColor: { value: new Color$1( 1, 1, 1 ) },
13730
+ specularColor: { value: /*@__PURE__*/ new Color$1( 1, 1, 1 ) },
13871
13731
  specularColorMap: { value: null },
13872
13732
  }
13873
13733
  ] ),
@@ -16724,6 +16584,8 @@
16724
16584
  const array = attribute.isInterleavedBufferAttribute ? attribute.data.array : attribute.array;
16725
16585
 
16726
16586
  if ( array instanceof Int8Array ) denominator = 127;
16587
+ else if ( array instanceof Uint8Array ) denominator = 255;
16588
+ else if ( array instanceof Uint16Array ) denominator = 65535;
16727
16589
  else if ( array instanceof Int16Array ) denominator = 32767;
16728
16590
  else if ( array instanceof Int32Array ) denominator = 2147483647;
16729
16591
  else console.error( 'THREE.WebGLMorphtargets: Unsupported morph attribute data type: ', array );
@@ -17132,10 +16994,10 @@
17132
16994
  *
17133
16995
  */
17134
16996
 
17135
- const emptyTexture = new Texture();
17136
- const emptyArrayTexture = new DataArrayTexture();
17137
- const empty3dTexture = new Data3DTexture();
17138
- const emptyCubeTexture = new CubeTexture();
16997
+ const emptyTexture = /*@__PURE__*/ new Texture();
16998
+ const emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();
16999
+ const empty3dTexture = /*@__PURE__*/ new Data3DTexture();
17000
+ const emptyCubeTexture = /*@__PURE__*/ new CubeTexture();
17139
17001
 
17140
17002
  // --- Utilities ---
17141
17003
 
@@ -20545,7 +20407,7 @@
20545
20407
 
20546
20408
  let renderStates = new WeakMap();
20547
20409
 
20548
- function get( scene, renderCallDepth ) {
20410
+ function get( scene, renderCallDepth = 0 ) {
20549
20411
 
20550
20412
  let renderState;
20551
20413
 
@@ -20807,20 +20669,9 @@
20807
20669
 
20808
20670
  }
20809
20671
 
20810
- if ( shadow.map === null && ! shadow.isPointLightShadow && this.type === VSMShadowMap ) {
20811
-
20812
- shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y );
20813
- shadow.map.texture.name = light.name + '.shadowMap';
20814
-
20815
- shadow.mapPass = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y );
20816
-
20817
- shadow.camera.updateProjectionMatrix();
20818
-
20819
- }
20820
-
20821
20672
  if ( shadow.map === null ) {
20822
20673
 
20823
- const pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat };
20674
+ const pars = ( this.type !== VSMShadowMap ) ? { minFilter: NearestFilter, magFilter: NearestFilter } : {};
20824
20675
 
20825
20676
  shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );
20826
20677
  shadow.map.texture.name = light.name + '.shadowMap';
@@ -20857,7 +20708,7 @@
20857
20708
 
20858
20709
  // do blur pass for VSM
20859
20710
 
20860
- if ( ! shadow.isPointLightShadow && this.type === VSMShadowMap ) {
20711
+ if ( shadow.isPointLightShadow !== true && this.type === VSMShadowMap ) {
20861
20712
 
20862
20713
  VSMPass( shadow, camera );
20863
20714
 
@@ -20887,6 +20738,12 @@
20887
20738
 
20888
20739
  }
20889
20740
 
20741
+ if ( shadow.mapPass === null ) {
20742
+
20743
+ shadow.mapPass = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y );
20744
+
20745
+ }
20746
+
20890
20747
  // vertical pass
20891
20748
 
20892
20749
  shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;
@@ -20923,7 +20780,7 @@
20923
20780
 
20924
20781
  }
20925
20782
 
20926
- if ( ( _renderer.localClippingEnabled && material.clipShadows === true && material.clippingPlanes.length !== 0 ) ||
20783
+ if ( ( _renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) ||
20927
20784
  ( material.displacementMap && material.displacementScale !== 0 ) ||
20928
20785
  ( material.alphaMap && material.alphaTest > 0 ) ) {
20929
20786
 
@@ -21364,6 +21221,9 @@
21364
21221
  const depthBuffer = new DepthBuffer();
21365
21222
  const stencilBuffer = new StencilBuffer();
21366
21223
 
21224
+ const uboBindings = new WeakMap();
21225
+ const uboProgamMap = new WeakMap();
21226
+
21367
21227
  let enabledCapabilities = {};
21368
21228
 
21369
21229
  let currentBoundFramebuffers = {};
@@ -22114,6 +21974,47 @@
22114
21974
 
22115
21975
  }
22116
21976
 
21977
+ function updateUBOMapping( uniformsGroup, program ) {
21978
+
21979
+ let mapping = uboProgamMap.get( program );
21980
+
21981
+ if ( mapping === undefined ) {
21982
+
21983
+ mapping = new WeakMap();
21984
+
21985
+ uboProgamMap.set( program, mapping );
21986
+
21987
+ }
21988
+
21989
+ let blockIndex = mapping.get( uniformsGroup );
21990
+
21991
+ if ( blockIndex === undefined ) {
21992
+
21993
+ blockIndex = gl.getUniformBlockIndex( program, uniformsGroup.name );
21994
+
21995
+ mapping.set( uniformsGroup, blockIndex );
21996
+
21997
+ }
21998
+
21999
+ }
22000
+
22001
+ function uniformBlockBinding( uniformsGroup, program ) {
22002
+
22003
+ const mapping = uboProgamMap.get( program );
22004
+ const blockIndex = mapping.get( uniformsGroup );
22005
+
22006
+ if ( uboBindings.get( uniformsGroup ) !== blockIndex ) {
22007
+
22008
+ // bind shader specific block index to global block point
22009
+
22010
+ gl.uniformBlockBinding( program, blockIndex, uniformsGroup.__bindingPointIndex );
22011
+
22012
+ uboBindings.set( uniformsGroup, blockIndex );
22013
+
22014
+ }
22015
+
22016
+ }
22017
+
22117
22018
  //
22118
22019
 
22119
22020
  function reset() {
@@ -22241,6 +22142,9 @@
22241
22142
  texImage2D: texImage2D,
22242
22143
  texImage3D: texImage3D,
22243
22144
 
22145
+ updateUBOMapping: updateUBOMapping,
22146
+ uniformBlockBinding: uniformBlockBinding,
22147
+
22244
22148
  texStorage2D: texStorage2D,
22245
22149
  texStorage3D: texStorage3D,
22246
22150
  texSubImage2D: texSubImage2D,
@@ -24196,7 +24100,7 @@
24196
24100
 
24197
24101
  const isWebGL2 = capabilities.isWebGL2;
24198
24102
 
24199
- function convert( p, encoding ) {
24103
+ function convert( p, encoding = null ) {
24200
24104
 
24201
24105
  let extension;
24202
24106
 
@@ -24607,10 +24511,121 @@
24607
24511
 
24608
24512
  if ( inputSource && frame.session.visibilityState !== 'visible-blurred' ) {
24609
24513
 
24514
+ if ( hand && inputSource.hand ) {
24515
+
24516
+ handPose = true;
24517
+
24518
+ for ( const inputjoint of inputSource.hand.values() ) {
24519
+
24520
+ // Update the joints groups with the XRJoint poses
24521
+ const jointPose = frame.getJointPose( inputjoint, referenceSpace );
24522
+
24523
+ if ( hand.joints[ inputjoint.jointName ] === undefined ) {
24524
+
24525
+ // The transform of this joint will be updated with the joint pose on each frame
24526
+ const joint = new Group$1();
24527
+ joint.matrixAutoUpdate = false;
24528
+ joint.visible = false;
24529
+ hand.joints[ inputjoint.jointName ] = joint;
24530
+ // ??
24531
+ hand.add( joint );
24532
+
24533
+ }
24534
+
24535
+ const joint = hand.joints[ inputjoint.jointName ];
24536
+
24537
+ if ( jointPose !== null ) {
24538
+
24539
+ joint.matrix.fromArray( jointPose.transform.matrix );
24540
+ joint.matrix.decompose( joint.position, joint.rotation, joint.scale );
24541
+ joint.jointRadius = jointPose.radius;
24542
+
24543
+ }
24544
+
24545
+ joint.visible = jointPose !== null;
24546
+
24547
+ }
24548
+
24549
+ // Custom events
24550
+
24551
+ // Check pinchz
24552
+ const indexTip = hand.joints[ 'index-finger-tip' ];
24553
+ const thumbTip = hand.joints[ 'thumb-tip' ];
24554
+ const distance = indexTip.position.distanceTo( thumbTip.position );
24555
+
24556
+ const distanceToPinch = 0.02;
24557
+ const threshold = 0.005;
24558
+
24559
+ if ( hand.inputState.pinching && distance > distanceToPinch + threshold ) {
24560
+
24561
+ hand.inputState.pinching = false;
24562
+ this.dispatchEvent( {
24563
+ type: 'pinchend',
24564
+ handedness: inputSource.handedness,
24565
+ target: this
24566
+ } );
24567
+
24568
+ } else if ( ! hand.inputState.pinching && distance <= distanceToPinch - threshold ) {
24569
+
24570
+ hand.inputState.pinching = true;
24571
+ this.dispatchEvent( {
24572
+ type: 'pinchstart',
24573
+ handedness: inputSource.handedness,
24574
+ target: this
24575
+ } );
24576
+
24577
+ }
24578
+
24579
+ } else {
24580
+
24581
+ if ( grip !== null && inputSource.gripSpace ) {
24582
+
24583
+ gripPose = frame.getPose( inputSource.gripSpace, referenceSpace );
24584
+
24585
+ if ( gripPose !== null ) {
24586
+
24587
+ grip.matrix.fromArray( gripPose.transform.matrix );
24588
+ grip.matrix.decompose( grip.position, grip.rotation, grip.scale );
24589
+
24590
+ if ( gripPose.linearVelocity ) {
24591
+
24592
+ grip.hasLinearVelocity = true;
24593
+ grip.linearVelocity.copy( gripPose.linearVelocity );
24594
+
24595
+ } else {
24596
+
24597
+ grip.hasLinearVelocity = false;
24598
+
24599
+ }
24600
+
24601
+ if ( gripPose.angularVelocity ) {
24602
+
24603
+ grip.hasAngularVelocity = true;
24604
+ grip.angularVelocity.copy( gripPose.angularVelocity );
24605
+
24606
+ } else {
24607
+
24608
+ grip.hasAngularVelocity = false;
24609
+
24610
+ }
24611
+
24612
+ }
24613
+
24614
+ }
24615
+
24616
+ }
24617
+
24610
24618
  if ( targetRay !== null ) {
24611
24619
 
24612
24620
  inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
24613
24621
 
24622
+ // Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it
24623
+ if ( inputPose === null && gripPose !== null ) {
24624
+
24625
+ inputPose = gripPose;
24626
+
24627
+ }
24628
+
24614
24629
  if ( inputPose !== null ) {
24615
24630
 
24616
24631
  targetRay.matrix.fromArray( inputPose.transform.matrix );
@@ -24644,109 +24659,6 @@
24644
24659
 
24645
24660
  }
24646
24661
 
24647
- if ( hand && inputSource.hand ) {
24648
-
24649
- handPose = true;
24650
-
24651
- for ( const inputjoint of inputSource.hand.values() ) {
24652
-
24653
- // Update the joints groups with the XRJoint poses
24654
- const jointPose = frame.getJointPose( inputjoint, referenceSpace );
24655
-
24656
- if ( hand.joints[ inputjoint.jointName ] === undefined ) {
24657
-
24658
- // The transform of this joint will be updated with the joint pose on each frame
24659
- const joint = new Group$1();
24660
- joint.matrixAutoUpdate = false;
24661
- joint.visible = false;
24662
- hand.joints[ inputjoint.jointName ] = joint;
24663
- // ??
24664
- hand.add( joint );
24665
-
24666
- }
24667
-
24668
- const joint = hand.joints[ inputjoint.jointName ];
24669
-
24670
- if ( jointPose !== null ) {
24671
-
24672
- joint.matrix.fromArray( jointPose.transform.matrix );
24673
- joint.matrix.decompose( joint.position, joint.rotation, joint.scale );
24674
- joint.jointRadius = jointPose.radius;
24675
-
24676
- }
24677
-
24678
- joint.visible = jointPose !== null;
24679
-
24680
- }
24681
-
24682
- // Custom events
24683
-
24684
- // Check pinchz
24685
- const indexTip = hand.joints[ 'index-finger-tip' ];
24686
- const thumbTip = hand.joints[ 'thumb-tip' ];
24687
- const distance = indexTip.position.distanceTo( thumbTip.position );
24688
-
24689
- const distanceToPinch = 0.02;
24690
- const threshold = 0.005;
24691
-
24692
- if ( hand.inputState.pinching && distance > distanceToPinch + threshold ) {
24693
-
24694
- hand.inputState.pinching = false;
24695
- this.dispatchEvent( {
24696
- type: 'pinchend',
24697
- handedness: inputSource.handedness,
24698
- target: this
24699
- } );
24700
-
24701
- } else if ( ! hand.inputState.pinching && distance <= distanceToPinch - threshold ) {
24702
-
24703
- hand.inputState.pinching = true;
24704
- this.dispatchEvent( {
24705
- type: 'pinchstart',
24706
- handedness: inputSource.handedness,
24707
- target: this
24708
- } );
24709
-
24710
- }
24711
-
24712
- } else {
24713
-
24714
- if ( grip !== null && inputSource.gripSpace ) {
24715
-
24716
- gripPose = frame.getPose( inputSource.gripSpace, referenceSpace );
24717
-
24718
- if ( gripPose !== null ) {
24719
-
24720
- grip.matrix.fromArray( gripPose.transform.matrix );
24721
- grip.matrix.decompose( grip.position, grip.rotation, grip.scale );
24722
-
24723
- if ( gripPose.linearVelocity ) {
24724
-
24725
- grip.hasLinearVelocity = true;
24726
- grip.linearVelocity.copy( gripPose.linearVelocity );
24727
-
24728
- } else {
24729
-
24730
- grip.hasLinearVelocity = false;
24731
-
24732
- }
24733
-
24734
- if ( gripPose.angularVelocity ) {
24735
-
24736
- grip.hasAngularVelocity = true;
24737
- grip.angularVelocity.copy( gripPose.angularVelocity );
24738
-
24739
- } else {
24740
-
24741
- grip.hasAngularVelocity = false;
24742
-
24743
- }
24744
-
24745
- }
24746
-
24747
- }
24748
-
24749
- }
24750
24662
 
24751
24663
  }
24752
24664
 
@@ -24831,7 +24743,7 @@
24831
24743
  let newRenderTarget = null;
24832
24744
 
24833
24745
  const controllers = [];
24834
- const inputSourcesMap = new Map();
24746
+ const controllerInputSources = [];
24835
24747
 
24836
24748
  //
24837
24749
 
@@ -24908,7 +24820,15 @@
24908
24820
 
24909
24821
  function onSessionEvent( event ) {
24910
24822
 
24911
- const controller = inputSourcesMap.get( event.inputSource );
24823
+ const controllerIndex = controllerInputSources.indexOf( event.inputSource );
24824
+
24825
+ if ( controllerIndex === - 1 ) {
24826
+
24827
+ return;
24828
+
24829
+ }
24830
+
24831
+ const controller = controllers[ controllerIndex ];
24912
24832
 
24913
24833
  if ( controller !== undefined ) {
24914
24834
 
@@ -24929,17 +24849,17 @@
24929
24849
  session.removeEventListener( 'end', onSessionEnd );
24930
24850
  session.removeEventListener( 'inputsourceschange', onInputSourcesChange );
24931
24851
 
24932
- inputSourcesMap.forEach( function ( controller, inputSource ) {
24852
+ for ( let i = 0; i < controllers.length; i ++ ) {
24933
24853
 
24934
- if ( controller !== undefined ) {
24854
+ const inputSource = controllerInputSources[ i ];
24935
24855
 
24936
- controller.disconnect( inputSource );
24856
+ if ( inputSource === null ) continue;
24937
24857
 
24938
- }
24858
+ controllerInputSources[ i ] = null;
24939
24859
 
24940
- } );
24860
+ controllers[ i ].disconnect( inputSource );
24941
24861
 
24942
- inputSourcesMap.clear();
24862
+ }
24943
24863
 
24944
24864
  _currentDepthNear = null;
24945
24865
  _currentDepthFar = null;
@@ -25086,7 +25006,7 @@
25086
25006
  }
25087
25007
 
25088
25008
  const projectionlayerInit = {
25089
- colorFormat: ( renderer.outputEncoding === sRGBEncoding ) ? 35907 : 32856,
25009
+ colorFormat: 32856,
25090
25010
  depthFormat: glDepthFormat,
25091
25011
  scaleFactor: framebufferScaleFactor
25092
25012
  };
@@ -25135,28 +25055,17 @@
25135
25055
 
25136
25056
  function onInputSourcesChange( event ) {
25137
25057
 
25138
- const inputSources = session.inputSources;
25139
-
25140
- // Assign controllers to available inputSources
25141
-
25142
- for ( let i = 0; i < inputSources.length; i ++ ) {
25143
-
25144
- const index = inputSources[ i ].handedness === 'right' ? 1 : 0;
25145
- inputSourcesMap.set( inputSources[ i ], controllers[ index ] );
25146
-
25147
- }
25148
-
25149
25058
  // Notify disconnected
25150
25059
 
25151
25060
  for ( let i = 0; i < event.removed.length; i ++ ) {
25152
25061
 
25153
25062
  const inputSource = event.removed[ i ];
25154
- const controller = inputSourcesMap.get( inputSource );
25063
+ const index = controllerInputSources.indexOf( inputSource );
25155
25064
 
25156
- if ( controller ) {
25065
+ if ( index >= 0 ) {
25157
25066
 
25158
- controller.dispatchEvent( { type: 'disconnected', data: inputSource } );
25159
- inputSourcesMap.delete( inputSource );
25067
+ controllerInputSources[ index ] = null;
25068
+ controllers[ index ].dispatchEvent( { type: 'disconnected', data: inputSource } );
25160
25069
 
25161
25070
  }
25162
25071
 
@@ -25167,7 +25076,38 @@
25167
25076
  for ( let i = 0; i < event.added.length; i ++ ) {
25168
25077
 
25169
25078
  const inputSource = event.added[ i ];
25170
- const controller = inputSourcesMap.get( inputSource );
25079
+
25080
+ let controllerIndex = controllerInputSources.indexOf( inputSource );
25081
+
25082
+ if ( controllerIndex === - 1 ) {
25083
+
25084
+ // Assign input source a controller that currently has no input source
25085
+
25086
+ for ( let i = 0; i < controllers.length; i ++ ) {
25087
+
25088
+ if ( i >= controllerInputSources.length ) {
25089
+
25090
+ controllerInputSources.push( inputSource );
25091
+ controllerIndex = i;
25092
+ break;
25093
+
25094
+ } else if ( controllerInputSources[ i ] === null ) {
25095
+
25096
+ controllerInputSources[ i ] = inputSource;
25097
+ controllerIndex = i;
25098
+ break;
25099
+
25100
+ }
25101
+
25102
+ }
25103
+
25104
+ // If all controllers do currently receive input we ignore new ones
25105
+
25106
+ if ( controllerIndex === - 1 ) break;
25107
+
25108
+ }
25109
+
25110
+ const controller = controllers[ controllerIndex ];
25171
25111
 
25172
25112
  if ( controller ) {
25173
25113
 
@@ -25457,14 +25397,12 @@
25457
25397
 
25458
25398
  //
25459
25399
 
25460
- const inputSources = session.inputSources;
25461
-
25462
25400
  for ( let i = 0; i < controllers.length; i ++ ) {
25463
25401
 
25464
- const inputSource = inputSources[ i ];
25465
- const controller = inputSourcesMap.get( inputSource );
25402
+ const inputSource = controllerInputSources[ i ];
25403
+ const controller = controllers[ i ];
25466
25404
 
25467
- if ( controller !== undefined ) {
25405
+ if ( inputSource !== null && controller !== undefined ) {
25468
25406
 
25469
25407
  controller.update( inputSource, frame, customReferenceSpace || referenceSpace );
25470
25408
 
@@ -26168,6 +26106,376 @@
26168
26106
 
26169
26107
  }
26170
26108
 
26109
+ function WebGLUniformsGroups( gl, info, capabilities, state ) {
26110
+
26111
+ let buffers = {};
26112
+ let updateList = {};
26113
+ let allocatedBindingPoints = [];
26114
+
26115
+ const maxBindingPoints = ( capabilities.isWebGL2 ) ? gl.getParameter( 35375 ) : 0; // binding points are global whereas block indices are per shader program
26116
+
26117
+ function bind( uniformsGroup, program ) {
26118
+
26119
+ const webglProgram = program.program;
26120
+ state.uniformBlockBinding( uniformsGroup, webglProgram );
26121
+
26122
+ }
26123
+
26124
+ function update( uniformsGroup, program ) {
26125
+
26126
+ let buffer = buffers[ uniformsGroup.id ];
26127
+
26128
+ if ( buffer === undefined ) {
26129
+
26130
+ prepareUniformsGroup( uniformsGroup );
26131
+
26132
+ buffer = createBuffer( uniformsGroup );
26133
+ buffers[ uniformsGroup.id ] = buffer;
26134
+
26135
+ uniformsGroup.addEventListener( 'dispose', onUniformsGroupsDispose );
26136
+
26137
+ }
26138
+
26139
+ // ensure to update the binding points/block indices mapping for this program
26140
+
26141
+ const webglProgram = program.program;
26142
+ state.updateUBOMapping( uniformsGroup, webglProgram );
26143
+
26144
+ // update UBO once per frame
26145
+
26146
+ const frame = info.render.frame;
26147
+
26148
+ if ( updateList[ uniformsGroup.id ] !== frame ) {
26149
+
26150
+ updateBufferData( uniformsGroup );
26151
+
26152
+ updateList[ uniformsGroup.id ] = frame;
26153
+
26154
+ }
26155
+
26156
+ }
26157
+
26158
+ function createBuffer( uniformsGroup ) {
26159
+
26160
+ // the setup of an UBO is independent of a particular shader program but global
26161
+
26162
+ const bindingPointIndex = allocateBindingPointIndex();
26163
+ uniformsGroup.__bindingPointIndex = bindingPointIndex;
26164
+
26165
+ const buffer = gl.createBuffer();
26166
+ const size = uniformsGroup.__size;
26167
+ const usage = uniformsGroup.usage;
26168
+
26169
+ gl.bindBuffer( 35345, buffer );
26170
+ gl.bufferData( 35345, size, usage );
26171
+ gl.bindBuffer( 35345, null );
26172
+ gl.bindBufferBase( 35345, bindingPointIndex, buffer );
26173
+
26174
+ return buffer;
26175
+
26176
+ }
26177
+
26178
+ function allocateBindingPointIndex() {
26179
+
26180
+ for ( let i = 0; i < maxBindingPoints; i ++ ) {
26181
+
26182
+ if ( allocatedBindingPoints.indexOf( i ) === - 1 ) {
26183
+
26184
+ allocatedBindingPoints.push( i );
26185
+ return i;
26186
+
26187
+ }
26188
+
26189
+ }
26190
+
26191
+ console.error( 'THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.' );
26192
+
26193
+ return 0;
26194
+
26195
+ }
26196
+
26197
+ function updateBufferData( uniformsGroup ) {
26198
+
26199
+ const buffer = buffers[ uniformsGroup.id ];
26200
+ const uniforms = uniformsGroup.uniforms;
26201
+ const cache = uniformsGroup.__cache;
26202
+
26203
+ gl.bindBuffer( 35345, buffer );
26204
+
26205
+ for ( let i = 0, il = uniforms.length; i < il; i ++ ) {
26206
+
26207
+ const uniform = uniforms[ i ];
26208
+
26209
+ // partly update the buffer if necessary
26210
+
26211
+ if ( hasUniformChanged( uniform, i, cache ) === true ) {
26212
+
26213
+ const value = uniform.value;
26214
+ const offset = uniform.__offset;
26215
+
26216
+ if ( typeof value === 'number' ) {
26217
+
26218
+ uniform.__data[ 0 ] = value;
26219
+ gl.bufferSubData( 35345, offset, uniform.__data );
26220
+
26221
+ } else {
26222
+
26223
+ if ( uniform.value.isMatrix3 ) {
26224
+
26225
+ // manually converting 3x3 to 3x4
26226
+
26227
+ uniform.__data[ 0 ] = uniform.value.elements[ 0 ];
26228
+ uniform.__data[ 1 ] = uniform.value.elements[ 1 ];
26229
+ uniform.__data[ 2 ] = uniform.value.elements[ 2 ];
26230
+ uniform.__data[ 3 ] = uniform.value.elements[ 0 ];
26231
+ uniform.__data[ 4 ] = uniform.value.elements[ 3 ];
26232
+ uniform.__data[ 5 ] = uniform.value.elements[ 4 ];
26233
+ uniform.__data[ 6 ] = uniform.value.elements[ 5 ];
26234
+ uniform.__data[ 7 ] = uniform.value.elements[ 0 ];
26235
+ uniform.__data[ 8 ] = uniform.value.elements[ 6 ];
26236
+ uniform.__data[ 9 ] = uniform.value.elements[ 7 ];
26237
+ uniform.__data[ 10 ] = uniform.value.elements[ 8 ];
26238
+ uniform.__data[ 11 ] = uniform.value.elements[ 0 ];
26239
+
26240
+ } else {
26241
+
26242
+ value.toArray( uniform.__data );
26243
+
26244
+ }
26245
+
26246
+ gl.bufferSubData( 35345, offset, uniform.__data );
26247
+
26248
+ }
26249
+
26250
+ }
26251
+
26252
+ }
26253
+
26254
+ gl.bindBuffer( 35345, null );
26255
+
26256
+ }
26257
+
26258
+ function hasUniformChanged( uniform, index, cache ) {
26259
+
26260
+ const value = uniform.value;
26261
+
26262
+ if ( cache[ index ] === undefined ) {
26263
+
26264
+ // cache entry does not exist so far
26265
+
26266
+ if ( typeof value === 'number' ) {
26267
+
26268
+ cache[ index ] = value;
26269
+
26270
+ } else {
26271
+
26272
+ cache[ index ] = value.clone();
26273
+
26274
+ }
26275
+
26276
+ return true;
26277
+
26278
+ } else {
26279
+
26280
+ // compare current value with cached entry
26281
+
26282
+ if ( typeof value === 'number' ) {
26283
+
26284
+ if ( cache[ index ] !== value ) {
26285
+
26286
+ cache[ index ] = value;
26287
+ return true;
26288
+
26289
+ }
26290
+
26291
+ } else {
26292
+
26293
+ const cachedObject = cache[ index ];
26294
+
26295
+ if ( cachedObject.equals( value ) === false ) {
26296
+
26297
+ cachedObject.copy( value );
26298
+ return true;
26299
+
26300
+ }
26301
+
26302
+ }
26303
+
26304
+ }
26305
+
26306
+ return false;
26307
+
26308
+ }
26309
+
26310
+ function prepareUniformsGroup( uniformsGroup ) {
26311
+
26312
+ // determine total buffer size according to the STD140 layout
26313
+ // Hint: STD140 is the only supported layout in WebGL 2
26314
+
26315
+ const uniforms = uniformsGroup.uniforms;
26316
+
26317
+ let offset = 0; // global buffer offset in bytes
26318
+ const chunkSize = 16; // size of a chunk in bytes
26319
+ let chunkOffset = 0; // offset within a single chunk in bytes
26320
+
26321
+ for ( let i = 0, l = uniforms.length; i < l; i ++ ) {
26322
+
26323
+ const uniform = uniforms[ i ];
26324
+ const info = getUniformSize( uniform );
26325
+
26326
+ // the following two properties will be used for partial buffer updates
26327
+
26328
+ uniform.__data = new Float32Array( info.storage / Float32Array.BYTES_PER_ELEMENT );
26329
+ uniform.__offset = offset;
26330
+
26331
+ //
26332
+
26333
+ if ( i > 0 ) {
26334
+
26335
+ chunkOffset = offset % chunkSize;
26336
+
26337
+ const remainingSizeInChunk = chunkSize - chunkOffset;
26338
+
26339
+ // check for chunk overflow
26340
+
26341
+ if ( chunkOffset !== 0 && ( remainingSizeInChunk - info.boundary ) < 0 ) {
26342
+
26343
+ // add padding and adjust offset
26344
+
26345
+ offset += ( chunkSize - chunkOffset );
26346
+ uniform.__offset = offset;
26347
+
26348
+ }
26349
+
26350
+ }
26351
+
26352
+ offset += info.storage;
26353
+
26354
+ }
26355
+
26356
+ // ensure correct final padding
26357
+
26358
+ chunkOffset = offset % chunkSize;
26359
+
26360
+ if ( chunkOffset > 0 ) offset += ( chunkSize - chunkOffset );
26361
+
26362
+ //
26363
+
26364
+ uniformsGroup.__size = offset;
26365
+ uniformsGroup.__cache = {};
26366
+
26367
+ return this;
26368
+
26369
+ }
26370
+
26371
+ function getUniformSize( uniform ) {
26372
+
26373
+ const value = uniform.value;
26374
+
26375
+ const info = {
26376
+ boundary: 0, // bytes
26377
+ storage: 0 // bytes
26378
+ };
26379
+
26380
+ // determine sizes according to STD140
26381
+
26382
+ if ( typeof value === 'number' ) {
26383
+
26384
+ // float/int
26385
+
26386
+ info.boundary = 4;
26387
+ info.storage = 4;
26388
+
26389
+ } else if ( value.isVector2 ) {
26390
+
26391
+ // vec2
26392
+
26393
+ info.boundary = 8;
26394
+ info.storage = 8;
26395
+
26396
+ } else if ( value.isVector3 || value.isColor ) {
26397
+
26398
+ // vec3
26399
+
26400
+ info.boundary = 16;
26401
+ info.storage = 12; // evil: vec3 must start on a 16-byte boundary but it only consumes 12 bytes
26402
+
26403
+ } else if ( value.isVector4 ) {
26404
+
26405
+ // vec4
26406
+
26407
+ info.boundary = 16;
26408
+ info.storage = 16;
26409
+
26410
+ } else if ( value.isMatrix3 ) {
26411
+
26412
+ // mat3 (in STD140 a 3x3 matrix is represented as 3x4)
26413
+
26414
+ info.boundary = 48;
26415
+ info.storage = 48;
26416
+
26417
+ } else if ( value.isMatrix4 ) {
26418
+
26419
+ // mat4
26420
+
26421
+ info.boundary = 64;
26422
+ info.storage = 64;
26423
+
26424
+ } else if ( value.isTexture ) {
26425
+
26426
+ console.warn( 'THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.' );
26427
+
26428
+ } else {
26429
+
26430
+ console.warn( 'THREE.WebGLRenderer: Unsupported uniform value type.', value );
26431
+
26432
+ }
26433
+
26434
+ return info;
26435
+
26436
+ }
26437
+
26438
+ function onUniformsGroupsDispose( event ) {
26439
+
26440
+ const uniformsGroup = event.target;
26441
+
26442
+ uniformsGroup.removeEventListener( 'dispose', onUniformsGroupsDispose );
26443
+
26444
+ const index = allocatedBindingPoints.indexOf( uniformsGroup.__bindingPointIndex );
26445
+ allocatedBindingPoints.splice( index, 1 );
26446
+
26447
+ gl.deleteBuffer( buffers[ uniformsGroup.id ] );
26448
+
26449
+ delete buffers[ uniformsGroup.id ];
26450
+ delete updateList[ uniformsGroup.id ];
26451
+
26452
+ }
26453
+
26454
+ function dispose() {
26455
+
26456
+ for ( const id in buffers ) {
26457
+
26458
+ gl.deleteBuffer( buffers[ id ] );
26459
+
26460
+ }
26461
+
26462
+ allocatedBindingPoints = [];
26463
+ buffers = {};
26464
+ updateList = {};
26465
+
26466
+ }
26467
+
26468
+ return {
26469
+
26470
+ bind: bind,
26471
+ update: update,
26472
+
26473
+ dispose: dispose
26474
+
26475
+ };
26476
+
26477
+ }
26478
+
26171
26479
  function createCanvasElement() {
26172
26480
 
26173
26481
  const canvas = createElementNS( 'canvas' );
@@ -26429,7 +26737,7 @@
26429
26737
 
26430
26738
  let background, morphtargets, bufferRenderer, indexedBufferRenderer;
26431
26739
 
26432
- let utils, bindingStates;
26740
+ let utils, bindingStates, uniformsGroups;
26433
26741
 
26434
26742
  function initGLContext() {
26435
26743
 
@@ -26443,7 +26751,7 @@
26443
26751
 
26444
26752
  state = new WebGLState( _gl, extensions, capabilities );
26445
26753
 
26446
- info = new WebGLInfo( _gl );
26754
+ info = new WebGLInfo();
26447
26755
  properties = new WebGLProperties();
26448
26756
  textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info );
26449
26757
  cubemaps = new WebGLCubeMaps( _this );
@@ -26460,6 +26768,7 @@
26460
26768
  renderStates = new WebGLRenderStates( extensions, capabilities );
26461
26769
  background = new WebGLBackground( _this, cubemaps, state, objects, _alpha, _premultipliedAlpha );
26462
26770
  shadowMap = new WebGLShadowMap( _this, objects, capabilities );
26771
+ uniformsGroups = new WebGLUniformsGroups( _gl, info, capabilities, state );
26463
26772
 
26464
26773
  bufferRenderer = new WebGLBufferRenderer( _gl, extensions, info, capabilities );
26465
26774
  indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info, capabilities );
@@ -26725,6 +27034,7 @@
26725
27034
  cubeuvmaps.dispose();
26726
27035
  objects.dispose();
26727
27036
  bindingStates.dispose();
27037
+ uniformsGroups.dispose();
26728
27038
  programCache.dispose();
26729
27039
 
26730
27040
  xr.dispose();
@@ -27905,6 +28215,31 @@
27905
28215
  p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix );
27906
28216
  p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld );
27907
28217
 
28218
+ // UBOs
28219
+
28220
+ if ( material.isShaderMaterial || material.isRawShaderMaterial ) {
28221
+
28222
+ const groups = material.uniformsGroups;
28223
+
28224
+ for ( let i = 0, l = groups.length; i < l; i ++ ) {
28225
+
28226
+ if ( capabilities.isWebGL2 ) {
28227
+
28228
+ const group = groups[ i ];
28229
+
28230
+ uniformsGroups.update( group, program );
28231
+ uniformsGroups.bind( group, program );
28232
+
28233
+ } else {
28234
+
28235
+ console.warn( 'THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.' );
28236
+
28237
+ }
28238
+
28239
+ }
28240
+
28241
+ }
28242
+
27908
28243
  return program;
27909
28244
 
27910
28245
  }
@@ -28298,7 +28633,23 @@
28298
28633
 
28299
28634
  this.initTexture = function ( texture ) {
28300
28635
 
28301
- textures.setTexture2D( texture, 0 );
28636
+ if ( texture.isCubeTexture ) {
28637
+
28638
+ textures.setTextureCube( texture, 0 );
28639
+
28640
+ } else if ( texture.isData3DTexture ) {
28641
+
28642
+ textures.setTexture3D( texture, 0 );
28643
+
28644
+ } else if ( texture.isDataArrayTexture ) {
28645
+
28646
+ textures.setTexture2DArray( texture, 0 );
28647
+
28648
+ } else {
28649
+
28650
+ textures.setTexture2D( texture, 0 );
28651
+
28652
+ }
28302
28653
 
28303
28654
  state.unbindTexture();
28304
28655
 
@@ -28506,7 +28857,7 @@
28506
28857
 
28507
28858
  if ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {
28508
28859
 
28509
- data.arrayBuffers[ this.array.buffer._uuid ] = Array.prototype.slice.call( new Uint32Array( this.array.buffer ) );
28860
+ data.arrayBuffers[ this.array.buffer._uuid ] = Array.from( new Uint32Array( this.array.buffer ) );
28510
28861
 
28511
28862
  }
28512
28863
 
@@ -28703,7 +29054,7 @@
28703
29054
 
28704
29055
  if ( data === undefined ) {
28705
29056
 
28706
- console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.' );
29057
+ console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will deinterleave buffer data.' );
28707
29058
 
28708
29059
  const array = [];
28709
29060
 
@@ -28745,7 +29096,7 @@
28745
29096
 
28746
29097
  if ( data === undefined ) {
28747
29098
 
28748
- console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.' );
29099
+ console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will deinterleave buffer data.' );
28749
29100
 
28750
29101
  const array = [];
28751
29102
 
@@ -28772,7 +29123,7 @@
28772
29123
 
28773
29124
  } else {
28774
29125
 
28775
- // save as true interlaved attribtue
29126
+ // save as true interleaved attribtue
28776
29127
 
28777
29128
  if ( data.interleavedBuffers === undefined ) {
28778
29129
 
@@ -28800,31 +29151,25 @@
28800
29151
 
28801
29152
  }
28802
29153
 
28803
- class SpriteMaterial extends Material {
28804
-
28805
- constructor( parameters ) {
28806
-
28807
- super();
29154
+ class InstancedBufferAttribute extends BufferAttribute {
28808
29155
 
28809
- this.isSpriteMaterial = true;
29156
+ constructor( array, itemSize, normalized, meshPerAttribute = 1 ) {
28810
29157
 
28811
- this.type = 'SpriteMaterial';
29158
+ if ( typeof normalized === 'number' ) {
28812
29159
 
28813
- this.color = new Color$1( 0xffffff );
29160
+ meshPerAttribute = normalized;
28814
29161
 
28815
- this.map = null;
29162
+ normalized = false;
28816
29163
 
28817
- this.alphaMap = null;
29164
+ console.error( 'THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.' );
28818
29165
 
28819
- this.rotation = 0;
28820
-
28821
- this.sizeAttenuation = true;
29166
+ }
28822
29167
 
28823
- this.transparent = true;
29168
+ super( array, itemSize, normalized );
28824
29169
 
28825
- this.fog = true;
29170
+ this.isInstancedBufferAttribute = true;
28826
29171
 
28827
- this.setValues( parameters );
29172
+ this.meshPerAttribute = meshPerAttribute;
28828
29173
 
28829
29174
  }
28830
29175
 
@@ -28832,19 +29177,21 @@
28832
29177
 
28833
29178
  super.copy( source );
28834
29179
 
28835
- this.color.copy( source.color );
29180
+ this.meshPerAttribute = source.meshPerAttribute;
28836
29181
 
28837
- this.map = source.map;
29182
+ return this;
28838
29183
 
28839
- this.alphaMap = source.alphaMap;
29184
+ }
28840
29185
 
28841
- this.rotation = source.rotation;
29186
+ toJSON() {
28842
29187
 
28843
- this.sizeAttenuation = source.sizeAttenuation;
29188
+ const data = super.toJSON();
28844
29189
 
28845
- this.fog = source.fog;
29190
+ data.meshPerAttribute = this.meshPerAttribute;
28846
29191
 
28847
- return this;
29192
+ data.isInstancedBufferAttribute = true;
29193
+
29194
+ return data;
28848
29195
 
28849
29196
  }
28850
29197
 
@@ -29153,52 +29500,6 @@
29153
29500
 
29154
29501
  }
29155
29502
 
29156
- class PointsMaterial extends Material {
29157
-
29158
- constructor( parameters ) {
29159
-
29160
- super();
29161
-
29162
- this.isPointsMaterial = true;
29163
-
29164
- this.type = 'PointsMaterial';
29165
-
29166
- this.color = new Color$1( 0xffffff );
29167
-
29168
- this.map = null;
29169
-
29170
- this.alphaMap = null;
29171
-
29172
- this.size = 1;
29173
- this.sizeAttenuation = true;
29174
-
29175
- this.fog = true;
29176
-
29177
- this.setValues( parameters );
29178
-
29179
- }
29180
-
29181
- copy( source ) {
29182
-
29183
- super.copy( source );
29184
-
29185
- this.color.copy( source.color );
29186
-
29187
- this.map = source.map;
29188
-
29189
- this.alphaMap = source.alphaMap;
29190
-
29191
- this.size = source.size;
29192
- this.sizeAttenuation = source.sizeAttenuation;
29193
-
29194
- this.fog = source.fog;
29195
-
29196
- return this;
29197
-
29198
- }
29199
-
29200
- }
29201
-
29202
29503
  /**
29203
29504
  * Extensible curve object.
29204
29505
  *
@@ -29851,8 +30152,10 @@
29851
30152
 
29852
30153
  //
29853
30154
 
29854
- const tmp = new Vector3();
29855
- const px = new CubicPoly(), py = new CubicPoly(), pz = new CubicPoly();
30155
+ const tmp = /*@__PURE__*/ new Vector3();
30156
+ const px = /*@__PURE__*/ new CubicPoly();
30157
+ const py = /*@__PURE__*/ new CubicPoly();
30158
+ const pz = /*@__PURE__*/ new CubicPoly();
29856
30159
 
29857
30160
  class CatmullRomCurve3 extends Curve {
29858
30161
 
@@ -30902,6 +31205,7 @@
30902
31205
  constructor( points ) {
30903
31206
 
30904
31207
  super();
31208
+
30905
31209
  this.type = 'Path';
30906
31210
 
30907
31211
  this.currentPoint = new Vector2();
@@ -31171,6 +31475,7 @@
31171
31475
  constructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {
31172
31476
 
31173
31477
  super();
31478
+
31174
31479
  this.type = 'CylinderGeometry';
31175
31480
 
31176
31481
  this.parameters = {
@@ -31434,11 +31739,6 @@
31434
31739
 
31435
31740
  }
31436
31741
 
31437
- new Vector3();
31438
- new Vector3();
31439
- new Vector3();
31440
- new Triangle();
31441
-
31442
31742
  class Shape extends Path$1 {
31443
31743
 
31444
31744
  constructor( points ) {
@@ -32479,7 +32779,7 @@
32479
32779
 
32480
32780
  const curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;
32481
32781
  const steps = options.steps !== undefined ? options.steps : 1;
32482
- let depth = options.depth !== undefined ? options.depth : 1;
32782
+ const depth = options.depth !== undefined ? options.depth : 1;
32483
32783
 
32484
32784
  let bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true;
32485
32785
  let bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 0.2;
@@ -32491,15 +32791,6 @@
32491
32791
 
32492
32792
  const uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator;
32493
32793
 
32494
- // deprecated options
32495
-
32496
- if ( options.amount !== undefined ) {
32497
-
32498
- console.warn( 'THREE.ExtrudeBufferGeometry: amount has been renamed to depth.' );
32499
- depth = options.amount;
32500
-
32501
- }
32502
-
32503
32794
  //
32504
32795
 
32505
32796
  let extrudePts, extrudeByPath = false;
@@ -33221,6 +33512,7 @@
33221
33512
  constructor( radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI ) {
33222
33513
 
33223
33514
  super();
33515
+
33224
33516
  this.type = 'SphereGeometry';
33225
33517
 
33226
33518
  this.parameters = {
@@ -33342,6 +33634,7 @@
33342
33634
  constructor( path = new QuadraticBezierCurve3( new Vector3( - 1, - 1, 0 ), new Vector3( - 1, 1, 0 ), new Vector3( 1, 1, 0 ) ), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false ) {
33343
33635
 
33344
33636
  super();
33637
+
33345
33638
  this.type = 'TubeGeometry';
33346
33639
 
33347
33640
  this.parameters = {
@@ -33526,6 +33819,7 @@
33526
33819
  constructor( geometry = null ) {
33527
33820
 
33528
33821
  super();
33822
+
33529
33823
  this.type = 'WireframeGeometry';
33530
33824
 
33531
33825
  this.parameters = {
@@ -33651,363 +33945,6 @@
33651
33945
 
33652
33946
  }
33653
33947
 
33654
- class ShadowMaterial extends Material {
33655
-
33656
- constructor( parameters ) {
33657
-
33658
- super();
33659
-
33660
- this.isShadowMaterial = true;
33661
-
33662
- this.type = 'ShadowMaterial';
33663
-
33664
- this.color = new Color$1( 0x000000 );
33665
- this.transparent = true;
33666
-
33667
- this.fog = true;
33668
-
33669
- this.setValues( parameters );
33670
-
33671
- }
33672
-
33673
- copy( source ) {
33674
-
33675
- super.copy( source );
33676
-
33677
- this.color.copy( source.color );
33678
-
33679
- this.fog = source.fog;
33680
-
33681
- return this;
33682
-
33683
- }
33684
-
33685
- }
33686
-
33687
- class RawShaderMaterial extends ShaderMaterial {
33688
-
33689
- constructor( parameters ) {
33690
-
33691
- super( parameters );
33692
-
33693
- this.isRawShaderMaterial = true;
33694
-
33695
- this.type = 'RawShaderMaterial';
33696
-
33697
- }
33698
-
33699
- }
33700
-
33701
- class MeshStandardMaterial extends Material {
33702
-
33703
- constructor( parameters ) {
33704
-
33705
- super();
33706
-
33707
- this.isMeshStandardMaterial = true;
33708
-
33709
- this.defines = { 'STANDARD': '' };
33710
-
33711
- this.type = 'MeshStandardMaterial';
33712
-
33713
- this.color = new Color$1( 0xffffff ); // diffuse
33714
- this.roughness = 1.0;
33715
- this.metalness = 0.0;
33716
-
33717
- this.map = null;
33718
-
33719
- this.lightMap = null;
33720
- this.lightMapIntensity = 1.0;
33721
-
33722
- this.aoMap = null;
33723
- this.aoMapIntensity = 1.0;
33724
-
33725
- this.emissive = new Color$1( 0x000000 );
33726
- this.emissiveIntensity = 1.0;
33727
- this.emissiveMap = null;
33728
-
33729
- this.bumpMap = null;
33730
- this.bumpScale = 1;
33731
-
33732
- this.normalMap = null;
33733
- this.normalMapType = TangentSpaceNormalMap;
33734
- this.normalScale = new Vector2( 1, 1 );
33735
-
33736
- this.displacementMap = null;
33737
- this.displacementScale = 1;
33738
- this.displacementBias = 0;
33739
-
33740
- this.roughnessMap = null;
33741
-
33742
- this.metalnessMap = null;
33743
-
33744
- this.alphaMap = null;
33745
-
33746
- this.envMap = null;
33747
- this.envMapIntensity = 1.0;
33748
-
33749
- this.wireframe = false;
33750
- this.wireframeLinewidth = 1;
33751
- this.wireframeLinecap = 'round';
33752
- this.wireframeLinejoin = 'round';
33753
-
33754
- this.flatShading = false;
33755
-
33756
- this.fog = true;
33757
-
33758
- this.setValues( parameters );
33759
-
33760
- }
33761
-
33762
- copy( source ) {
33763
-
33764
- super.copy( source );
33765
-
33766
- this.defines = { 'STANDARD': '' };
33767
-
33768
- this.color.copy( source.color );
33769
- this.roughness = source.roughness;
33770
- this.metalness = source.metalness;
33771
-
33772
- this.map = source.map;
33773
-
33774
- this.lightMap = source.lightMap;
33775
- this.lightMapIntensity = source.lightMapIntensity;
33776
-
33777
- this.aoMap = source.aoMap;
33778
- this.aoMapIntensity = source.aoMapIntensity;
33779
-
33780
- this.emissive.copy( source.emissive );
33781
- this.emissiveMap = source.emissiveMap;
33782
- this.emissiveIntensity = source.emissiveIntensity;
33783
-
33784
- this.bumpMap = source.bumpMap;
33785
- this.bumpScale = source.bumpScale;
33786
-
33787
- this.normalMap = source.normalMap;
33788
- this.normalMapType = source.normalMapType;
33789
- this.normalScale.copy( source.normalScale );
33790
-
33791
- this.displacementMap = source.displacementMap;
33792
- this.displacementScale = source.displacementScale;
33793
- this.displacementBias = source.displacementBias;
33794
-
33795
- this.roughnessMap = source.roughnessMap;
33796
-
33797
- this.metalnessMap = source.metalnessMap;
33798
-
33799
- this.alphaMap = source.alphaMap;
33800
-
33801
- this.envMap = source.envMap;
33802
- this.envMapIntensity = source.envMapIntensity;
33803
-
33804
- this.wireframe = source.wireframe;
33805
- this.wireframeLinewidth = source.wireframeLinewidth;
33806
- this.wireframeLinecap = source.wireframeLinecap;
33807
- this.wireframeLinejoin = source.wireframeLinejoin;
33808
-
33809
- this.flatShading = source.flatShading;
33810
-
33811
- this.fog = source.fog;
33812
-
33813
- return this;
33814
-
33815
- }
33816
-
33817
- }
33818
-
33819
- class MeshPhysicalMaterial extends MeshStandardMaterial {
33820
-
33821
- constructor( parameters ) {
33822
-
33823
- super();
33824
-
33825
- this.isMeshPhysicalMaterial = true;
33826
-
33827
- this.defines = {
33828
-
33829
- 'STANDARD': '',
33830
- 'PHYSICAL': ''
33831
-
33832
- };
33833
-
33834
- this.type = 'MeshPhysicalMaterial';
33835
-
33836
- this.clearcoatMap = null;
33837
- this.clearcoatRoughness = 0.0;
33838
- this.clearcoatRoughnessMap = null;
33839
- this.clearcoatNormalScale = new Vector2( 1, 1 );
33840
- this.clearcoatNormalMap = null;
33841
-
33842
- this.ior = 1.5;
33843
-
33844
- Object.defineProperty( this, 'reflectivity', {
33845
- get: function () {
33846
-
33847
- return ( clamp( 2.5 * ( this.ior - 1 ) / ( this.ior + 1 ), 0, 1 ) );
33848
-
33849
- },
33850
- set: function ( reflectivity ) {
33851
-
33852
- this.ior = ( 1 + 0.4 * reflectivity ) / ( 1 - 0.4 * reflectivity );
33853
-
33854
- }
33855
- } );
33856
-
33857
- this.iridescenceMap = null;
33858
- this.iridescenceIOR = 1.3;
33859
- this.iridescenceThicknessRange = [ 100, 400 ];
33860
- this.iridescenceThicknessMap = null;
33861
-
33862
- this.sheenColor = new Color$1( 0x000000 );
33863
- this.sheenColorMap = null;
33864
- this.sheenRoughness = 1.0;
33865
- this.sheenRoughnessMap = null;
33866
-
33867
- this.transmissionMap = null;
33868
-
33869
- this.thickness = 0;
33870
- this.thicknessMap = null;
33871
- this.attenuationDistance = 0.0;
33872
- this.attenuationColor = new Color$1( 1, 1, 1 );
33873
-
33874
- this.specularIntensity = 1.0;
33875
- this.specularIntensityMap = null;
33876
- this.specularColor = new Color$1( 1, 1, 1 );
33877
- this.specularColorMap = null;
33878
-
33879
- this._sheen = 0.0;
33880
- this._clearcoat = 0;
33881
- this._iridescence = 0;
33882
- this._transmission = 0;
33883
-
33884
- this.setValues( parameters );
33885
-
33886
- }
33887
-
33888
- get sheen() {
33889
-
33890
- return this._sheen;
33891
-
33892
- }
33893
-
33894
- set sheen( value ) {
33895
-
33896
- if ( this._sheen > 0 !== value > 0 ) {
33897
-
33898
- this.version ++;
33899
-
33900
- }
33901
-
33902
- this._sheen = value;
33903
-
33904
- }
33905
-
33906
- get clearcoat() {
33907
-
33908
- return this._clearcoat;
33909
-
33910
- }
33911
-
33912
- set clearcoat( value ) {
33913
-
33914
- if ( this._clearcoat > 0 !== value > 0 ) {
33915
-
33916
- this.version ++;
33917
-
33918
- }
33919
-
33920
- this._clearcoat = value;
33921
-
33922
- }
33923
-
33924
- get iridescence() {
33925
-
33926
- return this._iridescence;
33927
-
33928
- }
33929
-
33930
- set iridescence( value ) {
33931
-
33932
- if ( this._iridescence > 0 !== value > 0 ) {
33933
-
33934
- this.version ++;
33935
-
33936
- }
33937
-
33938
- this._iridescence = value;
33939
-
33940
- }
33941
-
33942
- get transmission() {
33943
-
33944
- return this._transmission;
33945
-
33946
- }
33947
-
33948
- set transmission( value ) {
33949
-
33950
- if ( this._transmission > 0 !== value > 0 ) {
33951
-
33952
- this.version ++;
33953
-
33954
- }
33955
-
33956
- this._transmission = value;
33957
-
33958
- }
33959
-
33960
- copy( source ) {
33961
-
33962
- super.copy( source );
33963
-
33964
- this.defines = {
33965
-
33966
- 'STANDARD': '',
33967
- 'PHYSICAL': ''
33968
-
33969
- };
33970
-
33971
- this.clearcoat = source.clearcoat;
33972
- this.clearcoatMap = source.clearcoatMap;
33973
- this.clearcoatRoughness = source.clearcoatRoughness;
33974
- this.clearcoatRoughnessMap = source.clearcoatRoughnessMap;
33975
- this.clearcoatNormalMap = source.clearcoatNormalMap;
33976
- this.clearcoatNormalScale.copy( source.clearcoatNormalScale );
33977
-
33978
- this.ior = source.ior;
33979
-
33980
- this.iridescence = source.iridescence;
33981
- this.iridescenceMap = source.iridescenceMap;
33982
- this.iridescenceIOR = source.iridescenceIOR;
33983
- this.iridescenceThicknessRange = [ ...source.iridescenceThicknessRange ];
33984
- this.iridescenceThicknessMap = source.iridescenceThicknessMap;
33985
-
33986
- this.sheen = source.sheen;
33987
- this.sheenColor.copy( source.sheenColor );
33988
- this.sheenColorMap = source.sheenColorMap;
33989
- this.sheenRoughness = source.sheenRoughness;
33990
- this.sheenRoughnessMap = source.sheenRoughnessMap;
33991
-
33992
- this.transmission = source.transmission;
33993
- this.transmissionMap = source.transmissionMap;
33994
-
33995
- this.thickness = source.thickness;
33996
- this.thicknessMap = source.thicknessMap;
33997
- this.attenuationDistance = source.attenuationDistance;
33998
- this.attenuationColor.copy( source.attenuationColor );
33999
-
34000
- this.specularIntensity = source.specularIntensity;
34001
- this.specularIntensityMap = source.specularIntensityMap;
34002
- this.specularColor.copy( source.specularColor );
34003
- this.specularColorMap = source.specularColorMap;
34004
-
34005
- return this;
34006
-
34007
- }
34008
-
34009
- }
34010
-
34011
33948
  class MeshPhongMaterial extends Material {
34012
33949
 
34013
33950
  constructor( parameters ) {
@@ -34098,176 +34035,24 @@
34098
34035
  this.displacementScale = source.displacementScale;
34099
34036
  this.displacementBias = source.displacementBias;
34100
34037
 
34101
- this.specularMap = source.specularMap;
34102
-
34103
- this.alphaMap = source.alphaMap;
34104
-
34105
- this.envMap = source.envMap;
34106
- this.combine = source.combine;
34107
- this.reflectivity = source.reflectivity;
34108
- this.refractionRatio = source.refractionRatio;
34109
-
34110
- this.wireframe = source.wireframe;
34111
- this.wireframeLinewidth = source.wireframeLinewidth;
34112
- this.wireframeLinecap = source.wireframeLinecap;
34113
- this.wireframeLinejoin = source.wireframeLinejoin;
34114
-
34115
- this.flatShading = source.flatShading;
34116
-
34117
- this.fog = source.fog;
34118
-
34119
- return this;
34120
-
34121
- }
34122
-
34123
- }
34124
-
34125
- class MeshToonMaterial extends Material {
34126
-
34127
- constructor( parameters ) {
34128
-
34129
- super();
34130
-
34131
- this.isMeshToonMaterial = true;
34132
-
34133
- this.defines = { 'TOON': '' };
34134
-
34135
- this.type = 'MeshToonMaterial';
34136
-
34137
- this.color = new Color$1( 0xffffff );
34138
-
34139
- this.map = null;
34140
- this.gradientMap = null;
34141
-
34142
- this.lightMap = null;
34143
- this.lightMapIntensity = 1.0;
34144
-
34145
- this.aoMap = null;
34146
- this.aoMapIntensity = 1.0;
34147
-
34148
- this.emissive = new Color$1( 0x000000 );
34149
- this.emissiveIntensity = 1.0;
34150
- this.emissiveMap = null;
34151
-
34152
- this.bumpMap = null;
34153
- this.bumpScale = 1;
34154
-
34155
- this.normalMap = null;
34156
- this.normalMapType = TangentSpaceNormalMap;
34157
- this.normalScale = new Vector2( 1, 1 );
34158
-
34159
- this.displacementMap = null;
34160
- this.displacementScale = 1;
34161
- this.displacementBias = 0;
34162
-
34163
- this.alphaMap = null;
34164
-
34165
- this.wireframe = false;
34166
- this.wireframeLinewidth = 1;
34167
- this.wireframeLinecap = 'round';
34168
- this.wireframeLinejoin = 'round';
34169
-
34170
- this.fog = true;
34171
-
34172
- this.setValues( parameters );
34173
-
34174
- }
34175
-
34176
- copy( source ) {
34177
-
34178
- super.copy( source );
34179
-
34180
- this.color.copy( source.color );
34181
-
34182
- this.map = source.map;
34183
- this.gradientMap = source.gradientMap;
34184
-
34185
- this.lightMap = source.lightMap;
34186
- this.lightMapIntensity = source.lightMapIntensity;
34187
-
34188
- this.aoMap = source.aoMap;
34189
- this.aoMapIntensity = source.aoMapIntensity;
34190
-
34191
- this.emissive.copy( source.emissive );
34192
- this.emissiveMap = source.emissiveMap;
34193
- this.emissiveIntensity = source.emissiveIntensity;
34194
-
34195
- this.bumpMap = source.bumpMap;
34196
- this.bumpScale = source.bumpScale;
34197
-
34198
- this.normalMap = source.normalMap;
34199
- this.normalMapType = source.normalMapType;
34200
- this.normalScale.copy( source.normalScale );
34201
-
34202
- this.displacementMap = source.displacementMap;
34203
- this.displacementScale = source.displacementScale;
34204
- this.displacementBias = source.displacementBias;
34205
-
34038
+ this.specularMap = source.specularMap;
34039
+
34206
34040
  this.alphaMap = source.alphaMap;
34207
34041
 
34042
+ this.envMap = source.envMap;
34043
+ this.combine = source.combine;
34044
+ this.reflectivity = source.reflectivity;
34045
+ this.refractionRatio = source.refractionRatio;
34046
+
34208
34047
  this.wireframe = source.wireframe;
34209
34048
  this.wireframeLinewidth = source.wireframeLinewidth;
34210
34049
  this.wireframeLinecap = source.wireframeLinecap;
34211
34050
  this.wireframeLinejoin = source.wireframeLinejoin;
34212
34051
 
34213
- this.fog = source.fog;
34214
-
34215
- return this;
34216
-
34217
- }
34218
-
34219
- }
34220
-
34221
- class MeshNormalMaterial extends Material {
34222
-
34223
- constructor( parameters ) {
34224
-
34225
- super();
34226
-
34227
- this.isMeshNormalMaterial = true;
34228
-
34229
- this.type = 'MeshNormalMaterial';
34230
-
34231
- this.bumpMap = null;
34232
- this.bumpScale = 1;
34233
-
34234
- this.normalMap = null;
34235
- this.normalMapType = TangentSpaceNormalMap;
34236
- this.normalScale = new Vector2( 1, 1 );
34237
-
34238
- this.displacementMap = null;
34239
- this.displacementScale = 1;
34240
- this.displacementBias = 0;
34241
-
34242
- this.wireframe = false;
34243
- this.wireframeLinewidth = 1;
34244
-
34245
- this.flatShading = false;
34246
-
34247
- this.setValues( parameters );
34248
-
34249
- }
34250
-
34251
- copy( source ) {
34252
-
34253
- super.copy( source );
34254
-
34255
- this.bumpMap = source.bumpMap;
34256
- this.bumpScale = source.bumpScale;
34257
-
34258
- this.normalMap = source.normalMap;
34259
- this.normalMapType = source.normalMapType;
34260
- this.normalScale.copy( source.normalScale );
34261
-
34262
- this.displacementMap = source.displacementMap;
34263
- this.displacementScale = source.displacementScale;
34264
- this.displacementBias = source.displacementBias;
34265
-
34266
- this.wireframe = source.wireframe;
34267
- this.wireframeLinewidth = source.wireframeLinewidth;
34268
-
34269
34052
  this.flatShading = source.flatShading;
34270
34053
 
34054
+ this.fog = source.fog;
34055
+
34271
34056
  return this;
34272
34057
 
34273
34058
  }
@@ -34358,140 +34143,6 @@
34358
34143
 
34359
34144
  }
34360
34145
 
34361
- class MeshMatcapMaterial extends Material {
34362
-
34363
- constructor( parameters ) {
34364
-
34365
- super();
34366
-
34367
- this.isMeshMatcapMaterial = true;
34368
-
34369
- this.defines = { 'MATCAP': '' };
34370
-
34371
- this.type = 'MeshMatcapMaterial';
34372
-
34373
- this.color = new Color$1( 0xffffff ); // diffuse
34374
-
34375
- this.matcap = null;
34376
-
34377
- this.map = null;
34378
-
34379
- this.bumpMap = null;
34380
- this.bumpScale = 1;
34381
-
34382
- this.normalMap = null;
34383
- this.normalMapType = TangentSpaceNormalMap;
34384
- this.normalScale = new Vector2( 1, 1 );
34385
-
34386
- this.displacementMap = null;
34387
- this.displacementScale = 1;
34388
- this.displacementBias = 0;
34389
-
34390
- this.alphaMap = null;
34391
-
34392
- this.flatShading = false;
34393
-
34394
- this.fog = true;
34395
-
34396
- this.setValues( parameters );
34397
-
34398
- }
34399
-
34400
-
34401
- copy( source ) {
34402
-
34403
- super.copy( source );
34404
-
34405
- this.defines = { 'MATCAP': '' };
34406
-
34407
- this.color.copy( source.color );
34408
-
34409
- this.matcap = source.matcap;
34410
-
34411
- this.map = source.map;
34412
-
34413
- this.bumpMap = source.bumpMap;
34414
- this.bumpScale = source.bumpScale;
34415
-
34416
- this.normalMap = source.normalMap;
34417
- this.normalMapType = source.normalMapType;
34418
- this.normalScale.copy( source.normalScale );
34419
-
34420
- this.displacementMap = source.displacementMap;
34421
- this.displacementScale = source.displacementScale;
34422
- this.displacementBias = source.displacementBias;
34423
-
34424
- this.alphaMap = source.alphaMap;
34425
-
34426
- this.flatShading = source.flatShading;
34427
-
34428
- this.fog = source.fog;
34429
-
34430
- return this;
34431
-
34432
- }
34433
-
34434
- }
34435
-
34436
- class LineDashedMaterial extends LineBasicMaterial {
34437
-
34438
- constructor( parameters ) {
34439
-
34440
- super();
34441
-
34442
- this.isLineDashedMaterial = true;
34443
-
34444
- this.type = 'LineDashedMaterial';
34445
-
34446
- this.scale = 1;
34447
- this.dashSize = 3;
34448
- this.gapSize = 1;
34449
-
34450
- this.setValues( parameters );
34451
-
34452
- }
34453
-
34454
- copy( source ) {
34455
-
34456
- super.copy( source );
34457
-
34458
- this.scale = source.scale;
34459
- this.dashSize = source.dashSize;
34460
- this.gapSize = source.gapSize;
34461
-
34462
- return this;
34463
-
34464
- }
34465
-
34466
- }
34467
-
34468
- const materialLib = {
34469
- ShadowMaterial,
34470
- SpriteMaterial,
34471
- RawShaderMaterial,
34472
- ShaderMaterial,
34473
- PointsMaterial,
34474
- MeshPhysicalMaterial,
34475
- MeshStandardMaterial,
34476
- MeshPhongMaterial,
34477
- MeshToonMaterial,
34478
- MeshNormalMaterial,
34479
- MeshLambertMaterial,
34480
- MeshDepthMaterial,
34481
- MeshDistanceMaterial,
34482
- MeshBasicMaterial,
34483
- MeshMatcapMaterial,
34484
- LineDashedMaterial,
34485
- LineBasicMaterial,
34486
- Material
34487
- };
34488
-
34489
- Material.fromType = function ( type ) {
34490
-
34491
- return new materialLib[ type ]();
34492
-
34493
- };
34494
-
34495
34146
  const Cache = {
34496
34147
 
34497
34148
  enabled: false,
@@ -34671,7 +34322,7 @@
34671
34322
 
34672
34323
  }
34673
34324
 
34674
- const DefaultLoadingManager = new LoadingManager();
34325
+ const DefaultLoadingManager = /*@__PURE__*/ new LoadingManager();
34675
34326
 
34676
34327
  class Loader {
34677
34328
 
@@ -35235,30 +34886,6 @@
35235
34886
 
35236
34887
  }
35237
34888
 
35238
- // Characters [].:/ are reserved for track binding syntax.
35239
- const _RESERVED_CHARS_RE = '\\[\\]\\.:\\/';
35240
-
35241
- // Attempts to allow node names from any language. ES5's `\w` regexp matches
35242
- // only latin characters, and the unicode \p{L} is not yet supported. So
35243
- // instead, we exclude reserved characters and match everything else.
35244
- const _wordChar = '[^' + _RESERVED_CHARS_RE + ']';
35245
- const _wordCharOrDot = '[^' + _RESERVED_CHARS_RE.replace( '\\.', '' ) + ']';
35246
-
35247
- // Parent directories, delimited by '/' or ':'. Currently unused, but must
35248
- // be matched to parse the rest of the track name.
35249
- /((?:WC+[\/:])*)/.source.replace( 'WC', _wordChar );
35250
-
35251
- // Target node. May contain word characters (a-zA-Z0-9_) and '.' or '-'.
35252
- /(WCOD+)?/.source.replace( 'WCOD', _wordCharOrDot );
35253
-
35254
- // Object on target node, and accessor. May not contain reserved
35255
- // characters. Accessor may contain any character except closing bracket.
35256
- /(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace( 'WC', _wordChar );
35257
-
35258
- // Property and accessor. May not contain reserved characters. Accessor may
35259
- // contain any non-bracket characters.
35260
- /\.(WC+)(?:\[(.+)\])?/.source.replace( 'WC', _wordChar );
35261
-
35262
34889
  class InstancedInterleavedBuffer extends InterleavedBuffer {
35263
34890
 
35264
34891
  constructor( array, stride, meshPerAttribute = 1 ) {
@@ -35891,120 +35518,6 @@
35891
35518
 
35892
35519
  }
35893
35520
 
35894
- const _baseTable = new Uint32Array( 512 );
35895
- const _shiftTable = new Uint32Array( 512 );
35896
-
35897
- for ( let i = 0; i < 256; ++ i ) {
35898
-
35899
- const e = i - 127;
35900
-
35901
- // very small number (0, -0)
35902
-
35903
- if ( e < - 27 ) {
35904
-
35905
- _baseTable[ i ] = 0x0000;
35906
- _baseTable[ i | 0x100 ] = 0x8000;
35907
- _shiftTable[ i ] = 24;
35908
- _shiftTable[ i | 0x100 ] = 24;
35909
-
35910
- // small number (denorm)
35911
-
35912
- } else if ( e < - 14 ) {
35913
-
35914
- _baseTable[ i ] = 0x0400 >> ( - e - 14 );
35915
- _baseTable[ i | 0x100 ] = ( 0x0400 >> ( - e - 14 ) ) | 0x8000;
35916
- _shiftTable[ i ] = - e - 1;
35917
- _shiftTable[ i | 0x100 ] = - e - 1;
35918
-
35919
- // normal number
35920
-
35921
- } else if ( e <= 15 ) {
35922
-
35923
- _baseTable[ i ] = ( e + 15 ) << 10;
35924
- _baseTable[ i | 0x100 ] = ( ( e + 15 ) << 10 ) | 0x8000;
35925
- _shiftTable[ i ] = 13;
35926
- _shiftTable[ i | 0x100 ] = 13;
35927
-
35928
- // large number (Infinity, -Infinity)
35929
-
35930
- } else if ( e < 128 ) {
35931
-
35932
- _baseTable[ i ] = 0x7c00;
35933
- _baseTable[ i | 0x100 ] = 0xfc00;
35934
- _shiftTable[ i ] = 24;
35935
- _shiftTable[ i | 0x100 ] = 24;
35936
-
35937
- // stay (NaN, Infinity, -Infinity)
35938
-
35939
- } else {
35940
-
35941
- _baseTable[ i ] = 0x7c00;
35942
- _baseTable[ i | 0x100 ] = 0xfc00;
35943
- _shiftTable[ i ] = 13;
35944
- _shiftTable[ i | 0x100 ] = 13;
35945
-
35946
- }
35947
-
35948
- }
35949
-
35950
- // float16 to float32 helpers
35951
-
35952
- const _mantissaTable = new Uint32Array( 2048 );
35953
- const _exponentTable = new Uint32Array( 64 );
35954
- const _offsetTable = new Uint32Array( 64 );
35955
-
35956
- for ( let i = 1; i < 1024; ++ i ) {
35957
-
35958
- let m = i << 13; // zero pad mantissa bits
35959
- let e = 0; // zero exponent
35960
-
35961
- // normalized
35962
- while ( ( m & 0x00800000 ) === 0 ) {
35963
-
35964
- m <<= 1;
35965
- e -= 0x00800000; // decrement exponent
35966
-
35967
- }
35968
-
35969
- m &= ~ 0x00800000; // clear leading 1 bit
35970
- e += 0x38800000; // adjust bias
35971
-
35972
- _mantissaTable[ i ] = m | e;
35973
-
35974
- }
35975
-
35976
- for ( let i = 1024; i < 2048; ++ i ) {
35977
-
35978
- _mantissaTable[ i ] = 0x38000000 + ( ( i - 1024 ) << 13 );
35979
-
35980
- }
35981
-
35982
- for ( let i = 1; i < 31; ++ i ) {
35983
-
35984
- _exponentTable[ i ] = i << 23;
35985
-
35986
- }
35987
-
35988
- _exponentTable[ 31 ] = 0x47800000;
35989
- _exponentTable[ 32 ] = 0x80000000;
35990
- for ( let i = 33; i < 63; ++ i ) {
35991
-
35992
- _exponentTable[ i ] = 0x80000000 + ( ( i - 32 ) << 23 );
35993
-
35994
- }
35995
-
35996
- _exponentTable[ 63 ] = 0xc7800000;
35997
-
35998
- for ( let i = 1; i < 64; ++ i ) {
35999
-
36000
- if ( i !== 32 ) {
36001
-
36002
- _offsetTable[ i ] = 1024;
36003
-
36004
- }
36005
-
36006
- }
36007
-
36008
35521
  if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
36009
35522
 
36010
35523
  __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
@@ -37363,10 +36876,10 @@
37363
36876
 
37364
36877
  // minX, minY and invSize are later used to transform coords into integers for z-order calculation
37365
36878
  invSize = Math.max(maxX - minX, maxY - minY);
37366
- invSize = invSize !== 0 ? 1 / invSize : 0;
36879
+ invSize = invSize !== 0 ? 32767 / invSize : 0;
37367
36880
  }
37368
36881
 
37369
- earcutLinked(outerNode, triangles, dim, minX, minY, invSize);
36882
+ earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);
37370
36883
 
37371
36884
  return triangles;
37372
36885
  }
@@ -37430,9 +36943,9 @@
37430
36943
 
37431
36944
  if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {
37432
36945
  // cut off the triangle
37433
- triangles.push(prev.i / dim);
37434
- triangles.push(ear.i / dim);
37435
- triangles.push(next.i / dim);
36946
+ triangles.push(prev.i / dim | 0);
36947
+ triangles.push(ear.i / dim | 0);
36948
+ triangles.push(next.i / dim | 0);
37436
36949
 
37437
36950
  removeNode(ear);
37438
36951
 
@@ -37475,10 +36988,18 @@
37475
36988
  if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
37476
36989
 
37477
36990
  // now make sure we don't have other points inside the potential ear
37478
- var p = ear.next.next;
36991
+ var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
37479
36992
 
37480
- while (p !== ear.prev) {
37481
- if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
36993
+ // triangle bbox; min & max are calculated like this for speed
36994
+ var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),
36995
+ y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),
36996
+ x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),
36997
+ y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);
36998
+
36999
+ var p = c.next;
37000
+ while (p !== a) {
37001
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&
37002
+ pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) &&
37482
37003
  area(p.prev, p, p.next) >= 0) return false;
37483
37004
  p = p.next;
37484
37005
  }
@@ -37493,45 +37014,43 @@
37493
37014
 
37494
37015
  if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
37495
37016
 
37017
+ var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
37018
+
37496
37019
  // triangle bbox; min & max are calculated like this for speed
37497
- var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),
37498
- minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),
37499
- maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),
37500
- maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);
37020
+ var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),
37021
+ y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),
37022
+ x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),
37023
+ y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);
37501
37024
 
37502
37025
  // z-order range for the current triangle bbox;
37503
- var minZ = zOrder(minTX, minTY, minX, minY, invSize),
37504
- maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);
37026
+ var minZ = zOrder(x0, y0, minX, minY, invSize),
37027
+ maxZ = zOrder(x1, y1, minX, minY, invSize);
37505
37028
 
37506
37029
  var p = ear.prevZ,
37507
37030
  n = ear.nextZ;
37508
37031
 
37509
37032
  // look for points inside the triangle in both directions
37510
37033
  while (p && p.z >= minZ && n && n.z <= maxZ) {
37511
- if (p !== ear.prev && p !== ear.next &&
37512
- pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
37513
- area(p.prev, p, p.next) >= 0) return false;
37034
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&
37035
+ pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
37514
37036
  p = p.prevZ;
37515
37037
 
37516
- if (n !== ear.prev && n !== ear.next &&
37517
- pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&
37518
- area(n.prev, n, n.next) >= 0) return false;
37038
+ if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&
37039
+ pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;
37519
37040
  n = n.nextZ;
37520
37041
  }
37521
37042
 
37522
37043
  // look for remaining points in decreasing z-order
37523
37044
  while (p && p.z >= minZ) {
37524
- if (p !== ear.prev && p !== ear.next &&
37525
- pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
37526
- area(p.prev, p, p.next) >= 0) return false;
37045
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&
37046
+ pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
37527
37047
  p = p.prevZ;
37528
37048
  }
37529
37049
 
37530
37050
  // look for remaining points in increasing z-order
37531
37051
  while (n && n.z <= maxZ) {
37532
- if (n !== ear.prev && n !== ear.next &&
37533
- pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&
37534
- area(n.prev, n, n.next) >= 0) return false;
37052
+ if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&
37053
+ pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;
37535
37054
  n = n.nextZ;
37536
37055
  }
37537
37056
 
@@ -37547,9 +37066,9 @@
37547
37066
 
37548
37067
  if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
37549
37068
 
37550
- triangles.push(a.i / dim);
37551
- triangles.push(p.i / dim);
37552
- triangles.push(b.i / dim);
37069
+ triangles.push(a.i / dim | 0);
37070
+ triangles.push(p.i / dim | 0);
37071
+ triangles.push(b.i / dim | 0);
37553
37072
 
37554
37073
  // remove two nodes involved
37555
37074
  removeNode(p);
@@ -37579,8 +37098,8 @@
37579
37098
  c = filterPoints(c, c.next);
37580
37099
 
37581
37100
  // run earcut on each half
37582
- earcutLinked(a, triangles, dim, minX, minY, invSize);
37583
- earcutLinked(c, triangles, dim, minX, minY, invSize);
37101
+ earcutLinked(a, triangles, dim, minX, minY, invSize, 0);
37102
+ earcutLinked(c, triangles, dim, minX, minY, invSize, 0);
37584
37103
  return;
37585
37104
  }
37586
37105
  b = b.next;
@@ -37607,7 +37126,6 @@
37607
37126
  // process holes from left to right
37608
37127
  for (i = 0; i < queue.length; i++) {
37609
37128
  outerNode = eliminateHole(queue[i], outerNode);
37610
- outerNode = filterPoints(outerNode, outerNode.next);
37611
37129
  }
37612
37130
 
37613
37131
  return outerNode;
@@ -37627,11 +37145,8 @@
37627
37145
  var bridgeReverse = splitPolygon(bridge, hole);
37628
37146
 
37629
37147
  // filter collinear points around the cuts
37630
- var filteredBridge = filterPoints(bridge, bridge.next);
37631
37148
  filterPoints(bridgeReverse, bridgeReverse.next);
37632
-
37633
- // Check if input node was removed by the filtering
37634
- return outerNode === bridge ? filteredBridge : outerNode;
37149
+ return filterPoints(bridge, bridge.next);
37635
37150
  }
37636
37151
 
37637
37152
  // David Eberly's algorithm for finding a bridge between hole and outer polygon
@@ -37649,11 +37164,8 @@
37649
37164
  var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
37650
37165
  if (x <= hx && x > qx) {
37651
37166
  qx = x;
37652
- if (x === hx) {
37653
- if (hy === p.y) return p;
37654
- if (hy === p.next.y) return p.next;
37655
- }
37656
37167
  m = p.x < p.next.x ? p : p.next;
37168
+ if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint
37657
37169
  }
37658
37170
  }
37659
37171
  p = p.next;
@@ -37661,8 +37173,6 @@
37661
37173
 
37662
37174
  if (!m) return null;
37663
37175
 
37664
- if (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint
37665
-
37666
37176
  // look for points inside the triangle of hole point, segment intersection and endpoint;
37667
37177
  // if there are no points found, we have a valid connection;
37668
37178
  // otherwise choose the point of the minimum angle with the ray as connection point
@@ -37703,7 +37213,7 @@
37703
37213
  function indexCurve(start, minX, minY, invSize) {
37704
37214
  var p = start;
37705
37215
  do {
37706
- if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);
37216
+ if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);
37707
37217
  p.prevZ = p.prev;
37708
37218
  p.nextZ = p.next;
37709
37219
  p = p.next;
@@ -37771,8 +37281,8 @@
37771
37281
  // z-order of a point given coords and inverse of the longer side of data bbox
37772
37282
  function zOrder(x, y, minX, minY, invSize) {
37773
37283
  // coords are transformed into non-negative 15-bit integer range
37774
- x = 32767 * (x - minX) * invSize;
37775
- y = 32767 * (y - minY) * invSize;
37284
+ x = (x - minX) * invSize | 0;
37285
+ y = (y - minY) * invSize | 0;
37776
37286
 
37777
37287
  x = (x | (x << 8)) & 0x00FF00FF;
37778
37288
  x = (x | (x << 4)) & 0x0F0F0F0F;
@@ -37801,9 +37311,9 @@
37801
37311
 
37802
37312
  // check if a point lies within a convex triangle
37803
37313
  function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
37804
- return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&
37805
- (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&
37806
- (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;
37314
+ return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&
37315
+ (ax - px) * (by - py) >= (bx - px) * (ay - py) &&
37316
+ (bx - px) * (cy - py) >= (cx - px) * (by - py);
37807
37317
  }
37808
37318
 
37809
37319
  // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
@@ -37946,7 +37456,7 @@
37946
37456
  this.next = null;
37947
37457
 
37948
37458
  // z-order curve value
37949
- this.z = null;
37459
+ this.z = 0;
37950
37460
 
37951
37461
  // previous and next nodes in z-order
37952
37462
  this.prevZ = null;
@@ -38054,7 +37564,7 @@
38054
37564
  return lo;
38055
37565
  }
38056
37566
 
38057
- function right(a, x, lo, hi) {
37567
+ function right(a, x, lo = 0, hi = a.length) {
38058
37568
  if (lo < hi) {
38059
37569
  if (compare1(x, x) !== 0) return hi;
38060
37570
  do {
@@ -38066,7 +37576,7 @@
38066
37576
  return lo;
38067
37577
  }
38068
37578
 
38069
- function center(a, x, lo, hi) {
37579
+ function center(a, x, lo = 0, hi = a.length) {
38070
37580
  const i = left(a, x, lo, hi - 1);
38071
37581
  return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
38072
37582
  }
@@ -43319,7 +42829,7 @@
43319
42829
  }
43320
42830
 
43321
42831
  function _iterableToArrayLimit$4(arr, i) {
43322
- var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
42832
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
43323
42833
 
43324
42834
  if (_i == null) return;
43325
42835
  var _arr = [];
@@ -43502,14 +43012,9 @@
43502
43012
 
43503
43013
  if (Object.getOwnPropertySymbols) {
43504
43014
  var symbols = Object.getOwnPropertySymbols(object);
43505
-
43506
- if (enumerableOnly) {
43507
- symbols = symbols.filter(function (sym) {
43508
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
43509
- });
43510
- }
43511
-
43512
- keys.push.apply(keys, symbols);
43015
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
43016
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
43017
+ })), keys.push.apply(keys, symbols);
43513
43018
  }
43514
43019
 
43515
43020
  return keys;
@@ -43517,19 +43022,12 @@
43517
43022
 
43518
43023
  function _objectSpread2$1(target) {
43519
43024
  for (var i = 1; i < arguments.length; i++) {
43520
- var source = arguments[i] != null ? arguments[i] : {};
43521
-
43522
- if (i % 2) {
43523
- ownKeys$1(Object(source), true).forEach(function (key) {
43524
- _defineProperty$2(target, key, source[key]);
43525
- });
43526
- } else if (Object.getOwnPropertyDescriptors) {
43527
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
43528
- } else {
43529
- ownKeys$1(Object(source)).forEach(function (key) {
43530
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
43531
- });
43532
- }
43025
+ var source = null != arguments[i] ? arguments[i] : {};
43026
+ i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
43027
+ _defineProperty$2(target, key, source[key]);
43028
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
43029
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
43030
+ });
43533
43031
  }
43534
43032
 
43535
43033
  return target;
@@ -43607,7 +43105,7 @@
43607
43105
  }
43608
43106
 
43609
43107
  function _iterableToArrayLimit$3(arr, i) {
43610
- var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
43108
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
43611
43109
 
43612
43110
  if (_i == null) return;
43613
43111
  var _arr = [];
@@ -43661,6 +43159,8 @@
43661
43159
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
43662
43160
  }
43663
43161
 
43162
+ var _excluded$2 = ["createObj", "updateObj", "exitObj", "objBindAttr", "dataBindAttr"];
43163
+
43664
43164
  function diffArrays(prev, next, idAccessor) {
43665
43165
  var result = {
43666
43166
  enter: [],
@@ -43755,7 +43255,7 @@
43755
43255
  objBindAttr = _ref7$objBindAttr === void 0 ? '__obj' : _ref7$objBindAttr,
43756
43256
  _ref7$dataBindAttr = _ref7.dataBindAttr,
43757
43257
  dataBindAttr = _ref7$dataBindAttr === void 0 ? '__data' : _ref7$dataBindAttr,
43758
- dataDiffOptions = _objectWithoutProperties$1(_ref7, ["createObj", "updateObj", "exitObj", "objBindAttr", "dataBindAttr"]);
43258
+ dataDiffOptions = _objectWithoutProperties$1(_ref7, _excluded$2);
43759
43259
 
43760
43260
  var _dataBindDiff = dataBindDiff(data, existingObjs, _objectSpread2$1({
43761
43261
  objBindAttr: objBindAttr,
@@ -43805,13 +43305,13 @@
43805
43305
  }
43806
43306
  }
43807
43307
 
43808
- var FrameTicker$1 = {exports: {}};
43308
+ var FrameTicker$3 = {exports: {}};
43809
43309
 
43810
43310
  (function (module, exports) {
43811
43311
  !function(e,t){module.exports=t();}(commonjsGlobal,function(){return function(e){function t(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t,i){var n=i(1),r=function(){function e(e,t,i){void 0===e&&(e=NaN),void 0===t&&(t=NaN),void 0===i&&(i=!1),this._minFPS=t,this._maxFPS=e,this._timeScale=1,this._currentTick=0,this._currentTime=0,this._tickDeltaTime=0,this._isRunning=!1,this._maxInterval=isNaN(this._minFPS)?NaN:1e3/this._minFPS,this._minInterval=isNaN(this._maxFPS)?NaN:1e3/this._maxFPS,this._onResume=new n.default,this._onPause=new n.default,this._onTick=new n.default,this._onTickOncePerFrame=new n.default,i||this.resume();}return e.prototype.updateOnce=function(e){e(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick);},e.prototype.resume=function(){this._isRunning||(this._isRunning=!0,this._lastTimeUpdated=this.getTimer(),this._onResume.dispatch(),this.animateOnce());},e.prototype.pause=function(){this._isRunning&&(this._isRunning=!1,this._onPause.dispatch(),window.cancelAnimationFrame(this._animationFrameHandle));},e.prototype.dispose=function(){this.pause(),this._onResume.removeAll(),this._onPause.removeAll(),this._onTick.removeAll();},Object.defineProperty(e.prototype,"currentTick",{get:function(){return this._currentTick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"currentTimeSeconds",{get:function(){return this._currentTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tickDeltaTimeSeconds",{get:function(){return this._tickDeltaTime/1e3},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"timeScale",{get:function(){return this._timeScale},set:function(e){this._timeScale!==e&&(this._timeScale=e);},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onResume",{get:function(){return this._onResume},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onPause",{get:function(){return this._onPause},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTick",{get:function(){return this._onTick},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onTickOncePerFrame",{get:function(){return this._onTickOncePerFrame},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isRunning",{get:function(){return this._isRunning},enumerable:!0,configurable:!0}),e.prototype.animateOnce=function(){var e=this;this._animationFrameHandle=window.requestAnimationFrame(function(){return e.onFrame()});},e.prototype.onFrame=function(){if(this._now=this.getTimer(),this._frameDeltaTime=this._now-this._lastTimeUpdated,isNaN(this._minInterval)||this._frameDeltaTime>=this._minInterval)if(isNaN(this._maxInterval))this.update(this._frameDeltaTime*this._timeScale,!0),this._lastTimeUpdated=this._now;else for(this._interval=Math.min(this._frameDeltaTime,this._maxInterval);this._now>=this._lastTimeUpdated+this._interval;)this.update(this._interval*this._timeScale,this._now<=this._lastTimeUpdated+2*this._maxInterval),this._lastTimeUpdated+=this._interval;this._isRunning&&this.animateOnce();},e.prototype.update=function(e,t){void 0===t&&(t=!0),this._currentTick++,this._currentTime+=e,this._tickDeltaTime=e,this._onTick.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick),t&&this._onTickOncePerFrame.dispatch(this.currentTimeSeconds,this.tickDeltaTimeSeconds,this.currentTick);},e.prototype.getTimer=function(){return Date.now()},e}();Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;},function(e,t,i){!function(t,i){e.exports=i();}(this,function(){return function(e){function t(n){if(i[n])return i[n].exports;var r=i[n]={exports:{},id:n,loaded:!1};return e[n].call(r.exports,r,r.exports,t),r.loaded=!0,r.exports}var i={};return t.m=e,t.c=i,t.p="",t(0)}([function(e,t){var i=function(){function e(){this.functions=[];}return e.prototype.add=function(e){return this.functions.indexOf(e)===-1&&(this.functions.push(e),!0)},e.prototype.remove=function(e){var t=this.functions.indexOf(e);return t>-1&&(this.functions.splice(t,1),!0)},e.prototype.removeAll=function(){return this.functions.length>0&&(this.functions.length=0,!0)},e.prototype.dispatch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var i=this.functions.concat();i.forEach(function(t){t.apply(void 0,e);});},Object.defineProperty(e.prototype,"numItems",{get:function(){return this.functions.length},enumerable:!0,configurable:!0}),e}();Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;}])});}])});
43812
- } (FrameTicker$1));
43312
+ } (FrameTicker$3));
43813
43313
 
43814
- var FrameTicker = /*@__PURE__*/getDefaultExportFromCjs(FrameTicker$1.exports);
43314
+ var _FrameTicker = /*@__PURE__*/getDefaultExportFromCjs(FrameTicker$3.exports);
43815
43315
 
43816
43316
  function initRange(domain, range) {
43817
43317
  switch (arguments.length) {
@@ -46255,6 +45755,8 @@
46255
45755
 
46256
45756
  function defaultLocale(definition) {
46257
45757
  locale = formatLocale(definition);
45758
+ locale.format;
45759
+ locale.parse;
46258
45760
  utcFormat = locale.utcFormat;
46259
45761
  utcParse = locale.utcParse;
46260
45762
  return locale;
@@ -49049,8 +48551,6 @@
49049
48551
  }
49050
48552
  }
49051
48553
 
49052
- var arguments_ = [];
49053
-
49054
48554
  var ENVIRONMENT_IS_WEB = false;
49055
48555
  var ENVIRONMENT_IS_WORKER = false;
49056
48556
  var ENVIRONMENT_IS_NODE = false;
@@ -49107,7 +48607,7 @@
49107
48607
  process["argv"][1].replace(/\\/g, "/");
49108
48608
  }
49109
48609
 
49110
- arguments_ = process["argv"].slice(2);
48610
+ process["argv"].slice(2);
49111
48611
 
49112
48612
  Module["inspect"] = function () {
49113
48613
  return "[Emscripten Module object]";
@@ -49143,9 +48643,7 @@
49143
48643
  };
49144
48644
 
49145
48645
  if (typeof scriptArgs != "undefined") {
49146
- arguments_ = scriptArgs;
49147
- } else if (typeof arguments != "undefined") {
49148
- arguments_ = arguments;
48646
+ scriptArgs;
49149
48647
  }
49150
48648
 
49151
48649
  if (typeof print !== "undefined") {
@@ -49239,8 +48737,8 @@
49239
48737
  }
49240
48738
 
49241
48739
  moduleOverrides = null;
49242
- if (Module["arguments"]) { arguments_ = Module["arguments"]; }
49243
- if (Module["thisProgram"]) ;
48740
+ if (Module["arguments"]) { Module["arguments"]; }
48741
+ if (Module["thisProgram"]) { Module["thisProgram"]; }
49244
48742
 
49245
48743
  var tempRet0 = 0;
49246
48744
 
@@ -49927,7 +49425,6 @@
49927
49425
 
49928
49426
  function Z(a, b) {
49929
49427
  a = a | 0;
49930
- b = b | 0;
49931
49428
  S = a;
49932
49429
  }
49933
49430
 
@@ -61293,7 +60790,6 @@
61293
60790
  };
61294
60791
 
61295
60792
  function run(args) {
61296
- args = args || arguments_;
61297
60793
 
61298
60794
  if (runDependencies > 0) {
61299
60795
  return;
@@ -63000,7 +62496,7 @@
63000
62496
 
63001
62497
  for ( let p = 0, pl = paths.length; p < pl; p ++ ) {
63002
62498
 
63003
- Array.prototype.push.apply( shapes, paths[ p ].toShapes() );
62499
+ shapes.push( ...paths[ p ].toShapes() );
63004
62500
 
63005
62501
  }
63006
62502
 
@@ -63978,6 +63474,7 @@
63978
63474
  TubeBufferGeometry: TubeGeometry,
63979
63475
  Vector3: Vector3
63980
63476
  };
63477
+ var FrameTicker$2 = _FrameTicker["default"] || _FrameTicker;
63981
63478
  // support both modes for backwards threejs compatibility
63982
63479
 
63983
63480
  var setAttributeFn$1 = new THREE$c.BufferGeometry().setAttribute ? 'setAttribute' : 'addAttribute';
@@ -64068,7 +63565,7 @@
64068
63565
 
64069
63566
  state.scene = threeObj; // Kick-off dash animations
64070
63567
 
64071
- new FrameTicker().onTick.add(function (_, timeDelta) {
63568
+ new FrameTicker$2().onTick.add(function (_, timeDelta) {
64072
63569
  state.arcsData.filter(function (d) {
64073
63570
  return d.__threeObj && d.__threeObj.children.length && d.__threeObj.children[0].material && d.__threeObj.children[0].__dashAnimateStep;
64074
63571
  }).forEach(function (d) {
@@ -64874,89 +64371,89 @@
64874
64371
  obj.material.color.set(colorStr2Hex(color));
64875
64372
  obj.material.transparent = opacity < 1;
64876
64373
  obj.material.opacity = opacity;
64877
- var h3Idxs = [];
64878
-
64879
- if (geoJson.type === 'Polygon') {
64880
- polyfill(geoJson.coordinates, h3Res, true).forEach(function (idx) {
64881
- return h3Idxs.push(idx);
64882
- });
64883
- } else if (geoJson.type === 'MultiPolygon') {
64884
- geoJson.coordinates.forEach(function (coords) {
64885
- return polyfill(coords, h3Res, true).forEach(function (idx) {
64886
- return h3Idxs.push(idx);
64887
- });
64888
- });
64889
- } else {
64890
- console.warn("Unsupported GeoJson geometry type: ".concat(geoJson.type, ". Skipping geometry..."));
64891
- }
64892
-
64893
- var hexBins = h3Idxs.map(function (h3Idx) {
64894
- var hexCenter = h3ToGeo(h3Idx);
64895
- var hexGeoJson = h3ToGeoBoundary(h3Idx, true).reverse(); // correct polygon winding
64896
- // stitch longitudes at the anti-meridian
64897
-
64898
- var centerLng = hexCenter[1];
64899
- hexGeoJson.forEach(function (d) {
64900
- var edgeLng = d[0];
64901
-
64902
- if (Math.abs(centerLng - edgeLng) > 170) {
64903
- // normalize large lng distances
64904
- d[0] += centerLng > edgeLng ? 360 : -360;
64905
- }
64906
- });
64907
- return {
64908
- h3Idx: h3Idx,
64909
- hexCenter: hexCenter,
64910
- hexGeoJson: hexGeoJson
64911
- };
64912
- });
64913
64374
  var targetD = {
64914
64375
  alt: alt,
64915
64376
  margin: margin,
64916
64377
  curvatureResolution: curvatureResolution
64917
64378
  };
64379
+ var currentTargetD = obj.__currentTargetD || Object.assign({}, targetD, {
64380
+ alt: -1e-3
64381
+ });
64918
64382
 
64919
- var applyUpdate = function applyUpdate(td) {
64920
- var _obj$__currentTargetD = obj.__currentTargetD = td,
64921
- alt = _obj$__currentTargetD.alt,
64922
- margin = _obj$__currentTargetD.margin,
64923
- curvatureResolution = _obj$__currentTargetD.curvatureResolution;
64924
-
64925
- obj.geometry && obj.geometry.dispose();
64926
- obj.geometry = !hexBins.length ? new THREE$9.BufferGeometry() : BufferGeometryUtils.mergeBufferGeometries(hexBins.map(function (h) {
64927
- // compute new geojson with relative margin
64928
- var relNum = function relNum(st, end, rat) {
64929
- return st - (st - end) * rat;
64930
- };
64383
+ if (Object.keys(targetD).some(function (k) {
64384
+ return currentTargetD[k] !== targetD[k];
64385
+ })) {
64386
+ var h3Idxs = [];
64931
64387
 
64932
- var _h$hexCenter = _slicedToArray$1(h.hexCenter, 2),
64933
- clat = _h$hexCenter[0],
64934
- clng = _h$hexCenter[1];
64388
+ if (geoJson.type === 'Polygon') {
64389
+ polyfill(geoJson.coordinates, h3Res, true).forEach(function (idx) {
64390
+ return h3Idxs.push(idx);
64391
+ });
64392
+ } else if (geoJson.type === 'MultiPolygon') {
64393
+ geoJson.coordinates.forEach(function (coords) {
64394
+ return polyfill(coords, h3Res, true).forEach(function (idx) {
64395
+ return h3Idxs.push(idx);
64396
+ });
64397
+ });
64398
+ } else {
64399
+ console.warn("Unsupported GeoJson geometry type: ".concat(geoJson.type, ". Skipping geometry..."));
64400
+ }
64935
64401
 
64936
- var geoJson = margin === 0 ? h.hexGeoJson : h.hexGeoJson.map(function (_ref) {
64937
- var _ref2 = _slicedToArray$1(_ref, 2),
64938
- elng = _ref2[0],
64939
- elat = _ref2[1];
64402
+ var hexBins = h3Idxs.map(function (h3Idx) {
64403
+ var hexCenter = h3ToGeo(h3Idx);
64404
+ var hexGeoJson = h3ToGeoBoundary(h3Idx, true).reverse(); // correct polygon winding
64405
+ // stitch longitudes at the anti-meridian
64940
64406
 
64941
- return [[elng, clng], [elat, clat]].map(function (_ref3) {
64942
- var _ref4 = _slicedToArray$1(_ref3, 2),
64943
- st = _ref4[0],
64944
- end = _ref4[1];
64407
+ var centerLng = hexCenter[1];
64408
+ hexGeoJson.forEach(function (d) {
64409
+ var edgeLng = d[0];
64945
64410
 
64946
- return relNum(st, end, margin);
64947
- });
64411
+ if (Math.abs(centerLng - edgeLng) > 170) {
64412
+ // normalize large lng distances
64413
+ d[0] += centerLng > edgeLng ? 360 : -360;
64414
+ }
64948
64415
  });
64949
- return new ConicPolygonBufferGeometry([geoJson], GLOBE_RADIUS, GLOBE_RADIUS * (1 + alt), false, true, false, curvatureResolution);
64950
- }));
64951
- };
64416
+ return {
64417
+ h3Idx: h3Idx,
64418
+ hexCenter: hexCenter,
64419
+ hexGeoJson: hexGeoJson
64420
+ };
64421
+ });
64952
64422
 
64953
- var currentTargetD = obj.__currentTargetD || Object.assign({}, targetD, {
64954
- alt: -1e-3
64955
- });
64423
+ var applyUpdate = function applyUpdate(td) {
64424
+ var _obj$__currentTargetD = obj.__currentTargetD = td,
64425
+ alt = _obj$__currentTargetD.alt,
64426
+ margin = _obj$__currentTargetD.margin,
64427
+ curvatureResolution = _obj$__currentTargetD.curvatureResolution;
64428
+
64429
+ obj.geometry && obj.geometry.dispose();
64430
+ obj.geometry = !hexBins.length ? new THREE$9.BufferGeometry() : BufferGeometryUtils.mergeBufferGeometries(hexBins.map(function (h) {
64431
+ // compute new geojson with relative margin
64432
+ var relNum = function relNum(st, end, rat) {
64433
+ return st - (st - end) * rat;
64434
+ };
64435
+
64436
+ var _h$hexCenter = _slicedToArray$1(h.hexCenter, 2),
64437
+ clat = _h$hexCenter[0],
64438
+ clng = _h$hexCenter[1];
64439
+
64440
+ var geoJson = margin === 0 ? h.hexGeoJson : h.hexGeoJson.map(function (_ref) {
64441
+ var _ref2 = _slicedToArray$1(_ref, 2),
64442
+ elng = _ref2[0],
64443
+ elat = _ref2[1];
64444
+
64445
+ return [[elng, clng], [elat, clat]].map(function (_ref3) {
64446
+ var _ref4 = _slicedToArray$1(_ref3, 2),
64447
+ st = _ref4[0],
64448
+ end = _ref4[1];
64449
+
64450
+ return relNum(st, end, margin);
64451
+ });
64452
+ });
64453
+ return new ConicPolygonBufferGeometry([geoJson], GLOBE_RADIUS, GLOBE_RADIUS * (1 + alt), false, true, false, curvatureResolution);
64454
+ }));
64455
+ };
64956
64456
 
64957
- if (Object.keys(targetD).some(function (k) {
64958
- return currentTargetD[k] !== targetD[k];
64959
- })) {
64960
64457
  if (!state.hexPolygonsTransitionDuration || state.hexPolygonsTransitionDuration < 0) {
64961
64458
  // set final position
64962
64459
  applyUpdate(targetD);
@@ -65016,6 +64513,7 @@
65016
64513
  ShaderMaterial: ShaderMaterial,
65017
64514
  Vector3: Vector3
65018
64515
  };
64516
+ var FrameTicker$1 = _FrameTicker["default"] || _FrameTicker;
65019
64517
  // support both modes for backwards threejs compatibility
65020
64518
 
65021
64519
  var setAttributeFn = new THREE$7.BufferGeometry().setAttribute ? 'setAttribute' : 'addAttribute';
@@ -65102,7 +64600,7 @@
65102
64600
 
65103
64601
  state.scene = threeObj; // Kick-off dash animations
65104
64602
 
65105
- new FrameTicker().onTick.add(function (_, timeDelta) {
64603
+ new FrameTicker$1().onTick.add(function (_, timeDelta) {
65106
64604
  state.pathsData.filter(function (d) {
65107
64605
  return d.__threeObj && d.__threeObj.children.length && d.__threeObj.children[0].material && d.__threeObj.children[0].__dashAnimateStep;
65108
64606
  }).forEach(function (d) {
@@ -65811,6 +65309,7 @@
65811
65309
  LineBasicMaterial: LineBasicMaterial,
65812
65310
  Vector3: Vector3
65813
65311
  };
65312
+ var FrameTicker = _FrameTicker["default"] || _FrameTicker;
65814
65313
  var RingsLayerKapsule = index$2({
65815
65314
  props: {
65816
65315
  ringsData: {
@@ -68186,8 +67685,6 @@
68186
67685
 
68187
67686
  function onMouseMove( event ) {
68188
67687
 
68189
- if ( scope.enabled === false ) return;
68190
-
68191
67688
  switch ( state ) {
68192
67689
 
68193
67690
  case STATE.ROTATE:
@@ -70564,8 +70061,10 @@
70564
70061
  state.pointerPos.y = ev.pageY - offset.top; // Move tooltip
70565
70062
 
70566
70063
  state.toolTipElem.style.top = "".concat(state.pointerPos.y, "px");
70567
- state.toolTipElem.style.left = "".concat(state.pointerPos.x, "px");
70568
- state.toolTipElem.style.transform = "translate(-".concat(state.pointerPos.x / state.width * 100, "%, 21px)"); // adjust horizontal position to not exceed canvas boundaries
70064
+ state.toolTipElem.style.left = "".concat(state.pointerPos.x, "px"); // adjust horizontal position to not exceed canvas boundaries
70065
+
70066
+ state.toolTipElem.style.transform = "translate(-".concat(state.pointerPos.x / state.width * 100, "%, ").concat( // flip to above if near bottom
70067
+ state.height - state.pointerPos.y < 100 ? 'calc(-100% - 8px)' : '21px', ")");
70569
70068
  }
70570
70069
 
70571
70070
  function getOffset(el) {
@@ -70686,7 +70185,7 @@
70686
70185
  }
70687
70186
 
70688
70187
  if (changedProps.hasOwnProperty('skyRadius') && state.skyRadius) {
70689
- state.controls.hasOwnProperty('maxDistance') && changedProps.skyRadius && (state.controls.maxDistance = state.skyRadius);
70188
+ state.controls.hasOwnProperty('maxDistance') && changedProps.skyRadius && (state.controls.maxDistance = Math.min(state.controls.maxDistance, state.skyRadius));
70690
70189
  state.camera.far = state.skyRadius * 2.5;
70691
70190
  state.camera.updateProjectionMatrix();
70692
70191
  state.skysphere.geometry = new three.SphereGeometry(state.skyRadius);
@@ -71118,10 +70617,7 @@
71118
70617
  var controls = state.renderObjs.controls();
71119
70618
  controls.minDistance = globeR * 1.01; // just above the surface
71120
70619
 
71121
- setTimeout(function () {
71122
- return controls.maxDistance = globeR * 100;
71123
- }); // apply async after renderObjs sets maxDistance
71124
-
70620
+ controls.maxDistance = globeR * 100;
71125
70621
  controls.enablePan = false;
71126
70622
  controls.enableDamping = true;
71127
70623
  controls.dampingFactor = 0.1;