globe.gl 2.32.2 → 2.32.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/globe.gl.js CHANGED
@@ -1,4 +1,4 @@
1
- // Version 2.32.2 globe.gl - https://github.com/vasturiano/globe.gl
1
+ // Version 2.32.3 globe.gl - https://github.com/vasturiano/globe.gl
2
2
  (function (global, factory) {
3
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
4
  typeof define === 'function' && define.amd ? define(factory) :
@@ -68,7 +68,7 @@
68
68
  }
69
69
  function _toPropertyKey$7(t) {
70
70
  var i = _toPrimitive$7(t, "string");
71
- return "symbol" == typeof i ? i : String(i);
71
+ return "symbol" == typeof i ? i : i + "";
72
72
  }
73
73
  function _defineProperty$3(obj, key, value) {
74
74
  key = _toPropertyKey$7(key);
@@ -142,7 +142,7 @@
142
142
  * Copyright 2010-2023 Three.js Authors
143
143
  * SPDX-License-Identifier: MIT
144
144
  */
145
- const REVISION = '161';
145
+ const REVISION = '162';
146
146
 
147
147
  const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
148
148
  const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
@@ -199,6 +199,7 @@
199
199
  const ACESFilmicToneMapping = 4;
200
200
  const CustomToneMapping = 5;
201
201
  const AgXToneMapping = 6;
202
+ const NeutralToneMapping = 7;
202
203
 
203
204
  const UVMapping = 300;
204
205
  const CubeReflectionMapping = 301;
@@ -273,10 +274,6 @@
273
274
  const TrianglesDrawMode = 0;
274
275
  const TriangleStripDrawMode = 1;
275
276
  const TriangleFanDrawMode = 2;
276
- /** @deprecated Use LinearSRGBColorSpace or NoColorSpace in three.js r152+. */
277
- const LinearEncoding = 3000;
278
- /** @deprecated Use SRGBColorSpace in three.js r152+. */
279
- const sRGBEncoding = 3001;
280
277
  const BasicDepthPacking = 3200;
281
278
  const RGBADepthPacking = 3201;
282
279
  const TangentSpaceNormalMap = 0;
@@ -2072,17 +2069,7 @@
2072
2069
  this.flipY = true;
2073
2070
  this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)
2074
2071
 
2075
- if ( typeof colorSpace === 'string' ) {
2076
-
2077
- this.colorSpace = colorSpace;
2078
-
2079
- } else { // @deprecated, r152
2080
-
2081
- warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
2082
- this.colorSpace = colorSpace === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
2083
-
2084
- }
2085
-
2072
+ this.colorSpace = colorSpace;
2086
2073
 
2087
2074
  this.userData = {};
2088
2075
 
@@ -2321,20 +2308,6 @@
2321
2308
 
2322
2309
  }
2323
2310
 
2324
- get encoding() { // @deprecated, r152
2325
-
2326
- warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
2327
- return this.colorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
2328
-
2329
- }
2330
-
2331
- set encoding( encoding ) { // @deprecated, r152
2332
-
2333
- warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
2334
- this.colorSpace = encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
2335
-
2336
- }
2337
-
2338
2311
  }
2339
2312
 
2340
2313
  Texture.DEFAULT_IMAGE = null;
@@ -3008,14 +2981,6 @@
3008
2981
 
3009
2982
  const image = { width: width, height: height, depth: 1 };
3010
2983
 
3011
- if ( options.encoding !== undefined ) {
3012
-
3013
- // @deprecated, r152
3014
- warnOnce( 'THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace.' );
3015
- options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
3016
-
3017
- }
3018
-
3019
2984
  options = Object.assign( {
3020
2985
  generateMipmaps: false,
3021
2986
  internalFormat: null,
@@ -3023,15 +2988,25 @@
3023
2988
  depthBuffer: true,
3024
2989
  stencilBuffer: false,
3025
2990
  depthTexture: null,
3026
- samples: 0
2991
+ samples: 0,
2992
+ count: 1
3027
2993
  }, options );
3028
2994
 
