react-globe.gl 2.22.7 → 2.22.9

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.
@@ -1,4 +1,4 @@
1
- // Version 2.22.7 react-globe.gl - https://github.com/vasturiano/react-globe.gl
1
+ // Version 2.22.9 react-globe.gl - https://github.com/vasturiano/react-globe.gl
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('react')) :
4
4
  typeof define === 'function' && define.amd ? define(['react'], factory) :
@@ -290,7 +290,7 @@
290
290
  * Copyright 2010-2022 Three.js Authors
291
291
  * SPDX-License-Identifier: MIT
292
292
  */
293
- const REVISION = '146';
293
+ const REVISION = '148';
294
294
  const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
295
295
  const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
296
296
  const CullFaceNone = 0;
@@ -302,6 +302,7 @@
302
302
  const FrontSide = 0;
303
303
  const BackSide = 1;
304
304
  const DoubleSide = 2;
305
+ const TwoPassDoubleSide = 3;
305
306
  const NoBlending = 0;
306
307
  const NormalBlending = 1;
307
308
  const AdditiveBlending = 2;
@@ -1528,12 +1529,11 @@
1528
1529
 
1529
1530
  }
1530
1531
 
1531
- scale( sx, sy ) {
1532
+ //
1532
1533
 
1533
- const te = this.elements;
1534
+ scale( sx, sy ) {
1534
1535
 
1535
- te[ 0 ] *= sx; te[ 3 ] *= sx; te[ 6 ] *= sx;
1536
- te[ 1 ] *= sy; te[ 4 ] *= sy; te[ 7 ] *= sy;
1536
+ this.premultiply( _m3.makeScale( sx, sy ) );
1537
1537
 
1538
1538
  return this;
1539
1539
 
@@ -1541,37 +1541,71 @@
1541
1541
 
1542
1542
  rotate( theta ) {
1543
1543
 
1544
+ this.premultiply( _m3.makeRotation( - theta ) );
1545
+
1546
+ return this;
1547
+
1548
+ }
1549
+
1550
+ translate( tx, ty ) {
1551
+
1552
+ this.premultiply( _m3.makeTranslation( tx, ty ) );
1553
+
1554
+ return this;
1555
+
1556
+ }
1557
+
1558
+ // for 2D Transforms
1559
+
1560
+ makeTranslation( x, y ) {
1561
+
1562
+ this.set(
1563
+
1564
+ 1, 0, x,
1565
+ 0, 1, y,
1566
+ 0, 0, 1
1567
+
1568
+ );
1569
+
1570
+ return this;
1571
+
1572
+ }
1573
+
1574
+ makeRotation( theta ) {
1575
+
1576
+ // counterclockwise
1577
+
1544
1578
  const c = Math.cos( theta );
1545
1579
  const s = Math.sin( theta );
1546
1580
 
1547
- const te = this.elements;
1548
-
1549
- const a11 = te[ 0 ], a12 = te[ 3 ], a13 = te[ 6 ];
1550
- const a21 = te[ 1 ], a22 = te[ 4 ], a23 = te[ 7 ];
1581
+ this.set(
1551
1582
 
1552
- te[ 0 ] = c * a11 + s * a21;
1553
- te[ 3 ] = c * a12 + s * a22;
1554
- te[ 6 ] = c * a13 + s * a23;
1583
+ c, - s, 0,
1584
+ s, c, 0,
1585
+ 0, 0, 1
1555
1586
 
1556
- te[ 1 ] = - s * a11 + c * a21;
1557
- te[ 4 ] = - s * a12 + c * a22;
1558
- te[ 7 ] = - s * a13 + c * a23;
1587
+ );
1559
1588
 
1560
1589
  return this;
1561
1590
 
1562
1591
  }
1563
1592
 
1564
- translate( tx, ty ) {
1593
+ makeScale( x, y ) {
1565
1594
 
1566
- const te = this.elements;
1595
+ this.set(
1596
+
1597
+ x, 0, 0,
1598
+ 0, y, 0,
1599
+ 0, 0, 1
1567
1600
 
1568
- te[ 0 ] += tx * te[ 2 ]; te[ 3 ] += tx * te[ 5 ]; te[ 6 ] += tx * te[ 8 ];
1569
- te[ 1 ] += ty * te[ 2 ]; te[ 4 ] += ty * te[ 5 ]; te[ 7 ] += ty * te[ 8 ];
1601
+ );
1570
1602
 
1571
1603
  return this;
1572
1604
 
1573
1605
  }
1574
1606
 
1607
+ //
1608
+
1575
1609
  equals( matrix ) {
1576
1610
 
1577
1611
  const te = this.elements;
@@ -1627,6 +1661,8 @@
1627
1661
 
1628
1662
  }
1629
1663
 
1664
+ const _m3 = /*@__PURE__*/ new Matrix3();
1665
+
1630
1666
  function arrayNeedsUint32( array ) {
1631
1667
 
1632
1668
  // assumes larger values usually on last
@@ -1745,7 +1781,7 @@
1745
1781
  'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0,
1746
1782
  'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 };
1747
1783
 
1748
- const _rgb = { r: 0, g: 0, b: 0 };
1784
+ const _rgb$1 = { r: 0, g: 0, b: 0 };
1749
1785
  const _hslA = { h: 0, s: 0, l: 0 };
1750
1786
  const _hslB = { h: 0, s: 0, l: 0 };
1751
1787
 
@@ -1835,7 +1871,7 @@
1835
1871
 
1836
1872
  }
1837
1873
 
1838
- setRGB( r, g, b, colorSpace = LinearSRGBColorSpace ) {
1874
+ setRGB( r, g, b, colorSpace = ColorManagement.workingColorSpace ) {
1839
1875
 
1840
1876
  this.r = r;
1841
1877
  this.g = g;
@@ -1847,7 +1883,7 @@
1847
1883
 
1848
1884
  }
1849
1885
 
1850
- setHSL( h, s, l, colorSpace = LinearSRGBColorSpace ) {
1886
+ setHSL( h, s, l, colorSpace = ColorManagement.workingColorSpace ) {
1851
1887
 
1852
1888
  // h,s,l ranges are in 0.0 - 1.0
1853
1889
  h = euclideanModulo( h, 1 );
@@ -2075,9 +2111,9 @@
2075
2111
 
2076
2112
  getHex( colorSpace = SRGBColorSpace ) {
2077
2113
 
2078
- ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb ), colorSpace );
2114
+ ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb$1 ), colorSpace );
2079
2115
 
2080
- return clamp( _rgb.r * 255, 0, 255 ) << 16 ^ clamp( _rgb.g * 255, 0, 255 ) << 8 ^ clamp( _rgb.b * 255, 0, 255 ) << 0;
2116
+ return clamp( _rgb$1.r * 255, 0, 255 ) << 16 ^ clamp( _rgb$1.g * 255, 0, 255 ) << 8 ^ clamp( _rgb$1.b * 255, 0, 255 ) << 0;
2081
2117
 
2082
2118
  }
2083
2119
 
@@ -2087,13 +2123,13 @@
2087
2123
 
2088
2124
  }
2089
2125
 
2090
- getHSL( target, colorSpace = LinearSRGBColorSpace ) {
2126
+ getHSL( target, colorSpace = ColorManagement.workingColorSpace ) {
2091
2127
 
2092
2128
  // h,s,l ranges are in 0.0 - 1.0
2093
2129
 
2094
- ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb ), colorSpace );
2130
+ ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb$1 ), colorSpace );
2095
2131
 
2096
- const r = _rgb.r, g = _rgb.g, b = _rgb.b;
2132
+ const r = _rgb$1.r, g = _rgb$1.g, b = _rgb$1.b;
2097
2133
 
2098
2134
  const max = Math.max( r, g, b );
2099
2135
  const min = Math.min( r, g, b );
@@ -2132,13 +2168,13 @@
2132
2168
 
2133
2169
  }
2134
2170
 
2135
- getRGB( target, colorSpace = LinearSRGBColorSpace ) {
2171
+ getRGB( target, colorSpace = ColorManagement.workingColorSpace ) {
2136
2172
 
2137
- ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb ), colorSpace );
2173
+ ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb$1 ), colorSpace );
2138
2174
 
2139
- target.r = _rgb.r;
2140
- target.g = _rgb.g;
2141
- target.b = _rgb.b;
2175
+ target.r = _rgb$1.r;
2176
+ target.g = _rgb$1.g;
2177
+ target.b = _rgb$1.b;
2142
2178
 
2143
2179
  return target;
2144
2180
 
@@ -2146,16 +2182,16 @@
2146
2182
 
2147
2183
  getStyle( colorSpace = SRGBColorSpace ) {
2148
2184
 
2149
- ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb ), colorSpace );
2185
+ ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb$1 ), colorSpace );
2150
2186
 
2151
2187
  if ( colorSpace !== SRGBColorSpace ) {
2152
2188
 
2153
2189
  // Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).
2154
- return `color(${ colorSpace } ${ _rgb.r } ${ _rgb.g } ${ _rgb.b })`;
2190
+ return `color(${ colorSpace } ${ _rgb$1.r } ${ _rgb$1.g } ${ _rgb$1.b })`;
2155
2191
 
2156
2192
  }
2157
2193
 
2158
- return `rgb(${( _rgb.r * 255 ) | 0},${( _rgb.g * 255 ) | 0},${( _rgb.b * 255 ) | 0})`;
2194
+ return `rgb(${( _rgb$1.r * 255 ) | 0},${( _rgb$1.g * 255 ) | 0},${( _rgb$1.b * 255 ) | 0})`;
2159
2195
 
2160
2196
  }
2161
2197
 
@@ -2568,7 +2604,7 @@
2568
2604
 
2569
2605
  class Texture extends EventDispatcher {
2570
2606
 
2571
- constructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding ) {
2607
+ constructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = Texture.DEFAULT_ANISOTROPY, encoding = LinearEncoding ) {
2572
2608
 
2573
2609
  super();
2574
2610
 
@@ -2735,12 +2771,13 @@
2735
2771
 
2736
2772
  flipY: this.flipY,
2737
2773
 
2774
+ generateMipmaps: this.generateMipmaps,
2738
2775
  premultiplyAlpha: this.premultiplyAlpha,
2739
2776
  unpackAlignment: this.unpackAlignment
2740
2777
 
2741
2778
  };
2742
2779
 
2743
- if ( JSON.stringify( this.userData ) !== '{}' ) output.userData = this.userData;
2780
+ if ( Object.keys( this.userData ).length > 0 ) output.userData = this.userData;
2744
2781
 
