super-three 0.161.0 → 0.162.0

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.
Files changed (131) hide show
  1. package/build/three.cjs +490 -393
  2. package/build/three.module.js +490 -391
  3. package/build/three.module.min.js +1 -1
  4. package/examples/jsm/controls/DragControls.js +91 -30
  5. package/examples/jsm/controls/OrbitControls.js +32 -6
  6. package/examples/jsm/controls/TransformControls.js +6 -6
  7. package/examples/jsm/exporters/GLTFExporter.js +11 -1
  8. package/examples/jsm/interactive/InteractiveGroup.js +15 -25
  9. package/examples/jsm/libs/rhino3dm/rhino3dm.js +1 -8723
  10. package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +1 -8734
  11. package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
  12. package/examples/jsm/libs/tween.module.js +32 -14
  13. package/examples/jsm/loaders/3DMLoader.js +13 -21
  14. package/examples/jsm/loaders/VOXLoader.js +9 -2
  15. package/examples/jsm/loaders/VRMLLoader.js +6 -2
  16. package/examples/jsm/misc/ProgressiveLightMap.js +1 -0
  17. package/examples/jsm/nodes/Nodes.js +9 -7
  18. package/examples/jsm/nodes/accessors/AccessorsUtils.js +10 -0
  19. package/examples/jsm/nodes/accessors/ClippingNode.js +144 -0
  20. package/examples/jsm/nodes/accessors/MaterialNode.js +2 -2
  21. package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +2 -12
  22. package/examples/jsm/nodes/accessors/MorphNode.js +8 -8
  23. package/examples/jsm/nodes/accessors/ReferenceNode.js +87 -29
  24. package/examples/jsm/nodes/accessors/SkinningNode.js +31 -10
  25. package/examples/jsm/nodes/accessors/StorageBufferNode.js +18 -0
  26. package/examples/jsm/nodes/accessors/TangentNode.js +8 -2
  27. package/examples/jsm/nodes/accessors/TextureNode.js +1 -1
  28. package/examples/jsm/nodes/accessors/UniformsNode.js +140 -0
  29. package/examples/jsm/nodes/code/CodeNode.js +6 -0
  30. package/examples/jsm/nodes/core/AssignNode.js +68 -12
  31. package/examples/jsm/nodes/core/Node.js +14 -4
  32. package/examples/jsm/nodes/core/NodeBuilder.js +3 -9
  33. package/examples/jsm/nodes/core/NodeFrame.js +2 -2
  34. package/examples/jsm/nodes/core/TempNode.js +1 -1
  35. package/examples/jsm/nodes/display/BlendModeNode.js +30 -1
  36. package/examples/jsm/nodes/display/NormalMapNode.js +3 -5
  37. package/examples/jsm/nodes/materials/NodeMaterial.js +37 -6
  38. package/examples/jsm/nodes/math/CondNode.js +42 -7
  39. package/examples/jsm/nodes/math/MathNode.js +20 -0
  40. package/examples/jsm/nodes/utils/ArrayElementNode.js +0 -6
  41. package/examples/jsm/nodes/utils/LoopNode.js +2 -0
  42. package/examples/jsm/nodes/utils/StorageArrayElementNode.js +91 -0
  43. package/examples/jsm/postprocessing/OutputPass.js +2 -0
  44. package/examples/jsm/renderers/common/Background.js +2 -2
  45. package/examples/jsm/renderers/common/ClippingContext.js +165 -0
  46. package/examples/jsm/renderers/common/RenderContext.js +2 -0
  47. package/examples/jsm/renderers/common/RenderContexts.js +2 -13
  48. package/examples/jsm/renderers/common/RenderObject.js +44 -1
  49. package/examples/jsm/renderers/common/RenderObjects.js +3 -1
  50. package/examples/jsm/renderers/common/Renderer.js +94 -37
  51. package/examples/jsm/renderers/common/StorageBufferAttribute.js +2 -2
  52. package/examples/jsm/renderers/common/StorageInstancedBufferAttribute.js +17 -0
  53. package/examples/jsm/renderers/common/Textures.js +3 -13
  54. package/examples/jsm/renderers/common/UniformsGroup.js +6 -4
  55. package/examples/jsm/renderers/common/nodes/NodeStorageBuffer.js +23 -0
  56. package/examples/jsm/renderers/common/nodes/NodeUniformBuffer.js +23 -0
  57. package/examples/jsm/renderers/common/nodes/Nodes.js +1 -0
  58. package/examples/jsm/renderers/webgl/WebGLBackend.js +26 -6
  59. package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +135 -10
  60. package/examples/jsm/renderers/webgl/utils/WebGLAttributeUtils.js +7 -1
  61. package/examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js +47 -0
  62. package/examples/jsm/renderers/webgl/utils/WebGLUtils.js +1 -0
  63. package/examples/jsm/renderers/webgpu/WebGPUBackend.js +13 -12
  64. package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +15 -40
  65. package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +7 -1
  66. package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +2 -2
  67. package/examples/jsm/shaders/OutputShader.js +4 -0
  68. package/examples/jsm/utils/SkeletonUtils.js +14 -3
  69. package/examples/jsm/webxr/VRButton.js +13 -5
  70. package/examples/jsm/webxr/XRButton.js +0 -1
  71. package/examples/jsm/webxr/XRControllerModelFactory.js +8 -0
  72. package/package.json +4 -3
  73. package/src/Three.Legacy.js +20 -0
  74. package/src/Three.js +0 -1
  75. package/src/constants.js +2 -5
  76. package/src/core/BufferAttribute.js +0 -11
  77. package/src/core/BufferGeometry.js +23 -29
  78. package/src/core/Object3D.js +11 -0
  79. package/src/core/Raycaster.js +18 -4
  80. package/src/core/RenderTarget.js +44 -21
  81. package/src/extras/PMREMGenerator.js +2 -0
  82. package/src/extras/curves/EllipseCurve.js +2 -2
  83. package/src/helpers/SpotLightHelper.js +18 -1
  84. package/src/loaders/DataTextureLoader.js +0 -4
  85. package/src/loaders/MaterialLoader.js +1 -0
  86. package/src/loaders/ObjectLoader.js +2 -1
  87. package/src/materials/Material.js +2 -1
  88. package/src/materials/MeshBasicMaterial.js +3 -0
  89. package/src/materials/MeshLambertMaterial.js +3 -0
  90. package/src/materials/MeshPhongMaterial.js +3 -0
  91. package/src/materials/MeshStandardMaterial.js +3 -0
  92. package/src/math/Quaternion.js +13 -12
  93. package/src/math/Vector3.js +7 -7
  94. package/src/objects/InstancedMesh.js +53 -0
  95. package/src/objects/Mesh.js +0 -1
  96. package/src/renderers/WebGLCubeRenderTarget.js +1 -10
  97. package/src/renderers/WebGLRenderer.js +15 -22
  98. package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +1 -0
  99. package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +1 -1
  100. package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +2 -2
  101. package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +1 -1
  102. package/src/renderers/shaders/ShaderChunk/morphinstance_vertex.glsl.js +14 -0
  103. package/src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +11 -2
  104. package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +23 -0
  105. package/src/renderers/shaders/ShaderChunk.js +2 -0
  106. package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +3 -2
  107. package/src/renderers/shaders/ShaderLib/depth.glsl.js +2 -0
  108. package/src/renderers/shaders/ShaderLib/distanceRGBA.glsl.js +2 -0
  109. package/src/renderers/shaders/ShaderLib/linedashed.glsl.js +1 -0
  110. package/src/renderers/shaders/ShaderLib/meshbasic.glsl.js +1 -0
  111. package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +1 -0
  112. package/src/renderers/shaders/ShaderLib/meshmatcap.glsl.js +1 -0
  113. package/src/renderers/shaders/ShaderLib/meshnormal.glsl.js +1 -0
  114. package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +1 -0
  115. package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +1 -0
  116. package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +1 -0
  117. package/src/renderers/shaders/ShaderLib/points.glsl.js +1 -0
  118. package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -0
  119. package/src/renderers/shaders/ShaderLib.js +2 -1
  120. package/src/renderers/shaders/UniformsLib.js +1 -0
  121. package/src/renderers/webgl/WebGLBackground.js +18 -0
  122. package/src/renderers/webgl/WebGLMaterials.js +24 -1
  123. package/src/renderers/webgl/WebGLMorphtargets.js +15 -8
  124. package/src/renderers/webgl/WebGLProgram.js +12 -1
  125. package/src/renderers/webgl/WebGLPrograms.js +19 -16
  126. package/src/renderers/webgl/WebGLState.js +11 -21
  127. package/src/renderers/webgl/WebGLTextures.js +80 -50
  128. package/src/scenes/Scene.js +8 -0
  129. package/src/textures/Texture.js +1 -29
  130. package/examples/jsm/nodes/core/ArrayUniformNode.js +0 -26
  131. package/src/renderers/WebGLMultipleRenderTargets.js +0 -82
@@ -3,7 +3,7 @@
3
3
  * Copyright 2010-2023 Three.js Authors
4
4
  * SPDX-License-Identifier: MIT
5
5
  */
6
- const REVISION = '161';
6
+ const REVISION = '162';
7
7
 
8
8
  const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
9
9
  const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
@@ -62,6 +62,7 @@ const CineonToneMapping = 3;
62
62
  const ACESFilmicToneMapping = 4;
63
63
  const CustomToneMapping = 5;
64
64
  const AgXToneMapping = 6;
65
+ const NeutralToneMapping = 7;
65
66
  const AttachedBindMode = 'attached';
66
67
  const DetachedBindMode = 'detached';
67
68
 
@@ -153,10 +154,6 @@ const AdditiveAnimationBlendMode = 2501;
153
154
  const TrianglesDrawMode = 0;
154
155
  const TriangleStripDrawMode = 1;
155
156
  const TriangleFanDrawMode = 2;
156
- /** @deprecated Use LinearSRGBColorSpace or NoColorSpace in three.js r152+. */
157
- const LinearEncoding = 3000;
158
- /** @deprecated Use SRGBColorSpace in three.js r152+. */
159
- const sRGBEncoding = 3001;
160
157
  const BasicDepthPacking = 3200;
161
158
  const RGBADepthPacking = 3201;
162
159
  const TangentSpaceNormalMap = 0;
@@ -1996,17 +1993,7 @@ class Texture extends EventDispatcher {
1996
1993
  this.flipY = true;
1997
1994
  this.unpackAlignment = 4; // valid values: 1, 2, 4, 8 (see http://www.khronos.org/opengles/sdk/docs/man/xhtml/glPixelStorei.xml)
1998
1995
 
1999
- if ( typeof colorSpace === 'string' ) {
2000
-
2001
- this.colorSpace = colorSpace;
2002
-
2003
- } else { // @deprecated, r152
2004
-
2005
- warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
2006
- this.colorSpace = colorSpace === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
2007
-
2008
- }
2009
-
1996
+ this.colorSpace = colorSpace;
2010
1997
 
2011
1998
  this.userData = {};
2012
1999
 
@@ -2245,20 +2232,6 @@ class Texture extends EventDispatcher {
2245
2232
 
2246
2233
  }
2247
2234
 
2248
- get encoding() { // @deprecated, r152
2249
-
2250
- warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
2251
- return this.colorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
2252
-
2253
- }
2254
-
2255
- set encoding( encoding ) { // @deprecated, r152
2256
-
2257
- warnOnce( 'THREE.Texture: Property .encoding has been replaced by .colorSpace.' );
2258
- this.colorSpace = encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
2259
-
2260
- }
2261
-
2262
2235
  }
2263
2236
 
2264
2237
  Texture.DEFAULT_IMAGE = null;