3029
- this.texture = new Texture( image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
3030
- this.texture.isRenderTargetTexture = true;
2995
+ const texture = new Texture( image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
2996
+
2997
+ texture.flipY = false;
2998
+ texture.generateMipmaps = options.generateMipmaps;
2999
+ texture.internalFormat = options.internalFormat;
3000
+
3001
+ this.textures = [];
3002
+
3003
+ const count = options.count;
3004
+ for ( let i = 0; i < count; i ++ ) {
3031
3005
 
3032
- this.texture.flipY = false;
3033
- this.texture.generateMipmaps = options.generateMipmaps;
3034
- this.texture.internalFormat = options.internalFormat;
3006
+ this.textures[ i ] = texture.clone();
3007
+ this.textures[ i ].isRenderTargetTexture = true;
3008
+
3009
+ }
3035
3010
 
3036
3011
  this.depthBuffer = options.depthBuffer;
3037
3012
  this.stencilBuffer = options.stencilBuffer;
@@ -3042,6 +3017,18 @@
3042
3017
 
3043
3018
  }
3044
3019
 
3020
+ get texture() {
3021
+
3022
+ return this.textures[ 0 ];
3023
+
3024
+ }
3025
+
3026
+ set texture( value ) {
3027
+
3028
+ this.textures[ 0 ] = value;
3029
+
3030
+ }
3031
+
3045
3032
  setSize( width, height, depth = 1 ) {
3046
3033
 
3047
3034
  if ( this.width !== width || this.height !== height || this.depth !== depth ) {
@@ -3050,9 +3037,13 @@
3050
3037
  this.height = height;
3051
3038
  this.depth = depth;
3052
3039
 
3053
- this.texture.image.width = width;
3054
- this.texture.image.height = height;
3055
- this.texture.image.depth = depth;
3040
+ for ( let i = 0, il = this.textures.length; i < il; i ++ ) {
3041
+
3042
+ this.textures[ i ].image.width = width;
3043
+ this.textures[ i ].image.height = height;
3044
+ this.textures[ i ].image.depth = depth;
3045
+
3046
+ }
3056
3047
 
3057
3048
  this.dispose();
3058
3049
 
@@ -3080,8 +3071,14 @@
3080
3071
 
3081
3072
  this.viewport.copy( source.viewport );
3082
3073
 
3083
- this.texture = source.texture.clone();
3084
- this.texture.isRenderTargetTexture = true;
3074
+ this.textures.length = 0;
3075
+
3076
+ for ( let i = 0, il = source.textures.length; i < il; i ++ ) {
3077
+
3078
+ this.textures[ i ] = source.textures[ i ].clone();
3079
+ this.textures[ i ].isRenderTargetTexture = true;
3080
+
3081
+ }
3085
3082
 
3086
3083
  // ensure image object is not shared, see #20328
3087
3084
 
@@ -3764,23 +3761,24 @@
3764
3761
 
3765
3762
  random() {
3766
3763
 
3767
- // Derived from http://planning.cs.uiuc.edu/node198.html
3768
- // Note, this source uses w, x, y, z ordering,
3769
- // so we swap the order below.
3764
+ // sets this quaternion to a uniform random unit quaternnion
3770
3765
 
3771
- const u1 = Math.random();
3772
- const sqrt1u1 = Math.sqrt( 1 - u1 );
3773
- const sqrtu1 = Math.sqrt( u1 );
3766
+ // Ken Shoemake
3767
+ // Uniform random rotations
3768
+ // D. Kirk, editor, Graphics Gems III, pages 124-132. Academic Press, New York, 1992.
3774
3769
 
3775
- const u2 = 2 * Math.PI * Math.random();
3770
+ const theta1 = 2 * Math.PI * Math.random();
3771
+ const theta2 = 2 * Math.PI * Math.random();
3776
3772
 
3777
- const u3 = 2 * Math.PI * Math.random();
3773
+ const x0 = Math.random();
3774
+ const r1 = Math.sqrt( 1 - x0 );
3775
+ const r2 = Math.sqrt( x0 );
3778
3776
 
3779
3777
  return this.set(
3780
- sqrt1u1 * Math.cos( u2 ),
3781
- sqrtu1 * Math.sin( u3 ),
3782
- sqrtu1 * Math.cos( u3 ),
3783
- sqrt1u1 * Math.sin( u2 ),
3778
+ r1 * Math.sin( theta1 ),
3779
+ r1 * Math.cos( theta1 ),
3780
+ r2 * Math.sin( theta2 ),
3781
+ r2 * Math.cos( theta2 ),
3784
3782
  );
3785
3783
 
3786
3784
  }
@@ -4548,15 +4546,15 @@
4548
4546
 
4549
4547
  randomDirection() {
4550
4548
 
4551
- // Derived from https://mathworld.wolfram.com/SpherePointPicking.html
4549
+ // https://mathworld.wolfram.com/SpherePointPicking.html
4552
4550
 
4553
- const u = ( Math.random() - 0.5 ) * 2;
4554
- const t = Math.random() * Math.PI * 2;
4555
- const f = Math.sqrt( 1 - u ** 2 );
4551
+ const theta = Math.random() * Math.PI * 2;
4552
+ const u = Math.random() * 2 - 1;
4553
+ const c = Math.sqrt( 1 - u * u );
4556
4554
 
4557
- this.x = f * Math.cos( t );
4558
- this.y = f * Math.sin( t );
4559
- this.z = u;
4555
+ this.x = c * Math.cos( theta );
4556
+ this.y = u;
4557
+ this.z = c * Math.sin( theta );
4560
4558
 
4561
4559
  return this;
4562
4560
 
@@ -6582,25 +6580,25 @@
6582
6580
  position.z = te[ 14 ];
6583
6581
 
6584
6582
  // scale the rotation part
6585
- _m1$2.copy( this );
6583
+ _m1$4.copy( this );
6586
6584
 
6587
6585
  const invSX = 1 / sx;
6588
6586
  const invSY = 1 / sy;
6589
6587
  const invSZ = 1 / sz;
6590
6588
 
6591
- _m1$2.elements[ 0 ] *= invSX;
6592
- _m1$2.elements[ 1 ] *= invSX;
6593
- _m1$2.elements[ 2 ] *= invSX;
6589
+ _m1$4.elements[ 0 ] *= invSX;
6590
+ _m1$4.elements[ 1 ] *= invSX;
6591
+ _m1$4.elements[ 2 ] *= invSX;
6594
6592
 
6595
- _m1$2.elements[ 4 ] *= invSY;
6596
- _m1$2.elements[ 5 ] *= invSY;
6597
- _m1$2.elements[ 6 ] *= invSY;
6593
+ _m1$4.elements[ 4 ] *= invSY;
6594
+ _m1$4.elements[ 5 ] *= invSY;
6595
+ _m1$4.elements[ 6 ] *= invSY;
6598
6596
 
6599
- _m1$2.elements[ 8 ] *= invSZ;
6600
- _m1$2.elements[ 9 ] *= invSZ;
6601
- _m1$2.elements[ 10 ] *= invSZ;
6597
+ _m1$4.elements[ 8 ] *= invSZ;
6598
+ _m1$4.elements[ 9 ] *= invSZ;
6599
+ _m1$4.elements[ 10 ] *= invSZ;
6602
6600
 
6603
- quaternion.setFromRotationMatrix( _m1$2 );
6601
+ quaternion.setFromRotationMatrix( _m1$4 );
6604
6602
 
6605
6603
  scale.x = sx;
6606
6604
  scale.y = sy;
@@ -6741,14 +6739,14 @@
6741
6739
  }
6742
6740
 
6743
6741
  const _v1$5 = /*@__PURE__*/ new Vector3();
6744
- const _m1$2 = /*@__PURE__*/ new Matrix4();
6742
+ const _m1$4 = /*@__PURE__*/ new Matrix4();
6745
6743
  const _zero = /*@__PURE__*/ new Vector3( 0, 0, 0 );
6746
6744
  const _one = /*@__PURE__*/ new Vector3( 1, 1, 1 );
6747
6745
  const _x = /*@__PURE__*/ new Vector3();
6748
6746
  const _y = /*@__PURE__*/ new Vector3();
6749
6747
  const _z = /*@__PURE__*/ new Vector3();
6750
6748
 
6751
- const _matrix$1 = /*@__PURE__*/ new Matrix4();
6749
+ const _matrix$2 = /*@__PURE__*/ new Matrix4();
6752
6750
  const _quaternion$3 = /*@__PURE__*/ new Quaternion();
6753
6751
 
6754
6752
  class Euler {
@@ -6983,9 +6981,9 @@
6983
6981
 
6984
6982
  setFromQuaternion( q, order, update ) {
6985
6983
 
6986
- _matrix$1.makeRotationFromQuaternion( q );
6984
+ _matrix$2.makeRotationFromQuaternion( q );
6987
6985
 
6988
- return this.setFromRotationMatrix( _matrix$1, order, update );
6986
+ return this.setFromRotationMatrix( _matrix$2, order, update );
6989
6987
 
6990
6988
  }
6991
6989
 
@@ -7120,7 +7118,7 @@
7120
7118
 
7121
7119
  const _v1$4 = /*@__PURE__*/ new Vector3();
7122
7120
  const _q1 = /*@__PURE__*/ new Quaternion();
7123
- const _m1$1 = /*@__PURE__*/ new Matrix4();
7121
+ const _m1$3 = /*@__PURE__*/ new Matrix4();
7124
7122
  const _target = /*@__PURE__*/ new Vector3();
7125
7123
 
7126
7124
  const _position$3 = /*@__PURE__*/ new Vector3();
@@ -7134,6 +7132,9 @@
7134
7132
  const _addedEvent = { type: 'added' };
7135
7133
  const _removedEvent = { type: 'removed' };
7136
7134
 
7135
+ const _childaddedEvent = { type: 'childadded', child: null };
7136
+ const _childremovedEvent = { type: 'childremoved', child: null };
7137
+
7137
7138
  class Object3D extends EventDispatcher {
7138
7139
 
7139
7140
  constructor() {
@@ -7370,7 +7371,7 @@
7370
7371
 
7371
7372
  this.updateWorldMatrix( true, false );
7372
7373
 
7373
- return vector.applyMatrix4( _m1$1.copy( this.matrixWorld ).invert() );
7374
+ return vector.applyMatrix4( _m1$3.copy( this.matrixWorld ).invert() );
7374
7375
 
7375
7376
  }
7376
7377
 
@@ -7396,20 +7397,20 @@
7396
7397
 
7397
7398
  if ( this.isCamera || this.isLight ) {
7398
7399
 
7399
- _m1$1.lookAt( _position$3, _target, this.up );
7400
+ _m1$3.lookAt( _position$3, _target, this.up );
7400
7401
 
7401
7402
  } else {
7402
7403
 
7403
- _m1$1.lookAt( _target, _position$3, this.up );
7404
+ _m1$3.lookAt( _target, _position$3, this.up );
7404
7405
 
7405
7406
  }
7406
7407
 
7407
- this.quaternion.setFromRotationMatrix( _m1$1 );
7408
+ this.quaternion.setFromRotationMatrix( _m1$3 );
7408
7409
 
7409
7410
  if ( parent ) {
7410
7411
 
7411
- _m1$1.extractRotation( parent.matrixWorld );
7412
- _q1.setFromRotationMatrix( _m1$1 );
7412
+ _m1$3.extractRotation( parent.matrixWorld );
7413
+ _q1.setFromRotationMatrix( _m1$3 );
7413
7414
  this.quaternion.premultiply( _q1.invert() );
7414
7415
 
7415
7416
  }
@@ -7450,6 +7451,10 @@
7450
7451
 
7451
7452
  object.dispatchEvent( _addedEvent );
7452
7453
 
7454
+ _childaddedEvent.child = object;
7455
+ this.dispatchEvent( _childaddedEvent );
7456
+ _childaddedEvent.child = null;
7457
+
7453
7458
  } else {
7454
7459
 
7455
7460
  console.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object );
@@ -7483,6 +7488,10 @@
7483
7488
 
7484
7489
  object.dispatchEvent( _removedEvent );
7485
7490
 
7491
+ _childremovedEvent.child = object;
7492
+ this.dispatchEvent( _childremovedEvent );
7493
+ _childremovedEvent.child = null;
7494
+
7486
7495
  }
7487
7496
 
7488
7497
  return this;
@@ -7517,17 +7526,17 @@
7517
7526
 
7518
7527
  this.updateWorldMatrix( true, false );
7519
7528
 
7520
- _m1$1.copy( this.matrixWorld ).invert();
7529
+ _m1$3.copy( this.matrixWorld ).invert();
7521
7530
 
7522
7531
  if ( object.parent !== null ) {
7523
7532
 
7524
7533
  object.parent.updateWorldMatrix( true, false );
7525
7534
 
7526
- _m1$1.multiply( object.parent.matrixWorld );
7535
+ _m1$3.multiply( object.parent.matrixWorld );
7527
7536
 
7528
7537
  }
7529
7538
 
7530
- object.applyMatrix4( _m1$1 );
7539
+ object.applyMatrix4( _m1$3 );
7531
7540
 
7532
7541
  this.add( object );
7533
7542
 
@@ -9227,7 +9236,7 @@
9227
9236
  if ( this.sheenColor && this.sheenColor.isColor ) data.sheenColor = this.sheenColor.getHex();
9228
9237
  if ( this.sheenRoughness !== undefined ) data.sheenRoughness = this.sheenRoughness;
9229
9238
  if ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex();
9230
- if ( this.emissiveIntensity && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;
9239
+ if ( this.emissiveIntensity !== undefined && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;
9231
9240
 
9232
9241
  if ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex();
9233
9242
  if ( this.specularIntensity !== undefined ) data.specularIntensity = this.specularIntensity;
@@ -9337,6 +9346,7 @@
9337
9346
 
9338
9347
  }
9339
9348
 
9349
+ if ( this.envMapRotation !== undefined ) data.envMapRotation = this.envMapRotation.toArray();
9340
9350
  if ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity;
9341
9351
  if ( this.reflectivity !== undefined ) data.reflectivity = this.reflectivity;
9342
9352
  if ( this.refractionRatio !== undefined ) data.refractionRatio = this.refractionRatio;
@@ -9581,6 +9591,7 @@
9581
9591
  this.alphaMap = null;
9582
9592
 
9583
9593
  this.envMap = null;
9594
+ this.envMapRotation = new Euler();
9584
9595
  this.combine = MultiplyOperation;
9585
9596
  this.reflectivity = 1;
9586
9597
  this.refractionRatio = 0.98;
@@ -9615,6 +9626,7 @@
9615
9626
  this.alphaMap = source.alphaMap;
9616
9627
 
9617
9628
  this.envMap = source.envMap;
9629
+ this.envMapRotation.copy( source.envMapRotation );
9618
9630
  this.combine = source.combine;
9619
9631
  this.reflectivity = source.reflectivity;
9620
9632
  this.refractionRatio = source.refractionRatio;
@@ -10048,7 +10060,7 @@
10048
10060
 
10049
10061
  let _id$2 = 0;
10050
10062
 
10051
- const _m1 = /*@__PURE__*/ new Matrix4();
10063
+ const _m1$2 = /*@__PURE__*/ new Matrix4();
10052
10064
  const _obj = /*@__PURE__*/ new Object3D();
10053
10065
  const _offset = /*@__PURE__*/ new Vector3();
10054
10066
  const _box$2 = /*@__PURE__*/ new Box3();
@@ -10214,9 +10226,9 @@
10214
10226
 
10215
10227
  applyQuaternion( q ) {
10216
10228
 
10217
- _m1.makeRotationFromQuaternion( q );
10229
+ _m1$2.makeRotationFromQuaternion( q );
10218
10230
 
10219
- this.applyMatrix4( _m1 );
10231
+ this.applyMatrix4( _m1$2 );
10220
10232
 
10221
10233
  return this;
10222
10234
 
@@ -10226,9 +10238,9 @@
10226
10238
 
10227
10239
  // rotate geometry around world x-axis
10228
10240
 
10229
- _m1.makeRotationX( angle );
10241
+ _m1$2.makeRotationX( angle );
10230
10242
 
10231
- this.applyMatrix4( _m1 );
10243
+ this.applyMatrix4( _m1$2 );
10232
10244
 
10233
10245
  return this;
10234
10246
 
@@ -10238,9 +10250,9 @@
10238
10250
 
10239
10251
  // rotate geometry around world y-axis
10240
10252
 
10241
- _m1.makeRotationY( angle );
10253
+ _m1$2.makeRotationY( angle );
10242
10254
 
10243
- this.applyMatrix4( _m1 );
10255
+ this.applyMatrix4( _m1$2 );
10244
10256
 
10245
10257
  return this;
10246
10258
 
@@ -10250,9 +10262,9 @@
10250
10262
 
10251
10263
  // rotate geometry around world z-axis
10252
10264
 
10253
- _m1.makeRotationZ( angle );
10265
+ _m1$2.makeRotationZ( angle );
10254
10266
 
10255
- this.applyMatrix4( _m1 );
10267
+ this.applyMatrix4( _m1$2 );
10256
10268
 
10257
10269
  return this;
10258
10270
 
@@ -10262,9 +10274,9 @@
10262
10274
 
10263
10275
  // translate geometry
10264
10276
 
10265
- _m1.makeTranslation( x, y, z );
10277
+ _m1$2.makeTranslation( x, y, z );
10266
10278
 
10267
- this.applyMatrix4( _m1 );
10279
+ this.applyMatrix4( _m1$2 );
10268
10280
 
10269
10281
  return this;
10270
10282
 
@@ -10274,9 +10286,9 @@
10274
10286
 
10275
10287
  // scale geometry
10276
10288
 
10277
- _m1.makeScale( x, y, z );
10289
+ _m1$2.makeScale( x, y, z );
10278
10290
 
10279
- this.applyMatrix4( _m1 );
10291
+ this.applyMatrix4( _m1$2 );
10280
10292
 
10281
10293
  return this;
10282
10294
 
@@ -10336,7 +10348,7 @@
10336
10348
 
10337
10349
  if ( position && position.isGLBufferAttribute ) {
10338
10350
 
10339
- console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this );
10351
+ console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );
10340
10352
 
10341
10353
  this.boundingBox.set(
10342
10354
  new Vector3( - Infinity, - Infinity, - Infinity ),
@@ -10406,7 +10418,7 @@
10406
10418
 
10407
10419
  if ( position && position.isGLBufferAttribute ) {
10408
10420
 
10409
- console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this );
10421
+ console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );
10410
10422
 
10411
10423
  this.boundingSphere.set( new Vector3(), Infinity );
10412
10424
 
@@ -10523,24 +10535,21 @@
10523
10535
 
10524
10536
  }
10525
10537
 
10526
- const indices = index.array;
10527
- const positions = attributes.position.array;
10528
- const normals = attributes.normal.array;
10529
- const uvs = attributes.uv.array;
10530
-
10531
- const nVertices = positions.length / 3;
10538
+ const positionAttribute = attributes.position;
10539
+ const normalAttribute = attributes.normal;
10540
+ const uvAttribute = attributes.uv;
10532
10541
 
10533
10542
  if ( this.hasAttribute( 'tangent' ) === false ) {
10534
10543
 
10535
- this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * nVertices ), 4 ) );
10544
+ this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );
10536
10545
 