2745
2782
  if ( ! isRootObject ) {
2746
2783
 
@@ -2853,6 +2890,7 @@
2853
2890
 
2854
2891
  Texture.DEFAULT_IMAGE = null;
2855
2892
  Texture.DEFAULT_MAPPING = UVMapping;
2893
+ Texture.DEFAULT_ANISOTROPY = 1;
2856
2894
 
2857
2895
  class Vector4 {
2858
2896
 
@@ -7772,12 +7810,16 @@
7772
7810
 
7773
7811
  localToWorld( vector ) {
7774
7812
 
7813
+ this.updateWorldMatrix( true, false );
7814
+
7775
7815
  return vector.applyMatrix4( this.matrixWorld );
7776
7816
 
7777
7817
  }
7778
7818
 
7779
7819
  worldToLocal( vector ) {
7780
7820
 
7821
+ this.updateWorldMatrix( true, false );
7822
+
7781
7823
  return vector.applyMatrix4( _m1$1.copy( this.matrixWorld ).invert() );
7782
7824
 
7783
7825
  }
@@ -7991,6 +8033,28 @@
7991
8033
 
7992
8034
  }
7993
8035
 
8036
+ getObjectsByProperty( name, value ) {
8037
+
8038
+ let result = [];
8039
+
8040
+ if ( this[ name ] === value ) result.push( this );
8041
+
8042
+ for ( let i = 0, l = this.children.length; i < l; i ++ ) {
8043
+
8044
+ const childResult = this.children[ i ].getObjectsByProperty( name, value );
8045
+
8046
+ if ( childResult.length > 0 ) {
8047
+
8048
+ result = result.concat( childResult );
8049
+
8050
+ }
8051
+
8052
+ }
8053
+
8054
+ return result;
8055
+
8056
+ }
8057
+
7994
8058
  getWorldPosition( target ) {
7995
8059
 
7996
8060
  this.updateWorldMatrix( true, false );
@@ -8212,7 +8276,7 @@
8212
8276
  if ( this.visible === false ) object.visible = false;
8213
8277
  if ( this.frustumCulled === false ) object.frustumCulled = false;
8214
8278
  if ( this.renderOrder !== 0 ) object.renderOrder = this.renderOrder;
8215
- if ( JSON.stringify( this.userData ) !== '{}' ) object.userData = this.userData;
8279
+ if ( Object.keys( this.userData ).length > 0 ) object.userData = this.userData;
8216
8280
 
8217
8281
  object.layers = this.layers.mask;
8218
8282
  object.matrix = this.matrix.toArray();
@@ -9119,7 +9183,7 @@
9119
9183
 
9120
9184
  if ( this.fog === false ) data.fog = false;
9121
9185
 
9122
- if ( JSON.stringify( this.userData ) !== '{}' ) data.userData = this.userData;
9186
+ if ( Object.keys( this.userData ).length > 0 ) data.userData = this.userData;
9123
9187
 
9124
9188
  // TODO: Copied from Object3D.toJSON
9125
9189
 
@@ -9331,7 +9395,7 @@
9331
9395
 
9332
9396
  class BufferAttribute {
9333
9397
 
9334
- constructor( array, itemSize, normalized ) {
9398
+ constructor( array, itemSize, normalized = false ) {
9335
9399
 
9336
9400
  if ( Array.isArray( array ) ) {
9337
9401
 
@@ -9346,7 +9410,7 @@
9346
9410
  this.array = array;
9347
9411
  this.itemSize = itemSize;
9348
9412
  this.count = array !== undefined ? array.length / itemSize : 0;
9349
- this.normalized = normalized === true;
9413
+ this.normalized = normalized;
9350
9414
 
9351
9415
  this.usage = StaticDrawUsage;
9352
9416
  this.updateRange = { offset: 0, count: - 1 };
@@ -10683,7 +10747,7 @@
10683
10747
 
10684
10748
  clone() {
10685
10749
 
10686
- return new this.constructor().copy( this );
10750
+ return new this.constructor().copy( this );
10687
10751
 
10688
10752
  }
10689
10753
 
@@ -10813,12 +10877,7 @@
10813
10877
  const _vC$1 = /*@__PURE__*/ new Vector3();
10814
10878
 
10815
10879
  const _tempA = /*@__PURE__*/ new Vector3();
10816
- const _tempB = /*@__PURE__*/ new Vector3();
10817
- const _tempC = /*@__PURE__*/ new Vector3();
10818
-
10819
10880
  const _morphA = /*@__PURE__*/ new Vector3();
10820
- const _morphB = /*@__PURE__*/ new Vector3();
10821
- const _morphC = /*@__PURE__*/ new Vector3();
10822
10881
 
10823
10882
  const _uvA$1 = /*@__PURE__*/ new Vector2();
10824
10883
  const _uvB$1 = /*@__PURE__*/ new Vector2();
@@ -10898,6 +10957,56 @@
10898
10957
 
10899
10958
  }
10900
10959
 
10960
+ getVertexPosition( vert, target ) {
10961
+
10962
+ const geometry = this.geometry;
10963
+ const position = geometry.attributes.position;
10964
+ const morphPosition = geometry.morphAttributes.position;
10965
+ const morphTargetsRelative = geometry.morphTargetsRelative;
10966
+
10967
+ target.fromBufferAttribute( position, vert );
10968
+
10969
+ const morphInfluences = this.morphTargetInfluences;
10970
+
10971
+ if ( morphPosition && morphInfluences ) {
10972
+
10973
+ _morphA.set( 0, 0, 0 );
10974
+
10975
+ for ( let i = 0, il = morphPosition.length; i < il; i ++ ) {
10976
+
10977
+ const influence = morphInfluences[ i ];
10978
+ const morphAttribute = morphPosition[ i ];
10979
+
10980
+ if ( influence === 0 ) continue;
10981
+
10982
+ _tempA.fromBufferAttribute( morphAttribute, vert );
10983
+
10984
+ if ( morphTargetsRelative ) {
10985
+
10986
+ _morphA.addScaledVector( _tempA, influence );
10987
+
10988
+ } else {
10989
+
10990
+ _morphA.addScaledVector( _tempA.sub( target ), influence );
10991
+
10992
+ }
10993
+
10994
+ }
10995
+
10996
+ target.add( _morphA );
10997
+
10998
+ }
10999
+
11000
+ if ( this.isSkinnedMesh ) {
11001
+
11002
+ this.boneTransform( vert, target );
11003
+
11004
+ }
11005
+
11006
+ return target;
11007
+
11008
+ }
11009
+
10901
11010
  raycast( raycaster, intersects ) {
10902
11011
 
10903
11012
  const geometry = this.geometry;
@@ -10932,8 +11041,6 @@
10932
11041
 
10933
11042
  const index = geometry.index;
10934
11043
  const position = geometry.attributes.position;
10935
- const morphPosition = geometry.morphAttributes.position;
10936
- const morphTargetsRelative = geometry.morphTargetsRelative;
10937
11044
  const uv = geometry.attributes.uv;
10938
11045
  const uv2 = geometry.attributes.uv2;
10939
11046
  const groups = geometry.groups;
@@ -10959,7 +11066,7 @@
10959
11066
  const b = index.getX( j + 1 );
10960
11067
  const c = index.getX( j + 2 );
10961
11068
 
10962
- intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c );
11069
+ intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, _ray$2, uv, uv2, a, b, c );
10963
11070
 
10964
11071
  if ( intersection ) {
10965
11072
 
@@ -10984,7 +11091,7 @@
10984
11091
  const b = index.getX( i + 1 );
10985
11092
  const c = index.getX( i + 2 );
10986
11093
 
10987
- intersection = checkBufferGeometryIntersection( this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c );
11094
+ intersection = checkBufferGeometryIntersection( this, material, raycaster, _ray$2, uv, uv2, a, b, c );
10988
11095
 
10989
11096
  if ( intersection ) {
10990
11097
 
@@ -11017,7 +11124,7 @@
11017
11124
  const b = j + 1;
11018
11125
  const c = j + 2;
11019
11126
 
11020
- intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c );
11127
+ intersection = checkBufferGeometryIntersection( this, groupMaterial, raycaster, _ray$2, uv, uv2, a, b, c );
11021
11128
 
11022
11129
  if ( intersection ) {
11023
11130
 
@@ -11042,7 +11149,7 @@
11042
11149
  const b = i + 1;
11043
11150
  const c = i + 2;
11044
11151
 
11045
- intersection = checkBufferGeometryIntersection( this, material, raycaster, _ray$2, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c );
11152
+ intersection = checkBufferGeometryIntersection( this, material, raycaster, _ray$2, uv, uv2, a, b, c );
11046
11153
 
11047
11154
  if ( intersection ) {
11048
11155
 
@@ -11071,7 +11178,7 @@
11071
11178
 
11072
11179
  } else {
11073
11180
 
11074
- intersect = ray.intersectTriangle( pA, pB, pC, material.side !== DoubleSide, point );
11181
+ intersect = ray.intersectTriangle( pA, pB, pC, ( material.side === FrontSide ), point );
11075
11182
 
11076
11183
  }
11077
11184
 
@@ -11092,60 +11199,11 @@
11092
11199
 
11093
11200
  }
11094
11201
 
11095
- function checkBufferGeometryIntersection( object, material, raycaster, ray, position, morphPosition, morphTargetsRelative, uv, uv2, a, b, c ) {
11096
-
11097
- _vA$1.fromBufferAttribute( position, a );
11098
- _vB$1.fromBufferAttribute( position, b );
11099
- _vC$1.fromBufferAttribute( position, c );
11100
-
11101
- const morphInfluences = object.morphTargetInfluences;
11102
-
11103
- if ( morphPosition && morphInfluences ) {
11104
-
11105
- _morphA.set( 0, 0, 0 );
11106
- _morphB.set( 0, 0, 0 );
11107
- _morphC.set( 0, 0, 0 );
11108
-
11109
- for ( let i = 0, il = morphPosition.length; i < il; i ++ ) {
11110
-
11111
- const influence = morphInfluences[ i ];
11112
- const morphAttribute = morphPosition[ i ];
11113
-
11114
- if ( influence === 0 ) continue;
11115
-
11116
- _tempA.fromBufferAttribute( morphAttribute, a );
11117
- _tempB.fromBufferAttribute( morphAttribute, b );
11118
- _tempC.fromBufferAttribute( morphAttribute, c );
11119
-
11120
- if ( morphTargetsRelative ) {
11121
-
11122
- _morphA.addScaledVector( _tempA, influence );
11123
- _morphB.addScaledVector( _tempB, influence );
11124
- _morphC.addScaledVector( _tempC, influence );
11125
-
11126
- } else {
11127
-
11128
- _morphA.addScaledVector( _tempA.sub( _vA$1 ), influence );
11129
- _morphB.addScaledVector( _tempB.sub( _vB$1 ), influence );
11130
- _morphC.addScaledVector( _tempC.sub( _vC$1 ), influence );
11131
-
11132
- }
11133
-
11134
- }
11135
-
11136
- _vA$1.add( _morphA );
11137
- _vB$1.add( _morphB );
11138
- _vC$1.add( _morphC );
11139
-
11140
- }
11141
-
11142
- if ( object.isSkinnedMesh ) {
11202
+ function checkBufferGeometryIntersection( object, material, raycaster, ray, uv, uv2, a, b, c ) {
11143
11203
 
11144
- object.boneTransform( a, _vA$1 );
11145
- object.boneTransform( b, _vB$1 );
11146
- object.boneTransform( c, _vC$1 );
11147
-
11148
- }
11204
+ object.getVertexPosition( a, _vA$1 );
11205
+ object.getVertexPosition( b, _vB$1 );
11206
+ object.getVertexPosition( c, _vC$1 );
11149
11207
 
11150
11208
  const intersection = checkIntersection( object, material, raycaster, ray, _vA$1, _vB$1, _vC$1, _intersectionPoint );
11151
11209
 
@@ -11429,6 +11487,19 @@
11429
11487
 
11430
11488
  }
11431
11489
 
11490
+ function getUnlitUniformColorSpace( renderer ) {
11491
+
11492
+ if ( renderer.getRenderTarget() === null ) {
11493
+
11494
+ // https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398
11495
+ return renderer.outputEncoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
11496
+
11497
+ }
11498
+
11499
+ return LinearSRGBColorSpace;
11500
+
11501
+ }
11502
+
11432
11503
  // Legacy
11433
11504
 
11434
11505
  const UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms };
@@ -11905,7 +11976,8 @@
11905
11976
 
11906
11977
  }
11907
11978
 
11908
- const fov = 90, aspect = 1;
11979
+ const fov = - 90; // negative fov is not an error
11980
+ const aspect = 1;
11909
11981
 
11910
11982
  class CubeCamera extends Object3D {
11911
11983
 
@@ -11919,38 +11991,38 @@
11919
11991
 
11920
11992
  const cameraPX = new PerspectiveCamera( fov, aspect, near, far );
11921
11993
  cameraPX.layers = this.layers;
11922
- cameraPX.up.set( 0, - 1, 0 );
11923
- cameraPX.lookAt( new Vector3( 1, 0, 0 ) );
11994
+ cameraPX.up.set( 0, 1, 0 );
11995
+ cameraPX.lookAt( 1, 0, 0 );
11924
11996
  this.add( cameraPX );
11925
11997
 
11926
11998
  const cameraNX = new PerspectiveCamera( fov, aspect, near, far );
11927
11999
  cameraNX.layers = this.layers;
11928
- cameraNX.up.set( 0, - 1, 0 );
11929
- cameraNX.lookAt( new Vector3( - 1, 0, 0 ) );
12000
+ cameraNX.up.set( 0, 1, 0 );
12001
+ cameraNX.lookAt( - 1, 0, 0 );
11930
12002
  this.add( cameraNX );
11931
12003
 
11932
12004
  const cameraPY = new PerspectiveCamera( fov, aspect, near, far );
11933
12005
  cameraPY.layers = this.layers;
11934
- cameraPY.up.set( 0, 0, 1 );
11935
- cameraPY.lookAt( new Vector3( 0, 1, 0 ) );
12006
+ cameraPY.up.set( 0, 0, - 1 );
12007
+ cameraPY.lookAt( 0, 1, 0 );
11936
12008
  this.add( cameraPY );
11937
12009
 
11938
12010
  const cameraNY = new PerspectiveCamera( fov, aspect, near, far );
11939
12011
  cameraNY.layers = this.layers;
11940
- cameraNY.up.set( 0, 0, - 1 );
11941
- cameraNY.lookAt( new Vector3( 0, - 1, 0 ) );
12012
+ cameraNY.up.set( 0, 0, 1 );
12013
+ cameraNY.lookAt( 0, - 1, 0 );
11942
12014
  this.add( cameraNY );
11943
12015
 
11944
12016
  const cameraPZ = new PerspectiveCamera( fov, aspect, near, far );
11945
12017
  cameraPZ.layers = this.layers;
11946
- cameraPZ.up.set( 0, - 1, 0 );
11947
- cameraPZ.lookAt( new Vector3( 0, 0, 1 ) );
12018
+ cameraPZ.up.set( 0, 1, 0 );
12019
+ cameraPZ.lookAt( 0, 0, 1 );
11948
12020
  this.add( cameraPZ );
11949
12021
 
11950
12022
  const cameraNZ = new PerspectiveCamera( fov, aspect, near, far );
11951
12023
  cameraNZ.layers = this.layers;
11952
- cameraNZ.up.set( 0, - 1, 0 );
11953
- cameraNZ.lookAt( new Vector3( 0, 0, - 1 ) );
12024
+ cameraNZ.up.set( 0, 1, 0 );
12025
+ cameraNZ.lookAt( 0, 0, - 1 );
11954
12026
  this.add( cameraNZ );
11955
12027
 
11956
12028
  }
@@ -12694,6 +12766,8 @@
12694
12766
 
12695
12767
  }
12696
12768
 
12769
+ attribute.onUploadCallback();
12770
+
12697
12771
  }
12698
12772
 
12699
12773
  //
@@ -12895,7 +12969,7 @@
12895
12969
 
12896
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 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}";
12897
12971
 
12898
- 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 cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_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 ), cubeUV_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";
12972
+ 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\thighp vec2 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 cubeUV_r0 1.0\n\t#define cubeUV_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_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 ), cubeUV_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";
12899
12973
 
12900
12974
  var defaultnormal_vertex = "vec3 transformedNormal = objectNormal;\n#ifdef USE_INSTANCING\n\tmat3 m = mat3( instanceMatrix );\n\ttransformedNormal /= vec3( dot( m[ 0 ], m[ 0 ] ), dot( m[ 1 ], m[ 1 ] ), dot( m[ 2 ], m[ 2 ] ) );\n\ttransformedNormal = m * transformedNormal;\n#endif\ntransformedNormal = normalMatrix * transformedNormal;\n#ifdef FLIP_SIDED\n\ttransformedNormal = - transformedNormal;\n#endif\n#ifdef USE_TANGENT\n\tvec3 transformedTangent = ( modelViewMatrix * vec4( objectTangent, 0.0 ) ).xyz;\n\t#ifdef FLIP_SIDED\n\t\ttransformedTangent = - transformedTangent;\n\t#endif\n#endif";
12901
12975
 
@@ -12937,7 +13011,7 @@
12937
13011
 
12938
13012
  var lights_lambert_fragment = "LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;";
12939
13013
 
12940
- var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\n#define Material_LightProbeLOD( material )\t(0)";
13014
+ var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert";
12941
13015
 
12942
13016
  var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif";
12943
13017
 
@@ -12945,17 +13019,17 @@
12945
13019
 
12946
13020
  var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
12947
13021
 
12948
- var lights_toon_pars_fragment = "varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)";
13022
+ var lights_toon_pars_fragment = "varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon";
12949
13023
 
12950
13024
  var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;";
12951
13025
 
12952
- var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)";
13026
+ var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong";
12953
13027
 
12954
13028
  var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif";
12955
13029
 
12956
13030
  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\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\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}";
12957
13031
 
12958
- 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\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\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 ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\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, vSpotLightCoord[ 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";
13032
+ 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 *= ( 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\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\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 ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ 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 *= ( 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";
12959
13033
 
12960
13034
  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";
12961
13035
 
@@ -13025,7 +13099,7 @@
13025
13099
 
13026
13100
  var roughnessmap_pars_fragment = "#ifdef USE_ROUGHNESSMAP\n\tuniform sampler2D roughnessMap;\n#endif";
13027
13101
 
13028
- var shadowmap_pars_fragment = "#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbvec4 inFrustumVec = bvec4 ( shadowCoord.x >= 0.0, shadowCoord.x <= 1.0, shadowCoord.y >= 0.0, shadowCoord.y <= 1.0 );\n\t\tbool inFrustum = all( inFrustumVec );\n\t\tbvec2 frustumTestVec = bvec2( inFrustum, shadowCoord.z <= 1.0 );\n\t\tbool frustumTest = all( frustumTestVec );\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif";
13102
+ var shadowmap_pars_fragment = "#if NUM_SPOT_LIGHT_COORDS > 0\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#if NUM_SPOT_LIGHT_MAPS > 0\n uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n\tfloat texture2DCompare( sampler2D depths, vec2 uv, float compare ) {\n\t\treturn step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );\n\t}\n\tvec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {\n\t\treturn unpackRGBATo2Half( texture2D( shadow, uv ) );\n\t}\n\tfloat VSMShadow (sampler2D shadow, vec2 uv, float compare ){\n\t\tfloat occlusion = 1.0;\n\t\tvec2 distribution = texture2DDistribution( shadow, uv );\n\t\tfloat hard_shadow = step( compare , distribution.x );\n\t\tif (hard_shadow != 1.0 ) {\n\t\t\tfloat distance = compare - distribution.x ;\n\t\t\tfloat variance = max( 0.00000, distribution.y * distribution.y );\n\t\t\tfloat softness_probability = variance / (variance + distance * distance );\t\t\tsoftness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );\t\t\tocclusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );\n\t\t}\n\t\treturn occlusion;\n\t}\n\tfloat getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord ) {\n\t\tfloat shadow = 1.0;\n\t\tshadowCoord.xyz /= shadowCoord.w;\n\t\tshadowCoord.z += shadowBias;\n\t\tbool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;\n\t\tbool frustumTest = inFrustum && shadowCoord.z <= 1.0;\n\t\tif ( frustumTest ) {\n\t\t#if defined( SHADOWMAP_TYPE_PCF )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx0 = - texelSize.x * shadowRadius;\n\t\t\tfloat dy0 = - texelSize.y * shadowRadius;\n\t\t\tfloat dx1 = + texelSize.x * shadowRadius;\n\t\t\tfloat dy1 = + texelSize.y * shadowRadius;\n\t\t\tfloat dx2 = dx0 / 2.0;\n\t\t\tfloat dy2 = dy0 / 2.0;\n\t\t\tfloat dx3 = dx1 / 2.0;\n\t\t\tfloat dy3 = dy1 / 2.0;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )\n\t\t\t) * ( 1.0 / 17.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_PCF_SOFT )\n\t\t\tvec2 texelSize = vec2( 1.0 ) / shadowMapSize;\n\t\t\tfloat dx = texelSize.x;\n\t\t\tfloat dy = texelSize.y;\n\t\t\tvec2 uv = shadowCoord.xy;\n\t\t\tvec2 f = fract( uv * shadowMapSize + 0.5 );\n\t\t\tuv -= f * texelSize;\n\t\t\tshadow = (\n\t\t\t\ttexture2DCompare( shadowMap, uv, shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +\n\t\t\t\ttexture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),\n\t\t\t\t\t f.x ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t f.y ) +\n\t\t\t\tmix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),\n\t\t\t\t\t\t f.x ),\n\t\t\t\t\t f.y )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#elif defined( SHADOWMAP_TYPE_VSM )\n\t\t\tshadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#else\n\t\t\tshadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );\n\t\t#endif\n\t\t}\n\t\treturn shadow;\n\t}\n\tvec2 cubeToUV( vec3 v, float texelSizeY ) {\n\t\tvec3 absV = abs( v );\n\t\tfloat scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );\n\t\tabsV *= scaleToCube;\n\t\tv *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );\n\t\tvec2 planar = v.xy;\n\t\tfloat almostATexel = 1.5 * texelSizeY;\n\t\tfloat almostOne = 1.0 - almostATexel;\n\t\tif ( absV.z >= almostOne ) {\n\t\t\tif ( v.z > 0.0 )\n\t\t\t\tplanar.x = 4.0 - v.x;\n\t\t} else if ( absV.x >= almostOne ) {\n\t\t\tfloat signX = sign( v.x );\n\t\t\tplanar.x = v.z * signX + 2.0 * signX;\n\t\t} else if ( absV.y >= almostOne ) {\n\t\t\tfloat signY = sign( v.y );\n\t\t\tplanar.x = v.x + 2.0 * signY + 2.0;\n\t\t\tplanar.y = v.z * signY - 2.0;\n\t\t}\n\t\treturn vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );\n\t}\n\tfloat getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {\n\t\tvec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );\n\t\tvec3 lightToPosition = shadowCoord.xyz;\n\t\tfloat dp = ( length( lightToPosition ) - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );\t\tdp += shadowBias;\n\t\tvec3 bd3D = normalize( lightToPosition );\n\t\t#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )\n\t\t\tvec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;\n\t\t\treturn (\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +\n\t\t\t\ttexture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )\n\t\t\t) * ( 1.0 / 9.0 );\n\t\t#else\n\t\t\treturn texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );\n\t\t#endif\n\t}\n#endif";
13029
13103
 
13030
13104
  var shadowmap_pars_vertex = "#if NUM_SPOT_LIGHT_COORDS > 0\n uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];\n varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];\n#endif\n#ifdef USE_SHADOWMAP\n\t#if NUM_DIR_LIGHT_SHADOWS > 0\n\t\tuniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tvarying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];\n\t\tstruct DirectionalLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_SPOT_LIGHT_SHADOWS > 0\n\t\tstruct SpotLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t};\n\t\tuniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];\n\t#endif\n\t#if NUM_POINT_LIGHT_SHADOWS > 0\n\t\tuniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tvarying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];\n\t\tstruct PointLightShadow {\n\t\t\tfloat shadowBias;\n\t\t\tfloat shadowNormalBias;\n\t\t\tfloat shadowRadius;\n\t\t\tvec2 shadowMapSize;\n\t\t\tfloat shadowCameraNear;\n\t\t\tfloat shadowCameraFar;\n\t\t};\n\t\tuniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];\n\t#endif\n#endif";
13031
13105
 
@@ -13069,11 +13143,11 @@
13069
13143
 
13070
13144
  const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
13071
13145
 
13072
- const fragment$h = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
13146
+ const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
13073
13147
 
13074
13148
  const vertex$g = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
13075
13149
 
13076
- const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
13150
+ const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
13077
13151
 
13078
13152
  const vertex$f = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
13079
13153
 
@@ -13704,6 +13778,7 @@
13704
13778
  uniforms: {
13705
13779
  uvTransform: { value: /*@__PURE__*/ new Matrix3() },
13706
13780
  t2D: { value: null },
13781
+ backgroundIntensity: { value: 1 }
13707
13782
  },
13708
13783
 
13709
13784
  vertexShader: ShaderChunk.background_vert,
@@ -13716,7 +13791,8 @@
13716
13791
  uniforms: {
13717
13792
  envMap: { value: null },
13718
13793
  flipEnvMap: { value: - 1 },
13719
- backgroundBlurriness: { value: 0 }
13794
+ backgroundBlurriness: { value: 0 },
13795
+ backgroundIntensity: { value: 1 }
13720
13796
  },
13721
13797
 
13722
13798
  vertexShader: ShaderChunk.backgroundCube_vert,
@@ -13825,6 +13901,8 @@
13825
13901
 
13826
13902
  };
13827
13903
 
13904
+ const _rgb = { r: 0, b: 0, g: 0 };
13905
+
13828
13906
  function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, premultipliedAlpha ) {
13829
13907
 
13830
13908
  const clearColor = new Color$1( 0x000000 );
@@ -13923,6 +14001,8 @@
13923
14001
  boxMesh.material.uniforms.envMap.value = background;
13924
14002
  boxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? - 1 : 1;
13925
14003
  boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;
14004
+ boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
14005
+ boxMesh.material.toneMapped = ( background.encoding === sRGBEncoding ) ? false : true;
13926
14006
 
13927
14007
  if ( currentBackground !== background ||
13928
14008
  currentBackgroundVersion !== background.version ||
@@ -13977,6 +14057,8 @@
13977
14057
  }
13978
14058
 
13979
14059
  planeMesh.material.uniforms.t2D.value = background;
14060
+ planeMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
14061
+ planeMesh.material.toneMapped = ( background.encoding === sRGBEncoding ) ? false : true;
13980
14062
 
13981
14063
  if ( background.matrixAutoUpdate === true ) {
13982
14064
 
@@ -14009,7 +14091,9 @@
14009
14091
 
14010
14092
  function setClear( color, alpha ) {
14011
14093
 
14012
- state.buffers.color.setClear( color.r, color.g, color.b, alpha, premultipliedAlpha );
14094
+ color.getRGB( _rgb, getUnlitUniformColorSpace( renderer ) );
14095
+
14096
+ state.buffers.color.setClear( _rgb.r, _rgb.g, _rgb.b, alpha, premultipliedAlpha );
14013
14097
 
14014
14098
  }
14015
14099
 
@@ -20332,10 +20416,6 @@
20332
20416
 
20333
20417
  const uniforms = cache.get( light );
20334
20418
 
20335
- // (a) intensity is the total visible light emitted
20336
- //uniforms.color.copy( color ).multiplyScalar( intensity / ( light.width * light.height * Math.PI ) );
20337
-
20338
- // (b) intensity is the brightness of the light
20339
20419
  uniforms.color.copy( color ).multiplyScalar( intensity );
20340
20420
 
20341
20421
  uniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 );
@@ -21002,37 +21082,38 @@
21002
21082
 
21003
21083
  result = ( light.isPointLight === true ) ? _distanceMaterial : _depthMaterial;
21004
21084
 
21005
- }
21085
+ if ( ( _renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) ||
21086
+ ( material.displacementMap && material.displacementScale !== 0 ) ||
21087
+ ( material.alphaMap && material.alphaTest > 0 ) ||
21088
+ ( material.map && material.alphaTest > 0 ) ) {
21089
+
21090
+ // in this case we need a unique material instance reflecting the
21091
+ // appropriate state
21006
21092
 
21007
- if ( ( _renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) ||
21008
- ( material.displacementMap && material.displacementScale !== 0 ) ||
21009
- ( material.alphaMap && material.alphaTest > 0 ) ) {
21093
+ const keyA = result.uuid, keyB = material.uuid;
21010
21094
 
21011
- // in this case we need a unique material instance reflecting the
21012
- // appropriate state
21095
+ let materialsForVariant = _materialCache[ keyA ];
21013
21096
 
21014
- const keyA = result.uuid, keyB = material.uuid;
21097
+ if ( materialsForVariant === undefined ) {
21015
21098
 
21016
- let materialsForVariant = _materialCache[ keyA ];
21099
+ materialsForVariant = {};
21100
+ _materialCache[ keyA ] = materialsForVariant;
21017
21101
 
21018
- if ( materialsForVariant === undefined ) {
21102
+ }
21019
21103
 
21020
- materialsForVariant = {};
21021
- _materialCache[ keyA ] = materialsForVariant;
21104
+ let cachedMaterial = materialsForVariant[ keyB ];
21022
21105
 
21023
- }
21106
+ if ( cachedMaterial === undefined ) {
21024
21107
 
21025
- let cachedMaterial = materialsForVariant[ keyB ];
21108
+ cachedMaterial = result.clone();
21109
+ materialsForVariant[ keyB ] = cachedMaterial;
21026
21110
 
21027
- if ( cachedMaterial === undefined ) {
21111
+ }
21028
21112
 
21029
- cachedMaterial = result.clone();
21030
- materialsForVariant[ keyB ] = cachedMaterial;
21113
+ result = cachedMaterial;
21031
21114
 
21032
21115
  }
21033
21116
 
21034
- result = cachedMaterial;
21035
-
21036
21117
  }
21037
21118
 
21038
21119
  result.visible = material.visible;
@@ -21050,6 +21131,7 @@
21050
21131
 
21051
21132
  result.alphaMap = material.alphaMap;
21052
21133
  result.alphaTest = material.alphaTest;
21134
+ result.map = material.map;
21053
21135
 
21054
21136
  result.clipShadows = material.clipShadows;
21055
21137
  result.clippingPlanes = material.clippingPlanes;
@@ -21438,7 +21520,7 @@
21438
21520
  const stencilBuffer = new StencilBuffer();
21439
21521
 
21440
21522
  const uboBindings = new WeakMap();
21441
- const uboProgamMap = new WeakMap();
21523
+ const uboProgramMap = new WeakMap();
21442
21524
 
21443
21525
  let enabledCapabilities = {};
21444
21526
 
@@ -21849,7 +21931,7 @@
21849
21931
  }
21850
21932
 
21851
21933
  currentBlending = blending;
21852
- currentPremultipledAlpha = null;
21934
+ currentPremultipledAlpha = false;
21853
21935
 
21854
21936
  }
