globe.gl 2.26.2 → 2.26.3

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,40 +1,10 @@
1
- // Version 2.26.2 globe.gl - https://github.com/vasturiano/globe.gl
1
+ // Version 2.26.3 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) :
5
5
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Globe = factory());
6
6
  })(this, (function () { 'use strict';
7
7
 
8
- function styleInject$1(css, ref) {
9
- if ( ref === void 0 ) ref = {};
10
- var insertAt = ref.insertAt;
11
-
12
- if (!css || typeof document === 'undefined') { return; }
13
-
14
- var head = document.head || document.getElementsByTagName('head')[0];
15
- var style = document.createElement('style');
16
- style.type = 'text/css';
17
-
18
- if (insertAt === 'top') {
19
- if (head.firstChild) {
20
- head.insertBefore(style, head.firstChild);
21
- } else {
22
- head.appendChild(style);
23
- }
24
- } else {
25
- head.appendChild(style);
26
- }
27
-
28
- if (style.styleSheet) {
29
- style.styleSheet.cssText = css;
30
- } else {
31
- style.appendChild(document.createTextNode(css));
32
- }
33
- }
34
-
35
- var css_248z$1 = ".scene-container .clickable {\n cursor: pointer;\n}";
36
- styleInject$1(css_248z$1);
37
-
38
8
  function ownKeys$2(object, enumerableOnly) {
39
9
  var keys = Object.keys(object);
40
10
 
@@ -150,7 +120,7 @@
150
120
  * Copyright 2010-2022 Three.js Authors
151
121
  * SPDX-License-Identifier: MIT
152
122
  */
153
- const REVISION = '141';
123
+ const REVISION = '143';
154
124
  const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
155
125
  const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
156
126
  const CullFaceNone = 0;
@@ -372,13 +342,7 @@
372
342
 
373
343
  }
374
344
 
375
- const _lut = [];
376
-
377
- for ( let i = 0; i < 256; i ++ ) {
378
-
379
- _lut[ i ] = ( i < 16 ? '0' : '' ) + ( i ).toString( 16 );
380
-
381
- }
345
+ 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
346
 
383
347
  let _seed = 1234567;
384
348
 
@@ -703,7 +667,7 @@
703
667
 
704
668
  constructor( x = 0, y = 0 ) {
705
669
 
706
- this.isVector2 = true;
670
+ Vector2.prototype.isVector2 = true;
707
671
 
708
672
  this.x = x;
709
673
  this.y = y;
@@ -809,14 +773,7 @@
809
773
 
810
774
  }
811
775
 
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
- }
776
+ add( v ) {
820
777
 
821
778
  this.x += v.x;
822
779
  this.y += v.y;
@@ -852,14 +809,7 @@
852
809
 
853
810
  }
854
811
 
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
- }
812
+ sub( v ) {
863
813
 
864
814
  this.x -= v.x;
865
815
  this.y -= v.y;
@@ -1135,13 +1085,7 @@
1135
1085
 
1136
1086
  }
1137
1087
 
1138
- fromBufferAttribute( attribute, index, offset ) {
1139
-
1140
- if ( offset !== undefined ) {
1141
-
1142
- console.warn( 'THREE.Vector2: offset has been removed from .fromBufferAttribute().' );
1143
-
1144
- }
1088
+ fromBufferAttribute( attribute, index ) {
1145
1089
 
1146
1090
  this.x = attribute.getX( index );
1147
1091
  this.y = attribute.getY( index );
@@ -1186,7 +1130,7 @@
1186
1130
 
1187
1131
  constructor() {
1188
1132
 
1189
- this.isMatrix3 = true;
1133
+ Matrix3.prototype.isMatrix3 = true;
1190
1134
 
1191
1135
  this.elements = [
1192
1136
 
@@ -1196,12 +1140,6 @@
1196
1140
 
1197
1141
  ];
1198
1142
 
1199
- if ( arguments.length > 0 ) {
1200
-
1201
- console.error( 'THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.' );
1202
-
1203
- }
1204
-
1205
1143
  }
1206
1144
 
1207
1145
  set( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {
@@ -2450,7 +2388,7 @@
2450
2388
  // images of DataTexture
2451
2389
 
2452
2390
  return {
2453
- data: Array.prototype.slice.call( image.data ),
2391
+ data: Array.from( image.data ),
2454
2392
  width: image.width,
2455
2393
  height: image.height,
2456
2394
  type: image.data.constructor.name
@@ -2761,7 +2699,7 @@
2761
2699
 
2762
2700
  constructor( x = 0, y = 0, z = 0, w = 1 ) {
2763
2701
 
2764
- this.isVector4 = true;
2702
+ Vector4.prototype.isVector4 = true;
2765
2703
 
2766
2704
  this.x = x;
2767
2705
  this.y = y;
@@ -2895,14 +2833,7 @@
2895
2833
 
2896
2834
  }
2897
2835
 
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
- }
2836
+ add( v ) {
2906
2837
 
2907
2838
  this.x += v.x;
2908
2839
  this.y += v.y;
@@ -2946,14 +2877,7 @@
2946
2877
 
2947
2878
  }
2948
2879
 
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
- }
2880
+ sub( v ) {
2957
2881
 
2958
2882
  this.x -= v.x;
2959
2883
  this.y -= v.y;
@@ -3381,13 +3305,7 @@
3381
3305
 
3382
3306
  }
3383
3307
 
3384
- fromBufferAttribute( attribute, index, offset ) {
3385
-
3386
- if ( offset !== undefined ) {
3387
-
3388
- console.warn( 'THREE.Vector4: offset has been removed from .fromBufferAttribute().' );
3389
-
3390
- }
3308
+ fromBufferAttribute( attribute, index ) {
3391
3309
 
3392
3310
  this.x = attribute.getX( index );
3393
3311
  this.y = attribute.getY( index );
@@ -3590,13 +3508,6 @@
3590
3508
 
3591
3509
  }
3592
3510
 
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
3511
  static slerpFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) {
3601
3512
 
3602
3513
  // fuzz-free, array-based Quaternion SLERP operation
@@ -4074,14 +3985,7 @@
4074
3985
 
4075
3986
  }
4076
3987
 
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
- }
3988
+ multiply( q ) {
4085
3989
 
4086
3990
  return this.multiplyQuaternions( this, q );
4087
3991
 
@@ -4276,7 +4180,7 @@
4276
4180
 
4277
4181
  constructor( x = 0, y = 0, z = 0 ) {
4278
4182
 
4279
- this.isVector3 = true;
4183
+ Vector3.prototype.isVector3 = true;
4280
4184
 
4281
4185
  this.x = x;
4282
4186
  this.y = y;
@@ -4374,14 +4278,7 @@
4374
4278
 
4375
4279
  }
4376
4280
 
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
- }
4281
+ add( v ) {
4385
4282
 
4386
4283
  this.x += v.x;
4387
4284
  this.y += v.y;
@@ -4421,14 +4318,7 @@
4421
4318
 
4422
4319
  }
4423
4320
 
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
- }
4321
+ sub( v ) {
4432
4322
 
4433
4323
  this.x -= v.x;
4434
4324
  this.y -= v.y;
@@ -4458,14 +4348,7 @@
4458
4348
 
4459
4349
  }
4460
4350
 
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
- }
4351
+ multiply( v ) {
4469
4352
 
4470
4353
  this.x *= v.x;
4471
4354
  this.y *= v.y;
@@ -4497,12 +4380,6 @@
4497
4380
 
4498
4381
  applyEuler( euler ) {
4499
4382
 
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
4383
  return this.applyQuaternion( _quaternion$4.setFromEuler( euler ) );
4507
4384
 
4508
4385
  }
@@ -4771,14 +4648,7 @@
4771
4648
 
4772
4649
  }
4773
4650
 
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
- }
4651
+ cross( v ) {
4782
4652
 
4783
4653
  return this.crossVectors( this, v );
4784
4654
 
@@ -4968,13 +4838,7 @@
4968
4838
 
4969
4839
  }
4970
4840
 