10537
10546
  }
10538
10547
 
10539
- const tangents = this.getAttribute( 'tangent' ).array;
10548
+ const tangentAttribute = this.getAttribute( 'tangent' );
10540
10549
 
10541
10550
  const tan1 = [], tan2 = [];
10542
10551
 
10543
- for ( let i = 0; i < nVertices; i ++ ) {
10552
+ for ( let i = 0; i < positionAttribute.count; i ++ ) {
10544
10553
 
10545
10554
  tan1[ i ] = new Vector3();
10546
10555
  tan2[ i ] = new Vector3();
@@ -10560,13 +10569,13 @@
10560
10569
 
10561
10570
  function handleTriangle( a, b, c ) {
10562
10571
 
10563
- vA.fromArray( positions, a * 3 );
10564
- vB.fromArray( positions, b * 3 );
10565
- vC.fromArray( positions, c * 3 );
10572
+ vA.fromBufferAttribute( positionAttribute, a );
10573
+ vB.fromBufferAttribute( positionAttribute, b );
10574
+ vC.fromBufferAttribute( positionAttribute, c );
10566
10575
 
10567
- uvA.fromArray( uvs, a * 2 );
10568
- uvB.fromArray( uvs, b * 2 );
10569
- uvC.fromArray( uvs, c * 2 );
10576
+ uvA.fromBufferAttribute( uvAttribute, a );
10577
+ uvB.fromBufferAttribute( uvAttribute, b );
10578
+ uvC.fromBufferAttribute( uvAttribute, c );
10570
10579
 
10571
10580
  vB.sub( vA );
10572
10581
  vC.sub( vA );
@@ -10599,7 +10608,7 @@
10599
10608
 
10600
10609
  groups = [ {
10601
10610
  start: 0,
10602
- count: indices.length
10611
+ count: index.count
10603
10612
  } ];
10604
10613
 
10605
10614
  }
@@ -10614,9 +10623,9 @@
10614
10623
  for ( let j = start, jl = start + count; j < jl; j += 3 ) {
10615
10624
 
10616
10625
  handleTriangle(
10617
- indices[ j + 0 ],
10618
- indices[ j + 1 ],
10619
- indices[ j + 2 ]
10626
+ index.getX( j + 0 ),
10627
+ index.getX( j + 1 ),
10628
+ index.getX( j + 2 )
10620
10629
  );
10621
10630
 
10622
10631
  }
@@ -10628,7 +10637,7 @@
10628
10637
 
10629
10638
  function handleVertex( v ) {
10630
10639
 
10631
- n.fromArray( normals, v * 3 );
10640
+ n.fromBufferAttribute( normalAttribute, v );
10632
10641
  n2.copy( n );
10633
10642
 
10634
10643
  const t = tan1[ v ];
@@ -10644,10 +10653,7 @@
10644
10653
  const test = tmp2.dot( tan2[ v ] );
10645
10654
  const w = ( test < 0.0 ) ? - 1.0 : 1.0;
10646
10655
 
10647
- tangents[ v * 4 ] = tmp.x;
10648
- tangents[ v * 4 + 1 ] = tmp.y;
10649
- tangents[ v * 4 + 2 ] = tmp.z;
10650
- tangents[ v * 4 + 3 ] = w;
10656
+ tangentAttribute.setXYZW( v, tmp.x, tmp.y, tmp.z, w );
10651
10657
 
10652
10658
  }
10653
10659
 
@@ -10660,9 +10666,9 @@
10660
10666
 
10661
10667
  for ( let j = start, jl = start + count; j < jl; j += 3 ) {
10662
10668
 
10663
- handleVertex( indices[ j + 0 ] );
10664
- handleVertex( indices[ j + 1 ] );
10665
- handleVertex( indices[ j + 2 ] );
10669
+ handleVertex( index.getX( j + 0 ) );
10670
+ handleVertex( index.getX( j + 1 ) );
10671
+ handleVertex( index.getX( j + 2 ) );
10666
10672
 
10667
10673
  }
10668
10674
 
@@ -11491,7 +11497,6 @@
11491
11497
  _uvC$1.fromBufferAttribute( uv1, c );
11492
11498
 
11493
11499
  intersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );
11494
- intersection.uv2 = intersection.uv1; // @deprecated, r152
11495
11500
 
11496
11501
  }
11497
11502
 
@@ -12525,14 +12530,6 @@
12525
12530
  const image = { width: size, height: size, depth: 1 };
12526
12531
  const images = [ image, image, image, image, image, image ];
12527
12532
 