21855
21937
 
@@ -22235,13 +22317,13 @@
22235
22317
 
22236
22318
  function updateUBOMapping( uniformsGroup, program ) {
22237
22319
 
22238
- let mapping = uboProgamMap.get( program );
22320
+ let mapping = uboProgramMap.get( program );
22239
22321
 
22240
22322
  if ( mapping === undefined ) {
22241
22323
 
22242
22324
  mapping = new WeakMap();
22243
22325
 
22244
- uboProgamMap.set( program, mapping );
22326
+ uboProgramMap.set( program, mapping );
22245
22327
 
22246
22328
  }
22247
22329
 
@@ -22259,16 +22341,15 @@
22259
22341
 
22260
22342
  function uniformBlockBinding( uniformsGroup, program ) {
22261
22343
 
22262
- const mapping = uboProgamMap.get( program );
22344
+ const mapping = uboProgramMap.get( program );
22263
22345
  const blockIndex = mapping.get( uniformsGroup );
22264
22346
 
22265
- if ( uboBindings.get( uniformsGroup ) !== blockIndex ) {
22347
+ if ( uboBindings.get( program ) !== blockIndex ) {
22266
22348
 
22267
22349
  // bind shader specific block index to global block point
22268
-
22269
22350
  gl.uniformBlockBinding( program, blockIndex, uniformsGroup.__bindingPointIndex );
22270
22351
 
22271
- uboBindings.set( uniformsGroup, blockIndex );
22352
+ uboBindings.set( program, blockIndex );
22272
22353
 
22273
22354
  }
22274
22355
 
@@ -22429,7 +22510,7 @@
22429
22510
  const maxTextureSize = capabilities.maxTextureSize;
22430
22511
  const maxSamples = capabilities.maxSamples;
22431
22512
  const multisampledRTTExt = extensions.has( 'WEBGL_multisampled_render_to_texture' ) ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : null;
22432
- const supportsInvalidateFramebuffer = /OculusBrowser/g.test( typeof navigator === 'undefined' ? '' : navigator.userAgent );
22513
+ const supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent );
22433
22514
 
22434
22515
  const _videoTextures = new WeakMap();
22435
22516
  let _canvas;
@@ -22992,6 +23073,8 @@
22992
23073
 
22993
23074
  const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
22994
23075
 
23076
+ if ( texture.magFilter === NearestFilter ) return;
23077
+ if ( texture.minFilter !== NearestMipmapLinearFilter && texture.minFilter !== LinearMipmapLinearFilter ) return;
22995
23078
  if ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false ) return; // verify extension for WebGL 1 and WebGL 2
22996
23079
  if ( isWebGL2 === false && ( texture.type === HalfFloatType && extensions.has( 'OES_texture_half_float_linear' ) === false ) ) return; // verify extension for WebGL 1 only
22997
23080
 
@@ -24455,7 +24538,6 @@
24455
24538
  if ( p === LuminanceAlphaFormat ) return 6410;
24456
24539
  if ( p === DepthFormat ) return 6402;
24457
24540
  if ( p === DepthStencilFormat ) return 34041;
24458
- if ( p === RedFormat ) return 6403;
24459
24541
 
24460
24542
  // @deprecated since r137
24461
24543
 
@@ -24486,6 +24568,7 @@
24486
24568
 
24487
24569
  // WebGL2 formats.
24488
24570
 
24571
+ if ( p === RedFormat ) return 6403;
24489
24572
  if ( p === RedIntegerFormat ) return 36244;
24490
24573
  if ( p === RGFormat ) return 33319;
24491
24574
  if ( p === RGIntegerFormat ) return 33320;
@@ -24791,6 +24874,31 @@
24791
24874
 
24792
24875
  }
24793
24876
 
24877
+ connect( inputSource ) {
24878
+
24879
+ if ( inputSource && inputSource.hand ) {
24880
+
24881
+ const hand = this._hand;
24882
+
24883
+ if ( hand ) {
24884
+
24885
+ for ( const inputjoint of inputSource.hand.values() ) {
24886
+
24887
+ // Initialize hand with joints when connected
24888
+ this._getHandJoint( hand, inputjoint );
24889
+
24890
+ }
24891
+
24892
+ }
24893
+
24894
+ }
24895
+
24896
+ this.dispatchEvent( { type: 'connected', data: inputSource } );
24897
+
24898
+ return this;
24899
+
24900
+ }
24901
+
24794
24902
  disconnect( inputSource ) {
24795
24903
 
24796
24904
  this.dispatchEvent( { type: 'disconnected', data: inputSource } );
@@ -24838,19 +24946,8 @@
24838
24946
  // Update the joints groups with the XRJoint poses
24839
24947
  const jointPose = frame.getJointPose( inputjoint, referenceSpace );
24840
24948
 
24841
- if ( hand.joints[ inputjoint.jointName ] === undefined ) {
24842
-
24843
- // The transform of this joint will be updated with the joint pose on each frame
24844
- const joint = new Group$1();
24845
- joint.matrixAutoUpdate = false;
24846
- joint.visible = false;
24847
- hand.joints[ inputjoint.jointName ] = joint;
24848
- // ??
24849
- hand.add( joint );
24850
-
24851
- }
24852
-
24853
- const joint = hand.joints[ inputjoint.jointName ];
24949
+ // The transform of this joint will be updated with the joint pose on each frame
24950
+ const joint = this._getHandJoint( hand, inputjoint );
24854
24951
 
24855
24952
  if ( jointPose !== null ) {
24856
24953
 
@@ -25002,6 +25099,25 @@
25002
25099
 
25003
25100
  }
25004
25101
 
25102
+ // private method
25103
+
25104
+ _getHandJoint( hand, inputjoint ) {
25105
+
25106
+ if ( hand.joints[ inputjoint.jointName ] === undefined ) {
25107
+
25108
+ const joint = new Group$1();
25109
+ joint.matrixAutoUpdate = false;
25110
+ joint.visible = false;
25111
+ hand.joints[ inputjoint.jointName ] = joint;
25112
+
25113
+ hand.add( joint );
25114
+
25115
+ }
25116
+
25117
+ return hand.joints[ inputjoint.jointName ];
25118
+
25119
+ }
25120
+
25005
25121
  }
25006
25122
 
25007
25123
  class DepthTexture extends Texture {
@@ -25063,6 +25179,9 @@
25063
25179
  const controllers = [];
25064
25180
  const controllerInputSources = [];
25065
25181
 
25182
+ const planes = new Set();
25183
+ const planesLastChangedTimes = new Map();
25184
+
25066
25185
  //
25067
25186
 
25068
25187
  const cameraL = new PerspectiveCamera();
@@ -25384,7 +25503,7 @@
25384
25503
  if ( index >= 0 ) {
25385
25504
 
25386
25505
  controllerInputSources[ index ] = null;
25387
- controllers[ index ].dispatchEvent( { type: 'disconnected', data: inputSource } );
25506
+ controllers[ index ].disconnect( inputSource );
25388
25507
 
25389
25508
  }
25390
25509
 
@@ -25430,7 +25549,7 @@
25430
25549
 
25431
25550
  if ( controller ) {
25432
25551
 
25433
- controller.dispatchEvent( { type: 'connected', data: inputSource } );
25552
+ controller.connect( inputSource );
25434
25553
 
25435
25554
  }
25436
25555
 
@@ -25620,6 +25739,12 @@
25620
25739
 
25621
25740
  };
25622
25741
 
25742
+ this.getPlanes = function () {
25743
+
25744
+ return planes;
25745
+
25746
+ };
25747
+
25623
25748
  // Animation Loop
25624
25749
 
25625
25750
  let onAnimationFrameCallback = null;
@@ -25728,6 +25853,65 @@
25728
25853
 
25729
25854
  if ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame );
25730
25855
 
25856
+ if ( frame.detectedPlanes ) {
25857
+
25858
+ scope.dispatchEvent( { type: 'planesdetected', data: frame.detectedPlanes } );
25859
+
25860
+ let planesToRemove = null;
25861
+
25862
+ for ( const plane of planes ) {
25863
+
25864
+ if ( ! frame.detectedPlanes.has( plane ) ) {
25865
+
25866
+ if ( planesToRemove === null ) {
25867
+
25868
+ planesToRemove = [];
25869
+
25870
+ }
25871
+
25872
+ planesToRemove.push( plane );
25873
+
25874
+ }
25875
+
25876
+ }
25877
+
25878
+ if ( planesToRemove !== null ) {
25879
+
25880
+ for ( const plane of planesToRemove ) {
25881
+
25882
+ planes.delete( plane );
25883
+ planesLastChangedTimes.delete( plane );
25884
+ scope.dispatchEvent( { type: 'planeremoved', data: plane } );
25885
+
25886
+ }
25887
+
25888
+ }
25889
+
25890
+ for ( const plane of frame.detectedPlanes ) {
25891
+
25892
+ if ( ! planes.has( plane ) ) {
25893
+
25894
+ planes.add( plane );
25895
+ planesLastChangedTimes.set( plane, frame.lastChangedTime );
25896
+ scope.dispatchEvent( { type: 'planeadded', data: plane } );
25897
+
25898
+ } else {
25899
+
25900
+ const lastKnownTime = planesLastChangedTimes.get( plane );
25901
+
25902
+ if ( plane.lastChangedTime > lastKnownTime ) {
25903
+
25904
+ planesLastChangedTimes.set( plane, plane.lastChangedTime );
25905
+ scope.dispatchEvent( { type: 'planechanged', data: plane } );
25906
+
25907
+ }
25908
+
25909
+ }
25910
+
25911
+ }
25912
+
25913
+ }
25914
+
25731
25915
  xrFrame = null;
25732
25916
 
25733
25917
  }
@@ -25752,7 +25936,7 @@
25752
25936
 