@@ -2932,14 +2905,6 @@ class RenderTarget extends EventDispatcher {
2932
2905
 
2933
2906
  const image = { width: width, height: height, depth: 1 };
2934
2907
 
2935
- if ( options.encoding !== undefined ) {
2936
-
2937
- // @deprecated, r152
2938
- warnOnce( 'THREE.WebGLRenderTarget: option.encoding has been replaced by option.colorSpace.' );
2939
- options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
2940
-
2941
- }
2942
-
2943
2908
  options = Object.assign( {
2944
2909
  generateMipmaps: false,
2945
2910
  internalFormat: null,
@@ -2947,15 +2912,25 @@ class RenderTarget extends EventDispatcher {
2947
2912
  depthBuffer: true,
2948
2913
  stencilBuffer: false,
2949
2914
  depthTexture: null,
2950
- samples: 0
2915
+ samples: 0,
2916
+ count: 1
2951
2917
  }, options );
2952
2918
 
2953
- this.texture = new Texture( image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
2954
- this.texture.isRenderTargetTexture = true;
2919
+ const texture = new Texture( image, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
2920
+
2921
+ texture.flipY = false;
2922
+ texture.generateMipmaps = options.generateMipmaps;
2923
+ texture.internalFormat = options.internalFormat;
2924
+
2925
+ this.textures = [];
2926
+
2927
+ const count = options.count;
2928
+ for ( let i = 0; i < count; i ++ ) {
2955
2929
 
2956
- this.texture.flipY = false;
2957
- this.texture.generateMipmaps = options.generateMipmaps;
2958
- this.texture.internalFormat = options.internalFormat;
2930
+ this.textures[ i ] = texture.clone();
2931
+ this.textures[ i ].isRenderTargetTexture = true;
2932
+
2933
+ }
2959
2934
 
2960
2935
  this.depthBuffer = options.depthBuffer;
2961
2936
  this.stencilBuffer = options.stencilBuffer;
@@ -2966,6 +2941,18 @@ class RenderTarget extends EventDispatcher {
2966
2941
 
2967
2942
  }
2968
2943
 
2944
+ get texture() {
2945
+
2946
+ return this.textures[ 0 ];
2947
+
2948
+ }
2949
+
2950
+ set texture( value ) {
2951
+
2952
+ this.textures[ 0 ] = value;
2953
+
2954
+ }
2955
+
2969
2956
  setSize( width, height, depth = 1 ) {
2970
2957
 
2971
2958
  if ( this.width !== width || this.height !== height || this.depth !== depth ) {
@@ -2974,9 +2961,13 @@ class RenderTarget extends EventDispatcher {
2974
2961
  this.height = height;
2975
2962
  this.depth = depth;
2976
2963
 
2977
- this.texture.image.width = width;
2978
- this.texture.image.height = height;
2979
- this.texture.image.depth = depth;
2964
+ for ( let i = 0, il = this.textures.length; i < il; i ++ ) {
2965
+
2966
+ this.textures[ i ].image.width = width;
2967
+ this.textures[ i ].image.height = height;
2968
+ this.textures[ i ].image.depth = depth;
2969
+
2970
+ }
2980
2971
 
2981
2972
  this.dispose();
2982
2973
 
@@ -3004,8 +2995,14 @@ class RenderTarget extends EventDispatcher {
3004
2995
 
3005
2996
  this.viewport.copy( source.viewport );
3006
2997
 
3007
- this.texture = source.texture.clone();
3008
- this.texture.isRenderTargetTexture = true;
2998
+ this.textures.length = 0;
2999
+
3000
+ for ( let i = 0, il = source.textures.length; i < il; i ++ ) {
3001
+
3002
+ this.textures[ i ] = source.textures[ i ].clone();
3003
+ this.textures[ i ].isRenderTargetTexture = true;
3004
+
3005
+ }
3009
3006
 
3010
3007
  // ensure image object is not shared, see #20328
3011
3008
 
@@ -3133,85 +3130,6 @@ class WebGL3DRenderTarget extends WebGLRenderTarget {
3133
3130
 
3134
3131
  }
3135
3132
 
3136
- class WebGLMultipleRenderTargets extends WebGLRenderTarget {
3137
-
3138
- constructor( width = 1, height = 1, count = 1, options = {} ) {
3139
-
3140
- super( width, height, options );
3141
-
3142
- this.isWebGLMultipleRenderTargets = true;
3143
-
3144
- const texture = this.texture;
3145
-
3146
- this.texture = [];
3147
-
3148
- for ( let i = 0; i < count; i ++ ) {
3149
-
3150
- this.texture[ i ] = texture.clone();
3151
- this.texture[ i ].isRenderTargetTexture = true;
3152
-
3153
- }
3154
-
3155
- }
3156
-
3157
- setSize( width, height, depth = 1 ) {
3158
-
3159
- if ( this.width !== width || this.height !== height || this.depth !== depth ) {
3160
-
3161
- this.width = width;
3162
- this.height = height;
3163
- this.depth = depth;
3164
-
3165
- for ( let i = 0, il = this.texture.length; i < il; i ++ ) {
3166
-
3167
- this.texture[ i ].image.width = width;
3168
- this.texture[ i ].image.height = height;
3169
- this.texture[ i ].image.depth = depth;
3170
-
3171
- }
3172
-
3173
- this.dispose();
3174
-
3175
- }
3176
-
3177
- this.viewport.set( 0, 0, width, height );
3178
- this.scissor.set( 0, 0, width, height );
3179
-
3180
- }
3181
-
3182
- copy( source ) {
3183
-
3184
- this.dispose();
3185
-
3186
- this.width = source.width;
3187
- this.height = source.height;
3188
- this.depth = source.depth;
3189
-
3190
- this.scissor.copy( source.scissor );
3191
- this.scissorTest = source.scissorTest;
3192
-
3193
- this.viewport.copy( source.viewport );
3194
-
3195
- this.depthBuffer = source.depthBuffer;
3196
- this.stencilBuffer = source.stencilBuffer;
3197
-
3198
- if ( source.depthTexture !== null ) this.depthTexture = source.depthTexture.clone();
3199
-
3200
- this.texture.length = 0;
3201
-
3202
- for ( let i = 0, il = source.texture.length; i < il; i ++ ) {
3203
-
3204
- this.texture[ i ] = source.texture[ i ].clone();
3205
- this.texture[ i ].isRenderTargetTexture = true;
3206
-
3207
- }
3208
-
3209
- return this;
3210
-
3211
- }
3212
-
3213
- }
3214
-
3215
3133
  class Quaternion {
3216
3134
 
3217
3135
  constructor( x = 0, y = 0, z = 0, w = 1 ) {
@@ -3803,23 +3721,24 @@ class Quaternion {
3803
3721
 
3804
3722
  random() {
3805
3723
 
3806
- // Derived from http://planning.cs.uiuc.edu/node198.html
3807
- // Note, this source uses w, x, y, z ordering,
3808
- // so we swap the order below.
3724
+ // sets this quaternion to a uniform random unit quaternnion
3809
3725
 
3810
- const u1 = Math.random();
3811
- const sqrt1u1 = Math.sqrt( 1 - u1 );
3812
- const sqrtu1 = Math.sqrt( u1 );
3726
+ // Ken Shoemake
3727
+ // Uniform random rotations
3728
+ // D. Kirk, editor, Graphics Gems III, pages 124-132. Academic Press, New York, 1992.
3813
3729
 
3814
- const u2 = 2 * Math.PI * Math.random();
3730
+ const theta1 = 2 * Math.PI * Math.random();
3731
+ const theta2 = 2 * Math.PI * Math.random();
3815
3732
 
3816
- const u3 = 2 * Math.PI * Math.random();
3733
+ const x0 = Math.random();
3734
+ const r1 = Math.sqrt( 1 - x0 );
3735
+ const r2 = Math.sqrt( x0 );
3817
3736
 
3818
3737
  return this.set(
3819
- sqrt1u1 * Math.cos( u2 ),
3820
- sqrtu1 * Math.sin( u3 ),
3821
- sqrtu1 * Math.cos( u3 ),
3822
- sqrt1u1 * Math.sin( u2 ),
3738
+ r1 * Math.sin( theta1 ),
3739
+ r1 * Math.cos( theta1 ),
3740
+ r2 * Math.sin( theta2 ),
3741
+ r2 * Math.cos( theta2 ),
3823
3742
  );
3824
3743
 
3825
3744
  }
@@ -4587,15 +4506,15 @@ class Vector3 {
4587
4506
 
4588
4507
  randomDirection() {
4589
4508
 
4590
- // Derived from https://mathworld.wolfram.com/SpherePointPicking.html
4509
+ // https://mathworld.wolfram.com/SpherePointPicking.html
4591
4510
 
4592
- const u = ( Math.random() - 0.5 ) * 2;
4593
- const t = Math.random() * Math.PI * 2;
4594
- const f = Math.sqrt( 1 - u ** 2 );
4511
+ const theta = Math.random() * Math.PI * 2;
4512
+ const u = Math.random() * 2 - 1;
4513
+ const c = Math.sqrt( 1 - u * u );
4595
4514
 
4596
- this.x = f * Math.cos( t );
4597
- this.y = f * Math.sin( t );
4598
- this.z = u;
4515
+ this.x = c * Math.cos( theta );
4516
+ this.y = u;
4517
+ this.z = c * Math.sin( theta );
4599
4518
 
4600
4519
  return this;
4601
4520
 
@@ -6621,25 +6540,25 @@ class Matrix4 {
6621
6540
  position.z = te[ 14 ];
6622
6541
 
6623
6542
  // scale the rotation part
6624
- _m1$2.copy( this );
6543
+ _m1$4.copy( this );
6625
6544
 
6626
6545
  const invSX = 1 / sx;
6627
6546
  const invSY = 1 / sy;
6628
6547
  const invSZ = 1 / sz;
6629
6548
 
6630
- _m1$2.elements[ 0 ] *= invSX;
6631
- _m1$2.elements[ 1 ] *= invSX;
6632
- _m1$2.elements[ 2 ] *= invSX;
6549
+ _m1$4.elements[ 0 ] *= invSX;
6550
+ _m1$4.elements[ 1 ] *= invSX;
6551
+ _m1$4.elements[ 2 ] *= invSX;
6633
6552
 
6634
- _m1$2.elements[ 4 ] *= invSY;
6635
- _m1$2.elements[ 5 ] *= invSY;
6636
- _m1$2.elements[ 6 ] *= invSY;
6553
+ _m1$4.elements[ 4 ] *= invSY;
6554
+ _m1$4.elements[ 5 ] *= invSY;
6555
+ _m1$4.elements[ 6 ] *= invSY;
6637
6556
 
6638
- _m1$2.elements[ 8 ] *= invSZ;
6639
- _m1$2.elements[ 9 ] *= invSZ;
6640
- _m1$2.elements[ 10 ] *= invSZ;
6557
+ _m1$4.elements[ 8 ] *= invSZ;
6558
+ _m1$4.elements[ 9 ] *= invSZ;
6559
+ _m1$4.elements[ 10 ] *= invSZ;
6641
6560
 
6642
- quaternion.setFromRotationMatrix( _m1$2 );
6561
+ quaternion.setFromRotationMatrix( _m1$4 );
6643
6562
 
6644
6563
  scale.x = sx;
6645
6564
  scale.y = sy;
@@ -6780,14 +6699,14 @@ class Matrix4 {
6780
6699
  }
6781
6700
 
6782
6701
  const _v1$5 = /*@__PURE__*/ new Vector3();
6783
- const _m1$2 = /*@__PURE__*/ new Matrix4();
6702
+ const _m1$4 = /*@__PURE__*/ new Matrix4();
6784
6703
  const _zero = /*@__PURE__*/ new Vector3( 0, 0, 0 );
6785
6704
  const _one = /*@__PURE__*/ new Vector3( 1, 1, 1 );
6786
6705
  const _x = /*@__PURE__*/ new Vector3();
6787
6706
  const _y = /*@__PURE__*/ new Vector3();
6788
6707
  const _z = /*@__PURE__*/ new Vector3();
6789
6708
 
6790
- const _matrix$1 = /*@__PURE__*/ new Matrix4();
6709
+ const _matrix$2 = /*@__PURE__*/ new Matrix4();
6791
6710
  const _quaternion$3 = /*@__PURE__*/ new Quaternion();
6792
6711
 
6793
6712
  class Euler {
@@ -7022,9 +6941,9 @@ class Euler {
7022
6941
 
7023
6942
  setFromQuaternion( q, order, update ) {
7024
6943
 
7025
- _matrix$1.makeRotationFromQuaternion( q );
6944
+ _matrix$2.makeRotationFromQuaternion( q );
7026
6945
 
7027
- return this.setFromRotationMatrix( _matrix$1, order, update );
6946
+ return this.setFromRotationMatrix( _matrix$2, order, update );
7028
6947
 
7029
6948
  }
7030
6949
 
@@ -7159,7 +7078,7 @@ let _object3DId = 0;
7159
7078
 
7160
7079
  const _v1$4 = /*@__PURE__*/ new Vector3();
7161
7080
  const _q1 = /*@__PURE__*/ new Quaternion();
7162
- const _m1$1 = /*@__PURE__*/ new Matrix4();
7081
+ const _m1$3 = /*@__PURE__*/ new Matrix4();
7163
7082
  const _target = /*@__PURE__*/ new Vector3();
7164
7083
 
7165
7084
  const _position$3 = /*@__PURE__*/ new Vector3();
@@ -7173,6 +7092,9 @@ const _zAxis = /*@__PURE__*/ new Vector3( 0, 0, 1 );
7173
7092
  const _addedEvent = { type: 'added' };
7174
7093
  const _removedEvent = { type: 'removed' };
7175
7094
 
7095
+ const _childaddedEvent = { type: 'childadded', child: null };
7096
+ const _childremovedEvent = { type: 'childremoved', child: null };
7097
+
7176
7098
  class Object3D extends EventDispatcher {
7177
7099
 
7178
7100
  constructor() {
@@ -7409,7 +7331,7 @@ class Object3D extends EventDispatcher {
7409
7331
 
7410
7332
  this.updateWorldMatrix( true, false );
7411
7333
 
7412
- return vector.applyMatrix4( _m1$1.copy( this.matrixWorld ).invert() );
7334
+ return vector.applyMatrix4( _m1$3.copy( this.matrixWorld ).invert() );
7413
7335
 
7414
7336
  }
7415
7337
 
@@ -7435,20 +7357,20 @@ class Object3D extends EventDispatcher {
7435
7357
 
7436
7358
  if ( this.isCamera || this.isLight ) {
7437
7359
 
7438
- _m1$1.lookAt( _position$3, _target, this.up );
7360
+ _m1$3.lookAt( _position$3, _target, this.up );
7439
7361
 
7440
7362
  } else {
7441
7363
 
7442
- _m1$1.lookAt( _target, _position$3, this.up );
7364
+ _m1$3.lookAt( _target, _position$3, this.up );
7443
7365
 
7444
7366
  }
7445
7367
 
7446
- this.quaternion.setFromRotationMatrix( _m1$1 );
7368
+ this.quaternion.setFromRotationMatrix( _m1$3 );
7447
7369
 
7448
7370
  if ( parent ) {
7449
7371
 
7450
- _m1$1.extractRotation( parent.matrixWorld );
7451
- _q1.setFromRotationMatrix( _m1$1 );
7372
+ _m1$3.extractRotation( parent.matrixWorld );
7373
+ _q1.setFromRotationMatrix( _m1$3 );
7452
7374
  this.quaternion.premultiply( _q1.invert() );
7453
7375
 
7454
7376
  }
@@ -7489,6 +7411,10 @@ class Object3D extends EventDispatcher {
7489
7411
 
7490
7412
  object.dispatchEvent( _addedEvent );
7491
7413
 
7414
+ _childaddedEvent.child = object;
7415
+ this.dispatchEvent( _childaddedEvent );
7416
+ _childaddedEvent.child = null;
7417
+
7492
7418
  } else {
7493
7419
 
7494
7420
  console.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object );
@@ -7522,6 +7448,10 @@ class Object3D extends EventDispatcher {
7522
7448
 
7523
7449
  object.dispatchEvent( _removedEvent );
7524
7450
 
7451
+ _childremovedEvent.child = object;
7452
+ this.dispatchEvent( _childremovedEvent );
7453
+ _childremovedEvent.child = null;
7454
+
7525
7455
  }
7526
7456
 
7527
7457
  return this;
@@ -7556,17 +7486,17 @@ class Object3D extends EventDispatcher {
7556
7486
 
7557
7487
  this.updateWorldMatrix( true, false );
7558
7488
 
7559
- _m1$1.copy( this.matrixWorld ).invert();
7489
+ _m1$3.copy( this.matrixWorld ).invert();
7560
7490
 
7561
7491
  if ( object.parent !== null ) {
7562
7492
 
7563
7493
  object.parent.updateWorldMatrix( true, false );
7564
7494
 
7565
- _m1$1.multiply( object.parent.matrixWorld );
7495
+ _m1$3.multiply( object.parent.matrixWorld );
7566
7496
 
7567
7497
  }
7568
7498
 
7569
- object.applyMatrix4( _m1$1 );
7499
+ object.applyMatrix4( _m1$3 );
7570
7500
 
7571
7501
  this.add( object );
7572
7502
 
@@ -9266,7 +9196,7 @@ class Material extends EventDispatcher {
9266
9196
  if ( this.sheenColor && this.sheenColor.isColor ) data.sheenColor = this.sheenColor.getHex();
9267
9197
  if ( this.sheenRoughness !== undefined ) data.sheenRoughness = this.sheenRoughness;
9268
9198
  if ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex();
9269
- if ( this.emissiveIntensity && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;
9199
+ if ( this.emissiveIntensity !== undefined && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;
9270
9200
 
9271
9201
  if ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex();
9272
9202
  if ( this.specularIntensity !== undefined ) data.specularIntensity = this.specularIntensity;
@@ -9376,6 +9306,7 @@ class Material extends EventDispatcher {
9376
9306
 
9377
9307
  }
9378
9308
 
9309
+ if ( this.envMapRotation !== undefined ) data.envMapRotation = this.envMapRotation.toArray();
9379
9310
  if ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity;
9380
9311
  if ( this.reflectivity !== undefined ) data.reflectivity = this.reflectivity;
9381
9312
  if ( this.refractionRatio !== undefined ) data.refractionRatio = this.refractionRatio;
@@ -9620,6 +9551,7 @@ class MeshBasicMaterial extends Material {
9620
9551
  this.alphaMap = null;
9621
9552
 
9622
9553
  this.envMap = null;
9554
+ this.envMapRotation = new Euler();
9623
9555
  this.combine = MultiplyOperation;
9624
9556
  this.reflectivity = 1;
9625
9557
  this.refractionRatio = 0.98;
@@ -9654,6 +9586,7 @@ class MeshBasicMaterial extends Material {
9654
9586
  this.alphaMap = source.alphaMap;
9655
9587
 
9656
9588
  this.envMap = source.envMap;
9589
+ this.envMapRotation.copy( source.envMapRotation );
9657
9590
  this.combine = source.combine;
9658
9591
  this.reflectivity = source.reflectivity;
9659
9592
  this.refractionRatio = source.refractionRatio;
@@ -10458,19 +10391,9 @@ class Float32BufferAttribute extends BufferAttribute {
10458
10391
 
10459
10392
  }
10460
10393
 
10461
- class Float64BufferAttribute extends BufferAttribute {
10462
-
10463
- constructor( array, itemSize, normalized ) {
10464
-
10465
- super( new Float64Array( array ), itemSize, normalized );
10466
-
10467
- }
10468
-
10469
- }
10470
-
10471
10394
  let _id$2 = 0;
10472
10395
 
10473
- const _m1 = /*@__PURE__*/ new Matrix4();
10396
+ const _m1$2 = /*@__PURE__*/ new Matrix4();
10474
10397
  const _obj = /*@__PURE__*/ new Object3D();
10475
10398
  const _offset = /*@__PURE__*/ new Vector3();
10476
10399
  const _box$2 = /*@__PURE__*/ new Box3();
@@ -10636,9 +10559,9 @@ class BufferGeometry extends EventDispatcher {
10636
10559
 
10637
10560
  applyQuaternion( q ) {
10638
10561
 
10639
- _m1.makeRotationFromQuaternion( q );
10562
+ _m1$2.makeRotationFromQuaternion( q );
10640
10563
 
10641
- this.applyMatrix4( _m1 );
10564
+ this.applyMatrix4( _m1$2 );
10642
10565
 
10643
10566
  return this;
10644
10567
 
@@ -10648,9 +10571,9 @@ class BufferGeometry extends EventDispatcher {
10648
10571
 
10649
10572
  // rotate geometry around world x-axis
10650
10573
 
10651
- _m1.makeRotationX( angle );
10574
+ _m1$2.makeRotationX( angle );
10652
10575
 
10653
- this.applyMatrix4( _m1 );
10576
+ this.applyMatrix4( _m1$2 );
10654
10577
 
10655
10578
  return this;
10656
10579
 
@@ -10660,9 +10583,9 @@ class BufferGeometry extends EventDispatcher {
10660
10583
 
10661
10584
  // rotate geometry around world y-axis
10662
10585
 
10663
- _m1.makeRotationY( angle );
10586
+ _m1$2.makeRotationY( angle );
10664
10587
 
10665
- this.applyMatrix4( _m1 );
10588
+ this.applyMatrix4( _m1$2 );
10666
10589
 
10667
10590
  return this;
10668
10591
 
@@ -10672,9 +10595,9 @@ class BufferGeometry extends EventDispatcher {
10672
10595
 
10673
10596
  // rotate geometry around world z-axis
10674
10597
 
10675
- _m1.makeRotationZ( angle );
10598
+ _m1$2.makeRotationZ( angle );
10676
10599
 
10677
- this.applyMatrix4( _m1 );
10600
+ this.applyMatrix4( _m1$2 );
10678
10601
 
10679
10602
  return this;
10680
10603
 
@@ -10684,9 +10607,9 @@ class BufferGeometry extends EventDispatcher {
10684
10607
 
10685
10608
  // translate geometry
10686
10609
 
10687
- _m1.makeTranslation( x, y, z );
10610
+ _m1$2.makeTranslation( x, y, z );
10688
10611
 
10689
- this.applyMatrix4( _m1 );
10612
+ this.applyMatrix4( _m1$2 );
10690
10613
 
10691
10614
  return this;
10692
10615
 
@@ -10696,9 +10619,9 @@ class BufferGeometry extends EventDispatcher {
10696
10619
 
10697
10620
  // scale geometry
10698
10621
 
10699
- _m1.makeScale( x, y, z );
10622
+ _m1$2.makeScale( x, y, z );
10700
10623
 
10701
- this.applyMatrix4( _m1 );
10624
+ this.applyMatrix4( _m1$2 );
10702
10625
 
10703
10626
  return this;
10704
10627
 
@@ -10758,7 +10681,7 @@ class BufferGeometry extends EventDispatcher {
10758
10681
 
10759
10682
  if ( position && position.isGLBufferAttribute ) {
10760
10683
 
10761
- console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box. Alternatively set "mesh.frustumCulled" to "false".', this );
10684
+ console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );
10762
10685
 
10763
10686
  this.boundingBox.set(
10764
10687
  new Vector3( - Infinity, - Infinity, - Infinity ),
@@ -10828,7 +10751,7 @@ class BufferGeometry extends EventDispatcher {
10828
10751
 
10829
10752
  if ( position && position.isGLBufferAttribute ) {
10830
10753
 
10831
- console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere. Alternatively set "mesh.frustumCulled" to "false".', this );
10754
+ console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );
10832
10755
 
10833
10756
  this.boundingSphere.set( new Vector3(), Infinity );
10834
10757
 
@@ -10945,24 +10868,21 @@ class BufferGeometry extends EventDispatcher {
10945
10868
 
10946
10869
  }
10947
10870
 
10948
- const indices = index.array;
10949
- const positions = attributes.position.array;
10950
- const normals = attributes.normal.array;
10951
- const uvs = attributes.uv.array;
10952
-
10953
- const nVertices = positions.length / 3;
10871
+ const positionAttribute = attributes.position;
10872
+ const normalAttribute = attributes.normal;
10873
+ const uvAttribute = attributes.uv;
10954
10874
 
10955
10875
  if ( this.hasAttribute( 'tangent' ) === false ) {
10956
10876
 
10957
- this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * nVertices ), 4 ) );
10877
+ this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );
10958
10878
 
10959
10879
  }
10960
10880
 
10961
- const tangents = this.getAttribute( 'tangent' ).array;
10881
+ const tangentAttribute = this.getAttribute( 'tangent' );
10962
10882
 
10963
10883
  const tan1 = [], tan2 = [];
10964
10884
 
10965
- for ( let i = 0; i < nVertices; i ++ ) {
10885
+ for ( let i = 0; i < positionAttribute.count; i ++ ) {
10966
10886
 
10967
10887
  tan1[ i ] = new Vector3();
10968
10888
  tan2[ i ] = new Vector3();
@@ -10982,13 +10902,13 @@ class BufferGeometry extends EventDispatcher {
10982
10902
 
10983
10903
  function handleTriangle( a, b, c ) {
10984
10904
 
10985
- vA.fromArray( positions, a * 3 );
10986
- vB.fromArray( positions, b * 3 );
10987
- vC.fromArray( positions, c * 3 );
10905
+ vA.fromBufferAttribute( positionAttribute, a );
10906
+ vB.fromBufferAttribute( positionAttribute, b );
10907
+ vC.fromBufferAttribute( positionAttribute, c );
10988
10908
 
10989
- uvA.fromArray( uvs, a * 2 );
10990
- uvB.fromArray( uvs, b * 2 );
10991
- uvC.fromArray( uvs, c * 2 );
10909
+ uvA.fromBufferAttribute( uvAttribute, a );
10910
+ uvB.fromBufferAttribute( uvAttribute, b );
10911
+ uvC.fromBufferAttribute( uvAttribute, c );
10992
10912
 
10993
10913
  vB.sub( vA );
10994
10914
  vC.sub( vA );
@@ -11021,7 +10941,7 @@ class BufferGeometry extends EventDispatcher {
11021
10941
 
11022
10942
  groups = [ {
11023
10943
  start: 0,
11024
- count: indices.length
10944
+ count: index.count
11025
10945
  } ];
11026
10946
 
11027
10947
  }
@@ -11036,9 +10956,9 @@ class BufferGeometry extends EventDispatcher {
11036
10956
  for ( let j = start, jl = start + count; j < jl; j += 3 ) {
11037
10957
 
11038
10958
  handleTriangle(
11039
- indices[ j + 0 ],
11040
- indices[ j + 1 ],
11041
- indices[ j + 2 ]
10959
+ index.getX( j + 0 ),
10960
+ index.getX( j + 1 ),
10961
+ index.getX( j + 2 )
11042
10962
  );
11043
10963
 
11044
10964
  }
@@ -11050,7 +10970,7 @@ class BufferGeometry extends EventDispatcher {
11050
10970
 
11051
10971
  function handleVertex( v ) {
11052
10972
 
11053
- n.fromArray( normals, v * 3 );
10973
+ n.fromBufferAttribute( normalAttribute, v );
11054
10974
  n2.copy( n );
11055
10975
 
11056
10976
  const t = tan1[ v ];
@@ -11066,10 +10986,7 @@ class BufferGeometry extends EventDispatcher {
11066
10986
  const test = tmp2.dot( tan2[ v ] );
11067
10987
  const w = ( test < 0.0 ) ? - 1.0 : 1.0;
11068
10988
 
11069
- tangents[ v * 4 ] = tmp.x;
11070
- tangents[ v * 4 + 1 ] = tmp.y;
11071
- tangents[ v * 4 + 2 ] = tmp.z;
11072
- tangents[ v * 4 + 3 ] = w;
10989
+ tangentAttribute.setXYZW( v, tmp.x, tmp.y, tmp.z, w );
11073
10990
 
11074
10991
  }
11075
10992
 
@@ -11082,9 +10999,9 @@ class BufferGeometry extends EventDispatcher {
11082
10999
 
11083
11000
  for ( let j = start, jl = start + count; j < jl; j += 3 ) {
11084
11001
 
11085
- handleVertex( indices[ j + 0 ] );
11086
- handleVertex( indices[ j + 1 ] );
11087
- handleVertex( indices[ j + 2 ] );
11002
+ handleVertex( index.getX( j + 0 ) );
11003
+ handleVertex( index.getX( j + 1 ) );
11004
+ handleVertex( index.getX( j + 2 ) );
11088
11005
 
11089
11006
  }
11090
11007
 
@@ -11913,7 +11830,6 @@ function checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, n
11913
11830
  _uvC$1.fromBufferAttribute( uv1, c );
11914
11831
 
11915
11832
  intersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );
11916
- intersection.uv2 = intersection.uv1; // @deprecated, r152
11917
11833
 
11918
11834
  }
11919
11835
 
@@ -12947,14 +12863,6 @@ class WebGLCubeRenderTarget extends WebGLRenderTarget {
12947
12863
  const image = { width: size, height: size, depth: 1 };
12948
12864
  const images = [ image, image, image, image, image, image ];
12949
12865
 
12950
- if ( options.encoding !== undefined ) {
12951
-
12952
- // @deprecated, r152
12953
- warnOnce( 'THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace.' );
12954
- options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
12955
-
12956
- }
12957
-
12958
12866
  this.texture = new CubeTexture( images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
12959
12867
 
12960
12868
  // By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)
@@ -13897,9 +13805,9 @@ var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
13897
13805
 
13898
13806
  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}";
13899
13807
 
13900
- 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";
13808
+ 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";
13901
13809
 
13902
- 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";
13810
+ 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";
13903
13811
 
13904
13812
  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";
13905
13813
 
@@ -13927,7 +13835,7 @@ var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertM
13927
13835
 
13928
13836
  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";
13929
13837
 
13930
- 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";
13838
+ 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";
13931
13839
 
13932
13840
  var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
13933
13841
 
@@ -13967,11 +13875,13 @@ var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_META
13967
13875
 
13968
13876
  var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif";
13969
13877
 
13878
+ 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";
13879
+
13970
13880
  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";
13971
13881
 
13972
13882
  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";
13973
13883
 
13974
- 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";
13884
+ 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";
13975
13885
 
13976
13886
  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";
13977
13887
 
@@ -14033,7 +13943,7 @@ var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D spe
14033
13943
 
14034
13944
  var tonemapping_fragment = "#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif";
14035
13945
 
14036
- 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; }";
13946
+ 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; }";
14037
13947
 
14038
13948
  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";
14039
13949
 
@@ -14053,17 +13963,17 @@ const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\n
14053
13963
 
14054
13964
  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}";
14055
13965
 
14056
- 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}";
13966
+ 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}";
14057
13967
 
14058
13968
  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}";
14059
13969
 
14060
13970
  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}";
14061
13971
 
14062
- 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}";
13972
+ 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}";
14063
13973
 
14064
13974
  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}";
14065
13975
 
14066
- 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}";
13976
+ 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}";
14067
13977
 
14068
13978
  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}";
14069
13979
 
@@ -14071,43 +13981,43 @@ const vertex$c = "varying vec3 vWorldDirection;\n#include <common>\nvoid main()
14071
13981
 
14072
13982
  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}";
14073
13983
 
14074
- 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}";
13984
+ 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}";
14075
13985
 
14076
13986
  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}";
14077
13987
 
14078
- 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}";
13988
+ 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}";
14079
13989
 
14080
13990
  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}";
14081
13991
 
14082
- 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}";
13992
+ 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}";
14083
13993
 
14084
13994
  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}";
14085
13995
 
14086
- 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}";
13996
+ 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}";
14087
13997
 
14088
13998
  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}";
14089
13999
 
14090
- 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}";
14000
+ 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}";
14091
14001
 
14092
14002
  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}";
14093
14003
 
14094
- 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}";
14004
+ 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}";
14095
14005
 
14096
14006
  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}";
14097
14007
 
14098
- 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}";
14008
+ 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}";
14099
14009
 
14100
14010
  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}";
14101
14011
 
14102
- 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}";
14012
+ 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}";
14103
14013
 
14104
14014
  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}";