12528
- if ( options.encoding !== undefined ) {
12529
-
12530
- // @deprecated, r152
12531
- warnOnce( 'THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace.' );
12532
- options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
12533
-
12534
- }
12535
-
12536
12533
  this.texture = new CubeTexture( images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
12537
12534
 
12538
12535
  // By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)
@@ -13475,9 +13472,9 @@
13475
13472
 
13476
13473
  var colorspace_pars_fragment = "\nconst mat3 LINEAR_SRGB_TO_LINEAR_DISPLAY_P3 = mat3(\n\tvec3( 0.8224621, 0.177538, 0.0 ),\n\tvec3( 0.0331941, 0.9668058, 0.0 ),\n\tvec3( 0.0170827, 0.0723974, 0.9105199 )\n);\nconst mat3 LINEAR_DISPLAY_P3_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.2249401, - 0.2249404, 0.0 ),\n\tvec3( - 0.0420569, 1.0420571, 0.0 ),\n\tvec3( - 0.0196376, - 0.0786361, 1.0982735 )\n);\nvec4 LinearSRGBToLinearDisplayP3( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_SRGB_TO_LINEAR_DISPLAY_P3, value.a );\n}\nvec4 LinearDisplayP3ToLinearSRGB( in vec4 value ) {\n\treturn vec4( value.rgb * LINEAR_DISPLAY_P3_TO_LINEAR_SRGB, value.a );\n}\nvec4 LinearTransferOETF( in vec4 value ) {\n\treturn value;\n}\nvec4 sRGBTransferOETF( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}\nvec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn sRGBTransferOETF( value );\n}";
13477
13474
 
13478
- var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif";
13475
+ var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif";
13479
13476
 
13480
- var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif";
13477
+ var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif";
13481
13478
 
13482
13479
  var envmap_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif";
13483
13480
 
@@ -13505,7 +13502,7 @@
13505
13502
 
13506
13503
  var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\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 ( LEGACY_LIGHTS )\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#else\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#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, 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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\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 vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\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";
13507
13504
 
13508
- var envmap_physical_pars_fragment = "#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif";
13505
+ var envmap_physical_pars_fragment = "#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif";
13509
13506
 
13510
13507
  var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
13511
13508
 
@@ -13545,11 +13542,13 @@
13545
13542
 
13546
13543
  var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif";
13547
13544
 
13545
+ var morphinstance_vertex = "#ifdef USE_INSTANCING_MORPH\n\tfloat morphTargetInfluences[MORPHTARGETS_COUNT];\n\tfloat morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\tmorphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;\n\t}\n#endif";
13546
+
13548
13547
  var morphcolor_vertex = "#if defined( USE_MORPHCOLORS ) && defined( MORPHTARGETS_TEXTURE )\n\tvColor *= morphTargetBaseInfluence;\n\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t#if defined( USE_COLOR_ALPHA )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];\n\t\t#elif defined( USE_COLOR )\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];\n\t\t#endif\n\t}\n#endif";
13549
13548
 
13550
13549
  var morphnormal_vertex = "#ifdef USE_MORPHNORMALS\n\tobjectNormal *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\tobjectNormal += morphNormal0 * morphTargetInfluences[ 0 ];\n\t\tobjectNormal += morphNormal1 * morphTargetInfluences[ 1 ];\n\t\tobjectNormal += morphNormal2 * morphTargetInfluences[ 2 ];\n\t\tobjectNormal += morphNormal3 * morphTargetInfluences[ 3 ];\n\t#endif\n#endif";
13551
13550
 
13552
- var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\tuniform float morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif";
13551
+ var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\t#ifndef USE_INSTANCING_MORPH\n\t\tuniform float morphTargetBaseInfluence;\n\t#endif\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\t#ifndef USE_INSTANCING_MORPH\n\t\t\tuniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];\n\t\t#endif\n\t\tuniform sampler2DArray morphTargetsTexture;\n\t\tuniform ivec2 morphTargetsTextureSize;\n\t\tvec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {\n\t\t\tint texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;\n\t\t\tint y = texelIndex / morphTargetsTextureSize.x;\n\t\t\tint x = texelIndex - y * morphTargetsTextureSize.x;\n\t\t\tivec3 morphUV = ivec3( x, y, morphTargetIndex );\n\t\t\treturn texelFetch( morphTargetsTexture, morphUV, 0 );\n\t\t}\n\t#else\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\tuniform float morphTargetInfluences[ 8 ];\n\t\t#else\n\t\t\tuniform float morphTargetInfluences[ 4 ];\n\t\t#endif\n\t#endif\n#endif";
13553
13552
 
13554
13553
  var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif";
13555
13554
 
@@ -13611,7 +13610,7 @@
13611
13610
 
13612
13611
  var tonemapping_fragment = "#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif";
13613
13612
 
13614
- var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }";
13613
+ var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nconst mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(\n\tvec3( 1.6605, - 0.1246, - 0.0182 ),\n\tvec3( - 0.5876, 1.1329, - 0.1006 ),\n\tvec3( - 0.0728, - 0.0083, 1.1187 )\n);\nconst mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(\n\tvec3( 0.6274, 0.0691, 0.0164 ),\n\tvec3( 0.3293, 0.9195, 0.0880 ),\n\tvec3( 0.0433, 0.0113, 0.8956 )\n);\nvec3 agxDefaultContrastApprox( vec3 x ) {\n\tvec3 x2 = x * x;\n\tvec3 x4 = x2 * x2;\n\treturn + 15.5 * x4 * x2\n\t\t- 40.14 * x4 * x\n\t\t+ 31.96 * x4\n\t\t- 6.868 * x2 * x\n\t\t+ 0.4298 * x2\n\t\t+ 0.1191 * x\n\t\t- 0.00232;\n}\nvec3 AgXToneMapping( vec3 color ) {\n\tconst mat3 AgXInsetMatrix = mat3(\n\t\tvec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),\n\t\tvec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),\n\t\tvec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )\n\t);\n\tconst mat3 AgXOutsetMatrix = mat3(\n\t\tvec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),\n\t\tvec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),\n\t\tvec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )\n\t);\n\tconst float AgxMinEv = - 12.47393;\tconst float AgxMaxEv = 4.026069;\n\tcolor *= toneMappingExposure;\n\tcolor = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor = AgXInsetMatrix * color;\n\tcolor = max( color, 1e-10 );\tcolor = log2( color );\n\tcolor = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );\n\tcolor = clamp( color, 0.0, 1.0 );\n\tcolor = agxDefaultContrastApprox( color );\n\tcolor = AgXOutsetMatrix * color;\n\tcolor = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );\n\tcolor = LINEAR_REC2020_TO_LINEAR_SRGB * color;\n\tcolor = clamp( color, 0.0, 1.0 );\n\treturn color;\n}\nvec3 NeutralToneMapping( vec3 color ) {\n\tfloat startCompression = 0.8 - 0.04;\n\tfloat desaturation = 0.15;\n\tcolor *= toneMappingExposure;\n\tfloat x = min(color.r, min(color.g, color.b));\n\tfloat offset = x < 0.08 ? x - 6.25 * x * x : 0.04;\n\tcolor -= offset;\n\tfloat peak = max(color.r, max(color.g, color.b));\n\tif (peak < startCompression) return color;\n\tfloat d = 1. - startCompression;\n\tfloat newPeak = 1. - d * d / (peak + d - startCompression);\n\tcolor *= newPeak / peak;\n\tfloat g = 1. - 1. / (desaturation * (peak - newPeak) + 1.);\n\treturn mix(color, vec3(1, 1, 1), g);\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }";
13615
13614
 
13616
13615
  var transmission_fragment = "#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif";
13617
13616
 
@@ -13631,17 +13630,17 @@
13631
13630
 
13632
13631
  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}";
13633
13632
 
13634
- 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 <colorspace_fragment>\n}";
13633
+ 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;\nuniform mat3 backgroundRotation;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, backgroundRotation * 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 <colorspace_fragment>\n}";
13635
13634
 
13636
13635
  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}";
13637
13636
 
13638
13637
  const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
13639
13638
 
13640
- const vertex$e = "#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}";
13639
+ const vertex$e = "#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}";
13641
13640
 
13642
13641
  const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}";
13643
13642
 
13644
- const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}";
13643
+ const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <skinbase_vertex>\n\t#include <morphinstance_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}";
13645
13644
 
13646
13645
  const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <clipping_planes_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}";
13647
13646
 
@@ -13649,43 +13648,43 @@
13649
13648
 
13650
13649
  const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
13651
13650
 
13652
- const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";
13651
+ const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";
13653
13652
 
13654
13653
  const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";
13655
13654
 
13656
- const vertex$a = "#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}";
13655
+ const vertex$a = "#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}";
13657
13656
 
13658
13657
  const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13659
13658
 
13660
- const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
13659
+ const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
13661
13660
 
13662
13661
  const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13663
13662
 
13664
- const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}";
13663
+ const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}";
13665
13664
 
13666
13665
  const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13667
13666
 
13668
- const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}";
13667
+ const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}";
13669
13668
 
13670
13669
  const fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <packing>\n#include <uv_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );\n\t#include <clipping_planes_fragment>\n\t#include <logdepthbuf_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tgl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}";
13671
13670
 
13672
- const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
13671
+ const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
13673
13672
 
13674
13673
  const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13675
13674
 
13676
- const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}";
13675
+ const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}";
13677
13676
 
13678
13677
  const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13679
13678
 
13680
- const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
13679
+ const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <batching_pars_vertex>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
13681
13680
 
13682
13681
  const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13683
13682
 
13684
- const vertex$3 = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}";
13683
+ const vertex$3 = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}";
13685
13684
 
13686
13685
  const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";
13687
13686
 
13688
- const vertex$2 = "#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
13687
+ const vertex$2 = "#include <common>\n#include <batching_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <batching_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphinstance_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
13689
13688
 
13690
13689
  const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}";
13691
13690
 
@@ -13761,6 +13760,7 @@
13761
13760
  map_particle_pars_fragment: map_particle_pars_fragment,
13762
13761
  metalnessmap_fragment: metalnessmap_fragment,
13763
13762
  metalnessmap_pars_fragment: metalnessmap_pars_fragment,
13763
+ morphinstance_vertex: morphinstance_vertex,
13764
13764
  morphcolor_vertex: morphcolor_vertex,
13765
13765
  morphnormal_vertex: morphnormal_vertex,
13766
13766
  morphtarget_pars_vertex: morphtarget_pars_vertex,
@@ -13869,6 +13869,7 @@
13869
13869
  envmap: {
13870
13870
 
13871
13871
  envMap: { value: null },
13872
+ envMapRotation: { value: /*@__PURE__*/ new Matrix3() },
13872
13873
  flipEnvMap: { value: - 1 },
13873
13874
  reflectivity: { value: 1.0 }, // basic, lambert, phong
13874
13875
  ior: { value: 1.5 }, // physical
@@ -14289,7 +14290,8 @@
14289
14290
  envMap: { value: null },
14290
14291
  flipEnvMap: { value: - 1 },
14291
14292
  backgroundBlurriness: { value: 0 },
14292
- backgroundIntensity: { value: 1 }
14293
+ backgroundIntensity: { value: 1 },
14294
+ backgroundRotation: { value: /*@__PURE__*/ new Matrix3() }
14293
14295
  },
14294
14296
 
14295
14297
  vertexShader: ShaderChunk.backgroundCube_vert,
@@ -14413,6 +14415,8 @@
14413
14415
  };
14414
14416
 
14415
14417
  const _rgb = { r: 0, b: 0, g: 0 };
14418
+ const _e1$1 = /*@__PURE__*/ new Euler();
14419
+ const _m1$1 = /*@__PURE__*/ new Matrix4();
14416
14420
 
14417
14421
  function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, premultipliedAlpha ) {
14418
14422
 
@@ -14509,10 +14513,24 @@
14509
14513
 
14510
14514
  }
14511
14515
 
14516
+ _e1$1.copy( scene.backgroundRotation );
14517
+
14518
+ // accommodate left-handed frame
14519
+ _e1$1.x *= - 1; _e1$1.y *= - 1; _e1$1.z *= - 1;
14520
+
14521
+ if ( background.isCubeTexture && background.isRenderTargetTexture === false ) {
14522
+
14523
+ // environment maps which are not cube render targets or PMREMs follow a different convention
14524
+ _e1$1.y *= - 1;
14525
+ _e1$1.z *= - 1;
14526
+
14527
+ }
14528
+
14512
14529
  boxMesh.material.uniforms.envMap.value = background;
14513
14530
  boxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? - 1 : 1;
14514
14531
  boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;
14515
14532
  boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
14533
+ boxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4( _m1$1.makeRotationFromEuler( _e1$1 ) );
14516
14534
  boxMesh.material.toneMapped = ColorManagement.getTransfer( background.colorSpace ) !== SRGBTransfer;
14517
14535
 