25753
25937
  function refreshFogUniforms( uniforms, fog ) {
25754
25938
 
25755
- uniforms.fogColor.value.copy( fog.color );
25939
+ fog.color.getRGB( uniforms.fogColor.value, getUnlitUniformColorSpace( renderer ) );
25756
25940
 
25757
25941
  if ( fog.isFog ) {
25758
25942
 
@@ -26526,43 +26710,52 @@
26526
26710
 
26527
26711
  if ( hasUniformChanged( uniform, i, cache ) === true ) {
26528
26712
 
26529
- const value = uniform.value;
26530
26713
  const offset = uniform.__offset;
26531
26714
 
26532
- if ( typeof value === 'number' ) {
26715
+ const values = Array.isArray( uniform.value ) ? uniform.value : [ uniform.value ];
26533
26716
 
26534
- uniform.__data[ 0 ] = value;
26535
- gl.bufferSubData( 35345, offset, uniform.__data );
26717
+ let arrayOffset = 0;
26536
26718
 
26537
- } else {
26719
+ for ( let i = 0; i < values.length; i ++ ) {
26720
+
26721
+ const value = values[ i ];
26722
+
26723
+ const info = getUniformSize( value );
26724
+
26725
+ if ( typeof value === 'number' ) {
26538
26726
 
26539
- if ( uniform.value.isMatrix3 ) {
26727
+ uniform.__data[ 0 ] = value;
26728
+ gl.bufferSubData( 35345, offset + arrayOffset, uniform.__data );
26729
+
26730
+ } else if ( value.isMatrix3 ) {
26540
26731
 
26541
26732
  // manually converting 3x3 to 3x4
26542
26733
 
26543
- uniform.__data[ 0 ] = uniform.value.elements[ 0 ];
26544
- uniform.__data[ 1 ] = uniform.value.elements[ 1 ];
26545
- uniform.__data[ 2 ] = uniform.value.elements[ 2 ];
26546
- uniform.__data[ 3 ] = uniform.value.elements[ 0 ];
26547
- uniform.__data[ 4 ] = uniform.value.elements[ 3 ];
26548
- uniform.__data[ 5 ] = uniform.value.elements[ 4 ];
26549
- uniform.__data[ 6 ] = uniform.value.elements[ 5 ];
26550
- uniform.__data[ 7 ] = uniform.value.elements[ 0 ];
26551
- uniform.__data[ 8 ] = uniform.value.elements[ 6 ];
26552
- uniform.__data[ 9 ] = uniform.value.elements[ 7 ];
26553
- uniform.__data[ 10 ] = uniform.value.elements[ 8 ];
26554
- uniform.__data[ 11 ] = uniform.value.elements[ 0 ];
26734
+ uniform.__data[ 0 ] = value.elements[ 0 ];
26735
+ uniform.__data[ 1 ] = value.elements[ 1 ];
26736
+ uniform.__data[ 2 ] = value.elements[ 2 ];
26737
+ uniform.__data[ 3 ] = value.elements[ 0 ];
26738
+ uniform.__data[ 4 ] = value.elements[ 3 ];
26739
+ uniform.__data[ 5 ] = value.elements[ 4 ];
26740
+ uniform.__data[ 6 ] = value.elements[ 5 ];
26741
+ uniform.__data[ 7 ] = value.elements[ 0 ];
26742
+ uniform.__data[ 8 ] = value.elements[ 6 ];
26743
+ uniform.__data[ 9 ] = value.elements[ 7 ];
26744
+ uniform.__data[ 10 ] = value.elements[ 8 ];
26745
+ uniform.__data[ 11 ] = value.elements[ 0 ];
26555
26746
 
26556
26747
  } else {
26557
26748
 
26558
- value.toArray( uniform.__data );
26749
+ value.toArray( uniform.__data, arrayOffset );
26559
26750
 
26560
- }
26751
+ arrayOffset += info.storage / Float32Array.BYTES_PER_ELEMENT;
26561
26752
 
26562
- gl.bufferSubData( 35345, offset, uniform.__data );
26753
+ }
26563
26754
 
26564
26755
  }
26565
26756
 
26757
+ gl.bufferSubData( 35345, offset, uniform.__data );
26758
+
26566
26759
  }
26567
26760
 
26568
26761
  }
@@ -26585,7 +26778,17 @@
26585
26778
 
26586
26779
  } else {
26587
26780
 
26588
- cache[ index ] = value.clone();
26781
+ const values = Array.isArray( value ) ? value : [ value ];
26782
+
26783
+ const tempValues = [];
26784
+
26785
+ for ( let i = 0; i < values.length; i ++ ) {
26786
+
26787
+ tempValues.push( values[ i ].clone() );
26788
+
26789
+ }
26790
+
26791
+ cache[ index ] = tempValues;
26589
26792
 
26590
26793
  }
26591
26794
 
@@ -26606,12 +26809,19 @@
26606
26809
 
26607
26810
  } else {
26608
26811
 
26609
- const cachedObject = cache[ index ];
26812
+ const cachedObjects = Array.isArray( cache[ index ] ) ? cache[ index ] : [ cache[ index ] ];
26813
+ const values = Array.isArray( value ) ? value : [ value ];
26610
26814
 
26611
- if ( cachedObject.equals( value ) === false ) {
26815
+ for ( let i = 0; i < cachedObjects.length; i ++ ) {
26612
26816
 
26613
- cachedObject.copy( value );
26614
- return true;
26817
+ const cachedObject = cachedObjects[ i ];
26818
+
26819
+ if ( cachedObject.equals( values[ i ] ) === false ) {
26820
+
26821
+ cachedObject.copy( values[ i ] );
26822
+ return true;
26823
+
26824
+ }
26615
26825
 
26616
26826
  }
26617
26827
 
@@ -26637,11 +26847,28 @@
26637
26847
  for ( let i = 0, l = uniforms.length; i < l; i ++ ) {
26638
26848
 
26639
26849
  const uniform = uniforms[ i ];
26640
- const info = getUniformSize( uniform );
26850
+
26851
+ const infos = {
26852
+ boundary: 0, // bytes
26853
+ storage: 0 // bytes
26854
+ };
26855
+
26856
+ const values = Array.isArray( uniform.value ) ? uniform.value : [ uniform.value ];
26857
+
26858
+ for ( let j = 0, jl = values.length; j < jl; j ++ ) {
26859
+
26860
+ const value = values[ j ];
26861
+
26862
+ const info = getUniformSize( value );
26863
+
26864
+ infos.boundary += info.boundary;
26865
+ infos.storage += info.storage;
26866
+
26867
+ }
26641
26868
 
26642
26869
  // the following two properties will be used for partial buffer updates
26643
26870
 
26644
- uniform.__data = new Float32Array( info.storage / Float32Array.BYTES_PER_ELEMENT );
26871
+ uniform.__data = new Float32Array( infos.storage / Float32Array.BYTES_PER_ELEMENT );
26645
26872
  uniform.__offset = offset;
26646
26873
 
26647
26874
  //
@@ -26654,7 +26881,7 @@
26654
26881
 
26655
26882
  // check for chunk overflow
26656
26883
 
26657
- if ( chunkOffset !== 0 && ( remainingSizeInChunk - info.boundary ) < 0 ) {
26884
+ if ( chunkOffset !== 0 && ( remainingSizeInChunk - infos.boundary ) < 0 ) {
26658
26885
 
26659
26886
  // add padding and adjust offset
26660
26887
 
@@ -26665,7 +26892,7 @@
26665
26892
 
26666
26893
  }
26667
26894
 
26668
- offset += info.storage;
26895
+ offset += infos.storage;
26669
26896
 
26670
26897
  }
26671
26898
 
@@ -26684,9 +26911,7 @@
26684
26911
 
26685
26912
  }
26686
26913
 
26687
- function getUniformSize( uniform ) {
26688
-
26689
- const value = uniform.value;
26914
+ function getUniformSize( value ) {
26690
26915
 
26691
26916
  const info = {
26692
26917
  boundary: 0, // bytes
@@ -26879,28 +27104,6 @@
26879
27104
  this.toneMapping = NoToneMapping;
26880
27105
  this.toneMappingExposure = 1.0;
26881
27106
 
26882
- //
26883
-
26884
- Object.defineProperties( this, {
26885
-
26886
- // @deprecated since r136, 0e21088102b4de7e0a0a33140620b7a3424b9e6d
26887
-
26888
- gammaFactor: {
26889
- get: function () {
26890
-
26891
- console.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' );
26892
- return 2;
26893
-
26894
- },
26895
- set: function () {
26896
-
26897
- console.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' );
26898
-
26899
- }
26900
- }
26901
-
26902
- } );
26903
-
26904
27107
  // internal properties
26905
27108
 
26906
27109
  const _this = this;
@@ -27467,31 +27670,48 @@
27467
27670
  //
27468
27671
 
27469
27672
  let index = geometry.index;
27470
- const position = geometry.attributes.position;
27673
+ let rangeFactor = 1;
27674
+
27675
+ if ( material.wireframe === true ) {
27676
+
27677
+ index = geometries.getWireframeAttribute( geometry );
27678
+ rangeFactor = 2;
27679
+
27680
+ }
27471
27681
 
27472
27682
  //
27473
27683
 
27474
- if ( index === null ) {
27684
+ const drawRange = geometry.drawRange;
27685
+ const position = geometry.attributes.position;
27475
27686
 
27476
- if ( position === undefined || position.count === 0 ) return;
27687
+ let drawStart = drawRange.start * rangeFactor;
27688
+ let drawEnd = ( drawRange.start + drawRange.count ) * rangeFactor;
27477
27689
 
27478
- } else if ( index.count === 0 ) {
27690
+ if ( group !== null ) {
27479
27691
 
27480
- return;
27692
+ drawStart = Math.max( drawStart, group.start * rangeFactor );
27693
+ drawEnd = Math.min( drawEnd, ( group.start + group.count ) * rangeFactor );
27481
27694
 
27482
27695
  }
27483
27696
 
27484
- //
27697
+ if ( index !== null ) {
27485
27698
 
27486
- let rangeFactor = 1;
27699
+ drawStart = Math.max( drawStart, 0 );
27700
+ drawEnd = Math.min( drawEnd, index.count );
27487
27701
 
27488
- if ( material.wireframe === true ) {
27702
+ } else if ( position !== undefined && position !== null ) {
27489
27703
 
27490
- index = geometries.getWireframeAttribute( geometry );
27491
- rangeFactor = 2;
27704
+ drawStart = Math.max( drawStart, 0 );
27705
+ drawEnd = Math.min( drawEnd, position.count );
27492
27706
 
27493
27707
  }
27494
27708
 
27709
+ const drawCount = drawEnd - drawStart;
27710
+
27711
+ if ( drawCount < 0 || drawCount === Infinity ) return;
27712
+
27713
+ //
27714
+
27495
27715
  bindingStates.setup( object, material, program, geometry, index );
27496
27716
 
27497
27717
  let attribute;
@@ -27508,23 +27728,6 @@
27508
27728
 
27509
27729
  //
27510
27730
 
27511
- const dataCount = ( index !== null ) ? index.count : position.count;
27512
-
27513
- const rangeStart = geometry.drawRange.start * rangeFactor;
27514
- const rangeCount = geometry.drawRange.count * rangeFactor;
27515
-
27516
- const groupStart = group !== null ? group.start * rangeFactor : 0;
27517
- const groupCount = group !== null ? group.count * rangeFactor : Infinity;
27518
-
27519
- const drawStart = Math.max( rangeStart, groupStart );
27520
- const drawEnd = Math.min( dataCount, rangeStart + rangeCount, groupStart + groupCount ) - 1;
27521
-
27522
- const drawCount = Math.max( 0, drawEnd - drawStart + 1 );
27523
-
27524
- if ( drawCount === 0 ) return;
27525
-
27526
- //
27527
-
27528
27731
  if ( object.isMesh ) {
27529
27732
 
27530
27733
  if ( material.wireframe === true ) {
@@ -27576,7 +27779,8 @@
27576
27779
 
27577
27780
  } else if ( geometry.isInstancedBufferGeometry ) {
27578
27781
 
27579
- const instanceCount = Math.min( geometry.instanceCount, geometry._maxInstanceCount );
27782
+ const maxInstanceCount = geometry._maxInstanceCount !== undefined ? geometry._maxInstanceCount : Infinity;
27783
+ const instanceCount = Math.min( geometry.instanceCount, maxInstanceCount );
27580
27784
 
27581
27785
  renderer.renderInstances( drawStart, drawCount, instanceCount );
27582
27786
 
@@ -27594,7 +27798,7 @@
27594
27798
 
27595
27799
  function prepare( material, scene, object ) {
27596
27800
 
27597
- if ( material.transparent === true && material.side === DoubleSide ) {
27801
+ if ( material.transparent === true && material.side === TwoPassDoubleSide ) {
27598
27802
 
27599
27803
  material.side = BackSide;
27600
27804
  material.needsUpdate = true;
@@ -27604,7 +27808,7 @@
27604
27808
  material.needsUpdate = true;
27605
27809
  getProgram( material, scene, object );
27606
27810
 
27607
- material.side = DoubleSide;
27811
+ material.side = TwoPassDoubleSide;
27608
27812
 
27609
27813
  } else {
27610
27814
 
@@ -28076,7 +28280,7 @@
28076
28280
 
28077
28281
  material.onBeforeRender( _this, scene, camera, geometry, object, group );
28078
28282
 
28079
- if ( material.transparent === true && material.side === DoubleSide ) {
28283
+ if ( material.transparent === true && material.side === TwoPassDoubleSide ) {
28080
28284
 
28081
28285
  material.side = BackSide;
28082
28286
  material.needsUpdate = true;
@@ -28086,7 +28290,7 @@
28086
28290
  material.needsUpdate = true;
28087
28291
  _this.renderBufferDirect( camera, scene, geometry, material, object, group );
28088
28292
 
28089
- material.side = DoubleSide;
28293
+ material.side = TwoPassDoubleSide;
28090
28294
 
28091
28295
  } else {
28092
28296
 
@@ -29036,6 +29240,7 @@
29036
29240
  this.fog = null;
29037
29241
 
29038
29242
  this.backgroundBlurriness = 0;
29243
+ this.backgroundIntensity = 1;
29039
29244
 
29040
29245
  this.overrideMaterial = null;
29041
29246
 
@@ -29056,6 +29261,7 @@
29056
29261
  if ( source.fog !== null ) this.fog = source.fog.clone();
29057
29262
 
29058
29263
  this.backgroundBlurriness = source.backgroundBlurriness;
29264
+ this.backgroundIntensity = source.backgroundIntensity;
29059
29265
 
29060
29266
  if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();
29061
29267
 
@@ -29071,6 +29277,7 @@
29071
29277
 
29072
29278
  if ( this.fog !== null ) data.object.fog = this.fog.toJSON();
29073
29279
  if ( this.backgroundBlurriness > 0 ) data.backgroundBlurriness = this.backgroundBlurriness;
29280
+ if ( this.backgroundIntensity !== 1 ) data.backgroundIntensity = this.backgroundIntensity;
29074
29281
 
29075
29282
  return data;
29076
29283
 
@@ -29249,7 +29456,7 @@
29249
29456
  this.itemSize = itemSize;
29250
29457
  this.offset = offset;
29251
29458
 
29252
- this.normalized = normalized === true;
29459
+ this.normalized = normalized;
29253
29460
 
29254
29461
  }
29255
29462
 
@@ -29463,7 +29670,7 @@
29463
29670
 
29464
29671
  if ( data === undefined ) {
29465
29672
 
29466
- console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will deinterleave buffer data.' );
29673
+ console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' );
29467
29674
 
29468
29675
  const array = [];
29469
29676
 
@@ -29505,7 +29712,7 @@
29505
29712
 
29506
29713
  if ( data === undefined ) {
29507
29714
 
29508
- console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will deinterleave buffer data.' );
29715
+ console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' );
29509
29716
 
29510
29717
  const array = [];
29511
29718
 
@@ -29521,7 +29728,7 @@
29521
29728
 
29522
29729
  }
29523
29730
 
29524
- // deinterleave data and save it as an ordinary buffer attribute for now
29731
+ // de-interleave data and save it as an ordinary buffer attribute for now
29525
29732
 
29526
29733
  return {
29527
29734
  itemSize: this.itemSize,
@@ -29532,7 +29739,7 @@
29532
29739
 
29533
29740
  } else {
29534
29741
 
29535
- // save as true interleaved attribtue
29742
+ // save as true interleaved attribute
29536
29743
 
29537
29744
  if ( data.interleavedBuffers === undefined ) {
29538
29745
 
@@ -31787,7 +31994,7 @@
31787
31994
 
31788
31995
  class CircleGeometry extends BufferGeometry {
31789
31996
 
31790
- constructor( radius = 1, segments = 8, thetaStart = 0, thetaLength = Math.PI * 2 ) {
31997
+ constructor( radius = 1, segments = 32, thetaStart = 0, thetaLength = Math.PI * 2 ) {
31791
31998
 
31792
31999
  super();
31793
32000
 
@@ -31871,7 +32078,7 @@
31871
32078
 
31872
32079
  class CylinderGeometry extends BufferGeometry {
31873
32080
 
31874
- constructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {
32081
+ constructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 32, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) {
31875
32082
 
31876
32083
  super();
31877
32084
 
@@ -35217,15 +35424,9 @@
35217
35424
 
35218
35425
  }
35219
35426
 
35220
- clone() {
35221
-
35222
- return new this.constructor().copy( this );
35223
-
35224
- }
35225
-
35226
35427
  toJSON() {
35227
35428
 
35228
- const data = super.toJSON( this );
35429
+ const data = super.toJSON();
35229
35430
 
35230
35431
  data.instanceCount = this.instanceCount;
35231
35432
 
@@ -37255,10 +37456,14 @@
37255
37456
  update: update,
37256
37457
  };
37257
37458
 
37258
- var earcut$1 = {exports: {}};
37459
+ var earcutExports = {};
37460
+ var earcut$1 = {
37461
+ get exports(){ return earcutExports; },
37462
+ set exports(v){ earcutExports = v; },
37463
+ };
37259
37464
 
37260
37465
  earcut$1.exports = earcut;
37261
- earcut$1.exports.default = earcut;
37466
+ earcutExports.default = earcut;
37262
37467
 
37263
37468
  function earcut(data, holeIndices, dim) {
37264
37469
 
@@ -38712,7 +38917,8 @@
38712
38917
  }
38713
38918
 
38714
38919
  function rotationIdentity(lambda, phi) {
38715
- return [abs(lambda) > pi$1 ? lambda + Math.round(-lambda / tau$1) * tau$1 : lambda, phi];
38920
+ if (abs(lambda) > pi$1) lambda -= Math.round(lambda / tau$1) * tau$1;
38921
+ return [lambda, phi];
38716
38922
  }
38717
38923
 
38718
38924
  rotationIdentity.invert = rotationIdentity;
@@ -38726,7 +38932,9 @@
38726
38932
 
38727
38933
  function forwardRotationLambda(deltaLambda) {
38728
38934
  return function(lambda, phi) {
38729
- return lambda += deltaLambda, [lambda > pi$1 ? lambda - tau$1 : lambda < -pi$1 ? lambda + tau$1 : lambda, phi];
38935
+ lambda += deltaLambda;
38936
+ if (abs(lambda) > pi$1) lambda -= Math.round(lambda / tau$1) * tau$1;
38937
+ return [lambda, phi];
38730
38938
  };
38731
38939
  }
38732
38940
 
@@ -40643,7 +40851,7 @@
40643
40851
  return polar2Cartesian$2(lat, lng, r);
40644
40852
  });
40645
40853
 
40646
- var _earcut$flatten = earcut$1.exports.flatten([coords3d]),
40854
+ var _earcut$flatten = earcutExports.flatten([coords3d]),
40647
40855
  vertices = _earcut$flatten.vertices;
40648
40856
 
40649
40857
  var numPoints = Math.round(vertices.length / 3);
@@ -40686,7 +40894,7 @@
40686
40894
  });
40687
40895
  }); // Each point generates 3 vertice items (x,y,z).
40688
40896
 
40689
- var _earcut$flatten2 = earcut$1.exports.flatten(coords3d),
40897
+ var _earcut$flatten2 = earcutExports.flatten(coords3d),
40690
40898
  vertices = _earcut$flatten2.vertices,
40691
40899
  holes = _earcut$flatten2.holes;
40692
40900
 
@@ -42002,6 +42210,112 @@
42002
42210
 
42003
42211
  }
42004
42212
 
42213
+
42214
+ // Creates a new, non-indexed geometry with smooth normals everywhere except faces that meet at
42215
+ // an angle greater than the crease angle.
42216
+ function toCreasedNormals( geometry, creaseAngle = Math.PI / 3 /* 60 degrees */ ) {
42217
+
42218
+ const creaseDot = Math.cos( creaseAngle );
42219
+ const hashMultiplier = ( 1 + 1e-10 ) * 1e2;
42220
+
42221
+ // reusable vertors
42222
+ const verts = [ new Vector3(), new Vector3(), new Vector3() ];
42223
+ const tempVec1 = new Vector3();
42224
+ const tempVec2 = new Vector3();
42225
+ const tempNorm = new Vector3();
42226
+ const tempNorm2 = new Vector3();
42227
+
42228
+ // hashes a vector
42229
+ function hashVertex( v ) {
42230
+
42231
+ const x = ~ ~ ( v.x * hashMultiplier );
42232
+ const y = ~ ~ ( v.y * hashMultiplier );
42233
+ const z = ~ ~ ( v.z * hashMultiplier );
42234
+ return `${x},${y},${z}`;
42235
+
42236
+ }
42237
+
42238
+ const resultGeometry = geometry.toNonIndexed();
42239
+ const posAttr = resultGeometry.attributes.position;
42240
+ const vertexMap = {};
42241
+
42242
+ // find all the normals shared by commonly located vertices
42243
+ for ( let i = 0, l = posAttr.count / 3; i < l; i ++ ) {
42244
+
42245
+ const i3 = 3 * i;
42246
+ const a = verts[ 0 ].fromBufferAttribute( posAttr, i3 + 0 );
42247
+ const b = verts[ 1 ].fromBufferAttribute( posAttr, i3 + 1 );
42248
+ const c = verts[ 2 ].fromBufferAttribute( posAttr, i3 + 2 );
42249
+
42250
+ tempVec1.subVectors( c, b );
42251
+ tempVec2.subVectors( a, b );
42252
+
42253
+ // add the normal to the map for all vertices
42254
+ const normal = new Vector3().crossVectors( tempVec1, tempVec2 ).normalize();
42255
+ for ( let n = 0; n < 3; n ++ ) {
42256
+
42257
+ const vert = verts[ n ];
42258
+ const hash = hashVertex( vert );
42259
+ if ( ! ( hash in vertexMap ) ) {
42260
+
42261
+ vertexMap[ hash ] = [];
42262
+
42263
+ }
42264
+
42265
+ vertexMap[ hash ].push( normal );
42266
+
42267
+ }
42268
+
42269
+ }
42270
+
42271
+ // average normals from all vertices that share a common location if they are within the
42272
+ // provided crease threshold
42273
+ const normalArray = new Float32Array( posAttr.count * 3 );
42274
+ const normAttr = new BufferAttribute( normalArray, 3, false );
42275
+ for ( let i = 0, l = posAttr.count / 3; i < l; i ++ ) {
42276
+
42277
+ // get the face normal for this vertex
42278
+ const i3 = 3 * i;
42279
+ const a = verts[ 0 ].fromBufferAttribute( posAttr, i3 + 0 );
42280
+ const b = verts[ 1 ].fromBufferAttribute( posAttr, i3 + 1 );
42281
+ const c = verts[ 2 ].fromBufferAttribute( posAttr, i3 + 2 );
42282
+
42283
+ tempVec1.subVectors( c, b );
42284
+ tempVec2.subVectors( a, b );
42285
+
42286
+ tempNorm.crossVectors( tempVec1, tempVec2 ).normalize();
42287
+
42288
+ // average all normals that meet the threshold and set the normal value
42289
+ for ( let n = 0; n < 3; n ++ ) {
42290
+
42291
+ const vert = verts[ n ];
42292
+ const hash = hashVertex( vert );
42293
+ const otherNormals = vertexMap[ hash ];
42294
+ tempNorm2.set( 0, 0, 0 );
42295
+
42296
+ for ( let k = 0, lk = otherNormals.length; k < lk; k ++ ) {
42297
+
42298
+ const otherNorm = otherNormals[ k ];
42299
+ if ( tempNorm.dot( otherNorm ) > creaseDot ) {
42300
+
42301
+ tempNorm2.add( otherNorm );
42302
+
42303
+ }
42304
+
42305
+ }
42306
+
42307
+ tempNorm2.normalize();
42308
+ normAttr.setXYZ( i3 + n, tempNorm2.x, tempNorm2.y, tempNorm2.z );
42309
+
42310
+ }
42311
+
42312
+ }
42313
+
42314
+ resultGeometry.setAttribute( 'normal', normAttr );
42315
+ return resultGeometry;
42316
+
42317
+ }
42318
+
42005
42319
  var _bfg = /*#__PURE__*/Object.freeze({
42006
42320
  __proto__: null,
42007
42321
  deepCloneAttribute: deepCloneAttribute,
@@ -42016,7 +42330,8 @@
42016
42330
  mergeVertices: mergeVertices,
42017
42331
  toTrianglesDrawMode: toTrianglesDrawMode,
42018
42332
  computeMorphedAttributes: computeMorphedAttributes,
42019
- mergeGroups: mergeGroups
42333
+ mergeGroups: mergeGroups,
42334
+ toCreasedNormals: toCreasedNormals
42020
42335
  });
42021
42336
 
42022
42337
  var index$1 = (function (p) {
@@ -42029,7 +42344,11 @@
42029
42344
  };
42030
42345
  }); // constant
42031
42346
 
42032
- var tinycolor = {exports: {}};
42347
+ var tinycolorExports = {};
42348
+ var tinycolor = {
42349
+ get exports(){ return tinycolorExports; },
42350
+ set exports(v){ tinycolorExports = v; },
42351
+ };
42033
42352
 
42034
42353
  (function (module) {
42035
42354
  // TinyColor v1.4.2
@@ -43225,7 +43544,7 @@
43225
43544
  })(Math);
43226
43545
  } (tinycolor));
43227
43546
 
43228
- var tinyColor = tinycolor.exports;
43547
+ var tinyColor = tinycolorExports;
43229
43548
 
43230
43549
  function _objectWithoutPropertiesLoose$3(source, excluded) {
43231
43550
  if (source == null) return {};
@@ -43338,7 +43657,7 @@
43338
43657
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
43339
43658
  }
43340
43659
 
43341
- function _toPrimitive(input, hint) {
43660
+ function _toPrimitive$4(input, hint) {
43342
43661
  if (typeof input !== "object" || input === null) return input;
43343
43662
  var prim = input[Symbol.toPrimitive];
43344
43663
 
@@ -43351,8 +43670,8 @@
43351
43670
  return (hint === "string" ? String : Number)(input);
43352
43671
  }
43353
43672
 
43354
- function _toPropertyKey(arg) {
43355
- var key = _toPrimitive(arg, "string");
43673
+ function _toPropertyKey$4(arg) {
43674
+ var key = _toPrimitive$4(arg, "string");
43356
43675
 
43357
43676
  return typeof key === "symbol" ? key : String(key);
43358
43677
  }
@@ -43379,7 +43698,7 @@
43379
43698
  if (isProp) {
43380
43699
  var _itemVal = itemVal,
43381
43700
  propVal = _itemVal[keyAccessor],
43382
- rest = _objectWithoutProperties$3(_itemVal, [keyAccessor].map(_toPropertyKey));
43701
+ rest = _objectWithoutProperties$3(_itemVal, [keyAccessor].map(_toPropertyKey$4));
43383
43702
 
43384
43703
  key = propVal;
43385
43704
  itemVal = rest;
@@ -43760,13 +44079,17 @@
43760
44079
  }
43761
44080
  }
43762
44081
 
43763
- var FrameTicker$3 = {exports: {}};
44082
+ var FrameTickerExports = {};
44083
+ var FrameTicker$3 = {
44084
+ get exports(){ return FrameTickerExports; },
44085
+ set exports(v){ FrameTickerExports = v; },
44086
+ };
43764
44087
 
43765
44088
  (function (module, exports) {
43766
44089
  !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;}])});}])});
43767
44090
  } (FrameTicker$3));
43768
44091
 
43769
- var _FrameTicker = /*@__PURE__*/getDefaultExportFromCjs(FrameTicker$3.exports);
44092
+ var _FrameTicker = /*@__PURE__*/getDefaultExportFromCjs(FrameTickerExports);
43770
44093
 
43771
44094
  function initRange(domain, range) {
43772
44095
  switch (arguments.length) {
@@ -47100,6 +47423,33 @@
47100
47423
  return data ? v(data) : v;
47101
47424
  }
47102
47425
 
47426
+ function _iterableToArrayLimit$2(arr, i) {
47427
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
47428
+ if (null != _i) {
47429
+ var _s,
47430
+ _e,
47431
+ _x,
47432
+ _r,
47433
+ _arr = [],
47434
+ _n = !0,
47435
+ _d = !1;
47436
+ try {
47437
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
47438
+ if (Object(_i) !== _i) return;
47439
+ _n = !1;
47440
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
47441
+ } catch (err) {
47442
+ _d = !0, _e = err;
47443
+ } finally {
47444
+ try {
47445
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
47446
+ } finally {
47447
+ if (_d) throw _e;
47448
+ }
47449
+ }
47450
+ return _arr;
47451
+ }
47452
+ }
47103
47453
  function _classCallCheck$1(instance, Constructor) {
47104
47454
  if (!(instance instanceof Constructor)) {
47105
47455
  throw new TypeError("Cannot call a class as a function");
@@ -47111,7 +47461,7 @@
47111
47461
  descriptor.enumerable = descriptor.enumerable || false;
47112
47462
  descriptor.configurable = true;
47113
47463
  if ("value" in descriptor) descriptor.writable = true;
47114
- Object.defineProperty(target, descriptor.key, descriptor);
47464
+ Object.defineProperty(target, _toPropertyKey$3(descriptor.key), descriptor);
47115
47465
  }
47116
47466
  }
47117
47467
  function _createClass$1(Constructor, protoProps, staticProps) {
@@ -47205,30 +47555,6 @@
47205
47555
  function _iterableToArray$3(iter) {
47206
47556
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
47207
47557
  }
47208
- function _iterableToArrayLimit$2(arr, i) {
47209
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
47210
- if (_i == null) return;
47211
- var _arr = [];
47212
- var _n = true;
47213
- var _d = false;
47214
- var _s, _e;
47215
- try {
47216
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
47217
- _arr.push(_s.value);
47218
- if (i && _arr.length === i) break;
47219
- }
47220
- } catch (err) {
47221
- _d = true;
47222
- _e = err;
47223
- } finally {
47224
- try {
47225
- if (!_n && _i["return"] != null) _i["return"]();
47226
- } finally {
47227
- if (_d) throw _e;
47228
- }
47229
- }
47230
- return _arr;
47231
- }
47232
47558
  function _unsupportedIterableToArray$3(o, minLen) {
47233
47559
  if (!o) return;
47234
47560
  if (typeof o === "string") return _arrayLikeToArray$3(o, minLen);
@@ -47248,6 +47574,20 @@
47248
47574
  function _nonIterableRest$2() {
47249
47575
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
47250
47576
  }
47577
+ function _toPrimitive$3(input, hint) {
47578
+ if (typeof input !== "object" || input === null) return input;
47579
+ var prim = input[Symbol.toPrimitive];
47580
+ if (prim !== undefined) {
47581
+ var res = prim.call(input, hint || "default");
47582
+ if (typeof res !== "object") return res;
47583
+ throw new TypeError("@@toPrimitive must return a primitive value.");
47584
+ }
47585
+ return (hint === "string" ? String : Number)(input);
47586
+ }
47587
+ function _toPropertyKey$3(arg) {
47588
+ var key = _toPrimitive$3(arg, "string");
47589
+ return typeof key === "symbol" ? key : String(key);
47590
+ }
47251
47591
 
47252
47592
  function geoPolygonTriangulate(polygon) {
47253
47593
  var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
@@ -47308,42 +47648,40 @@
47308
47648
  });
47309
47649
  } else if (!innerPoints.length) {
47310
47650
  // earcut triangulation slightly more performing if it's only using the polygon perimeter
47311
- var _earcut$flatten = earcut$1.exports.flatten(contour),
47651
+ var _earcut$flatten = earcutExports.flatten(contour),
47312
47652
  vertices = _earcut$flatten.vertices,
47313
47653
  _earcut$flatten$holes = _earcut$flatten.holes,
47314
47654
  holes = _earcut$flatten$holes === void 0 ? [] : _earcut$flatten$holes;
47315
- indices = earcut$1.exports(vertices, holes, 2);
47655
+ indices = earcutExports(vertices, holes, 2);
47316
47656
  } else {
47317
- (function () {
47318
- // use delaunator
47319
- var delaunay = Delaunator.from(points);
47320
- var _loop = function _loop(i, len) {
47321
- var _indices2;
47322
- var inds = [2, 1, 0].map(function (idx) {
47323
- return delaunay.triangles[i + idx];
47324
- }); // reverse wound to have same orientation as earcut
47325
- var triangle = inds.map(function (indice) {
47326
- return points[indice];
47327
- });
47657
+ // use delaunator
47658
+ var delaunay = Delaunator.from(points);
47659
+ var _loop = function _loop(i) {
47660
+ var _indices2;
47661
+ var inds = [2, 1, 0].map(function (idx) {
47662
+ return delaunay.triangles[i + idx];
47663
+ }); // reverse wound to have same orientation as earcut
47664
+ var triangle = inds.map(function (indice) {
47665
+ return points[indice];
47666
+ });
47328
47667
 
47329
- // exclude edge triangles outside polygon perimeter or through holes
47330
- if (inds.some(function (ind) {
47331
- return ind < edgePoints.length;
47332
- })) {
47333
- var triangleCentroid = [0, 1].map(function (coordIdx) {
47334
- return mean(triangle, function (p) {
47335
- return p[coordIdx];
47336
- });
47668
+ // exclude edge triangles outside polygon perimeter or through holes
47669
+ if (inds.some(function (ind) {
47670
+ return ind < edgePoints.length;
47671
+ })) {
47672
+ var triangleCentroid = [0, 1].map(function (coordIdx) {
47673
+ return mean(triangle, function (p) {
47674
+ return p[coordIdx];
47337
47675
  });
47338
- if (!pointInside(triangleCentroid, boundariesGeojson, crossesPoleOrAntimeridian)) return "continue";
47339
- }
47340
- (_indices2 = indices).push.apply(_indices2, _toConsumableArray$3(inds));
47341
- };
47342
- for (var i = 0, len = delaunay.triangles.length; i < len; i += 3) {
47343
- var _ret = _loop(i);
47344
- if (_ret === "continue") continue;
47676
+ });
47677
+ if (!pointInside(triangleCentroid, boundariesGeojson, crossesPoleOrAntimeridian)) return "continue";
47345
47678
  }
47346
- })();
47679
+ (_indices2 = indices).push.apply(_indices2, _toConsumableArray$3(inds));
47680
+ };
47681
+ for (var i = 0, len = delaunay.triangles.length; i < len; i += 3) {
47682
+ var _ret = _loop(i);
47683
+ if (_ret === "continue") continue;
47684
+ }
47347
47685
  }
47348
47686
 
47349
47687
  // calc uvs
@@ -47544,7 +47882,7 @@
47544
47882
  });
47545
47883
  });