14105
14015
 
14106
- 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}";
14016
+ 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}";
14107
14017
 
14108
14018
  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}";
14109
14019
 
14110
- 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}";
14020
+ 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}";
14111
14021
 
14112
14022
  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}";
14113
14023
 
@@ -14183,6 +14093,7 @@ const ShaderChunk = {
14183
14093
  map_particle_pars_fragment: map_particle_pars_fragment,
14184
14094
  metalnessmap_fragment: metalnessmap_fragment,
14185
14095
  metalnessmap_pars_fragment: metalnessmap_pars_fragment,
14096
+ morphinstance_vertex: morphinstance_vertex,
14186
14097
  morphcolor_vertex: morphcolor_vertex,
14187
14098
  morphnormal_vertex: morphnormal_vertex,
14188
14099
  morphtarget_pars_vertex: morphtarget_pars_vertex,
@@ -14291,6 +14202,7 @@ const UniformsLib = {
14291
14202
  envmap: {
14292
14203
 
14293
14204
  envMap: { value: null },
14205
+ envMapRotation: { value: /*@__PURE__*/ new Matrix3() },
14294
14206
  flipEnvMap: { value: - 1 },
14295
14207
  reflectivity: { value: 1.0 }, // basic, lambert, phong
14296
14208
  ior: { value: 1.5 }, // physical
@@ -14711,7 +14623,8 @@ const ShaderLib = {
14711
14623
  envMap: { value: null },
14712
14624
  flipEnvMap: { value: - 1 },
14713
14625
  backgroundBlurriness: { value: 0 },
14714
- backgroundIntensity: { value: 1 }
14626
+ backgroundIntensity: { value: 1 },
14627
+ backgroundRotation: { value: /*@__PURE__*/ new Matrix3() }
14715
14628
  },
14716
14629
 
14717
14630
  vertexShader: ShaderChunk.backgroundCube_vert,
@@ -14835,6 +14748,8 @@ ShaderLib.physical = {
14835
14748
  };
14836
14749
 
14837
14750
  const _rgb = { r: 0, b: 0, g: 0 };
14751
+ const _e1$1 = /*@__PURE__*/ new Euler();
14752
+ const _m1$1 = /*@__PURE__*/ new Matrix4();
14838
14753
 
14839
14754
  function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, premultipliedAlpha ) {
14840
14755
 
@@ -14931,10 +14846,24 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
14931
14846
 
14932
14847
  }
14933
14848
 
14849
+ _e1$1.copy( scene.backgroundRotation );
14850
+
14851
+ // accommodate left-handed frame
14852
+ _e1$1.x *= - 1; _e1$1.y *= - 1; _e1$1.z *= - 1;
14853
+
14854
+ if ( background.isCubeTexture && background.isRenderTargetTexture === false ) {
14855
+
14856
+ // environment maps which are not cube render targets or PMREMs follow a different convention
14857
+ _e1$1.y *= - 1;
14858
+ _e1$1.z *= - 1;
14859
+
14860
+ }
14861
+
14934
14862
  boxMesh.material.uniforms.envMap.value = background;
14935
14863
  boxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? - 1 : 1;
14936
14864
  boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;
14937
14865
  boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
14866
+ boxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4( _m1$1.makeRotationFromEuler( _e1$1 ) );
14938
14867
  boxMesh.material.toneMapped = ColorManagement.getTransfer( background.colorSpace ) !== SRGBTransfer;
14939
14868
 
14940
14869
  if ( currentBackground !== background ||
@@ -16399,6 +16328,7 @@ class PMREMGenerator {
16399
16328
  * Generates a PMREM from an equirectangular texture, which can be either LDR
16400
16329
  * or HDR. The ideal input image size is 1k (1024 x 512),
16401
16330
  * as this matches best with the 256 x 256 cubemap output.
16331
+ * The smallest supported equirectangular image size is 64 x 32.
16402
16332
  */
16403
16333
  fromEquirectangular( equirectangular, renderTarget = null ) {
16404
16334
 
@@ -16410,6 +16340,7 @@ class PMREMGenerator {
16410
16340
  * Generates a PMREM from an cubemap texture, which can be either LDR
16411
16341
  * or HDR. The ideal input cube size is 256 x 256,
16412
16342
  * as this matches best with the 256 x 256 cubemap output.
16343
+ * The smallest supported cube size is 16 x 16.
16413
16344
  */
16414
16345
  fromCubemap( cubemap, renderTarget = null ) {
16415
16346
 
@@ -17917,24 +17848,31 @@ function WebGLMorphtargets( gl, capabilities, textures ) {
17917
17848
  }
17918
17849
 
17919
17850
  //
17851
+ if ( object.isInstancedMesh === true && object.morphTexture !== null ) {
17920
17852
 
17921
- let morphInfluencesSum = 0;
17853
+ program.getUniforms().setValue( gl, 'morphTexture', object.morphTexture, textures );
17922
17854
 
17923
- for ( let i = 0; i < objectInfluences.length; i ++ ) {
17855
+ } else {
17924
17856
 
17925
- morphInfluencesSum += objectInfluences[ i ];
17857
+ let morphInfluencesSum = 0;
17926
17858
 
17927
- }
17859
+ for ( let i = 0; i < objectInfluences.length; i ++ ) {
17928
17860
 
17929
- const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
17861
+ morphInfluencesSum += objectInfluences[ i ];
17930
17862
 
17931
- program.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence );
17932
- program.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences );
17863
+ }
17864
+
17865
+ const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
17866
+
17867
+
17868
+ program.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence );
17869
+ program.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences );
17870
+
17871
+ }
17933
17872
 
17934
17873
  program.getUniforms().setValue( gl, 'morphTargetsTexture', entry.texture, textures );
17935
17874
  program.getUniforms().setValue( gl, 'morphTargetsTextureSize', entry.size );
17936
17875
 
17937
-
17938
17876
  } else {
17939
17877
 
17940
17878
  // When object doesn't have morph target influences defined, we treat it as a 0-length array
@@ -19580,6 +19518,10 @@ function getToneMappingFunction( functionName, toneMapping ) {
19580
19518
  toneMappingName = 'AgX';
19581
19519
  break;
19582
19520
 
19521
+ case NeutralToneMapping:
19522
+ toneMappingName = 'Neutral';
19523
+ break;
19524
+
19583
19525
  case CustomToneMapping:
19584
19526
  toneMappingName = 'Custom';
19585
19527
  break;
@@ -20005,6 +19947,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
20005
19947
  parameters.batching ? '#define USE_BATCHING' : '',
20006
19948
  parameters.instancing ? '#define USE_INSTANCING' : '',
20007
19949
  parameters.instancingColor ? '#define USE_INSTANCING_COLOR' : '',
19950
+ parameters.instancingMorph ? '#define USE_INSTANCING_MORPH' : '',
20008
19951
 
20009
19952
  parameters.useFog && parameters.fog ? '#define USE_FOG' : '',
20010
19953
  parameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '',
@@ -20136,6 +20079,12 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
20136
20079
 
20137
20080
  '#endif',
20138
20081
 
20082
+ '#ifdef USE_INSTANCING_MORPH',
20083
+
20084
+ ' uniform sampler2D morphTexture;',
20085
+
20086
+ '#endif',
20087
+
20139
20088
  'attribute vec3 position;',
20140
20089
  'attribute vec3 normal;',
20141
20090
  'attribute vec2 uv;',
@@ -20927,6 +20876,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20927
20876
  batching: IS_BATCHEDMESH,
20928
20877
  instancing: IS_INSTANCEDMESH,
20929
20878
  instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
20879
+ instancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null,
20930
20880
 
20931
20881
  supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
20932
20882
  numMultiviewViews: numMultiviewViews,
@@ -21214,38 +21164,40 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
21214
21164
  _programLayers.enable( 2 );
21215
21165
  if ( parameters.instancingColor )
21216
21166
  _programLayers.enable( 3 );
21217
- if ( parameters.matcap )
21167
+ if ( parameters.instancingMorph )
21218
21168
  _programLayers.enable( 4 );
21219
- if ( parameters.envMap )
21169
+ if ( parameters.matcap )
21220
21170
  _programLayers.enable( 5 );
21221
- if ( parameters.normalMapObjectSpace )
21171
+ if ( parameters.envMap )
21222
21172
  _programLayers.enable( 6 );
21223
- if ( parameters.normalMapTangentSpace )
21173
+ if ( parameters.normalMapObjectSpace )
21224
21174
  _programLayers.enable( 7 );
21225
- if ( parameters.clearcoat )
21175
+ if ( parameters.normalMapTangentSpace )
21226
21176
  _programLayers.enable( 8 );
21227
- if ( parameters.iridescence )
21177
+ if ( parameters.clearcoat )
21228
21178
  _programLayers.enable( 9 );
21229
- if ( parameters.alphaTest )
21179
+ if ( parameters.iridescence )
21230
21180
  _programLayers.enable( 10 );
21231
- if ( parameters.vertexColors )
21181
+ if ( parameters.alphaTest )
21232
21182
  _programLayers.enable( 11 );
21233
- if ( parameters.vertexAlphas )
21183
+ if ( parameters.vertexColors )
21234
21184
  _programLayers.enable( 12 );
21235
- if ( parameters.vertexUv1s )
21185
+ if ( parameters.vertexAlphas )
21236
21186
  _programLayers.enable( 13 );
21237
- if ( parameters.vertexUv2s )
21187
+ if ( parameters.vertexUv1s )
21238
21188
  _programLayers.enable( 14 );
21239
- if ( parameters.vertexUv3s )
21189
+ if ( parameters.vertexUv2s )
21240
21190
  _programLayers.enable( 15 );
21241
- if ( parameters.vertexTangents )
21191
+ if ( parameters.vertexUv3s )
21242
21192
  _programLayers.enable( 16 );
21243
- if ( parameters.anisotropy )
21193
+ if ( parameters.vertexTangents )
21244
21194
  _programLayers.enable( 17 );
21245
- if ( parameters.alphaHash )
21195
+ if ( parameters.anisotropy )
21246
21196
  _programLayers.enable( 18 );
21247
- if ( parameters.batching )
21197
+ if ( parameters.alphaHash )
21248
21198
  _programLayers.enable( 19 );
21199
+ if ( parameters.batching )
21200
+ _programLayers.enable( 20 );
21249
21201
 
21250
21202
  array.push( _programLayers.mask );
21251
21203
  _programLayers.disableAll();
@@ -23352,33 +23304,19 @@ function WebGLState( gl, extensions, capabilities ) {
23352
23304
 
23353
23305
  }
23354
23306
 
23355
- if ( renderTarget.isWebGLMultipleRenderTargets ) {
23307
+ const textures = renderTarget.textures;
23356
23308
 
23357
- const textures = renderTarget.texture;
23309
+ if ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {
23358
23310
 
23359
- if ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {
23311
+ for ( let i = 0, il = textures.length; i < il; i ++ ) {
23360
23312
 
23361
- for ( let i = 0, il = textures.length; i < il; i ++ ) {
23362
-
23363
- drawBuffers[ i ] = gl.COLOR_ATTACHMENT0 + i;
23364
-
23365
- }
23366
-
23367
- drawBuffers.length = textures.length;
23368
-
23369
- needsUpdate = true;
23313
+ drawBuffers[ i ] = gl.COLOR_ATTACHMENT0 + i;
23370
23314
 
23371
23315
  }
23372
23316
 
23373
- } else {
23317
+ drawBuffers.length = textures.length;
23374
23318
 
23375
- if ( drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {
23376
-
23377
- drawBuffers[ 0 ] = gl.COLOR_ATTACHMENT0;
23378
-
23379
- needsUpdate = true;
23380
-
23381
- }
23319
+ needsUpdate = true;
23382
23320
 
23383
23321
  }
23384
23322
 
@@ -23400,10 +23338,14 @@ function WebGLState( gl, extensions, capabilities ) {
23400
23338
 
23401
23339
  gl.drawBuffers( drawBuffers );
23402
23340
 
23403
- } else {
23341
+ } else if ( extensions.has( 'WEBGL_draw_buffers' ) === true ) {
23404
23342
 
23405
23343
  extensions.get( 'WEBGL_draw_buffers' ).drawBuffersWEBGL( drawBuffers );
23406
23344
 
23345
+ } else {
23346
+
23347
+ throw new Error( 'THREE.WebGLState: Usage of gl.drawBuffers() require WebGL2 or WEBGL_draw_buffers extension' );
23348
+
23407
23349
  }
23408
23350
 
23409
23351
  }
@@ -24191,6 +24133,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24191
24133
  const supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent );
24192
24134
  const multiviewExt = extensions.has( 'OCULUS_multiview' ) ? extensions.get( 'OCULUS_multiview' ) : null;
24193
24135
 
24136
+ const _imageDimensions = new Vector2();
24194
24137
  const _videoTextures = new WeakMap();
24195
24138
  let _canvas;
24196
24139
 
@@ -24231,11 +24174,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24231
24174
 
24232
24175
  let scale = 1;
24233
24176
 
24177
+ const dimensions = getDimensions( image );
24178
+
24234
24179
  // handle case if texture exceeds max size
24235
24180
 
24236
- if ( image.width > maxSize || image.height > maxSize ) {
24181
+ if ( dimensions.width > maxSize || dimensions.height > maxSize ) {
24237
24182
 
24238
- scale = maxSize / Math.max( image.width, image.height );
24183
+ scale = maxSize / Math.max( dimensions.width, dimensions.height );
24239
24184
 
24240
24185
  }
24241
24186
 
@@ -24247,12 +24192,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24247
24192
 
24248
24193
  if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||
24249
24194
  ( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||
24250
- ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {
24195
+ ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ||
24196
+ ( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) ) {
24251
24197
 
24252
24198
  const floor = needsPowerOfTwo ? floorPowerOfTwo : Math.floor;
24253
24199
 
24254
- const width = floor( scale * image.width );
24255
- const height = floor( scale * image.height );
24200
+ const width = floor( scale * dimensions.width );
24201
+ const height = floor( scale * dimensions.height );
24256
24202
 
24257
24203
  if ( _canvas === undefined ) _canvas = createCanvas( width, height );
24258
24204
 
@@ -24266,7 +24212,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24266
24212
  const context = canvas.getContext( '2d' );
24267
24213
  context.drawImage( image, 0, 0, width, height );
24268
24214
 
24269
- console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + image.width + 'x' + image.height + ') to (' + width + 'x' + height + ').' );
24215
+ console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + dimensions.width + 'x' + dimensions.height + ') to (' + width + 'x' + height + ').' );
24270
24216
 
24271
24217
  return canvas;
24272
24218
 
@@ -24274,7 +24220,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24274
24220
 
24275
24221
  if ( 'data' in image ) {
24276
24222
 
24277
- console.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + image.width + 'x' + image.height + ').' );
24223
+ console.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + dimensions.width + 'x' + dimensions.height + ').' );
24278
24224
 
24279
24225
  }
24280
24226
 
@@ -24290,7 +24236,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24290
24236
 
24291
24237
  function isPowerOfTwo$1( image ) {
24292
24238
 
24293
- return isPowerOfTwo( image.width ) && isPowerOfTwo( image.height );
24239
+ const dimensions = getDimensions( image );
24240
+
24241
+ return isPowerOfTwo( dimensions.width ) && isPowerOfTwo( dimensions.height );
24294
24242
 
24295
24243
  }
24296
24244
 
@@ -24357,6 +24305,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24357
24305
 
24358
24306
  }
24359
24307
 
24308
+ if ( glFormat === _gl.RG_INTEGER ) {
24309
+
24310
+ if ( glType === _gl.UNSIGNED_BYTE ) internalFormat = _gl.RG8UI;
24311
+ if ( glType === _gl.UNSIGNED_SHORT ) internalFormat = _gl.RG16UI;
24312
+ if ( glType === _gl.UNSIGNED_INT ) internalFormat = _gl.RG32UI;
24313
+ if ( glType === _gl.BYTE ) internalFormat = _gl.RG8I;
24314
+ if ( glType === _gl.SHORT ) internalFormat = _gl.RG16I;
24315
+ if ( glType === _gl.INT ) internalFormat = _gl.RG32I;
24316
+
24317
+ }
24318
+
24360
24319
  if ( glFormat === _gl.RGBA ) {
24361
24320
 
24362
24321
  const transfer = forceLinearTransfer ? LinearTransfer : ColorManagement.getTransfer( colorSpace );
@@ -24504,18 +24463,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24504
24463
 
24505
24464
  function deallocateRenderTarget( renderTarget ) {
24506
24465
 
24507
- const texture = renderTarget.texture;
24508
-
24509
24466
  const renderTargetProperties = properties.get( renderTarget );
24510
- const textureProperties = properties.get( texture );
24511
-
24512
- if ( textureProperties.__webglTexture !== undefined ) {
24513
-
24514
- _gl.deleteTexture( textureProperties.__webglTexture );
24515
-
24516
- info.memory.textures --;
24517
-
24518
- }
24519
24467
 
24520
24468
  if ( renderTarget.depthTexture ) {
24521
24469
 
@@ -24570,27 +24518,24 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24570
24518
 
24571
24519
  }
24572
24520
 
24573
- if ( renderTarget.isWebGLMultipleRenderTargets ) {
24574
-
24575
- for ( let i = 0, il = texture.length; i < il; i ++ ) {
24576
-
24577
- const attachmentProperties = properties.get( texture[ i ] );
24521
+ const textures = renderTarget.textures;
24578
24522
 
24579
- if ( attachmentProperties.__webglTexture ) {
24523
+ for ( let i = 0, il = textures.length; i < il; i ++ ) {
24580
24524
 
24581
- _gl.deleteTexture( attachmentProperties.__webglTexture );
24525
+ const attachmentProperties = properties.get( textures[ i ] );
24582
24526
 
24583
- info.memory.textures --;
24527
+ if ( attachmentProperties.__webglTexture ) {
24584
24528
 
24585
- }
24529
+ _gl.deleteTexture( attachmentProperties.__webglTexture );
24586
24530
 
24587
- properties.remove( texture[ i ] );
24531
+ info.memory.textures --;
24588
24532
 
24589
24533
  }
24590
24534
 
24535
+ properties.remove( textures[ i ] );
24536
+
24591
24537
  }
24592
24538
 
24593
- properties.remove( texture );
24594
24539
  properties.remove( renderTarget );
24595
24540
 
24596
24541
  }
@@ -24813,8 +24758,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24813
24758
 
24814
24759
  if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {
24815
24760
 
24816
- const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
24817
-
24818
24761
  if ( texture.magFilter === NearestFilter ) return;
24819
24762
  if ( texture.minFilter !== NearestMipmapLinearFilter && texture.minFilter !== LinearMipmapLinearFilter ) return;
24820
24763
  if ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false ) return; // verify extension for WebGL 1 and WebGL 2
@@ -24822,6 +24765,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24822
24765
 
24823
24766
  if ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) {
24824
24767
 
24768
+ const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
24825
24769
  _gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) );
24826
24770
  properties.get( texture ).__currentAnisotropy = texture.anisotropy;
24827
24771
 
@@ -25342,7 +25286,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25342
25286
 
25343
25287
  if ( useTexStorage && allocateMemory ) {
25344
25288
 
25345
- state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );
25289
+ const dimensions = getDimensions( mipmaps[ 0 ] );
25290
+
25291
+ state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height );
25346
25292
 
25347
25293
  }
25348
25294
 
@@ -25374,7 +25320,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25374
25320
 
25375
25321
  if ( allocateMemory ) {
25376
25322
 
25377
- state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, image.width, image.height );
25323
+ const dimensions = getDimensions( image );
25324
+
25325
+ state.texStorage2D( _gl.TEXTURE_2D, levels, glInternalFormat, dimensions.width, dimensions.height );
25378
25326
 
25379
25327
  }
25380
25328
 
@@ -25545,7 +25493,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25545
25493
 
25546
25494
  if ( mipmaps.length > 0 ) levels ++;
25547
25495
 
25548
- state.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, cubeImage[ 0 ].width, cubeImage[ 0 ].height );
25496
+ const dimensions = getDimensions( cubeImage[ 0 ] );
25497
+
25498
+ state.texStorage2D( _gl.TEXTURE_CUBE_MAP, levels, glInternalFormat, dimensions.width, dimensions.height );
25549
25499
 