14518
14536
  if ( currentBackground !== background ||
@@ -15977,6 +15995,7 @@
15977
15995
  * Generates a PMREM from an equirectangular texture, which can be either LDR
15978
15996
  * or HDR. The ideal input image size is 1k (1024 x 512),
15979
15997
  * as this matches best with the 256 x 256 cubemap output.
15998
+ * The smallest supported equirectangular image size is 64 x 32.
15980
15999
  */
15981
16000
  fromEquirectangular( equirectangular, renderTarget = null ) {
15982
16001
 
@@ -15988,6 +16007,7 @@
15988
16007
  * Generates a PMREM from an cubemap texture, which can be either LDR
15989
16008
  * or HDR. The ideal input cube size is 256 x 256,
15990
16009
  * as this matches best with the 256 x 256 cubemap output.
16010
+ * The smallest supported cube size is 16 x 16.
15991
16011
  */
15992
16012
  fromCubemap( cubemap, renderTarget = null ) {
15993
16013
 
@@ -17495,24 +17515,31 @@
17495
17515
  }
17496
17516
 
17497
17517
  //
17518
+ if ( object.isInstancedMesh === true && object.morphTexture !== null ) {
17498
17519
 
17499
- let morphInfluencesSum = 0;
17520
+ program.getUniforms().setValue( gl, 'morphTexture', object.morphTexture, textures );
17500
17521
 
17501
- for ( let i = 0; i < objectInfluences.length; i ++ ) {
17522
+ } else {
17502
17523
 
17503
- morphInfluencesSum += objectInfluences[ i ];
17524
+ let morphInfluencesSum = 0;
17504
17525
 
17505
- }
17526
+ for ( let i = 0; i < objectInfluences.length; i ++ ) {
17506
17527
 
17507
- const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
17528
+ morphInfluencesSum += objectInfluences[ i ];
17508
17529
 
17509
- program.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence );
17510
- program.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences );
17530
+ }
17531
+
17532
+ const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
17533
+
17534
+
17535
+ program.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence );
17536
+ program.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences );
17537
+
17538
+ }
17511
17539
 
17512
17540
  program.getUniforms().setValue( gl, 'morphTargetsTexture', entry.texture, textures );
17513
17541
  program.getUniforms().setValue( gl, 'morphTargetsTextureSize', entry.size );
17514
17542
 
17515
-
17516
17543
  } else {
17517
17544
 
17518
17545
  // When object doesn't have morph target influences defined, we treat it as a 0-length array
@@ -19061,6 +19088,10 @@
19061
19088
  toneMappingName = 'AgX';
19062
19089
  break;
19063
19090
 
19091
+ case NeutralToneMapping:
19092
+ toneMappingName = 'Neutral';
19093
+ break;
19094
+
19064
19095
  case CustomToneMapping:
19065
19096
  toneMappingName = 'Custom';
19066
19097
  break;
@@ -19484,6 +19515,7 @@
19484
19515
  parameters.batching ? '#define USE_BATCHING' : '',
19485
19516
  parameters.instancing ? '#define USE_INSTANCING' : '',
19486
19517
  parameters.instancingColor ? '#define USE_INSTANCING_COLOR' : '',
19518
+ parameters.instancingMorph ? '#define USE_INSTANCING_MORPH' : '',
19487
19519
 
19488
19520
  parameters.useFog && parameters.fog ? '#define USE_FOG' : '',
19489
19521
  parameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '',
@@ -19615,6 +19647,12 @@
19615
19647
 
19616
19648
  '#endif',
19617
19649
 
19650
+ '#ifdef USE_INSTANCING_MORPH',
19651
+
19652
+ ' uniform sampler2D morphTexture;',
19653
+
19654
+ '#endif',
19655
+
19618
19656
  'attribute vec3 position;',
19619
19657
  'attribute vec3 normal;',
19620
19658
  'attribute vec2 uv;',
@@ -20356,6 +20394,7 @@
20356
20394
  batching: IS_BATCHEDMESH,
20357
20395
  instancing: IS_INSTANCEDMESH,
20358
20396
  instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
20397
+ instancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null,
20359
20398
 
20360
20399
  supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
20361
20400
  outputColorSpace: ( currentRenderTarget === null ) ? renderer.outputColorSpace : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace ),
@@ -20642,38 +20681,40 @@
20642
20681
  _programLayers.enable( 2 );
20643
20682
  if ( parameters.instancingColor )
20644
20683
  _programLayers.enable( 3 );
20645
- if ( parameters.matcap )
20684
+ if ( parameters.instancingMorph )
20646
20685
  _programLayers.enable( 4 );
20647
- if ( parameters.envMap )
20686
+ if ( parameters.matcap )
20648
20687
  _programLayers.enable( 5 );
20649
- if ( parameters.normalMapObjectSpace )
20688
+ if ( parameters.envMap )
20650
20689
  _programLayers.enable( 6 );
20651
- if ( parameters.normalMapTangentSpace )
20690
+ if ( parameters.normalMapObjectSpace )
20652
20691
  _programLayers.enable( 7 );
20653
- if ( parameters.clearcoat )
20692
+ if ( parameters.normalMapTangentSpace )
20654
20693
  _programLayers.enable( 8 );
20655
- if ( parameters.iridescence )
20694
+ if ( parameters.clearcoat )
20656
20695
  _programLayers.enable( 9 );
20657
- if ( parameters.alphaTest )
20696
+ if ( parameters.iridescence )
20658
20697
  _programLayers.enable( 10 );
20659
- if ( parameters.vertexColors )
20698
+ if ( parameters.alphaTest )
20660
20699
  _programLayers.enable( 11 );
20661
- if ( parameters.vertexAlphas )
20700
+ if ( parameters.vertexColors )
20662
20701
  _programLayers.enable( 12 );
20663
- if ( parameters.vertexUv1s )
20702
+ if ( parameters.vertexAlphas )
20664
20703
  _programLayers.enable( 13 );
20665
- if ( parameters.vertexUv2s )
20704
+ if ( parameters.vertexUv1s )
20666
20705
  _programLayers.enable( 14 );
20667
- if ( parameters.vertexUv3s )
20706
+ if ( parameters.vertexUv2s )
20668
20707
  _programLayers.enable( 15 );
20669
- if ( parameters.vertexTangents )
20708
+ if ( parameters.vertexUv3s )
20670
20709
  _programLayers.enable( 16 );
20671
- if ( parameters.anisotropy )
20710
+ if ( parameters.vertexTangents )
20672
20711
  _programLayers.enable( 17 );
20673
- if ( parameters.alphaHash )
20712
+ if ( parameters.anisotropy )
20674
20713
  _programLayers.enable( 18 );
20675
- if ( parameters.batching )
20714
+ if ( parameters.alphaHash )
20676
20715
  _programLayers.enable( 19 );
20716
+ if ( parameters.batching )
20717
+ _programLayers.enable( 20 );
20677
20718
 
20678
20719
  array.push( _programLayers.mask );
20679
20720
  _programLayers.disableAll();
@@ -22778,33 +22819,19 @@
22778
22819
 
22779
22820
  }
22780
22821
 
22781
- if ( renderTarget.isWebGLMultipleRenderTargets ) {
22822
+ const textures = renderTarget.textures;
22782
22823
 
22783
- const textures = renderTarget.texture;
22824
+ if ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {
22784
22825
 
22785
- if ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {
22786
-
22787
- for ( let i = 0, il = textures.length; i < il; i ++ ) {
22826
+ for ( let i = 0, il = textures.length; i < il; i ++ ) {
22788
22827
 
22789
- drawBuffers[ i ] = gl.COLOR_ATTACHMENT0 + i;
22790
-
22791
- }
22792
-
22793
- drawBuffers.length = textures.length;
22794
-
22795
- needsUpdate = true;
22828
+ drawBuffers[ i ] = gl.COLOR_ATTACHMENT0 + i;
22796
22829
 
22797
22830
  }
22798
22831
 
22799
- } else {
22800
-
22801
- if ( drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {
22832
+ drawBuffers.length = textures.length;
22802
22833
 
22803
- drawBuffers[ 0 ] = gl.COLOR_ATTACHMENT0;
22804
-
22805
- needsUpdate = true;
22806
-
22807
- }
22834
+ needsUpdate = true;
22808
22835
 
22809
22836
  }
22810
22837
 
@@ -22826,10 +22853,14 @@
22826
22853
 
22827
22854
  gl.drawBuffers( drawBuffers );
22828
22855
 
22829
- } else {
22856
+ } else if ( extensions.has( 'WEBGL_draw_buffers' ) === true ) {
22830
22857
 
22831
22858
  extensions.get( 'WEBGL_draw_buffers' ).drawBuffersWEBGL( drawBuffers );
22832
22859
 
22860
+ } else {
22861
+
22862
+ throw new Error( 'THREE.WebGLState: Usage of gl.drawBuffers() require WebGL2 or WEBGL_draw_buffers extension' );
22863
+
22833
22864
  }
22834
22865
 
22835
22866
  }
@@ -23616,6 +23647,7 @@
23616
23647
  const multisampledRTTExt = extensions.has( 'WEBGL_multisampled_render_to_texture' ) ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : null;
23617
23648
  const supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent );
23618
23649
 
23650
+ const _imageDimensions = new Vector2();
23619
23651
  const _videoTextures = new WeakMap();
23620
23652
  let _canvas;
23621
23653
 
@@ -23653,11 +23685,13 @@
23653
23685
 
23654
23686
  let scale = 1;
23655
23687
 
23688
+ const dimensions = getDimensions( image );
23689
+
23656
23690
  // handle case if texture exceeds max size
23657
23691
 
23658
- if ( image.width > maxSize || image.height > maxSize ) {
23692
+ if ( dimensions.width > maxSize || dimensions.height > maxSize ) {
23659
23693
 
23660
- scale = maxSize / Math.max( image.width, image.height );
23694
+ scale = maxSize / Math.max( dimensions.width, dimensions.height );
23661
23695
 
23662
23696
  }
23663
23697
 
@@ -23669,12 +23703,13 @@
23669
23703
 
23670
23704
  if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||
23671
23705
  ( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||
23672
- ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {
23706
+ ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ||
23707
+ ( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) ) {
23673
23708
 
23674
23709
  const floor = needsPowerOfTwo ? floorPowerOfTwo : Math.floor;
23675
23710
 
23676
- const width = floor( scale * image.width );
23677
- const height = floor( scale * image.height );
23711
+ const width = floor( scale * dimensions.width );
23712
+ const height = floor( scale * dimensions.height );
23678
23713
 
23679
23714
  if ( _canvas === undefined ) _canvas = createCanvas( width, height );
23680
23715
 
@@ -23688,7 +23723,7 @@
23688
23723
  const context = canvas.getContext( '2d' );
23689
23724
  context.drawImage( image, 0, 0, width, height );
23690
23725
 
23691
- console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + image.width + 'x' + image.height + ') to (' + width + 'x' + height + ').' );
23726
+ console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + dimensions.width + 'x' + dimensions.height + ') to (' + width + 'x' + height + ').' );
23692
23727
 
23693
23728
  return canvas;
23694
23729
 
@@ -23696,7 +23731,7 @@
23696
23731
 
23697
23732
  if ( 'data' in image ) {
23698
23733
 
23699
- console.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + image.width + 'x' + image.height + ').' );
23734
+ console.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + dimensions.width + 'x' + dimensions.height + ').' );
23700
23735
 