47546
47884
  // returns { vertices, holes, coordinates }. Each point generates 3 vertice items (x,y,z).
47547
- return earcut$1.exports.flatten(coords3d);
47885
+ return earcutExports.flatten(coords3d);
47548
47886
  }
47549
47887
  function generateTorso() {
47550
47888
  var _generateVertices = generateVertices(contour, startHeight),
@@ -47572,11 +47910,7 @@
47572
47910
  indices.push(v1Idx + numPoints, v1Idx, v0Idx);
47573
47911
  }
47574
47912
  var uvs = []; // wrap texture around perimeter (u), with v=1 on top
47575
- for (var v = 1; v >= 0; v--) {
47576
- for (var i = 0; i < numPoints; i += 1) {
47577
- uvs.push(i / (numPoints - 1), v);
47578
- }
47579
- }
47913
+ for (var v = 1; v >= 0; v--) for (var i = 0; i < numPoints; i += 1) uvs.push(i / (numPoints - 1), v);
47580
47914
  return {
47581
47915
  indices: indices,
47582
47916
  vertices: vertices,
@@ -61819,14 +62153,12 @@
61819
62153
  Sphere,
61820
62154
  Vector3,
61821
62155
  WireframeGeometry
61822
- }; // support multiple method names for backwards threejs compatibility
62156
+ };
61823
62157
 
62158
+ // support multiple method names for backwards threejs compatibility
61824
62159
  var setAttributeFn$1$1 = new THREE$2$1.BufferGeometry().setAttribute ? 'setAttribute' : 'addAttribute';
61825
-
61826
62160
  const _box$1 = new THREE$2$1.Box3();
61827
-
61828
62161
  const _vector = new THREE$2$1.Vector3();
61829
-
61830
62162
  class LineSegmentsGeometry extends THREE$2$1.InstancedBufferGeometry {
61831
62163
  constructor() {
61832
62164
  super();
@@ -61838,37 +62170,29 @@
61838
62170
  this[setAttributeFn$1$1]('position', new THREE$2$1.Float32BufferAttribute(positions, 3));
61839
62171
  this[setAttributeFn$1$1]('uv', new THREE$2$1.Float32BufferAttribute(uvs, 2));
61840
62172
  }
61841
-
61842
62173
  applyMatrix4(matrix) {
61843
62174
  const start = this.attributes.instanceStart;
61844
62175
  const end = this.attributes.instanceEnd;
61845
-
61846
62176
  if (start !== undefined) {
61847
62177
  start.applyMatrix4(matrix);
61848
62178
  end.applyMatrix4(matrix);
61849
62179
  start.needsUpdate = true;
61850
62180
  }
61851
-
61852
62181
  if (this.boundingBox !== null) {
61853
62182
  this.computeBoundingBox();
61854
62183
  }
61855
-
61856
62184
  if (this.boundingSphere !== null) {
61857
62185
  this.computeBoundingSphere();
61858
62186
  }
61859
-
61860
62187
  return this;
61861
62188
  }
61862
-
61863
62189
  setPositions(array) {
61864
62190
  let lineSegments;
61865
-
61866
62191
  if (array instanceof Float32Array) {
61867
62192
  lineSegments = array;
61868
62193
  } else if (Array.isArray(array)) {
61869
62194
  lineSegments = new Float32Array(array);
61870
62195
  }
61871
-
61872
62196
  const instanceBuffer = new THREE$2$1.InstancedInterleavedBuffer(lineSegments, 6, 1); // xyz, xyz
61873
62197
 
61874
62198
  this[setAttributeFn$1$1]('instanceStart', new THREE$2$1.InterleavedBufferAttribute(instanceBuffer, 3, 0)); // xyz
@@ -61880,16 +62204,13 @@
61880
62204
  this.computeBoundingSphere();
61881
62205
  return this;
61882
62206
  }
61883
-
61884
62207
  setColors(array) {
61885
62208
  let colors;
61886
-
61887
62209
  if (array instanceof Float32Array) {
61888
62210
  colors = array;
61889
62211
  } else if (Array.isArray(array)) {
61890
62212
  colors = new Float32Array(array);
61891
62213
  }
61892
-
61893
62214
  const instanceColorBuffer = new THREE$2$1.InstancedInterleavedBuffer(colors, 6, 1); // rgb, rgb
61894
62215
 
61895
62216
  this[setAttributeFn$1$1]('instanceColorStart', new THREE$2$1.InterleavedBufferAttribute(instanceColorBuffer, 3, 0)); // rgb
@@ -61898,26 +62219,21 @@
61898
62219
 
61899
62220
  return this;
61900
62221
  }
61901
-
61902
62222
  fromWireframeGeometry(geometry) {
61903
62223
  this.setPositions(geometry.attributes.position.array);
61904
62224
  return this;
61905
62225
  }
61906
-
61907
62226
  fromEdgesGeometry(geometry) {
61908
62227
  this.setPositions(geometry.attributes.position.array);
61909
62228
  return this;
61910
62229
  }
61911
-
61912
62230
  fromMesh(mesh) {
61913
62231
  this.fromWireframeGeometry(new THREE$2$1.WireframeGeometry(mesh.geometry)); // set colors, maybe
61914
62232
 
61915
62233
  return this;
61916
62234
  }
61917
-
61918
62235
  fromLineSegments(lineSegments) {
61919
62236
  const geometry = lineSegments.geometry;
61920
-
61921
62237
  if (geometry.isGeometry) {
61922
62238
  console.error('LineSegmentsGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.');
61923
62239
  return;
@@ -61925,72 +62241,52 @@
61925
62241
  this.setPositions(geometry.attributes.position.array); // assumes non-indexed
61926
62242
  } // set colors, maybe
61927
62243
 
61928
-
61929
62244
  return this;
61930
62245
  }
61931
-
61932
62246
  computeBoundingBox() {
61933
62247
  if (this.boundingBox === null) {
61934
62248
  this.boundingBox = new THREE$2$1.Box3();
61935
62249
  }
61936
-
61937
62250
  const start = this.attributes.instanceStart;
61938
62251
  const end = this.attributes.instanceEnd;
61939
-
61940
62252
  if (start !== undefined && end !== undefined) {
61941
62253
  this.boundingBox.setFromBufferAttribute(start);
61942
-
61943
62254
  _box$1.setFromBufferAttribute(end);
61944
-
61945
62255
  this.boundingBox.union(_box$1);
61946
62256
  }
61947
62257
  }
61948
-
61949
62258
  computeBoundingSphere() {
61950
62259
  if (this.boundingSphere === null) {
61951
62260
  this.boundingSphere = new THREE$2$1.Sphere();
61952
62261
  }
61953
-
61954
62262
  if (this.boundingBox === null) {
61955
62263
  this.computeBoundingBox();
61956
62264
  }
61957
-
61958
62265
  const start = this.attributes.instanceStart;
61959
62266
  const end = this.attributes.instanceEnd;
61960
-
61961
62267
  if (start !== undefined && end !== undefined) {
61962
62268
  const center = this.boundingSphere.center;
61963
62269
  this.boundingBox.getCenter(center);
61964
62270
  let maxRadiusSq = 0;
61965
-
61966
62271
  for (let i = 0, il = start.count; i < il; i++) {
61967
62272
  _vector.fromBufferAttribute(start, i);
61968
-
61969
62273
  maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector));
61970
-
61971
62274
  _vector.fromBufferAttribute(end, i);
61972
-
61973
62275
  maxRadiusSq = Math.max(maxRadiusSq, center.distanceToSquared(_vector));
61974
62276
  }
61975
-
61976
62277
  this.boundingSphere.radius = Math.sqrt(maxRadiusSq);
61977
-
61978
62278
  if (isNaN(this.boundingSphere.radius)) {
61979
62279
  console.error('THREE.LineSegmentsGeometry.computeBoundingSphere(): Computed radius is NaN. The instanced position data is likely to have NaN values.', this);
61980
62280
  }
61981
62281
  }