25550
25500
  }
25551
25501
 
@@ -25835,7 +25785,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25835
25785
 
25836
25786
  } else {
25837
25787
 
25838
- const textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [ renderTarget.texture ];
25788
+ const textures = renderTarget.textures;
25839
25789
 
25840
25790
  for ( let i = 0; i < textures.length; i ++ ) {
25841
25791
 
@@ -26047,7 +25997,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26047
25997
 
26048
25998
  renderTarget.addEventListener( 'dispose', onRenderTargetDispose );
26049
25999
 
26050
- if ( renderTarget.isWebGLMultipleRenderTargets !== true ) {
26000
+ const textures = renderTarget.textures;
26001
+
26002
+ const isCube = ( renderTarget.isWebGLCubeRenderTarget === true );
26003
+ const isMultipleRenderTargets = ( textures.length > 1 );
26004
+ const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;
26005
+
26006
+ if ( ! isMultipleRenderTargets ) {
26051
26007
 
26052
26008
  if ( textureProperties.__webglTexture === undefined ) {
26053
26009
 
@@ -26060,10 +26016,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26060
26016
 
26061
26017
  }
26062
26018
 
26063
- const isCube = ( renderTarget.isWebGLCubeRenderTarget === true );
26064
- const isMultipleRenderTargets = ( renderTarget.isWebGLMultipleRenderTargets === true );
26065
- const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;
26066
-
26067
26019
  // Setup framebuffer
26068
26020
 
26069
26021
  if ( isCube ) {
@@ -26112,8 +26064,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26112
26064
 
26113
26065
  if ( capabilities.drawBuffers ) {
26114
26066
 
26115
- const textures = renderTarget.texture;
26116
-
26117
26067
  for ( let i = 0, il = textures.length; i < il; i ++ ) {
26118
26068
 
26119
26069
  const attachmentProperties = properties.get( textures[ i ] );
@@ -26138,8 +26088,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26138
26088
 
26139
26089
  if ( ( isWebGL2 && renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) {
26140
26090
 
26141
- const textures = isMultipleRenderTargets ? texture : [ texture ];
26142
-
26143
26091
  renderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();
26144
26092
  renderTargetProperties.__webglColorRenderbuffer = [];
26145
26093
 
@@ -26212,8 +26160,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26212
26160
 
26213
26161
  } else if ( isMultipleRenderTargets ) {
26214
26162
 
26215
- const textures = renderTarget.texture;
26216
-
26217
26163
  for ( let i = 0, il = textures.length; i < il; i ++ ) {
26218
26164
 
26219
26165
  const attachment = textures[ i ];
@@ -26298,7 +26244,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26298
26244
 
26299
26245
  const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;
26300
26246
 
26301
- const textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [ renderTarget.texture ];
26247
+ const textures = renderTarget.textures;
26302
26248
 
26303
26249
  for ( let i = 0, il = textures.length; i < il; i ++ ) {
26304
26250
 
@@ -26323,14 +26269,14 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26323
26269
 
26324
26270
  if ( ( isWebGL2 && renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) {
26325
26271
 
26326
- const textures = renderTarget.isWebGLMultipleRenderTargets ? renderTarget.texture : [ renderTarget.texture ];
26272
+ const textures = renderTarget.textures;
26327
26273
  const width = renderTarget.width;
26328
26274
  const height = renderTarget.height;
26329
26275
  let mask = _gl.COLOR_BUFFER_BIT;
26330
26276
  const invalidationArray = [];
26331
26277
  const depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;
26332
26278
  const renderTargetProperties = properties.get( renderTarget );
26333
- const isMultipleRenderTargets = ( renderTarget.isWebGLMultipleRenderTargets === true );
26279
+ const isMultipleRenderTargets = ( textures.length > 1 );
26334
26280
 
26335
26281
  // If MRT we need to remove FBO attachments
26336
26282
  if ( isMultipleRenderTargets ) {
@@ -26514,6 +26460,31 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26514
26460
 
26515
26461
  }
26516
26462
 
26463
+ function getDimensions( image ) {
26464
+
26465
+ if ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) {
26466
+
26467
+ // if intrinsic data are not available, fallback to width/height
26468
+
26469
+ _imageDimensions.width = image.naturalWidth || image.width;
26470
+ _imageDimensions.height = image.naturalHeight || image.height;
26471
+
26472
+ } else if ( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) {
26473
+
26474
+ _imageDimensions.width = image.displayWidth;
26475
+ _imageDimensions.height = image.displayHeight;
26476
+
26477
+ } else {
26478
+
26479
+ _imageDimensions.width = image.width;
26480
+ _imageDimensions.height = image.height;
26481
+
26482
+ }
26483
+
26484
+ return _imageDimensions;
26485
+
26486
+ }
26487
+
26517
26488
  //
26518
26489
 
26519
26490
  this.allocateTextureUnit = allocateTextureUnit;
@@ -28729,6 +28700,9 @@ class WebXRManager extends EventDispatcher {
28729
28700
 
28730
28701
  }
28731
28702
 
28703
+ const _e1 = /*@__PURE__*/ new Euler();
28704
+ const _m1 = /*@__PURE__*/ new Matrix4();
28705
+
28732
28706
  function WebGLMaterials( renderer, properties ) {
28733
28707
 
28734
28708
  function refreshTransformUniform( map, uniform ) {
@@ -28937,12 +28911,30 @@ function WebGLMaterials( renderer, properties ) {
28937
28911
 
28938
28912
  }
28939
28913
 
28940
- const envMap = properties.get( material ).envMap;
28914
+ const materialProperties = properties.get( material );
28915
+
28916
+ const envMap = materialProperties.envMap;
28917
+ const envMapRotation = materialProperties.envMapRotation;
28941
28918
 
28942
28919
  if ( envMap ) {
28943
28920
 
28944
28921
  uniforms.envMap.value = envMap;
28945
28922
 
28923
+ _e1.copy( envMapRotation );
28924
+
28925
+ // accommodate left-handed frame
28926
+ _e1.x *= - 1; _e1.y *= - 1; _e1.z *= - 1;
28927
+
28928
+ if ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) {
28929
+
28930
+ // environment maps which are not cube render targets or PMREMs follow a different convention
28931
+ _e1.y *= - 1;
28932
+ _e1.z *= - 1;
28933
+
28934
+ }
28935
+
28936
+ uniforms.envMapRotation.value.setFromMatrix4( _m1.makeRotationFromEuler( _e1 ) );
28937
+
28946
28938
  uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1;
28947
28939
 
28948
28940
  uniforms.reflectivity.value = material.reflectivity;
@@ -30113,7 +30105,7 @@ class WebGLRenderer {
30113
30105
 
30114
30106
  }
30115
30107
 
30116
- state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor() );
30108
+ state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).round() );
30117
30109
 
30118
30110
  };
30119
30111
 
@@ -30135,7 +30127,7 @@ class WebGLRenderer {
30135
30127
 
30136
30128
  }
30137
30129
 
30138
- state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor() );
30130
+ state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).round() );
30139
30131
 
30140
30132
  };
30141
30133
 
@@ -31253,6 +31245,7 @@ class WebGLRenderer {
31253
31245
  materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;
31254
31246
  materialProperties.fog = scene.fog;
31255
31247
  materialProperties.envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || materialProperties.environment );
31248
+ materialProperties.envMapRotation = ( materialProperties.environment !== null && material.envMap === null ) ? scene.environmentRotation : material.envMapRotation;
31256
31249
 
31257
31250
  if ( programs === undefined ) {
31258
31251
 
@@ -31365,6 +31358,7 @@ class WebGLRenderer {
31365
31358
  materialProperties.batching = parameters.batching;
31366
31359
  materialProperties.instancing = parameters.instancing;
31367
31360
  materialProperties.instancingColor = parameters.instancingColor;
31361
+ materialProperties.instancingMorph = parameters.instancingMorph;
31368
31362
  materialProperties.skinning = parameters.skinning;
31369
31363
  materialProperties.morphTargets = parameters.morphTargets;
31370
31364
  materialProperties.morphNormals = parameters.morphNormals;
@@ -31478,6 +31472,14 @@ class WebGLRenderer {
31478
31472
 
31479
31473
  needsProgramChange = true;
31480
31474
 
31475
+ } else if ( object.isInstancedMesh && materialProperties.instancingMorph === true && object.morphTexture === null ) {
31476
+
31477
+ needsProgramChange = true;
31478
+
31479
+ } else if ( object.isInstancedMesh && materialProperties.instancingMorph === false && object.morphTexture !== null ) {
31480
+
31481
+ needsProgramChange = true;
31482
+
31481
31483
  } else if ( materialProperties.envMap !== envMap ) {
31482
31484
 
31483
31485
  needsProgramChange = true;
@@ -32123,8 +32125,8 @@ class WebGLRenderer {
32123
32125
 
32124
32126
  }
32125
32127
 
32126
- const width = sourceBox.max.x - sourceBox.min.x + 1;
32127
- const height = sourceBox.max.y - sourceBox.min.y + 1;
32128
+ const width = Math.round( sourceBox.max.x - sourceBox.min.x );
32129
+ const height = Math.round( sourceBox.max.y - sourceBox.min.y );
32128
32130
  const depth = sourceBox.max.z - sourceBox.min.z + 1;
32129
32131
  const glFormat = utils.convert( dstTexture.format );
32130
32132
  const glType = utils.convert( dstTexture.type );
@@ -32171,9 +32173,8 @@ class WebGLRenderer {
32171
32173
 
32172
32174
  } else {
32173
32175
 
32174
- if ( srcTexture.isCompressedArrayTexture ) {
32176
+ if ( dstTexture.isCompressedArrayTexture ) {
32175
32177
 
32176
- console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.' );
32177
32178
  _gl.compressedTexSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data );
32178
32179
 
32179
32180
  } else {
@@ -32262,20 +32263,6 @@ class WebGLRenderer {
32262
32263
 
32263
32264
  }
32264
32265
 
32265
- get outputEncoding() { // @deprecated, r152
32266
-
32267
- console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
32268
- return this.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
32269
-
32270
- }
32271
-
32272
- set outputEncoding( encoding ) { // @deprecated, r152
32273
-
32274
- console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
32275
- this.outputColorSpace = encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
32276
-
32277
- }
32278
-
32279
32266
  get useLegacyLights() { // @deprecated, r155
32280
32267
 
32281
32268
  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.' );
@@ -32379,6 +32366,8 @@ class Scene extends Object3D {
32379
32366
 
32380
32367
  this.backgroundBlurriness = 0;
32381
32368
  this.backgroundIntensity = 1;
32369
+ this.backgroundRotation = new Euler();
32370
+ this.environmentRotation = new Euler();
32382
32371
 
32383
32372
  this.overrideMaterial = null;
32384
32373
 
@@ -32400,6 +32389,8 @@ class Scene extends Object3D {
32400
32389
 
32401
32390
  this.backgroundBlurriness = source.backgroundBlurriness;
32402
32391
  this.backgroundIntensity = source.backgroundIntensity;
32392
+ this.backgroundRotation.copy( source.backgroundRotation );
32393
+ this.environmentRotation.copy( source.environmentRotation );
32403
32394
 
32404
32395
  if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();
32405
32396
 
@@ -32417,6 +32408,9 @@ class Scene extends Object3D {
32417
32408
  if ( this.backgroundBlurriness > 0 ) data.object.backgroundBlurriness = this.backgroundBlurriness;
32418
32409
  if ( this.backgroundIntensity !== 1 ) data.object.backgroundIntensity = this.backgroundIntensity;
32419
32410
 
32411
+ data.object.backgroundRotation = this.backgroundRotation.toArray();
32412
+ data.object.environmentRotation = this.environmentRotation.toArray();
32413
+
32420
32414
  return data;
32421
32415
 
32422
32416
  }
@@ -33960,6 +33954,7 @@ class InstancedMesh extends Mesh {
33960
33954
 
33961
33955
  this.instanceMatrix = new InstancedBufferAttribute( new Float32Array( count * 16 ), 16 );
33962
33956
  this.instanceColor = null;
33957
+ this.morphTexture = null;
33963
33958
 
33964
33959
  this.count = count;
33965
33960
 
@@ -34065,6 +34060,24 @@ class InstancedMesh extends Mesh {
34065
34060
 
34066
34061
  }
34067
34062
 
34063
+ getMorphAt( index, object ) {
34064
+
34065
+ const objectInfluences = object.morphTargetInfluences;
34066
+
34067
+ const array = this.morphTexture.source.data.data;
34068
+
34069
+ const len = objectInfluences.length + 1; // All influences + the baseInfluenceSum
34070
+
34071
+ const dataIndex = index * len + 1; // Skip the baseInfluenceSum at the beginning
34072
+
34073
+ for ( let i = 0; i < objectInfluences.length; i ++ ) {
34074
+
34075
+ objectInfluences[ i ] = array[ dataIndex + i ];
34076
+
34077
+ }
34078
+
34079
+ }
34080
+
34068
34081
  raycast( raycaster, intersects ) {
34069
34082
 
34070
34083
  const matrixWorld = this.matrixWorld;
@@ -34135,6 +34148,38 @@ class InstancedMesh extends Mesh {
34135
34148
 
34136
34149
  }
34137
34150
 
34151
+ setMorphAt( index, object ) {
34152
+
34153
+ const objectInfluences = object.morphTargetInfluences;
34154
+
34155
+ const len = objectInfluences.length + 1; // morphBaseInfluence + all influences
34156
+
34157
+ if ( this.morphTexture === null ) {
34158
+
34159
+ this.morphTexture = new DataTexture( new Float32Array( len * this.count ), len, this.count, RedFormat, FloatType );
34160
+
34161
+ }
34162
+
34163
+ const array = this.morphTexture.source.data.data;
34164
+
34165
+ let morphInfluencesSum = 0;
34166
+
34167
+ for ( let i = 0; i < objectInfluences.length; i ++ ) {
34168
+
34169
+ morphInfluencesSum += objectInfluences[ i ];
34170
+
34171
+ }
34172
+
34173
+ const morphBaseInfluence = this.geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
34174
+
34175
+ const dataIndex = len * index;
34176
+
34177
+ array[ dataIndex ] = morphBaseInfluence;
34178
+
34179
+ array.set( objectInfluences, dataIndex + 1 );
34180
+
34181
+ }
34182
+
34138
34183
  updateMorphTargets() {
34139
34184
 
34140
34185
  }
@@ -34205,7 +34250,7 @@ class MultiDrawRenderList {
34205
34250
  }
34206
34251
 
34207
34252
  const ID_ATTR_NAME = 'batchId';
34208
- const _matrix = /*@__PURE__*/ new Matrix4();
34253
+ const _matrix$1 = /*@__PURE__*/ new Matrix4();
34209
34254
  const _invMatrixWorld = /*@__PURE__*/ new Matrix4();
34210
34255
  const _identityMatrix = /*@__PURE__*/ new Matrix4();
34211
34256
  const _projScreenMatrix$2 = /*@__PURE__*/ new Matrix4();
@@ -34428,8 +34473,8 @@ class BatchedMesh extends Mesh {
34428
34473
 
34429
34474
  if ( active[ i ] === false ) continue;
34430
34475
 
34431
- this.getMatrixAt( i, _matrix );
34432
- this.getBoundingBoxAt( i, _box$1 ).applyMatrix4( _matrix );
34476
+ this.getMatrixAt( i, _matrix$1 );
34477
+ this.getBoundingBoxAt( i, _box$1 ).applyMatrix4( _matrix$1 );
34433
34478
  boundingBox.union( _box$1 );
34434
34479
 
34435
34480
  }
@@ -34453,8 +34498,8 @@ class BatchedMesh extends Mesh {
34453
34498
 
34454
34499
  if ( active[ i ] === false ) continue;
34455
34500
 
34456
- this.getMatrixAt( i, _matrix );
34457
- this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix );
34501
+ this.getMatrixAt( i, _matrix$1 );
34502
+ this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix$1 );
34458
34503
  boundingSphere.union( _sphere$2 );
34459
34504
 
34460
34505
  }
@@ -35061,8 +35106,8 @@ class BatchedMesh extends Mesh {
35061
35106
  if ( visibility[ i ] && active[ i ] ) {
35062
35107
 
35063
35108
  // get the bounds in world space
35064
- this.getMatrixAt( i, _matrix );
35065
- this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix );
35109
+ this.getMatrixAt( i, _matrix$1 );
35110
+ this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix$1 );
35066
35111
 
35067
35112
  // determine whether the batched geometry is within the frustum
35068
35113
  let culled = false;
@@ -35119,8 +35164,8 @@ class BatchedMesh extends Mesh {
35119
35164
  if ( perObjectFrustumCulled ) {
35120
35165
 
35121
35166
  // get the bounds in world space
35122
- this.getMatrixAt( i, _matrix );
35123
- this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix );
35167
+ this.getMatrixAt( i, _matrix$1 );
35168
+ this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix$1 );
35124
35169
  culled = ! _frustum.intersectsSphere( _sphere$2 );
35125
35170
 
35126
35171
  }
@@ -36249,9 +36294,9 @@ class EllipseCurve extends Curve {
36249
36294
 
36250
36295
  }
36251
36296
 
36252
- getPoint( t, optionalTarget ) {
36297
+ getPoint( t, optionalTarget = new Vector2() ) {
36253
36298
 
36254
- const point = optionalTarget || new Vector2();
36299
+ const point = optionalTarget;
36255
36300
 
36256
36301
  const twoPi = Math.PI * 2;
36257
36302
  let deltaAngle = this.aEndAngle - this.aStartAngle;
@@ -41908,6 +41953,7 @@ class MeshStandardMaterial extends Material {
41908
41953
  this.alphaMap = null;
41909
41954
 
41910
41955
  this.envMap = null;
41956
+ this.envMapRotation = new Euler();
41911
41957
  this.envMapIntensity = 1.0;
41912
41958
 
41913
41959
  this.wireframe = false;
@@ -41963,6 +42009,7 @@ class MeshStandardMaterial extends Material {
41963
42009
  this.alphaMap = source.alphaMap;
41964
42010
 
41965
42011
  this.envMap = source.envMap;
42012
+ this.envMapRotation.copy( source.envMapRotation );
41966
42013
  this.envMapIntensity = source.envMapIntensity;
41967
42014
 
41968
42015
  this.wireframe = source.wireframe;
@@ -42240,6 +42287,7 @@ class MeshPhongMaterial extends Material {
42240
42287
  this.alphaMap = null;
42241
42288
 
42242
42289
  this.envMap = null;
42290
+ this.envMapRotation = new Euler();
42243
42291
  this.combine = MultiplyOperation;
42244
42292
  this.reflectivity = 1;
42245
42293
  this.refractionRatio = 0.98;
@@ -42293,6 +42341,7 @@ class MeshPhongMaterial extends Material {
42293
42341
  this.alphaMap = source.alphaMap;
42294
42342
 
42295
42343
  this.envMap = source.envMap;
42344
+ this.envMapRotation.copy( source.envMapRotation );
42296
42345
  this.combine = source.combine;
42297
42346
  this.reflectivity = source.reflectivity;
42298
42347
  this.refractionRatio = source.refractionRatio;
@@ -42504,6 +42553,7 @@ class MeshLambertMaterial extends Material {
42504
42553
  this.alphaMap = null;
42505
42554
 
42506
42555
  this.envMap = null;
42556
+ this.envMapRotation = new Euler();
42507
42557
  this.combine = MultiplyOperation;
42508
42558
  this.reflectivity = 1;
42509
42559
  this.refractionRatio = 0.98;
@@ -42555,6 +42605,7 @@ class MeshLambertMaterial extends Material {
42555
42605
  this.alphaMap = source.alphaMap;
42556
42606
 
42557
42607
  this.envMap = source.envMap;
42608
+ this.envMapRotation.copy( source.envMapRotation );
42558
42609
  this.combine = source.combine;
42559
42610
  this.reflectivity = source.reflectivity;
42560
42611
  this.refractionRatio = source.refractionRatio;
@@ -45397,10 +45448,6 @@ class DataTextureLoader extends Loader {
45397
45448
 
45398
45449
  texture.colorSpace = texData.colorSpace;
45399
45450
 
45400
- } else if ( texData.encoding !== undefined ) { // @deprecated, r152
45401
-
45402
- texture.encoding = texData.encoding;
45403
-
45404
45451
  }
45405
45452
 
45406
45453
  if ( texData.flipY !== undefined ) {
@@ -46636,6 +46683,7 @@ class MaterialLoader extends Loader {
46636
46683
  if ( json.specularColorMap !== undefined ) material.specularColorMap = getTexture( json.specularColorMap );
46637
46684
 
46638
46685
  if ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap );
46686
+ if ( json.envMapRotation !== undefined ) material.envMapRotation.fromArray( json.envMapRotation );
46639
46687
  if ( json.envMapIntensity !== undefined ) material.envMapIntensity = json.envMapIntensity;
46640
46688
 
46641
46689
  if ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity;
@@ -47631,7 +47679,6 @@ class ObjectLoader extends Loader {
47631
47679
  if ( data.internalFormat !== undefined ) texture.internalFormat = data.internalFormat;
47632
47680
  if ( data.type !== undefined ) texture.type = data.type;
47633
47681
  if ( data.colorSpace !== undefined ) texture.colorSpace = data.colorSpace;
47634
- if ( data.encoding !== undefined ) texture.encoding = data.encoding; // @deprecated, r152
47635
47682
 
47636
47683
  if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER );
47637
47684
  if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER );
@@ -47770,6 +47817,8 @@ class ObjectLoader extends Loader {
47770
47817
 
47771
47818
  if ( data.backgroundBlurriness !== undefined ) object.backgroundBlurriness = data.backgroundBlurriness;
47772
47819
  if ( data.backgroundIntensity !== undefined ) object.backgroundIntensity = data.backgroundIntensity;
47820
+ if ( data.backgroundRotation !== undefined ) object.backgroundRotation.fromArray( data.backgroundRotation );
47821
+ if ( data.environmentRotation !== undefined ) object.environmentRotation.fromArray( data.environmentRotation );
47773
47822
 
47774
47823
  break;
47775
47824
 
@@ -52278,6 +52327,8 @@ class GLBufferAttribute {
52278
52327
 
52279
52328
  }
52280
52329
 
52330
+ const _matrix = /*@__PURE__*/ new Matrix4();
52331
+
52281
52332
  class Raycaster {
52282
52333
 
52283
52334
  constructor( origin, direction, near = 0, far = Infinity ) {
@@ -52330,9 +52381,20 @@ class Raycaster {
52330
52381
 
52331
52382
  }
52332
52383
 
52384
+ setFromXRController( controller ) {
52385
+
52386
+ _matrix.identity().extractRotation( controller.matrixWorld );
52387
+
52388
+ this.ray.origin.setFromMatrixPosition( controller.matrixWorld );
52389
+ this.ray.direction.set( 0, 0, - 1 ).applyMatrix4( _matrix );
52390
+
52391
+ return this;
52392
+
52393
+ }
52394
+
52333
52395
  intersectObject( object, recursive = true, intersects = [] ) {
52334
52396
 
52335
- intersectObject( object, this, intersects, recursive );
52397
+ intersect( object, this, intersects, recursive );
52336
52398
 
52337
52399
  intersects.sort( ascSort );
52338
52400
 
@@ -52344,7 +52406,7 @@ class Raycaster {
52344
52406
 
52345
52407
  for ( let i = 0, l = objects.length; i < l; i ++ ) {
52346
52408
 
52347
- intersectObject( objects[ i ], this, intersects, recursive );
52409
+ intersect( objects[ i ], this, intersects, recursive );
52348
52410
 
52349
52411
  }
52350
52412
 
@@ -52362,7 +52424,7 @@ function ascSort( a, b ) {
52362
52424
 
52363
52425
  }
52364
52426
 
52365
- function intersectObject( object, raycaster, intersects, recursive ) {
52427
+ function intersect( object, raycaster, intersects, recursive ) {
52366
52428
 
52367
52429
  if ( object.layers.test( raycaster.layers ) ) {
52368
52430
 
@@ -52376,7 +52438,7 @@ function intersectObject( object, raycaster, intersects, recursive ) {
52376
52438
 
52377
52439
  for ( let i = 0, l = children.length; i < l; i ++ ) {
52378
52440
 
52379
- intersectObject( children[ i ], raycaster, intersects, true );
52441
+ intersect( children[ i ], raycaster, intersects, true );
52380
52442
 
52381
52443
  }
52382
52444
 
@@ -52850,7 +52912,6 @@ class SpotLightHelper extends Object3D {
52850
52912
 
52851
52913
  this.light = light;
52852
52914
 
52853
- this.matrix = light.matrixWorld;
52854
52915
  this.matrixAutoUpdate = false;
52855
52916
 
52856
52917
  this.color = color;
@@ -52902,6 +52963,24 @@ class SpotLightHelper extends Object3D {
52902
52963
  this.light.updateWorldMatrix( true, false );
52903
52964
  this.light.target.updateWorldMatrix( true, false );
52904
52965
 
52966
+ // update the local matrix based on the parent and light target transforms
52967
+ if ( this.parent ) {
52968
+
52969
+ this.parent.updateWorldMatrix( true );
52970
+
52971
+ this.matrix
52972
+ .copy( this.parent.matrixWorld )
52973
+ .invert()
52974
+ .multiply( this.light.matrixWorld );
52975
+
52976
+ } else {
52977
+
52978
+ this.matrix.copy( this.light.matrixWorld );
52979
+
52980
+ }
52981
+
52982
+ this.matrixWorld.copy( this.light.matrixWorld );
52983
+
52905
52984
  const coneLength = this.light.distance ? this.light.distance : 1000;
52906
52985
  const coneWidth = coneLength * Math.tan( this.light.angle );
52907
52986
 
@@ -54342,6 +54421,26 @@ class ShapePath {
54342
54421
 
54343
54422
  }
54344
54423
 
54424
+ class WebGLMultipleRenderTargets extends WebGLRenderTarget { // @deprecated, r162
54425
+
54426
+ constructor( width = 1, height = 1, count = 1, options = {} ) {
54427
+
54428
+ console.warn( 'THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.' );
54429
+
54430
+ super( width, height, { ...options, count } );
54431
+
54432
+ this.isWebGLMultipleRenderTargets = true;
54433
+
54434
+ }
54435
+
54436
+ get texture() {
54437
+
54438
+ return this.textures;
54439
+
54440
+ }
54441
+
54442
+ }
54443
+
54345
54444
  if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
54346
54445
 
54347
54446
  __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
@@ -54364,4 +54463,4 @@ if ( typeof window !== 'undefined' ) {
54364
54463
 
54365
54464
  }
54366
54465
 
54367
- export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DisplayP3ColorSpace, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, Float64BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearDisplayP3ColorSpace, LinearEncoding, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, MOUSE, Material, MaterialLoader, MathUtils, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, P3Primaries, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, Rec709Primaries, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderTarget, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingGeometry, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsLib, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoTexture, WebGL1Renderer, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLMultipleRenderTargets, WebGLRenderTarget, WebGLRenderer, WebGLUtils, WebGPUCoordinateSystem, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, _SRGBAFormat, createCanvasElement, sRGBEncoding };
54466
+ export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DisplayP3ColorSpace, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearDisplayP3ColorSpace, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, LuminanceAlphaFormat, LuminanceFormat, MOUSE, Material, MaterialLoader, MathUtils, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, P3Primaries, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RGBADepthPacking, RGBAFormat, RGBAIntegerFormat, RGBA_ASTC_10x10_Format, RGBA_ASTC_10x5_Format, RGBA_ASTC_10x6_Format, RGBA_ASTC_10x8_Format, RGBA_ASTC_12x10_Format, RGBA_ASTC_12x12_Format, RGBA_ASTC_4x4_Format, RGBA_ASTC_5x4_Format, RGBA_ASTC_5x5_Format, RGBA_ASTC_6x5_Format, RGBA_ASTC_6x6_Format, RGBA_ASTC_8x5_Format, RGBA_ASTC_8x6_Format, RGBA_ASTC_8x8_Format, RGBA_BPTC_Format, RGBA_ETC2_EAC_Format, RGBA_PVRTC_2BPPV1_Format, RGBA_PVRTC_4BPPV1_Format, RGBA_S3TC_DXT1_Format, RGBA_S3TC_DXT3_Format, RGBA_S3TC_DXT5_Format, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, Rec709Primaries, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderTarget, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingGeometry, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsLib, UniformsUtils, UnsignedByteType, UnsignedInt248Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoTexture, WebGL1Renderer, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLCubeRenderTarget, WebGLMultipleRenderTargets, WebGLRenderTarget, WebGLRenderer, WebGLUtils, WebGPUCoordinateSystem, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, _SRGBAFormat, createCanvasElement };