23701
23736
  }
23702
23737
 
@@ -23712,7 +23747,9 @@
23712
23747
 
23713
23748
  function isPowerOfTwo$1( image ) {
23714
23749
 
23715
- return isPowerOfTwo( image.width ) && isPowerOfTwo( image.height );
23750
+ const dimensions = getDimensions( image );
23751
+
23752
+ return isPowerOfTwo( dimensions.width ) && isPowerOfTwo( dimensions.height );
23716
23753
 
23717
23754
  }
23718
23755
 
@@ -23779,6 +23816,17 @@
23779
23816
 
23780
23817
  }
23781
23818
 
23819
+ if ( glFormat === _gl.RG_INTEGER ) {
23820
+
23821
+ if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RG8UI;
23822
+ if ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.RG16UI;
23823
+ if ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.RG32UI;
23824
+ if ( glType === _gl.BYTE ) internalFormat = _gl.RG8I;
23825
+ if ( glType === _gl.SHORT ) internalFormat = _gl.RG16I;
23826
+ if ( glType === _gl.INT ) internalFormat = _gl.RG32I;
23827
+
23828
+ }
23829
+
23782
23830
  if ( glFormat === _gl.RGBA ) {
23783
23831
 
23784
23832
  const transfer = forceLinearTransfer ? LinearTransfer : ColorManagement.getTransfer( colorSpace );
@@ -23926,18 +23974,7 @@
23926
23974
 
23927
23975
  function deallocateRenderTarget( renderTarget ) {
23928
23976
 
23929
- const texture = renderTarget.texture;
23930
-
23931
23977
  const renderTargetProperties = properties.get( renderTarget );
23932
- const textureProperties = properties.get( texture );
23933
-
23934
- if ( textureProperties.__webglTexture !== undefined ) {
23935
-
23936
- _gl.deleteTexture( textureProperties.__webglTexture );
23937
-
23938
- info.memory.textures --;
23939
-
23940
- }
23941
23978
 
23942
23979
  if ( renderTarget.depthTexture ) {
23943
23980
 
@@ -23992,27 +24029,24 @@
23992
24029
 
23993
24030
  }
23994
24031
 
23995
- if ( renderTarget.isWebGLMultipleRenderTargets ) {
23996
-
23997
- for ( let i = 0, il = texture.length; i < il; i ++ ) {
24032
+ const textures = renderTarget.textures;
23998
24033
 
23999
- const attachmentProperties = properties.get( texture[ i ] );
24000
-
24001
- if ( attachmentProperties.__webglTexture ) {
24034
+ for ( let i = 0, il = textures.length; i < il; i ++ ) {
24002
24035
 
24003
- _gl.deleteTexture( attachmentProperties.__webglTexture );
24036
+ const attachmentProperties = properties.get( textures[ i ] );
24004
24037
 
24005
- info.memory.textures --;
24038
+ if ( attachmentProperties.__webglTexture ) {
24006
24039
 
24007
- }
24040
+ _gl.deleteTexture( attachmentProperties.__webglTexture );
24008
24041
 
24009
- properties.remove( texture[ i ] );
24042
+ info.memory.textures --;
24010
24043
 
24011
24044
  }
24012
24045
 
24046
+ properties.remove( textures[ i ] );
24047
+
24013
24048
  }
24014
24049
 
24015
- properties.remove( texture );
24016
24050
  properties.remove( renderTarget );
24017
24051
 
24018
24052
  }
@@ -24232,8 +24266,6 @@
24232
24266
 
24233
24267
  if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {
24234
24268
 
24235
- const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
24236
-
24237
24269
  if ( texture.magFilter === NearestFilter ) return;
24238
24270
  if ( texture.minFilter !== NearestMipmapLinearFilter && texture.minFilter !== LinearMipmapLinearFilter ) return;
24239
24271
  if ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false ) return; // verify extension for WebGL 1 and WebGL 2
@@ -24241,6 +24273,7 @@
24241
24273
 
24242
24274
  if ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) {
24243
24275
 
24276
+ const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
24244
24277
  _gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) );
24245
24278
  properties.get( texture ).__currentAnisotropy = texture.anisotropy;
24246
24279
 
@@ -24724,7 +24757,9 @@
24724
24757
 
24725
24758
  if ( useTexStorage && allocateMemory ) {
24726
24759
 
24727
- state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );
24760
+ const dimensions = getDimensions( mipmaps[ 0 ] );
24761
+
24762
+ state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height );
24728
24763
 
24729
24764
  }
24730
24765
 
@@ -24756,7 +24791,9 @@
24756
24791
 
24757
24792
  if ( allocateMemory ) {
24758
24793
 
24759
- state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height );
24794
+ const dimensions = getDimensions( image );
24795
+
24796
+ state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height );
24760
24797
 
24761
24798
  }
24762
24799
 
@@ -24926,7 +24963,9 @@
24926
24963
 
24927
24964
  if ( mipmaps.length > 0 ) levels ++;
24928
24965
 
24929
- state.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, cubeImage[ 0 ].width, cubeImage[ 0 ].height );
24966
+ const dimensions = getDimensions( cubeImage[ 0 ] );
24967
+
24968
+ state.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, dimensions.width, dimensions.height );
24930
24969
 
24931
24970
  }
24932
24971
 
@@ -25142,7 +25181,7 @@
25142
25181
 