61982
62282
  }
61983
-
61984
62283
  toJSON() {// todo
61985
62284
  }
61986
-
61987
62285
  applyMatrix(matrix) {
61988
62286
  console.warn('THREE.LineSegmentsGeometry: applyMatrix() has been renamed to applyMatrix4().');
61989
62287
  return this.applyMatrix4(matrix);
61990
62288
  }
61991
-
61992
62289
  }
61993
-
61994
62290
  LineSegmentsGeometry.prototype.isLineSegmentsGeometry = true;
61995
62291
 
61996
62292
  /**
@@ -62035,12 +62331,11 @@
62035
62331
  gapSize: {
62036
62332
  value: 1
62037
62333
  } // todo FIX - maybe change to totalSize
62038
-
62039
62334
  };
62335
+
62040
62336
  THREE$1$1.ShaderLib['line'] = {
62041
62337
  uniforms: THREE$1$1.UniformsUtils.merge([THREE$1$1.UniformsLib.common, THREE$1$1.UniformsLib.fog, THREE$1$1.UniformsLib.line]),
62042
- vertexShader:
62043
- /* glsl */
62338
+ vertexShader: /* glsl */
62044
62339
  `
62045
62340
  #include <common>
62046
62341
  #include <color_pars_vertex>
@@ -62250,8 +62545,7 @@
62250
62545
 
62251
62546
  }
62252
62547
  `,
62253
- fragmentShader:
62254
- /* glsl */
62548
+ fragmentShader: /* glsl */
62255
62549
  `
62256
62550
  uniform vec3 diffuse;
62257
62551
  uniform float opacity;
@@ -62400,7 +62694,6 @@
62400
62694
  }
62401
62695
  `
62402
62696
  };
