super-three 0.160.1 → 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 (225) hide show
  1. package/LICENSE +1 -1
  2. package/build/three.cjs +867 -499
  3. package/build/three.module.js +867 -496
  4. package/build/three.module.min.js +1 -1
  5. package/examples/jsm/Addons.js +5 -1
  6. package/examples/jsm/capabilities/WebGPU.js +13 -9
  7. package/examples/jsm/controls/DragControls.js +91 -30
  8. package/examples/jsm/controls/OrbitControls.js +130 -15
  9. package/examples/jsm/controls/TransformControls.js +6 -6
  10. package/examples/jsm/curves/NURBSUtils.js +59 -4
  11. package/examples/jsm/curves/NURBSVolume.js +62 -0
  12. package/examples/jsm/exporters/GLTFExporter.js +11 -1
  13. package/examples/jsm/exporters/USDZExporter.js +8 -7
  14. package/examples/jsm/helpers/TextureHelper.js +3 -3
  15. package/examples/jsm/interactive/InteractiveGroup.js +15 -25
  16. package/examples/jsm/libs/rhino3dm/rhino3dm.js +1 -8723
  17. package/examples/jsm/libs/rhino3dm/rhino3dm.module.js +1 -8734
  18. package/examples/jsm/libs/rhino3dm/rhino3dm.wasm +0 -0
  19. package/examples/jsm/libs/tween.module.js +32 -14
  20. package/examples/jsm/loaders/3DMLoader.js +57 -64
  21. package/examples/jsm/loaders/DDSLoader.js +1 -0
  22. package/examples/jsm/loaders/KTX2Loader.js +20 -5
  23. package/examples/jsm/loaders/LUT3dlLoader.js +78 -46
  24. package/examples/jsm/loaders/LUTCubeLoader.js +81 -67
  25. package/examples/jsm/loaders/LUTImageLoader.js +3 -2
  26. package/examples/jsm/loaders/MaterialXLoader.js +115 -16
  27. package/examples/jsm/loaders/SVGLoader.js +4 -3
  28. package/examples/jsm/loaders/VOXLoader.js +9 -2
  29. package/examples/jsm/loaders/VRMLLoader.js +7 -3
  30. package/examples/jsm/materials/MeshPostProcessingMaterial.js +144 -0
  31. package/examples/jsm/misc/ProgressiveLightMap.js +1 -0
  32. package/examples/jsm/misc/Timer.js +13 -4
  33. package/examples/jsm/nodes/Nodes.js +24 -11
  34. package/examples/jsm/nodes/accessors/AccessorsUtils.js +10 -0
  35. package/examples/jsm/nodes/accessors/BufferAttributeNode.js +5 -3
  36. package/examples/jsm/nodes/accessors/CameraNode.js +9 -4
  37. package/examples/jsm/nodes/accessors/ClippingNode.js +144 -0
  38. package/examples/jsm/nodes/accessors/CubeTextureNode.js +12 -1
  39. package/examples/jsm/nodes/accessors/MaterialNode.js +2 -2
  40. package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +2 -12
  41. package/examples/jsm/nodes/accessors/MorphNode.js +8 -8
  42. package/examples/jsm/nodes/accessors/ReferenceNode.js +87 -29
  43. package/examples/jsm/nodes/accessors/SkinningNode.js +31 -10
  44. package/examples/jsm/nodes/accessors/StorageBufferNode.js +45 -0
  45. package/examples/jsm/nodes/accessors/TangentNode.js +8 -2
  46. package/examples/jsm/nodes/accessors/TextureNode.js +1 -1
  47. package/examples/jsm/nodes/accessors/TextureStoreNode.js +56 -3
  48. package/examples/jsm/nodes/accessors/UniformsNode.js +140 -0
  49. package/examples/jsm/nodes/accessors/VertexColorNode.js +70 -0
  50. package/examples/jsm/nodes/code/CodeNode.js +6 -0
  51. package/examples/jsm/nodes/core/AssignNode.js +68 -12
  52. package/examples/jsm/nodes/core/AttributeNode.js +1 -1
  53. package/examples/jsm/nodes/core/Node.js +14 -4
  54. package/examples/jsm/nodes/core/NodeBuilder.js +26 -27
  55. package/examples/jsm/nodes/core/NodeFrame.js +18 -10
  56. package/examples/jsm/nodes/core/TempNode.js +1 -1
  57. package/examples/jsm/nodes/core/constants.js +1 -0
  58. package/examples/jsm/nodes/display/AfterImageNode.js +148 -0
  59. package/examples/jsm/nodes/display/AnamorphicNode.js +148 -0
  60. package/examples/jsm/nodes/display/BlendModeNode.js +30 -1
  61. package/examples/jsm/nodes/display/ColorAdjustmentNode.js +3 -0
  62. package/examples/jsm/nodes/display/GaussianBlurNode.js +33 -13
  63. package/examples/jsm/nodes/display/NormalMapNode.js +3 -5
  64. package/examples/jsm/nodes/display/PassNode.js +3 -2
  65. package/examples/jsm/nodes/display/ToneMappingNode.js +46 -3
  66. package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +1 -4
  67. package/examples/jsm/nodes/display/ViewportNode.js +0 -2
  68. package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +4 -4
  69. package/examples/jsm/nodes/fog/FogNode.js +2 -1
  70. package/examples/jsm/nodes/lighting/AmbientLightNode.js +1 -1
  71. package/examples/jsm/nodes/lighting/AnalyticLightNode.js +13 -5
  72. package/examples/jsm/nodes/lighting/LightingContextNode.js +1 -1
  73. package/examples/jsm/nodes/lighting/LightsNode.js +1 -1
  74. package/examples/jsm/nodes/materials/Line2NodeMaterial.js +18 -30
  75. package/examples/jsm/nodes/materials/Materials.js +1 -0
  76. package/examples/jsm/nodes/materials/MeshSSSNodeMaterial.js +84 -0
  77. package/examples/jsm/nodes/materials/NodeMaterial.js +43 -10
  78. package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +1 -7
  79. package/examples/jsm/nodes/math/CondNode.js +42 -7
  80. package/examples/jsm/nodes/math/MathNode.js +32 -2
  81. package/examples/jsm/nodes/math/MathUtils.js +15 -0
  82. package/examples/jsm/nodes/math/OperatorNode.js +13 -5
  83. package/examples/jsm/nodes/math/TriNoise3D.js +71 -0
  84. package/examples/jsm/nodes/shadernode/ShaderNode.js +10 -1
  85. package/examples/jsm/nodes/utils/JoinNode.js +2 -2
  86. package/examples/jsm/nodes/utils/LoopNode.js +5 -3
  87. package/examples/jsm/nodes/utils/ReflectorNode.js +227 -0
  88. package/examples/jsm/nodes/utils/RotateNode.js +68 -0
  89. package/examples/jsm/nodes/utils/RotateUVNode.js +1 -9
  90. package/examples/jsm/nodes/utils/SplitNode.js +4 -4
  91. package/examples/jsm/nodes/utils/StorageArrayElementNode.js +91 -0
  92. package/examples/jsm/objects/GroundedSkybox.js +50 -0
  93. package/examples/jsm/objects/QuadMesh.js +8 -2
  94. package/examples/jsm/objects/Water2.js +8 -8
  95. package/examples/jsm/postprocessing/GTAOPass.js +11 -1
  96. package/examples/jsm/postprocessing/OutputPass.js +2 -0
  97. package/examples/jsm/renderers/common/Backend.js +14 -0
  98. package/examples/jsm/renderers/common/Background.js +2 -2
  99. package/examples/jsm/renderers/common/Bindings.js +1 -1
  100. package/examples/jsm/renderers/common/ClippingContext.js +165 -0
  101. package/examples/jsm/renderers/common/DataMap.js +1 -1
  102. package/examples/jsm/renderers/common/Info.js +25 -1
  103. package/examples/jsm/renderers/common/Pipelines.js +8 -8
  104. package/examples/jsm/renderers/common/PostProcessing.js +2 -2
  105. package/examples/jsm/renderers/common/ProgrammableStage.js +3 -1
  106. package/examples/jsm/renderers/common/RenderContext.js +2 -0
  107. package/examples/jsm/renderers/common/RenderContexts.js +2 -13
  108. package/examples/jsm/renderers/common/RenderObject.js +46 -1
  109. package/examples/jsm/renderers/common/RenderObjects.js +3 -1
  110. package/examples/jsm/renderers/common/Renderer.js +290 -17
  111. package/examples/jsm/renderers/common/StorageBufferAttribute.js +17 -0
  112. package/examples/jsm/renderers/common/StorageInstancedBufferAttribute.js +17 -0
  113. package/examples/jsm/renderers/common/Textures.js +28 -18
  114. package/examples/jsm/renderers/common/UniformsGroup.js +6 -4
  115. package/examples/jsm/renderers/common/nodes/NodeBuilderState.js +2 -1
  116. package/examples/jsm/renderers/common/nodes/NodeStorageBuffer.js +23 -0
  117. package/examples/jsm/renderers/common/nodes/NodeUniformBuffer.js +23 -0
  118. package/examples/jsm/renderers/common/nodes/Nodes.js +5 -2
  119. package/examples/jsm/renderers/webgl/WebGLBackend.js +653 -272
  120. package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +171 -39
  121. package/examples/jsm/renderers/webgl/utils/WebGLAttributeUtils.js +95 -8
  122. package/examples/jsm/renderers/webgl/utils/WebGLConstants.js +11 -0
  123. package/examples/jsm/renderers/webgl/utils/WebGLState.js +197 -0
  124. package/examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js +424 -11
  125. package/examples/jsm/renderers/webgl/utils/WebGLUtils.js +3 -2
  126. package/examples/jsm/renderers/webgl-legacy/nodes/GLSL1NodeBuilder.js +1 -21
  127. package/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodeBuilder.js +2 -2
  128. package/examples/jsm/renderers/webgpu/WebGPUBackend.js +300 -112
  129. package/examples/jsm/renderers/webgpu/WebGPURenderer.js +7 -2
  130. package/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.js +71 -79
  131. package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +15 -1
  132. package/examples/jsm/renderers/webgpu/utils/WebGPUPipelineUtils.js +38 -4
  133. package/examples/jsm/renderers/webgpu/utils/WebGPUTextureUtils.js +87 -14
  134. package/examples/jsm/shaders/OutputShader.js +4 -0
  135. package/examples/jsm/transpiler/AST.js +1 -1
  136. package/examples/jsm/transpiler/GLSLDecoder.js +1 -1
  137. package/examples/jsm/transpiler/ShaderToyDecoder.js +1 -1
  138. package/examples/jsm/transpiler/TSLEncoder.js +1 -1
  139. package/examples/jsm/utils/BufferGeometryUtils.js +23 -27
  140. package/examples/jsm/utils/SkeletonUtils.js +14 -3
  141. package/examples/jsm/utils/SortUtils.js +2 -0
  142. package/examples/jsm/webxr/ARButton.js +12 -2
  143. package/examples/jsm/webxr/VRButton.js +25 -7
  144. package/examples/jsm/webxr/XRButton.js +12 -3
  145. package/examples/jsm/webxr/XRControllerModelFactory.js +14 -1
  146. package/examples/jsm/webxr/XRHandMeshModel.js +3 -1
  147. package/package.json +5 -4
  148. package/src/Three.Legacy.js +20 -0
  149. package/src/Three.js +0 -1
  150. package/src/audio/Audio.js +1 -3
  151. package/src/cameras/PerspectiveCamera.js +35 -0
  152. package/src/constants.js +2 -6
  153. package/src/core/BufferAttribute.js +2 -12
  154. package/src/core/BufferGeometry.js +23 -29
  155. package/src/core/InterleavedBuffer.js +2 -1
  156. package/src/core/InterleavedBufferAttribute.js +20 -0
  157. package/src/core/Object3D.js +11 -0
  158. package/src/core/Raycaster.js +18 -4
  159. package/src/core/RenderTarget.js +44 -21
  160. package/src/extras/PMREMGenerator.js +2 -0
  161. package/src/extras/curves/EllipseCurve.js +2 -2
  162. package/src/helpers/SpotLightHelper.js +18 -1
  163. package/src/loaders/DataTextureLoader.js +0 -4
  164. package/src/loaders/MaterialLoader.js +1 -0
  165. package/src/loaders/ObjectLoader.js +2 -1
  166. package/src/materials/Material.js +2 -1
  167. package/src/materials/MeshBasicMaterial.js +3 -0
  168. package/src/materials/MeshLambertMaterial.js +3 -0
  169. package/src/materials/MeshPhongMaterial.js +3 -0
  170. package/src/materials/MeshStandardMaterial.js +3 -0
  171. package/src/materials/ShaderMaterial.js +2 -1
  172. package/src/math/Quaternion.js +13 -12
  173. package/src/math/Triangle.js +0 -30
  174. package/src/math/Vector3.js +7 -7
  175. package/src/objects/BatchedMesh.js +6 -7
  176. package/src/objects/InstancedMesh.js +53 -0
  177. package/src/objects/Mesh.js +0 -1
  178. package/src/objects/SkinnedMesh.js +0 -8
  179. package/src/renderers/WebGLCubeRenderTarget.js +1 -10
  180. package/src/renderers/WebGLRenderer.js +20 -23
  181. package/src/renderers/shaders/ShaderChunk/alphatest_fragment.glsl.js +9 -0
  182. package/src/renderers/shaders/ShaderChunk/clipping_planes_fragment.glsl.js +56 -11
  183. package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +1 -0
  184. package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +1 -1
  185. package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +2 -2
  186. package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +1 -1
  187. package/src/renderers/shaders/ShaderChunk/morphinstance_vertex.glsl.js +14 -0
  188. package/src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +11 -2
  189. package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +38 -7
  190. package/src/renderers/shaders/ShaderChunk.js +2 -0
  191. package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +3 -2
  192. package/src/renderers/shaders/ShaderLib/depth.glsl.js +3 -2
  193. package/src/renderers/shaders/ShaderLib/distanceRGBA.glsl.js +3 -2
  194. package/src/renderers/shaders/ShaderLib/linedashed.glsl.js +2 -1
  195. package/src/renderers/shaders/ShaderLib/meshbasic.glsl.js +2 -2
  196. package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +2 -1
  197. package/src/renderers/shaders/ShaderLib/meshmatcap.glsl.js +2 -2
  198. package/src/renderers/shaders/ShaderLib/meshnormal.glsl.js +4 -1
  199. package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +2 -1
  200. package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +2 -1
  201. package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +2 -1
  202. package/src/renderers/shaders/ShaderLib/points.glsl.js +2 -1
  203. package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -0
  204. package/src/renderers/shaders/ShaderLib/sprite.glsl.js +1 -1
  205. package/src/renderers/shaders/ShaderLib.js +2 -1
  206. package/src/renderers/shaders/UniformsLib.js +1 -0
  207. package/src/renderers/webgl/WebGLAttributes.js +2 -2
  208. package/src/renderers/webgl/WebGLBackground.js +18 -0
  209. package/src/renderers/webgl/WebGLCubeMaps.js +1 -1
  210. package/src/renderers/webgl/WebGLMaterials.js +24 -1
  211. package/src/renderers/webgl/WebGLMorphtargets.js +15 -8
  212. package/src/renderers/webgl/WebGLProgram.js +42 -4
  213. package/src/renderers/webgl/WebGLPrograms.js +38 -27
  214. package/src/renderers/webgl/WebGLState.js +11 -21
  215. package/src/renderers/webgl/WebGLTextures.js +170 -66
  216. package/src/renderers/webxr/WebXRDepthSensing.js +105 -0
  217. package/src/renderers/webxr/WebXRManager.js +46 -0
  218. package/src/scenes/Scene.js +8 -0
  219. package/src/textures/Source.js +1 -0
  220. package/src/textures/Texture.js +1 -29
  221. package/build/three.js +0 -54519
  222. package/build/three.min.js +0 -7
  223. package/examples/jsm/nodes/core/ArrayUniformNode.js +0 -26
  224. package/examples/jsm/objects/GroundProjectedSkybox.js +0 -172
  225. 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 = '160';
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 };
@@ -18,7 +18,6 @@ const VSMShadowMap = 3;
18
18
  const FrontSide = 0;