25143
25182
  } else {
25144
25183
 
25145
- const textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [ renderTarget.texture ];
25184
+ const textures = renderTarget.textures;
25146
25185
 
25147
25186
  for ( let i = 0; i < textures.length; i ++ ) {
25148
25187
 
@@ -25306,7 +25345,13 @@
25306
25345
 
25307
25346
  renderTarget.addEventListener( 'dispose', onRenderTargetDispose );
25308
25347
 
25309
- if ( renderTarget.isWebGLMultipleRenderTargets !== true ) {
25348
+ const textures = renderTarget.textures;
25349
+
25350
+ const isCube = ( renderTarget.isWebGLCubeRenderTarget === true );
25351
+ const isMultipleRenderTargets = ( textures.length > 1 );
25352
+ const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;
25353
+
25354
+ if ( ! isMultipleRenderTargets ) {
25310
25355
 
25311
25356
  if ( textureProperties.__webglTexture === undefined ) {
25312
25357
 
@@ -25319,10 +25364,6 @@
25319
25364
 
25320
25365
  }
25321
25366
 
25322
- const isCube = ( renderTarget.isWebGLCubeRenderTarget === true );
25323
- const isMultipleRenderTargets = ( renderTarget.isWebGLMultipleRenderTargets === true );
25324
- const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;
25325
-
25326
25367
  // Setup framebuffer
25327
25368
 
25328
25369
  if ( isCube ) {
@@ -25371,8 +25412,6 @@
25371
25412
 
25372
25413
  if ( capabilities.drawBuffers ) {
25373
25414
 
25374
- const textures = renderTarget.texture;
25375
-
25376
25415
  for ( let i = 0, il = textures.length; i < il; i ++ ) {
25377
25416
 
25378
25417
  const attachmentProperties = properties.get( textures[ i ] );
@@ -25397,8 +25436,6 @@
25397
25436
 
25398
25437
  if ( ( isWebGL2 && renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) {
25399
25438
 
25400
- const textures = isMultipleRenderTargets ? texture : [ texture ];
25401
-
25402
25439
  renderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();
25403
25440
  renderTargetProperties.__webglColorRenderbuffer = [];
25404
25441
 
@@ -25471,8 +25508,6 @@
25471
25508
 
25472
25509
  } else if ( isMultipleRenderTargets ) {
25473
25510
 
25474
- const textures = renderTarget.texture;
25475
-
25476
25511
  for ( let i = 0, il = textures.length; i < il; i ++ ) {
25477
25512
 
25478
25513
  const attachment = textures[ i ];
@@ -25551,7 +25586,7 @@
25551
25586
 
25552
25587
  const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;
25553
25588
 
25554
- const textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [ renderTarget.texture ];
25589
+ const textures = renderTarget.textures;
25555
25590
 
25556
25591
  for ( let i = 0, il = textures.length; i < il; i ++ ) {
25557
25592
 
@@ -25576,14 +25611,14 @@
25576
25611
 
25577
25612
  if ( ( isWebGL2 && renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) {
25578
25613
 
25579
- const textures = renderTarget.isWebGLMultipleRenderTargets ? renderTarget.texture : [ renderTarget.texture ];
25614
+ const textures = renderTarget.textures;
25580
25615
  const width = renderTarget.width;
25581
25616
  const height = renderTarget.height;
25582
25617
  let mask = _gl.COLOR_BUFFER_BIT;
25583
25618
  const invalidationArray = [];
25584
25619
  const depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;
25585
25620
  const renderTargetProperties = properties.get( renderTarget );
25586
- const isMultipleRenderTargets = ( renderTarget.isWebGLMultipleRenderTargets === true );
25621
+ const isMultipleRenderTargets = ( textures.length > 1 );
25587
25622
 
25588
25623
  // If MRT we need to remove FBO attachments
25589
25624
  if ( isMultipleRenderTargets ) {
@@ -25767,6 +25802,31 @@
25767
25802
 
25768
25803
  }
25769
25804
 
25805
+ function getDimensions( image ) {
25806
+
25807
+ if ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) {
25808
+
25809
+ // if intrinsic data are not available, fallback to width/height
25810
+
25811
+ _imageDimensions.width = image.naturalWidth || image.width;
25812
+ _imageDimensions.height = image.naturalHeight || image.height;
25813
+
25814
+ } else if ( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) {
25815
+
25816
+ _imageDimensions.width = image.displayWidth;
25817
+ _imageDimensions.height = image.displayHeight;
25818
+
25819
+ } else {
25820
+
25821
+ _imageDimensions.width = image.width;
25822
+ _imageDimensions.height = image.height;
25823
+
25824
+ }
25825
+
25826
+ return _imageDimensions;
25827
+
25828
+ }
25829
+
25770
25830
  //
25771
25831
 
25772
25832
  this.allocateTextureUnit = allocateTextureUnit;
@@ -27338,6 +27398,9 @@ void main() {
27338
27398
 
27339
27399
  }
27340
27400
 
27401
+ const _e1 = /*@__PURE__*/ new Euler();
27402
+ const _m1 = /*@__PURE__*/ new Matrix4();
27403
+
27341
27404
  function WebGLMaterials( renderer, properties ) {
27342
27405
 
27343
27406
  function refreshTransformUniform( map, uniform ) {
@@ -27546,12 +27609,30 @@ void main() {
27546
27609
 
27547
27610
  }
27548
27611
 
27549
- const envMap = properties.get( material ).envMap;
27612
+ const materialProperties = properties.get( material );
27613
+
27614
+ const envMap = materialProperties.envMap;
27615
+ const envMapRotation = materialProperties.envMapRotation;
27550
27616
 
27551
27617
  if ( envMap ) {
27552
27618
 
27553
27619
  uniforms.envMap.value = envMap;
27554
27620
 
27621
+ _e1.copy( envMapRotation );
27622
+
27623
+ // accommodate left-handed frame
27624
+ _e1.x *= - 1; _e1.y *= - 1; _e1.z *= - 1;
27625
+
27626
+ if ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) {
27627
+
27628
+ // environment maps which are not cube render targets or PMREMs follow a different convention
27629
+ _e1.y *= - 1;
27630
+ _e1.z *= - 1;
27631
+
27632
+ }
27633
+
27634
+ uniforms.envMapRotation.value.setFromMatrix4( _m1.makeRotationFromEuler( _e1 ) );
27635
+
27555
27636
  uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1;
27556
27637
 
27557
27638
  uniforms.reflectivity.value = material.reflectivity;
@@ -28719,7 +28800,7 @@ void main() {
28719
28800
 
28720
28801
  }
28721
28802
 
28722
- state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor() );
28803
+ state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).round() );
28723
28804
 
28724
28805
  };
28725
28806
 
@@ -28741,7 +28822,7 @@ void main() {
28741
28822
 
28742
28823
  }
28743
28824
 
28744
- state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor() );
28825
+ state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).round() );
28745
28826
 
28746
28827
  };
28747
28828
 
@@ -29842,6 +29923,7 @@ void main() {
29842
29923
  materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;
29843
29924
  materialProperties.fog = scene.fog;
29844
29925
  materialProperties.envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || materialProperties.environment );
29926
+ materialProperties.envMapRotation = ( materialProperties.environment !== null && material.envMap === null ) ? scene.environmentRotation : material.envMapRotation;
29845
29927
 
29846
29928
  if ( programs === undefined ) {
29847
29929
 
@@ -29954,6 +30036,7 @@ void main() {
29954
30036
  materialProperties.batching = parameters.batching;
29955
30037
  materialProperties.instancing = parameters.instancing;
29956
30038
  materialProperties.instancingColor = parameters.instancingColor;
30039
+ materialProperties.instancingMorph = parameters.instancingMorph;
29957
30040
  materialProperties.skinning = parameters.skinning;
29958
30041
  materialProperties.morphTargets = parameters.morphTargets;
29959
30042
  materialProperties.morphNormals = parameters.morphNormals;
@@ -30064,6 +30147,14 @@ void main() {
30064
30147
 
30065
30148
  needsProgramChange = true;
30066
30149
 
30150
+ } else if ( object.isInstancedMesh && materialProperties.instancingMorph === true && object.morphTexture === null ) {
30151
+
30152
+ needsProgramChange = true;
30153
+
30154
+ } else if ( object.isInstancedMesh && materialProperties.instancingMorph === false && object.morphTexture !== null ) {
30155
+
30156
+ needsProgramChange = true;
30157
+
30067
30158
  } else if ( materialProperties.envMap !== envMap ) {
30068
30159
 
30069
30160
  needsProgramChange = true;
@@ -30392,20 +30483,16 @@ void main() {
30392
30483
  const renderTargetProperties = properties.get( renderTarget );
30393
30484
  renderTargetProperties.__hasExternalTextures = true;
30394
30485
 
30395
- if ( renderTargetProperties.__hasExternalTextures ) {
30486
+ renderTargetProperties.__autoAllocateDepthBuffer = depthTexture === undefined;
30396
30487
 
30397
- renderTargetProperties.__autoAllocateDepthBuffer = depthTexture === undefined;
30488
+ if ( ! renderTargetProperties.__autoAllocateDepthBuffer ) {
30398
30489
 
30399
- if ( ! renderTargetProperties.__autoAllocateDepthBuffer ) {
30490
+ // The multisample_render_to_texture extension doesn't work properly if there
30491
+ // are midframe flushes and an external depth buffer. Disable use of the extension.
30492
+ if ( extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true ) {
30400
30493
 
30401
- // The multisample_render_to_texture extension doesn't work properly if there
30402
- // are midframe flushes and an external depth buffer. Disable use of the extension.
30403
- if ( extensions.has( 'WEBGL_multisampled_render_to_texture' ) === true ) {
30404
-
30405
- console.warn( 'THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided' );
30406
- renderTargetProperties.__useRenderToTexture = false;
30407
-
30408
- }
30494
+ console.warn( 'THREE.WebGLRenderer: Render-to-texture extension was disabled because an external texture was provided' );
30495
+ renderTargetProperties.__useRenderToTexture = false;
30409
30496
 
30410
30497
  }
30411
30498
 
@@ -30665,8 +30752,8 @@ void main() {
30665
30752
 
30666
30753
  }
30667
30754
 
30668
- const width = sourceBox.max.x - sourceBox.min.x + 1;
30669
- const height = sourceBox.max.y - sourceBox.min.y + 1;
30755
+ const width = Math.round( sourceBox.max.x - sourceBox.min.x );
30756
+ const height = Math.round( sourceBox.max.y - sourceBox.min.y );
30670
30757
  const depth = sourceBox.max.z - sourceBox.min.z + 1;
30671
30758
  const glFormat = utils.convert( dstTexture.format );
30672
30759
  const glType = utils.convert( dstTexture.type );
@@ -30713,9 +30800,8 @@ void main() {
30713
30800
 
30714
30801
  } else {
30715
30802
 
30716
- if ( srcTexture.isCompressedArrayTexture ) {
30803
+ if ( dstTexture.isCompressedArrayTexture ) {
30717
30804
 
30718
- console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.' );
30719
30805
  _gl.compressedTexSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data );
30720
30806
 
30721
30807
  } else {
@@ -30804,20 +30890,6 @@ void main() {
30804
30890
 
30805
30891
  }
30806
30892
 
30807
- get outputEncoding() { // @deprecated, r152
30808
-
30809
- console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
30810
- return this.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
30811
-
30812
- }
30813
-
30814
- set outputEncoding( encoding ) { // @deprecated, r152
30815
-
30816
- console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
30817
- this.outputColorSpace = encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
30818
-
30819
- }
30820
-
30821
30893
  get useLegacyLights() { // @deprecated, r155
30822
30894
 
30823
30895
  console.warn( 'THREE.WebGLRenderer: The property .useLegacyLights has been deprecated. Migrate your lighting according to the following guide: https://discourse.threejs.org/t/updates-to-lighting-in-three-js-r155/53733.' );
@@ -30854,6 +30926,8 @@ void main() {
30854
30926
 
30855
30927
  this.backgroundBlurriness = 0;
30856
30928
  this.backgroundIntensity = 1;
30929
+ this.backgroundRotation = new Euler();
30930
+ this.environmentRotation = new Euler();
30857
30931
 
30858
30932
  this.overrideMaterial = null;
30859
30933
 
@@ -30875,6 +30949,8 @@ void main() {
30875
30949
 
30876
30950
  this.backgroundBlurriness = source.backgroundBlurriness;
30877
30951
  this.backgroundIntensity = source.backgroundIntensity;
30952
+ this.backgroundRotation.copy( source.backgroundRotation );
30953
+ this.environmentRotation.copy( source.environmentRotation );
30878
30954
 
30879
30955
  if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();
30880
30956
 
@@ -30892,6 +30968,9 @@ void main() {
30892
30968
  if ( this.backgroundBlurriness > 0 ) data.object.backgroundBlurriness = this.backgroundBlurriness;
30893
30969
  if ( this.backgroundIntensity !== 1 ) data.object.backgroundIntensity = this.backgroundIntensity;
30894
30970
 
30971
+ data.object.backgroundRotation = this.backgroundRotation.toArray();
30972
+ data.object.environmentRotation = this.environmentRotation.toArray();
30973
+
30895
30974
  return data;
30896
30975
 
30897
30976
  }
@@ -32181,9 +32260,9 @@ void main() {
32181
32260
 
32182
32261
  }
32183
32262
 
32184
- getPoint( t, optionalTarget ) {
32263
+ getPoint( t, optionalTarget = new Vector2() ) {
32185
32264
 
32186
- const point = optionalTarget || new Vector2();
32265
+ const point = optionalTarget;
32187
32266
 
32188
32267
  const twoPi = Math.PI * 2;
32189
32268
  let deltaAngle = this.aEndAngle - this.aStartAngle;
@@ -36317,6 +36396,7 @@ void main() {
36317
36396
  this.alphaMap = null;
36318
36397
 
36319
36398
  this.envMap = null;
36399
+ this.envMapRotation = new Euler();
36320
36400
  this.combine = MultiplyOperation;
36321
36401
  this.reflectivity = 1;
36322
36402
  this.refractionRatio = 0.98;
@@ -36370,6 +36450,7 @@ void main() {
36370
36450
  this.alphaMap = source.alphaMap;
36371
36451
 
36372
36452
  this.envMap = source.envMap;
36453
+ this.envMapRotation.copy( source.envMapRotation );
36373
36454
  this.combine = source.combine;
36374
36455
  this.reflectivity = source.reflectivity;
36375
36456
  this.refractionRatio = source.refractionRatio;
@@ -36429,6 +36510,7 @@ void main() {
36429
36510
  this.alphaMap = null;
36430
36511
 
36431
36512
  this.envMap = null;
36513
+ this.envMapRotation = new Euler();
36432
36514
  this.combine = MultiplyOperation;
36433
36515
  this.reflectivity = 1;
36434
36516
  this.refractionRatio = 0.98;
@@ -36480,6 +36562,7 @@ void main() {
36480
36562
  this.alphaMap = source.alphaMap;
36481
36563
 
36482
36564
  this.envMap = source.envMap;
36565
+ this.envMapRotation.copy( source.envMapRotation );
36483
36566
  this.combine = source.combine;
36484
36567
  this.reflectivity = source.reflectivity;
36485
36568
  this.refractionRatio = source.refractionRatio;
@@ -37282,6 +37365,8 @@ void main() {
37282
37365
 
37283
37366
  }
37284
37367
 
37368
+ const _matrix = /*@__PURE__*/ new Matrix4();
37369
+
37285
37370
  class Raycaster {
37286
37371
 
37287
37372
  constructor( origin, direction, near = 0, far = Infinity ) {
@@ -37334,9 +37419,20 @@ void main() {
37334
37419
 
37335
37420
  }
37336
37421
 
37422
+ setFromXRController( controller ) {
37423
+
37424
+ _matrix.identity().extractRotation( controller.matrixWorld );
37425
+
37426
+ this.ray.origin.setFromMatrixPosition( controller.matrixWorld );
37427
+ this.ray.direction.set( 0, 0, - 1 ).applyMatrix4( _matrix );
37428
+
37429
+ return this;
37430
+
37431
+ }
37432
+
37337
37433
  intersectObject( object, recursive = true, intersects = [] ) {
37338
37434
 
37339
- intersectObject( object, this, intersects, recursive );
37435
+ intersect( object, this, intersects, recursive );
37340
37436
 
37341
37437
  intersects.sort( ascSort );
37342
37438
 
@@ -37348,7 +37444,7 @@ void main() {
37348
37444
 
37349
37445
  for ( let i = 0, l = objects.length; i < l; i ++ ) {
37350
37446
 
37351
- intersectObject( objects[ i ], this, intersects, recursive );
37447
+ intersect( objects[ i ], this, intersects, recursive );
37352
37448
 
37353
37449
  }
37354
37450
 
@@ -37366,7 +37462,7 @@ void main() {
37366
37462
 
37367
37463
  }
37368
37464
 
37369
- function intersectObject( object, raycaster, intersects, recursive ) {
37465
+ function intersect( object, raycaster, intersects, recursive ) {
37370
37466
 
37371
37467
  if ( object.layers.test( raycaster.layers ) ) {
37372
37468
 
@@ -37380,7 +37476,7 @@ void main() {
37380
37476
 
37381
37477
  for ( let i = 0, l = children.length; i < l; i ++ ) {
37382
37478
 
37383
- intersectObject( children[ i ], raycaster, intersects, true );
37479
+ intersect( children[ i ], raycaster, intersects, true );
37384
37480
 
37385
37481
  }
37386
37482
 
@@ -41667,7 +41763,7 @@ void main() {
41667
41763
 
41668
41764
  function clipCircle(radius) {
41669
41765
  var cr = cos$1(radius),
41670
- delta = 6 * radians$1,
41766
+ delta = 2 * radians$1,
41671
41767
  smallRadius = cr > 0,
41672
41768
  notHemisphere = abs(cr) > epsilon$2; // TODO optimise for this common case
41673
41769
 
@@ -69797,7 +69893,7 @@ void main() {
69797
69893
  applyUpdate(targetD);
69798
69894
  } else {
69799
69895
  // animate
69800
- new Tween(obj.__currentTargetD).to(targetD, state.pointsTransitionDuration).easing(Easing.Quadratic.InOut).onUpdate(applyUpdate).start();
69896
+ new Tween(obj.__currentTargetD).to(targetD, state.htmlTransitionDuration).easing(Easing.Quadratic.InOut).onUpdate(applyUpdate).start();
69801
69897
  }
69802
69898
  }
69803
69899
  });
@@ -70137,7 +70233,7 @@ void main() {
70137
70233
  emptyObject(threeObj);
70138
70234
 
70139
70235
  // Main three object to manipulate
70140
- threeObj.add(state.scene = new THREE$i.Group());
70236
+ state.scene = threeObj;
70141
70237
  state.scene.visible = false; // hide scene before globe initialization
70142
70238
 
70143
70239
  // Add all layers groups
@@ -71280,6 +71376,7 @@ void main() {
71280
71376
  scope.target.clampLength( scope.minTargetRadius, scope.maxTargetRadius );
71281
71377
  scope.target.add( scope.cursor );
71282
71378
 
71379
+ let zoomChanged = false;
71283
71380
  // adjust the camera position based on zoom only if we're not zooming to the cursor or if it's an ortho camera
71284
71381
  // we adjust zoom later in these cases
71285
71382
  if ( scope.zoomToCursor && performCursorZoom || scope.object.isOrthographicCamera ) {
@@ -71288,7 +71385,9 @@ void main() {
71288
71385
 
71289
71386
  } else {
71290
71387
 
71388
+ const prevRadius = spherical.radius;
71291
71389
  spherical.radius = clampDistance( spherical.radius * scale );
71390
+ zoomChanged = prevRadius != spherical.radius;
71292
71391
 
71293
71392
  }
71294
71393
 
@@ -71317,7 +71416,6 @@ void main() {
71317
71416
  }
71318
71417
 
71319
71418
  // adjust camera position
71320
- let zoomChanged = false;
71321
71419
  if ( scope.zoomToCursor && performCursorZoom ) {
71322
71420
 
71323
71421
  let newRadius = null;
@@ -71332,15 +71430,19 @@ void main() {
71332
71430
  scope.object.position.addScaledVector( dollyDirection, radiusDelta );
71333
71431
  scope.object.updateMatrixWorld();
71334
71432
 
71433
+ zoomChanged = !! radiusDelta;
71434
+
71335
71435
  } else if ( scope.object.isOrthographicCamera ) {
71336
71436
 
71337
71437
  // adjust the ortho camera position based on zoom changes
71338
71438
  const mouseBefore = new Vector3( mouse.x, mouse.y, 0 );
71339
71439
  mouseBefore.unproject( scope.object );
71340
71440
 
71441
+ const prevZoom = scope.object.zoom;
71341
71442
  scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / scale ) );
71342
71443
  scope.object.updateProjectionMatrix();
71343
- zoomChanged = true;
71444
+
71445
+ zoomChanged = prevZoom !== scope.object.zoom;
71344
71446
 
71345
71447
  const mouseAfter = new Vector3( mouse.x, mouse.y, 0 );
71346
71448
  mouseAfter.unproject( scope.object );
@@ -71393,12 +71495,13 @@ void main() {
71393
71495
 
71394
71496
  } else if ( scope.object.isOrthographicCamera ) {
71395
71497
 
71396
- zoomChanged = scale !== 1;
71498
+ const prevZoom = scope.object.zoom;
71499
+ scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / scale ) );
71397
71500
 
71398
- if ( zoomChanged ) {
71501
+ if ( prevZoom !== scope.object.zoom ) {
71399
71502
 
71400
- scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / scale ) );
71401
71503
  scope.object.updateProjectionMatrix();
71504
+ zoomChanged = true;
71402
71505
 
71403
71506
  }
71404
71507
 
@@ -71414,7 +71517,7 @@ void main() {
71414
71517
  if ( zoomChanged ||
71415
71518
  lastPosition.distanceToSquared( scope.object.position ) > EPS ||
71416
71519
  8 * ( 1 - lastQuaternion.dot( scope.object.quaternion ) ) > EPS ||
71417
- lastTargetPosition.distanceToSquared( scope.target ) > 0 ) {
71520
+ lastTargetPosition.distanceToSquared( scope.target ) > EPS ) {
71418
71521
 
71419
71522
  scope.dispatchEvent( _changeEvent$1 );
71420
71523
 
@@ -71443,6 +71546,9 @@ void main() {
71443
71546
  scope.domElement.removeEventListener( 'pointermove', onPointerMove );
71444
71547
  scope.domElement.removeEventListener( 'pointerup', onPointerUp );
71445
71548
 
71549
+ const document = scope.domElement.getRootNode(); // offscreen canvas compatibility
71550
+
71551
+ document.removeEventListener( 'keydown', interceptControlDown, { capture: true } );
71446
71552
 
71447
71553
  if ( scope._domElementKeyEvents !== null ) {
71448
71554
 
@@ -72032,6 +72138,10 @@ void main() {
72032
72138
 
72033
72139
  //
72034
72140
 
72141
+ if ( isTrackingPointer( event ) ) return;
72142
+
72143
+ //
72144
+
72035
72145
  addPointer( event );
72036
72146
 
72037
72147
  if ( event.pointerType === 'touch' ) {
@@ -72479,6 +72589,18 @@ void main() {
72479
72589
 
72480
72590
  }
72481
72591
 
72592
+ function isTrackingPointer( event ) {
72593
+
72594
+ for ( let i = 0; i < pointers.length; i ++ ) {
72595
+
72596
+ if ( pointers[ i ] == event.pointerId ) return true;
72597
+
72598
+ }
72599
+
72600
+ return false;
72601
+
72602
+ }
72603
+
72482
72604
  function trackPointer( event ) {
72483
72605
 
72484
72606
  let position = pointerPositions[ event.pointerId ];
@@ -75477,7 +75599,8 @@ void main() {
75477
75599
  : {
75478
75600
  AmbientLight: AmbientLight,
75479
75601
  DirectionalLight: DirectionalLight,
75480
- Vector2: Vector2
75602
+ Vector2: Vector2,
75603
+ REVISION: REVISION
75481
75604
  }), {}, {
75482
75605
  CSS2DRenderer: CSS2DRenderer
75483
75606
  });
@@ -75893,7 +76016,7 @@ void main() {
75893
76016
  return d;
75894
76017
  }
75895
76018
  };
75896
- state.renderObjs.renderer().useLegacyLights = false; // force behavior of three < 155
76019
+ THREE.REVISION < 155 && (state.renderObjs.renderer().useLegacyLights = false); // force behavior of three < 155
75897
76020
  state.renderObjs.hoverOrderComparator(function (a, b) {
75898
76021
  var aObj = getGlobeObj(a);
75899
76022
  var bObj = getGlobeObj(b);