62403
-
62404
62697
  class LineMaterial extends THREE$1$1.ShaderMaterial {
62405
62698
  constructor(parameters) {
62406
62699
  super({
@@ -62409,8 +62702,8 @@
62409
62702
  vertexShader: THREE$1$1.ShaderLib['line'].vertexShader,
62410
62703
  fragmentShader: THREE$1$1.ShaderLib['line'].fragmentShader,
62411
62704
  clipping: true // required for clipping support
62412
-
62413
62705
  });
62706
+
62414
62707
  Object.defineProperties(this, {
62415
62708
  color: {
62416
62709
  enumerable: true,
@@ -62448,19 +62741,16 @@
62448
62741
  get: function () {
62449
62742
  return Boolean('USE_DASH' in this.defines);
62450
62743
  },
62451
-
62452
62744
  set(value) {
62453
62745
  if (Boolean(value) !== Boolean('USE_DASH' in this.defines)) {
62454
62746
  this.needsUpdate = true;
62455
62747
  }
62456
-
62457
62748
  if (value === true) {
62458
62749
  this.defines.USE_DASH = '';
62459
62750
  } else {
62460
62751
  delete this.defines.USE_DASH;
62461
62752
  }
62462
62753
  }
62463
-
62464
62754
  },
62465
62755
  dashScale: {
62466
62756
  enumerable: true,
@@ -62525,7 +62815,6 @@
62525
62815
  if (Boolean(value) !== Boolean('ALPHA_TO_COVERAGE' in this.defines)) {
62526
62816
  this.needsUpdate = true;
62527
62817
  }
62528
-
62529
62818
  if (value === true) {
62530
62819
  this.defines.ALPHA_TO_COVERAGE = '';
62531
62820
  this.extensions.derivatives = true;
@@ -62538,9 +62827,7 @@
62538
62827
  });
62539
62828
  this.setValues(parameters);
62540
62829
  }
62541
-
62542
62830
  }
62543
-
62544
62831
  LineMaterial.prototype.isLineMaterial = true;
62545
62832
 
62546
62833
  const THREE$h = window.THREE ? window.THREE // Prefer consumption from global THREE, if exists
@@ -62558,32 +62845,20 @@
62558
62845
  Vector4
62559
62846
  };
62560
62847
 
62848
+ // support both modes for backwards threejs compatibility
62561
62849
  var setAttributeFn$2 = new THREE$h.BufferGeometry().setAttribute ? 'setAttribute' : 'addAttribute';
62562
-
62563
62850
  const _start = new THREE$h.Vector3();
62564
-
62565
62851
  const _end = new THREE$h.Vector3();
62566
-
62567
62852
  const _start4 = new THREE$h.Vector4();
62568
-
62569
62853
  const _end4 = new THREE$h.Vector4();
62570
-
62571
62854
  const _ssOrigin = new THREE$h.Vector4();
62572
-
62573
62855
  const _ssOrigin3 = new THREE$h.Vector3();
62574
-
62575
62856
  const _mvMatrix = new THREE$h.Matrix4();
62576
-
62577
62857
  const _line = new THREE$h.Line3();
62578
-
62579
62858
  const _closestPoint = new THREE$h.Vector3();
62580
-
62581
62859
  const _box = new THREE$h.Box3();
62582
-
62583
62860
  const _sphere = new THREE$h.Sphere();
62584
-
62585
62861
  const _clipToWorldVector = new THREE$h.Vector4();
62586
-
62587
62862
  class LineSegments2 extends THREE$h.Mesh {
62588
62863
  constructor(geometry = new LineSegmentsGeometry(), material = new LineMaterial({
62589
62864
  color: Math.random() * 0xffffff
@@ -62592,22 +62867,17 @@
62592
62867
  this.type = 'LineSegments2';
62593
62868
  } // for backwards-compatability, but could be a method of LineSegmentsGeometry...
62594
62869
 
62595
-
62596
62870
  computeLineDistances() {
62597
62871
  const geometry = this.geometry;
62598
62872
  const instanceStart = geometry.attributes.instanceStart;
62599
62873
  const instanceEnd = geometry.attributes.instanceEnd;
62600
62874
  const lineDistances = new Float32Array(2 * instanceStart.count);
62601
-
62602
62875
  for (let i = 0, j = 0, l = instanceStart.count; i < l; i++, j += 2) {
62603
62876
  _start.fromBufferAttribute(instanceStart, i);
62604
-
62605
62877
  _end.fromBufferAttribute(instanceEnd, i);
62606
-
62607
62878
  lineDistances[j] = j === 0 ? 0 : lineDistances[j - 1];
62608
62879
  lineDistances[j + 1] = lineDistances[j] + _start.distanceTo(_end);
62609
62880
  }
62610
-
62611
62881
  const instanceDistanceBuffer = new THREE$h.InstancedInterleavedBuffer(lineDistances, 2, 1); // d0, d1
62612
62882
 
62613
62883
  geometry[setAttributeFn$2]('instanceDistanceStart', new THREE$h.InterleavedBufferAttribute(instanceDistanceBuffer, 1, 0)); // d0
@@ -62616,12 +62886,10 @@
62616
62886
 
62617
62887
  return this;
62618
62888
  }
62619
-
62620
62889
  raycast(raycaster, intersects) {
62621
62890
  if (raycaster.camera === null) {
62622
62891
  console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2.');
62623
62892
  }
62624
-
62625
62893
  const threshold = raycaster.params.Line2 !== undefined ? raycaster.params.Line2.threshold || 0 : 0;
62626
62894
  const ray = raycaster.ray;
62627
62895
  const camera = raycaster.camera;
@@ -62643,42 +62911,30 @@
62643
62911
  if (geometry.boundingSphere === null) {
62644
62912
  geometry.computeBoundingSphere();
62645
62913
  }
62646
-
62647
62914
  _sphere.copy(geometry.boundingSphere).applyMatrix4(matrixWorld);
62648
-
62649
62915
  const distanceToSphere = Math.max(camera.near, _sphere.distanceToPoint(ray.origin)); // get the w component to scale the world space line width
62650
62916
 
62651
62917
  _clipToWorldVector.set(0, 0, -distanceToSphere, 1.0).applyMatrix4(camera.projectionMatrix);
62652
-
62653
62918
  _clipToWorldVector.multiplyScalar(1.0 / _clipToWorldVector.w);
62654
-
62655
62919
  _clipToWorldVector.applyMatrix4(camera.projectionMatrixInverse); // increase the sphere bounds by the worst case line screen space width
62656
62920
 
62657
-
62658
62921
  const sphereMargin = Math.abs(ssMaxWidth / _clipToWorldVector.w) * 0.5;
62659
62922
  _sphere.radius += sphereMargin;
62660
-
62661
62923
  if (raycaster.ray.intersectsSphere(_sphere) === false) {
62662
62924
  return;
62663
62925
  } //
62664
62926
  // check if we intersect the box bounds
62665
62927
 
62666
-
62667
62928
  if (geometry.boundingBox === null) {
62668
62929
  geometry.computeBoundingBox();
62669
62930
  }
62670
-
62671
62931
  _box.copy(geometry.boundingBox).applyMatrix4(matrixWorld);
62672
-
62673
62932
  const distanceToBox = Math.max(camera.near, _box.distanceToPoint(ray.origin)); // get the w component to scale the world space line width
62674
62933
 
62675
62934
  _clipToWorldVector.set(0, 0, -distanceToBox, 1.0).applyMatrix4(camera.projectionMatrix);
62676
-
62677
62935
  _clipToWorldVector.multiplyScalar(1.0 / _clipToWorldVector.w);
62678
-
62679
62936
  _clipToWorldVector.applyMatrix4(camera.projectionMatrixInverse); // increase the sphere bounds by the worst case line screen space width
62680
62937
 
62681
-
62682
62938
  const boxMargin = Math.abs(ssMaxWidth / _clipToWorldVector.w) * 0.5;
62683
62939
  _box.max.x += boxMargin;
62684
62940
  _box.max.y += boxMargin;
@@ -62686,7 +62942,6 @@
62686
62942
  _box.min.x -= boxMargin;
62687
62943
  _box.min.y -= boxMargin;
62688
62944
  _box.min.z -= boxMargin;
62689
-
62690
62945
  if (raycaster.ray.intersectsBox(_box) === false) {
62691
62946
  return;
62692
62947
  } //
@@ -62694,100 +62949,69 @@
62694
62949
  // sitting at the camera origin which will cause "w" to be 0 when
62695
62950
  // applying the projection matrix.
62696
62951
 
62697
-
62698
62952
  ray.at(1, _ssOrigin); // ndc space [ - 1.0, 1.0 ]
62699
62953
 
62700
62954
  _ssOrigin.w = 1;
62701
-
62702
62955
  _ssOrigin.applyMatrix4(camera.matrixWorldInverse);
62703
-
62704
62956
  _ssOrigin.applyMatrix4(projectionMatrix);
62705
-
62706
62957
  _ssOrigin.multiplyScalar(1 / _ssOrigin.w); // screen space
62707
62958
 
62708
-
62709
62959
  _ssOrigin.x *= resolution.x / 2;
62710
62960
  _ssOrigin.y *= resolution.y / 2;
62711
62961
  _ssOrigin.z = 0;
62712
-
62713
62962
  _ssOrigin3.copy(_ssOrigin);
62714
-
62715
62963
  _mvMatrix.multiplyMatrices(camera.matrixWorldInverse, matrixWorld);
62716
-
62717
62964
  for (let i = 0, l = instanceStart.count; i < l; i++) {
62718
62965
  _start4.fromBufferAttribute(instanceStart, i);
62719
-
62720
62966
  _end4.fromBufferAttribute(instanceEnd, i);
62721
-
62722
62967
  _start4.w = 1;
62723
62968
  _end4.w = 1; // camera space
62724
62969
 
62725
62970
  _start4.applyMatrix4(_mvMatrix);
62726
-
62727
62971
  _end4.applyMatrix4(_mvMatrix); // skip the segment if it's entirely behind the camera
62728
62972
 
62729
-
62730
62973
  var isBehindCameraNear = _start4.z > near && _end4.z > near;
62731
-
62732
62974
  if (isBehindCameraNear) {
62733
62975
  continue;
62734
62976
  } // trim the segment if it extends behind camera near
62735
62977
 
62736
-
62737
62978
  if (_start4.z > near) {
62738
62979
  const deltaDist = _start4.z - _end4.z;
62739
62980
  const t = (_start4.z - near) / deltaDist;
62740
-
62741
62981
  _start4.lerp(_end4, t);
62742
62982
  } else if (_end4.z > near) {
62743
62983
  const deltaDist = _end4.z - _start4.z;
62744
62984
  const t = (_end4.z - near) / deltaDist;
62745
-
62746
62985
  _end4.lerp(_start4, t);
62747
62986
  } // clip space
62748
62987
 
62749
-
62750
62988
  _start4.applyMatrix4(projectionMatrix);
62751
-
62752
62989
  _end4.applyMatrix4(projectionMatrix); // ndc space [ - 1.0, 1.0 ]
62753
62990
 
62754
-
62755
62991
  _start4.multiplyScalar(1 / _start4.w);
62756
-
62757
62992
  _end4.multiplyScalar(1 / _end4.w); // screen space
62758
62993
 
62759
-
62760
62994
  _start4.x *= resolution.x / 2;
62761
62995
  _start4.y *= resolution.y / 2;
62762
62996
  _end4.x *= resolution.x / 2;
62763
62997
  _end4.y *= resolution.y / 2; // create 2d segment
62764
62998
 
62765
62999
  _line.start.copy(_start4);
62766
-
62767
63000
  _line.start.z = 0;
62768
-
62769
63001
  _line.end.copy(_end4);
62770
-
62771
63002
  _line.end.z = 0; // get closest point on ray to segment
62772
63003
 
62773
63004
  const param = _line.closestPointToPointParameter(_ssOrigin3, true);
62774
-
62775
63005
  _line.at(param, _closestPoint); // check if the intersection point is within clip space
62776
63006
 
62777
-
62778
63007
  const zPos = THREE$h.MathUtils.lerp(_start4.z, _end4.z, param);
62779
63008
  const isInClipSpace = zPos >= -1 && zPos <= 1;
62780
63009
  const isInside = _ssOrigin3.distanceTo(_closestPoint) < lineWidth * 0.5;
62781
-
62782
63010
  if (isInClipSpace && isInside) {
62783
63011
  _line.start.fromBufferAttribute(instanceStart, i);
62784
-
62785
63012
  _line.end.fromBufferAttribute(instanceEnd, i);
62786
-
62787
63013
  _line.start.applyMatrix4(matrixWorld);
62788
-
62789
63014
  _line.end.applyMatrix4(matrixWorld);
62790
-
62791
63015
  const pointOnLine = new THREE$h.Vector3();
62792
63016
  const point = new THREE$h.Vector3();
62793
63017
  ray.distanceSqToSegment(_line.start, _line.end, point, pointOnLine);
@@ -62804,9 +63028,7 @@
62804
63028
  }
62805
63029
  }
62806
63030
  }
62807
-
62808
63031
  }
62809
-
62810
63032
  LineSegments2.prototype.LineSegments2 = true;
62811
63033
 
62812
63034
  class LineGeometry extends LineSegmentsGeometry {
@@ -62814,12 +63036,10 @@
62814
63036
  super();
62815
63037
  this.type = 'LineGeometry';
62816
63038
  }
62817
-
62818
63039
  setPositions(array) {
62819
63040
  // converts [ x1, y1, z1, x2, y2, z2, ... ] to pairs format
62820
63041
  var length = array.length - 3;
62821
63042
  var points = new Float32Array(2 * length);
62822
-
62823
63043
  for (var i = 0; i < length; i += 3) {
62824
63044
  points[2 * i] = array[i];
62825
63045
  points[2 * i + 1] = array[i + 1];
@@ -62828,16 +63048,13 @@
62828
63048
  points[2 * i + 4] = array[i + 4];
62829
63049
  points[2 * i + 5] = array[i + 5];
62830
63050
  }
62831
-
62832
63051
  super.setPositions(points);
62833
63052
  return this;
62834
63053
  }
62835
-
62836
63054
  setColors(array) {
62837
63055
  // converts [ r1, g1, b1, r2, g2, b2, ... ] to pairs format
62838
63056
  var length = array.length - 3;
62839
63057
  var colors = new Float32Array(2 * length);
62840
-
62841
63058
  for (var i = 0; i < length; i += 3) {
62842
63059
  colors[2 * i] = array[i];
62843
63060
  colors[2 * i + 1] = array[i + 1];
@@ -62846,14 +63063,11 @@
62846
63063
  colors[2 * i + 4] = array[i + 4];
62847
63064
  colors[2 * i + 5] = array[i + 5];
62848
63065
  }
62849
-
62850
63066
  super.setColors(colors);
62851
63067
  return this;
62852
63068
  }
62853
-
62854
63069
  fromLine(line) {
62855
63070
  var geometry = line.geometry;
62856
-
62857
63071
  if (geometry.isGeometry) {
62858
63072
  console.error('THREE.LineGeometry no longer supports Geometry. Use THREE.BufferGeometry instead.');
62859
63073
  return;
@@ -62861,12 +63075,9 @@
62861
63075
  this.setPositions(geometry.attributes.position.array); // assumes non-indexed
62862
63076
  } // set colors, maybe
62863
63077
 
62864
-
62865
63078
  return this;
62866
63079
  }
62867
-
62868
63080
  }
62869
-
62870
63081
  LineGeometry.prototype.isLineGeometry = true;
62871
63082
 
62872
63083
  class Line2 extends LineSegments2 {
@@ -62876,9 +63087,7 @@
62876
63087
  super(geometry, material);
62877
63088
  this.type = 'Line2';
62878
63089
  }
62879
-
62880
63090
  }
62881
-
62882
63091
  Line2.prototype.isLine2 = true;
62883
63092
 
62884
63093
  /**
@@ -63074,6 +63283,33 @@
63074
63283
 
63075
63284
  }
63076
63285
 
63286
+ function _iterableToArrayLimit$1(arr, i) {
63287
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
63288
+ if (null != _i) {
63289
+ var _s,
63290
+ _e,
63291
+ _x,
63292
+ _r,
63293
+ _arr = [],
63294
+ _n = !0,
63295
+ _d = !1;
63296
+ try {
63297
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
63298
+ if (Object(_i) !== _i) return;
63299
+ _n = !1;
63300
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
63301
+ } catch (err) {
63302
+ _d = !0, _e = err;
63303
+ } finally {
63304
+ try {
63305
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
63306
+ } finally {
63307
+ if (_d) throw _e;
63308
+ }
63309
+ }
63310
+ return _arr;
63311
+ }
63312
+ }
63077
63313
  function ownKeys$1(object, enumerableOnly) {
63078
63314
  var keys = Object.keys(object);
63079
63315
  if (Object.getOwnPropertySymbols) {
@@ -63106,7 +63342,7 @@
63106
63342
  descriptor.enumerable = descriptor.enumerable || false;
63107
63343
  descriptor.configurable = true;
63108
63344
  if ("value" in descriptor) descriptor.writable = true;
63109
- Object.defineProperty(target, descriptor.key, descriptor);
63345
+ Object.defineProperty(target, _toPropertyKey$2(descriptor.key), descriptor);
63110
63346
  }
63111
63347
  }
63112
63348
  function _createClass(Constructor, protoProps, staticProps) {
@@ -63118,6 +63354,7 @@
63118
63354
  return Constructor;
63119
63355
  }
63120
63356
  function _defineProperty$2(obj, key, value) {
63357
+ key = _toPropertyKey$2(key);
63121
63358
  if (key in obj) {
63122
63359
  Object.defineProperty(obj, key, {
63123
63360
  value: value,
@@ -63255,30 +63492,6 @@
63255
63492
  function _iterableToArray$2(iter) {
63256
63493
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
63257
63494
  }
63258
- function _iterableToArrayLimit$1(arr, i) {
63259
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
63260
- if (_i == null) return;
63261
- var _arr = [];
63262
- var _n = true;
63263
- var _d = false;
63264
- var _s, _e;
63265
- try {
63266
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
63267
- _arr.push(_s.value);
63268
- if (i && _arr.length === i) break;
63269
- }
63270
- } catch (err) {
63271
- _d = true;
63272
- _e = err;
63273
- } finally {
63274
- try {
63275
- if (!_n && _i["return"] != null) _i["return"]();
63276
- } finally {
63277
- if (_d) throw _e;
63278
- }
63279
- }
63280
- return _arr;
63281
- }
63282
63495
  function _unsupportedIterableToArray$2(o, minLen) {
63283
63496
  if (!o) return;
63284
63497
  if (typeof o === "string") return _arrayLikeToArray$2(o, minLen);
@@ -63298,6 +63511,20 @@
63298
63511
  function _nonIterableRest$1() {
63299
63512
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
63300
63513
  }
63514
+ function _toPrimitive$2(input, hint) {
63515
+ if (typeof input !== "object" || input === null) return input;
63516
+ var prim = input[Symbol.toPrimitive];
63517
+ if (prim !== undefined) {
63518
+ var res = prim.call(input, hint || "default");
63519
+ if (typeof res !== "object") return res;
63520
+ throw new TypeError("@@toPrimitive must return a primitive value.");
63521
+ }
63522
+ return (hint === "string" ? String : Number)(input);
63523
+ }
63524
+ function _toPropertyKey$2(arg) {
63525
+ var key = _toPrimitive$2(arg, "string");
63526
+ return typeof key === "symbol" ? key : String(key);
63527
+ }
63301
63528
 
63302
63529
  var materialDispose = function materialDispose(material) {
63303
63530
  if (material instanceof Array) {
@@ -64954,9 +65181,7 @@
64954
65181
  // fatline
64955
65182
  var offset = obj.material.dashOffset - step;
64956
65183
  var dashLength = obj.material.dashSize + obj.material.gapSize;
64957
- while (offset <= -dashLength) {
64958
- offset += dashLength;
64959
- } // cycle within dash length
65184
+ while (offset <= -dashLength) offset += dashLength; // cycle within dash length
64960
65185
  obj.material.dashOffset = offset;
64961
65186
  }
64962
65187
  });
@@ -65152,9 +65377,7 @@
65152
65377
  lineCoords.forEach(function (pnt) {
65153
65378
  if (prevPnt) {
65154
65379
  // cross the anti-meridian if that's the closest distance between points
65155
- while (Math.abs(prevPnt[1] - pnt[1]) > 180) {
65156
- prevPnt[1] += 360 * (prevPnt[1] < pnt[1] ? 1 : -1);
65157
- }
65380
+ while (Math.abs(prevPnt[1] - pnt[1]) > 180) prevPnt[1] += 360 * (prevPnt[1] < pnt[1] ? 1 : -1);
65158
65381
  var dist = Math.sqrt(Math.pow(pnt[0] - prevPnt[0], 2) + Math.pow(pnt[1] - prevPnt[1], 2));
65159
65382
  if (dist > maxDegDistance) {
65160
65383
  var numAdditionalPnts = Math.floor(dist / maxDegDistance);
@@ -67621,22 +67844,62 @@
67621
67844
  switch ( event.code ) {
67622
67845
 
67623
67846
  case scope.keys.UP:
67624
- pan( 0, scope.keyPanSpeed );
67847
+
67848
+ if ( event.ctrlKey || event.metaKey || event.shiftKey ) {
67849
+
67850
+ rotateUp( 2 * Math.PI * scope.rotateSpeed / scope.domElement.clientHeight );
67851
+
67852
+ } else {
67853
+
67854
+ pan( 0, scope.keyPanSpeed );
67855
+
67856
+ }
67857
+
67625
67858
  needsUpdate = true;
67626
67859
  break;
67627
67860
 
67628
67861
  case scope.keys.BOTTOM:
67629
- pan( 0, - scope.keyPanSpeed );
67862
+
67863
+ if ( event.ctrlKey || event.metaKey || event.shiftKey ) {
67864
+
67865
+ rotateUp( - 2 * Math.PI * scope.rotateSpeed / scope.domElement.clientHeight );
67866
+
67867
+ } else {
67868
+
67869
+ pan( 0, - scope.keyPanSpeed );
67870
+
67871
+ }
67872
+
67630
67873
  needsUpdate = true;
67631
67874
  break;
67632
67875
 
67633
67876
  case scope.keys.LEFT:
67634
- pan( scope.keyPanSpeed, 0 );
67877
+
67878
+ if ( event.ctrlKey || event.metaKey || event.shiftKey ) {
67879
+
67880
+ rotateLeft( 2 * Math.PI * scope.rotateSpeed / scope.domElement.clientHeight );
67881
+
67882
+ } else {
67883
+
67884
+ pan( scope.keyPanSpeed, 0 );
67885
+
67886
+ }
67887
+
67635
67888
  needsUpdate = true;
67636
67889
  break;
67637
67890
 
67638
67891
  case scope.keys.RIGHT:
67639
- pan( - scope.keyPanSpeed, 0 );
67892
+
67893
+ if ( event.ctrlKey || event.metaKey || event.shiftKey ) {
67894
+
67895
+ rotateLeft( - 2 * Math.PI * scope.rotateSpeed / scope.domElement.clientHeight );
67896
+
67897
+ } else {
67898
+
67899
+ pan( - scope.keyPanSpeed, 0 );
67900
+
67901
+ }
67902
+
67640
67903
  needsUpdate = true;
67641
67904
  break;
67642
67905
 
@@ -68592,15 +68855,15 @@
68592
68855
 
68593
68856
  // https://github.com/mrdoob/three.js/pull/21358
68594
68857
 
68595
- const _geometry$1 = new BufferGeometry();
68596
- _geometry$1.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
68597
- _geometry$1.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );
68858
+ const _geometry = new BufferGeometry();
68859
+ _geometry.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
68860
+ _geometry.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );
68598
68861
 
68599
68862
  class FullScreenQuad {
68600
68863
 
68601
68864
  constructor( material ) {
68602
68865
 
68603
- this._mesh = new Mesh( _geometry$1, material );
68866
+ this._mesh = new Mesh( _geometry, material );
68604
68867
 
68605
68868
  }
68606
68869
 
@@ -68832,20 +69095,6 @@
68832
69095
 
68833
69096
  this.passes = [];
68834
69097
 
68835
- // dependencies
68836
-
68837
- if ( CopyShader === undefined ) {
68838
-
68839
- console.error( 'THREE.EffectComposer relies on CopyShader' );
68840
-
68841
- }
68842
-
68843
- if ( ShaderPass === undefined ) {
68844
-
68845
- console.error( 'THREE.EffectComposer relies on ShaderPass' );
68846
-
68847
- }
68848
-
68849
69098
  this.copyPass = new ShaderPass( CopyShader );
68850
69099
 
68851
69100
  this.clock = new Clock();
@@ -69028,16 +69277,6 @@
69028
69277
 
69029
69278
  }
69030
69279
 
69031
- // Helper for passes that need to fill the viewport with a single quad.
69032
-
69033
- new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );
69034
-
69035
- // https://github.com/mrdoob/three.js/pull/21358
69036
-
69037
- const _geometry = new BufferGeometry();
69038
- _geometry.setAttribute( 'position', new Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );
69039
- _geometry.setAttribute( 'uv', new Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );
69040
-
69041
69280
  class RenderPass extends Pass {
69042
69281
 
69043
69282
  constructor( scene, camera, overrideMaterial, clearColor, clearAlpha ) {
@@ -69893,7 +70132,35 @@
69893
70132
  var css_248z$1 = ".scene-nav-info {\n bottom: 5px;\n width: 100%;\n text-align: center;\n color: slategrey;\n opacity: 0.7;\n font-size: 10px;\n}\n\n.scene-tooltip {\n top: 0;\n color: lavender;\n font-size: 15px;\n}\n\n.scene-nav-info, .scene-tooltip {\n position: absolute;\n font-family: sans-serif;\n pointer-events: none;\n}\n\n.scene-container canvas:focus {\n outline: none;\n}";
69894
70133
  styleInject$1(css_248z$1);
69895
70134
 
70135
+ function _iterableToArrayLimit(arr, i) {
70136
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
70137
+ if (null != _i) {
70138
+ var _s,
70139
+ _e,
70140
+ _x,
70141
+ _r,
70142
+ _arr = [],
70143
+ _n = !0,
70144
+ _d = !1;
70145
+ try {
70146
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
70147
+ if (Object(_i) !== _i) return;
70148
+ _n = !1;
70149
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
70150
+ } catch (err) {
70151
+ _d = !0, _e = err;
70152
+ } finally {
70153
+ try {
70154
+ if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
70155
+ } finally {
70156
+ if (_d) throw _e;
70157
+ }
70158
+ }
70159
+ return _arr;
70160
+ }
70161
+ }
69896
70162
  function _defineProperty$1(obj, key, value) {
70163
+ key = _toPropertyKey$1(key);
69897
70164
  if (key in obj) {
69898
70165
  Object.defineProperty(obj, key, {
69899
70166
  value: value,
@@ -69921,30 +70188,6 @@
69921
70188
  function _iterableToArray$1(iter) {
69922
70189
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
69923
70190
  }
69924
- function _iterableToArrayLimit(arr, i) {
69925
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
69926
- if (_i == null) return;
69927
- var _arr = [];
69928
- var _n = true;
69929
- var _d = false;
69930
- var _s, _e;
69931
- try {
69932
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
69933
- _arr.push(_s.value);
69934
- if (i && _arr.length === i) break;
69935
- }
69936
- } catch (err) {
69937
- _d = true;
69938
- _e = err;
69939
- } finally {
69940
- try {
69941
- if (!_n && _i["return"] != null) _i["return"]();
69942
- } finally {
69943
- if (_d) throw _e;
69944
- }
69945
- }
69946
- return _arr;
69947
- }
69948
70191
  function _unsupportedIterableToArray$1(o, minLen) {
69949
70192
  if (!o) return;
69950
70193
  if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
@@ -69964,6 +70207,20 @@
69964
70207
  function _nonIterableRest() {
69965
70208
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
69966
70209
  }
70210
+ function _toPrimitive$1(input, hint) {
70211
+ if (typeof input !== "object" || input === null) return input;
70212
+ var prim = input[Symbol.toPrimitive];
70213
+ if (prim !== undefined) {
70214
+ var res = prim.call(input, hint || "default");
70215
+ if (typeof res !== "object") return res;
70216
+ throw new TypeError("@@toPrimitive must return a primitive value.");
70217
+ }
70218
+ return (hint === "string" ? String : Number)(input);
70219
+ }
70220
+ function _toPropertyKey$1(arg) {
70221
+ var key = _toPrimitive$1(arg, "string");
70222
+ return typeof key === "symbol" ? key : String(key);
70223
+ }
69967
70224
 
69968
70225
  var three = window.THREE ? window.THREE // Prefer consumption from global THREE, if exists
69969
70226
  : {
@@ -70540,6 +70797,7 @@
70540
70797
  return target;
70541
70798
  }
70542
70799
  function _defineProperty(obj, key, value) {
70800
+ key = _toPropertyKey(key);
70543
70801
  if (key in obj) {
70544
70802
  Object.defineProperty(obj, key, {
70545
70803
  value: value,
@@ -70604,6 +70862,20 @@
70604
70862
  function _nonIterableSpread() {
70605
70863
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
70606
70864
  }
70865
+ function _toPrimitive(input, hint) {
70866
+ if (typeof input !== "object" || input === null) return input;
70867
+ var prim = input[Symbol.toPrimitive];
70868
+ if (prim !== undefined) {
70869
+ var res = prim.call(input, hint || "default");
70870
+ if (typeof res !== "object") return res;
70871
+ throw new TypeError("@@toPrimitive must return a primitive value.");
70872
+ }
70873
+ return (hint === "string" ? String : Number)(input);
70874
+ }
70875
+ function _toPropertyKey(arg) {
70876
+ var key = _toPrimitive(arg, "string");
70877
+ return typeof key === "symbol" ? key : String(key);
70878
+ }
70607
70879
 
70608
70880
  function linkKapsule (kapsulePropName, kapsuleType) {
70609
70881
  var dummyK = new kapsuleType(); // To extract defaults
@@ -70862,12 +71134,8 @@
70862
71134
  setCameraPos(finalGeoCoords);
70863
71135
  } else {
70864
71136
  // Avoid rotating more than 180deg longitude
70865
- while (curGeoCoords.lng - finalGeoCoords.lng > 180) {
70866
- curGeoCoords.lng -= 360;
70867
- }
70868
- while (curGeoCoords.lng - finalGeoCoords.lng < -180) {
70869
- curGeoCoords.lng += 360;
70870
- }
71137
+ while (curGeoCoords.lng - finalGeoCoords.lng > 180) curGeoCoords.lng -= 360;
71138
+ while (curGeoCoords.lng - finalGeoCoords.lng < -180) curGeoCoords.lng += 360;
70871
71139
  new exports$1.Tween(curGeoCoords).to(finalGeoCoords, transitionDuration).easing(exports$1.Easing.Cubic.InOut).onUpdate(setCameraPos).start();
70872
71140
  }
70873
71141
  return this;
@@ -71199,9 +71467,17 @@
71199
71467
  }
71200
71468
  });
71201
71469
 
71202
- var propTypes = {exports: {}};
71470
+ var propTypesExports = {};
71471
+ var propTypes = {
71472
+ get exports(){ return propTypesExports; },
71473
+ set exports(v){ propTypesExports = v; },
71474
+ };
71203
71475
 
71204
- var reactIs = {exports: {}};
71476
+ var reactIsExports = {};
71477
+ var reactIs = {
71478
+ get exports(){ return reactIsExports; },
71479
+ set exports(v){ reactIsExports = v; },
71480
+ };
71205
71481
 
71206
71482
  var reactIs_development = {};
71207
71483
 
@@ -71602,7 +71878,7 @@
71602
71878
  * LICENSE file in the root directory of this source tree.
71603
71879
  */
71604
71880
 
71605
- var ReactIs$1 = reactIs.exports;
71881
+ var ReactIs$1 = reactIsExports;
71606
71882
  var assign = objectAssign;
71607
71883
 
71608
71884
  var ReactPropTypesSecret = ReactPropTypesSecret_1;
@@ -72212,7 +72488,7 @@
72212
72488
  */
72213
72489
 
72214
72490
  {
72215
- var ReactIs = reactIs.exports;
72491
+ var ReactIs = reactIsExports;
72216
72492
 
72217
72493
  // By explicitly using `prop-types` you are opting into new development behavior.
72218
72494
  // http://fb.me/prop-types-in-prod
@@ -72221,180 +72497,180 @@
72221
72497
  }
72222
72498
 
72223
72499
  var GlobePropTypes = {
72224
- width: propTypes.exports.number,
72225
- height: propTypes.exports.number,
72226
- backgroundColor: propTypes.exports.string,
72227
- backgroundImageUrl: propTypes.exports.string,
72228
- globeImageUrl: propTypes.exports.string,
72229
- bumpImageUrl: propTypes.exports.string,
72230
- showGlobe: propTypes.exports.bool,
72231
- showGraticules: propTypes.exports.bool,
72232
- showAtmosphere: propTypes.exports.bool,
72233
- atmosphereColor: propTypes.exports.string,
72234
- atmosphereAltitude: propTypes.exports.number,
72235
- globeMaterial: propTypes.exports.object,
72236
- onGlobeReady: propTypes.exports.func,
72237
- onGlobeClick: propTypes.exports.func,
72238
- onGlobeRightClick: propTypes.exports.func,
72239
- pointsData: propTypes.exports.arrayOf(propTypes.exports.object),
72240
- pointLat: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72241
- pointLng: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72242
- pointColor: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72243
- pointAltitude: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72244
- pointRadius: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72245
- pointResolution: propTypes.exports.number,
72246
- pointsMerge: propTypes.exports.bool,
72247
- pointsTransitionDuration: propTypes.exports.number,
72248
- pointLabel: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72249
- onPointClick: propTypes.exports.func,
72250
- onPointRightClick: propTypes.exports.func,
72251
- onPointHover: propTypes.exports.func,
72252
- arcsData: propTypes.exports.arrayOf(propTypes.exports.object),
72253
- arcStartLat: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72254
- arcStartLng: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72255
- arcEndLat: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72256
- arcEndLng: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72257
- arcColor: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.arrayOf(propTypes.exports.string), propTypes.exports.func]),
72258
- arcAltitude: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72259
- arcAltitudeAutoScale: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72260
- arcStroke: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72261
- arcCurveResolution: propTypes.exports.number,
72262
- arcCircularResolution: propTypes.exports.number,
72263
- arcDashLength: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72264
- arcDashGap: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72265
- arcDashInitialGap: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72266
- arcDashAnimateTime: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72267
- arcsTransitionDuration: propTypes.exports.number,
72268
- arcLabel: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72269
- onArcClick: propTypes.exports.func,
72270
- onArcRightClick: propTypes.exports.func,
72271
- onArcHover: propTypes.exports.func,
72272
- polygonsData: propTypes.exports.arrayOf(propTypes.exports.object),
72273
- polygonGeoJsonGeometry: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72274
- polygonCapColor: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72275
- polygonCapMaterial: propTypes.exports.oneOfType([propTypes.exports.object, propTypes.exports.string, propTypes.exports.func]),
72276
- polygonSideColor: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72277
- polygonSideMaterial: propTypes.exports.oneOfType([propTypes.exports.object, propTypes.exports.string, propTypes.exports.func]),
72278
- polygonStrokeColor: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72279
- polygonAltitude: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72280
- polygonCapCurvatureResolution: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72281
- polygonsTransitionDuration: propTypes.exports.number,
72282
- polygonLabel: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72283
- onPolygonClick: propTypes.exports.func,
72284
- onPolygonRightClick: propTypes.exports.func,
72285
- onPolygonHover: propTypes.exports.func,
72286
- pathsData: propTypes.exports.array,
72287
- pathPoints: propTypes.exports.oneOfType([propTypes.exports.array, propTypes.exports.string, propTypes.exports.func]),
72288
- pathPointLat: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72289
- pathPointLng: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72290
- pathPointAlt: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72291
- pathResolution: propTypes.exports.number,
72292
- pathColor: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.arrayOf(propTypes.exports.string), propTypes.exports.func]),
72293
- pathStroke: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72294
- pathDashLength: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72295
- pathDashGap: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72296
- pathDashInitialGap: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72297
- pathDashAnimateTime: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72298
- pathTransitionDuration: propTypes.exports.number,
72299
- pathLabel: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72300
- onPathClick: propTypes.exports.func,
72301
- onPathRightClick: propTypes.exports.func,
72302
- onPathHover: propTypes.exports.func,
72303
- hexBinPointsData: propTypes.exports.arrayOf(propTypes.exports.object),
72304
- hexBinPointLat: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72305
- hexBinPointLng: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72306
- hexBinPointWeight: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72307
- hexBinResolution: propTypes.exports.number,
72308
- hexMargin: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.func]),
72309
- hexTopColor: propTypes.exports.func,
72310
- hexSideColor: propTypes.exports.func,
72311
- hexAltitude: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.func]),
72312
- hexTopCurvatureResolution: propTypes.exports.number,
72313
- hexBinMerge: propTypes.exports.bool,
72314
- hexTransitionDuration: propTypes.exports.number,
72315
- hexLabel: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72316
- onHexClick: propTypes.exports.func,
72317
- onHexRightClick: propTypes.exports.func,
72318
- onHexHover: propTypes.exports.func,
72319
- hexPolygonsData: propTypes.exports.arrayOf(propTypes.exports.object),
72320
- hexPolygonGeoJsonGeometry: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72321
- hexPolygonColor: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72322
- hexPolygonAltitude: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72323
- hexPolygonResolution: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72324
- hexPolygonMargin: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72325
- hexPolygonCurvatureResolution: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72326
- hexPolygonsTransitionDuration: propTypes.exports.number,
72327
- hexPolygonLabel: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72328
- onHexPolygonClick: propTypes.exports.func,
72329
- onHexPolygonRightClick: propTypes.exports.func,
72330
- onHexPolygonHover: propTypes.exports.func,
72331
- tilesData: propTypes.exports.arrayOf(propTypes.exports.object),
72332
- tileLat: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72333
- tileLng: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72334
- tileAltitude: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72335
- tileWidth: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72336
- tileHeight: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72337
- tileUseGlobeProjection: propTypes.exports.oneOfType([propTypes.exports.bool, propTypes.exports.string, propTypes.exports.func]),
72338
- tileMaterial: propTypes.exports.oneOfType([propTypes.exports.object, propTypes.exports.string, propTypes.exports.func]),
72339
- tileCurvatureResolution: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72340
- tilesTransitionDuration: propTypes.exports.number,
72341
- tileLabel: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72342
- onTileClick: propTypes.exports.func,
72343
- onTileRightClick: propTypes.exports.func,
72344
- onTileHover: propTypes.exports.func,
72345
- ringsData: propTypes.exports.arrayOf(propTypes.exports.object),
72346
- ringLat: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72347
- ringLng: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72348
- ringAltitude: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72349
- ringColor: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.arrayOf(propTypes.exports.string), propTypes.exports.func]),
72350
- ringResolution: propTypes.exports.number,
72351
- ringMaxRadius: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72352
- ringPropagationSpeed: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72353
- ringRepeatPeriod: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72354
- labelsData: propTypes.exports.arrayOf(propTypes.exports.object),
72355
- labelLat: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72356
- labelLng: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72357
- labelAltitude: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72358
- labelRotation: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72359
- labelText: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72360
- labelSize: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72361
- labelTypeFace: propTypes.exports.object,
72362
- labelColor: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72363
- labelResolution: propTypes.exports.number,
72364
- labelIncludeDot: propTypes.exports.oneOfType([propTypes.exports.bool, propTypes.exports.string, propTypes.exports.func]),
72365
- labelDotRadius: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72366
- labelDotOrientation: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72367
- labelsTransitionDuration: propTypes.exports.number,
72368
- labelLabel: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72369
- onLabelClick: propTypes.exports.func,
72370
- onLabelRightClick: propTypes.exports.func,
72371
- onLabelHover: propTypes.exports.func,
72372
- htmlElementsData: propTypes.exports.arrayOf(propTypes.exports.object),
72373
- htmlLat: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72374
- htmlLng: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72375
- htmlAltitude: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72376
- htmlElement: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72377
- htmlTransitionDuration: propTypes.exports.number,
72378
- objectsData: propTypes.exports.arrayOf(propTypes.exports.object),
72379
- objectLat: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72380
- objectLng: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72381
- objectAltitude: propTypes.exports.oneOfType([propTypes.exports.number, propTypes.exports.string, propTypes.exports.func]),
72382
- objectThreeObject: propTypes.exports.oneOfType([propTypes.exports.object, propTypes.exports.string, propTypes.exports.func]),
72383
- objectLabel: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72384
- onObjectClick: propTypes.exports.func,
72385
- onObjectRightClick: propTypes.exports.func,
72386
- onObjectHover: propTypes.exports.func,
72387
- customLayerData: propTypes.exports.arrayOf(propTypes.exports.object),
72388
- customThreeObject: propTypes.exports.oneOfType([propTypes.exports.object, propTypes.exports.string, propTypes.exports.func]),
72389
- customThreeObjectUpdate: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72390
- customLayerLabel: propTypes.exports.oneOfType([propTypes.exports.string, propTypes.exports.func]),
72391
- onCustomLayerClick: propTypes.exports.func,
72392
- onCustomLayerRightClick: propTypes.exports.func,
72393
- onCustomLayerHover: propTypes.exports.func,
72394
- enablePointerInteraction: propTypes.exports.bool,
72395
- pointerEventsFilter: propTypes.exports.func,
72396
- lineHoverPrecision: propTypes.exports.number,
72397
- onZoom: propTypes.exports.func
72500
+ width: propTypesExports.number,
72501
+ height: propTypesExports.number,
72502
+ backgroundColor: propTypesExports.string,
72503
+ backgroundImageUrl: propTypesExports.string,
72504
+ globeImageUrl: propTypesExports.string,
72505
+ bumpImageUrl: propTypesExports.string,
72506
+ showGlobe: propTypesExports.bool,
72507
+ showGraticules: propTypesExports.bool,
72508
+ showAtmosphere: propTypesExports.bool,
72509
+ atmosphereColor: propTypesExports.string,
72510
+ atmosphereAltitude: propTypesExports.number,
72511
+ globeMaterial: propTypesExports.object,
72512
+ onGlobeReady: propTypesExports.func,
72513
+ onGlobeClick: propTypesExports.func,
72514
+ onGlobeRightClick: propTypesExports.func,
72515
+ pointsData: propTypesExports.arrayOf(propTypesExports.object),
72516
+ pointLat: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72517
+ pointLng: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72518
+ pointColor: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72519
+ pointAltitude: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72520
+ pointRadius: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72521
+ pointResolution: propTypesExports.number,
72522
+ pointsMerge: propTypesExports.bool,
72523
+ pointsTransitionDuration: propTypesExports.number,
72524
+ pointLabel: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72525
+ onPointClick: propTypesExports.func,
72526
+ onPointRightClick: propTypesExports.func,
72527
+ onPointHover: propTypesExports.func,
72528
+ arcsData: propTypesExports.arrayOf(propTypesExports.object),
72529
+ arcStartLat: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72530
+ arcStartLng: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72531
+ arcEndLat: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72532
+ arcEndLng: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72533
+ arcColor: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.arrayOf(propTypesExports.string), propTypesExports.func]),
72534
+ arcAltitude: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72535
+ arcAltitudeAutoScale: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72536
+ arcStroke: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72537
+ arcCurveResolution: propTypesExports.number,
72538
+ arcCircularResolution: propTypesExports.number,
72539
+ arcDashLength: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72540
+ arcDashGap: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72541
+ arcDashInitialGap: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72542
+ arcDashAnimateTime: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72543
+ arcsTransitionDuration: propTypesExports.number,
72544
+ arcLabel: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72545
+ onArcClick: propTypesExports.func,
72546
+ onArcRightClick: propTypesExports.func,
72547
+ onArcHover: propTypesExports.func,
72548
+ polygonsData: propTypesExports.arrayOf(propTypesExports.object),
72549
+ polygonGeoJsonGeometry: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72550
+ polygonCapColor: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72551
+ polygonCapMaterial: propTypesExports.oneOfType([propTypesExports.object, propTypesExports.string, propTypesExports.func]),
72552
+ polygonSideColor: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72553
+ polygonSideMaterial: propTypesExports.oneOfType([propTypesExports.object, propTypesExports.string, propTypesExports.func]),
72554
+ polygonStrokeColor: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72555
+ polygonAltitude: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72556
+ polygonCapCurvatureResolution: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72557
+ polygonsTransitionDuration: propTypesExports.number,
72558
+ polygonLabel: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72559
+ onPolygonClick: propTypesExports.func,
72560
+ onPolygonRightClick: propTypesExports.func,
72561
+ onPolygonHover: propTypesExports.func,
72562
+ pathsData: propTypesExports.array,
72563
+ pathPoints: propTypesExports.oneOfType([propTypesExports.array, propTypesExports.string, propTypesExports.func]),
72564
+ pathPointLat: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72565
+ pathPointLng: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72566
+ pathPointAlt: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72567
+ pathResolution: propTypesExports.number,
72568
+ pathColor: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.arrayOf(propTypesExports.string), propTypesExports.func]),
72569
+ pathStroke: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72570
+ pathDashLength: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72571
+ pathDashGap: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72572
+ pathDashInitialGap: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72573
+ pathDashAnimateTime: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72574
+ pathTransitionDuration: propTypesExports.number,
72575
+ pathLabel: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72576
+ onPathClick: propTypesExports.func,
72577
+ onPathRightClick: propTypesExports.func,
72578
+ onPathHover: propTypesExports.func,
72579
+ hexBinPointsData: propTypesExports.arrayOf(propTypesExports.object),
72580
+ hexBinPointLat: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72581
+ hexBinPointLng: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72582
+ hexBinPointWeight: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72583
+ hexBinResolution: propTypesExports.number,
72584
+ hexMargin: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.func]),
72585
+ hexTopColor: propTypesExports.func,
72586
+ hexSideColor: propTypesExports.func,
72587
+ hexAltitude: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.func]),
72588
+ hexTopCurvatureResolution: propTypesExports.number,
72589
+ hexBinMerge: propTypesExports.bool,
72590
+ hexTransitionDuration: propTypesExports.number,
72591
+ hexLabel: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72592
+ onHexClick: propTypesExports.func,
72593
+ onHexRightClick: propTypesExports.func,
72594
+ onHexHover: propTypesExports.func,
72595
+ hexPolygonsData: propTypesExports.arrayOf(propTypesExports.object),
72596
+ hexPolygonGeoJsonGeometry: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72597
+ hexPolygonColor: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72598
+ hexPolygonAltitude: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72599
+ hexPolygonResolution: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72600
+ hexPolygonMargin: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72601
+ hexPolygonCurvatureResolution: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72602
+ hexPolygonsTransitionDuration: propTypesExports.number,
72603
+ hexPolygonLabel: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72604
+ onHexPolygonClick: propTypesExports.func,
72605
+ onHexPolygonRightClick: propTypesExports.func,
72606
+ onHexPolygonHover: propTypesExports.func,
72607
+ tilesData: propTypesExports.arrayOf(propTypesExports.object),
72608
+ tileLat: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72609
+ tileLng: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72610
+ tileAltitude: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72611
+ tileWidth: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72612
+ tileHeight: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72613
+ tileUseGlobeProjection: propTypesExports.oneOfType([propTypesExports.bool, propTypesExports.string, propTypesExports.func]),
72614
+ tileMaterial: propTypesExports.oneOfType([propTypesExports.object, propTypesExports.string, propTypesExports.func]),
72615
+ tileCurvatureResolution: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72616
+ tilesTransitionDuration: propTypesExports.number,
72617
+ tileLabel: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72618
+ onTileClick: propTypesExports.func,
72619
+ onTileRightClick: propTypesExports.func,
72620
+ onTileHover: propTypesExports.func,
72621
+ ringsData: propTypesExports.arrayOf(propTypesExports.object),
72622
+ ringLat: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72623
+ ringLng: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72624
+ ringAltitude: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72625
+ ringColor: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.arrayOf(propTypesExports.string), propTypesExports.func]),
72626
+ ringResolution: propTypesExports.number,
72627
+ ringMaxRadius: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72628
+ ringPropagationSpeed: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72629
+ ringRepeatPeriod: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72630
+ labelsData: propTypesExports.arrayOf(propTypesExports.object),
72631
+ labelLat: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72632
+ labelLng: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72633
+ labelAltitude: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72634
+ labelRotation: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72635
+ labelText: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72636
+ labelSize: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72637
+ labelTypeFace: propTypesExports.object,
72638
+ labelColor: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72639
+ labelResolution: propTypesExports.number,
72640
+ labelIncludeDot: propTypesExports.oneOfType([propTypesExports.bool, propTypesExports.string, propTypesExports.func]),
72641
+ labelDotRadius: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72642
+ labelDotOrientation: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72643
+ labelsTransitionDuration: propTypesExports.number,
72644
+ labelLabel: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72645
+ onLabelClick: propTypesExports.func,
72646
+ onLabelRightClick: propTypesExports.func,
72647
+ onLabelHover: propTypesExports.func,
72648
+ htmlElementsData: propTypesExports.arrayOf(propTypesExports.object),
72649
+ htmlLat: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72650
+ htmlLng: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72651
+ htmlAltitude: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72652
+ htmlElement: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72653
+ htmlTransitionDuration: propTypesExports.number,
72654
+ objectsData: propTypesExports.arrayOf(propTypesExports.object),
72655
+ objectLat: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72656
+ objectLng: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72657
+ objectAltitude: propTypesExports.oneOfType([propTypesExports.number, propTypesExports.string, propTypesExports.func]),
72658
+ objectThreeObject: propTypesExports.oneOfType([propTypesExports.object, propTypesExports.string, propTypesExports.func]),
72659
+ objectLabel: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72660
+ onObjectClick: propTypesExports.func,
72661
+ onObjectRightClick: propTypesExports.func,
72662
+ onObjectHover: propTypesExports.func,
72663
+ customLayerData: propTypesExports.arrayOf(propTypesExports.object),
72664
+ customThreeObject: propTypesExports.oneOfType([propTypesExports.object, propTypesExports.string, propTypesExports.func]),
72665
+ customThreeObjectUpdate: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72666
+ customLayerLabel: propTypesExports.oneOfType([propTypesExports.string, propTypesExports.func]),
72667
+ onCustomLayerClick: propTypesExports.func,
72668
+ onCustomLayerRightClick: propTypesExports.func,
72669
+ onCustomLayerHover: propTypesExports.func,
72670
+ enablePointerInteraction: propTypesExports.bool,
72671
+ pointerEventsFilter: propTypesExports.func,
72672
+ lineHoverPrecision: propTypesExports.number,
72673
+ onZoom: propTypesExports.func
72398
72674
  };
72399
72675
 
72400
72676
  var Globe = index$3(globe, {