4971
- fromBufferAttribute( attribute, index, offset ) {
4972
-
4973
- if ( offset !== undefined ) {
4974
-
4975
- console.warn( 'THREE.Vector3: offset has been removed from .fromBufferAttribute().' );
4976
-
4977
- }
4841
+ fromBufferAttribute( attribute, index ) {
4978
4842
 
4979
4843
  this.x = attribute.getX( index );
4980
4844
  this.y = attribute.getY( index );
@@ -6273,7 +6137,7 @@
6273
6137
 
6274
6138
  constructor() {
6275
6139
 
6276
- this.isMatrix4 = true;
6140
+ Matrix4.prototype.isMatrix4 = true;
6277
6141
 
6278
6142
  this.elements = [
6279
6143
 
@@ -6284,12 +6148,6 @@
6284
6148
 
6285
6149
  ];
6286
6150
 
6287
- if ( arguments.length > 0 ) {
6288
-
6289
- console.error( 'THREE.Matrix4: the constructor no longer reads arguments. use .set() instead.' );
6290
-
6291
- }
6292
-
6293
6151
  }
6294
6152
 
6295
6153
  set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {
@@ -6429,12 +6287,6 @@
6429
6287
 
6430
6288
  makeRotationFromEuler( euler ) {
6431
6289
 
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
6290
  const te = this.elements;
6439
6291
 
6440
6292
  const x = euler.x, y = euler.y, z = euler.z;
@@ -6608,14 +6460,7 @@
6608
6460
 
6609
6461
  }
6610
6462
 
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
- }
6463
+ multiply( m ) {
6619
6464
 
6620
6465
  return this.multiplyMatrices( this, m );
6621
6466
 
@@ -7042,12 +6887,6 @@
7042
6887
 
7043
6888
  makePerspective( left, right, top, bottom, near, far ) {
7044
6889
 
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
6890
  const te = this.elements;
7052
6891
  const x = 2 * near / ( right - left );
7053
6892
  const y = 2 * near / ( top - bottom );
@@ -8242,7 +8081,7 @@
8242
8081
 
8243
8082
  }
8244
8083
 
8245
- if ( this.environment && this.environment.isTexture ) {
8084
+ if ( this.environment && this.environment.isTexture && this.environment.isRenderTargetTexture !== true ) {
8246
8085
 
8247
8086
  object.environment = this.environment.toJSON( meta ).uuid;
8248
8087
 
@@ -8442,7 +8281,7 @@
8442
8281
 
8443
8282
  }
8444
8283
 
8445
- Object3D.DefaultUp = new Vector3( 0, 1, 0 );
8284
+ Object3D.DefaultUp = /*@__PURE__*/ new Vector3( 0, 1, 0 );
8446
8285
  Object3D.DefaultMatrixAutoUpdate = true;
8447
8286
 
8448
8287
  const _v0$1 = /*@__PURE__*/ new Vector3();
@@ -9236,31 +9075,8 @@
9236
9075
 
9237
9076
  }
9238
9077
 
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
9078
  }
9255
9079
 
9256
- Material.fromType = function ( /*type*/ ) {
9257
-
9258
- // TODO: Behavior added in Materials.js
9259
-
9260
- return null;
9261
-
9262
- };
9263
-
9264
9080
  class MeshBasicMaterial extends Material {
9265
9081
 
9266
9082
  constructor( parameters ) {
@@ -9720,7 +9536,7 @@
9720
9536
  const data = {
9721
9537
  itemSize: this.itemSize,
9722
9538
  type: this.array.constructor.name,
9723
- array: Array.prototype.slice.call( this.array ),
9539
+ array: Array.from( this.array ),
9724
9540
  normalized: this.normalized
9725
9541
  };
9726
9542
 
@@ -11493,6 +11309,20 @@
11493
11309
 
11494
11310
  }
11495
11311
 
11312
+ function cloneUniformsGroups( src ) {
11313
+
11314
+ const dst = [];
11315
+
11316
+ for ( let u = 0; u < src.length; u ++ ) {
11317
+
11318
+ dst.push( src[ u ].clone() );
11319
+
11320
+ }
11321
+
11322
+ return dst;
11323
+
11324
+ }
11325
+
11496
11326
  // Legacy
11497
11327
 
11498
11328
  const UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms };
@@ -11513,6 +11343,7 @@
11513
11343
 
11514
11344
  this.defines = {};
11515
11345
  this.uniforms = {};
11346
+ this.uniformsGroups = [];
11516
11347
 
11517
11348
  this.vertexShader = default_vertex;
11518
11349
  this.fragmentShader = default_fragment;
@@ -11568,6 +11399,7 @@
11568
11399
  this.vertexShader = source.vertexShader;
11569
11400
 
11570
11401
  this.uniforms = cloneUniforms( source.uniforms );
11402
+ this.uniformsGroups = cloneUniformsGroups( source.uniformsGroups );
11571
11403
 
11572
11404
  this.defines = Object.assign( {}, source.defines );
11573
11405
 
@@ -12851,6 +12683,7 @@
12851
12683
  constructor( width = 1, height = 1, widthSegments = 1, heightSegments = 1 ) {
12852
12684
 
12853
12685
  super();
12686
+
12854
12687
  this.type = 'PlaneGeometry';
12855
12688
 
12856
12689
  this.parameters = {
@@ -12945,11 +12778,11 @@
12945
12778
 
12946
12779
  var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif";
12947
12780
 
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";
12781
+ 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
12782
 
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";
12783
+ 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
12784
 
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";
12785
+ 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
12786
 
12954
12787
  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
12788
 
@@ -12967,7 +12800,7 @@
12967
12800
 
12968
12801
  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
12802
 
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}";
12803
+ 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
12804
 
12972
12805
  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
12806
 
@@ -13027,7 +12860,7 @@
13027
12860
 
13028
12861
  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
12862
 
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";
12863
+ 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
12864
 
13032
12865
  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
12866
 
@@ -13071,7 +12904,7 @@
13071
12904
 
13072
12905
  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
12906
 
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";
12907
+ 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
12908
 
13076
12909
  var clearcoat_normal_fragment_begin = "#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif";
13077
12910
 
@@ -13352,12 +13185,12 @@
13352
13185
 
13353
13186
  common: {
13354
13187
 
13355
- diffuse: { value: new Color$1( 0xffffff ) },
13188
+ diffuse: { value: /*@__PURE__*/ new Color$1( 0xffffff ) },
13356
13189
  opacity: { value: 1.0 },
13357
13190
 
13358
13191
  map: { value: null },
13359
- uvTransform: { value: new Matrix3() },
13360
- uv2Transform: { value: new Matrix3() },
13192
+ uvTransform: { value: /*@__PURE__*/ new Matrix3() },
13193
+ uv2Transform: { value: /*@__PURE__*/ new Matrix3() },
13361
13194
 
13362
13195
  alphaMap: { value: null },
13363
13196
  alphaTest: { value: 0 }
@@ -13410,7 +13243,7 @@
13410
13243
  normalmap: {
13411
13244
 
13412
13245
  normalMap: { value: null },
13413
- normalScale: { value: new Vector2( 1, 1 ) }
13246
+ normalScale: { value: /*@__PURE__*/ new Vector2( 1, 1 ) }
13414
13247
 
13415
13248
  },
13416
13249
 
@@ -13445,7 +13278,7 @@
13445
13278
  fogDensity: { value: 0.00025 },
13446
13279
  fogNear: { value: 1 },
13447
13280
  fogFar: { value: 2000 },
13448
- fogColor: { value: new Color$1( 0xffffff ) }
13281
+ fogColor: { value: /*@__PURE__*/ new Color$1( 0xffffff ) }
13449
13282
 
13450
13283
  },
13451
13284
 
@@ -13530,27 +13363,27 @@
13530
13363
 
13531
13364
  points: {
13532
13365
 
13533
- diffuse: { value: new Color$1( 0xffffff ) },
13366
+ diffuse: { value: /*@__PURE__*/ new Color$1( 0xffffff ) },
13534
13367
  opacity: { value: 1.0 },
13535
13368
  size: { value: 1.0 },
13536
13369
  scale: { value: 1.0 },
13537
13370
  map: { value: null },
13538
13371
  alphaMap: { value: null },
13539
13372
  alphaTest: { value: 0 },
13540
- uvTransform: { value: new Matrix3() }
13373
+ uvTransform: { value: /*@__PURE__*/ new Matrix3() }
13541
13374
 
13542
13375
  },
13543
13376
 
13544
13377
  sprite: {
13545
13378
 
13546
- diffuse: { value: new Color$1( 0xffffff ) },
13379
+ diffuse: { value: /*@__PURE__*/ new Color$1( 0xffffff ) },
13547
13380
  opacity: { value: 1.0 },
13548
- center: { value: new Vector2( 0.5, 0.5 ) },
13381
+ center: { value: /*@__PURE__*/ new Vector2( 0.5, 0.5 ) },
13549
13382
  rotation: { value: 0.0 },
13550
13383
  map: { value: null },
13551
13384
  alphaMap: { value: null },
13552
13385
  alphaTest: { value: 0 },
13553
- uvTransform: { value: new Matrix3() }
13386
+ uvTransform: { value: /*@__PURE__*/ new Matrix3() }
13554
13387
 
13555
13388
  }
13556
13389
 
@@ -13560,7 +13393,7 @@
13560
13393
 
13561
13394
  basic: {
13562
13395
 
13563
- uniforms: mergeUniforms( [
13396
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13564
13397
  UniformsLib.common,
13565
13398
  UniformsLib.specularmap,
13566
13399
  UniformsLib.envmap,
@@ -13576,7 +13409,7 @@
13576
13409
 
13577
13410
  lambert: {
13578
13411
 
13579
- uniforms: mergeUniforms( [
13412
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13580
13413
  UniformsLib.common,
13581
13414
  UniformsLib.specularmap,
13582
13415
  UniformsLib.envmap,
@@ -13586,7 +13419,7 @@
13586
13419
  UniformsLib.fog,
13587
13420
  UniformsLib.lights,
13588
13421
  {
13589
- emissive: { value: new Color$1( 0x000000 ) }
13422
+ emissive: { value: /*@__PURE__*/ new Color$1( 0x000000 ) }
13590
13423
  }
13591
13424
  ] ),
13592
13425
 
@@ -13597,7 +13430,7 @@
13597
13430
 
13598
13431
  phong: {
13599
13432
 
13600
- uniforms: mergeUniforms( [
13433
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13601
13434
  UniformsLib.common,
13602
13435
  UniformsLib.specularmap,
13603
13436
  UniformsLib.envmap,
@@ -13610,8 +13443,8 @@
13610
13443
  UniformsLib.fog,
13611
13444
  UniformsLib.lights,
13612
13445
  {
13613
- emissive: { value: new Color$1( 0x000000 ) },
13614
- specular: { value: new Color$1( 0x111111 ) },
13446
+ emissive: { value: /*@__PURE__*/ new Color$1( 0x000000 ) },
13447
+ specular: { value: /*@__PURE__*/ new Color$1( 0x111111 ) },
13615
13448
  shininess: { value: 30 }
13616
13449
  }
13617
13450
  ] ),
@@ -13623,7 +13456,7 @@
13623
13456
 
13624
13457
  standard: {
13625
13458
 
13626
- uniforms: mergeUniforms( [
13459
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13627
13460
  UniformsLib.common,
13628
13461
  UniformsLib.envmap,
13629
13462
  UniformsLib.aomap,
@@ -13637,7 +13470,7 @@
13637
13470
  UniformsLib.fog,
13638
13471
  UniformsLib.lights,
13639
13472
  {
13640
- emissive: { value: new Color$1( 0x000000 ) },
13473
+ emissive: { value: /*@__PURE__*/ new Color$1( 0x000000 ) },
13641
13474
  roughness: { value: 1.0 },
13642
13475
  metalness: { value: 0.0 },
13643
13476
  envMapIntensity: { value: 1 } // temporary
@@ -13651,7 +13484,7 @@
13651
13484
 
13652
13485
  toon: {
13653
13486
 
13654
- uniforms: mergeUniforms( [
13487
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13655
13488
  UniformsLib.common,
13656
13489
  UniformsLib.aomap,
13657
13490
  UniformsLib.lightmap,
@@ -13663,7 +13496,7 @@
13663
13496
  UniformsLib.fog,
13664
13497
  UniformsLib.lights,
13665
13498
  {
13666
- emissive: { value: new Color$1( 0x000000 ) }
13499
+ emissive: { value: /*@__PURE__*/ new Color$1( 0x000000 ) }
13667
13500
  }
13668
13501
  ] ),
13669
13502
 
@@ -13674,7 +13507,7 @@
13674
13507
 
13675
13508
  matcap: {
13676
13509
 
13677
- uniforms: mergeUniforms( [
13510
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13678
13511
  UniformsLib.common,
13679
13512
  UniformsLib.bumpmap,
13680
13513
  UniformsLib.normalmap,
@@ -13692,7 +13525,7 @@
13692
13525
 
13693
13526
  points: {
13694
13527
 
13695
- uniforms: mergeUniforms( [
13528
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13696
13529
  UniformsLib.points,
13697
13530
  UniformsLib.fog
13698
13531
  ] ),
@@ -13704,7 +13537,7 @@
13704
13537
 
13705
13538
  dashed: {
13706
13539
 
13707
- uniforms: mergeUniforms( [
13540
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13708
13541
  UniformsLib.common,
13709
13542
  UniformsLib.fog,
13710
13543
  {
@@ -13721,7 +13554,7 @@
13721
13554
 
13722
13555
  depth: {
13723
13556
 
13724
- uniforms: mergeUniforms( [
13557
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13725
13558
  UniformsLib.common,
13726
13559
  UniformsLib.displacementmap
13727
13560
  ] ),
@@ -13733,7 +13566,7 @@
13733
13566
 
13734
13567
  normal: {
13735
13568
 
13736
- uniforms: mergeUniforms( [
13569
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13737
13570
  UniformsLib.common,
13738
13571
  UniformsLib.bumpmap,
13739
13572
  UniformsLib.normalmap,
@@ -13750,7 +13583,7 @@
13750
13583
 
13751
13584
  sprite: {
13752
13585
 
13753
- uniforms: mergeUniforms( [
13586
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13754
13587
  UniformsLib.sprite,
13755
13588
  UniformsLib.fog
13756
13589
  ] ),
@@ -13763,7 +13596,7 @@
13763
13596
  background: {
13764
13597
 
13765
13598
  uniforms: {
13766
- uvTransform: { value: new Matrix3() },
13599
+ uvTransform: { value: /*@__PURE__*/ new Matrix3() },
13767
13600
  t2D: { value: null },
13768
13601
  },
13769
13602
 
@@ -13771,13 +13604,10 @@
13771
13604
  fragmentShader: ShaderChunk.background_frag
13772
13605
 
13773
13606
  },
13774
- /* -------------------------------------------------------------------------
13775
- // Cube map shader
13776
- ------------------------------------------------------------------------- */
13777
13607
 
13778
13608
  cube: {
13779
13609
 
13780
- uniforms: mergeUniforms( [
13610
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13781
13611
  UniformsLib.envmap,
13782
13612
  {
13783
13613
  opacity: { value: 1.0 }
@@ -13802,11 +13632,11 @@
13802
13632
 
13803
13633
  distanceRGBA: {
13804
13634
 
13805
- uniforms: mergeUniforms( [
13635
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13806
13636
  UniformsLib.common,
13807
13637
  UniformsLib.displacementmap,
13808
13638
  {
13809
- referencePosition: { value: new Vector3() },
13639
+ referencePosition: { value: /*@__PURE__*/ new Vector3() },
13810
13640
  nearDistance: { value: 1 },
13811
13641
  farDistance: { value: 1000 }
13812
13642
  }
@@ -13819,11 +13649,11 @@
13819
13649
 
13820
13650
  shadow: {
13821
13651
 
13822
- uniforms: mergeUniforms( [
13652
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13823
13653
  UniformsLib.lights,
13824
13654
  UniformsLib.fog,
13825
13655
  {
13826
- color: { value: new Color$1( 0x00000 ) },
13656
+ color: { value: /*@__PURE__*/ new Color$1( 0x00000 ) },
13827
13657
  opacity: { value: 1.0 }
13828
13658
  },
13829
13659
  ] ),
@@ -13837,14 +13667,14 @@
13837
13667
 
13838
13668
  ShaderLib.physical = {
13839
13669
 
13840
- uniforms: mergeUniforms( [
13670
+ uniforms: /*@__PURE__*/ mergeUniforms( [
13841
13671
  ShaderLib.standard.uniforms,
13842
13672
  {
13843
13673
  clearcoat: { value: 0 },
13844
13674
  clearcoatMap: { value: null },
13845
13675
  clearcoatRoughness: { value: 0 },
13846
13676
  clearcoatRoughnessMap: { value: null },
13847
- clearcoatNormalScale: { value: new Vector2( 1, 1 ) },
13677
+ clearcoatNormalScale: { value: /*@__PURE__*/ new Vector2( 1, 1 ) },
13848
13678
  clearcoatNormalMap: { value: null },
13849
13679
  iridescence: { value: 0 },
13850
13680
  iridescenceMap: { value: null },
@@ -13853,21 +13683,21 @@
13853
13683
  iridescenceThicknessMaximum: { value: 400 },
13854
13684
  iridescenceThicknessMap: { value: null },
13855
13685
  sheen: { value: 0 },
13856
- sheenColor: { value: new Color$1( 0x000000 ) },
13686
+ sheenColor: { value: /*@__PURE__*/ new Color$1( 0x000000 ) },
13857
13687
  sheenColorMap: { value: null },
13858
13688
  sheenRoughness: { value: 1 },
13859
13689
  sheenRoughnessMap: { value: null },
13860
13690
  transmission: { value: 0 },
13861
13691
  transmissionMap: { value: null },
13862
- transmissionSamplerSize: { value: new Vector2() },
13692
+ transmissionSamplerSize: { value: /*@__PURE__*/ new Vector2() },
13863
13693
  transmissionSamplerMap: { value: null },
13864
13694
  thickness: { value: 0 },
13865
13695
  thicknessMap: { value: null },
13866
13696
  attenuationDistance: { value: 0 },
13867
- attenuationColor: { value: new Color$1( 0x000000 ) },
13697
+ attenuationColor: { value: /*@__PURE__*/ new Color$1( 0x000000 ) },
13868
13698
  specularIntensity: { value: 1 },
13869
13699
  specularIntensityMap: { value: null },
13870
- specularColor: { value: new Color$1( 1, 1, 1 ) },
13700
+ specularColor: { value: /*@__PURE__*/ new Color$1( 1, 1, 1 ) },
13871
13701
  specularColorMap: { value: null },
13872
13702
  }
13873
13703
  ] ),
@@ -16724,6 +16554,8 @@
16724
16554
  const array = attribute.isInterleavedBufferAttribute ? attribute.data.array : attribute.array;
16725
16555
 
16726
16556
  if ( array instanceof Int8Array ) denominator = 127;
16557
+ else if ( array instanceof Uint8Array ) denominator = 255;
16558
+ else if ( array instanceof Uint16Array ) denominator = 65535;
16727
16559
  else if ( array instanceof Int16Array ) denominator = 32767;
16728
16560
  else if ( array instanceof Int32Array ) denominator = 2147483647;
16729
16561
  else console.error( 'THREE.WebGLMorphtargets: Unsupported morph attribute data type: ', array );
@@ -17132,10 +16964,10 @@
17132
16964
  *
17133
16965
  */
17134
16966
 
17135
- const emptyTexture = new Texture();
17136
- const emptyArrayTexture = new DataArrayTexture();
17137
- const empty3dTexture = new Data3DTexture();
17138
- const emptyCubeTexture = new CubeTexture();
16967
+ const emptyTexture = /*@__PURE__*/ new Texture();
16968
+ const emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();
16969
+ const empty3dTexture = /*@__PURE__*/ new Data3DTexture();
16970
+ const emptyCubeTexture = /*@__PURE__*/ new CubeTexture();
17139
16971
 
17140
16972
  // --- Utilities ---
17141
16973
 
@@ -20545,7 +20377,7 @@
20545
20377
 
20546
20378
  let renderStates = new WeakMap();
20547
20379
 
20548
- function get( scene, renderCallDepth ) {
20380
+ function get( scene, renderCallDepth = 0 ) {
20549
20381
 
20550
20382
  let renderState;
20551
20383
 
@@ -20807,20 +20639,9 @@
20807
20639
 
20808
20640
  }
20809
20641
 
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
20642
  if ( shadow.map === null ) {
20822
20643
 
20823
- const pars = { minFilter: NearestFilter, magFilter: NearestFilter, format: RGBAFormat };
20644
+ const pars = ( this.type !== VSMShadowMap ) ? { minFilter: NearestFilter, magFilter: NearestFilter } : {};
20824
20645
 
20825
20646
  shadow.map = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y, pars );
20826
20647
  shadow.map.texture.name = light.name + '.shadowMap';
@@ -20857,7 +20678,7 @@
20857
20678
 
20858
20679
  // do blur pass for VSM
20859
20680
 
20860
- if ( ! shadow.isPointLightShadow && this.type === VSMShadowMap ) {
20681
+ if ( shadow.isPointLightShadow !== true && this.type === VSMShadowMap ) {
20861
20682
 
20862
20683
  VSMPass( shadow, camera );
20863
20684
 
@@ -20887,6 +20708,12 @@
20887
20708
 
20888
20709
  }
20889
20710
 
20711
+ if ( shadow.mapPass === null ) {
20712
+
20713
+ shadow.mapPass = new WebGLRenderTarget( _shadowMapSize.x, _shadowMapSize.y );
20714
+
20715
+ }
20716
+
20890
20717
  // vertical pass
20891
20718
 
20892
20719
  shadowMaterialVertical.uniforms.shadow_pass.value = shadow.map.texture;
@@ -20923,7 +20750,7 @@
20923
20750
 
20924
20751
  }
20925
20752
 
20926
- if ( ( _renderer.localClippingEnabled && material.clipShadows === true && material.clippingPlanes.length !== 0 ) ||
20753
+ if ( ( _renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) ||
20927
20754
  ( material.displacementMap && material.displacementScale !== 0 ) ||
20928
20755
  ( material.alphaMap && material.alphaTest > 0 ) ) {
20929
20756
 
@@ -21364,6 +21191,9 @@
21364
21191
  const depthBuffer = new DepthBuffer();
21365
21192
  const stencilBuffer = new StencilBuffer();
21366
21193
 
21194
+ const uboBindings = new WeakMap();
21195
+ const uboProgamMap = new WeakMap();
21196
+
21367
21197
  let enabledCapabilities = {};
21368
21198
 
21369
21199
  let currentBoundFramebuffers = {};
@@ -22114,6 +21944,47 @@
22114
21944
 
22115
21945
  }
22116
21946
 
21947
+ function updateUBOMapping( uniformsGroup, program ) {
21948
+
21949
+ let mapping = uboProgamMap.get( program );
21950
+
21951
+ if ( mapping === undefined ) {
21952
+
21953
+ mapping = new WeakMap();
21954
+
21955
+ uboProgamMap.set( program, mapping );
21956
+
21957
+ }
21958
+
21959
+ let blockIndex = mapping.get( uniformsGroup );
21960
+
21961
+ if ( blockIndex === undefined ) {
21962
+
21963
+ blockIndex = gl.getUniformBlockIndex( program, uniformsGroup.name );
21964
+
21965
+ mapping.set( uniformsGroup, blockIndex );
21966
+
21967
+ }
21968
+
21969
+ }
21970
+
21971
+ function uniformBlockBinding( uniformsGroup, program ) {
21972
+
21973
+ const mapping = uboProgamMap.get( program );
21974
+ const blockIndex = mapping.get( uniformsGroup );
21975
+
21976
+ if ( uboBindings.get( uniformsGroup ) !== blockIndex ) {
21977
+
21978
+ // bind shader specific block index to global block point
21979
+
21980
+ gl.uniformBlockBinding( program, blockIndex, uniformsGroup.__bindingPointIndex );
21981
+
21982
+ uboBindings.set( uniformsGroup, blockIndex );
21983
+
21984
+ }
21985
+
21986
+ }
21987
+
22117
21988
  //
22118
21989
 
22119
21990
  function reset() {
@@ -22241,6 +22112,9 @@
22241
22112
  texImage2D: texImage2D,
22242
22113
  texImage3D: texImage3D,
22243
22114
 
22115
+ updateUBOMapping: updateUBOMapping,
22116
+ uniformBlockBinding: uniformBlockBinding,
22117
+
22244
22118
  texStorage2D: texStorage2D,
22245
22119
  texStorage3D: texStorage3D,
22246
22120
  texSubImage2D: texSubImage2D,
@@ -24196,7 +24070,7 @@
24196
24070
 
24197
24071
  const isWebGL2 = capabilities.isWebGL2;
24198
24072
 
24199
- function convert( p, encoding ) {
24073
+ function convert( p, encoding = null ) {
24200
24074
 
24201
24075
  let extension;
24202
24076
 
@@ -24607,43 +24481,6 @@
24607
24481
 
24608
24482
  if ( inputSource && frame.session.visibilityState !== 'visible-blurred' ) {
24609
24483
 
24610
- if ( targetRay !== null ) {
24611
-
24612
- inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
24613
-
24614
- if ( inputPose !== null ) {
24615
-
24616
- targetRay.matrix.fromArray( inputPose.transform.matrix );
24617
- targetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );
24618
-
24619
- if ( inputPose.linearVelocity ) {
24620
-
24621
- targetRay.hasLinearVelocity = true;
24622
- targetRay.linearVelocity.copy( inputPose.linearVelocity );
24623
-
24624
- } else {
24625
-
24626
- targetRay.hasLinearVelocity = false;
24627
-
24628
- }
24629
-
24630
- if ( inputPose.angularVelocity ) {
24631
-
24632
- targetRay.hasAngularVelocity = true;
24633
- targetRay.angularVelocity.copy( inputPose.angularVelocity );
24634
-
24635
- } else {
24636
-
24637
- targetRay.hasAngularVelocity = false;
24638
-
24639
- }
24640
-
24641
- this.dispatchEvent( _moveEvent );
24642
-
24643
- }
24644
-
24645
- }
24646
-
24647
24484
  if ( hand && inputSource.hand ) {
24648
24485
 
24649
24486
  handPose = true;
@@ -24748,6 +24585,51 @@
24748
24585
 
24749
24586
  }
24750
24587
 
24588
+ if ( targetRay !== null ) {
24589
+
24590
+ inputPose = frame.getPose( inputSource.targetRaySpace, referenceSpace );
24591
+
24592
+ // Some runtimes (namely Vive Cosmos with Vive OpenXR Runtime) have only grip space and ray space is equal to it
24593
+ if ( inputPose === null && gripPose !== null ) {
24594
+
24595
+ inputPose = gripPose;
24596
+
24597
+ }
24598
+
24599
+ if ( inputPose !== null ) {
24600
+
24601
+ targetRay.matrix.fromArray( inputPose.transform.matrix );
24602
+ targetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );
24603
+
24604
+ if ( inputPose.linearVelocity ) {
24605
+
24606
+ targetRay.hasLinearVelocity = true;
24607
+ targetRay.linearVelocity.copy( inputPose.linearVelocity );
24608
+
24609
+ } else {
24610
+
24611
+ targetRay.hasLinearVelocity = false;
24612
+
24613
+ }
24614
+
24615
+ if ( inputPose.angularVelocity ) {
24616
+
24617
+ targetRay.hasAngularVelocity = true;
24618
+ targetRay.angularVelocity.copy( inputPose.angularVelocity );
24619
+
24620
+ } else {
24621
+
24622
+ targetRay.hasAngularVelocity = false;
24623
+
24624
+ }
24625
+
24626
+ this.dispatchEvent( _moveEvent );
24627
+
24628
+ }
24629
+
24630
+ }
24631
+
24632
+
24751
24633
  }
24752
24634
 
24753
24635
  if ( targetRay !== null ) {
@@ -24831,7 +24713,7 @@
24831
24713
  let newRenderTarget = null;
24832
24714
 
24833
24715
  const controllers = [];
24834
- const inputSourcesMap = new Map();
24716
+ const controllerInputSources = [];
24835
24717
 
24836
24718
  //
24837
24719
 
@@ -24908,7 +24790,15 @@
24908
24790
 
24909
24791
  function onSessionEvent( event ) {
24910
24792
 
24911
- const controller = inputSourcesMap.get( event.inputSource );
24793
+ const controllerIndex = controllerInputSources.indexOf( event.inputSource );
24794
+
24795
+ if ( controllerIndex === - 1 ) {
24796
+
24797
+ return;
24798
+
24799
+ }
24800
+
24801
+ const controller = controllers[ controllerIndex ];
24912
24802
 
24913
24803
  if ( controller !== undefined ) {
24914
24804
 
@@ -24929,17 +24819,17 @@
24929
24819
  session.removeEventListener( 'end', onSessionEnd );
24930
24820
  session.removeEventListener( 'inputsourceschange', onInputSourcesChange );
24931
24821
 
24932
- inputSourcesMap.forEach( function ( controller, inputSource ) {
24822
+ for ( let i = 0; i < controllers.length; i ++ ) {
24933
24823
 
24934
- if ( controller !== undefined ) {
24824
+ const inputSource = controllerInputSources[ i ];
24935
24825
 
24936
- controller.disconnect( inputSource );
24826
+ if ( inputSource === null ) continue;
24937
24827
 
24938
- }
24828
+ controllerInputSources[ i ] = null;
24939
24829
 
24940
- } );
24830
+ controllers[ i ].disconnect( inputSource );
24941
24831
 
24942
- inputSourcesMap.clear();
24832
+ }
24943
24833
 
24944
24834
  _currentDepthNear = null;
24945
24835
  _currentDepthFar = null;
@@ -25086,7 +24976,7 @@
25086
24976
  }
25087
24977
 
25088
24978
  const projectionlayerInit = {
25089
- colorFormat: ( renderer.outputEncoding === sRGBEncoding ) ? 35907 : 32856,
24979
+ colorFormat: 32856,
25090
24980
  depthFormat: glDepthFormat,
25091
24981
  scaleFactor: framebufferScaleFactor
25092
24982
  };
@@ -25135,28 +25025,17 @@
25135
25025
 
25136
25026
  function onInputSourcesChange( event ) {
25137
25027
 
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
25028
  // Notify disconnected
25150
25029
 
25151
25030
  for ( let i = 0; i < event.removed.length; i ++ ) {
25152
25031
 
25153
25032
  const inputSource = event.removed[ i ];
25154
- const controller = inputSourcesMap.get( inputSource );
25033
+ const index = controllerInputSources.indexOf( inputSource );
25155
25034
 
25156
- if ( controller ) {
25035
+ if ( index >= 0 ) {
25157
25036
 
25158
- controller.dispatchEvent( { type: 'disconnected', data: inputSource } );
25159
- inputSourcesMap.delete( inputSource );
25037
+ controllerInputSources[ index ] = null;
25038
+ controllers[ index ].dispatchEvent( { type: 'disconnected', data: inputSource } );
25160
25039
 
25161
25040
  }
25162
25041
 
@@ -25167,7 +25046,38 @@
25167
25046
  for ( let i = 0; i < event.added.length; i ++ ) {
25168
25047
 
25169
25048
  const inputSource = event.added[ i ];
25170
- const controller = inputSourcesMap.get( inputSource );
25049
+
25050
+ let controllerIndex = controllerInputSources.indexOf( inputSource );
25051
+
25052
+ if ( controllerIndex === - 1 ) {
25053
+
25054
+ // Assign input source a controller that currently has no input source
25055
+
25056
+ for ( let i = 0; i < controllers.length; i ++ ) {
25057
+
25058
+ if ( i >= controllerInputSources.length ) {
25059
+
25060
+ controllerInputSources.push( inputSource );
25061
+ controllerIndex = i;
25062
+ break;
25063
+
25064
+ } else if ( controllerInputSources[ i ] === null ) {
25065
+
25066
+ controllerInputSources[ i ] = inputSource;
25067
+ controllerIndex = i;
25068
+ break;
25069
+
25070
+ }
25071
+
25072
+ }
25073
+
25074
+ // If all controllers do currently receive input we ignore new ones
25075
+
25076
+ if ( controllerIndex === - 1 ) break;
25077
+
25078
+ }
25079
+
25080
+ const controller = controllers[ controllerIndex ];
25171
25081
 
25172
25082
  if ( controller ) {
25173
25083
 
@@ -25457,14 +25367,12 @@
25457
25367
 
25458
25368
  //
25459
25369
 
25460
- const inputSources = session.inputSources;
25461
-
25462
25370
  for ( let i = 0; i < controllers.length; i ++ ) {
25463
25371
 
25464
- const inputSource = inputSources[ i ];
25465
- const controller = inputSourcesMap.get( inputSource );
25372
+ const inputSource = controllerInputSources[ i ];
25373
+ const controller = controllers[ i ];
25466
25374
 
25467
- if ( controller !== undefined ) {
25375
+ if ( inputSource !== null && controller !== undefined ) {
25468
25376
 
25469
25377
  controller.update( inputSource, frame, customReferenceSpace || referenceSpace );
25470
25378
 
@@ -26168,6 +26076,376 @@
26168
26076
 
26169
26077
  }
26170
26078
 
26079
+ function WebGLUniformsGroups( gl, info, capabilities, state ) {
26080
+
26081
+ let buffers = {};
26082
+ let updateList = {};
26083
+ let allocatedBindingPoints = [];
26084
+
26085
+ const maxBindingPoints = ( capabilities.isWebGL2 ) ? gl.getParameter( 35375 ) : 0; // binding points are global whereas block indices are per shader program
26086
+
26087
+ function bind( uniformsGroup, program ) {
26088
+
26089
+ const webglProgram = program.program;
26090
+ state.uniformBlockBinding( uniformsGroup, webglProgram );
26091
+
26092
+ }
26093
+
26094
+ function update( uniformsGroup, program ) {
26095
+
26096
+ let buffer = buffers[ uniformsGroup.id ];
26097
+
26098
+ if ( buffer === undefined ) {
26099
+
26100
+ prepareUniformsGroup( uniformsGroup );
26101
+
26102
+ buffer = createBuffer( uniformsGroup );
26103
+ buffers[ uniformsGroup.id ] = buffer;
26104
+
26105
+ uniformsGroup.addEventListener( 'dispose', onUniformsGroupsDispose );
26106
+
26107
+ }
26108
+
26109
+ // ensure to update the binding points/block indices mapping for this program
26110
+
26111
+ const webglProgram = program.program;
26112
+ state.updateUBOMapping( uniformsGroup, webglProgram );
26113
+
26114
+ // update UBO once per frame
26115
+
26116
+ const frame = info.render.frame;
26117
+
26118
+ if ( updateList[ uniformsGroup.id ] !== frame ) {
26119
+
26120
+ updateBufferData( uniformsGroup );
26121
+
26122
+ updateList[ uniformsGroup.id ] = frame;
26123
+
26124
+ }
26125
+
26126
+ }
26127
+
26128
+ function createBuffer( uniformsGroup ) {
26129
+
26130
+ // the setup of an UBO is independent of a particular shader program but global
26131
+
26132
+ const bindingPointIndex = allocateBindingPointIndex();
26133
+ uniformsGroup.__bindingPointIndex = bindingPointIndex;
26134
+
26135
+ const buffer = gl.createBuffer();
26136
+ const size = uniformsGroup.__size;
26137
+ const usage = uniformsGroup.usage;
26138
+
26139
+ gl.bindBuffer( 35345, buffer );
26140
+ gl.bufferData( 35345, size, usage );
26141
+ gl.bindBuffer( 35345, null );
26142
+ gl.bindBufferBase( 35345, bindingPointIndex, buffer );
26143
+
26144
+ return buffer;
26145
+
26146
+ }
26147
+
26148
+ function allocateBindingPointIndex() {
26149
+
26150
+ for ( let i = 0; i < maxBindingPoints; i ++ ) {
26151
+
26152
+ if ( allocatedBindingPoints.indexOf( i ) === - 1 ) {
26153
+
26154
+ allocatedBindingPoints.push( i );
26155
+ return i;
26156
+
26157
+ }
26158
+
26159
+ }
26160
+
26161
+ console.error( 'THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.' );
26162
+
26163
+ return 0;
26164
+
26165
+ }
26166
+
26167
+ function updateBufferData( uniformsGroup ) {
26168
+
26169
+ const buffer = buffers[ uniformsGroup.id ];
26170
+ const uniforms = uniformsGroup.uniforms;
26171
+ const cache = uniformsGroup.__cache;
26172
+
26173
+ gl.bindBuffer( 35345, buffer );
26174
+
26175
+ for ( let i = 0, il = uniforms.length; i < il; i ++ ) {
26176
+
26177
+ const uniform = uniforms[ i ];
26178
+
26179
+ // partly update the buffer if necessary
26180
+
26181
+ if ( hasUniformChanged( uniform, i, cache ) === true ) {
26182
+
26183
+ const value = uniform.value;
26184
+ const offset = uniform.__offset;
26185
+
26186
+ if ( typeof value === 'number' ) {
26187
+
26188
+ uniform.__data[ 0 ] = value;
26189
+ gl.bufferSubData( 35345, offset, uniform.__data );
26190
+
26191
+ } else {
26192
+
26193
+ if ( uniform.value.isMatrix3 ) {
26194
+
26195
+ // manually converting 3x3 to 3x4
26196
+
26197
+ uniform.__data[ 0 ] = uniform.value.elements[ 0 ];
26198
+ uniform.__data[ 1 ] = uniform.value.elements[ 1 ];
26199
+ uniform.__data[ 2 ] = uniform.value.elements[ 2 ];
26200
+ uniform.__data[ 3 ] = uniform.value.elements[ 0 ];
26201
+ uniform.__data[ 4 ] = uniform.value.elements[ 3 ];
26202
+ uniform.__data[ 5 ] = uniform.value.elements[ 4 ];
26203
+ uniform.__data[ 6 ] = uniform.value.elements[ 5 ];
26204
+ uniform.__data[ 7 ] = uniform.value.elements[ 0 ];
26205
+ uniform.__data[ 8 ] = uniform.value.elements[ 6 ];
26206
+ uniform.__data[ 9 ] = uniform.value.elements[ 7 ];
26207
+ uniform.__data[ 10 ] = uniform.value.elements[ 8 ];
26208
+ uniform.__data[ 11 ] = uniform.value.elements[ 0 ];
26209
+
26210
+ } else {
26211
+
26212
+ value.toArray( uniform.__data );
26213
+
26214
+ }
26215
+
26216
+ gl.bufferSubData( 35345, offset, uniform.__data );
26217
+
26218
+ }
26219
+
26220
+ }
26221
+
26222
+ }
26223
+
26224
+ gl.bindBuffer( 35345, null );
26225
+
26226
+ }
26227
+
26228
+ function hasUniformChanged( uniform, index, cache ) {
26229
+
26230
+ const value = uniform.value;
26231
+
26232
+ if ( cache[ index ] === undefined ) {
26233
+
26234
+ // cache entry does not exist so far
26235
+
26236
+ if ( typeof value === 'number' ) {
26237
+
26238
+ cache[ index ] = value;
26239
+
26240
+ } else {
26241
+
26242
+ cache[ index ] = value.clone();
26243
+
26244
+ }
26245
+
26246
+ return true;
26247
+
26248
+ } else {
26249
+
26250
+ // compare current value with cached entry
26251
+
26252
+ if ( typeof value === 'number' ) {
26253
+
26254
+ if ( cache[ index ] !== value ) {
26255
+
26256
+ cache[ index ] = value;
26257
+ return true;
26258
+
26259
+ }
26260
+
26261
+ } else {
26262
+
26263
+ const cachedObject = cache[ index ];
26264
+
26265
+ if ( cachedObject.equals( value ) === false ) {
26266
+
26267
+ cachedObject.copy( value );
26268
+ return true;
26269
+
26270
+ }
26271
+
26272
+ }
26273
+
26274
+ }
26275
+
26276
+ return false;
26277
+
26278
+ }
26279
+
26280
+ function prepareUniformsGroup( uniformsGroup ) {
26281
+
26282
+ // determine total buffer size according to the STD140 layout
26283
+ // Hint: STD140 is the only supported layout in WebGL 2
26284
+
26285
+ const uniforms = uniformsGroup.uniforms;
26286
+
26287
+ let offset = 0; // global buffer offset in bytes
26288
+ const chunkSize = 16; // size of a chunk in bytes
26289
+ let chunkOffset = 0; // offset within a single chunk in bytes
26290
+
26291
+ for ( let i = 0, l = uniforms.length; i < l; i ++ ) {
26292
+
26293
+ const uniform = uniforms[ i ];
26294
+ const info = getUniformSize( uniform );
26295
+
26296
+ // the following two properties will be used for partial buffer updates
26297
+
26298
+ uniform.__data = new Float32Array( info.storage / Float32Array.BYTES_PER_ELEMENT );
26299
+ uniform.__offset = offset;
26300
+
26301
+ //
26302
+
26303
+ if ( i > 0 ) {
26304
+
26305
+ chunkOffset = offset % chunkSize;
26306
+
26307
+ const remainingSizeInChunk = chunkSize - chunkOffset;
26308
+
26309
+ // check for chunk overflow
26310
+
26311
+ if ( chunkOffset !== 0 && ( remainingSizeInChunk - info.boundary ) < 0 ) {
26312
+
26313
+ // add padding and adjust offset
26314
+
26315
+ offset += ( chunkSize - chunkOffset );
26316
+ uniform.__offset = offset;
26317
+
26318
+ }
26319
+
26320
+ }
26321
+
26322
+ offset += info.storage;
26323
+
26324
+ }
26325
+
26326
+ // ensure correct final padding
26327
+
26328
+ chunkOffset = offset % chunkSize;
26329
+
26330
+ if ( chunkOffset > 0 ) offset += ( chunkSize - chunkOffset );
26331
+
26332
+ //
26333
+
26334
+ uniformsGroup.__size = offset;
26335
+ uniformsGroup.__cache = {};
26336
+
26337
+ return this;
26338
+
26339
+ }
26340
+
26341
+ function getUniformSize( uniform ) {
26342
+
26343
+ const value = uniform.value;
26344
+
26345
+ const info = {
26346
+ boundary: 0, // bytes
26347
+ storage: 0 // bytes
26348
+ };
26349
+
26350
+ // determine sizes according to STD140
26351
+
26352
+ if ( typeof value === 'number' ) {
26353
+
26354
+ // float/int
26355
+
26356
+ info.boundary = 4;
26357
+ info.storage = 4;
26358
+
26359
+ } else if ( value.isVector2 ) {
26360
+
26361
+ // vec2
26362
+
26363
+ info.boundary = 8;
26364
+ info.storage = 8;
26365
+
26366
+ } else if ( value.isVector3 || value.isColor ) {
26367
+
26368
+ // vec3
26369
+
26370
+ info.boundary = 16;
26371
+ info.storage = 12; // evil: vec3 must start on a 16-byte boundary but it only consumes 12 bytes
26372
+
26373
+ } else if ( value.isVector4 ) {
26374
+
26375
+ // vec4
26376
+
26377
+ info.boundary = 16;
26378
+ info.storage = 16;
26379
+
26380
+ } else if ( value.isMatrix3 ) {
26381
+
26382
+ // mat3 (in STD140 a 3x3 matrix is represented as 3x4)
26383
+
26384
+ info.boundary = 48;
26385
+ info.storage = 48;
26386
+
26387
+ } else if ( value.isMatrix4 ) {
26388
+
26389
+ // mat4
26390
+
26391
+ info.boundary = 64;
26392
+ info.storage = 64;
26393
+
26394
+ } else if ( value.isTexture ) {
26395
+
26396
+ console.warn( 'THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.' );
26397
+
26398
+ } else {
26399
+
26400
+ console.warn( 'THREE.WebGLRenderer: Unsupported uniform value type.', value );
26401
+
26402
+ }
26403
+
26404
+ return info;
26405
+
26406
+ }
26407
+
26408
+ function onUniformsGroupsDispose( event ) {
26409
+
26410
+ const uniformsGroup = event.target;
26411
+
26412
+ uniformsGroup.removeEventListener( 'dispose', onUniformsGroupsDispose );
26413
+
26414
+ const index = allocatedBindingPoints.indexOf( uniformsGroup.__bindingPointIndex );
26415
+ allocatedBindingPoints.splice( index, 1 );
26416
+
26417
+ gl.deleteBuffer( buffers[ uniformsGroup.id ] );
26418
+
26419
+ delete buffers[ uniformsGroup.id ];
26420
+ delete updateList[ uniformsGroup.id ];
26421
+
26422
+ }
26423
+
26424
+ function dispose() {
26425
+
26426
+ for ( const id in buffers ) {
26427
+
26428
+ gl.deleteBuffer( buffers[ id ] );
26429
+
26430
+ }
26431
+
26432
+ allocatedBindingPoints = [];
26433
+ buffers = {};
26434
+ updateList = {};
26435
+
26436
+ }
26437
+
26438
+ return {
26439
+
26440
+ bind: bind,
26441
+ update: update,
26442
+
26443
+ dispose: dispose
26444
+
26445
+ };
26446
+
26447
+ }
26448
+
26171
26449
  function createCanvasElement() {
26172
26450
 
26173
26451
  const canvas = createElementNS( 'canvas' );
@@ -26429,7 +26707,7 @@
26429
26707
 
26430
26708
  let background, morphtargets, bufferRenderer, indexedBufferRenderer;
26431
26709
 
26432
- let utils, bindingStates;
26710
+ let utils, bindingStates, uniformsGroups;
26433
26711
 
26434
26712
  function initGLContext() {
26435
26713
 
@@ -26443,7 +26721,7 @@
26443
26721
 
26444
26722
  state = new WebGLState( _gl, extensions, capabilities );
26445
26723
 
26446
- info = new WebGLInfo( _gl );
26724
+ info = new WebGLInfo();
26447
26725
  properties = new WebGLProperties();
26448
26726
  textures = new WebGLTextures( _gl, extensions, state, properties, capabilities, utils, info );
26449
26727
  cubemaps = new WebGLCubeMaps( _this );
@@ -26460,6 +26738,7 @@
26460
26738
  renderStates = new WebGLRenderStates( extensions, capabilities );
26461
26739
  background = new WebGLBackground( _this, cubemaps, state, objects, _alpha, _premultipliedAlpha );
26462
26740
  shadowMap = new WebGLShadowMap( _this, objects, capabilities );
26741
+ uniformsGroups = new WebGLUniformsGroups( _gl, info, capabilities, state );
26463
26742
 
26464
26743
  bufferRenderer = new WebGLBufferRenderer( _gl, extensions, info, capabilities );
26465
26744
  indexedBufferRenderer = new WebGLIndexedBufferRenderer( _gl, extensions, info, capabilities );
@@ -26725,6 +27004,7 @@
26725
27004
  cubeuvmaps.dispose();
26726
27005
  objects.dispose();
26727
27006
  bindingStates.dispose();
27007
+ uniformsGroups.dispose();
26728
27008
  programCache.dispose();
26729
27009
 
26730
27010
  xr.dispose();
@@ -27905,6 +28185,31 @@
27905
28185
  p_uniforms.setValue( _gl, 'normalMatrix', object.normalMatrix );
27906
28186
  p_uniforms.setValue( _gl, 'modelMatrix', object.matrixWorld );
27907
28187
 
28188
+ // UBOs
28189
+
28190
+ if ( material.isShaderMaterial || material.isRawShaderMaterial ) {
28191
+
28192
+ const groups = material.uniformsGroups;
28193
+
28194
+ for ( let i = 0, l = groups.length; i < l; i ++ ) {
28195
+
28196
+ if ( capabilities.isWebGL2 ) {
28197
+
28198
+ const group = groups[ i ];
28199
+
28200
+ uniformsGroups.update( group, program );
28201
+ uniformsGroups.bind( group, program );
28202
+
28203
+ } else {
28204
+
28205
+ console.warn( 'THREE.WebGLRenderer: Uniform Buffer Objects can only be used with WebGL 2.' );
28206
+
28207
+ }
28208
+
28209
+ }
28210
+
28211
+ }
28212
+
27908
28213
  return program;
27909
28214
 
27910
28215
  }
@@ -28298,7 +28603,23 @@
28298
28603
 
28299
28604
  this.initTexture = function ( texture ) {
28300
28605
 
28301
- textures.setTexture2D( texture, 0 );
28606
+ if ( texture.isCubeTexture ) {
28607
+
28608
+ textures.setTextureCube( texture, 0 );
28609
+
28610
+ } else if ( texture.isData3DTexture ) {
28611
+
28612
+ textures.setTexture3D( texture, 0 );
28613
+
28614
+ } else if ( texture.isDataArrayTexture ) {
28615
+
28616
+ textures.setTexture2DArray( texture, 0 );
28617
+
28618
+ } else {
28619
+
28620
+ textures.setTexture2D( texture, 0 );
28621
+
28622
+ }
28302
28623
 
28303
28624
  state.unbindTexture();
28304
28625
 
@@ -28506,7 +28827,7 @@
28506
28827
 
28507
28828
  if ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {
28508
28829
 
28509
- data.arrayBuffers[ this.array.buffer._uuid ] = Array.prototype.slice.call( new Uint32Array( this.array.buffer ) );
28830
+ data.arrayBuffers[ this.array.buffer._uuid ] = Array.from( new Uint32Array( this.array.buffer ) );
28510
28831
 
28511
28832
  }
28512
28833
 
@@ -28703,7 +29024,7 @@
28703
29024
 
28704
29025
  if ( data === undefined ) {
28705
29026
 
28706
- console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interlaved buffer attribute will deinterleave buffer data.' );
29027
+ console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will deinterleave buffer data.' );
28707
29028
 
28708
29029
  const array = [];
28709
29030
 
@@ -28745,7 +29066,7 @@
28745
29066
 
28746
29067
  if ( data === undefined ) {
28747
29068
 
28748
- console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interlaved buffer attribute will deinterleave buffer data.' );
29069
+ console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will deinterleave buffer data.' );
28749
29070
 
28750
29071
  const array = [];
28751
29072
 
@@ -28772,7 +29093,7 @@
28772
29093
 
28773
29094
  } else {
28774
29095
 
28775
- // save as true interlaved attribtue
29096
+ // save as true interleaved attribtue
28776
29097
 
28777
29098
  if ( data.interleavedBuffers === undefined ) {
28778
29099
 
@@ -28800,31 +29121,25 @@
28800
29121
 
28801
29122
  }
28802
29123
 
28803
- class SpriteMaterial extends Material {
29124
+ class InstancedBufferAttribute extends BufferAttribute {
28804
29125
 
28805
- constructor( parameters ) {
29126
+ constructor( array, itemSize, normalized, meshPerAttribute = 1 ) {
28806
29127
 
28807
- super();
29128
+ if ( typeof normalized === 'number' ) {
28808
29129
 
28809
- this.isSpriteMaterial = true;
29130
+ meshPerAttribute = normalized;
28810
29131
 
28811
- this.type = 'SpriteMaterial';
29132
+ normalized = false;
28812
29133
 
28813
- this.color = new Color$1( 0xffffff );
29134
+ console.error( 'THREE.InstancedBufferAttribute: The constructor now expects normalized as the third argument.' );
28814
29135
 
28815
- this.map = null;
28816
-
28817
- this.alphaMap = null;
28818
-
28819
- this.rotation = 0;
29136
+ }
28820
29137
 
28821
- this.sizeAttenuation = true;
29138
+ super( array, itemSize, normalized );
28822
29139
 
28823
- this.transparent = true;
29140
+ this.isInstancedBufferAttribute = true;
28824
29141
 
28825
- this.fog = true;
28826
-
28827
- this.setValues( parameters );
29142
+ this.meshPerAttribute = meshPerAttribute;
28828
29143
 
28829
29144
  }
28830
29145
 
@@ -28832,19 +29147,21 @@
28832
29147
 
28833
29148
  super.copy( source );
28834
29149
 
28835
- this.color.copy( source.color );
29150
+ this.meshPerAttribute = source.meshPerAttribute;
28836
29151
 
28837
- this.map = source.map;
29152
+ return this;
28838
29153
 
28839
- this.alphaMap = source.alphaMap;
29154
+ }
28840
29155
 
28841
- this.rotation = source.rotation;
29156
+ toJSON() {
28842
29157
 
28843
- this.sizeAttenuation = source.sizeAttenuation;
29158
+ const data = super.toJSON();
28844
29159
 
28845
- this.fog = source.fog;
29160
+ data.meshPerAttribute = this.meshPerAttribute;
28846
29161
 
28847
- return this;
29162
+ data.isInstancedBufferAttribute = true;
29163
+
29164
+ return data;
28848
29165
 
28849
29166
  }
28850
29167
 
@@ -29153,52 +29470,6 @@
29153
29470
 
29154
29471
  }
29155
29472
 
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
29473
  /**
29203
29474
  * Extensible curve object.
29204
29475
  *
@@ -29851,8 +30122,10 @@
29851
30122
 
29852
30123
  //
29853
30124
 
29854
- const tmp = new Vector3();
29855
- const px = new CubicPoly(), py = new CubicPoly(), pz = new CubicPoly();
30125
+ const tmp = /*@__PURE__*/ new Vector3();
30126
+ const px = /*@__PURE__*/ new CubicPoly();
30127
+ const py = /*@__PURE__*/ new CubicPoly();
30128
+ const pz = /*@__PURE__*/ new CubicPoly();
29856
30129
 
29857
30130
  class CatmullRomCurve3 extends Curve {
29858
30131
 
@@ -30902,6 +31175,7 @@
30902
31175
  constructor( points ) {
30903
31176
 
30904
31177
  super();
31178
+
30905
31179
  this.type = 'Path';
30906
31180
 
30907
31181
  this.currentPoint = new Vector2();
@@ -31171,6 +31445,7 @@
31171
31445
  constructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {
31172
31446
 
31173
31447
  super();
31448
+
31174
31449
  this.type = 'CylinderGeometry';
31175
31450
 
31176
31451
  this.parameters = {
@@ -31434,11 +31709,6 @@
31434
31709
 
31435
31710
  }
31436
31711
 
31437
- new Vector3();
31438
- new Vector3();
31439
- new Vector3();
31440
- new Triangle();
31441
-
31442
31712
  class Shape extends Path$1 {
31443
31713
 
31444
31714
  constructor( points ) {
@@ -32479,7 +32749,7 @@
32479
32749
 
32480
32750
  const curveSegments = options.curveSegments !== undefined ? options.curveSegments : 12;
32481
32751
  const steps = options.steps !== undefined ? options.steps : 1;
32482
- let depth = options.depth !== undefined ? options.depth : 1;
32752
+ const depth = options.depth !== undefined ? options.depth : 1;
32483
32753
 
32484
32754
  let bevelEnabled = options.bevelEnabled !== undefined ? options.bevelEnabled : true;
32485
32755
  let bevelThickness = options.bevelThickness !== undefined ? options.bevelThickness : 0.2;
@@ -32491,15 +32761,6 @@
32491
32761
 
32492
32762
  const uvgen = options.UVGenerator !== undefined ? options.UVGenerator : WorldUVGenerator;
32493
32763
 
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
32764
  //
32504
32765
 
32505
32766
  let extrudePts, extrudeByPath = false;
@@ -33221,6 +33482,7 @@
33221
33482
  constructor( radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI ) {
33222
33483
 
33223
33484
  super();
33485
+
33224
33486
  this.type = 'SphereGeometry';
33225
33487
 
33226
33488
  this.parameters = {
@@ -33342,6 +33604,7 @@
33342
33604
  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
33605
 
33344
33606
  super();
33607
+
33345
33608
  this.type = 'TubeGeometry';
33346
33609
 
33347
33610
  this.parameters = {
@@ -33526,6 +33789,7 @@
33526
33789
  constructor( geometry = null ) {
33527
33790
 
33528
33791
  super();
33792
+
33529
33793
  this.type = 'WireframeGeometry';
33530
33794
 
33531
33795
  this.parameters = {
@@ -33651,363 +33915,6 @@
33651
33915
 
33652
33916
  }
33653
33917
 
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
33918
  class MeshPhongMaterial extends Material {
34012
33919
 
34013
33920
  constructor( parameters ) {
@@ -34098,176 +34005,24 @@
34098
34005
  this.displacementScale = source.displacementScale;
34099
34006
  this.displacementBias = source.displacementBias;
34100
34007
 
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
-
34008
+ this.specularMap = source.specularMap;
34009
+
34206
34010
  this.alphaMap = source.alphaMap;
34207
34011
 
34012
+ this.envMap = source.envMap;
34013
+ this.combine = source.combine;
34014
+ this.reflectivity = source.reflectivity;
34015
+ this.refractionRatio = source.refractionRatio;
34016
+
34208
34017
  this.wireframe = source.wireframe;
34209
34018
  this.wireframeLinewidth = source.wireframeLinewidth;
34210
34019
  this.wireframeLinecap = source.wireframeLinecap;
34211
34020
  this.wireframeLinejoin = source.wireframeLinejoin;
34212
34021
 
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
34022
  this.flatShading = source.flatShading;
34270
34023
 
34024
+ this.fog = source.fog;
34025
+
34271
34026
  return this;
34272
34027
 
34273
34028
  }
@@ -34358,140 +34113,6 @@
34358
34113
 
34359
34114
  }
34360
34115
 
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
34116
  const Cache = {
34496
34117
 
34497
34118
  enabled: false,
@@ -34671,7 +34292,7 @@
34671
34292
 
34672
34293
  }
34673
34294
 
34674
- const DefaultLoadingManager = new LoadingManager();
34295
+ const DefaultLoadingManager = /*@__PURE__*/ new LoadingManager();
34675
34296
 
34676
34297
  class Loader {
34677
34298
 
@@ -35235,30 +34856,6 @@
35235
34856
 
35236
34857
  }
35237
34858
 
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
34859
  class InstancedInterleavedBuffer extends InterleavedBuffer {
35263
34860
 
35264
34861
  constructor( array, stride, meshPerAttribute = 1 ) {
@@ -35891,120 +35488,6 @@
35891
35488
 
35892
35489
  }
35893
35490
 
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
35491
  if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
36009
35492
 
36010
35493
  __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
@@ -37363,10 +36846,10 @@
37363
36846
 
37364
36847
  // minX, minY and invSize are later used to transform coords into integers for z-order calculation
37365
36848
  invSize = Math.max(maxX - minX, maxY - minY);
37366
- invSize = invSize !== 0 ? 1 / invSize : 0;
36849
+ invSize = invSize !== 0 ? 32767 / invSize : 0;
37367
36850
  }
37368
36851
 
37369
- earcutLinked(outerNode, triangles, dim, minX, minY, invSize);
36852
+ earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);
37370
36853
 
37371
36854
  return triangles;
37372
36855
  }
@@ -37430,9 +36913,9 @@
37430
36913
 
37431
36914
  if (invSize ? isEarHashed(ear, minX, minY, invSize) : isEar(ear)) {
37432
36915
  // cut off the triangle
37433
- triangles.push(prev.i / dim);
37434
- triangles.push(ear.i / dim);
37435
- triangles.push(next.i / dim);
36916
+ triangles.push(prev.i / dim | 0);
36917
+ triangles.push(ear.i / dim | 0);
36918
+ triangles.push(next.i / dim | 0);
37436
36919
 
37437
36920
  removeNode(ear);
37438
36921
 
@@ -37475,10 +36958,18 @@
37475
36958
  if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
37476
36959
 
37477
36960
  // now make sure we don't have other points inside the potential ear
37478
- var p = ear.next.next;
36961
+ var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
37479
36962
 
37480
- while (p !== ear.prev) {
37481
- if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
36963
+ // triangle bbox; min & max are calculated like this for speed
36964
+ var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),
36965
+ y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),
36966
+ x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),
36967
+ y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);
36968
+
36969
+ var p = c.next;
36970
+ while (p !== a) {
36971
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&
36972
+ pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) &&
37482
36973
  area(p.prev, p, p.next) >= 0) return false;
37483
36974
  p = p.next;
37484
36975
  }
@@ -37493,45 +36984,43 @@
37493
36984
 
37494
36985
  if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
37495
36986
 
36987
+ var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
36988
+
37496
36989
  // 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);
36990
+ var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),
36991
+ y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),
36992
+ x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),
36993
+ y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);
37501
36994
 
37502
36995
  // 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);
36996
+ var minZ = zOrder(x0, y0, minX, minY, invSize),
36997
+ maxZ = zOrder(x1, y1, minX, minY, invSize);
37505
36998
 
37506
36999
  var p = ear.prevZ,
37507
37000
  n = ear.nextZ;
37508
37001
 
37509
37002
  // look for points inside the triangle in both directions
37510
37003
  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;
37004
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&
37005
+ pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
37514
37006
  p = p.prevZ;
37515
37007
 
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;
37008
+ if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&
37009
+ pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;
37519
37010
  n = n.nextZ;
37520
37011
  }
37521
37012
 
37522
37013
  // look for remaining points in decreasing z-order
37523
37014
  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;
37015
+ if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&
37016
+ pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
37527
37017
  p = p.prevZ;
37528
37018
  }
37529
37019
 
37530
37020
  // look for remaining points in increasing z-order
37531
37021
  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;
37022
+ if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&
37023
+ pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;
37535
37024
  n = n.nextZ;
37536
37025
  }
37537
37026
 
@@ -37547,9 +37036,9 @@
37547
37036
 
37548
37037
  if (!equals(a, b) && intersects(a, p, p.next, b) && locallyInside(a, b) && locallyInside(b, a)) {
37549
37038
 
37550
- triangles.push(a.i / dim);
37551
- triangles.push(p.i / dim);
37552
- triangles.push(b.i / dim);
37039
+ triangles.push(a.i / dim | 0);
37040
+ triangles.push(p.i / dim | 0);
37041
+ triangles.push(b.i / dim | 0);
37553
37042
 
37554
37043
  // remove two nodes involved
37555
37044
  removeNode(p);
@@ -37579,8 +37068,8 @@
37579
37068
  c = filterPoints(c, c.next);
37580
37069
 
37581
37070
  // run earcut on each half
37582
- earcutLinked(a, triangles, dim, minX, minY, invSize);
37583
- earcutLinked(c, triangles, dim, minX, minY, invSize);
37071
+ earcutLinked(a, triangles, dim, minX, minY, invSize, 0);
37072
+ earcutLinked(c, triangles, dim, minX, minY, invSize, 0);
37584
37073
  return;
37585
37074
  }
37586
37075
  b = b.next;
@@ -37607,7 +37096,6 @@
37607
37096
  // process holes from left to right
37608
37097
  for (i = 0; i < queue.length; i++) {
37609
37098
  outerNode = eliminateHole(queue[i], outerNode);
37610
- outerNode = filterPoints(outerNode, outerNode.next);
37611
37099
  }
37612
37100
 
37613
37101
  return outerNode;
@@ -37627,11 +37115,8 @@
37627
37115
  var bridgeReverse = splitPolygon(bridge, hole);
37628
37116
 
37629
37117
  // filter collinear points around the cuts
37630
- var filteredBridge = filterPoints(bridge, bridge.next);
37631
37118
  filterPoints(bridgeReverse, bridgeReverse.next);
37632
-
37633
- // Check if input node was removed by the filtering
37634
- return outerNode === bridge ? filteredBridge : outerNode;
37119
+ return filterPoints(bridge, bridge.next);
37635
37120
  }
37636
37121
 
37637
37122
  // David Eberly's algorithm for finding a bridge between hole and outer polygon
@@ -37649,11 +37134,8 @@
37649
37134
  var x = p.x + (hy - p.y) * (p.next.x - p.x) / (p.next.y - p.y);
37650
37135
  if (x <= hx && x > qx) {
37651
37136
  qx = x;
37652
- if (x === hx) {
37653
- if (hy === p.y) return p;
37654
- if (hy === p.next.y) return p.next;
37655
- }
37656
37137
  m = p.x < p.next.x ? p : p.next;
37138
+ if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint
37657
37139
  }
37658
37140
  }
37659
37141
  p = p.next;
@@ -37661,8 +37143,6 @@
37661
37143
 
37662
37144
  if (!m) return null;
37663
37145
 
37664
- if (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint
37665
-
37666
37146
  // look for points inside the triangle of hole point, segment intersection and endpoint;
37667
37147
  // if there are no points found, we have a valid connection;
37668
37148
  // otherwise choose the point of the minimum angle with the ray as connection point
@@ -37703,7 +37183,7 @@
37703
37183
  function indexCurve(start, minX, minY, invSize) {
37704
37184
  var p = start;
37705
37185
  do {
37706
- if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);
37186
+ if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);
37707
37187
  p.prevZ = p.prev;
37708
37188
  p.nextZ = p.next;
37709
37189
  p = p.next;
@@ -37771,8 +37251,8 @@
37771
37251
  // z-order of a point given coords and inverse of the longer side of data bbox
37772
37252
  function zOrder(x, y, minX, minY, invSize) {
37773
37253
  // coords are transformed into non-negative 15-bit integer range
37774
- x = 32767 * (x - minX) * invSize;
37775
- y = 32767 * (y - minY) * invSize;
37254
+ x = (x - minX) * invSize | 0;
37255
+ y = (y - minY) * invSize | 0;
37776
37256
 
37777
37257
  x = (x | (x << 8)) & 0x00FF00FF;
37778
37258
  x = (x | (x << 4)) & 0x0F0F0F0F;
@@ -37801,9 +37281,9 @@
37801
37281
 
37802
37282
  // check if a point lies within a convex triangle
37803
37283
  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;
37284
+ return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&
37285
+ (ax - px) * (by - py) >= (bx - px) * (ay - py) &&
37286
+ (bx - px) * (cy - py) >= (cx - px) * (by - py);
37807
37287
  }
37808
37288
 
37809
37289
  // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
@@ -37946,7 +37426,7 @@
37946
37426
  this.next = null;
37947
37427
 
37948
37428
  // z-order curve value
37949
- this.z = null;
37429
+ this.z = 0;
37950
37430
 
37951
37431
  // previous and next nodes in z-order
37952
37432
  this.prevZ = null;
@@ -38054,7 +37534,7 @@
38054
37534
  return lo;
38055
37535
  }
38056
37536
 
38057
- function right(a, x, lo, hi) {
37537
+ function right(a, x, lo = 0, hi = a.length) {
38058
37538
  if (lo < hi) {
38059
37539
  if (compare1(x, x) !== 0) return hi;
38060
37540
  do {
@@ -38066,7 +37546,7 @@
38066
37546
  return lo;
38067
37547
  }
38068
37548
 
38069
- function center(a, x, lo, hi) {
37549
+ function center(a, x, lo = 0, hi = a.length) {
38070
37550
  const i = left(a, x, lo, hi - 1);
38071
37551
  return i > lo && delta(a[i - 1], x) > -delta(a[i], x) ? i - 1 : i;
38072
37552
  }
@@ -43319,7 +42799,7 @@
43319
42799
  }
43320
42800
 
43321
42801
  function _iterableToArrayLimit$4(arr, i) {
43322
- var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
42802
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
43323
42803
 
43324
42804
  if (_i == null) return;
43325
42805
  var _arr = [];
@@ -43502,14 +42982,9 @@
43502
42982
 
43503
42983
  if (Object.getOwnPropertySymbols) {
43504
42984
  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);
42985
+ enumerableOnly && (symbols = symbols.filter(function (sym) {
42986
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
42987
+ })), keys.push.apply(keys, symbols);
43513
42988
  }
43514
42989
 
43515
42990
  return keys;
@@ -43517,19 +42992,12 @@
43517
42992
 
43518
42993
  function _objectSpread2$1(target) {
43519
42994
  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
- }
42995
+ var source = null != arguments[i] ? arguments[i] : {};
42996
+ i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
42997
+ _defineProperty$2(target, key, source[key]);
42998
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
42999
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
43000
+ });
43533
43001
  }
43534
43002
 
43535
43003
  return target;
@@ -43607,7 +43075,7 @@
43607
43075
  }
43608
43076
 
43609
43077
  function _iterableToArrayLimit$3(arr, i) {
43610
- var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]);
43078
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
43611
43079
 
43612
43080
  if (_i == null) return;
43613
43081
  var _arr = [];
@@ -43661,6 +43129,8 @@
43661
43129
  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
43130
  }
43663
43131
 
43132
+ var _excluded$2 = ["createObj", "updateObj", "exitObj", "objBindAttr", "dataBindAttr"];
43133
+
43664
43134
  function diffArrays(prev, next, idAccessor) {
43665
43135
  var result = {
43666
43136
  enter: [],
@@ -43755,7 +43225,7 @@
43755
43225
  objBindAttr = _ref7$objBindAttr === void 0 ? '__obj' : _ref7$objBindAttr,
43756
43226
  _ref7$dataBindAttr = _ref7.dataBindAttr,
43757
43227
  dataBindAttr = _ref7$dataBindAttr === void 0 ? '__data' : _ref7$dataBindAttr,
43758
- dataDiffOptions = _objectWithoutProperties$1(_ref7, ["createObj", "updateObj", "exitObj", "objBindAttr", "dataBindAttr"]);
43228
+ dataDiffOptions = _objectWithoutProperties$1(_ref7, _excluded$2);
43759
43229
 
43760
43230
  var _dataBindDiff = dataBindDiff(data, existingObjs, _objectSpread2$1({
43761
43231
  objBindAttr: objBindAttr,
@@ -43805,13 +43275,13 @@
43805
43275
  }
43806
43276
  }
43807
43277
 
43808
- var FrameTicker$1 = {exports: {}};
43278
+ var FrameTicker$3 = {exports: {}};
43809
43279
 
43810
43280
  (function (module, exports) {
43811
43281
  !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));
43282
+ } (FrameTicker$3));
43813
43283
 
43814
- var FrameTicker = /*@__PURE__*/getDefaultExportFromCjs(FrameTicker$1.exports);
43284
+ var _FrameTicker = /*@__PURE__*/getDefaultExportFromCjs(FrameTicker$3.exports);
43815
43285
 
43816
43286
  function initRange(domain, range) {
43817
43287
  switch (arguments.length) {
@@ -46255,6 +45725,8 @@
46255
45725
 
46256
45726
  function defaultLocale(definition) {
46257
45727
  locale = formatLocale(definition);
45728
+ locale.format;
45729
+ locale.parse;
46258
45730
  utcFormat = locale.utcFormat;
46259
45731
  utcParse = locale.utcParse;
46260
45732
  return locale;
@@ -49049,8 +48521,6 @@
49049
48521
  }
49050
48522
  }
49051
48523
 
49052
- var arguments_ = [];
49053
-
49054
48524
  var ENVIRONMENT_IS_WEB = false;
49055
48525
  var ENVIRONMENT_IS_WORKER = false;
49056
48526
  var ENVIRONMENT_IS_NODE = false;
@@ -49107,7 +48577,7 @@
49107
48577
  process["argv"][1].replace(/\\/g, "/");
49108
48578
  }
49109
48579
 
49110
- arguments_ = process["argv"].slice(2);
48580
+ process["argv"].slice(2);
49111
48581
 
49112
48582
  Module["inspect"] = function () {
49113
48583
  return "[Emscripten Module object]";
@@ -49143,9 +48613,7 @@
49143
48613
  };
49144
48614
 
49145
48615
  if (typeof scriptArgs != "undefined") {
49146
- arguments_ = scriptArgs;
49147
- } else if (typeof arguments != "undefined") {
49148
- arguments_ = arguments;
48616
+ scriptArgs;
49149
48617
  }
49150
48618
 
49151
48619
  if (typeof print !== "undefined") {
@@ -49239,8 +48707,8 @@
49239
48707
  }
49240
48708
 
49241
48709
  moduleOverrides = null;
49242
- if (Module["arguments"]) { arguments_ = Module["arguments"]; }
49243
- if (Module["thisProgram"]) ;
48710
+ if (Module["arguments"]) { Module["arguments"]; }
48711
+ if (Module["thisProgram"]) { Module["thisProgram"]; }
49244
48712
 
49245
48713
  var tempRet0 = 0;
49246
48714
 
@@ -49927,7 +49395,6 @@
49927
49395
 
49928
49396
  function Z(a, b) {
49929
49397
  a = a | 0;
49930
- b = b | 0;
49931
49398
  S = a;
49932
49399
  }
49933
49400
 
@@ -61293,7 +60760,6 @@
61293
60760
  };
61294
60761
 
61295
60762
  function run(args) {
61296
- args = args || arguments_;
61297
60763
 
61298
60764
  if (runDependencies > 0) {
61299
60765
  return;
@@ -63000,7 +62466,7 @@
63000
62466
 
63001
62467
  for ( let p = 0, pl = paths.length; p < pl; p ++ ) {
63002
62468
 
63003
- Array.prototype.push.apply( shapes, paths[ p ].toShapes() );
62469
+ shapes.push( ...paths[ p ].toShapes() );
63004
62470
 
63005
62471
  }
63006
62472
 
@@ -63978,6 +63444,7 @@
63978
63444
  TubeBufferGeometry: TubeGeometry,
63979
63445
  Vector3: Vector3
63980
63446
  };
63447
+ var FrameTicker$2 = _FrameTicker["default"] || _FrameTicker;
63981
63448
  // support both modes for backwards threejs compatibility
63982
63449
 
63983
63450
  var setAttributeFn$1 = new THREE$c.BufferGeometry().setAttribute ? 'setAttribute' : 'addAttribute';
@@ -64068,7 +63535,7 @@
64068
63535
 
64069
63536
  state.scene = threeObj; // Kick-off dash animations
64070
63537
 
64071
- new FrameTicker().onTick.add(function (_, timeDelta) {
63538
+ new FrameTicker$2().onTick.add(function (_, timeDelta) {
64072
63539
  state.arcsData.filter(function (d) {
64073
63540
  return d.__threeObj && d.__threeObj.children.length && d.__threeObj.children[0].material && d.__threeObj.children[0].__dashAnimateStep;
64074
63541
  }).forEach(function (d) {
@@ -64874,89 +64341,89 @@
64874
64341
  obj.material.color.set(colorStr2Hex(color));
64875
64342
  obj.material.transparent = opacity < 1;
64876
64343
  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
64344
  var targetD = {
64914
64345
  alt: alt,
64915
64346
  margin: margin,
64916
64347
  curvatureResolution: curvatureResolution
64917
64348
  };
64349
+ var currentTargetD = obj.__currentTargetD || Object.assign({}, targetD, {
64350
+ alt: -1e-3
64351
+ });
64918
64352
 
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
- };
64353
+ if (Object.keys(targetD).some(function (k) {
64354
+ return currentTargetD[k] !== targetD[k];
64355
+ })) {
64356
+ var h3Idxs = [];
64931
64357
 
64932
- var _h$hexCenter = _slicedToArray$1(h.hexCenter, 2),
64933
- clat = _h$hexCenter[0],
64934
- clng = _h$hexCenter[1];
64358
+ if (geoJson.type === 'Polygon') {
64359
+ polyfill(geoJson.coordinates, h3Res, true).forEach(function (idx) {
64360
+ return h3Idxs.push(idx);
64361
+ });
64362
+ } else if (geoJson.type === 'MultiPolygon') {
64363
+ geoJson.coordinates.forEach(function (coords) {
64364
+ return polyfill(coords, h3Res, true).forEach(function (idx) {
64365
+ return h3Idxs.push(idx);
64366
+ });
64367
+ });
64368
+ } else {
64369
+ console.warn("Unsupported GeoJson geometry type: ".concat(geoJson.type, ". Skipping geometry..."));
64370
+ }
64935
64371
 
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];
64372
+ var hexBins = h3Idxs.map(function (h3Idx) {
64373
+ var hexCenter = h3ToGeo(h3Idx);
64374
+ var hexGeoJson = h3ToGeoBoundary(h3Idx, true).reverse(); // correct polygon winding
64375
+ // stitch longitudes at the anti-meridian
64940
64376
 
64941
- return [[elng, clng], [elat, clat]].map(function (_ref3) {
64942
- var _ref4 = _slicedToArray$1(_ref3, 2),
64943
- st = _ref4[0],
64944
- end = _ref4[1];
64377
+ var centerLng = hexCenter[1];
64378
+ hexGeoJson.forEach(function (d) {
64379
+ var edgeLng = d[0];
64945
64380
 
64946
- return relNum(st, end, margin);
64947
- });
64381
+ if (Math.abs(centerLng - edgeLng) > 170) {
64382
+ // normalize large lng distances
64383
+ d[0] += centerLng > edgeLng ? 360 : -360;
64384
+ }
64948
64385
  });
64949
- return new ConicPolygonBufferGeometry([geoJson], GLOBE_RADIUS, GLOBE_RADIUS * (1 + alt), false, true, false, curvatureResolution);
64950
- }));
64951
- };
64386
+ return {
64387
+ h3Idx: h3Idx,
64388
+ hexCenter: hexCenter,
64389
+ hexGeoJson: hexGeoJson
64390
+ };
64391
+ });
64952
64392
 
64953
- var currentTargetD = obj.__currentTargetD || Object.assign({}, targetD, {
64954
- alt: -1e-3
64955
- });
64393
+ var applyUpdate = function applyUpdate(td) {
64394
+ var _obj$__currentTargetD = obj.__currentTargetD = td,
64395
+ alt = _obj$__currentTargetD.alt,
64396
+ margin = _obj$__currentTargetD.margin,
64397
+ curvatureResolution = _obj$__currentTargetD.curvatureResolution;
64398
+
64399
+ obj.geometry && obj.geometry.dispose();
64400
+ obj.geometry = !hexBins.length ? new THREE$9.BufferGeometry() : BufferGeometryUtils.mergeBufferGeometries(hexBins.map(function (h) {
64401
+ // compute new geojson with relative margin
64402
+ var relNum = function relNum(st, end, rat) {
64403
+ return st - (st - end) * rat;
64404
+ };
64405
+
64406
+ var _h$hexCenter = _slicedToArray$1(h.hexCenter, 2),
64407
+ clat = _h$hexCenter[0],
64408
+ clng = _h$hexCenter[1];
64409
+
64410
+ var geoJson = margin === 0 ? h.hexGeoJson : h.hexGeoJson.map(function (_ref) {
64411
+ var _ref2 = _slicedToArray$1(_ref, 2),
64412
+ elng = _ref2[0],
64413
+ elat = _ref2[1];
64414
+
64415
+ return [[elng, clng], [elat, clat]].map(function (_ref3) {
64416
+ var _ref4 = _slicedToArray$1(_ref3, 2),
64417
+ st = _ref4[0],
64418
+ end = _ref4[1];
64419
+
64420
+ return relNum(st, end, margin);
64421
+ });
64422
+ });
64423
+ return new ConicPolygonBufferGeometry([geoJson], GLOBE_RADIUS, GLOBE_RADIUS * (1 + alt), false, true, false, curvatureResolution);
64424
+ }));
64425
+ };
64956
64426
 
64957
- if (Object.keys(targetD).some(function (k) {
64958
- return currentTargetD[k] !== targetD[k];
64959
- })) {
64960
64427
  if (!state.hexPolygonsTransitionDuration || state.hexPolygonsTransitionDuration < 0) {
64961
64428
  // set final position
64962
64429
  applyUpdate(targetD);
@@ -65016,6 +64483,7 @@
65016
64483
  ShaderMaterial: ShaderMaterial,
65017
64484
  Vector3: Vector3
65018
64485
  };
64486
+ var FrameTicker$1 = _FrameTicker["default"] || _FrameTicker;
65019
64487
  // support both modes for backwards threejs compatibility
65020
64488
 
65021
64489
  var setAttributeFn = new THREE$7.BufferGeometry().setAttribute ? 'setAttribute' : 'addAttribute';
@@ -65102,7 +64570,7 @@
65102
64570
 
65103
64571
  state.scene = threeObj; // Kick-off dash animations
65104
64572
 
65105
- new FrameTicker().onTick.add(function (_, timeDelta) {
64573
+ new FrameTicker$1().onTick.add(function (_, timeDelta) {
65106
64574
  state.pathsData.filter(function (d) {
65107
64575
  return d.__threeObj && d.__threeObj.children.length && d.__threeObj.children[0].material && d.__threeObj.children[0].__dashAnimateStep;
65108
64576
  }).forEach(function (d) {
@@ -65811,6 +65279,7 @@
65811
65279
  LineBasicMaterial: LineBasicMaterial,
65812
65280
  Vector3: Vector3
65813
65281
  };
65282
+ var FrameTicker = _FrameTicker["default"] || _FrameTicker;
65814
65283
  var RingsLayerKapsule = index$2({
65815
65284
  props: {
65816
65285
  ringsData: {
@@ -68186,8 +67655,6 @@
68186
67655
 
68187
67656
  function onMouseMove( event ) {
68188
67657
 
68189
- if ( scope.enabled === false ) return;
68190
-
68191
67658
  switch ( state ) {
68192
67659
 
68193
67660
  case STATE.ROTATE:
@@ -70564,8 +70031,10 @@
70564
70031
  state.pointerPos.y = ev.pageY - offset.top; // Move tooltip
70565
70032
 
70566
70033
  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
70034
+ state.toolTipElem.style.left = "".concat(state.pointerPos.x, "px"); // adjust horizontal position to not exceed canvas boundaries
70035
+
70036
+ state.toolTipElem.style.transform = "translate(-".concat(state.pointerPos.x / state.width * 100, "%, ").concat( // flip to above if near bottom
70037
+ state.height - state.pointerPos.y < 100 ? 'calc(-100% - 8px)' : '21px', ")");
70569
70038
  }
70570
70039
 
70571
70040
  function getOffset(el) {