19
19
  const BackSide = 1;
20
20
  const DoubleSide = 2;
21
- const TwoPassDoubleSide = 2; // r149
22
21
  const NoBlending = 0;
23
22
  const NormalBlending = 1;
24
23
  const AdditiveBlending = 2;
@@ -63,6 +62,7 @@ const CineonToneMapping = 3;
63
62
  const ACESFilmicToneMapping = 4;
64
63
  const CustomToneMapping = 5;
65
64
  const AgXToneMapping = 6;
65
+ const NeutralToneMapping = 7;
66
66
  const AttachedBindMode = 'attached';
67
67
  const DetachedBindMode = 'detached';
68
68
 
@@ -154,10 +154,6 @@ const AdditiveAnimationBlendMode = 2501;
154
154
  const TrianglesDrawMode = 0;
155
155
  const TriangleStripDrawMode = 1;
156
156
  const TriangleFanDrawMode = 2;
157
- /** @deprecated Use LinearSRGBColorSpace or NoColorSpace in three.js r152+. */
158
- const LinearEncoding = 3000;
159
- /** @deprecated Use SRGBColorSpace in three.js r152+. */
160
- const sRGBEncoding = 3001;
161
157
  const BasicDepthPacking = 3200;
162
158
  const RGBADepthPacking = 3201;
163
159
  const TangentSpaceNormalMap = 0;
@@ -1839,6 +1835,7 @@ class Source {
1839
1835
  this.uuid = generateUUID();
1840
1836
 
1841
1837
  this.data = data;
1838
+ this.dataReady = true;
1842
1839
 
1843
1840
  this.version = 0;
1844
1841
 
@@ -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 = [];
2955
2926
 
2956
- this.texture.flipY = false;
2957
- this.texture.generateMipmaps = options.generateMipmaps;
2958
- this.texture.internalFormat = options.internalFormat;
2927
+ const count = options.count;
2928
+ for ( let i = 0; i < count; i ++ ) {
2929
+
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
 
@@ -8156,7 +8086,7 @@ Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = true;
8156
8086
  const _v0$1 = /*@__PURE__*/ new Vector3();
8157
8087
  const _v1$3 = /*@__PURE__*/ new Vector3();
8158
8088
  const _v2$2 = /*@__PURE__*/ new Vector3();
8159
- const _v3$1 = /*@__PURE__*/ new Vector3();
8089
+ const _v3$2 = /*@__PURE__*/ new Vector3();
8160
8090
 
8161
8091
  const _vab = /*@__PURE__*/ new Vector3();
8162
8092
  const _vac = /*@__PURE__*/ new Vector3();
@@ -8165,8 +8095,6 @@ const _vap = /*@__PURE__*/ new Vector3();
8165
8095
  const _vbp = /*@__PURE__*/ new Vector3();
8166
8096
  const _vcp = /*@__PURE__*/ new Vector3();
8167
8097
 
8168
- let warnedGetUV = false;
8169
-
8170
8098
  class Triangle {
8171
8099
 
8172
8100
  constructor( a = new Vector3(), b = new Vector3(), c = new Vector3() ) {
@@ -8230,33 +8158,19 @@ class Triangle {
8230
8158
  static containsPoint( point, a, b, c ) {
8231
8159
 
8232
8160
  // if the triangle is degenerate then we can't contain a point
8233
- if ( this.getBarycoord( point, a, b, c, _v3$1 ) === null ) {
8161
+ if ( this.getBarycoord( point, a, b, c, _v3$2 ) === null ) {
8234
8162
 
8235
8163
  return false;
8236
8164
 
8237
8165
  }
8238
8166
 
8239
- return ( _v3$1.x >= 0 ) && ( _v3$1.y >= 0 ) && ( ( _v3$1.x + _v3$1.y ) <= 1 );
8240
-
8241
- }
8242
-
8243
- static getUV( point, p1, p2, p3, uv1, uv2, uv3, target ) { // @deprecated, r151
8244
-
8245
- if ( warnedGetUV === false ) {
8246
-
8247
- console.warn( 'THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().' );
8248
-
8249
- warnedGetUV = true;
8250
-
8251
- }
8252
-
8253
- return this.getInterpolation( point, p1, p2, p3, uv1, uv2, uv3, target );
8167
+ return ( _v3$2.x >= 0 ) && ( _v3$2.y >= 0 ) && ( ( _v3$2.x + _v3$2.y ) <= 1 );
8254
8168
 
8255
8169
  }
8256
8170
 
8257
8171
  static getInterpolation( point, p1, p2, p3, v1, v2, v3, target ) {
8258
8172
 
8259
- if ( this.getBarycoord( point, p1, p2, p3, _v3$1 ) === null ) {
8173
+ if ( this.getBarycoord( point, p1, p2, p3, _v3$2 ) === null ) {
8260
8174
 
8261
8175
  target.x = 0;
8262
8176
  target.y = 0;
@@ -8267,9 +8181,9 @@ class Triangle {
8267
8181
  }
8268
8182
 
8269
8183
  target.setScalar( 0 );
8270
- target.addScaledVector( v1, _v3$1.x );
8271
- target.addScaledVector( v2, _v3$1.y );
8272
- target.addScaledVector( v3, _v3$1.z );
8184
+ target.addScaledVector( v1, _v3$2.x );
8185
+ target.addScaledVector( v2, _v3$2.y );
8186
+ target.addScaledVector( v3, _v3$2.z );
8273
8187
 
8274
8188
  return target;
8275
8189
 
@@ -8364,20 +8278,6 @@ class Triangle {
8364
8278
 
8365
8279
  }
8366
8280
 
8367
- getUV( point, uv1, uv2, uv3, target ) { // @deprecated, r151
8368
-
8369
- if ( warnedGetUV === false ) {
8370
-
8371
- console.warn( 'THREE.Triangle.getUV() has been renamed to THREE.Triangle.getInterpolation().' );
8372
-
8373
- warnedGetUV = true;
8374
-
8375
- }
8376
-
8377
- return Triangle.getInterpolation( point, this.a, this.b, this.c, uv1, uv2, uv3, target );
8378
-
8379
- }
8380
-
8381
8281
  getInterpolation( point, v1, v2, v3, target ) {
8382
8282
 
8383
8283
  return Triangle.getInterpolation( point, this.a, this.b, this.c, v1, v2, v3, target );
@@ -9296,7 +9196,7 @@ class Material extends EventDispatcher {
9296
9196
  if ( this.sheenColor && this.sheenColor.isColor ) data.sheenColor = this.sheenColor.getHex();
9297
9197
  if ( this.sheenRoughness !== undefined ) data.sheenRoughness = this.sheenRoughness;
9298
9198
  if ( this.emissive && this.emissive.isColor ) data.emissive = this.emissive.getHex();
9299
- if ( this.emissiveIntensity && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;
9199
+ if ( this.emissiveIntensity !== undefined && this.emissiveIntensity !== 1 ) data.emissiveIntensity = this.emissiveIntensity;
9300
9200
 
9301
9201
  if ( this.specular && this.specular.isColor ) data.specular = this.specular.getHex();
9302
9202
  if ( this.specularIntensity !== undefined ) data.specularIntensity = this.specularIntensity;
@@ -9406,6 +9306,7 @@ class Material extends EventDispatcher {
9406
9306
 
9407
9307
  }
9408
9308
 
9309
+ if ( this.envMapRotation !== undefined ) data.envMapRotation = this.envMapRotation.toArray();
9409
9310
  if ( this.envMapIntensity !== undefined ) data.envMapIntensity = this.envMapIntensity;
9410
9311
  if ( this.reflectivity !== undefined ) data.reflectivity = this.reflectivity;
9411
9312
  if ( this.refractionRatio !== undefined ) data.refractionRatio = this.refractionRatio;
@@ -9650,6 +9551,7 @@ class MeshBasicMaterial extends Material {
9650
9551
  this.alphaMap = null;
9651
9552
 
9652
9553
  this.envMap = null;
9554
+ this.envMapRotation = new Euler();
9653
9555
  this.combine = MultiplyOperation;
9654
9556
  this.reflectivity = 1;
9655
9557
  this.refractionRatio = 0.98;
@@ -9684,6 +9586,7 @@ class MeshBasicMaterial extends Material {
9684
9586
  this.alphaMap = source.alphaMap;
9685
9587
 
9686
9588
  this.envMap = source.envMap;
9589
+ this.envMapRotation.copy( source.envMapRotation );
9687
9590
  this.combine = source.combine;
9688
9591
  this.reflectivity = source.reflectivity;
9689
9592
  this.refractionRatio = source.refractionRatio;
@@ -9911,7 +9814,7 @@ class BufferAttribute {
9911
9814
 
9912
9815
  get updateRange() {
9913
9816
 
9914
- console.warn( 'THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
9817
+ warnOnce( 'THREE.BufferAttribute: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
9915
9818
  return this._updateRange;
9916
9819
 
9917
9820
  }
@@ -10488,19 +10391,9 @@ class Float32BufferAttribute extends BufferAttribute {
10488
10391
 
10489
10392
  }
10490
10393
 
10491
- class Float64BufferAttribute extends BufferAttribute {
10492
-
10493
- constructor( array, itemSize, normalized ) {
10494
-
10495
- super( new Float64Array( array ), itemSize, normalized );
10496
-
10497
- }
10498
-
10499
- }
10500
-
10501
10394
  let _id$2 = 0;
10502
10395
 
10503
- const _m1 = /*@__PURE__*/ new Matrix4();
10396
+ const _m1$2 = /*@__PURE__*/ new Matrix4();
10504
10397
  const _obj = /*@__PURE__*/ new Object3D();
10505
10398
  const _offset = /*@__PURE__*/ new Vector3();
10506
10399
  const _box$2 = /*@__PURE__*/ new Box3();
@@ -10666,9 +10559,9 @@ class BufferGeometry extends EventDispatcher {
10666
10559
 
10667
10560
  applyQuaternion( q ) {
10668
10561
 
10669
- _m1.makeRotationFromQuaternion( q );
10562
+ _m1$2.makeRotationFromQuaternion( q );
10670
10563
 
10671
- this.applyMatrix4( _m1 );
10564
+ this.applyMatrix4( _m1$2 );
10672
10565
 
10673
10566
  return this;
10674
10567
 
@@ -10678,9 +10571,9 @@ class BufferGeometry extends EventDispatcher {
10678
10571
 
10679
10572
  // rotate geometry around world x-axis
10680
10573
 
10681
- _m1.makeRotationX( angle );
10574
+ _m1$2.makeRotationX( angle );
10682
10575
 
10683
- this.applyMatrix4( _m1 );
10576
+ this.applyMatrix4( _m1$2 );
10684
10577
 
10685
10578
  return this;
10686
10579
 
@@ -10690,9 +10583,9 @@ class BufferGeometry extends EventDispatcher {
10690
10583
 
10691
10584
  // rotate geometry around world y-axis
10692
10585
 
10693
- _m1.makeRotationY( angle );
10586
+ _m1$2.makeRotationY( angle );
10694
10587
 
10695
- this.applyMatrix4( _m1 );
10588
+ this.applyMatrix4( _m1$2 );
10696
10589
 
10697
10590
  return this;
10698
10591
 
@@ -10702,9 +10595,9 @@ class BufferGeometry extends EventDispatcher {
10702
10595
 
10703
10596
  // rotate geometry around world z-axis
10704
10597
 
10705
- _m1.makeRotationZ( angle );
10598
+ _m1$2.makeRotationZ( angle );
10706
10599
 
10707
- this.applyMatrix4( _m1 );
10600
+ this.applyMatrix4( _m1$2 );
10708
10601
 
10709
10602
  return this;
10710
10603
 
@@ -10714,9 +10607,9 @@ class BufferGeometry extends EventDispatcher {
10714
10607
 
10715
10608
  // translate geometry
10716
10609
 
10717
- _m1.makeTranslation( x, y, z );
10610
+ _m1$2.makeTranslation( x, y, z );
10718
10611
 
10719
- this.applyMatrix4( _m1 );
10612
+ this.applyMatrix4( _m1$2 );
10720
10613
 
10721
10614
  return this;
10722
10615
 
@@ -10726,9 +10619,9 @@ class BufferGeometry extends EventDispatcher {
10726
10619
 
10727
10620
  // scale geometry
10728
10621
 
10729
- _m1.makeScale( x, y, z );
10622
+ _m1$2.makeScale( x, y, z );
10730
10623
 
10731
- this.applyMatrix4( _m1 );
10624
+ this.applyMatrix4( _m1$2 );
10732
10625
 
10733
10626
  return this;
10734
10627
 
@@ -10788,7 +10681,7 @@ class BufferGeometry extends EventDispatcher {
10788
10681
 
10789
10682
  if ( position && position.isGLBufferAttribute ) {
10790
10683
 
10791
- 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 );
10792
10685
 
10793
10686
  this.boundingBox.set(
10794
10687
  new Vector3( - Infinity, - Infinity, - Infinity ),
@@ -10858,7 +10751,7 @@ class BufferGeometry extends EventDispatcher {
10858
10751
 
10859
10752
  if ( position && position.isGLBufferAttribute ) {
10860
10753
 
10861
- 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 );
10862
10755
 
10863
10756
  this.boundingSphere.set( new Vector3(), Infinity );
10864
10757
 
@@ -10975,24 +10868,21 @@ class BufferGeometry extends EventDispatcher {
10975
10868
 
10976
10869
  }
10977
10870
 
10978
- const indices = index.array;
10979
- const positions = attributes.position.array;
10980
- const normals = attributes.normal.array;
10981
- const uvs = attributes.uv.array;
10982
-
10983
- const nVertices = positions.length / 3;
10871
+ const positionAttribute = attributes.position;
10872
+ const normalAttribute = attributes.normal;
10873
+ const uvAttribute = attributes.uv;
10984
10874
 
10985
10875
  if ( this.hasAttribute( 'tangent' ) === false ) {
10986
10876
 
10987
- this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * nVertices ), 4 ) );
10877
+ this.setAttribute( 'tangent', new BufferAttribute( new Float32Array( 4 * positionAttribute.count ), 4 ) );
10988
10878
 
10989
10879
  }
10990
10880
 
10991
- const tangents = this.getAttribute( 'tangent' ).array;
10881
+ const tangentAttribute = this.getAttribute( 'tangent' );
10992
10882
 
10993
10883
  const tan1 = [], tan2 = [];
10994
10884
 
10995
- for ( let i = 0; i < nVertices; i ++ ) {
10885
+ for ( let i = 0; i < positionAttribute.count; i ++ ) {
10996
10886
 
10997
10887
  tan1[ i ] = new Vector3();
10998
10888
  tan2[ i ] = new Vector3();
@@ -11012,13 +10902,13 @@ class BufferGeometry extends EventDispatcher {
11012
10902
 
11013
10903
  function handleTriangle( a, b, c ) {
11014
10904
 
11015
- vA.fromArray( positions, a * 3 );
11016
- vB.fromArray( positions, b * 3 );
11017
- vC.fromArray( positions, c * 3 );
10905
+ vA.fromBufferAttribute( positionAttribute, a );
10906
+ vB.fromBufferAttribute( positionAttribute, b );
10907
+ vC.fromBufferAttribute( positionAttribute, c );
11018
10908
 
11019
- uvA.fromArray( uvs, a * 2 );
11020
- uvB.fromArray( uvs, b * 2 );
11021
- uvC.fromArray( uvs, c * 2 );
10909
+ uvA.fromBufferAttribute( uvAttribute, a );
10910
+ uvB.fromBufferAttribute( uvAttribute, b );
10911
+ uvC.fromBufferAttribute( uvAttribute, c );
11022
10912
 
11023
10913
  vB.sub( vA );
11024
10914
  vC.sub( vA );
@@ -11051,7 +10941,7 @@ class BufferGeometry extends EventDispatcher {
11051
10941
 
11052
10942
  groups = [ {
11053
10943
  start: 0,
11054
- count: indices.length
10944
+ count: index.count
11055
10945
  } ];
11056
10946
 
11057
10947
  }
@@ -11066,9 +10956,9 @@ class BufferGeometry extends EventDispatcher {
11066
10956
  for ( let j = start, jl = start + count; j < jl; j += 3 ) {
11067
10957
 
11068
10958
  handleTriangle(
11069
- indices[ j + 0 ],
11070
- indices[ j + 1 ],
11071
- indices[ j + 2 ]
10959
+ index.getX( j + 0 ),
10960
+ index.getX( j + 1 ),
10961
+ index.getX( j + 2 )
11072
10962
  );
11073
10963
 
11074
10964
  }
@@ -11080,7 +10970,7 @@ class BufferGeometry extends EventDispatcher {
11080
10970
 
11081
10971
  function handleVertex( v ) {
11082
10972
 
11083
- n.fromArray( normals, v * 3 );
10973
+ n.fromBufferAttribute( normalAttribute, v );
11084
10974
  n2.copy( n );
11085
10975
 
11086
10976
  const t = tan1[ v ];
@@ -11096,10 +10986,7 @@ class BufferGeometry extends EventDispatcher {
11096
10986
  const test = tmp2.dot( tan2[ v ] );
11097
10987
  const w = ( test < 0.0 ) ? - 1.0 : 1.0;
11098
10988
 
11099
- tangents[ v * 4 ] = tmp.x;
11100
- tangents[ v * 4 + 1 ] = tmp.y;
11101
- tangents[ v * 4 + 2 ] = tmp.z;
11102
- tangents[ v * 4 + 3 ] = w;
10989
+ tangentAttribute.setXYZW( v, tmp.x, tmp.y, tmp.z, w );
11103
10990
 
11104
10991
  }
11105
10992
 
@@ -11112,9 +10999,9 @@ class BufferGeometry extends EventDispatcher {
11112
10999
 
11113
11000
  for ( let j = start, jl = start + count; j < jl; j += 3 ) {
11114
11001
 
11115
- handleVertex( indices[ j + 0 ] );
11116
- handleVertex( indices[ j + 1 ] );
11117
- handleVertex( indices[ j + 2 ] );
11002
+ handleVertex( index.getX( j + 0 ) );
11003
+ handleVertex( index.getX( j + 1 ) );
11004
+ handleVertex( index.getX( j + 2 ) );
11118
11005
 
11119
11006
  }
11120
11007
 
@@ -11943,7 +11830,6 @@ function checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, n
11943
11830
  _uvC$1.fromBufferAttribute( uv1, c );
11944
11831
 
11945
11832
  intersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );
11946
- intersection.uv2 = intersection.uv1; // @deprecated, r152
11947
11833
 
11948
11834
  }
11949
11835
 
@@ -12294,7 +12180,8 @@ class ShaderMaterial extends Material {
12294
12180
  fragDepth: false, // set to use fragment depth values
12295
12181
  drawBuffers: false, // set to use draw buffers
12296
12182
  shaderTextureLOD: false, // set to use shader texture LOD
12297
- clipCullDistance: false // set to use vertex shader clipping
12183
+ clipCullDistance: false, // set to use vertex shader clipping
12184
+ multiDraw: false // set to use vertex shader multi_draw / enable gl_DrawID
12298
12185
  };
12299
12186
 
12300
12187
  // When rendered geometry doesn't include these attributes but the material does,
@@ -12506,6 +12393,11 @@ class Camera extends Object3D {
12506
12393
 
12507
12394
  }
12508
12395
 
12396
+ const _v3$1 = /*@__PURE__*/ new Vector3();
12397
+ const _minTarget = /*@__PURE__*/ new Vector2();
12398
+ const _maxTarget = /*@__PURE__*/ new Vector2();
12399
+
12400
+
12509
12401
  class PerspectiveCamera extends Camera {
12510
12402
 
12511
12403
  constructor( fov = 50, aspect = 1, near = 0.1, far = 2000 ) {
@@ -12604,6 +12496,34 @@ class PerspectiveCamera extends Camera {
12604
12496
 
12605
12497
  }
12606
12498
 
12499
+ /**
12500
+ * Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction.
12501
+ * Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle.
12502
+ */
12503
+ getViewBounds( distance, minTarget, maxTarget ) {
12504
+
12505
+ _v3$1.set( - 1, - 1, 0.5 ).applyMatrix4( this.projectionMatrixInverse );
12506
+
12507
+ minTarget.set( _v3$1.x, _v3$1.y ).multiplyScalar( - distance / _v3$1.z );
12508
+
12509
+ _v3$1.set( 1, 1, 0.5 ).applyMatrix4( this.projectionMatrixInverse );
12510
+
12511
+ maxTarget.set( _v3$1.x, _v3$1.y ).multiplyScalar( - distance / _v3$1.z );
12512
+
12513
+ }
12514
+
12515
+ /**
12516
+ * Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.
12517
+ * Copies the result into the target Vector2, where x is width and y is height.
12518
+ */
12519
+ getViewSize( distance, target ) {
12520
+
12521
+ this.getViewBounds( distance, _minTarget, _maxTarget );
12522
+
12523
+ return target.subVectors( _maxTarget, _minTarget );
12524
+
12525
+ }
12526
+
12607
12527
  /**
12608
12528
  * Sets an offset in a larger frustum. This is useful for multi-window or
12609
12529
  * multi-monitor/multi-machine setups.
@@ -12943,14 +12863,6 @@ class WebGLCubeRenderTarget extends WebGLRenderTarget {
12943
12863
  const image = { width: size, height: size, depth: 1 };
12944
12864
  const images = [ image, image, image, image, image, image ];
12945
12865
 
12946
- if ( options.encoding !== undefined ) {
12947
-
12948
- // @deprecated, r152
12949
- warnOnce( 'THREE.WebGLCubeRenderTarget: option.encoding has been replaced by option.colorSpace.' );
12950
- options.colorSpace = options.encoding === sRGBEncoding ? SRGBColorSpace : NoColorSpace;
12951
-
12952
- }
12953
-
12954
12866
  this.texture = new CubeTexture( images, options.mapping, options.wrapS, options.wrapT, options.magFilter, options.minFilter, options.format, options.type, options.anisotropy, options.colorSpace );
12955
12867
 
12956
12868
  // By convention -- likely based on the RenderMan spec from the 1990's -- cube maps are specified by WebGL (and three.js)
@@ -13596,7 +13508,7 @@ function WebGLAttributes( gl, capabilities ) {
13596
13508
  function updateBuffer( buffer, attribute, bufferType ) {
13597
13509
 
13598
13510
  const array = attribute.array;
13599
- const updateRange = attribute._updateRange; // deprecated
13511
+ const updateRange = attribute._updateRange; // @deprecated, r159
13600
13512
  const updateRanges = attribute.updateRanges;
13601
13513
 
13602
13514
  gl.bindBuffer( bufferType, buffer );
@@ -13631,7 +13543,7 @@ function WebGLAttributes( gl, capabilities ) {
13631
13543
 
13632
13544
  }
13633
13545
 
13634
- // deprecated
13546
+ // @deprecated, r159
13635
13547
  if ( updateRange.count !== - 1 ) {
13636
13548
 
13637
13549
  if ( isWebGL2 ) {
@@ -13837,7 +13749,7 @@ var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alp
13837
13749
 
13838
13750
  var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif";
13839
13751
 
13840
- var alphatest_fragment = "#ifdef USE_ALPHATEST\n\tif ( diffuseColor.a < alphaTest ) discard;\n#endif";
13752
+ var alphatest_fragment = "#ifdef USE_ALPHATEST\n\t#ifdef ALPHA_TO_COVERAGE\n\tdiffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );\n\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\tif ( diffuseColor.a < alphaTest ) discard;\n\t#endif\n#endif";
13841
13753
 
13842
13754
  var alphatest_pars_fragment = "#ifdef USE_ALPHATEST\n\tuniform float alphaTest;\n#endif";
13843
13755
 
@@ -13859,7 +13771,7 @@ var iridescence_fragment = "#ifdef USE_IRIDESCENCE\n\tconst mat3 XYZ_TO_REC709 =
13859
13771
 
13860
13772
  var bumpmap_pars_fragment = "#ifdef USE_BUMPMAP\n\tuniform sampler2D bumpMap;\n\tuniform float bumpScale;\n\tvec2 dHdxy_fwd() {\n\t\tvec2 dSTdx = dFdx( vBumpMapUv );\n\t\tvec2 dSTdy = dFdy( vBumpMapUv );\n\t\tfloat Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;\n\t\tfloat dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;\n\t\tfloat dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;\n\t\treturn vec2( dBx, dBy );\n\t}\n\tvec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {\n\t\tvec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );\n\t\tvec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );\n\t\tvec3 vN = surf_norm;\n\t\tvec3 R1 = cross( vSigmaY, vN );\n\t\tvec3 R2 = cross( vN, vSigmaX );\n\t\tfloat fDet = dot( vSigmaX, R1 ) * faceDirection;\n\t\tvec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );\n\t\treturn normalize( abs( fDet ) * surf_norm - vGrad );\n\t}\n#endif";
13861
13773
 
13862
- var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\tplane = clippingPlanes[ i ];\n\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t}\n\t#pragma unroll_loop_end\n\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\tbool clipped = true;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\tif ( clipped ) discard;\n\t#endif\n#endif";
13774
+ var clipping_planes_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tvec4 plane;\n\t#ifdef ALPHA_TO_COVERAGE\n\t\tfloat distanceToPlane, distanceGradient;\n\t\tfloat clipOpacity = 1.0;\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\tclipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\tif ( clipOpacity == 0.0 ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tfloat unionClipOpacity = 1.0;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tdistanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;\n\t\t\t\tdistanceGradient = fwidth( distanceToPlane ) / 2.0;\n\t\t\t\tunionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tclipOpacity *= 1.0 - unionClipOpacity;\n\t\t#endif\n\t\tdiffuseColor.a *= clipOpacity;\n\t\tif ( diffuseColor.a == 0.0 ) discard;\n\t#else\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {\n\t\t\tplane = clippingPlanes[ i ];\n\t\t\tif ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;\n\t\t}\n\t\t#pragma unroll_loop_end\n\t\t#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES\n\t\t\tbool clipped = true;\n\t\t\t#pragma unroll_loop_start\n\t\t\tfor ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {\n\t\t\t\tplane = clippingPlanes[ i ];\n\t\t\t\tclipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;\n\t\t\t}\n\t\t\t#pragma unroll_loop_end\n\t\t\tif ( clipped ) discard;\n\t\t#endif\n\t#endif\n#endif";
13863
13775
 
13864
13776
  var clipping_planes_pars_fragment = "#if NUM_CLIPPING_PLANES > 0\n\tvarying vec3 vClipPosition;\n\tuniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];\n#endif";
13865
13777
 
@@ -13893,9 +13805,9 @@ var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
13893
13805
 
13894
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}";
13895
13807
 
13896
- 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";
13897
13809
 
13898
- 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";
13899
13811
 
13900
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";
13901
13813
 
@@ -13923,7 +13835,7 @@ var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertM
13923
13835
 
13924
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";
13925
13837
 
13926
- 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";
13927
13839
 
13928
13840
  var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
13929
13841
 
@@ -13963,11 +13875,13 @@ var metalnessmap_fragment = "float metalnessFactor = metalness;\n#ifdef USE_META
13963
13875
 
13964
13876
  var metalnessmap_pars_fragment = "#ifdef USE_METALNESSMAP\n\tuniform sampler2D metalnessMap;\n#endif";
13965
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
+
13966
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";
13967
13881
 
13968
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";
13969
13883
 
13970
- 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";
13971
13885
 
13972
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";
13973
13887
 
@@ -14029,7 +13943,7 @@ var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D spe
14029
13943
 
14030
13944
  var tonemapping_fragment = "#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif";
14031
13945
 
14032
- 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 = LINEAR_SRGB_TO_LINEAR_REC2020 * color;\n\tcolor *= toneMappingExposure;\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\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; }";
14033
13947
 
14034
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";
14035
13949
 
@@ -14049,67 +13963,67 @@ const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\n
14049
13963
 
14050
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}";
14051
13965
 
14052
- 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}";
14053
13967
 
14054
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}";
14055
13969
 
14056
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}";
14057
13971
 
14058
- 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}";
14059
13973
 
14060
- 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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\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}";
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}";
14061
13975
 
14062
- 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}";
14063
13977
 
14064
- 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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\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}";
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}";
14065
13979
 
14066
13980
  const vertex$c = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}";
14067
13981
 
14068
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}";
14069
13983
 
14070
- 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}";
14071
13985
 
14072
- 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\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
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}";
14073
13987
 
14074
- 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}";
14075
13989
 
14076
- 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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
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}";
14077
13991
 
14078
- 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}";
14079
13993
 
14080
- 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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
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}";
14081
13995
 
14082
- 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}";
14083
13997
 
14084
- 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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
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}";
14085
13999
 
14086
- 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}";
14087
14001
 
14088
- 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\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 ), opacity );\n\t#ifdef OPAQUE\n\t\tgl_FragColor.a = 1.0;\n\t#endif\n}";
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}";
14089
14003
 
14090
- 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}";
14091
14005
 
14092
- 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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
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}";
14093
14007
 
14094
- 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}";
14095
14009
 
14096
- 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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
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}";
14097
14011
 
14098
- 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}";
14099
14013
 
14100
- 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\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
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}";
14101
14015
 
14102
- 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}";
14103
14017
 
14104
- 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\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\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}";
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}";
14105
14019
 
14106
- 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}";
14107
14021
 
14108
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}";
14109
14023
 
14110
14024
  const vertex$1 = "uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";
14111
14025
 
14112
- const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\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 <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_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}";
14026
+ const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\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 <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_fragment>\n\t#include <alphamap_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}";
14113
14027
 
14114
14028
  const ShaderChunk = {
14115
14029
  alphahash_fragment: alphahash_fragment,
@@ -14179,6 +14093,7 @@ const ShaderChunk = {
14179
14093
  map_particle_pars_fragment: map_particle_pars_fragment,
14180
14094
  metalnessmap_fragment: metalnessmap_fragment,
14181
14095
  metalnessmap_pars_fragment: metalnessmap_pars_fragment,
14096
+ morphinstance_vertex: morphinstance_vertex,
14182
14097
  morphcolor_vertex: morphcolor_vertex,
14183
14098
  morphnormal_vertex: morphnormal_vertex,
14184
14099
  morphtarget_pars_vertex: morphtarget_pars_vertex,
@@ -14287,6 +14202,7 @@ const UniformsLib = {
14287
14202
  envmap: {
14288
14203
 
14289
14204
  envMap: { value: null },
14205
+ envMapRotation: { value: /*@__PURE__*/ new Matrix3() },
14290
14206
  flipEnvMap: { value: - 1 },
14291
14207
  reflectivity: { value: 1.0 }, // basic, lambert, phong
14292
14208
  ior: { value: 1.5 }, // physical
@@ -14707,7 +14623,8 @@ const ShaderLib = {
14707
14623
  envMap: { value: null },
14708
14624
  flipEnvMap: { value: - 1 },
14709
14625
  backgroundBlurriness: { value: 0 },
14710
- backgroundIntensity: { value: 1 }
14626
+ backgroundIntensity: { value: 1 },
14627
+ backgroundRotation: { value: /*@__PURE__*/ new Matrix3() }
14711
14628
  },
14712
14629
 
14713
14630
  vertexShader: ShaderChunk.backgroundCube_vert,
@@ -14831,6 +14748,8 @@ ShaderLib.physical = {
14831
14748
  };
14832
14749
 
14833
14750
  const _rgb = { r: 0, b: 0, g: 0 };
14751
+ const _e1$1 = /*@__PURE__*/ new Euler();
14752
+ const _m1$1 = /*@__PURE__*/ new Matrix4();
14834
14753
 
14835
14754
  function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, premultipliedAlpha ) {
14836
14755
 
@@ -14927,10 +14846,24 @@ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha,
14927
14846
 
14928
14847
  }
14929
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
+
14930
14862
  boxMesh.material.uniforms.envMap.value = background;
14931
14863
  boxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? - 1 : 1;
14932
14864
  boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;
14933
14865
  boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
14866
+ boxMesh.material.uniforms.backgroundRotation.value.setFromMatrix4( _m1$1.makeRotationFromEuler( _e1$1 ) );
14934
14867
  boxMesh.material.toneMapped = ColorManagement.getTransfer( background.colorSpace ) !== SRGBTransfer;
14935
14868
 
14936
14869
  if ( currentBackground !== background ||
@@ -16097,7 +16030,7 @@ function WebGLCubeMaps( renderer ) {
16097
16030
 
16098
16031
  if ( image && image.height > 0 ) {
16099
16032
 
16100
- const renderTarget = new WebGLCubeRenderTarget( image.height / 2 );
16033
+ const renderTarget = new WebGLCubeRenderTarget( image.height );
16101
16034
  renderTarget.fromEquirectangularTexture( renderer, texture );
16102
16035
  cubemaps.set( texture, renderTarget );
16103
16036
 
@@ -16395,6 +16328,7 @@ class PMREMGenerator {
16395
16328
  * Generates a PMREM from an equirectangular texture, which can be either LDR
16396
16329
  * or HDR. The ideal input image size is 1k (1024 x 512),
16397
16330
  * as this matches best with the 256 x 256 cubemap output.
16331
+ * The smallest supported equirectangular image size is 64 x 32.
16398
16332
  */
16399
16333
  fromEquirectangular( equirectangular, renderTarget = null ) {
16400
16334
 
@@ -16406,6 +16340,7 @@ class PMREMGenerator {
16406
16340
  * Generates a PMREM from an cubemap texture, which can be either LDR
16407
16341
  * or HDR. The ideal input cube size is 256 x 256,
16408
16342
  * as this matches best with the 256 x 256 cubemap output.
16343
+ * The smallest supported cube size is 16 x 16.
16409
16344
  */
16410
16345
  fromCubemap( cubemap, renderTarget = null ) {
16411
16346
 
@@ -17913,24 +17848,31 @@ function WebGLMorphtargets( gl, capabilities, textures ) {
17913
17848
  }
17914
17849
 
17915
17850
  //
17851
+ if ( object.isInstancedMesh === true && object.morphTexture !== null ) {
17916
17852
 
17917
- let morphInfluencesSum = 0;
17853
+ program.getUniforms().setValue( gl, 'morphTexture', object.morphTexture, textures );
17918
17854
 
17919
- for ( let i = 0; i < objectInfluences.length; i ++ ) {
17855
+ } else {
17920
17856
 
17921
- morphInfluencesSum += objectInfluences[ i ];
17857
+ let morphInfluencesSum = 0;
17922
17858
 
17923
- }
17859
+ for ( let i = 0; i < objectInfluences.length; i ++ ) {
17924
17860
 
17925
- const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
17861
+ morphInfluencesSum += objectInfluences[ i ];
17862
+
17863
+ }
17864
+
17865
+ const morphBaseInfluence = geometry.morphTargetsRelative ? 1 : 1 - morphInfluencesSum;
17926
17866
 
17927
- program.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence );
17928
- program.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences );
17867
+
17868
+ program.getUniforms().setValue( gl, 'morphTargetBaseInfluence', morphBaseInfluence );
17869
+ program.getUniforms().setValue( gl, 'morphTargetInfluences', objectInfluences );
17870
+
17871
+ }
17929
17872
 
17930
17873
  program.getUniforms().setValue( gl, 'morphTargetsTexture', entry.texture, textures );
17931
17874
  program.getUniforms().setValue( gl, 'morphTargetsTextureSize', entry.size );
17932
17875
 
17933
-
17934
17876
  } else {
17935
17877
 
17936
17878
  // When object doesn't have morph target influences defined, we treat it as a 0-length array
@@ -19576,6 +19518,10 @@ function getToneMappingFunction( functionName, toneMapping ) {
19576
19518
  toneMappingName = 'AgX';
19577
19519
  break;
19578
19520
 
19521
+ case NeutralToneMapping:
19522
+ toneMappingName = 'Neutral';
19523
+ break;
19524
+
19579
19525
  case CustomToneMapping:
19580
19526
  toneMappingName = 'Custom';
19581
19527
  break;
@@ -19593,7 +19539,7 @@ function getToneMappingFunction( functionName, toneMapping ) {
19593
19539
  function generateExtensions( parameters ) {
19594
19540
 
19595
19541
  const chunks = [
19596
- ( parameters.extensionDerivatives || !! parameters.envMapCubeUVHeight || parameters.bumpMap || parameters.normalMapTangentSpace || parameters.clearcoatNormalMap || parameters.flatShading || parameters.shaderID === 'physical' ) ? '#extension GL_OES_standard_derivatives : enable' : '',
19542
+ ( parameters.extensionDerivatives || !! parameters.envMapCubeUVHeight || parameters.bumpMap || parameters.normalMapTangentSpace || parameters.clearcoatNormalMap || parameters.flatShading || parameters.alphaToCoverage || parameters.shaderID === 'physical' ) ? '#extension GL_OES_standard_derivatives : enable' : '',
19597
19543
  ( parameters.extensionFragDepth || parameters.logarithmicDepthBuffer ) && parameters.rendererExtensionFragDepth ? '#extension GL_EXT_frag_depth : enable' : '',
19598
19544
  ( parameters.extensionDrawBuffers && parameters.rendererExtensionDrawBuffers ) ? '#extension GL_EXT_draw_buffers : require' : '',
19599
19545
  ( parameters.extensionShaderTextureLOD || parameters.envMap || parameters.transmission ) && parameters.rendererExtensionShaderTextureLod ? '#extension GL_EXT_shader_texture_lod : enable' : ''
@@ -19606,7 +19552,8 @@ function generateExtensions( parameters ) {
19606
19552
  function generateVertexExtensions( parameters ) {
19607
19553
 
19608
19554
  const chunks = [
19609
- parameters.extensionClipCullDistance ? '#extension GL_ANGLE_clip_cull_distance : require' : ''
19555
+ parameters.extensionClipCullDistance ? '#extension GL_ANGLE_clip_cull_distance : require' : '',
19556
+ parameters.extensionMultiDraw ? '#extension GL_ANGLE_multi_draw : require' : '',
19610
19557
  ];
19611
19558
 
19612
19559
  return chunks.filter( filterEmptyLine ).join( '\n' );
@@ -19765,7 +19712,30 @@ function loopReplacer( match, start, end, snippet ) {
19765
19712
 
19766
19713
  function generatePrecision( parameters ) {
19767
19714
 
19768
- let precisionstring = 'precision ' + parameters.precision + ' float;\nprecision ' + parameters.precision + ' int;';
19715
+ let precisionstring = `precision ${parameters.precision} float;
19716
+ precision ${parameters.precision} int;
19717
+ precision ${parameters.precision} sampler2D;
19718
+ precision ${parameters.precision} samplerCube;
19719
+ `;
19720
+
19721
+ if ( parameters.isWebGL2 ) {
19722
+
19723
+ precisionstring += `precision ${parameters.precision} sampler3D;
19724
+ precision ${parameters.precision} sampler2DArray;
19725
+ precision ${parameters.precision} sampler2DShadow;
19726
+ precision ${parameters.precision} samplerCubeShadow;
19727
+ precision ${parameters.precision} sampler2DArrayShadow;
19728
+ precision ${parameters.precision} isampler2D;
19729
+ precision ${parameters.precision} isampler3D;
19730
+ precision ${parameters.precision} isamplerCube;
19731
+ precision ${parameters.precision} isampler2DArray;
19732
+ precision ${parameters.precision} usampler2D;
19733
+ precision ${parameters.precision} usampler3D;
19734
+ precision ${parameters.precision} usamplerCube;
19735
+ precision ${parameters.precision} usampler2DArray;
19736
+ `;
19737
+
19738
+ }
19769
19739
 
19770
19740
  if ( parameters.precision === 'highp' ) {
19771
19741
 
@@ -19977,6 +19947,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19977
19947
  parameters.batching ? '#define USE_BATCHING' : '',
19978
19948
  parameters.instancing ? '#define USE_INSTANCING' : '',
19979
19949
  parameters.instancingColor ? '#define USE_INSTANCING_COLOR' : '',
19950
+ parameters.instancingMorph ? '#define USE_INSTANCING_MORPH' : '',
19980
19951
 
19981
19952
  parameters.useFog && parameters.fog ? '#define USE_FOG' : '',
19982
19953
  parameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '',
@@ -20108,6 +20079,12 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
20108
20079
 
20109
20080
  '#endif',
20110
20081
 
20082
+ '#ifdef USE_INSTANCING_MORPH',
20083
+
20084
+ ' uniform sampler2D morphTexture;',
20085
+
20086
+ '#endif',
20087
+
20111
20088
  'attribute vec3 position;',
20112
20089
  'attribute vec3 normal;',
20113
20090
  'attribute vec2 uv;',
@@ -20196,6 +20173,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
20196
20173
  parameters.useFog && parameters.fog ? '#define USE_FOG' : '',
20197
20174
  parameters.useFog && parameters.fogExp2 ? '#define FOG_EXP2' : '',
20198
20175
 
20176
+ parameters.alphaToCoverage ? '#define ALPHA_TO_COVERAGE' : '',
20199
20177
  parameters.map ? '#define USE_MAP' : '',
20200
20178
  parameters.matcap ? '#define USE_MATCAP' : '',
20201
20179
  parameters.envMap ? '#define USE_ENVMAP' : '',
@@ -20444,6 +20422,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
20444
20422
  console.error(
20445
20423
  'THREE.WebGLProgram: Shader Error ' + gl.getError() + ' - ' +
20446
20424
  'VALIDATE_STATUS ' + gl.getProgramParameter( program, gl.VALIDATE_STATUS ) + '\n\n' +
20425
+ 'Material Name: ' + self.name + '\n' +
20426
+ 'Material Type: ' + self.type + '\n\n' +
20447
20427
  'Program Info Log: ' + programLog + '\n' +
20448
20428
  vertexErrors + '\n' +
20449
20429
  fragmentErrors
@@ -20708,6 +20688,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20708
20688
 
20709
20689
  const _programLayers = new Layers();
20710
20690
  const _customShaders = new WebGLShaderCache();
20691
+ const _activeChannels = new Set();
20711
20692
  const programs = [];
20712
20693
 
20713
20694
  const IS_WEBGL2 = capabilities.isWebGL2;
@@ -20736,6 +20717,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20736
20717
 
20737
20718
  function getChannel( value ) {
20738
20719
 
20720
+ _activeChannels.add( value );
20721
+
20739
20722
  if ( value === 0 ) return 'uv';
20740
20723
 
20741
20724
  return `uv${ value }`;
@@ -20858,10 +20841,6 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20858
20841
 
20859
20842
  const HAS_EXTENSIONS = !! material.extensions;
20860
20843
 
20861
- const HAS_ATTRIBUTE_UV1 = !! geometry.attributes.uv1;
20862
- const HAS_ATTRIBUTE_UV2 = !! geometry.attributes.uv2;
20863
- const HAS_ATTRIBUTE_UV3 = !! geometry.attributes.uv3;
20864
-
20865
20844
  let toneMapping = NoToneMapping;
20866
20845
 
20867
20846
  if ( material.toneMapped ) {
@@ -20897,10 +20876,12 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20897
20876
  batching: IS_BATCHEDMESH,
20898
20877
  instancing: IS_INSTANCEDMESH,
20899
20878
  instancingColor: IS_INSTANCEDMESH && object.instanceColor !== null,
20879
+ instancingMorph: IS_INSTANCEDMESH && object.morphTexture !== null,
20900
20880
 
20901
20881
  supportsVertexTextures: SUPPORTS_VERTEX_TEXTURES,
20902
20882
  numMultiviewViews: numMultiviewViews,
20903
20883
  outputColorSpace: ( currentRenderTarget === null ) ? renderer.outputColorSpace : ( currentRenderTarget.isXRRenderTarget === true ? currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace ),
20884
+ alphaToCoverage: !! material.alphaToCoverage,
20904
20885
 
20905
20886
  map: HAS_MAP,
20906
20887
  matcap: HAS_MATCAP,
@@ -20946,7 +20927,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20946
20927
 
20947
20928
  gradientMap: HAS_GRADIENTMAP,
20948
20929
 
20949
- opaque: material.transparent === false && material.blending === NormalBlending,
20930
+ opaque: material.transparent === false && material.blending === NormalBlending && material.alphaToCoverage === false,
20950
20931
 
20951
20932
  alphaMap: HAS_ALPHAMAP,
20952
20933
  alphaTest: HAS_ALPHATEST,
@@ -20993,15 +20974,12 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20993
20974
  vertexTangents: !! geometry.attributes.tangent && ( HAS_NORMALMAP || HAS_ANISOTROPY ),
20994
20975
  vertexColors: material.vertexColors,
20995
20976
  vertexAlphas: material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4,
20996
- vertexUv1s: HAS_ATTRIBUTE_UV1,
20997
- vertexUv2s: HAS_ATTRIBUTE_UV2,
20998
- vertexUv3s: HAS_ATTRIBUTE_UV3,
20999
20977
 
21000
20978
  pointsUvs: object.isPoints === true && !! geometry.attributes.uv && ( HAS_MAP || HAS_ALPHAMAP ),
21001
20979
 
21002
20980
  fog: !! fog,
21003
20981
  useFog: material.fog === true,
21004
- fogExp2: ( fog && fog.isFogExp2 ),
20982
+ fogExp2: ( !! fog && fog.isFogExp2 ),
21005
20983
 
21006
20984
  flatShading: material.flatShading === true,
21007
20985
 
@@ -21057,7 +21035,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
21057
21035
  extensionFragDepth: HAS_EXTENSIONS && material.extensions.fragDepth === true,
21058
21036
  extensionDrawBuffers: HAS_EXTENSIONS && material.extensions.drawBuffers === true,
21059
21037
  extensionShaderTextureLOD: HAS_EXTENSIONS && material.extensions.shaderTextureLOD === true,
21060
- extensionClipCullDistance: HAS_EXTENSIONS && material.extensions.clipCullDistance && extensions.has( 'WEBGL_clip_cull_distance' ),
21038
+ extensionClipCullDistance: HAS_EXTENSIONS && material.extensions.clipCullDistance === true && extensions.has( 'WEBGL_clip_cull_distance' ),
21039
+ extensionMultiDraw: HAS_EXTENSIONS && material.extensions.multiDraw === true && extensions.has( 'WEBGL_multi_draw' ),
21061
21040
 
21062
21041
  rendererExtensionFragDepth: IS_WEBGL2 || extensions.has( 'EXT_frag_depth' ),
21063
21042
  rendererExtensionDrawBuffers: IS_WEBGL2 || extensions.has( 'WEBGL_draw_buffers' ),
@@ -21068,6 +21047,14 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
21068
21047
 
21069
21048
  };
21070
21049
 
21050
+ // the usage of getChannel() determines the active texture channels for this shader
21051
+
21052
+ parameters.vertexUv1s = _activeChannels.has( 1 );
21053
+ parameters.vertexUv2s = _activeChannels.has( 2 );
21054
+ parameters.vertexUv3s = _activeChannels.has( 3 );
21055
+
21056
+ _activeChannels.clear();
21057
+
21071
21058
  return parameters;
21072
21059
 
21073
21060
  }
@@ -21177,38 +21164,40 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
21177
21164
  _programLayers.enable( 2 );
21178
21165
  if ( parameters.instancingColor )
21179
21166
  _programLayers.enable( 3 );
21180
- if ( parameters.matcap )
21167
+ if ( parameters.instancingMorph )
21181
21168
  _programLayers.enable( 4 );
21182
- if ( parameters.envMap )
21169
+ if ( parameters.matcap )
21183
21170
  _programLayers.enable( 5 );
21184
- if ( parameters.normalMapObjectSpace )
21171
+ if ( parameters.envMap )
21185
21172
  _programLayers.enable( 6 );
21186
- if ( parameters.normalMapTangentSpace )
21173
+ if ( parameters.normalMapObjectSpace )
21187
21174
  _programLayers.enable( 7 );
21188
- if ( parameters.clearcoat )
21175
+ if ( parameters.normalMapTangentSpace )
21189
21176
  _programLayers.enable( 8 );
21190
- if ( parameters.iridescence )
21177
+ if ( parameters.clearcoat )
21191
21178
  _programLayers.enable( 9 );
21192
- if ( parameters.alphaTest )
21179
+ if ( parameters.iridescence )
21193
21180
  _programLayers.enable( 10 );
21194
- if ( parameters.vertexColors )
21181
+ if ( parameters.alphaTest )
21195
21182
  _programLayers.enable( 11 );
21196
- if ( parameters.vertexAlphas )
21183
+ if ( parameters.vertexColors )
21197
21184
  _programLayers.enable( 12 );
21198
- if ( parameters.vertexUv1s )
21185
+ if ( parameters.vertexAlphas )
21199
21186
  _programLayers.enable( 13 );
21200
- if ( parameters.vertexUv2s )
21187
+ if ( parameters.vertexUv1s )
21201
21188
  _programLayers.enable( 14 );
21202
- if ( parameters.vertexUv3s )
21189
+ if ( parameters.vertexUv2s )
21203
21190
  _programLayers.enable( 15 );
21204
- if ( parameters.vertexTangents )
21191
+ if ( parameters.vertexUv3s )
21205
21192
  _programLayers.enable( 16 );
21206
- if ( parameters.anisotropy )
21193
+ if ( parameters.vertexTangents )
21207
21194
  _programLayers.enable( 17 );
21208
- if ( parameters.alphaHash )
21195
+ if ( parameters.anisotropy )
21209
21196
  _programLayers.enable( 18 );
21210
- if ( parameters.batching )
21197
+ if ( parameters.alphaHash )
21211
21198
  _programLayers.enable( 19 );
21199
+ if ( parameters.batching )
21200
+ _programLayers.enable( 20 );
21212
21201
 
21213
21202
  array.push( _programLayers.mask );
21214
21203
  _programLayers.disableAll();
@@ -21253,8 +21242,10 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
21253
21242
  _programLayers.enable( 18 );
21254
21243
  if ( parameters.decodeVideoTexture )
21255
21244
  _programLayers.enable( 19 );
21256
- if ( parameters.numMultiviewViews )
21245
+ if ( parameters.alphaToCoverage )
21257
21246
  _programLayers.enable( 20 );
21247
+ if ( parameters.numMultiviewViews )
21248
+ _programLayers.enable( 21 );
21258
21249
 
21259
21250
  array.push( _programLayers.mask );
21260
21251
 
@@ -23313,33 +23304,19 @@ function WebGLState( gl, extensions, capabilities ) {
23313
23304
 
23314
23305
  }
23315
23306
 
23316
- if ( renderTarget.isWebGLMultipleRenderTargets ) {
23317
-
23318
- const textures = renderTarget.texture;
23307
+ const textures = renderTarget.textures;
23319
23308
 
23320
- if ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {
23309
+ if ( drawBuffers.length !== textures.length || drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {
23321
23310
 
23322
- for ( let i = 0, il = textures.length; i < il; i ++ ) {
23323
-
23324
- drawBuffers[ i ] = gl.COLOR_ATTACHMENT0 + i;
23325
-
23326
- }
23311
+ for ( let i = 0, il = textures.length; i < il; i ++ ) {
23327
23312
 
23328
- drawBuffers.length = textures.length;
23329
-
23330
- needsUpdate = true;
23313
+ drawBuffers[ i ] = gl.COLOR_ATTACHMENT0 + i;
23331
23314
 
23332
23315
  }
23333
23316
 
23334
- } else {
23335
-
23336
- if ( drawBuffers[ 0 ] !== gl.COLOR_ATTACHMENT0 ) {
23337
-
23338
- drawBuffers[ 0 ] = gl.COLOR_ATTACHMENT0;
23317
+ drawBuffers.length = textures.length;
23339
23318
 
23340
- needsUpdate = true;
23341
-
23342
- }
23319
+ needsUpdate = true;
23343
23320
 
23344
23321
  }
23345
23322
 
@@ -23361,10 +23338,14 @@ function WebGLState( gl, extensions, capabilities ) {
23361
23338
 
23362
23339
  gl.drawBuffers( drawBuffers );
23363
23340
 
23364
- } else {
23341
+ } else if ( extensions.has( 'WEBGL_draw_buffers' ) === true ) {
23365
23342
 
23366
23343
  extensions.get( 'WEBGL_draw_buffers' ).drawBuffersWEBGL( drawBuffers );
23367
23344
 
23345
+ } else {
23346
+
23347
+ throw new Error( 'THREE.WebGLState: Usage of gl.drawBuffers() require WebGL2 or WEBGL_draw_buffers extension' );
23348
+
23368
23349
  }
23369
23350
 
23370
23351
  }
@@ -24152,6 +24133,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24152
24133
  const supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent );
24153
24134
  const multiviewExt = extensions.has( 'OCULUS_multiview' ) ? extensions.get( 'OCULUS_multiview' ) : null;
24154
24135
 
24136
+ const _imageDimensions = new Vector2();
24155
24137
  const _videoTextures = new WeakMap();
24156
24138
  let _canvas;
24157
24139
 
@@ -24192,11 +24174,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24192
24174
 
24193
24175
  let scale = 1;
24194
24176
 
24177
+ const dimensions = getDimensions( image );
24178
+
24195
24179
  // handle case if texture exceeds max size
24196
24180
 
24197
- if ( image.width > maxSize || image.height > maxSize ) {
24181
+ if ( dimensions.width > maxSize || dimensions.height > maxSize ) {
24198
24182
 
24199
- scale = maxSize / Math.max( image.width, image.height );
24183
+ scale = maxSize / Math.max( dimensions.width, dimensions.height );
24200
24184
 
24201
24185
  }
24202
24186
 
@@ -24208,12 +24192,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24208
24192
 
24209
24193
  if ( ( typeof HTMLImageElement !== 'undefined' && image instanceof HTMLImageElement ) ||
24210
24194
  ( typeof HTMLCanvasElement !== 'undefined' && image instanceof HTMLCanvasElement ) ||
24211
- ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ) {
24195
+ ( typeof ImageBitmap !== 'undefined' && image instanceof ImageBitmap ) ||
24196
+ ( typeof VideoFrame !== 'undefined' && image instanceof VideoFrame ) ) {
24212
24197
 
24213
24198
  const floor = needsPowerOfTwo ? floorPowerOfTwo : Math.floor;
24214
24199
 
24215
- const width = floor( scale * image.width );
24216
- const height = floor( scale * image.height );
24200
+ const width = floor( scale * dimensions.width );
24201
+ const height = floor( scale * dimensions.height );
24217
24202
 
24218
24203
  if ( _canvas === undefined ) _canvas = createCanvas( width, height );
24219
24204
 
@@ -24227,7 +24212,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24227
24212
  const context = canvas.getContext( '2d' );
24228
24213
  context.drawImage( image, 0, 0, width, height );
24229
24214
 
24230
- 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 + ').' );
24231
24216
 
24232
24217
  return canvas;
24233
24218
 
@@ -24235,7 +24220,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24235
24220
 
24236
24221
  if ( 'data' in image ) {
24237
24222
 
24238
- 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 + ').' );
24239
24224
 
24240
24225
  }
24241
24226
 
@@ -24251,7 +24236,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24251
24236
 
24252
24237
  function isPowerOfTwo$1( image ) {
24253
24238
 
24254
- return isPowerOfTwo( image.width ) && isPowerOfTwo( image.height );
24239
+ const dimensions = getDimensions( image );
24240
+
24241
+ return isPowerOfTwo( dimensions.width ) && isPowerOfTwo( dimensions.height );
24255
24242
 
24256
24243
  }
24257
24244
 
@@ -24318,6 +24305,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24318
24305
 
24319
24306
  }
24320
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
+
24321
24319
  if ( glFormat === _gl.RGBA ) {
24322
24320
 
24323
24321
  const transfer = forceLinearTransfer ? LinearTransfer : ColorManagement.getTransfer( colorSpace );
@@ -24465,18 +24463,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24465
24463
 
24466
24464
  function deallocateRenderTarget( renderTarget ) {
24467
24465
 
24468
- const texture = renderTarget.texture;
24469
-
24470
24466
  const renderTargetProperties = properties.get( renderTarget );
24471
- const textureProperties = properties.get( texture );
24472
-
24473
- if ( textureProperties.__webglTexture !== undefined ) {
24474
-
24475
- _gl.deleteTexture( textureProperties.__webglTexture );
24476
-
24477
- info.memory.textures --;
24478
-
24479
- }
24480
24467
 
24481
24468
  if ( renderTarget.depthTexture ) {
24482
24469
 
@@ -24531,27 +24518,24 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24531
24518
 
24532
24519
  }
24533
24520
 
24534
- if ( renderTarget.isWebGLMultipleRenderTargets ) {
24535
-
24536
- for ( let i = 0, il = texture.length; i < il; i ++ ) {
24537
-
24538
- const attachmentProperties = properties.get( texture[ i ] );
24521
+ const textures = renderTarget.textures;
24539
24522
 
24540
- if ( attachmentProperties.__webglTexture ) {
24523
+ for ( let i = 0, il = textures.length; i < il; i ++ ) {
24541
24524
 
24542
- _gl.deleteTexture( attachmentProperties.__webglTexture );
24525
+ const attachmentProperties = properties.get( textures[ i ] );
24543
24526
 
24544
- info.memory.textures --;
24527
+ if ( attachmentProperties.__webglTexture ) {
24545
24528
 
24546
- }
24529
+ _gl.deleteTexture( attachmentProperties.__webglTexture );
24547
24530
 
24548
- properties.remove( texture[ i ] );
24531
+ info.memory.textures --;
24549
24532
 
24550
24533
  }
24551
24534
 
24535
+ properties.remove( textures[ i ] );
24536
+
24552
24537
  }
24553
24538
 
24554
- properties.remove( texture );
24555
24539
  properties.remove( renderTarget );
24556
24540
 
24557
24541
  }
@@ -24715,6 +24699,14 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24715
24699
 
24716
24700
  function setTextureParameters( textureType, texture, supportsMips ) {
24717
24701
 
24702
+ if ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false &&
24703
+ ( texture.magFilter === LinearFilter || texture.magFilter === LinearMipmapNearestFilter || texture.magFilter === NearestMipmapLinearFilter || texture.magFilter === LinearMipmapLinearFilter ||
24704
+ texture.minFilter === LinearFilter || texture.minFilter === LinearMipmapNearestFilter || texture.minFilter === NearestMipmapLinearFilter || texture.minFilter === LinearMipmapLinearFilter ) ) {
24705
+
24706
+ console.warn( 'THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.' );
24707
+
24708
+ }
24709
+
24718
24710
  if ( supportsMips ) {
24719
24711
 
24720
24712
  _gl.texParameteri( textureType, _gl.TEXTURE_WRAP_S, wrappingToGL[ texture.wrapS ] );
@@ -24766,8 +24758,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24766
24758
 
24767
24759
  if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {
24768
24760
 
24769
- const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
24770
-
24771
24761
  if ( texture.magFilter === NearestFilter ) return;
24772
24762
  if ( texture.minFilter !== NearestMipmapLinearFilter && texture.minFilter !== LinearMipmapLinearFilter ) return;
24773
24763
  if ( texture.type === FloatType && extensions.has( 'OES_texture_float_linear' ) === false ) return; // verify extension for WebGL 1 and WebGL 2
@@ -24775,6 +24765,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24775
24765
 
24776
24766
  if ( texture.anisotropy > 1 || properties.get( texture ).__currentAnisotropy ) {
24777
24767
 
24768
+ const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
24778
24769
  _gl.texParameterf( textureType, extension.TEXTURE_MAX_ANISOTROPY_EXT, Math.min( texture.anisotropy, capabilities.getMaxAnisotropy() ) );
24779
24770
  properties.get( texture ).__currentAnisotropy = texture.anisotropy;
24780
24771
 
@@ -24945,6 +24936,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
24945
24936
 
24946
24937
  const useTexStorage = ( isWebGL2 && texture.isVideoTexture !== true && glInternalFormat !== RGB_ETC1_Format );
24947
24938
  const allocateMemory = ( sourceProperties.__version === undefined ) || ( forceUpload === true );
24939
+ const dataReady = source.dataReady;
24948
24940
  const levels = getMipLevels( texture, image, supportsMips );
24949
24941
 
24950
24942
  if ( texture.isDepthTexture ) {
@@ -25057,7 +25049,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25057
25049
 
25058
25050
  if ( useTexStorage ) {
25059
25051
 
25060
- state.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );
25052
+ if ( dataReady ) {
25053
+
25054
+ state.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );
25055
+
25056
+ }
25061
25057
 
25062
25058
  } else {
25063
25059
 
@@ -25079,7 +25075,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25079
25075
 
25080
25076
  }
25081
25077
 
25082
- state.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, image.width, image.height, glFormat, glType, image.data );
25078
+ if ( dataReady ) {
25079
+
25080
+ state.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, image.width, image.height, glFormat, glType, image.data );
25081
+
25082
+ }
25083
25083
 
25084
25084
  } else {
25085
25085
 
@@ -25109,7 +25109,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25109
25109
 
25110
25110
  if ( useTexStorage ) {
25111
25111
 
25112
- state.compressedTexSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, mipmap.data, 0, 0 );
25112
+ if ( dataReady ) {
25113
+
25114
+ state.compressedTexSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, mipmap.data, 0, 0 );
25115
+
25116
+ }
25113
25117
 
25114
25118
  } else {
25115
25119
 
@@ -25127,7 +25131,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25127
25131
 
25128
25132
  if ( useTexStorage ) {
25129
25133
 
25130
- state.texSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, glType, mipmap.data );
25134
+ if ( dataReady ) {
25135
+
25136
+ state.texSubImage3D( _gl.TEXTURE_2D_ARRAY, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, glType, mipmap.data );
25137
+
25138
+ }
25131
25139
 
25132
25140
  } else {
25133
25141
 
@@ -25157,7 +25165,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25157
25165
 
25158
25166
  if ( useTexStorage ) {
25159
25167
 
25160
- state.compressedTexSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );
25168
+ if ( dataReady ) {
25169
+
25170
+ state.compressedTexSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );
25171
+
25172
+ }
25161
25173
 
25162
25174
  } else {
25163
25175
 
@@ -25175,7 +25187,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25175
25187
 
25176
25188
  if ( useTexStorage ) {
25177
25189
 
25178
- state.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );
25190
+ if ( dataReady ) {
25191
+
25192
+ state.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );
25193
+
25194
+ }
25179
25195
 
25180
25196
  } else {
25181
25197
 
@@ -25199,7 +25215,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25199
25215
 
25200
25216
  }
25201
25217
 
25202
- state.texSubImage3D( _gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );
25218
+ if ( dataReady ) {
25219
+
25220
+ state.texSubImage3D( _gl.TEXTURE_2D_ARRAY, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );
25221
+
25222
+ }
25203
25223
 
25204
25224
  } else {
25205
25225
 
@@ -25217,7 +25237,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25217
25237
 
25218
25238
  }
25219
25239
 
25220
- state.texSubImage3D( _gl.TEXTURE_3D, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );
25240
+ if ( dataReady ) {
25241
+
25242
+ state.texSubImage3D( _gl.TEXTURE_3D, 0, 0, 0, 0, image.width, image.height, image.depth, glFormat, glType, image.data );
25243
+
25244
+ }
25221
25245
 
25222
25246
  } else {
25223
25247
 
@@ -25262,7 +25286,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25262
25286
 
25263
25287
  if ( useTexStorage && allocateMemory ) {
25264
25288
 
25265
- 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 );
25266
25292
 
25267
25293
  }
25268
25294
 
@@ -25272,7 +25298,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25272
25298
 
25273
25299
  if ( useTexStorage ) {
25274
25300
 
25275
- state.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, glFormat, glType, mipmap );
25301
+ if ( dataReady ) {
25302
+
25303
+ state.texSubImage2D( _gl.TEXTURE_2D, i, 0, 0, glFormat, glType, mipmap );
25304
+
25305
+ }
25276
25306
 
25277
25307
  } else {
25278
25308
 
@@ -25290,11 +25320,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25290
25320
 
25291
25321
  if ( allocateMemory ) {
25292
25322
 
25293
- 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 );
25294
25326
 
25295
25327
  }
25296
25328
 
25297
- state.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, glFormat, glType, image );
25329
+ if ( dataReady ) {
25330
+
25331
+ state.texSubImage2D( _gl.TEXTURE_2D, 0, 0, 0, glFormat, glType, image );
25332
+
25333
+ }
25298
25334
 
25299
25335
  } else {
25300
25336
 
@@ -25376,6 +25412,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25376
25412
 
25377
25413
  const useTexStorage = ( isWebGL2 && texture.isVideoTexture !== true );
25378
25414
  const allocateMemory = ( sourceProperties.__version === undefined ) || ( forceUpload === true );
25415
+ const dataReady = source.dataReady;
25379
25416
  let levels = getMipLevels( texture, image, supportsMips );
25380
25417
 
25381
25418
  setTextureParameters( _gl.TEXTURE_CUBE_MAP, texture, supportsMips );
@@ -25404,7 +25441,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25404
25441
 
25405
25442
  if ( useTexStorage ) {
25406
25443
 
25407
- state.compressedTexSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );
25444
+ if ( dataReady ) {
25445
+
25446
+ state.compressedTexSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );
25447
+
25448
+ }
25408
25449
 
25409
25450
  } else {
25410
25451
 
@@ -25422,7 +25463,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25422
25463
 
25423
25464
  if ( useTexStorage ) {
25424
25465
 
25425
- state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );
25466
+ if ( dataReady ) {
25467
+
25468
+ state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );
25469
+
25470
+ }
25426
25471
 
25427
25472
  } else {
25428
25473
 
@@ -25448,7 +25493,9 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25448
25493
 
25449
25494
  if ( mipmaps.length > 0 ) levels ++;
25450
25495
 
25451
- 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 );
25452
25499
 
25453
25500
  }
25454
25501
 
@@ -25458,7 +25505,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25458
25505
 
25459
25506
  if ( useTexStorage ) {
25460
25507
 
25461
- state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, cubeImage[ i ].width, cubeImage[ i ].height, glFormat, glType, cubeImage[ i ].data );
25508
+ if ( dataReady ) {
25509
+
25510
+ state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, cubeImage[ i ].width, cubeImage[ i ].height, glFormat, glType, cubeImage[ i ].data );
25511
+
25512
+ }
25462
25513
 
25463
25514
  } else {
25464
25515
 
@@ -25473,7 +25524,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25473
25524
 
25474
25525
  if ( useTexStorage ) {
25475
25526
 
25476
- state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, mipmapImage.width, mipmapImage.height, glFormat, glType, mipmapImage.data );
25527
+ if ( dataReady ) {
25528
+
25529
+ state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, mipmapImage.width, mipmapImage.height, glFormat, glType, mipmapImage.data );
25530
+
25531
+ }
25477
25532
 
25478
25533
  } else {
25479
25534
 
@@ -25487,7 +25542,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25487
25542
 
25488
25543
  if ( useTexStorage ) {
25489
25544
 
25490
- state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, glFormat, glType, cubeImage[ i ] );
25545
+ if ( dataReady ) {
25546
+
25547
+ state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, 0, 0, glFormat, glType, cubeImage[ i ] );
25548
+
25549
+ }
25491
25550
 
25492
25551
  } else {
25493
25552
 
@@ -25501,7 +25560,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25501
25560
 
25502
25561
  if ( useTexStorage ) {
25503
25562
 
25504
- state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, glFormat, glType, mipmap.image[ i ] );
25563
+ if ( dataReady ) {
25564
+
25565
+ state.texSubImage2D( _gl.TEXTURE_CUBE_MAP_POSITIVE_X + i, j + 1, 0, 0, glFormat, glType, mipmap.image[ i ] );
25566
+
25567
+ }
25505
25568
 
25506
25569
  } else {
25507
25570
 
@@ -25722,7 +25785,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25722
25785
 
25723
25786
  } else {
25724
25787
 
25725
- const textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [ renderTarget.texture ];
25788
+ const textures = renderTarget.textures;
25726
25789
 
25727
25790
  for ( let i = 0; i < textures.length; i ++ ) {
25728
25791
 
@@ -25934,7 +25997,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25934
25997
 
25935
25998
  renderTarget.addEventListener( 'dispose', onRenderTargetDispose );
25936
25999
 
25937
- 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 ) {
25938
26007
 
25939
26008
  if ( textureProperties.__webglTexture === undefined ) {
25940
26009
 
@@ -25947,10 +26016,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25947
26016
 
25948
26017
  }
25949
26018
 
25950
- const isCube = ( renderTarget.isWebGLCubeRenderTarget === true );
25951
- const isMultipleRenderTargets = ( renderTarget.isWebGLMultipleRenderTargets === true );
25952
- const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;
25953
-
25954
26019
  // Setup framebuffer
25955
26020
 
25956
26021
  if ( isCube ) {
@@ -25999,8 +26064,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
25999
26064
 
26000
26065
  if ( capabilities.drawBuffers ) {
26001
26066
 
26002
- const textures = renderTarget.texture;
26003
-
26004
26067
  for ( let i = 0, il = textures.length; i < il; i ++ ) {
26005
26068
 
26006
26069
  const attachmentProperties = properties.get( textures[ i ] );
@@ -26025,8 +26088,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26025
26088
 
26026
26089
  if ( ( isWebGL2 && renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) {
26027
26090
 
26028
- const textures = isMultipleRenderTargets ? texture : [ texture ];
26029
-
26030
26091
  renderTargetProperties.__webglMultisampledFramebuffer = _gl.createFramebuffer();
26031
26092
  renderTargetProperties.__webglColorRenderbuffer = [];
26032
26093
 
@@ -26099,8 +26160,6 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26099
26160
 
26100
26161
  } else if ( isMultipleRenderTargets ) {
26101
26162
 
26102
- const textures = renderTarget.texture;
26103
-
26104
26163
  for ( let i = 0, il = textures.length; i < il; i ++ ) {
26105
26164
 
26106
26165
  const attachment = textures[ i ];
@@ -26185,7 +26244,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26185
26244
 
26186
26245
  const supportsMips = isPowerOfTwo$1( renderTarget ) || isWebGL2;
26187
26246
 
26188
- const textures = renderTarget.isWebGLMultipleRenderTargets === true ? renderTarget.texture : [ renderTarget.texture ];
26247
+ const textures = renderTarget.textures;
26189
26248
 
26190
26249
  for ( let i = 0, il = textures.length; i < il; i ++ ) {
26191
26250
 
@@ -26210,14 +26269,14 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26210
26269
 
26211
26270
  if ( ( isWebGL2 && renderTarget.samples > 0 ) && useMultisampledRTT( renderTarget ) === false ) {
26212
26271
 
26213
- const textures = renderTarget.isWebGLMultipleRenderTargets ? renderTarget.texture : [ renderTarget.texture ];
26272
+ const textures = renderTarget.textures;
26214
26273
  const width = renderTarget.width;
26215
26274
  const height = renderTarget.height;
26216
26275
  let mask = _gl.COLOR_BUFFER_BIT;
26217
26276
  const invalidationArray = [];
26218
26277
  const depthStyle = renderTarget.stencilBuffer ? _gl.DEPTH_STENCIL_ATTACHMENT : _gl.DEPTH_ATTACHMENT;
26219
26278
  const renderTargetProperties = properties.get( renderTarget );
26220
- const isMultipleRenderTargets = ( renderTarget.isWebGLMultipleRenderTargets === true );
26279
+ const isMultipleRenderTargets = ( textures.length > 1 );
26221
26280
 
26222
26281
  // If MRT we need to remove FBO attachments
26223
26282
  if ( isMultipleRenderTargets ) {
@@ -26401,6 +26460,31 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
26401
26460
 
26402
26461
  }
26403
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
+
26404
26488
  //
26405
26489
 
26406
26490
  this.allocateTextureUnit = allocateTextureUnit;
@@ -27648,6 +27732,105 @@ class WebXRController {
27648
27732
 
27649
27733
  }
27650
27734
 
27735
+ const _occlusion_vertex = `
27736
+ void main() {
27737
+
27738
+ gl_Position = vec4( position, 1.0 );
27739
+
27740
+ }`;
27741
+
27742
+ const _occlusion_fragment = `
27743
+ uniform sampler2DArray depthColor;
27744
+ uniform float depthWidth;
27745
+ uniform float depthHeight;
27746
+
27747
+ void main() {
27748
+
27749
+ vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
27750
+
27751
+ if ( coord.x >= 1.0 ) {
27752
+
27753
+ gl_FragDepthEXT = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
27754
+
27755
+ } else {
27756
+
27757
+ gl_FragDepthEXT = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
27758
+
27759
+ }
27760
+
27761
+ }`;
27762
+
27763
+ class WebXRDepthSensing {
27764
+
27765
+ constructor() {
27766
+
27767
+ this.texture = null;
27768
+ this.mesh = null;
27769
+
27770
+ this.depthNear = 0;
27771
+ this.depthFar = 0;
27772
+
27773
+ }
27774
+
27775
+ init( renderer, depthData, renderState ) {
27776
+
27777
+ if ( this.texture === null ) {
27778
+
27779
+ const texture = new Texture();
27780
+
27781
+ const texProps = renderer.properties.get( texture );
27782
+ texProps.__webglTexture = depthData.texture;
27783
+
27784
+ if ( ( depthData.depthNear != renderState.depthNear ) || ( depthData.depthFar != renderState.depthFar ) ) {
27785
+
27786
+ this.depthNear = depthData.depthNear;
27787
+ this.depthFar = depthData.depthFar;
27788
+
27789
+ }
27790
+
27791
+ this.texture = texture;
27792
+
27793
+ }
27794
+
27795
+ }
27796
+
27797
+ render( renderer, cameraXR ) {
27798
+
27799
+ if ( this.texture !== null ) {
27800
+
27801
+ if ( this.mesh === null ) {
27802
+
27803
+ const viewport = cameraXR.cameras[ 0 ].viewport;
27804
+ const material = new ShaderMaterial( {
27805
+ extensions: { fragDepth: true },
27806
+ vertexShader: _occlusion_vertex,
27807
+ fragmentShader: _occlusion_fragment,
27808
+ uniforms: {
27809
+ depthColor: { value: this.texture },
27810
+ depthWidth: { value: viewport.z },
27811
+ depthHeight: { value: viewport.w }
27812
+ }
27813
+ } );
27814
+
27815
+ this.mesh = new Mesh( new PlaneGeometry( 20, 20 ), material );
27816
+
27817
+ }
27818
+
27819
+ renderer.render( this.mesh, cameraXR );
27820
+
27821
+ }
27822
+
27823
+ }
27824
+
27825
+ reset() {
27826
+
27827
+ this.texture = null;
27828
+ this.mesh = null;
27829
+
27830
+ }
27831
+
27832
+ }
27833
+
27651
27834
  class WebXRManager extends EventDispatcher {
27652
27835
 
27653
27836
  constructor( renderer, gl, extensions, useMultiview ) {
@@ -27674,7 +27857,10 @@ class WebXRManager extends EventDispatcher {
27674
27857
  let glProjLayer = null;
27675
27858
  let glBaseLayer = null;
27676
27859
  let xrFrame = null;
27860
+
27861
+ const depthSensing = new WebXRDepthSensing();
27677
27862
  const attributes = gl.getContextAttributes();
27863
+
27678
27864
  let initialRenderTarget = null;
27679
27865
  let newRenderTarget = null;
27680
27866
 
@@ -27811,6 +27997,8 @@ class WebXRManager extends EventDispatcher {
27811
27997
  _currentDepthNear = null;
27812
27998
  _currentDepthFar = null;
27813
27999
 
28000
+ depthSensing.reset();
28001
+
27814
28002
  // restore framebuffer/rendering state
27815
28003
 
27816
28004
  renderer.setRenderTarget( initialRenderTarget );
@@ -28218,6 +28406,13 @@ class WebXRManager extends EventDispatcher {
28218
28406
 
28219
28407
  if ( session === null ) return;
28220
28408
 
28409
+ if ( depthSensing.texture !== null ) {
28410
+
28411
+ camera.near = depthSensing.depthNear;
28412
+ camera.far = depthSensing.depthFar;
28413
+
28414
+ }
28415
+
28221
28416
  cameraXR.near = cameraR.near = cameraL.near = camera.near;
28222
28417
  cameraXR.far = cameraR.far = cameraL.far = camera.far;
28223
28418
 
@@ -28233,6 +28428,15 @@ class WebXRManager extends EventDispatcher {
28233
28428
  _currentDepthNear = cameraXR.near;
28234
28429
  _currentDepthFar = cameraXR.far;
28235
28430
 
28431
+ cameraL.near = _currentDepthNear;
28432
+ cameraL.far = _currentDepthFar;
28433
+ cameraR.near = _currentDepthNear;
28434
+ cameraR.far = _currentDepthFar;
28435
+
28436
+ cameraL.updateProjectionMatrix();
28437
+ cameraR.updateProjectionMatrix();
28438
+ camera.updateProjectionMatrix();
28439
+
28236
28440
  }
28237
28441
 
28238
28442
  const cameras = cameraXR.cameras;
@@ -28335,6 +28539,12 @@ class WebXRManager extends EventDispatcher {
28335
28539
 
28336
28540
  };
28337
28541
 
28542
+ this.hasDepthSensing = function () {
28543
+
28544
+ return depthSensing.texture !== null;
28545
+
28546
+ };
28547
+
28338
28548
  // Animation Loop
28339
28549
 
28340
28550
  let onAnimationFrameCallback = null;
@@ -28427,6 +28637,22 @@ class WebXRManager extends EventDispatcher {
28427
28637
 
28428
28638
  }
28429
28639
 
28640
+ //
28641
+
28642
+ const enabledFeatures = session.enabledFeatures;
28643
+
28644
+ if ( enabledFeatures && enabledFeatures.includes( 'depth-sensing' ) ) {
28645
+
28646
+ const depthData = glBinding.getDepthInformation( views[ 0 ] );
28647
+
28648
+ if ( depthData && depthData.isValid && depthData.texture ) {
28649
+
28650
+ depthSensing.init( renderer, depthData, session.renderState );
28651
+
28652
+ }
28653
+
28654
+ }
28655
+
28430
28656
  }
28431
28657
 
28432
28658
  //
@@ -28444,6 +28670,8 @@ class WebXRManager extends EventDispatcher {
28444
28670
 
28445
28671
  }
28446
28672
 
28673
+ depthSensing.render( renderer, cameraXR );
28674
+
28447
28675
  if ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame );
28448
28676
 
28449
28677
  if ( frame.detectedPlanes ) {
@@ -28472,6 +28700,9 @@ class WebXRManager extends EventDispatcher {
28472
28700
 
28473
28701
  }
28474
28702
 
28703
+ const _e1 = /*@__PURE__*/ new Euler();
28704
+ const _m1 = /*@__PURE__*/ new Matrix4();
28705
+
28475
28706
  function WebGLMaterials( renderer, properties ) {
28476
28707
 
28477
28708
  function refreshTransformUniform( map, uniform ) {
@@ -28680,12 +28911,30 @@ function WebGLMaterials( renderer, properties ) {
28680
28911
 
28681
28912
  }
28682
28913
 
28683
- const envMap = properties.get( material ).envMap;
28914
+ const materialProperties = properties.get( material );
28915
+
28916
+ const envMap = materialProperties.envMap;
28917
+ const envMapRotation = materialProperties.envMapRotation;
28684
28918
 
28685
28919
  if ( envMap ) {
28686
28920
 
28687
28921
  uniforms.envMap.value = envMap;
28688
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
+
28689
28938
  uniforms.flipEnvMap.value = ( envMap.isCubeTexture && envMap.isRenderTargetTexture === false ) ? - 1 : 1;
28690
28939
 
28691
28940
  uniforms.reflectivity.value = material.reflectivity;
@@ -29856,7 +30105,7 @@ class WebGLRenderer {
29856
30105
 
29857
30106
  }
29858
30107
 
29859
- state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).floor() );
30108
+ state.viewport( _currentViewport.copy( _viewport ).multiplyScalar( _pixelRatio ).round() );
29860
30109
 
29861
30110
  };
29862
30111
 
@@ -29878,7 +30127,7 @@ class WebGLRenderer {
29878
30127
 
29879
30128
  }
29880
30129
 
29881
- state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).floor() );
30130
+ state.scissor( _currentScissor.copy( _scissor ).multiplyScalar( _pixelRatio ).round() );
29882
30131
 
29883
30132
  };
29884
30133
 
@@ -30574,7 +30823,11 @@ class WebGLRenderer {
30574
30823
 
30575
30824
  //
30576
30825
 
30577
- background.render( currentRenderList, scene );
30826
+ if ( xr.enabled === false || xr.isPresenting === false || xr.hasDepthSensing() === false ) {
30827
+
30828
+ background.render( currentRenderList, scene );
30829
+
30830
+ }
30578
30831
 
30579
30832
  // render scene
30580
30833
 
@@ -30992,6 +31245,7 @@ class WebGLRenderer {
30992
31245
  materialProperties.environment = material.isMeshStandardMaterial ? scene.environment : null;
30993
31246
  materialProperties.fog = scene.fog;
30994
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;
30995
31249
 
30996
31250
  if ( programs === undefined ) {
30997
31251
 
@@ -31104,6 +31358,7 @@ class WebGLRenderer {
31104
31358
  materialProperties.batching = parameters.batching;
31105
31359
  materialProperties.instancing = parameters.instancing;
31106
31360
  materialProperties.instancingColor = parameters.instancingColor;
31361
+ materialProperties.instancingMorph = parameters.instancingMorph;
31107
31362
  materialProperties.skinning = parameters.skinning;
31108
31363
  materialProperties.morphTargets = parameters.morphTargets;
31109
31364
  materialProperties.morphNormals = parameters.morphNormals;
@@ -31217,6 +31472,14 @@ class WebGLRenderer {
31217
31472
 
31218
31473
  needsProgramChange = true;
31219
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
+
31220
31483
  } else if ( materialProperties.envMap !== envMap ) {
31221
31484
 
31222
31485
  needsProgramChange = true;
@@ -31862,8 +32125,8 @@ class WebGLRenderer {
31862
32125
 
31863
32126
  }
31864
32127
 
31865
- const width = sourceBox.max.x - sourceBox.min.x + 1;
31866
- 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 );
31867
32130
  const depth = sourceBox.max.z - sourceBox.min.z + 1;
31868
32131
  const glFormat = utils.convert( dstTexture.format );
31869
32132
  const glType = utils.convert( dstTexture.type );
@@ -31910,9 +32173,8 @@ class WebGLRenderer {
31910
32173
 
31911
32174
  } else {
31912
32175
 
31913
- if ( srcTexture.isCompressedArrayTexture ) {
32176
+ if ( dstTexture.isCompressedArrayTexture ) {
31914
32177
 
31915
- console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.' );
31916
32178
  _gl.compressedTexSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data );
31917
32179
 
31918
32180
  } else {
@@ -32001,20 +32263,6 @@ class WebGLRenderer {
32001
32263
 
32002
32264
  }
32003
32265
 
32004
- get outputEncoding() { // @deprecated, r152
32005
-
32006
- console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
32007
- return this.outputColorSpace === SRGBColorSpace ? sRGBEncoding : LinearEncoding;
32008
-
32009
- }
32010
-
32011
- set outputEncoding( encoding ) { // @deprecated, r152
32012
-
32013
- console.warn( 'THREE.WebGLRenderer: Property .outputEncoding has been removed. Use .outputColorSpace instead.' );
32014
- this.outputColorSpace = encoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
32015
-
32016
- }
32017
-
32018
32266
  get useLegacyLights() { // @deprecated, r155
32019
32267
 
32020
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.' );
@@ -32118,6 +32366,8 @@ class Scene extends Object3D {
32118
32366
 
32119
32367
  this.backgroundBlurriness = 0;
32120
32368
  this.backgroundIntensity = 1;
32369
+ this.backgroundRotation = new Euler();
32370
+ this.environmentRotation = new Euler();
32121
32371
 
32122
32372
  this.overrideMaterial = null;
32123
32373
 
@@ -32139,6 +32389,8 @@ class Scene extends Object3D {
32139
32389
 
32140
32390
  this.backgroundBlurriness = source.backgroundBlurriness;
32141
32391
  this.backgroundIntensity = source.backgroundIntensity;
32392
+ this.backgroundRotation.copy( source.backgroundRotation );
32393
+ this.environmentRotation.copy( source.environmentRotation );
32142
32394
 
32143
32395
  if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();
32144
32396
 
@@ -32156,6 +32408,9 @@ class Scene extends Object3D {
32156
32408
  if ( this.backgroundBlurriness > 0 ) data.object.backgroundBlurriness = this.backgroundBlurriness;
32157
32409
  if ( this.backgroundIntensity !== 1 ) data.object.backgroundIntensity = this.backgroundIntensity;
32158
32410
 
32411
+ data.object.backgroundRotation = this.backgroundRotation.toArray();
32412
+ data.object.environmentRotation = this.environmentRotation.toArray();
32413
+
32159
32414
  return data;
32160
32415
 
32161
32416
  }
@@ -32192,7 +32447,7 @@ class InterleavedBuffer {
32192
32447
 
32193
32448
  get updateRange() {
32194
32449
 
32195
- console.warn( 'THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
32450
+ warnOnce( 'THREE.InterleavedBuffer: updateRange() is deprecated and will be removed in r169. Use addUpdateRange() instead.' ); // @deprecated, r159
32196
32451
  return this._updateRange;
32197
32452
 
32198
32453
  }
@@ -32407,6 +32662,26 @@ class InterleavedBufferAttribute {
32407
32662
 
32408
32663
  }
32409
32664
 
32665
+ getComponent( index, component ) {
32666
+
32667
+ let value = this.array[ index * this.data.stride + this.offset + component ];
32668
+
32669
+ if ( this.normalized ) value = denormalize( value, this.array );
32670
+
32671
+ return value;
32672
+
32673
+ }
32674
+
32675
+ setComponent( index, component, value ) {
32676
+
32677
+ if ( this.normalized ) value = normalize( value, this.array );
32678
+
32679
+ this.data.array[ index * this.data.stride + this.offset + component ] = value;
32680
+
32681
+ return this;
32682
+
32683
+ }
32684
+
32410
32685
  setX( index, x ) {
32411
32686
 
32412
32687
  if ( this.normalized ) x = normalize( x, this.array );
@@ -33322,14 +33597,6 @@ class SkinnedMesh extends Mesh {
33322
33597
 
33323
33598
  }
33324
33599
 
33325
- boneTransform( index, vector ) { // @deprecated, r151
33326
-
33327
- console.warn( 'THREE.SkinnedMesh: .boneTransform() was renamed to .applyBoneTransform() in r151.' );
33328
- return this.applyBoneTransform( index, vector );
33329
-
33330
- }
33331
-
33332
-
33333
33600
  }
33334
33601
 
33335
33602
  class Bone extends Object3D {
@@ -33687,6 +33954,7 @@ class InstancedMesh extends Mesh {
33687
33954
 
33688
33955
  this.instanceMatrix = new InstancedBufferAttribute( new Float32Array( count * 16 ), 16 );
33689
33956
  this.instanceColor = null;
33957
+ this.morphTexture = null;
33690
33958
 
33691
33959
  this.count = count;
33692
33960
 
@@ -33792,6 +34060,24 @@ class InstancedMesh extends Mesh {
33792
34060
 
33793
34061
  }
33794
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
+
33795
34081
  raycast( raycaster, intersects ) {
33796
34082
 
33797
34083
  const matrixWorld = this.matrixWorld;
@@ -33862,6 +34148,38 @@ class InstancedMesh extends Mesh {
33862
34148
 
33863
34149
  }
33864
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
+
33865
34183
  updateMorphTargets() {
33866
34184
 
33867
34185
  }
@@ -33932,7 +34250,7 @@ class MultiDrawRenderList {
33932
34250
  }
33933
34251
 
33934
34252
  const ID_ATTR_NAME = 'batchId';
33935
- const _matrix = /*@__PURE__*/ new Matrix4();
34253
+ const _matrix$1 = /*@__PURE__*/ new Matrix4();
33936
34254
  const _invMatrixWorld = /*@__PURE__*/ new Matrix4();
33937
34255
  const _identityMatrix = /*@__PURE__*/ new Matrix4();
33938
34256
  const _projScreenMatrix$2 = /*@__PURE__*/ new Matrix4();
@@ -34155,8 +34473,8 @@ class BatchedMesh extends Mesh {
34155
34473
 
34156
34474
  if ( active[ i ] === false ) continue;
34157
34475
 
34158
- this.getMatrixAt( i, _matrix );
34159
- this.getBoundingBoxAt( i, _box$1 ).applyMatrix4( _matrix );
34476
+ this.getMatrixAt( i, _matrix$1 );
34477
+ this.getBoundingBoxAt( i, _box$1 ).applyMatrix4( _matrix$1 );
34160
34478
  boundingBox.union( _box$1 );
34161
34479
 
34162
34480
  }
@@ -34180,8 +34498,8 @@ class BatchedMesh extends Mesh {
34180
34498
 
34181
34499
  if ( active[ i ] === false ) continue;
34182
34500
 
34183
- this.getMatrixAt( i, _matrix );
34184
- this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix );
34501
+ this.getMatrixAt( i, _matrix$1 );
34502
+ this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix$1 );
34185
34503
  boundingSphere.union( _sphere$2 );
34186
34504
 
34187
34505
  }
@@ -34462,7 +34780,7 @@ class BatchedMesh extends Mesh {
34462
34780
  const active = this._active;
34463
34781
  if ( active[ id ] === false ) {
34464
34782
 
34465
- return this;
34783
+ return null;
34466
34784
 
34467
34785
  }
34468
34786
 
@@ -34505,7 +34823,7 @@ class BatchedMesh extends Mesh {
34505
34823
  const active = this._active;
34506
34824
  if ( active[ id ] === false ) {
34507
34825
 
34508
- return this;
34826
+ return null;
34509
34827
 
34510
34828
  }
34511
34829
 
@@ -34756,6 +35074,7 @@ class BatchedMesh extends Mesh {
34756
35074
  const index = geometry.getIndex();
34757
35075
  const bytesPerElement = index === null ? 1 : index.array.BYTES_PER_ELEMENT;
34758
35076
 
35077
+ const active = this._active;
34759
35078
  const visibility = this._visibility;
34760
35079
  const multiDrawStarts = this._multiDrawStarts;
34761
35080
  const multiDrawCounts = this._multiDrawCounts;
@@ -34770,7 +35089,7 @@ class BatchedMesh extends Mesh {
34770
35089
  .multiply( this.matrixWorld );
34771
35090
  _frustum.setFromProjectionMatrix(
34772
35091
  _projScreenMatrix$2,
34773
- renderer.isWebGPURenderer ? WebGPUCoordinateSystem : WebGLCoordinateSystem
35092
+ renderer.coordinateSystem
34774
35093
  );
34775
35094
 
34776
35095
  }
@@ -34784,11 +35103,11 @@ class BatchedMesh extends Mesh {
34784
35103
 
34785
35104
  for ( let i = 0, l = visibility.length; i < l; i ++ ) {
34786
35105
 
34787
- if ( visibility[ i ] ) {
35106
+ if ( visibility[ i ] && active[ i ] ) {
34788
35107
 
34789
35108
  // get the bounds in world space
34790
- this.getMatrixAt( i, _matrix );
34791
- this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix );
35109
+ this.getMatrixAt( i, _matrix$1 );
35110
+ this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix$1 );
34792
35111
 
34793
35112
  // determine whether the batched geometry is within the frustum
34794
35113
  let culled = false;
@@ -34838,15 +35157,15 @@ class BatchedMesh extends Mesh {
34838
35157
 
34839
35158
  for ( let i = 0, l = visibility.length; i < l; i ++ ) {
34840
35159
 
34841
- if ( visibility[ i ] ) {
35160
+ if ( visibility[ i ] && active[ i ] ) {
34842
35161
 
34843
35162
  // determine whether the batched geometry is within the frustum
34844
35163
  let culled = false;
34845
35164
  if ( perObjectFrustumCulled ) {
34846
35165
 
34847
35166
  // get the bounds in world space
34848
- this.getMatrixAt( i, _matrix );
34849
- this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix );
35167
+ this.getMatrixAt( i, _matrix$1 );
35168
+ this.getBoundingSphereAt( i, _sphere$2 ).applyMatrix4( _matrix$1 );
34850
35169
  culled = ! _frustum.intersectsSphere( _sphere$2 );
34851
35170
 
34852
35171
  }
@@ -35975,9 +36294,9 @@ class EllipseCurve extends Curve {
35975
36294
 
35976
36295
  }
35977
36296
 
35978
- getPoint( t, optionalTarget ) {
36297
+ getPoint( t, optionalTarget = new Vector2() ) {
35979
36298
 
35980
- const point = optionalTarget || new Vector2();
36299
+ const point = optionalTarget;
35981
36300
 
35982
36301
  const twoPi = Math.PI * 2;
35983
36302
  let deltaAngle = this.aEndAngle - this.aStartAngle;
@@ -41634,6 +41953,7 @@ class MeshStandardMaterial extends Material {
41634
41953
  this.alphaMap = null;
41635
41954
 
41636
41955
  this.envMap = null;
41956
+ this.envMapRotation = new Euler();
41637
41957
  this.envMapIntensity = 1.0;
41638
41958
 
41639
41959
  this.wireframe = false;
@@ -41689,6 +42009,7 @@ class MeshStandardMaterial extends Material {
41689
42009
  this.alphaMap = source.alphaMap;
41690
42010
 
41691
42011
  this.envMap = source.envMap;
42012
+ this.envMapRotation.copy( source.envMapRotation );
41692
42013
  this.envMapIntensity = source.envMapIntensity;
41693
42014
 
41694
42015
  this.wireframe = source.wireframe;
@@ -41966,6 +42287,7 @@ class MeshPhongMaterial extends Material {
41966
42287
  this.alphaMap = null;
41967
42288
 
41968
42289
  this.envMap = null;
42290
+ this.envMapRotation = new Euler();
41969
42291
  this.combine = MultiplyOperation;
41970
42292
  this.reflectivity = 1;
41971
42293
  this.refractionRatio = 0.98;
@@ -42019,6 +42341,7 @@ class MeshPhongMaterial extends Material {
42019
42341
  this.alphaMap = source.alphaMap;
42020
42342
 
42021
42343
  this.envMap = source.envMap;
42344
+ this.envMapRotation.copy( source.envMapRotation );
42022
42345
  this.combine = source.combine;
42023
42346
  this.reflectivity = source.reflectivity;
42024
42347
  this.refractionRatio = source.refractionRatio;
@@ -42230,6 +42553,7 @@ class MeshLambertMaterial extends Material {
42230
42553
  this.alphaMap = null;
42231
42554
 
42232
42555
  this.envMap = null;
42556
+ this.envMapRotation = new Euler();
42233
42557
  this.combine = MultiplyOperation;
42234
42558
  this.reflectivity = 1;
42235
42559
  this.refractionRatio = 0.98;
@@ -42281,6 +42605,7 @@ class MeshLambertMaterial extends Material {
42281
42605
  this.alphaMap = source.alphaMap;
42282
42606
 
42283
42607
  this.envMap = source.envMap;
42608
+ this.envMapRotation.copy( source.envMapRotation );
42284
42609
  this.combine = source.combine;
42285
42610
  this.reflectivity = source.reflectivity;
42286
42611
  this.refractionRatio = source.refractionRatio;
@@ -45123,10 +45448,6 @@ class DataTextureLoader extends Loader {
45123
45448
 
45124
45449
  texture.colorSpace = texData.colorSpace;
45125
45450
 
45126
- } else if ( texData.encoding !== undefined ) { // @deprecated, r152
45127
-
45128
- texture.encoding = texData.encoding;
45129
-
45130
45451
  }
45131
45452
 
45132
45453
  if ( texData.flipY !== undefined ) {
@@ -46362,6 +46683,7 @@ class MaterialLoader extends Loader {
46362
46683
  if ( json.specularColorMap !== undefined ) material.specularColorMap = getTexture( json.specularColorMap );
46363
46684
 
46364
46685
  if ( json.envMap !== undefined ) material.envMap = getTexture( json.envMap );
46686
+ if ( json.envMapRotation !== undefined ) material.envMapRotation.fromArray( json.envMapRotation );
46365
46687
  if ( json.envMapIntensity !== undefined ) material.envMapIntensity = json.envMapIntensity;
46366
46688
 
46367
46689
  if ( json.reflectivity !== undefined ) material.reflectivity = json.reflectivity;
@@ -47357,7 +47679,6 @@ class ObjectLoader extends Loader {
47357
47679
  if ( data.internalFormat !== undefined ) texture.internalFormat = data.internalFormat;
47358
47680
  if ( data.type !== undefined ) texture.type = data.type;
47359
47681
  if ( data.colorSpace !== undefined ) texture.colorSpace = data.colorSpace;
47360
- if ( data.encoding !== undefined ) texture.encoding = data.encoding; // @deprecated, r152
47361
47682
 
47362
47683
  if ( data.minFilter !== undefined ) texture.minFilter = parseConstant( data.minFilter, TEXTURE_FILTER );
47363
47684
  if ( data.magFilter !== undefined ) texture.magFilter = parseConstant( data.magFilter, TEXTURE_FILTER );
@@ -47496,6 +47817,8 @@ class ObjectLoader extends Loader {
47496
47817
 
47497
47818
  if ( data.backgroundBlurriness !== undefined ) object.backgroundBlurriness = data.backgroundBlurriness;
47498
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 );
47499
47822
 
47500
47823
  break;
47501
47824
 
@@ -48614,9 +48937,7 @@ class Audio extends Object3D {
48614
48937
 
48615
48938
  this.detune = value;
48616
48939
 
48617
- if ( this.source.detune === undefined ) return; // only set detune when available
48618
-
48619
- if ( this.isPlaying === true ) {
48940
+ if ( this.isPlaying === true && this.source.detune !== undefined ) {
48620
48941
 
48621
48942
  this.source.detune.setTargetAtTime( this.detune, this.context.currentTime, 0.01 );
48622
48943
 
@@ -52006,6 +52327,8 @@ class GLBufferAttribute {
52006
52327
 
52007
52328
  }
52008
52329
 
52330
+ const _matrix = /*@__PURE__*/ new Matrix4();
52331
+
52009
52332
  class Raycaster {
52010
52333
 
52011
52334
  constructor( origin, direction, near = 0, far = Infinity ) {
@@ -52058,9 +52381,20 @@ class Raycaster {
52058
52381
 
52059
52382
  }
52060
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
+
52061
52395
  intersectObject( object, recursive = true, intersects = [] ) {
52062
52396
 
52063
- intersectObject( object, this, intersects, recursive );
52397
+ intersect( object, this, intersects, recursive );
52064
52398
 
52065
52399
  intersects.sort( ascSort );
52066
52400
 
@@ -52072,7 +52406,7 @@ class Raycaster {
52072
52406
 
52073
52407
  for ( let i = 0, l = objects.length; i < l; i ++ ) {
52074
52408
 
52075
- intersectObject( objects[ i ], this, intersects, recursive );
52409
+ intersect( objects[ i ], this, intersects, recursive );
52076
52410
 
52077
52411
  }
52078
52412
 
@@ -52090,7 +52424,7 @@ function ascSort( a, b ) {
52090
52424
 
52091
52425
  }
52092
52426
 
52093
- function intersectObject( object, raycaster, intersects, recursive ) {
52427
+ function intersect( object, raycaster, intersects, recursive ) {
52094
52428
 
52095
52429
  if ( object.layers.test( raycaster.layers ) ) {
52096
52430
 
@@ -52104,7 +52438,7 @@ function intersectObject( object, raycaster, intersects, recursive ) {
52104
52438
 
52105
52439
  for ( let i = 0, l = children.length; i < l; i ++ ) {
52106
52440
 
52107
- intersectObject( children[ i ], raycaster, intersects, true );
52441
+ intersect( children[ i ], raycaster, intersects, true );
52108
52442
 
52109
52443
  }
52110
52444
 
@@ -52578,7 +52912,6 @@ class SpotLightHelper extends Object3D {
52578
52912
 
52579
52913
  this.light = light;
52580
52914
 
52581
- this.matrix = light.matrixWorld;
52582
52915
  this.matrixAutoUpdate = false;
52583
52916
 
52584
52917
  this.color = color;
@@ -52630,6 +52963,24 @@ class SpotLightHelper extends Object3D {
52630
52963
  this.light.updateWorldMatrix( true, false );
52631
52964
  this.light.target.updateWorldMatrix( true, false );
52632
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
+
52633
52984
  const coneLength = this.light.distance ? this.light.distance : 1000;
52634
52985
  const coneWidth = coneLength * Math.tan( this.light.angle );
52635
52986
 
@@ -54070,6 +54421,26 @@ class ShapePath {
54070
54421
 
54071
54422
  }
54072
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
+
54073
54444
  if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
54074
54445
 
54075
54446
  __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
@@ -54092,4 +54463,4 @@ if ( typeof window !== 'undefined' ) {
54092
54463
 
54093
54464
  }
54094
54465
 
54095
- 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, TwoPassDoubleSide, 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 };