super-three 0.144.0 → 0.147.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 (450) hide show
  1. package/README.md +1 -1
  2. package/build/three.cjs +735 -387
  3. package/build/three.js +735 -387
  4. package/build/three.min.js +1 -1
  5. package/build/three.module.js +910 -408
  6. package/examples/js/animation/AnimationClipCreator.js +0 -8
  7. package/examples/js/animation/CCDIKSolver.js +50 -67
  8. package/examples/js/animation/MMDAnimationHelper.js +66 -137
  9. package/examples/js/animation/MMDPhysics.js +70 -134
  10. package/examples/js/cameras/CinematicCamera.js +33 -22
  11. package/examples/js/controls/ArcballControls.js +138 -405
  12. package/examples/js/controls/DragControls.js +8 -33
  13. package/examples/js/controls/FirstPersonControls.js +32 -54
  14. package/examples/js/controls/FlyControls.js +29 -55
  15. package/examples/js/controls/OrbitControls.js +125 -99
  16. package/examples/js/controls/PointerLockControls.js +5 -14
  17. package/examples/js/controls/TrackballControls.js +33 -86
  18. package/examples/js/controls/TransformControls.js +85 -170
  19. package/examples/js/csm/CSM.js +4 -39
  20. package/examples/js/csm/CSMFrustum.js +3 -9
  21. package/examples/js/csm/CSMHelper.js +24 -4
  22. package/examples/js/csm/CSMShader.js +2 -6
  23. package/examples/js/curves/CurveExtras.js +27 -27
  24. package/examples/js/curves/NURBSCurve.js +4 -16
  25. package/examples/js/curves/NURBSSurface.js +3 -9
  26. package/examples/js/curves/NURBSUtils.js +8 -45
  27. package/examples/js/effects/AnaglyphEffect.js +4 -18
  28. package/examples/js/effects/AsciiEffect.js +32 -31
  29. package/examples/js/effects/OutlineEffect.js +26 -30
  30. package/examples/js/effects/ParallaxBarrierEffect.js +0 -13
  31. package/examples/js/effects/PeppersGhostEffect.js +12 -39
  32. package/examples/js/effects/StereoEffect.js +0 -4
  33. package/examples/js/environments/RoomEnvironment.js +12 -10
  34. package/examples/js/exporters/ColladaExporter.js +48 -65
  35. package/examples/js/exporters/DRACOExporter.js +22 -22
  36. package/examples/js/exporters/EXRExporter.js +15 -18
  37. package/examples/js/exporters/GLTFExporter.js +141 -317
  38. package/examples/js/exporters/MMDExporter.js +5 -12
  39. package/examples/js/exporters/OBJExporter.js +42 -33
  40. package/examples/js/exporters/PLYExporter.js +38 -33
  41. package/examples/js/exporters/STLExporter.js +5 -7
  42. package/examples/js/exporters/USDZExporter.js +113 -27
  43. package/examples/js/geometries/BoxLineGeometry.js +0 -1
  44. package/examples/js/geometries/ConvexGeometry.js +11 -6
  45. package/examples/js/geometries/DecalGeometry.js +53 -20
  46. package/examples/js/geometries/LightningStrike.js +54 -67
  47. package/examples/js/geometries/ParametricGeometries.js +8 -7
  48. package/examples/js/geometries/ParametricGeometry.js +25 -12
  49. package/examples/js/geometries/RoundedBoxGeometry.js +21 -19
  50. package/examples/js/geometries/TeapotGeometry.js +54 -50
  51. package/examples/js/geometries/TextGeometry.js +6 -4
  52. package/examples/js/helpers/LightProbeHelper.js +1 -2
  53. package/examples/js/helpers/OctreeHelper.js +22 -20
  54. package/examples/js/helpers/PositionalAudioHelper.js +8 -6
  55. package/examples/js/helpers/RectAreaLightHelper.js +6 -7
  56. package/examples/js/helpers/VertexNormalsHelper.js +15 -13
  57. package/examples/js/helpers/VertexTangentsHelper.js +15 -9
  58. package/examples/js/helpers/ViewHelper.js +31 -16
  59. package/examples/js/interactive/HTMLMesh.js +25 -39
  60. package/examples/js/interactive/InteractiveGroup.js +9 -14
  61. package/examples/js/interactive/SelectionBox.js +3 -70
  62. package/examples/js/interactive/SelectionHelper.js +0 -8
  63. package/examples/js/lights/LightProbeGenerator.js +32 -39
  64. package/examples/js/lights/RectAreaLightUniformsLib.js +5 -1
  65. package/examples/js/lines/LineGeometry.js +3 -5
  66. package/examples/js/lines/LineMaterial.js +4 -11
  67. package/examples/js/lines/LineSegments2.js +40 -89
  68. package/examples/js/lines/LineSegmentsGeometry.js +7 -28
  69. package/examples/js/lines/Wireframe.js +2 -7
  70. package/examples/js/lines/WireframeGeometry2.js +3 -1
  71. package/examples/js/loaders/3DMLoader.js +58 -155
  72. package/examples/js/loaders/3MFLoader.js +72 -106
  73. package/examples/js/loaders/AMFLoader.js +0 -25
  74. package/examples/js/loaders/BVHLoader.js +44 -43
  75. package/examples/js/loaders/BasisTextureLoader.js +16 -46
  76. package/examples/js/loaders/ColladaLoader.js +228 -359
  77. package/examples/js/loaders/DDSLoader.js +24 -25
  78. package/examples/js/loaders/DRACOLoader.js +29 -66
  79. package/examples/js/loaders/EXRLoader.js +67 -164
  80. package/examples/js/loaders/FBXLoader.js +287 -441
  81. package/examples/js/loaders/FontLoader.js +6 -15
  82. package/examples/js/loaders/GCodeLoader.js +15 -16
  83. package/examples/js/loaders/GLTFLoader.js +409 -706
  84. package/examples/js/loaders/HDRCubeTextureLoader.js +0 -6
  85. package/examples/js/loaders/KMZLoader.js +3 -7
  86. package/examples/js/loaders/KTXLoader.js +12 -30
  87. package/examples/js/loaders/LDrawLoader.js +178 -289
  88. package/examples/js/loaders/LUT3dlLoader.js +7 -11
  89. package/examples/js/loaders/LUTCubeLoader.js +0 -8
  90. package/examples/js/loaders/LWOLoader.js +59 -124
  91. package/examples/js/loaders/LogLuvLoader.js +27 -77
  92. package/examples/js/loaders/LottieLoader.js +4 -4
  93. package/examples/js/loaders/MD2Loader.js +26 -27
  94. package/examples/js/loaders/MDDLoader.js +6 -10
  95. package/examples/js/loaders/MMDLoader.js +180 -189
  96. package/examples/js/loaders/MTLLoader.js +18 -47
  97. package/examples/js/loaders/NRRDLoader.js +44 -84
  98. package/examples/js/loaders/OBJLoader.js +50 -65
  99. package/examples/js/loaders/PCDLoader.js +34 -29
  100. package/examples/js/loaders/PDBLoader.js +17 -13
  101. package/examples/js/loaders/PLYLoader.js +62 -48
  102. package/examples/js/loaders/PRWMLoader.js +11 -22
  103. package/examples/js/loaders/PVRLoader.js +7 -16
  104. package/examples/js/loaders/RGBELoader.js +36 -61
  105. package/examples/js/loaders/RGBMLoader.js +26 -87
  106. package/examples/js/loaders/STLLoader.js +20 -27
  107. package/examples/js/loaders/SVGLoader.js +361 -233
  108. package/examples/js/loaders/TDSLoader.js +81 -118
  109. package/examples/js/loaders/TGALoader.js +39 -41
  110. package/examples/js/loaders/TIFFLoader.js +0 -1
  111. package/examples/js/loaders/TTFLoader.js +0 -8
  112. package/examples/js/loaders/TiltLoader.js +14 -15
  113. package/examples/js/loaders/VOXLoader.js +8 -16
  114. package/examples/js/loaders/VRMLLoader.js +243 -340
  115. package/examples/js/loaders/VTKLoader.js +101 -118
  116. package/examples/js/loaders/XYZLoader.js +2 -4
  117. package/examples/js/loaders/lwo/IFFParser.js +55 -136
  118. package/examples/js/loaders/lwo/LWO2Parser.js +32 -83
  119. package/examples/js/loaders/lwo/LWO3Parser.js +31 -73
  120. package/examples/js/materials/MeshGouraudMaterial.js +15 -13
  121. package/examples/js/math/Capsule.js +0 -17
  122. package/examples/js/math/ColorConverter.js +3 -3
  123. package/examples/js/math/ConvexHull.js +185 -141
  124. package/examples/js/math/ImprovedNoise.js +1 -1
  125. package/examples/js/math/Lut.js +8 -15
  126. package/examples/js/math/MeshSurfaceSampler.js +6 -28
  127. package/examples/js/math/OBB.js +90 -49
  128. package/examples/js/math/Octree.js +2 -57
  129. package/examples/js/math/SimplexNoise.js +74 -88
  130. package/examples/js/misc/ConvexObjectBreaker.js +37 -48
  131. package/examples/js/misc/GPUComputationRenderer.js +26 -16
  132. package/examples/js/misc/Gyroscope.js +5 -9
  133. package/examples/js/misc/MD2Character.js +14 -23
  134. package/examples/js/misc/MD2CharacterComplex.js +73 -54
  135. package/examples/js/misc/MorphAnimMesh.js +0 -6
  136. package/examples/js/misc/MorphBlendMesh.js +3 -30
  137. package/examples/js/misc/ProgressiveLightMap.js +47 -43
  138. package/examples/js/misc/RollerCoaster.js +17 -24
  139. package/examples/js/misc/TubePainter.js +18 -12
  140. package/examples/js/misc/Volume.js +16 -45
  141. package/examples/js/misc/VolumeSlice.js +14 -24
  142. package/examples/js/modifiers/CurveModifier.js +19 -21
  143. package/examples/js/modifiers/EdgeSplitModifier.js +0 -30
  144. package/examples/js/modifiers/SimplifyModifier.js +56 -59
  145. package/examples/js/modifiers/TessellateModifier.js +2 -9
  146. package/examples/js/objects/GroundProjectedEnv.js +2 -14
  147. package/examples/js/objects/Lensflare.js +47 -38
  148. package/examples/js/objects/LightningStorm.js +10 -13
  149. package/examples/js/objects/MarchingCubes.js +80 -59
  150. package/examples/js/objects/Reflector.js +22 -20
  151. package/examples/js/objects/ReflectorForSSRPass.js +19 -23
  152. package/examples/js/objects/Refractor.js +52 -30
  153. package/examples/js/objects/ShadowMesh.js +1 -2
  154. package/examples/js/objects/Sky.js +2 -7
  155. package/examples/js/objects/Water.js +23 -18
  156. package/examples/js/objects/Water2.js +20 -19
  157. package/examples/js/physics/AmmoPhysics.js +23 -20
  158. package/examples/js/physics/OimoPhysics.js +19 -17
  159. package/examples/js/postprocessing/AdaptiveToneMappingPass.js +13 -20
  160. package/examples/js/postprocessing/AfterimagePass.js +19 -12
  161. package/examples/js/postprocessing/BloomPass.js +38 -17
  162. package/examples/js/postprocessing/BokehPass.js +29 -12
  163. package/examples/js/postprocessing/ClearPass.js +1 -6
  164. package/examples/js/postprocessing/CubeTexturePass.js +12 -9
  165. package/examples/js/postprocessing/DotScreenPass.js +7 -5
  166. package/examples/js/postprocessing/EffectComposer.js +25 -32
  167. package/examples/js/postprocessing/FilmPass.js +7 -5
  168. package/examples/js/postprocessing/GlitchPass.js +10 -11
  169. package/examples/js/postprocessing/HalftonePass.js +9 -9
  170. package/examples/js/postprocessing/LUTPass.js +2 -15
  171. package/examples/js/postprocessing/MaskPass.js +20 -17
  172. package/examples/js/postprocessing/OutlinePass.js +45 -36
  173. package/examples/js/postprocessing/Pass.js +11 -14
  174. package/examples/js/postprocessing/RenderPass.js +3 -7
  175. package/examples/js/postprocessing/RenderPixelatedPass.js +215 -0
  176. package/examples/js/postprocessing/SAOPass.js +40 -32
  177. package/examples/js/postprocessing/SMAAPass.js +34 -17
  178. package/examples/js/postprocessing/SSAARenderPass.js +14 -14
  179. package/examples/js/postprocessing/SSAOPass.js +56 -42
  180. package/examples/js/postprocessing/SSRPass.js +78 -61
  181. package/examples/js/postprocessing/SavePass.js +14 -6
  182. package/examples/js/postprocessing/ShaderPass.js +9 -8
  183. package/examples/js/postprocessing/TAARenderPass.js +11 -9
  184. package/examples/js/postprocessing/TexturePass.js +7 -4
  185. package/examples/js/postprocessing/UnrealBloomPass.js +43 -25
  186. package/examples/js/renderers/CSS2DRenderer.js +2 -21
  187. package/examples/js/renderers/CSS3DRenderer.js +3 -24
  188. package/examples/js/renderers/Projector.js +29 -85
  189. package/examples/js/renderers/SVGRenderer.js +4 -50
  190. package/examples/js/shaders/ACESFilmicToneMappingShader.js +3 -6
  191. package/examples/js/shaders/AfterimageShader.js +3 -6
  192. package/examples/js/shaders/BasicShader.js +3 -6
  193. package/examples/js/shaders/BleachBypassShader.js +3 -6
  194. package/examples/js/shaders/BlendShader.js +3 -6
  195. package/examples/js/shaders/BokehShader.js +3 -6
  196. package/examples/js/shaders/BokehShader2.js +4 -13
  197. package/examples/js/shaders/BrightnessContrastShader.js +3 -6
  198. package/examples/js/shaders/ColorCorrectionShader.js +2 -6
  199. package/examples/js/shaders/ColorifyShader.js +2 -6
  200. package/examples/js/shaders/ConvolutionShader.js +5 -10
  201. package/examples/js/shaders/CopyShader.js +3 -6
  202. package/examples/js/shaders/DOFMipMapShader.js +3 -6
  203. package/examples/js/shaders/DepthLimitedBlurShader.js +2 -9
  204. package/examples/js/shaders/DigitalGlitch.js +3 -6
  205. package/examples/js/shaders/DotScreenShader.js +2 -6
  206. package/examples/js/shaders/FXAAShader.js +1 -3
  207. package/examples/js/shaders/FilmShader.js +3 -6
  208. package/examples/js/shaders/FocusShader.js +3 -6
  209. package/examples/js/shaders/FreiChenShader.js +2 -6
  210. package/examples/js/shaders/GammaCorrectionShader.js +3 -6
  211. package/examples/js/shaders/GodRaysShader.js +11 -24
  212. package/examples/js/shaders/HalftoneShader.js +3 -6
  213. package/examples/js/shaders/HorizontalBlurShader.js +3 -6
  214. package/examples/js/shaders/HorizontalTiltShiftShader.js +3 -6
  215. package/examples/js/shaders/HueSaturationShader.js +3 -6
  216. package/examples/js/shaders/KaleidoShader.js +3 -6
  217. package/examples/js/shaders/LuminosityHighPassShader.js +2 -6
  218. package/examples/js/shaders/LuminosityShader.js +3 -6
  219. package/examples/js/shaders/MMDToonShader.js +2 -8
  220. package/examples/js/shaders/MirrorShader.js +3 -6
  221. package/examples/js/shaders/NormalMapShader.js +2 -6
  222. package/examples/js/shaders/RGBShiftShader.js +3 -6
  223. package/examples/js/shaders/SAOShader.js +2 -6
  224. package/examples/js/shaders/SMAAShader.js +6 -18
  225. package/examples/js/shaders/SSAOShader.js +2 -6
  226. package/examples/js/shaders/SSRShader.js +6 -18
  227. package/examples/js/shaders/SepiaShader.js +3 -6
  228. package/examples/js/shaders/SobelOperatorShader.js +2 -6
  229. package/examples/js/shaders/TechnicolorShader.js +3 -6
  230. package/examples/js/shaders/ToneMapShader.js +3 -6
  231. package/examples/js/shaders/ToonShader.js +8 -24
  232. package/examples/js/shaders/TriangleBlurShader.js +2 -6
  233. package/examples/js/shaders/UnpackDepthRGBAShader.js +3 -6
  234. package/examples/js/shaders/VelocityShader.js +126 -0
  235. package/examples/js/shaders/VerticalBlurShader.js +3 -6
  236. package/examples/js/shaders/VerticalTiltShiftShader.js +3 -6
  237. package/examples/js/shaders/VignetteShader.js +3 -6
  238. package/examples/js/shaders/VolumeShader.js +2 -6
  239. package/examples/js/shaders/WaterRefractionShader.js +2 -6
  240. package/examples/js/textures/FlakesTexture.js +0 -1
  241. package/examples/js/utils/BufferGeometryUtils.js +236 -170
  242. package/examples/js/utils/CameraUtils.js +5 -20
  243. package/examples/js/utils/GPUStatsPanel.js +3 -12
  244. package/examples/js/utils/GeometryCompressionUtils.js +19 -44
  245. package/examples/js/utils/GeometryUtils.js +13 -18
  246. package/examples/js/utils/LDrawUtils.js +8 -11
  247. package/examples/js/utils/PackedPhongMaterial.js +6 -4
  248. package/examples/js/utils/SceneUtils.js +117 -6
  249. package/examples/js/utils/ShadowMapViewer.js +17 -14
  250. package/examples/js/utils/SkeletonUtils.js +13 -27
  251. package/examples/js/utils/UVsDebug.js +20 -12
  252. package/examples/js/utils/WorkerPool.js +1 -11
  253. package/examples/jsm/animation/CCDIKSolver.js +27 -3
  254. package/examples/jsm/animation/MMDPhysics.js +25 -0
  255. package/examples/jsm/capabilities/WebGPU.js +3 -1
  256. package/examples/jsm/controls/FirstPersonControls.js +20 -20
  257. package/examples/jsm/controls/FlyControls.js +16 -17
  258. package/examples/jsm/controls/OrbitControls.js +44 -4
  259. package/examples/jsm/controls/TrackballControls.js +14 -2
  260. package/examples/jsm/controls/TransformControls.js +1 -1
  261. package/examples/jsm/csm/CSM.js +1 -0
  262. package/examples/jsm/csm/CSMHelper.js +30 -0
  263. package/examples/jsm/exporters/GLTFExporter.js +0 -79
  264. package/examples/jsm/exporters/USDZExporter.js +93 -1
  265. package/examples/jsm/helpers/OctreeHelper.js +22 -8
  266. package/examples/jsm/helpers/VertexNormalsHelper.js +7 -1
  267. package/examples/jsm/helpers/VertexTangentsHelper.js +7 -0
  268. package/examples/jsm/helpers/ViewHelper.js +24 -0
  269. package/examples/jsm/interactive/HTMLMesh.js +5 -6
  270. package/examples/jsm/interactive/InteractiveGroup.js +4 -2
  271. package/examples/jsm/libs/flow.module.js +610 -160
  272. package/examples/jsm/libs/lottie_canvas.module.js +14844 -0
  273. package/examples/jsm/lines/LineSegments2.js +4 -0
  274. package/examples/jsm/loaders/3DMLoader.js +1 -2
  275. package/examples/jsm/loaders/ColladaLoader.js +28 -0
  276. package/examples/jsm/loaders/FBXLoader.js +18 -2
  277. package/examples/jsm/loaders/GLTFLoader.js +269 -428
  278. package/examples/jsm/loaders/KTX2Loader.js +68 -29
  279. package/examples/jsm/loaders/LDrawLoader.js +14 -13
  280. package/examples/jsm/loaders/LottieLoader.js +4 -2
  281. package/examples/jsm/loaders/MaterialXLoader.js +728 -0
  282. package/examples/jsm/loaders/PCDLoader.js +1 -1
  283. package/examples/jsm/loaders/PLYLoader.js +68 -16
  284. package/examples/jsm/loaders/SVGLoader.js +227 -14
  285. package/examples/jsm/loaders/USDZLoader.js +351 -111
  286. package/examples/jsm/loaders/VRMLLoader.js +13 -1
  287. package/examples/jsm/math/ConvexHull.js +4 -4
  288. package/examples/jsm/math/Octree.js +1 -1
  289. package/examples/jsm/node-editor/NodeEditor.js +91 -12
  290. package/examples/jsm/node-editor/core/BaseNode.js +10 -3
  291. package/examples/jsm/node-editor/materials/BasicMaterialEditor.js +6 -9
  292. package/examples/jsm/node-editor/materials/StandardMaterialEditor.js +6 -9
  293. package/examples/jsm/node-editor/math/AngleEditor.js +3 -3
  294. package/examples/jsm/node-editor/math/InvertEditor.js +2 -2
  295. package/examples/jsm/node-editor/scene/MeshEditor.js +11 -8
  296. package/examples/jsm/node-editor/utils/PreviewEditor.js +4 -0
  297. package/examples/jsm/nodes/Nodes.js +30 -3
  298. package/examples/jsm/nodes/accessors/BitangentNode.js +62 -0
  299. package/examples/jsm/nodes/accessors/NormalNode.js +6 -6
  300. package/examples/jsm/nodes/accessors/Object3DNode.js +1 -1
  301. package/examples/jsm/nodes/accessors/PositionNode.js +6 -0
  302. package/examples/jsm/nodes/accessors/ReferenceNode.js +1 -1
  303. package/examples/jsm/nodes/accessors/SkinningNode.js +8 -1
  304. package/examples/jsm/nodes/accessors/TangentNode.js +95 -0
  305. package/examples/jsm/nodes/core/AttributeNode.js +31 -8
  306. package/examples/jsm/nodes/core/Node.js +1 -1
  307. package/examples/jsm/nodes/core/NodeBuilder.js +55 -6
  308. package/examples/jsm/nodes/core/NodeFrame.js +2 -2
  309. package/examples/jsm/nodes/core/NodeVarying.js +7 -4
  310. package/examples/jsm/nodes/core/VaryingNode.js +6 -4
  311. package/examples/jsm/nodes/core/constants.js +13 -13
  312. package/examples/jsm/nodes/display/BlendModeNode.js +85 -0
  313. package/examples/jsm/nodes/display/ColorAdjustmentNode.js +2 -12
  314. package/examples/jsm/nodes/display/NormalMapNode.js +19 -12
  315. package/examples/jsm/nodes/display/PosterizeNode.js +25 -0
  316. package/examples/jsm/nodes/display/ViewportNode.js +106 -0
  317. package/examples/jsm/nodes/functions/BSDF/BRDF_GGX.js +5 -5
  318. package/examples/jsm/nodes/functions/PhysicalLightingModel.js +3 -3
  319. package/examples/jsm/nodes/functions/light/getDistanceAttenuation.js +2 -2
  320. package/examples/jsm/nodes/gpgpu/ComputeNode.js +1 -1
  321. package/examples/jsm/nodes/lighting/AnalyticLightNode.js +1 -1
  322. package/examples/jsm/nodes/loaders/NodeMaterialLoader.js +3 -1
  323. package/examples/jsm/nodes/materials/Materials.js +9 -7
  324. package/examples/jsm/nodes/materials/NodeMaterial.js +9 -1
  325. package/examples/jsm/nodes/materialx/{Disclaimer.md → DISCLAIMER.md} +1 -1
  326. package/examples/jsm/nodes/materialx/MaterialXNodes.js +59 -0
  327. package/examples/jsm/nodes/materialx/{functions/lib → lib}/mx_hsv.js +1 -1
  328. package/examples/jsm/nodes/materialx/{functions/lib → lib}/mx_noise.js +13 -3
  329. package/examples/jsm/nodes/materialx/lib/mx_transform_color.js +18 -0
  330. package/examples/jsm/nodes/math/MathNode.js +5 -5
  331. package/examples/jsm/nodes/math/OperatorNode.js +16 -3
  332. package/examples/jsm/nodes/shadernode/ShaderNode.js +35 -20
  333. package/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.js +87 -63
  334. package/examples/jsm/nodes/shadernode/ShaderNodeElements.js +29 -0
  335. package/examples/jsm/nodes/utils/ConvertNode.js +15 -14
  336. package/examples/jsm/nodes/utils/EquirectUVNode.js +27 -0
  337. package/examples/jsm/nodes/utils/JoinNode.js +8 -2
  338. package/examples/jsm/nodes/utils/MatcapUVNode.js +2 -4
  339. package/examples/jsm/nodes/utils/MaxMipLevelNode.js +1 -1
  340. package/examples/jsm/nodes/utils/OscNode.js +2 -2
  341. package/examples/jsm/nodes/utils/RemapNode.js +34 -0
  342. package/examples/jsm/nodes/utils/SpriteSheetUVNode.js +8 -10
  343. package/examples/jsm/nodes/utils/TimerNode.js +21 -1
  344. package/examples/jsm/nodes/utils/TriplanarTexturesNode.js +51 -0
  345. package/examples/jsm/postprocessing/AfterimagePass.js +17 -4
  346. package/examples/jsm/postprocessing/BloomPass.js +22 -3
  347. package/examples/jsm/postprocessing/BokehPass.js +18 -4
  348. package/examples/jsm/postprocessing/CubeTexturePass.js +12 -5
  349. package/examples/jsm/postprocessing/DotScreenPass.js +8 -0
  350. package/examples/jsm/postprocessing/EffectComposer.js +9 -0
  351. package/examples/jsm/postprocessing/FilmPass.js +8 -0
  352. package/examples/jsm/postprocessing/GlitchPass.js +13 -1
  353. package/examples/jsm/postprocessing/HalftonePass.js +8 -0
  354. package/examples/jsm/postprocessing/OutlinePass.js +21 -1
  355. package/examples/jsm/postprocessing/Pass.js +2 -0
  356. package/examples/jsm/postprocessing/RenderPixelatedPass.js +234 -0
  357. package/examples/jsm/postprocessing/SAOPass.js +20 -0
  358. package/examples/jsm/postprocessing/SMAAPass.js +16 -0
  359. package/examples/jsm/postprocessing/SSAARenderPass.js +4 -0
  360. package/examples/jsm/postprocessing/SavePass.js +17 -1
  361. package/examples/jsm/postprocessing/ShaderPass.js +8 -0
  362. package/examples/jsm/postprocessing/TAARenderPass.js +9 -0
  363. package/examples/jsm/postprocessing/TexturePass.js +8 -0
  364. package/examples/jsm/postprocessing/UnrealBloomPass.js +16 -0
  365. package/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js +56 -35
  366. package/examples/jsm/renderers/webgpu/WebGPUAnimation.js +58 -0
  367. package/examples/jsm/renderers/webgpu/WebGPUAttributes.js +63 -5
  368. package/examples/jsm/renderers/webgpu/WebGPUBackground.js +36 -7
  369. package/examples/jsm/renderers/webgpu/WebGPURenderer.js +47 -12
  370. package/examples/jsm/renderers/webgpu/nodes/WebGPUNodeBuilder.js +41 -9
  371. package/examples/jsm/shaders/MMDToonShader.js +0 -2
  372. package/examples/jsm/shaders/VelocityShader.js +128 -0
  373. package/examples/jsm/utils/BufferGeometryUtils.js +174 -42
  374. package/examples/jsm/utils/SceneUtils.js +129 -4
  375. package/examples/jsm/webxr/OculusHandModel.js +3 -2
  376. package/examples/jsm/webxr/XRHandMeshModel.js +8 -3
  377. package/package.json +13 -13
  378. package/src/Three.js +1 -0
  379. package/src/animation/PropertyBinding.js +7 -0
  380. package/src/audio/AudioContext.js +5 -5
  381. package/src/cameras/CubeCamera.js +14 -14
  382. package/src/constants.js +1 -1
  383. package/src/core/InstancedBufferGeometry.js +1 -7
  384. package/src/core/InterleavedBufferAttribute.js +4 -4
  385. package/src/extras/Earcut.js +67 -67
  386. package/src/geometries/PolyhedronGeometry.js +1 -1
  387. package/src/geometries/ShapeGeometry.js +1 -1
  388. package/src/helpers/ArrowHelper.js +9 -0
  389. package/src/helpers/Box3Helper.js +7 -0
  390. package/src/helpers/BoxHelper.js +7 -1
  391. package/src/helpers/DirectionalLightHelper.js +5 -1
  392. package/src/helpers/GridHelper.js +7 -0
  393. package/src/helpers/HemisphereLightHelper.js +4 -1
  394. package/src/helpers/PlaneHelper.js +9 -0
  395. package/src/helpers/PointLightHelper.js +2 -1
  396. package/src/helpers/PolarGridHelper.js +7 -0
  397. package/src/helpers/SkeletonHelper.js +7 -0
  398. package/src/helpers/SpotLightHelper.js +4 -2
  399. package/src/lights/LightShadow.js +1 -2
  400. package/src/lights/PointLight.js +2 -2
  401. package/src/lights/SpotLight.js +2 -2
  402. package/src/loaders/FileLoader.js +4 -1
  403. package/src/loaders/ObjectLoader.js +5 -1
  404. package/src/materials/Material.js +1 -1
  405. package/src/materials/MeshPhysicalMaterial.js +1 -1
  406. package/src/math/Color.js +5 -5
  407. package/src/math/Matrix3.js +53 -18
  408. package/src/math/Ray.js +2 -5
  409. package/src/math/Sphere.js +36 -21
  410. package/src/objects/InstancedMesh.js +7 -0
  411. package/src/objects/LOD.js +25 -6
  412. package/src/renderers/WebGL3DRenderTarget.js +1 -1
  413. package/src/renderers/WebGLArrayRenderTarget.js +1 -1
  414. package/src/renderers/WebGLCubeRenderTarget.js +1 -1
  415. package/src/renderers/WebGLMultipleRenderTargets.js +1 -1
  416. package/src/renderers/WebGLRenderTarget.js +1 -1
  417. package/src/renderers/WebGLRenderer.js +36 -62
  418. package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +0 -4
  419. package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +0 -1
  420. package/src/renderers/shaders/ShaderChunk/lights_lambert_pars_fragment.glsl.js +0 -2
  421. package/src/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl.js +0 -2
  422. package/src/renderers/shaders/ShaderChunk/lights_toon_pars_fragment.glsl.js +0 -2
  423. package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +2 -4
  424. package/src/renderers/shaders/ShaderChunk/packing.glsl.js +8 -0
  425. package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +2 -2
  426. package/src/renderers/shaders/ShaderChunk.js +3 -0
  427. package/src/renderers/shaders/ShaderLib/background.glsl.js +7 -2
  428. package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +62 -0
  429. package/src/renderers/shaders/ShaderLib/cube.glsl.js +4 -6
  430. package/src/renderers/shaders/ShaderLib/vsm.glsl.js +0 -3
  431. package/src/renderers/shaders/ShaderLib.js +20 -6
  432. package/src/renderers/shaders/UniformsLib.js +1 -1
  433. package/src/renderers/shaders/UniformsUtils.js +15 -0
  434. package/src/renderers/webgl/WebGLAttributes.js +2 -0
  435. package/src/renderers/webgl/WebGLBackground.js +15 -7
  436. package/src/renderers/webgl/WebGLLights.js +0 -4
  437. package/src/renderers/webgl/WebGLMaterials.js +2 -1
  438. package/src/renderers/webgl/WebGLShadowMap.js +3 -1
  439. package/src/renderers/webgl/WebGLState.js +78 -41
  440. package/src/renderers/webgl/WebGLTextures.js +94 -39
  441. package/src/renderers/webgl/WebGLUniforms.js +152 -24
  442. package/src/renderers/webgl/WebGLUtils.js +1 -1
  443. package/src/renderers/webxr/WebXRController.js +46 -13
  444. package/src/renderers/webxr/WebXRManager.js +70 -2
  445. package/src/scenes/Scene.js +8 -0
  446. package/src/textures/CompressedArrayTexture.js +18 -0
  447. package/src/textures/Texture.js +2 -1
  448. package/examples/js/libs/lottie_canvas.js +0 -12751
  449. package/examples/js/shaders/PixelShader.js +0 -51
  450. package/examples/jsm/shaders/PixelShader.js +0 -44
@@ -3,7 +3,7 @@
3
3
  * Copyright 2010-2022 Three.js Authors
4
4
  * SPDX-License-Identifier: MIT
5
5
  */
6
- const REVISION = '144';
6
+ const REVISION = '147';
7
7
  const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
8
8
  const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
9
9
  const CullFaceNone = 0;
@@ -1287,12 +1287,11 @@ class Matrix3 {
1287
1287
 
1288
1288
  }
1289
1289
 
1290
- scale( sx, sy ) {
1290
+ //
1291
1291
 
1292
- const te = this.elements;
1292
+ scale( sx, sy ) {
1293
1293
 
1294
- te[ 0 ] *= sx; te[ 3 ] *= sx; te[ 6 ] *= sx;
1295
- te[ 1 ] *= sy; te[ 4 ] *= sy; te[ 7 ] *= sy;
1294
+ this.premultiply( _m3.makeScale( sx, sy ) );
1296
1295
 
1297
1296
  return this;
1298
1297
 
@@ -1300,37 +1299,71 @@ class Matrix3 {
1300
1299
 
1301
1300
  rotate( theta ) {
1302
1301
 
1302
+ this.premultiply( _m3.makeRotation( - theta ) );
1303
+
1304
+ return this;
1305
+
1306
+ }
1307
+
1308
+ translate( tx, ty ) {
1309
+
1310
+ this.premultiply( _m3.makeTranslation( tx, ty ) );
1311
+
1312
+ return this;
1313
+
1314
+ }
1315
+
1316
+ // for 2D Transforms
1317
+
1318
+ makeTranslation( x, y ) {
1319
+
1320
+ this.set(
1321
+
1322
+ 1, 0, x,
1323
+ 0, 1, y,
1324
+ 0, 0, 1
1325
+
1326
+ );
1327
+
1328
+ return this;
1329
+
1330
+ }
1331
+
1332
+ makeRotation( theta ) {
1333
+
1334
+ // counterclockwise
1335
+
1303
1336
  const c = Math.cos( theta );
1304
1337
  const s = Math.sin( theta );
1305
1338
 
1306
- const te = this.elements;
1307
-
1308
- const a11 = te[ 0 ], a12 = te[ 3 ], a13 = te[ 6 ];
1309
- const a21 = te[ 1 ], a22 = te[ 4 ], a23 = te[ 7 ];
1339
+ this.set(
1310
1340
 
1311
- te[ 0 ] = c * a11 + s * a21;
1312
- te[ 3 ] = c * a12 + s * a22;
1313
- te[ 6 ] = c * a13 + s * a23;
1341
+ c, - s, 0,
1342
+ s, c, 0,
1343
+ 0, 0, 1
1314
1344
 
1315
- te[ 1 ] = - s * a11 + c * a21;
1316
- te[ 4 ] = - s * a12 + c * a22;
1317
- te[ 7 ] = - s * a13 + c * a23;
1345
+ );
1318
1346
 
1319
1347
  return this;
1320
1348
 
1321
1349
  }
1322
1350
 
1323
- translate( tx, ty ) {
1351
+ makeScale( x, y ) {
1324
1352
 
1325
- const te = this.elements;
1353
+ this.set(
1326
1354
 
1327
- te[ 0 ] += tx * te[ 2 ]; te[ 3 ] += tx * te[ 5 ]; te[ 6 ] += tx * te[ 8 ];
1328
- te[ 1 ] += ty * te[ 2 ]; te[ 4 ] += ty * te[ 5 ]; te[ 7 ] += ty * te[ 8 ];
1355
+ x, 0, 0,
1356
+ 0, y, 0,
1357
+ 0, 0, 1
1358
+
1359
+ );
1329
1360
 
1330
1361
  return this;
1331
1362
 
1332
1363
  }
1333
1364
 
1365
+ //
1366
+
1334
1367
  equals( matrix ) {
1335
1368
 
1336
1369
  const te = this.elements;
@@ -1386,6 +1419,8 @@ class Matrix3 {
1386
1419
 
1387
1420
  }
1388
1421
 
1422
+ const _m3 = /*@__PURE__*/ new Matrix3();
1423
+
1389
1424
  function arrayNeedsUint32( array ) {
1390
1425
 
1391
1426
  // assumes larger values usually on last
@@ -1522,7 +1557,7 @@ const _colorKeywords = { 'aliceblue': 0xF0F8FF, 'antiquewhite': 0xFAEBD7, 'aqua'
1522
1557
  'springgreen': 0x00FF7F, 'steelblue': 0x4682B4, 'tan': 0xD2B48C, 'teal': 0x008080, 'thistle': 0xD8BFD8, 'tomato': 0xFF6347, 'turquoise': 0x40E0D0,
1523
1558
  'violet': 0xEE82EE, 'wheat': 0xF5DEB3, 'white': 0xFFFFFF, 'whitesmoke': 0xF5F5F5, 'yellow': 0xFFFF00, 'yellowgreen': 0x9ACD32 };
1524
1559
 
1525
- const _rgb = { r: 0, g: 0, b: 0 };
1560
+ const _rgb$1 = { r: 0, g: 0, b: 0 };
1526
1561
  const _hslA = { h: 0, s: 0, l: 0 };
1527
1562
  const _hslB = { h: 0, s: 0, l: 0 };
1528
1563
 
@@ -1612,7 +1647,7 @@ class Color {
1612
1647
 
1613
1648
  }
1614
1649
 
1615
- setRGB( r, g, b, colorSpace = LinearSRGBColorSpace ) {
1650
+ setRGB( r, g, b, colorSpace = ColorManagement.workingColorSpace ) {
1616
1651
 
1617
1652
  this.r = r;
1618
1653
  this.g = g;
@@ -1624,7 +1659,7 @@ class Color {
1624
1659
 
1625
1660
  }
1626
1661
 
1627
- setHSL( h, s, l, colorSpace = LinearSRGBColorSpace ) {
1662
+ setHSL( h, s, l, colorSpace = ColorManagement.workingColorSpace ) {
1628
1663
 
1629
1664
  // h,s,l ranges are in 0.0 - 1.0
1630
1665
  h = euclideanModulo( h, 1 );
@@ -1852,9 +1887,9 @@ class Color {
1852
1887
 
1853
1888
  getHex( colorSpace = SRGBColorSpace ) {
1854
1889
 
1855
- ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb ), colorSpace );
1890
+ ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb$1 ), colorSpace );
1856
1891
 
1857
- return clamp( _rgb.r * 255, 0, 255 ) << 16 ^ clamp( _rgb.g * 255, 0, 255 ) << 8 ^ clamp( _rgb.b * 255, 0, 255 ) << 0;
1892
+ return clamp( _rgb$1.r * 255, 0, 255 ) << 16 ^ clamp( _rgb$1.g * 255, 0, 255 ) << 8 ^ clamp( _rgb$1.b * 255, 0, 255 ) << 0;
1858
1893
 
1859
1894
  }
1860
1895
 
@@ -1864,13 +1899,13 @@ class Color {
1864
1899
 
1865
1900
  }
1866
1901
 
1867
- getHSL( target, colorSpace = LinearSRGBColorSpace ) {
1902
+ getHSL( target, colorSpace = ColorManagement.workingColorSpace ) {
1868
1903
 
1869
1904
  // h,s,l ranges are in 0.0 - 1.0
1870
1905
 
1871
- ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb ), colorSpace );
1906
+ ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb$1 ), colorSpace );
1872
1907
 
1873
- const r = _rgb.r, g = _rgb.g, b = _rgb.b;
1908
+ const r = _rgb$1.r, g = _rgb$1.g, b = _rgb$1.b;
1874
1909
 
1875
1910
  const max = Math.max( r, g, b );
1876
1911
  const min = Math.min( r, g, b );
@@ -1909,13 +1944,13 @@ class Color {
1909
1944
 
1910
1945
  }
1911
1946
 
1912
- getRGB( target, colorSpace = LinearSRGBColorSpace ) {
1947
+ getRGB( target, colorSpace = ColorManagement.workingColorSpace ) {
1913
1948
 
1914
- ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb ), colorSpace );
1949
+ ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb$1 ), colorSpace );
1915
1950
 
1916
- target.r = _rgb.r;
1917
- target.g = _rgb.g;
1918
- target.b = _rgb.b;
1951
+ target.r = _rgb$1.r;
1952
+ target.g = _rgb$1.g;
1953
+ target.b = _rgb$1.b;
1919
1954
 
1920
1955
  return target;
1921
1956
 
@@ -1923,16 +1958,16 @@ class Color {
1923
1958
 
1924
1959
  getStyle( colorSpace = SRGBColorSpace ) {
1925
1960
 
1926
- ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb ), colorSpace );
1961
+ ColorManagement.fromWorkingColorSpace( toComponents( this, _rgb$1 ), colorSpace );
1927
1962
 
1928
1963
  if ( colorSpace !== SRGBColorSpace ) {
1929
1964
 
1930
1965
  // Requires CSS Color Module Level 4 (https://www.w3.org/TR/css-color-4/).
1931
- return `color(${ colorSpace } ${ _rgb.r } ${ _rgb.g } ${ _rgb.b })`;
1966
+ return `color(${ colorSpace } ${ _rgb$1.r } ${ _rgb$1.g } ${ _rgb$1.b })`;
1932
1967
 
1933
1968
  }
1934
1969
 
1935
- return `rgb(${( _rgb.r * 255 ) | 0},${( _rgb.g * 255 ) | 0},${( _rgb.b * 255 ) | 0})`;
1970
+ return `rgb(${( _rgb$1.r * 255 ) | 0},${( _rgb$1.g * 255 ) | 0},${( _rgb$1.b * 255 ) | 0})`;
1936
1971
 
1937
1972
  }
1938
1973
 
@@ -2345,7 +2380,7 @@ let textureId = 0;
2345
2380
 
2346
2381
  class Texture extends EventDispatcher {
2347
2382
 
2348
- constructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1, encoding = LinearEncoding ) {
2383
+ constructor( image = Texture.DEFAULT_IMAGE, mapping = Texture.DEFAULT_MAPPING, wrapS = ClampToEdgeWrapping, wrapT = ClampToEdgeWrapping, magFilter = LinearFilter, minFilter = LinearMipmapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = Texture.DEFAULT_ANISOTROPY, encoding = LinearEncoding ) {
2349
2384
 
2350
2385
  super();
2351
2386
 
@@ -2630,6 +2665,7 @@ class Texture extends EventDispatcher {
2630
2665
 
2631
2666
  Texture.DEFAULT_IMAGE = null;
2632
2667
  Texture.DEFAULT_MAPPING = UVMapping;
2668
+ Texture.DEFAULT_ANISOTROPY = 1;
2633
2669
 
2634
2670
  class Vector4 {
2635
2671
 
@@ -3281,7 +3317,7 @@ class Vector4 {
3281
3317
  */
3282
3318
  class WebGLRenderTarget extends EventDispatcher {
3283
3319
 
3284
- constructor( width, height, options = {} ) {
3320
+ constructor( width = 1, height = 1, options = {} ) {
3285
3321
 
3286
3322
  super();
3287
3323
 
@@ -3402,7 +3438,7 @@ class DataArrayTexture extends Texture {
3402
3438
 
3403
3439
  class WebGLArrayRenderTarget extends WebGLRenderTarget {
3404
3440
 
3405
- constructor( width, height, depth ) {
3441
+ constructor( width = 1, height = 1, depth = 1 ) {
3406
3442
 
3407
3443
  super( width, height );
3408
3444
 
@@ -3451,7 +3487,7 @@ class Data3DTexture extends Texture {
3451
3487
 
3452
3488
  class WebGL3DRenderTarget extends WebGLRenderTarget {
3453
3489
 
3454
- constructor( width, height, depth ) {
3490
+ constructor( width = 1, height = 1, depth = 1 ) {
3455
3491
 
3456
3492
  super( width, height );
3457
3493
 
@@ -3469,7 +3505,7 @@ class WebGL3DRenderTarget extends WebGLRenderTarget {
3469
3505
 
3470
3506
  class WebGLMultipleRenderTargets extends WebGLRenderTarget {
3471
3507
 
3472
- constructor( width, height, count, options = {} ) {
3508
+ constructor( width = 1, height = 1, count = 1, options = {} ) {
3473
3509
 
3474
3510
  super( width, height, options );
3475
3511
 
@@ -5282,12 +5318,12 @@ class Box3 {
5282
5318
  // translate triangle to aabb origin
5283
5319
  _v0$2.subVectors( triangle.a, _center );
5284
5320
  _v1$7.subVectors( triangle.b, _center );
5285
- _v2$3.subVectors( triangle.c, _center );
5321
+ _v2$4.subVectors( triangle.c, _center );
5286
5322
 
5287
5323
  // compute edge vectors for triangle
5288
5324
  _f0.subVectors( _v1$7, _v0$2 );
5289
- _f1.subVectors( _v2$3, _v1$7 );
5290
- _f2.subVectors( _v0$2, _v2$3 );
5325
+ _f1.subVectors( _v2$4, _v1$7 );
5326
+ _f2.subVectors( _v0$2, _v2$4 );
5291
5327
 
5292
5328
  // test against axes that are given by cross product combinations of the edges of the triangle and the edges of the aabb
5293
5329
  // make an axis testing of each of the 3 sides of the aabb against each of the 3 sides of the triangle = 9 axis of separation
@@ -5297,7 +5333,7 @@ class Box3 {
5297
5333
  _f0.z, 0, - _f0.x, _f1.z, 0, - _f1.x, _f2.z, 0, - _f2.x,
5298
5334
  - _f0.y, _f0.x, 0, - _f1.y, _f1.x, 0, - _f2.y, _f2.x, 0
5299
5335
  ];
5300
- if ( ! satForAxes( axes, _v0$2, _v1$7, _v2$3, _extents ) ) {
5336
+ if ( ! satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents ) ) {
5301
5337
 
5302
5338
  return false;
5303
5339
 
@@ -5305,7 +5341,7 @@ class Box3 {
5305
5341
 
5306
5342
  // test 3 face normals from the aabb
5307
5343
  axes = [ 1, 0, 0, 0, 1, 0, 0, 0, 1 ];
5308
- if ( ! satForAxes( axes, _v0$2, _v1$7, _v2$3, _extents ) ) {
5344
+ if ( ! satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents ) ) {
5309
5345
 
5310
5346
  return false;
5311
5347
 
@@ -5316,7 +5352,7 @@ class Box3 {
5316
5352
  _triangleNormal.crossVectors( _f0, _f1 );
5317
5353
  axes = [ _triangleNormal.x, _triangleNormal.y, _triangleNormal.z ];
5318
5354
 
5319
- return satForAxes( axes, _v0$2, _v1$7, _v2$3, _extents );
5355
+ return satForAxes( axes, _v0$2, _v1$7, _v2$4, _extents );
5320
5356
 
5321
5357
  }
5322
5358
 
@@ -5422,7 +5458,7 @@ const _box$3 = /*@__PURE__*/ new Box3();
5422
5458
 
5423
5459
  const _v0$2 = /*@__PURE__*/ new Vector3();
5424
5460
  const _v1$7 = /*@__PURE__*/ new Vector3();
5425
- const _v2$3 = /*@__PURE__*/ new Vector3();
5461
+ const _v2$4 = /*@__PURE__*/ new Vector3();
5426
5462
 
5427
5463
  // triangle edge vectors
5428
5464
 
@@ -5463,8 +5499,7 @@ function satForAxes( axes, v0, v1, v2, extents ) {
5463
5499
 
5464
5500
  const _box$2 = /*@__PURE__*/ new Box3();
5465
5501
  const _v1$6 = /*@__PURE__*/ new Vector3();
5466
- const _toFarthestPoint = /*@__PURE__*/ new Vector3();
5467
- const _toPoint = /*@__PURE__*/ new Vector3();
5502
+ const _v2$3 = /*@__PURE__*/ new Vector3();
5468
5503
 
5469
5504
  class Sphere {
5470
5505
 
@@ -5621,23 +5656,31 @@ class Sphere {
5621
5656
 
5622
5657
  expandByPoint( point ) {
5623
5658
 
5624
- // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L649-L671
5659
+ if ( this.isEmpty() ) {
5660
+
5661
+ this.center.copy( point );
5662
+
5663
+ this.radius = 0;
5625
5664
 
5626
- _toPoint.subVectors( point, this.center );
5665
+ return this;
5627
5666
 
5628
- const lengthSq = _toPoint.lengthSq();
5667
+ }
5668
+
5669
+ _v1$6.subVectors( point, this.center );
5670
+
5671
+ const lengthSq = _v1$6.lengthSq();
5629
5672
 
5630
5673
  if ( lengthSq > ( this.radius * this.radius ) ) {
5631
5674
 
5675
+ // calculate the minimal sphere
5676
+
5632
5677
  const length = Math.sqrt( lengthSq );
5633
- const missingRadiusHalf = ( length - this.radius ) * 0.5;
5634
5678
 
5635
- // Nudge this sphere towards the target point. Add half the missing distance to radius,
5636
- // and the other half to position. This gives a tighter enclosure, instead of if
5637
- // the whole missing distance were just added to radius.
5679
+ const delta = ( length - this.radius ) * 0.5;
5680
+
5681
+ this.center.addScaledVector( _v1$6, delta / length );
5638
5682
 
5639
- this.center.add( _toPoint.multiplyScalar( missingRadiusHalf / length ) );
5640
- this.radius += missingRadiusHalf;
5683
+ this.radius += delta;
5641
5684
 
5642
5685
  }
5643
5686
 
@@ -5647,25 +5690,33 @@ class Sphere {
5647
5690
 
5648
5691
  union( sphere ) {
5649
5692
 
5650
- // from https://github.com/juj/MathGeoLib/blob/2940b99b99cfe575dd45103ef20f4019dee15b54/src/Geometry/Sphere.cpp#L759-L769
5693
+ if ( sphere.isEmpty() ) {
5694
+
5695
+ return this;
5696
+
5697
+ }
5698
+
5699
+ if ( this.isEmpty() ) {
5700
+
5701
+ this.copy( sphere );
5651
5702
 
5652
- // To enclose another sphere into this sphere, we only need to enclose two points:
5653
- // 1) Enclose the farthest point on the other sphere into this sphere.
5654
- // 2) Enclose the opposite point of the farthest point into this sphere.
5703
+ return this;
5655
5704
 
5656
- if ( this.center.equals( sphere.center ) === true ) {
5705
+ }
5657
5706
 
5658
- _toFarthestPoint.set( 0, 0, 1 ).multiplyScalar( sphere.radius );
5707
+ if ( this.center.equals( sphere.center ) === true ) {
5659
5708
 
5709
+ this.radius = Math.max( this.radius, sphere.radius );
5660
5710
 
5661
5711
  } else {
5662
5712
 
5663
- _toFarthestPoint.subVectors( sphere.center, this.center ).normalize().multiplyScalar( sphere.radius );
5713
+ _v2$3.subVectors( sphere.center, this.center ).setLength( sphere.radius );
5664
5714
 
5665
- }
5715
+ this.expandByPoint( _v1$6.copy( sphere.center ).add( _v2$3 ) );
5666
5716
 
5667
- this.expandByPoint( _v1$6.copy( sphere.center ).add( _toFarthestPoint ) );
5668
- this.expandByPoint( _v1$6.copy( sphere.center ).sub( _toFarthestPoint ) );
5717
+ this.expandByPoint( _v1$6.copy( sphere.center ).sub( _v2$3 ) );
5718
+
5719
+ }
5669
5720
 
5670
5721
  return this;
5671
5722
 
@@ -6041,12 +6092,9 @@ class Ray {
6041
6092
 
6042
6093
  if ( ( tmin > tymax ) || ( tymin > tmax ) ) return null;
6043
6094
 
6044
- // These lines also handle the case where tmin or tmax is NaN
6045
- // (result of 0 * Infinity). x !== x returns true if x is NaN
6095
+ if ( tymin > tmin || isNaN( tmin ) ) tmin = tymin;
6046
6096
 
6047
- if ( tymin > tmin || tmin !== tmin ) tmin = tymin;
6048
-
6049
- if ( tymax < tmax || tmax !== tmax ) tmax = tymax;
6097
+ if ( tymax < tmax || isNaN( tmax ) ) tmax = tymax;
6050
6098
 
6051
6099
  if ( invdirz >= 0 ) {
6052
6100
 
@@ -8940,7 +8988,7 @@ class Material extends EventDispatcher {
8940
8988
  if ( this.transmissionMap && this.transmissionMap.isTexture ) data.transmissionMap = this.transmissionMap.toJSON( meta ).uuid;
8941
8989
  if ( this.thickness !== undefined ) data.thickness = this.thickness;
8942
8990
  if ( this.thicknessMap && this.thicknessMap.isTexture ) data.thicknessMap = this.thicknessMap.toJSON( meta ).uuid;
8943
- if ( this.attenuationDistance !== undefined ) data.attenuationDistance = this.attenuationDistance;
8991
+ if ( this.attenuationDistance !== undefined && this.attenuationDistance !== Infinity ) data.attenuationDistance = this.attenuationDistance;
8944
8992
  if ( this.attenuationColor !== undefined ) data.attenuationColor = this.attenuationColor.getHex();
8945
8993
 
8946
8994
  if ( this.size !== undefined ) data.size = this.size;
@@ -11383,6 +11431,19 @@ function cloneUniformsGroups( src ) {
11383
11431
 
11384
11432
  }
11385
11433
 
11434
+ function getUnlitUniformColorSpace( renderer ) {
11435
+
11436
+ if ( renderer.getRenderTarget() === null ) {
11437
+
11438
+ // https://github.com/mrdoob/three.js/pull/23937#issuecomment-1111067398
11439
+ return renderer.outputEncoding === sRGBEncoding ? SRGBColorSpace : LinearSRGBColorSpace;
11440
+
11441
+ }
11442
+
11443
+ return LinearSRGBColorSpace;
11444
+
11445
+ }
11446
+
11386
11447
  // Legacy
11387
11448
 
11388
11449
  const UniformsUtils = { clone: cloneUniforms, merge: mergeUniforms };
@@ -11859,7 +11920,8 @@ class PerspectiveCamera extends Camera {
11859
11920
 
11860
11921
  }
11861
11922
 
11862
- const fov = 90, aspect = 1;
11923
+ const fov = - 90; // negative fov is not an error
11924
+ const aspect = 1;
11863
11925
 
11864
11926
  class CubeCamera extends Object3D {
11865
11927
 
@@ -11873,38 +11935,38 @@ class CubeCamera extends Object3D {
11873
11935
 
11874
11936
  const cameraPX = new PerspectiveCamera( fov, aspect, near, far );
11875
11937
  cameraPX.layers = this.layers;
11876
- cameraPX.up.set( 0, - 1, 0 );
11877
- cameraPX.lookAt( new Vector3( 1, 0, 0 ) );
11938
+ cameraPX.up.set( 0, 1, 0 );
11939
+ cameraPX.lookAt( 1, 0, 0 );
11878
11940
  this.add( cameraPX );
11879
11941
 
11880
11942
  const cameraNX = new PerspectiveCamera( fov, aspect, near, far );
11881
11943
  cameraNX.layers = this.layers;
11882
- cameraNX.up.set( 0, - 1, 0 );
11883
- cameraNX.lookAt( new Vector3( - 1, 0, 0 ) );
11944
+ cameraNX.up.set( 0, 1, 0 );
11945
+ cameraNX.lookAt( - 1, 0, 0 );
11884
11946
  this.add( cameraNX );
11885
11947
 
11886
11948
  const cameraPY = new PerspectiveCamera( fov, aspect, near, far );
11887
11949
  cameraPY.layers = this.layers;
11888
- cameraPY.up.set( 0, 0, 1 );
11889
- cameraPY.lookAt( new Vector3( 0, 1, 0 ) );
11950
+ cameraPY.up.set( 0, 0, - 1 );
11951
+ cameraPY.lookAt( 0, 1, 0 );
11890
11952
  this.add( cameraPY );
11891
11953
 
11892
11954
  const cameraNY = new PerspectiveCamera( fov, aspect, near, far );
11893
11955
  cameraNY.layers = this.layers;
11894
- cameraNY.up.set( 0, 0, - 1 );
11895
- cameraNY.lookAt( new Vector3( 0, - 1, 0 ) );
11956
+ cameraNY.up.set( 0, 0, 1 );
11957
+ cameraNY.lookAt( 0, - 1, 0 );
11896
11958
  this.add( cameraNY );
11897
11959
 
11898
11960
  const cameraPZ = new PerspectiveCamera( fov, aspect, near, far );
11899
11961
  cameraPZ.layers = this.layers;
11900
- cameraPZ.up.set( 0, - 1, 0 );
11901
- cameraPZ.lookAt( new Vector3( 0, 0, 1 ) );
11962
+ cameraPZ.up.set( 0, 1, 0 );
11963
+ cameraPZ.lookAt( 0, 0, 1 );
11902
11964
  this.add( cameraPZ );
11903
11965
 
11904
11966
  const cameraNZ = new PerspectiveCamera( fov, aspect, near, far );
11905
11967
  cameraNZ.layers = this.layers;
11906
- cameraNZ.up.set( 0, - 1, 0 );
11907
- cameraNZ.lookAt( new Vector3( 0, 0, - 1 ) );
11968
+ cameraNZ.up.set( 0, 1, 0 );
11969
+ cameraNZ.lookAt( 0, 0, - 1 );
11908
11970
  this.add( cameraNZ );
11909
11971
 
11910
11972
  }
@@ -11991,7 +12053,7 @@ class CubeTexture extends Texture {
11991
12053
 
11992
12054
  class WebGLCubeRenderTarget extends WebGLRenderTarget {
11993
12055
 
11994
- constructor( size, options = {} ) {
12056
+ constructor( size = 1, options = {} ) {
11995
12057
 
11996
12058
  super( size, size, options );
11997
12059
 
@@ -12648,6 +12710,8 @@ function WebGLAttributes( gl, capabilities ) {
12648
12710
 
12649
12711
  }
12650
12712
 
12713
+ attribute.onUploadCallback();
12714
+
12651
12715
  }
12652
12716
 
12653
12717
  //
@@ -12865,7 +12929,7 @@ var encodings_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
12865
12929
 
12866
12930
  var encodings_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( 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}";
12867
12931
 
12868
- 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#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 envColor = textureCubeUV( envMap, reflectVec, 0.0 );\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";
12932
+ 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";
12869
12933
 
12870
12934
  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";
12871
12935
 
@@ -12891,7 +12955,7 @@ var lightmap_pars_fragment = "#ifdef USE_LIGHTMAP\n\tuniform sampler2D lightMap;
12891
12955
 
12892
12956
  var lights_lambert_fragment = "LambertMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularStrength = specularStrength;";
12893
12957
 
12894
- var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert\n#define Material_LightProbeLOD( material )\t(0)";
12958
+ var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertMaterial {\n\tvec3 diffuseColor;\n\tfloat specularStrength;\n};\nvoid RE_Direct_Lambert( const in IncidentLight directLight, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in GeometricContext geometry, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Lambert\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Lambert";
12895
12959
 
12896
12960
  var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( PHYSICALLY_CORRECT_LIGHTS )\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#else\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif";
12897
12961
 
@@ -12899,11 +12963,11 @@ var envmap_physical_pars_fragment = "#if defined( USE_ENVMAP )\n\tvec3 getIBLIrr
12899
12963
 
12900
12964
  var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
12901
12965
 
12902
- var lights_toon_pars_fragment = "varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon\n#define Material_LightProbeLOD( material )\t(0)";
12966
+ var lights_toon_pars_fragment = "varying vec3 vViewPosition;\nstruct ToonMaterial {\n\tvec3 diffuseColor;\n};\nvoid RE_Direct_Toon( const in IncidentLight directLight, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\tvec3 irradiance = getGradientIrradiance( geometry.normal, directLight.direction ) * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in GeometricContext geometry, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_Toon\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Toon";
12903
12967
 
12904
12968
  var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;\nmaterial.specularColor = specular;\nmaterial.specularShininess = shininess;\nmaterial.specularStrength = specularStrength;";
12905
12969
 
12906
- var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong\n#define Material_LightProbeLOD( material )\t(0)";
12970
+ var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong";
12907
12971
 
12908
12972
  var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULARINTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vUv ).a;\n\t\t#endif\n\t\t#ifdef USE_SPECULARCOLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vUv ).rgb;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEENCOLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEENROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vUv ).a;\n\t#endif\n#endif";
12909
12973
 
@@ -12943,7 +13007,7 @@ var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\tuniform float morphTar
12943
13007
 
12944
13008
  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";
12945
13009
 
12946
- var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );\n\tvec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;";
13010
+ var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\t#ifdef USE_TANGENT\n\t\tvec3 tangent = normalize( vTangent );\n\t\tvec3 bitangent = normalize( vBitangent );\n\t\t#ifdef DOUBLE_SIDED\n\t\t\ttangent = tangent * faceDirection;\n\t\t\tbitangent = bitangent * faceDirection;\n\t\t#endif\n\t\t#if defined( TANGENTSPACE_NORMALMAP ) || defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tmat3 vTBN = mat3( tangent, bitangent, normal );\n\t\t#endif\n\t#endif\n#endif\nvec3 geometryNormal = normal;";
12947
13011
 
12948
13012
  var normal_fragment_maps = "#ifdef OBJECTSPACE_NORMALMAP\n\tnormal = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( TANGENTSPACE_NORMALMAP )\n\tvec3 mapN = texture2D( normalMap, vUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\t#ifdef USE_TANGENT\n\t\tnormal = normalize( vTBN * mapN );\n\t#else\n\t\tnormal = perturbNormal2Arb( - vViewPosition, normal, mapN, faceDirection );\n\t#endif\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif";
12949
13013
 
@@ -12965,7 +13029,7 @@ var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D
12965
13029
 
12966
13030
  var output_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );";
12967
13031
 
12968
- var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}";
13032
+ var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) {\n\treturn linearClipZ * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * invClipZ - far );\n}";
12969
13033
 
12970
13034
  var premultiplied_alpha_fragment = "#ifdef PREMULTIPLIED_ALPHA\n\tgl_FragColor.rgb *= gl_FragColor.a;\n#endif";
12971
13035
 
@@ -13005,7 +13069,7 @@ var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp(
13005
13069
 
13006
13070
  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, vUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = 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, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif";
13007
13071
 
13008
- var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( attenuationDistance == 0.0 ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif";
13072
+ var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat framebufferLod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\t#ifdef texture2DLodEXT\n\t\t\treturn texture2DLodEXT( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#else\n\t\t\treturn texture2D( transmissionSamplerMap, fragCoord.xy, framebufferLod );\n\t\t#endif\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif";
13009
13073
 
13010
13074
  var uv_pars_fragment = "#if ( defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ) )\n\tvarying vec2 vUv;\n#endif";
13011
13075
 
@@ -13021,13 +13085,17 @@ var uv2_vertex = "#if defined( USE_LIGHTMAP ) || defined( USE_AOMAP )\n\tvUv2 =
13021
13085
 
13022
13086
  var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";
13023
13087
 
13024
- const vertex$g = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
13088
+ const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
13089
+
13090
+ const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\ttexColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
13091
+
13092
+ 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}";
13025
13093
 
13026
- const fragment$g = "uniform sampler2D t2D;\nvarying vec2 vUv;\nvoid main() {\n\tgl_FragColor = texture2D( t2D, vUv );\n\t#ifdef DECODE_VIDEO_TEXTURE\n\t\tgl_FragColor = vec4( mix( pow( gl_FragColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), gl_FragColor.rgb * 0.0773993808, vec3( lessThanEqual( gl_FragColor.rgb, vec3( 0.04045 ) ) ) ), gl_FragColor.w );\n\t#endif\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
13094
+ const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
13027
13095
 
13028
13096
  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}";
13029
13097
 
13030
- const fragment$f = "#include <envmap_common_pars_fragment>\nuniform float opacity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\tvec3 vReflect = vWorldDirection;\n\t#include <envmap_fragment>\n\tgl_FragColor = envColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
13098
+ 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 <encodings_fragment>\n}";
13031
13099
 
13032
13100
  const vertex$e = "#include <common>\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 <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}";
13033
13101
 
@@ -13193,8 +13261,10 @@ const ShaderChunk = {
13193
13261
  uv2_vertex: uv2_vertex,
13194
13262
  worldpos_vertex: worldpos_vertex,
13195
13263
 
13196
- background_vert: vertex$g,
13197
- background_frag: fragment$g,
13264
+ background_vert: vertex$h,
13265
+ background_frag: fragment$h,
13266
+ backgroundCube_vert: vertex$g,
13267
+ backgroundCube_frag: fragment$g,
13198
13268
  cube_vert: vertex$f,
13199
13269
  cube_frag: fragment$f,
13200
13270
  depth_vert: vertex$e,
@@ -13259,7 +13329,7 @@ const UniformsLib = {
13259
13329
  flipEnvMap: { value: - 1 },
13260
13330
  reflectivity: { value: 1.0 }, // basic, lambert, phong
13261
13331
  ior: { value: 1.5 }, // physical
13262
- refractionRatio: { value: 0.98 } // basic, lambert, phong
13332
+ refractionRatio: { value: 0.98 }, // basic, lambert, phong
13263
13333
 
13264
13334
  },
13265
13335
 
@@ -13652,6 +13722,7 @@ const ShaderLib = {
13652
13722
  uniforms: {
13653
13723
  uvTransform: { value: /*@__PURE__*/ new Matrix3() },
13654
13724
  t2D: { value: null },
13725
+ backgroundIntensity: { value: 1 }
13655
13726
  },
13656
13727
 
13657
13728
  vertexShader: ShaderChunk.background_vert,
@@ -13659,14 +13730,27 @@ const ShaderLib = {
13659
13730
 
13660
13731
  },
13661
13732
 
13733
+ backgroundCube: {
13734
+
13735
+ uniforms: {
13736
+ envMap: { value: null },
13737
+ flipEnvMap: { value: - 1 },
13738
+ backgroundBlurriness: { value: 0 },
13739
+ backgroundIntensity: { value: 1 }
13740
+ },
13741
+
13742
+ vertexShader: ShaderChunk.backgroundCube_vert,
13743
+ fragmentShader: ShaderChunk.backgroundCube_frag
13744
+
13745
+ },
13746
+
13662
13747
  cube: {
13663
13748
 
13664
- uniforms: /*@__PURE__*/ mergeUniforms( [
13665
- UniformsLib.envmap,
13666
- {
13667
- opacity: { value: 1.0 }
13668
- }
13669
- ] ),
13749
+ uniforms: {
13750
+ tCube: { value: null },
13751
+ tFlip: { value: - 1 },
13752
+ opacity: { value: 1.0 }
13753
+ },
13670
13754
 
13671
13755
  vertexShader: ShaderChunk.cube_vert,
13672
13756
  fragmentShader: ShaderChunk.cube_frag
@@ -13761,7 +13845,9 @@ ShaderLib.physical = {
13761
13845
 
13762
13846
  };
13763
13847
 
13764
- function WebGLBackground( renderer, cubemaps, state, objects, alpha, premultipliedAlpha ) {
13848
+ const _rgb = { r: 0, b: 0, g: 0 };
13849
+
13850
+ function WebGLBackground( renderer, cubemaps, cubeuvmaps, state, objects, alpha, premultipliedAlpha ) {
13765
13851
 
13766
13852
  const clearColor = new Color( 0x000000 );
13767
13853
  let clearAlpha = alpha === true ? 0 : 1;
@@ -13780,7 +13866,8 @@ function WebGLBackground( renderer, cubemaps, state, objects, alpha, premultipli
13780
13866
 
13781
13867
  if ( background && background.isTexture ) {
13782
13868
 
13783
- background = cubemaps.get( background );
13869
+ const usePMREM = scene.backgroundBlurriness > 0; // use PMREM if the user wants to blur the background
13870
+ background = ( usePMREM ? cubeuvmaps : cubemaps ).get( background );
13784
13871
 
13785
13872
  }
13786
13873
 
@@ -13821,9 +13908,9 @@ function WebGLBackground( renderer, cubemaps, state, objects, alpha, premultipli
13821
13908
  new BoxGeometry( 1, 1, 1 ),
13822
13909
  new ShaderMaterial( {
13823
13910
  name: 'BackgroundCubeMaterial',
13824
- uniforms: cloneUniforms( ShaderLib.cube.uniforms ),
13825
- vertexShader: ShaderLib.cube.vertexShader,
13826
- fragmentShader: ShaderLib.cube.fragmentShader,
13911
+ uniforms: cloneUniforms( ShaderLib.backgroundCube.uniforms ),
13912
+ vertexShader: ShaderLib.backgroundCube.vertexShader,
13913
+ fragmentShader: ShaderLib.backgroundCube.fragmentShader,
13827
13914
  side: BackSide,
13828
13915
  depthTest: false,
13829
13916
  depthWrite: false,
@@ -13857,6 +13944,8 @@ function WebGLBackground( renderer, cubemaps, state, objects, alpha, premultipli
13857
13944
 
13858
13945
  boxMesh.material.uniforms.envMap.value = background;
13859
13946
  boxMesh.material.uniforms.flipEnvMap.value = ( background.isCubeTexture && background.isRenderTargetTexture === false ) ? - 1 : 1;
13947
+ boxMesh.material.uniforms.backgroundBlurriness.value = scene.backgroundBlurriness;
13948
+ boxMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
13860
13949
 
13861
13950
  if ( currentBackground !== background ||
13862
13951
  currentBackgroundVersion !== background.version ||
@@ -13911,6 +14000,7 @@ function WebGLBackground( renderer, cubemaps, state, objects, alpha, premultipli
13911
14000
  }
13912
14001
 
13913
14002
  planeMesh.material.uniforms.t2D.value = background;
14003
+ planeMesh.material.uniforms.backgroundIntensity.value = scene.backgroundIntensity;
13914
14004
 
13915
14005
  if ( background.matrixAutoUpdate === true ) {
13916
14006
 
@@ -13943,7 +14033,9 @@ function WebGLBackground( renderer, cubemaps, state, objects, alpha, premultipli
13943
14033
 
13944
14034
  function setClear( color, alpha ) {
13945
14035
 
13946
- state.buffers.color.setClear( color.r, color.g, color.b, alpha, premultipliedAlpha );
14036
+ color.getRGB( _rgb, getUnlitUniformColorSpace( renderer ) );
14037
+
14038
+ state.buffers.color.setClear( _rgb.r, _rgb.g, _rgb.b, alpha, premultipliedAlpha );
13947
14039
 
13948
14040
  }
13949
14041
 
@@ -17312,17 +17404,32 @@ function setValueV1i( gl, v ) {
17312
17404
 
17313
17405
  }
17314
17406
 
17315
- // Single integer / boolean vector (from flat array)
17407
+ // Single integer / boolean vector (from flat array or THREE.VectorN)
17316
17408
 
17317
17409
  function setValueV2i( gl, v ) {
17318
17410
 
17319
17411
  const cache = this.cache;
17320
17412
 
17321
- if ( arraysEqual( cache, v ) ) return;
17413
+ if ( v.x !== undefined ) {
17322
17414
 
17323
- gl.uniform2iv( this.addr, v );
17415
+ if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {
17324
17416
 
17325
- copyArray( cache, v );
17417
+ gl.uniform2i( this.addr, v.x, v.y );
17418
+
17419
+ cache[ 0 ] = v.x;
17420
+ cache[ 1 ] = v.y;
17421
+
17422
+ }
17423
+
17424
+ } else {
17425
+
17426
+ if ( arraysEqual( cache, v ) ) return;
17427
+
17428
+ gl.uniform2iv( this.addr, v );
17429
+
17430
+ copyArray( cache, v );
17431
+
17432
+ }
17326
17433
 
17327
17434
  }
17328
17435
 
@@ -17330,11 +17437,27 @@ function setValueV3i( gl, v ) {
17330
17437
 
17331
17438
  const cache = this.cache;
17332
17439
 
17333
- if ( arraysEqual( cache, v ) ) return;
17440
+ if ( v.x !== undefined ) {
17334
17441
 
17335
- gl.uniform3iv( this.addr, v );
17442
+ if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {
17336
17443
 
17337
- copyArray( cache, v );
17444
+ gl.uniform3i( this.addr, v.x, v.y, v.z );
17445
+
17446
+ cache[ 0 ] = v.x;
17447
+ cache[ 1 ] = v.y;
17448
+ cache[ 2 ] = v.z;
17449
+
17450
+ }
17451
+
17452
+ } else {
17453
+
17454
+ if ( arraysEqual( cache, v ) ) return;
17455
+
17456
+ gl.uniform3iv( this.addr, v );
17457
+
17458
+ copyArray( cache, v );
17459
+
17460
+ }
17338
17461
 
17339
17462
  }
17340
17463
 
@@ -17342,11 +17465,28 @@ function setValueV4i( gl, v ) {
17342
17465
 
17343
17466
  const cache = this.cache;
17344
17467
 
17345
- if ( arraysEqual( cache, v ) ) return;
17468
+ if ( v.x !== undefined ) {
17346
17469
 
17347
- gl.uniform4iv( this.addr, v );
17470
+ if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {
17471
+
17472
+ gl.uniform4i( this.addr, v.x, v.y, v.z, v.w );
17348
17473
 
17349
- copyArray( cache, v );
17474
+ cache[ 0 ] = v.x;
17475
+ cache[ 1 ] = v.y;
17476
+ cache[ 2 ] = v.z;
17477
+ cache[ 3 ] = v.w;
17478
+
17479
+ }
17480
+
17481
+ } else {
17482
+
17483
+ if ( arraysEqual( cache, v ) ) return;
17484
+
17485
+ gl.uniform4iv( this.addr, v );
17486
+
17487
+ copyArray( cache, v );
17488
+
17489
+ }
17350
17490
 
17351
17491
  }
17352
17492
 
@@ -17364,17 +17504,32 @@ function setValueV1ui( gl, v ) {
17364
17504
 
17365
17505
  }
17366
17506
 
17367
- // Single unsigned integer vector (from flat array)
17507
+ // Single unsigned integer vector (from flat array or THREE.VectorN)
17368
17508
 
17369
17509
  function setValueV2ui( gl, v ) {
17370
17510
 
17371
17511
  const cache = this.cache;
17372
17512
 
17373
- if ( arraysEqual( cache, v ) ) return;
17513
+ if ( v.x !== undefined ) {
17374
17514
 
17375
- gl.uniform2uiv( this.addr, v );
17515
+ if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y ) {
17516
+
17517
+ gl.uniform2ui( this.addr, v.x, v.y );
17518
+
17519
+ cache[ 0 ] = v.x;
17520
+ cache[ 1 ] = v.y;
17521
+
17522
+ }
17523
+
17524
+ } else {
17525
+
17526
+ if ( arraysEqual( cache, v ) ) return;
17527
+
17528
+ gl.uniform2uiv( this.addr, v );
17529
+
17530
+ copyArray( cache, v );
17376
17531
 
17377
- copyArray( cache, v );
17532
+ }
17378
17533
 
17379
17534
  }
17380
17535
 
@@ -17382,11 +17537,27 @@ function setValueV3ui( gl, v ) {
17382
17537
 
17383
17538
  const cache = this.cache;
17384
17539
 
17385
- if ( arraysEqual( cache, v ) ) return;
17540
+ if ( v.x !== undefined ) {
17386
17541
 
17387
- gl.uniform3uiv( this.addr, v );
17542
+ if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z ) {
17388
17543
 
17389
- copyArray( cache, v );
17544
+ gl.uniform3ui( this.addr, v.x, v.y, v.z );
17545
+
17546
+ cache[ 0 ] = v.x;
17547
+ cache[ 1 ] = v.y;
17548
+ cache[ 2 ] = v.z;
17549
+
17550
+ }
17551
+
17552
+ } else {
17553
+
17554
+ if ( arraysEqual( cache, v ) ) return;
17555
+
17556
+ gl.uniform3uiv( this.addr, v );
17557
+
17558
+ copyArray( cache, v );
17559
+
17560
+ }
17390
17561
 
17391
17562
  }
17392
17563
 
@@ -17394,11 +17565,28 @@ function setValueV4ui( gl, v ) {
17394
17565
 
17395
17566
  const cache = this.cache;
17396
17567
 
17397
- if ( arraysEqual( cache, v ) ) return;
17568
+ if ( v.x !== undefined ) {
17569
+
17570
+ if ( cache[ 0 ] !== v.x || cache[ 1 ] !== v.y || cache[ 2 ] !== v.z || cache[ 3 ] !== v.w ) {
17571
+
17572
+ gl.uniform4ui( this.addr, v.x, v.y, v.z, v.w );
17398
17573
 
17399
- gl.uniform4uiv( this.addr, v );
17574
+ cache[ 0 ] = v.x;
17575
+ cache[ 1 ] = v.y;
17576
+ cache[ 2 ] = v.z;
17577
+ cache[ 3 ] = v.w;
17578
+
17579
+ }
17580
+
17581
+ } else {
17400
17582
 
17401
- copyArray( cache, v );
17583
+ if ( arraysEqual( cache, v ) ) return;
17584
+
17585
+ gl.uniform4uiv( this.addr, v );
17586
+
17587
+ copyArray( cache, v );
17588
+
17589
+ }
17402
17590
 
17403
17591
  }
17404
17592
 
@@ -17644,11 +17832,19 @@ function setValueV4uiArray( gl, v ) {
17644
17832
 
17645
17833
  function setValueT1Array( gl, v, textures ) {
17646
17834
 
17835
+ const cache = this.cache;
17836
+
17647
17837
  const n = v.length;
17648
17838
 
17649
17839
  const units = allocTexUnits( textures, n );
17650
17840
 
17651
- gl.uniform1iv( this.addr, units );
17841
+ if ( ! arraysEqual( cache, units ) ) {
17842
+
17843
+ gl.uniform1iv( this.addr, units );
17844
+
17845
+ copyArray( cache, units );
17846
+
17847
+ }
17652
17848
 
17653
17849
  for ( let i = 0; i !== n; ++ i ) {
17654
17850
 
@@ -17660,11 +17856,19 @@ function setValueT1Array( gl, v, textures ) {
17660
17856
 
17661
17857
  function setValueT3DArray( gl, v, textures ) {
17662
17858
 
17859
+ const cache = this.cache;
17860
+
17663
17861
  const n = v.length;
17664
17862
 
17665
17863
  const units = allocTexUnits( textures, n );
17666
17864
 
17667
- gl.uniform1iv( this.addr, units );
17865
+ if ( ! arraysEqual( cache, units ) ) {
17866
+
17867
+ gl.uniform1iv( this.addr, units );
17868
+
17869
+ copyArray( cache, units );
17870
+
17871
+ }
17668
17872
 
17669
17873
  for ( let i = 0; i !== n; ++ i ) {
17670
17874
 
@@ -17676,11 +17880,19 @@ function setValueT3DArray( gl, v, textures ) {
17676
17880
 
17677
17881
  function setValueT6Array( gl, v, textures ) {
17678
17882
 
17883
+ const cache = this.cache;
17884
+
17679
17885
  const n = v.length;
17680
17886
 
17681
17887
  const units = allocTexUnits( textures, n );
17682
17888
 
17683
- gl.uniform1iv( this.addr, units );
17889
+ if ( ! arraysEqual( cache, units ) ) {
17890
+
17891
+ gl.uniform1iv( this.addr, units );
17892
+
17893
+ copyArray( cache, units );
17894
+
17895
+ }
17684
17896
 
17685
17897
  for ( let i = 0; i !== n; ++ i ) {
17686
17898
 
@@ -17692,11 +17904,19 @@ function setValueT6Array( gl, v, textures ) {
17692
17904
 
17693
17905
  function setValueT2DArrayArray( gl, v, textures ) {
17694
17906
 
17907
+ const cache = this.cache;
17908
+
17695
17909
  const n = v.length;
17696
17910
 
17697
17911
  const units = allocTexUnits( textures, n );
17698
17912
 
17699
- gl.uniform1iv( this.addr, units );
17913
+ if ( ! arraysEqual( cache, units ) ) {
17914
+
17915
+ gl.uniform1iv( this.addr, units );
17916
+
17917
+ copyArray( cache, units );
17918
+
17919
+ }
17700
17920
 
17701
17921
  for ( let i = 0; i !== n; ++ i ) {
17702
17922
 
@@ -20138,10 +20358,6 @@ function WebGLLights( extensions, capabilities ) {
20138
20358
 
20139
20359
  const uniforms = cache.get( light );
20140
20360
 
20141
- // (a) intensity is the total visible light emitted
20142
- //uniforms.color.copy( color ).multiplyScalar( intensity / ( light.width * light.height * Math.PI ) );
20143
-
20144
- // (b) intensity is the brightness of the light
20145
20361
  uniforms.color.copy( color ).multiplyScalar( intensity );
20146
20362
 
20147
20363
  uniforms.halfWidth.set( light.width * 0.5, 0.0, 0.0 );
@@ -20812,7 +21028,8 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
20812
21028
 
20813
21029
  if ( ( _renderer.localClippingEnabled && material.clipShadows === true && Array.isArray( material.clippingPlanes ) && material.clippingPlanes.length !== 0 ) ||
20814
21030
  ( material.displacementMap && material.displacementScale !== 0 ) ||
20815
- ( material.alphaMap && material.alphaTest > 0 ) ) {
21031
+ ( material.alphaMap && material.alphaTest > 0 ) ||
21032
+ ( material.map && material.alphaTest > 0 ) ) {
20816
21033
 
20817
21034
  // in this case we need a unique material instance reflecting the
20818
21035
  // appropriate state
@@ -20856,6 +21073,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
20856
21073
 
20857
21074
  result.alphaMap = material.alphaMap;
20858
21075
  result.alphaTest = material.alphaTest;
21076
+ result.map = material.map;
20859
21077
 
20860
21078
  result.clipShadows = material.clipShadows;
20861
21079
  result.clippingPlanes = material.clippingPlanes;
@@ -21040,59 +21258,51 @@ function WebGLState( gl, extensions, capabilities ) {
21040
21258
 
21041
21259
  if ( currentDepthFunc !== depthFunc ) {
21042
21260
 
21043
- if ( depthFunc ) {
21044
-
21045
- switch ( depthFunc ) {
21046
-
21047
- case NeverDepth:
21261
+ switch ( depthFunc ) {
21048
21262
 
21049
- gl.depthFunc( 512 );
21050
- break;
21051
-
21052
- case AlwaysDepth:
21263
+ case NeverDepth:
21053
21264
 
21054
- gl.depthFunc( 519 );
21055
- break;
21265
+ gl.depthFunc( 512 );
21266
+ break;
21056
21267
 
21057
- case LessDepth:
21268
+ case AlwaysDepth:
21058
21269
 
21059
- gl.depthFunc( 513 );
21060
- break;
21270
+ gl.depthFunc( 519 );
21271
+ break;
21061
21272
 
21062
- case LessEqualDepth:
21273
+ case LessDepth:
21063
21274
 
21064
- gl.depthFunc( 515 );
21065
- break;
21275
+ gl.depthFunc( 513 );
21276
+ break;
21066
21277
 
21067
- case EqualDepth:
21278
+ case LessEqualDepth:
21068
21279
 
21069
- gl.depthFunc( 514 );
21070
- break;
21071
-
21072
- case GreaterEqualDepth:
21280
+ gl.depthFunc( 515 );
21281
+ break;
21073
21282
 
21074
- gl.depthFunc( 518 );
21075
- break;
21283
+ case EqualDepth:
21076
21284
 
21077
- case GreaterDepth:
21285
+ gl.depthFunc( 514 );
21286
+ break;
21078
21287
 
21079
- gl.depthFunc( 516 );
21080
- break;
21288
+ case GreaterEqualDepth:
21081
21289
 
21082
- case NotEqualDepth:
21290
+ gl.depthFunc( 518 );
21291
+ break;
21083
21292
 
21084
- gl.depthFunc( 517 );
21085
- break;
21293
+ case GreaterDepth:
21086
21294
 
21087
- default:
21295
+ gl.depthFunc( 516 );
21296
+ break;
21088
21297
 
21089
- gl.depthFunc( 515 );
21298
+ case NotEqualDepth:
21090
21299
 
21091
- }
21300
+ gl.depthFunc( 517 );
21301
+ break;
21092
21302
 
21093
- } else {
21303
+ default:
21094
21304
 
21095
- gl.depthFunc( 515 );
21305
+ gl.depthFunc( 515 );
21096
21306
 
21097
21307
  }
21098
21308
 
@@ -21663,7 +21873,7 @@ function WebGLState( gl, extensions, capabilities ) {
21663
21873
  }
21664
21874
 
21665
21875
  currentBlending = blending;
21666
- currentPremultipledAlpha = null;
21876
+ currentPremultipledAlpha = false;
21667
21877
 
21668
21878
  }
21669
21879
 
@@ -21825,25 +22035,40 @@ function WebGLState( gl, extensions, capabilities ) {
21825
22035
 
21826
22036
  }
21827
22037
 
21828
- function bindTexture( webglType, webglTexture ) {
22038
+ function bindTexture( webglType, webglTexture, webglSlot ) {
22039
+
22040
+ if ( webglSlot === undefined ) {
22041
+
22042
+ if ( currentTextureSlot === null ) {
21829
22043
 
21830
- if ( currentTextureSlot === null ) {
22044
+ webglSlot = 33984 + maxTextures - 1;
21831
22045
 
21832
- activeTexture();
22046
+ } else {
22047
+
22048
+ webglSlot = currentTextureSlot;
22049
+
22050
+ }
21833
22051
 
21834
22052
  }
21835
22053
 
21836
- let boundTexture = currentBoundTextures[ currentTextureSlot ];
22054
+ let boundTexture = currentBoundTextures[ webglSlot ];
21837
22055
 
21838
22056
  if ( boundTexture === undefined ) {
21839
22057
 
21840
22058
  boundTexture = { type: undefined, texture: undefined };
21841
- currentBoundTextures[ currentTextureSlot ] = boundTexture;
22059
+ currentBoundTextures[ webglSlot ] = boundTexture;
21842
22060
 
21843
22061
  }
21844
22062
 
21845
22063
  if ( boundTexture.type !== webglType || boundTexture.texture !== webglTexture ) {
21846
22064
 
22065
+ if ( currentTextureSlot !== webglSlot ) {
22066
+
22067
+ gl.activeTexture( webglSlot );
22068
+ currentTextureSlot = webglSlot;
22069
+
22070
+ }
22071
+
21847
22072
  gl.bindTexture( webglType, webglTexture || emptyTextures[ webglType ] );
21848
22073
 
21849
22074
  boundTexture.type = webglType;
@@ -21882,6 +22107,20 @@ function WebGLState( gl, extensions, capabilities ) {
21882
22107
 
21883
22108
  }
21884
22109
 
22110
+ function compressedTexImage3D() {
22111
+
22112
+ try {
22113
+
22114
+ gl.compressedTexImage3D.apply( gl, arguments );
22115
+
22116
+ } catch ( error ) {
22117
+
22118
+ console.error( 'THREE.WebGLState:', error );
22119
+
22120
+ }
22121
+
22122
+ }
22123
+
21885
22124
  function texSubImage2D() {
21886
22125
 
21887
22126
  try {
@@ -21924,6 +22163,20 @@ function WebGLState( gl, extensions, capabilities ) {
21924
22163
 
21925
22164
  }
21926
22165
 
22166
+ function compressedTexSubImage3D() {
22167
+
22168
+ try {
22169
+
22170
+ gl.compressedTexSubImage3D.apply( gl, arguments );
22171
+
22172
+ } catch ( error ) {
22173
+
22174
+ console.error( 'THREE.WebGLState:', error );
22175
+
22176
+ }
22177
+
22178
+ }
22179
+
21927
22180
  function texStorage2D() {
21928
22181
 
21929
22182
  try {
@@ -22169,6 +22422,7 @@ function WebGLState( gl, extensions, capabilities ) {
22169
22422
  bindTexture: bindTexture,
22170
22423
  unbindTexture: unbindTexture,
22171
22424
  compressedTexImage2D: compressedTexImage2D,
22425
+ compressedTexImage3D: compressedTexImage3D,
22172
22426
  texImage2D: texImage2D,
22173
22427
  texImage3D: texImage3D,
22174
22428
 
@@ -22180,6 +22434,7 @@ function WebGLState( gl, extensions, capabilities ) {
22180
22434
  texSubImage2D: texSubImage2D,
22181
22435
  texSubImage3D: texSubImage3D,
22182
22436
  compressedTexSubImage2D: compressedTexSubImage2D,
22437
+ compressedTexSubImage3D: compressedTexSubImage3D,
22183
22438
 
22184
22439
  scissor: scissor,
22185
22440
  viewport: viewport,
@@ -22198,7 +22453,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
22198
22453
  const maxTextureSize = capabilities.maxTextureSize;
22199
22454
  const maxSamples = capabilities.maxSamples;
22200
22455
  const multisampledRTTExt = extensions.has( 'WEBGL_multisampled_render_to_texture' ) ? extensions.get( 'WEBGL_multisampled_render_to_texture' ) : null;
22201
- const supportsInvalidateFramebuffer = /OculusBrowser/g.test( navigator.userAgent );
22456
+ const supportsInvalidateFramebuffer = typeof navigator === 'undefined' ? false : /OculusBrowser/g.test( navigator.userAgent );
22202
22457
 
22203
22458
  const _videoTextures = new WeakMap();
22204
22459
  let _canvas;
@@ -22322,7 +22577,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
22322
22577
 
22323
22578
  }
22324
22579
 
22325
- function getInternalFormat( internalFormatName, glFormat, glType, encoding, isVideoTexture = false ) {
22580
+ function getInternalFormat( internalFormatName, glFormat, glType, encoding, forceLinearEncoding = false ) {
22326
22581
 
22327
22582
  if ( isWebGL2 === false ) return glFormat;
22328
22583
 
@@ -22356,7 +22611,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
22356
22611
 
22357
22612
  if ( glType === 5126 ) internalFormat = 34836;
22358
22613
  if ( glType === 5131 ) internalFormat = 34842;
22359
- if ( glType === 5121 ) internalFormat = ( encoding === sRGBEncoding && isVideoTexture === false ) ? 35907 : 32856;
22614
+ if ( glType === 5121 ) internalFormat = ( encoding === sRGBEncoding && forceLinearEncoding === false ) ? 35907 : 32856;
22360
22615
  if ( glType === 32819 ) internalFormat = 32854;
22361
22616
  if ( glType === 32820 ) internalFormat = 32855;
22362
22617
 
@@ -22602,6 +22857,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
22602
22857
 
22603
22858
  array.push( texture.wrapS );
22604
22859
  array.push( texture.wrapT );
22860
+ array.push( texture.wrapR || 0 );
22605
22861
  array.push( texture.magFilter );
22606
22862
  array.push( texture.minFilter );
22607
22863
  array.push( texture.anisotropy );
@@ -22647,8 +22903,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
22647
22903
 
22648
22904
  }
22649
22905
 
22650
- state.activeTexture( 33984 + slot );
22651
- state.bindTexture( 3553, textureProperties.__webglTexture );
22906
+ state.bindTexture( 3553, textureProperties.__webglTexture, 33984 + slot );
22652
22907
 
22653
22908
  }
22654
22909
 
@@ -22663,8 +22918,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
22663
22918
 
22664
22919
  }
22665
22920
 
22666
- state.activeTexture( 33984 + slot );
22667
- state.bindTexture( 35866, textureProperties.__webglTexture );
22921
+ state.bindTexture( 35866, textureProperties.__webglTexture, 33984 + slot );
22668
22922
 
22669
22923
  }
22670
22924
 
@@ -22679,8 +22933,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
22679
22933
 
22680
22934
  }
22681
22935
 
22682
- state.activeTexture( 33984 + slot );
22683
- state.bindTexture( 32879, textureProperties.__webglTexture );
22936
+ state.bindTexture( 32879, textureProperties.__webglTexture, 33984 + slot );
22684
22937
 
22685
22938
  }
22686
22939
 
@@ -22695,8 +22948,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
22695
22948
 
22696
22949
  }
22697
22950
 
22698
- state.activeTexture( 33984 + slot );
22699
- state.bindTexture( 34067, textureProperties.__webglTexture );
22951
+ state.bindTexture( 34067, textureProperties.__webglTexture, 33984 + slot );
22700
22952
 
22701
22953
  }
22702
22954
 
@@ -22862,16 +23114,19 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
22862
23114
 
22863
23115
  let textureType = 3553;
22864
23116
 
22865
- if ( texture.isDataArrayTexture ) textureType = 35866;
23117
+ if ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) textureType = 35866;
22866
23118
  if ( texture.isData3DTexture ) textureType = 32879;
22867
23119
 
22868
23120
  const forceUpload = initTexture( textureProperties, texture );
22869
23121
  const source = texture.source;
22870
23122
 
22871
- state.activeTexture( 33984 + slot );
22872
- state.bindTexture( textureType, textureProperties.__webglTexture );
23123
+ state.bindTexture( textureType, textureProperties.__webglTexture, 33984 + slot );
23124
+
23125
+ const sourceProperties = properties.get( source );
22873
23126
 
22874
- if ( source.version !== source.__currentVersion || forceUpload === true ) {
23127
+ if ( source.version !== sourceProperties.__version || forceUpload === true ) {
23128
+
23129
+ state.activeTexture( 33984 + slot );
22875
23130
 
22876
23131
  _gl.pixelStorei( 37440, texture.flipY );
22877
23132
  _gl.pixelStorei( 37441, texture.premultiplyAlpha );
@@ -22894,7 +23149,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
22894
23149
  const mipmaps = texture.mipmaps;
22895
23150
 
22896
23151
  const useTexStorage = ( isWebGL2 && texture.isVideoTexture !== true );
22897
- const allocateMemory = ( source.__currentVersion === undefined ) || ( forceUpload === true );
23152
+ const allocateMemory = ( sourceProperties.__version === undefined ) || ( forceUpload === true );
22898
23153
  const levels = getMipLevels( texture, image, supportsMips );
22899
23154
 
22900
23155
  if ( texture.isDepthTexture ) {
@@ -23041,45 +23296,97 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
23041
23296
 
23042
23297
  } else if ( texture.isCompressedTexture ) {
23043
23298
 
23044
- if ( useTexStorage && allocateMemory ) {
23299
+ if ( texture.isCompressedArrayTexture ) {
23045
23300
 
23046
- state.texStorage2D( 3553, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );
23301
+ if ( useTexStorage && allocateMemory ) {
23047
23302
 
23048
- }
23303
+ state.texStorage3D( 35866, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height, image.depth );
23049
23304
 
23050
- for ( let i = 0, il = mipmaps.length; i < il; i ++ ) {
23305
+ }
23051
23306
 
23052
- mipmap = mipmaps[ i ];
23307
+ for ( let i = 0, il = mipmaps.length; i < il; i ++ ) {
23053
23308
 
23054
- if ( texture.format !== RGBAFormat ) {
23309
+ mipmap = mipmaps[ i ];
23055
23310
 
23056
- if ( glFormat !== null ) {
23311
+ if ( texture.format !== RGBAFormat ) {
23057
23312
 
23058
- if ( useTexStorage ) {
23313
+ if ( glFormat !== null ) {
23314
+
23315
+ if ( useTexStorage ) {
23316
+
23317
+ state.compressedTexSubImage3D( 35866, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, mipmap.data, 0, 0 );
23059
23318
 
23060
- state.compressedTexSubImage2D( 3553, i, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );
23319
+ } else {
23320
+
23321
+ state.compressedTexImage3D( 35866, i, glInternalFormat, mipmap.width, mipmap.height, image.depth, 0, mipmap.data, 0, 0 );
23322
+
23323
+ }
23061
23324
 
23062
23325
  } else {
23063
23326
 
23064
- state.compressedTexImage2D( 3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data );
23327
+ console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );
23065
23328
 
23066
23329
  }
23067
23330
 
23068
23331
  } else {
23069
23332
 
23070
- console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );
23333
+ if ( useTexStorage ) {
23334
+
23335
+ state.texSubImage3D( 35866, i, 0, 0, 0, mipmap.width, mipmap.height, image.depth, glFormat, glType, mipmap.data );
23336
+
23337
+ } else {
23338
+
23339
+ state.texImage3D( 35866, i, glInternalFormat, mipmap.width, mipmap.height, image.depth, 0, glFormat, glType, mipmap.data );
23340
+
23341
+ }
23071
23342
 
23072
23343
  }
23073
23344
 
23074
- } else {
23345
+ }
23075
23346
 
23076
- if ( useTexStorage ) {
23347
+ } else {
23077
23348
 
23078
- state.texSubImage2D( 3553, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );
23349
+ if ( useTexStorage && allocateMemory ) {
23350
+
23351
+ state.texStorage2D( 3553, levels, glInternalFormat, mipmaps[ 0 ].width, mipmaps[ 0 ].height );
23352
+
23353
+ }
23354
+
23355
+ for ( let i = 0, il = mipmaps.length; i < il; i ++ ) {
23356
+
23357
+ mipmap = mipmaps[ i ];
23358
+
23359
+ if ( texture.format !== RGBAFormat ) {
23360
+
23361
+ if ( glFormat !== null ) {
23362
+
23363
+ if ( useTexStorage ) {
23364
+
23365
+ state.compressedTexSubImage2D( 3553, i, 0, 0, mipmap.width, mipmap.height, glFormat, mipmap.data );
23366
+
23367
+ } else {
23368
+
23369
+ state.compressedTexImage2D( 3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, mipmap.data );
23370
+
23371
+ }
23372
+
23373
+ } else {
23374
+
23375
+ console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );
23376
+
23377
+ }
23079
23378
 
23080
23379
  } else {
23081
23380
 
23082
- state.texImage2D( 3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );
23381
+ if ( useTexStorage ) {
23382
+
23383
+ state.texSubImage2D( 3553, i, 0, 0, mipmap.width, mipmap.height, glFormat, glType, mipmap.data );
23384
+
23385
+ } else {
23386
+
23387
+ state.texImage2D( 3553, i, glInternalFormat, mipmap.width, mipmap.height, 0, glFormat, glType, mipmap.data );
23388
+
23389
+ }
23083
23390
 
23084
23391
  }
23085
23392
 
@@ -23210,7 +23517,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
23210
23517
 
23211
23518
  }
23212
23519
 
23213
- source.__currentVersion = source.version;
23520
+ sourceProperties.__version = source.version;
23214
23521
 
23215
23522
  if ( texture.onUpdate ) texture.onUpdate( texture );
23216
23523
 
@@ -23227,10 +23534,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
23227
23534
  const forceUpload = initTexture( textureProperties, texture );
23228
23535
  const source = texture.source;
23229
23536
 
23230
- state.activeTexture( 33984 + slot );
23231
- state.bindTexture( 34067, textureProperties.__webglTexture );
23537
+ state.bindTexture( 34067, textureProperties.__webglTexture, 33984 + slot );
23538
+
23539
+ const sourceProperties = properties.get( source );
23232
23540
 
23233
- if ( source.version !== source.__currentVersion || forceUpload === true ) {
23541
+ if ( source.version !== sourceProperties.__version || forceUpload === true ) {
23542
+
23543
+ state.activeTexture( 33984 + slot );
23234
23544
 
23235
23545
  _gl.pixelStorei( 37440, texture.flipY );
23236
23546
  _gl.pixelStorei( 37441, texture.premultiplyAlpha );
@@ -23265,7 +23575,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
23265
23575
  glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding );
23266
23576
 
23267
23577
  const useTexStorage = ( isWebGL2 && texture.isVideoTexture !== true );
23268
- const allocateMemory = ( source.__currentVersion === undefined ) || ( forceUpload === true );
23578
+ const allocateMemory = ( sourceProperties.__version === undefined ) || ( forceUpload === true );
23269
23579
  let levels = getMipLevels( texture, image, supportsMips );
23270
23580
 
23271
23581
  setTextureParameters( 34067, texture, supportsMips );
@@ -23414,7 +23724,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
23414
23724
 
23415
23725
  }
23416
23726
 
23417
- source.__currentVersion = source.version;
23727
+ sourceProperties.__version = source.version;
23418
23728
 
23419
23729
  if ( texture.onUpdate ) texture.onUpdate( texture );
23420
23730
 
@@ -23454,7 +23764,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
23454
23764
 
23455
23765
  multisampledRTTExt.framebufferTexture2DMultisampleEXT( 36160, attachment, textureTarget, properties.get( texture ).__webglTexture, 0, getRenderTargetSamples( renderTarget ) );
23456
23766
 
23457
- } else {
23767
+ } else if ( textureTarget === 3553 || ( textureTarget >= 34069 && textureTarget <= 34074 ) ) { // see #24753
23458
23768
 
23459
23769
  _gl.framebufferTexture2D( 36160, attachment, textureTarget, properties.get( texture ).__webglTexture, 0 );
23460
23770
 
@@ -23778,7 +24088,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
23778
24088
 
23779
24089
  const glFormat = utils.convert( texture.format, texture.encoding );
23780
24090
  const glType = utils.convert( texture.type );
23781
- const glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding );
24091
+ const glInternalFormat = getInternalFormat( texture.internalFormat, glFormat, glType, texture.encoding, renderTarget.isXRRenderTarget === true );
23782
24092
  const samples = getRenderTargetSamples( renderTarget );
23783
24093
  _gl.renderbufferStorageMultisample( 36161, samples, glInternalFormat, renderTarget.width, renderTarget.height );
23784
24094
 
@@ -24169,7 +24479,6 @@ function WebGLUtils( gl, extensions, capabilities ) {
24169
24479
  if ( p === LuminanceAlphaFormat ) return 6410;
24170
24480
  if ( p === DepthFormat ) return 6402;
24171
24481
  if ( p === DepthStencilFormat ) return 34041;
24172
- if ( p === RedFormat ) return 6403;
24173
24482
 
24174
24483
  // @deprecated since r137
24175
24484
 
@@ -24200,6 +24509,7 @@ function WebGLUtils( gl, extensions, capabilities ) {
24200
24509
 
24201
24510
  // WebGL2 formats.
24202
24511
 
24512
+ if ( p === RedFormat ) return 6403;
24203
24513
  if ( p === RedIntegerFormat ) return 36244;
24204
24514
  if ( p === RGFormat ) return 33319;
24205
24515
  if ( p === RGIntegerFormat ) return 33320;
@@ -25038,6 +25348,31 @@ class WebXRController {
25038
25348
 
25039
25349
  }
25040
25350
 
25351
+ connect( inputSource ) {
25352
+
25353
+ if ( inputSource && inputSource.hand ) {
25354
+
25355
+ const hand = this._hand;
25356
+
25357
+ if ( hand ) {
25358
+
25359
+ for ( const inputjoint of inputSource.hand.values() ) {
25360
+
25361
+ // Initialize hand with joints when connected
25362
+ this._getHandJoint( hand, inputjoint );
25363
+
25364
+ }
25365
+
25366
+ }
25367
+
25368
+ }
25369
+
25370
+ this.dispatchEvent( { type: 'connected', data: inputSource } );
25371
+
25372
+ return this;
25373
+
25374
+ }
25375
+
25041
25376
  disconnect( inputSource ) {
25042
25377
 
25043
25378
  this.dispatchEvent( { type: 'disconnected', data: inputSource } );
@@ -25085,19 +25420,8 @@ class WebXRController {
25085
25420
  // Update the joints groups with the XRJoint poses
25086
25421
  const jointPose = frame.getJointPose( inputjoint, referenceSpace );
25087
25422
 
25088
- if ( hand.joints[ inputjoint.jointName ] === undefined ) {
25089
-
25090
- // The transform of this joint will be updated with the joint pose on each frame
25091
- const joint = new Group();
25092
- joint.matrixAutoUpdate = false;
25093
- joint.visible = false;
25094
- hand.joints[ inputjoint.jointName ] = joint;
25095
- // ??
25096
- hand.add( joint );
25097
-
25098
- }
25099
-
25100
- const joint = hand.joints[ inputjoint.jointName ];
25423
+ // The transform of this joint will be updated with the joint pose on each frame
25424
+ const joint = this._getHandJoint( hand, inputjoint );
25101
25425
 
25102
25426
  if ( jointPose !== null ) {
25103
25427
 
@@ -25249,6 +25573,25 @@ class WebXRController {
25249
25573
 
25250
25574
  }
25251
25575
 
25576
+ // private method
25577
+
25578
+ _getHandJoint( hand, inputjoint ) {
25579
+
25580
+ if ( hand.joints[ inputjoint.jointName ] === undefined ) {
25581
+
25582
+ const joint = new Group();
25583
+ joint.matrixAutoUpdate = false;
25584
+ joint.visible = false;
25585
+ hand.joints[ inputjoint.jointName ] = joint;
25586
+
25587
+ hand.add( joint );
25588
+
25589
+ }
25590
+
25591
+ return hand.joints[ inputjoint.jointName ];
25592
+
25593
+ }
25594
+
25252
25595
  }
25253
25596
 
25254
25597
  class DepthTexture extends Texture {
@@ -25313,6 +25656,9 @@ class WebXRManager extends EventDispatcher {
25313
25656
  const controllers = [];
25314
25657
  const controllerInputSources = [];
25315
25658
 
25659
+ const planes = new Set();
25660
+ const planesLastChangedTimes = new Map();
25661
+
25316
25662
  //
25317
25663
 
25318
25664
  const cameraL = new PerspectiveCamera();
@@ -25662,7 +26008,7 @@ class WebXRManager extends EventDispatcher {
25662
26008
  if ( index >= 0 ) {
25663
26009
 
25664
26010
  controllerInputSources[ index ] = null;
25665
- controllers[ index ].dispatchEvent( { type: 'disconnected', data: inputSource } );
26011
+ controllers[ index ].disconnect( inputSource );
25666
26012
 
25667
26013
  }
25668
26014
 
@@ -25708,7 +26054,7 @@ class WebXRManager extends EventDispatcher {
25708
26054
 
25709
26055
  if ( controller ) {
25710
26056
 
25711
- controller.dispatchEvent( { type: 'connected', data: inputSource } );
26057
+ controller.connect( inputSource );
25712
26058
 
25713
26059
  }
25714
26060
 
@@ -25905,6 +26251,12 @@ class WebXRManager extends EventDispatcher {
25905
26251
 
25906
26252
  };
25907
26253
 
26254
+ this.getPlanes = function () {
26255
+
26256
+ return planes;
26257
+
26258
+ };
26259
+
25908
26260
  // Animation Loop
25909
26261
 
25910
26262
  let onAnimationFrameCallback = null;
@@ -26013,6 +26365,65 @@ class WebXRManager extends EventDispatcher {
26013
26365
 
26014
26366
  if ( onAnimationFrameCallback ) onAnimationFrameCallback( time, frame );
26015
26367
 
26368
+ if ( frame.detectedPlanes ) {
26369
+
26370
+ scope.dispatchEvent( { type: 'planesdetected', data: frame.detectedPlanes } );
26371
+
26372
+ let planesToRemove = null;
26373
+
26374
+ for ( const plane of planes ) {
26375
+
26376
+ if ( ! frame.detectedPlanes.has( plane ) ) {
26377
+
26378
+ if ( planesToRemove === null ) {
26379
+
26380
+ planesToRemove = [];
26381
+
26382
+ }
26383
+
26384
+ planesToRemove.push( plane );
26385
+
26386
+ }
26387
+
26388
+ }
26389
+
26390
+ if ( planesToRemove !== null ) {
26391
+
26392
+ for ( const plane of planesToRemove ) {
26393
+
26394
+ planes.delete( plane );
26395
+ planesLastChangedTimes.delete( plane );
26396
+ scope.dispatchEvent( { type: 'planeremoved', data: plane } );
26397
+
26398
+ }
26399
+
26400
+ }
26401
+
26402
+ for ( const plane of frame.detectedPlanes ) {
26403
+
26404
+ if ( ! planes.has( plane ) ) {
26405
+
26406
+ planes.add( plane );
26407
+ planesLastChangedTimes.set( plane, frame.lastChangedTime );
26408
+ scope.dispatchEvent( { type: 'planeadded', data: plane } );
26409
+
26410
+ } else {
26411
+
26412
+ const lastKnownTime = planesLastChangedTimes.get( plane );
26413
+
26414
+ if ( plane.lastChangedTime > lastKnownTime ) {
26415
+
26416
+ planesLastChangedTimes.set( plane, plane.lastChangedTime );
26417
+ scope.dispatchEvent( { type: 'planechanged', data: plane } );
26418
+
26419
+ }
26420
+
26421
+ }
26422
+
26423
+ }
26424
+
26425
+ }
26426
+
26016
26427
  xrFrame = null;
26017
26428
 
26018
26429
  }
@@ -26037,7 +26448,7 @@ function WebGLMaterials( renderer, properties ) {
26037
26448
 
26038
26449
  function refreshFogUniforms( uniforms, fog ) {
26039
26450
 
26040
- uniforms.fogColor.value.copy( fog.color );
26451
+ fog.color.getRGB( uniforms.fogColor.value, getUnlitUniformColorSpace( renderer ) );
26041
26452
 
26042
26453
  if ( fog.isFog ) {
26043
26454
 
@@ -27164,28 +27575,6 @@ function WebGLRenderer( parameters = {} ) {
27164
27575
  this.toneMapping = NoToneMapping;
27165
27576
  this.toneMappingExposure = 1.0;
27166
27577
 
27167
- //
27168
-
27169
- Object.defineProperties( this, {
27170
-
27171
- // @deprecated since r136, 0e21088102b4de7e0a0a33140620b7a3424b9e6d
27172
-
27173
- gammaFactor: {
27174
- get: function () {
27175
-
27176
- console.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' );
27177
- return 2;
27178
-
27179
- },
27180
- set: function () {
27181
-
27182
- console.warn( 'THREE.WebGLRenderer: .gammaFactor has been removed.' );
27183
-
27184
- }
27185
- }
27186
-
27187
- } );
27188
-
27189
27578
  // internal properties
27190
27579
 
27191
27580
  const _this = this;
@@ -27367,7 +27756,7 @@ function WebGLRenderer( parameters = {} ) {
27367
27756
  materials = new WebGLMaterials( _this, properties );
27368
27757
  renderLists = new WebGLRenderLists();
27369
27758
  renderStates = new WebGLRenderStates( extensions, capabilities );
27370
- background = new WebGLBackground( _this, cubemaps, state, objects, _alpha, _premultipliedAlpha );
27759
+ background = new WebGLBackground( _this, cubemaps, cubeuvmaps, state, objects, _alpha, _premultipliedAlpha );
27371
27760
  shadowMap = new WebGLShadowMap( _this, objects, capabilities );
27372
27761
  uniformsGroups = new WebGLUniformsGroups( _gl, info, capabilities, state );
27373
27762
 
@@ -27750,31 +28139,48 @@ function WebGLRenderer( parameters = {} ) {
27750
28139
  //
27751
28140
 
27752
28141
  let index = geometry.index;
27753
- const position = geometry.attributes.position;
28142
+ let rangeFactor = 1;
28143
+
28144
+ if ( material.wireframe === true ) {
28145
+
28146
+ index = geometries.getWireframeAttribute( geometry );
28147
+ rangeFactor = 2;
28148
+
28149
+ }
27754
28150
 
27755
28151
  //
27756
28152
 
27757
- if ( index === null ) {
28153
+ const drawRange = geometry.drawRange;
28154
+ const position = geometry.attributes.position;
27758
28155
 
27759
- if ( position === undefined || position.count === 0 ) return;
28156
+ let drawStart = drawRange.start * rangeFactor;
28157
+ let drawEnd = ( drawRange.start + drawRange.count ) * rangeFactor;
27760
28158
 
27761
- } else if ( index.count === 0 ) {
28159
+ if ( group !== null ) {
27762
28160
 
27763
- return;
28161
+ drawStart = Math.max( drawStart, group.start * rangeFactor );
28162
+ drawEnd = Math.min( drawEnd, ( group.start + group.count ) * rangeFactor );
27764
28163
 
27765
28164
  }
27766
28165
 
27767
- //
28166
+ if ( index !== null ) {
27768
28167
 
27769
- let rangeFactor = 1;
28168
+ drawStart = Math.max( drawStart, 0 );
28169
+ drawEnd = Math.min( drawEnd, index.count );
27770
28170
 
27771
- if ( material.wireframe === true ) {
28171
+ } else if ( position !== undefined && position !== null ) {
27772
28172
 
27773
- index = geometries.getWireframeAttribute( geometry );
27774
- rangeFactor = 2;
28173
+ drawStart = Math.max( drawStart, 0 );
28174
+ drawEnd = Math.min( drawEnd, position.count );
27775
28175
 
27776
28176
  }
27777
28177
 
28178
+ const drawCount = drawEnd - drawStart;
28179
+
28180
+ if ( drawCount < 0 || drawCount === Infinity ) return;
28181
+
28182
+ //
28183
+
27778
28184
  bindingStates.setup( object, material, program, geometry, index );
27779
28185
 
27780
28186
  let attribute;
@@ -27791,23 +28197,6 @@ function WebGLRenderer( parameters = {} ) {
27791
28197
 
27792
28198
  //
27793
28199
 
27794
- const dataCount = ( index !== null ) ? index.count : position.count;
27795
-
27796
- const rangeStart = geometry.drawRange.start * rangeFactor;
27797
- const rangeCount = geometry.drawRange.count * rangeFactor;
27798
-
27799
- const groupStart = group !== null ? group.start * rangeFactor : 0;
27800
- const groupCount = group !== null ? group.count * rangeFactor : Infinity;
27801
-
27802
- const drawStart = Math.max( rangeStart, groupStart );
27803
- const drawEnd = Math.min( dataCount, rangeStart + rangeCount, groupStart + groupCount ) - 1;
27804
-
27805
- const drawCount = Math.max( 0, drawEnd - drawStart + 1 );
27806
-
27807
- if ( drawCount === 0 ) return;
27808
-
27809
- //
27810
-
27811
28200
  if ( object.isMesh ) {
27812
28201
 
27813
28202
  if ( material.wireframe === true ) {
@@ -27859,7 +28248,8 @@ function WebGLRenderer( parameters = {} ) {
27859
28248
 
27860
28249
  } else if ( geometry.isInstancedBufferGeometry ) {
27861
28250
 
27862
- const instanceCount = Math.min( geometry.instanceCount, geometry._maxInstanceCount );
28251
+ const maxInstanceCount = geometry._maxInstanceCount !== undefined ? geometry._maxInstanceCount : Infinity;
28252
+ const instanceCount = Math.min( geometry.instanceCount, maxInstanceCount );
27863
28253
 
27864
28254
  renderer.renderInstances( drawStart, drawCount, instanceCount );
27865
28255
 
@@ -28994,6 +29384,9 @@ function WebGLRenderer( parameters = {} ) {
28994
29384
  _currentActiveMipmapLevel = activeMipmapLevel;
28995
29385
 
28996
29386
  let useDefaultFramebuffer = true;
29387
+ let framebuffer = null;
29388
+ let isCube = false;
29389
+ let isRenderTarget3D = false;
28997
29390
 
28998
29391
  if ( renderTarget ) {
28999
29392
 
@@ -29016,17 +29409,9 @@ function WebGLRenderer( parameters = {} ) {
29016
29409
 
29017
29410
  }
29018
29411
 
29019
- }
29020
-
29021
- let framebuffer = null;
29022
- let isCube = false;
29023
- let isRenderTarget3D = false;
29024
-
29025
- if ( renderTarget ) {
29026
-
29027
29412
  const texture = renderTarget.texture;
29028
29413
 
29029
- if ( texture.isData3DTexture || texture.isDataArrayTexture ) {
29414
+ if ( texture.isData3DTexture || texture.isDataArrayTexture || texture.isCompressedArrayTexture ) {
29030
29415
 
29031
29416
  isRenderTarget3D = true;
29032
29417
 
@@ -29267,7 +29652,7 @@ function WebGLRenderer( parameters = {} ) {
29267
29652
 
29268
29653
  } else {
29269
29654
 
29270
- if ( srcTexture.isCompressedTexture ) {
29655
+ if ( srcTexture.isCompressedArrayTexture ) {
29271
29656
 
29272
29657
  console.warn( 'THREE.WebGLRenderer.copyTextureToTexture3D: untested support for compressed srcTexture.' );
29273
29658
  _gl.compressedTexSubImage3D( glTarget, level, position.x, position.y, position.z, width, height, depth, glFormat, image.data );
@@ -29303,7 +29688,7 @@ function WebGLRenderer( parameters = {} ) {
29303
29688
 
29304
29689
  textures.setTexture3D( texture, 0 );
29305
29690
 
29306
- } else if ( texture.isDataArrayTexture ) {
29691
+ } else if ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) {
29307
29692
 
29308
29693
  textures.setTexture2DArray( texture, 0 );
29309
29694
 
@@ -29419,6 +29804,9 @@ class Scene extends Object3D {
29419
29804
  this.environment = null;
29420
29805
  this.fog = null;
29421
29806
 
29807
+ this.backgroundBlurriness = 0;
29808
+ this.backgroundIntensity = 1;
29809
+
29422
29810
  this.overrideMaterial = null;
29423
29811
 
29424
29812
  if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
@@ -29437,6 +29825,9 @@ class Scene extends Object3D {
29437
29825
  if ( source.environment !== null ) this.environment = source.environment.clone();
29438
29826
  if ( source.fog !== null ) this.fog = source.fog.clone();
29439
29827
 
29828
+ this.backgroundBlurriness = source.backgroundBlurriness;
29829
+ this.backgroundIntensity = source.backgroundIntensity;
29830
+
29440
29831
  if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();
29441
29832
 
29442
29833
  this.matrixAutoUpdate = source.matrixAutoUpdate;
@@ -29450,6 +29841,8 @@ class Scene extends Object3D {
29450
29841
  const data = super.toJSON( meta );
29451
29842
 
29452
29843
  if ( this.fog !== null ) data.object.fog = this.fog.toJSON();
29844
+ if ( this.backgroundBlurriness > 0 ) data.backgroundBlurriness = this.backgroundBlurriness;
29845
+ if ( this.backgroundIntensity !== 1 ) data.backgroundIntensity = this.backgroundIntensity;
29453
29846
 
29454
29847
  return data;
29455
29848
 
@@ -29842,7 +30235,7 @@ class InterleavedBufferAttribute {
29842
30235
 
29843
30236
  if ( data === undefined ) {
29844
30237
 
29845
- console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will deinterleave buffer data.' );
30238
+ console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' );
29846
30239
 
29847
30240
  const array = [];
29848
30241
 
@@ -29884,7 +30277,7 @@ class InterleavedBufferAttribute {
29884
30277
 
29885
30278
  if ( data === undefined ) {
29886
30279
 
29887
- console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will deinterleave buffer data.' );
30280
+ console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' );
29888
30281
 
29889
30282
  const array = [];
29890
30283
 
@@ -29900,7 +30293,7 @@ class InterleavedBufferAttribute {
29900
30293
 
29901
30294
  }
29902
30295
 
29903
- // deinterleave data and save it as an ordinary buffer attribute for now
30296
+ // de-interleave data and save it as an ordinary buffer attribute for now
29904
30297
 
29905
30298
  return {
29906
30299
  itemSize: this.itemSize,
@@ -29911,7 +30304,7 @@ class InterleavedBufferAttribute {
29911
30304
 
29912
30305
  } else {
29913
30306
 
29914
- // save as true interleaved attribtue
30307
+ // save as true interleaved attribute
29915
30308
 
29916
30309
  if ( data.interleavedBuffers === undefined ) {
29917
30310
 
@@ -30196,7 +30589,7 @@ class LOD extends Object3D {
30196
30589
 
30197
30590
  const level = levels[ i ];
30198
30591
 
30199
- this.addLevel( level.object.clone(), level.distance );
30592
+ this.addLevel( level.object.clone(), level.distance, level.hysteresis );
30200
30593
 
30201
30594
  }
30202
30595
 
@@ -30206,7 +30599,7 @@ class LOD extends Object3D {
30206
30599
 
30207
30600
  }
30208
30601
 
30209
- addLevel( object, distance = 0 ) {
30602
+ addLevel( object, distance = 0, hysteresis = 0 ) {
30210
30603
 
30211
30604
  distance = Math.abs( distance );
30212
30605
 
@@ -30224,7 +30617,7 @@ class LOD extends Object3D {
30224
30617
 
30225
30618
  }
30226
30619
 
30227
- levels.splice( l, 0, { distance: distance, object: object } );
30620
+ levels.splice( l, 0, { distance: distance, hysteresis: hysteresis, object: object } );
30228
30621
 
30229
30622
  this.add( object );
30230
30623
 
@@ -30238,6 +30631,8 @@ class LOD extends Object3D {
30238
30631
 
30239
30632
  }
30240
30633
 
30634
+
30635
+
30241
30636
  getObjectForDistance( distance ) {
30242
30637
 
30243
30638
  const levels = this.levels;
@@ -30248,7 +30643,15 @@ class LOD extends Object3D {
30248
30643
 
30249
30644
  for ( i = 1, l = levels.length; i < l; i ++ ) {
30250
30645
 
30251
- if ( distance < levels[ i ].distance ) {
30646
+ let levelDistance = levels[ i ].distance;
30647
+
30648
+ if ( levels[ i ].object.visible ) {
30649
+
30650
+ levelDistance -= levelDistance * levels[ i ].hysteresis;
30651
+
30652
+ }
30653
+
30654
+ if ( distance < levelDistance ) {
30252
30655
 
30253
30656
  break;
30254
30657
 
@@ -30297,7 +30700,15 @@ class LOD extends Object3D {
30297
30700
 
30298
30701
  for ( i = 1, l = levels.length; i < l; i ++ ) {
30299
30702
 
30300
- if ( distance >= levels[ i ].distance ) {
30703
+ let levelDistance = levels[ i ].distance;
30704
+
30705
+ if ( levels[ i ].object.visible ) {
30706
+
30707
+ levelDistance -= levelDistance * levels[ i ].hysteresis;
30708
+
30709
+ }
30710
+
30711
+ if ( distance >= levelDistance ) {
30301
30712
 
30302
30713
  levels[ i - 1 ].object.visible = false;
30303
30714
  levels[ i ].object.visible = true;
@@ -30338,7 +30749,8 @@ class LOD extends Object3D {
30338
30749
 
30339
30750
  data.object.levels.push( {
30340
30751
  object: level.object.uuid,
30341
- distance: level.distance
30752
+ distance: level.distance,
30753
+ hysteresis: level.hysteresis
30342
30754
  } );
30343
30755
 
30344
30756
  }
@@ -30838,6 +31250,7 @@ const _instanceWorldMatrix = /*@__PURE__*/ new Matrix4();
30838
31250
 
30839
31251
  const _instanceIntersects = [];
30840
31252
 
31253
+ const _identity = /*@__PURE__*/ new Matrix4();
30841
31254
  const _mesh = /*@__PURE__*/ new Mesh();
30842
31255
 
30843
31256
  class InstancedMesh extends Mesh {
@@ -30855,6 +31268,12 @@ class InstancedMesh extends Mesh {
30855
31268
 
30856
31269
  this.frustumCulled = false;
30857
31270
 
31271
+ for ( let i = 0; i < count; i ++ ) {
31272
+
31273
+ this.setMatrixAt( i, _identity );
31274
+
31275
+ }
31276
+
30858
31277
  }
30859
31278
 
30860
31279
  copy( source, recursive ) {
@@ -31571,6 +31990,20 @@ class CompressedTexture extends Texture {
31571
31990
 
31572
31991
  }
31573
31992
 
31993
+ class CompressedArrayTexture extends CompressedTexture {
31994
+
31995
+ constructor( mipmaps, width, height, depth, format, type ) {
31996
+
31997
+ super( mipmaps, width, height, format, type );
31998
+
31999
+ this.isCompressedArrayTexture = true;
32000
+ this.image.depth = depth;
32001
+ this.wrapR = ClampToEdgeWrapping;
32002
+
32003
+ }
32004
+
32005
+ }
32006
+
31574
32007
  class CanvasTexture extends Texture {
31575
32008
 
31576
32009
  constructor( canvas, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy ) {
@@ -34108,7 +34541,7 @@ class PolyhedronGeometry extends BufferGeometry {
34108
34541
  const b = new Vector3();
34109
34542
  const c = new Vector3();
34110
34543
 
34111
- // iterate over all faces and apply a subdivison with the given detail value
34544
+ // iterate over all faces and apply a subdivision with the given detail value
34112
34545
 
34113
34546
  for ( let i = 0; i < indices.length; i += 3 ) {
34114
34547
 
@@ -34650,7 +35083,7 @@ class Shape extends Path {
34650
35083
  }
34651
35084
 
34652
35085
  /**
34653
- * Port from https://github.com/mapbox/earcut (v2.2.2)
35086
+ * Port from https://github.com/mapbox/earcut (v2.2.4)
34654
35087
  */
34655
35088
 
34656
35089
  const Earcut = {
@@ -34687,11 +35120,11 @@ const Earcut = {
34687
35120
 
34688
35121
  // minX, minY and invSize are later used to transform coords into integers for z-order calculation
34689
35122
  invSize = Math.max( maxX - minX, maxY - minY );
34690
- invSize = invSize !== 0 ? 1 / invSize : 0;
35123
+ invSize = invSize !== 0 ? 32767 / invSize : 0;
34691
35124
 
34692
35125
  }
34693
35126
 
34694
- earcutLinked( outerNode, triangles, dim, minX, minY, invSize );
35127
+ earcutLinked( outerNode, triangles, dim, minX, minY, invSize, 0 );
34695
35128
 
34696
35129
  return triangles;
34697
35130
 
@@ -34776,9 +35209,9 @@ function earcutLinked( ear, triangles, dim, minX, minY, invSize, pass ) {
34776
35209
  if ( invSize ? isEarHashed( ear, minX, minY, invSize ) : isEar( ear ) ) {
34777
35210
 
34778
35211
  // cut off the triangle
34779
- triangles.push( prev.i / dim );
34780
- triangles.push( ear.i / dim );
34781
- triangles.push( next.i / dim );
35212
+ triangles.push( prev.i / dim | 0 );
35213
+ triangles.push( ear.i / dim | 0 );
35214
+ triangles.push( next.i / dim | 0 );
34782
35215
 
34783
35216
  removeNode( ear );
34784
35217
 
@@ -34833,11 +35266,19 @@ function isEar( ear ) {
34833
35266
  if ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear
34834
35267
 
34835
35268
  // now make sure we don't have other points inside the potential ear
34836
- let p = ear.next.next;
35269
+ const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
35270
+
35271
+ // triangle bbox; min & max are calculated like this for speed
35272
+ const x0 = ax < bx ? ( ax < cx ? ax : cx ) : ( bx < cx ? bx : cx ),
35273
+ y0 = ay < by ? ( ay < cy ? ay : cy ) : ( by < cy ? by : cy ),
35274
+ x1 = ax > bx ? ( ax > cx ? ax : cx ) : ( bx > cx ? bx : cx ),
35275
+ y1 = ay > by ? ( ay > cy ? ay : cy ) : ( by > cy ? by : cy );
34837
35276
 
34838
- while ( p !== ear.prev ) {
35277
+ let p = c.next;
35278
+ while ( p !== a ) {
34839
35279
 
34840
- if ( pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y ) &&
35280
+ if ( p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&
35281
+ pointInTriangle( ax, ay, bx, by, cx, cy, p.x, p.y ) &&
34841
35282
  area( p.prev, p, p.next ) >= 0 ) return false;
34842
35283
  p = p.next;
34843
35284
 
@@ -34855,15 +35296,17 @@ function isEarHashed( ear, minX, minY, invSize ) {
34855
35296
 
34856
35297
  if ( area( a, b, c ) >= 0 ) return false; // reflex, can't be an ear
34857
35298
 
35299
+ const ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
35300
+
34858
35301
  // triangle bbox; min & max are calculated like this for speed
34859
- const minTX = a.x < b.x ? ( a.x < c.x ? a.x : c.x ) : ( b.x < c.x ? b.x : c.x ),
34860
- minTY = a.y < b.y ? ( a.y < c.y ? a.y : c.y ) : ( b.y < c.y ? b.y : c.y ),
34861
- maxTX = a.x > b.x ? ( a.x > c.x ? a.x : c.x ) : ( b.x > c.x ? b.x : c.x ),
34862
- maxTY = a.y > b.y ? ( a.y > c.y ? a.y : c.y ) : ( b.y > c.y ? b.y : c.y );
35302
+ const x0 = ax < bx ? ( ax < cx ? ax : cx ) : ( bx < cx ? bx : cx ),
35303
+ y0 = ay < by ? ( ay < cy ? ay : cy ) : ( by < cy ? by : cy ),
35304
+ x1 = ax > bx ? ( ax > cx ? ax : cx ) : ( bx > cx ? bx : cx ),
35305
+ y1 = ay > by ? ( ay > cy ? ay : cy ) : ( by > cy ? by : cy );
34863
35306
 
34864
35307
  // z-order range for the current triangle bbox;
34865
- const minZ = zOrder( minTX, minTY, minX, minY, invSize ),
34866
- maxZ = zOrder( maxTX, maxTY, minX, minY, invSize );
35308
+ const minZ = zOrder( x0, y0, minX, minY, invSize ),
35309
+ maxZ = zOrder( x1, y1, minX, minY, invSize );
34867
35310
 
34868
35311
  let p = ear.prevZ,
34869
35312
  n = ear.nextZ;
@@ -34871,14 +35314,12 @@ function isEarHashed( ear, minX, minY, invSize ) {
34871
35314
  // look for points inside the triangle in both directions
34872
35315
  while ( p && p.z >= minZ && n && n.z <= maxZ ) {
34873
35316
 
34874
- if ( p !== ear.prev && p !== ear.next &&
34875
- pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y ) &&
34876
- area( p.prev, p, p.next ) >= 0 ) return false;
35317
+ if ( p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&
35318
+ pointInTriangle( ax, ay, bx, by, cx, cy, p.x, p.y ) && area( p.prev, p, p.next ) >= 0 ) return false;
34877
35319
  p = p.prevZ;
34878
35320
 
34879
- if ( n !== ear.prev && n !== ear.next &&
34880
- pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y ) &&
34881
- area( n.prev, n, n.next ) >= 0 ) return false;
35321
+ if ( n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&
35322
+ pointInTriangle( ax, ay, bx, by, cx, cy, n.x, n.y ) && area( n.prev, n, n.next ) >= 0 ) return false;
34882
35323
  n = n.nextZ;
34883
35324
 
34884
35325
  }
@@ -34886,9 +35327,8 @@ function isEarHashed( ear, minX, minY, invSize ) {
34886
35327
  // look for remaining points in decreasing z-order
34887
35328
  while ( p && p.z >= minZ ) {
34888
35329
 
34889
- if ( p !== ear.prev && p !== ear.next &&
34890
- pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y ) &&
34891
- area( p.prev, p, p.next ) >= 0 ) return false;
35330
+ if ( p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&
35331
+ pointInTriangle( ax, ay, bx, by, cx, cy, p.x, p.y ) && area( p.prev, p, p.next ) >= 0 ) return false;
34892
35332
  p = p.prevZ;
34893
35333
 
34894
35334
  }
@@ -34896,9 +35336,8 @@ function isEarHashed( ear, minX, minY, invSize ) {
34896
35336
  // look for remaining points in increasing z-order
34897
35337
  while ( n && n.z <= maxZ ) {
34898
35338
 
34899
- if ( n !== ear.prev && n !== ear.next &&
34900
- pointInTriangle( a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y ) &&
34901
- area( n.prev, n, n.next ) >= 0 ) return false;
35339
+ if ( n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&
35340
+ pointInTriangle( ax, ay, bx, by, cx, cy, n.x, n.y ) && area( n.prev, n, n.next ) >= 0 ) return false;
34902
35341
  n = n.nextZ;
34903
35342
 
34904
35343
  }
@@ -34918,9 +35357,9 @@ function cureLocalIntersections( start, triangles, dim ) {
34918
35357
 
34919
35358
  if ( ! equals( a, b ) && intersects( a, p, p.next, b ) && locallyInside( a, b ) && locallyInside( b, a ) ) {
34920
35359
 
34921
- triangles.push( a.i / dim );
34922
- triangles.push( p.i / dim );
34923
- triangles.push( b.i / dim );
35360
+ triangles.push( a.i / dim | 0 );
35361
+ triangles.push( p.i / dim | 0 );
35362
+ triangles.push( b.i / dim | 0 );
34924
35363
 
34925
35364
  // remove two nodes involved
34926
35365
  removeNode( p );
@@ -34958,8 +35397,8 @@ function splitEarcut( start, triangles, dim, minX, minY, invSize ) {
34958
35397
  c = filterPoints( c, c.next );
34959
35398
 
34960
35399
  // run earcut on each half
34961
- earcutLinked( a, triangles, dim, minX, minY, invSize );
34962
- earcutLinked( c, triangles, dim, minX, minY, invSize );
35400
+ earcutLinked( a, triangles, dim, minX, minY, invSize, 0 );
35401
+ earcutLinked( c, triangles, dim, minX, minY, invSize, 0 );
34963
35402
  return;
34964
35403
 
34965
35404
  }
@@ -34995,8 +35434,7 @@ function eliminateHoles( data, holeIndices, outerNode, dim ) {
34995
35434
  // process holes from left to right
34996
35435
  for ( i = 0; i < queue.length; i ++ ) {
34997
35436
 
34998
- eliminateHole( queue[ i ], outerNode );
34999
- outerNode = filterPoints( outerNode, outerNode.next );
35437
+ outerNode = eliminateHole( queue[ i ], outerNode );
35000
35438
 
35001
35439
  }
35002
35440
 
@@ -35013,26 +35451,29 @@ function compareX( a, b ) {
35013
35451
  // find a bridge between vertices that connects hole with an outer ring and link it
35014
35452
  function eliminateHole( hole, outerNode ) {
35015
35453
 
35016
- outerNode = findHoleBridge( hole, outerNode );
35017
- if ( outerNode ) {
35018
-
35019
- const b = splitPolygon( outerNode, hole );
35454
+ const bridge = findHoleBridge( hole, outerNode );
35455
+ if ( ! bridge ) {
35020
35456
 
35021
- // filter collinear points around the cuts
35022
- filterPoints( outerNode, outerNode.next );
35023
- filterPoints( b, b.next );
35457
+ return outerNode;
35024
35458
 
35025
35459
  }
35026
35460
 
35461
+ const bridgeReverse = splitPolygon( bridge, hole );
35462
+
35463
+ // filter collinear points around the cuts
35464
+ filterPoints( bridgeReverse, bridgeReverse.next );
35465
+ return filterPoints( bridge, bridge.next );
35466
+
35027
35467
  }
35028
35468
 
35029
35469
  // David Eberly's algorithm for finding a bridge between hole and outer polygon
35030
35470
  function findHoleBridge( hole, outerNode ) {
35031
35471
 
35032
- let p = outerNode;
35033
- const hx = hole.x;
35034
- const hy = hole.y;
35035
- let qx = - Infinity, m;
35472
+ let p = outerNode,
35473
+ qx = - Infinity,
35474
+ m;
35475
+
35476
+ const hx = hole.x, hy = hole.y;
35036
35477
 
35037
35478
  // find a segment intersected by a ray from the hole's leftmost point to the left;
35038
35479
  // segment's endpoint with lesser x will be potential connection point
@@ -35044,14 +35485,8 @@ function findHoleBridge( hole, outerNode ) {
35044
35485
  if ( x <= hx && x > qx ) {
35045
35486
 
35046
35487
  qx = x;
35047
- if ( x === hx ) {
35048
-
35049
- if ( hy === p.y ) return p;
35050
- if ( hy === p.next.y ) return p.next;
35051
-
35052
- }
35053
-
35054
35488
  m = p.x < p.next.x ? p : p.next;
35489
+ if ( x === hx ) return m; // hole touches outer segment; pick leftmost endpoint
35055
35490
 
35056
35491
  }
35057
35492
 
@@ -35063,8 +35498,6 @@ function findHoleBridge( hole, outerNode ) {
35063
35498
 
35064
35499
  if ( ! m ) return null;
35065
35500
 
35066
- if ( hx === qx ) return m; // hole touches outer segment; pick leftmost endpoint
35067
-
35068
35501
  // look for points inside the triangle of hole point, segment intersection and endpoint;
35069
35502
  // if there are no points found, we have a valid connection;
35070
35503
  // otherwise choose the point of the minimum angle with the ray as connection point
@@ -35113,7 +35546,7 @@ function indexCurve( start, minX, minY, invSize ) {
35113
35546
  let p = start;
35114
35547
  do {
35115
35548
 
35116
- if ( p.z === null ) p.z = zOrder( p.x, p.y, minX, minY, invSize );
35549
+ if ( p.z === 0 ) p.z = zOrder( p.x, p.y, minX, minY, invSize );
35117
35550
  p.prevZ = p.prev;
35118
35551
  p.nextZ = p.next;
35119
35552
  p = p.next;
@@ -35197,8 +35630,8 @@ function sortLinked( list ) {
35197
35630
  function zOrder( x, y, minX, minY, invSize ) {
35198
35631
 
35199
35632
  // coords are transformed into non-negative 15-bit integer range
35200
- x = 32767 * ( x - minX ) * invSize;
35201
- y = 32767 * ( y - minY ) * invSize;
35633
+ x = ( x - minX ) * invSize | 0;
35634
+ y = ( y - minY ) * invSize | 0;
35202
35635
 
35203
35636
  x = ( x | ( x << 8 ) ) & 0x00FF00FF;
35204
35637
  x = ( x | ( x << 4 ) ) & 0x0F0F0F0F;
@@ -35233,19 +35666,19 @@ function getLeftmost( start ) {
35233
35666
  // check if a point lies within a convex triangle
35234
35667
  function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {
35235
35668
 
35236
- return ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&
35237
- ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&
35238
- ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;
35669
+ return ( cx - px ) * ( ay - py ) >= ( ax - px ) * ( cy - py ) &&
35670
+ ( ax - px ) * ( by - py ) >= ( bx - px ) * ( ay - py ) &&
35671
+ ( bx - px ) * ( cy - py ) >= ( cx - px ) * ( by - py );
35239
35672
 
35240
35673
  }
35241
35674
 
35242
35675
  // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
35243
35676
  function isValidDiagonal( a, b ) {
35244
35677
 
35245
- return a.next.i !== b.i && a.prev.i !== b.i && ! intersectsPolygon( a, b ) && // doesn't intersect other edges
35246
- ( locallyInside( a, b ) && locallyInside( b, a ) && middleInside( a, b ) && // locally visible
35247
- ( area( a.prev, a, b.prev ) || area( a, b.prev, b ) ) || // does not create opposite-facing sectors
35248
- equals( a, b ) && area( a.prev, a, a.next ) > 0 && area( b.prev, b, b.next ) > 0 ); // special zero-length case
35678
+ return a.next.i !== b.i && a.prev.i !== b.i && ! intersectsPolygon( a, b ) && // dones't intersect other edges
35679
+ ( locallyInside( a, b ) && locallyInside( b, a ) && middleInside( a, b ) && // locally visible
35680
+ ( area( a.prev, a, b.prev ) || area( a, b.prev, b ) ) || // does not create opposite-facing sectors
35681
+ equals( a, b ) && area( a.prev, a, a.next ) > 0 && area( b.prev, b, b.next ) > 0 ); // special zero-length case
35249
35682
 
35250
35683
  }
35251
35684
 
@@ -35302,7 +35735,7 @@ function intersectsPolygon( a, b ) {
35302
35735
  do {
35303
35736
 
35304
35737
  if ( p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i &&
35305
- intersects( p, p.next, a, b ) ) return true;
35738
+ intersects( p, p.next, a, b ) ) return true;
35306
35739
  p = p.next;
35307
35740
 
35308
35741
  } while ( p !== a );
@@ -35330,7 +35763,7 @@ function middleInside( a, b ) {
35330
35763
  do {
35331
35764
 
35332
35765
  if ( ( ( p.y > py ) !== ( p.next.y > py ) ) && p.next.y !== p.y &&
35333
- ( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )
35766
+ ( px < ( p.next.x - p.x ) * ( py - p.y ) / ( p.next.y - p.y ) + p.x ) )
35334
35767
  inside = ! inside;
35335
35768
  p = p.next;
35336
35769
 
@@ -35412,7 +35845,7 @@ function Node( i, x, y ) {
35412
35845
  this.next = null;
35413
35846
 
35414
35847
  // z-order curve value
35415
- this.z = null;
35848
+ this.z = 0;
35416
35849
 
35417
35850
  // previous and next nodes in z-order
35418
35851
  this.prevZ = null;
@@ -36610,7 +37043,7 @@ class ShapeGeometry extends BufferGeometry {
36610
37043
 
36611
37044
  }
36612
37045
 
36613
- // incides
37046
+ // indices
36614
37047
 
36615
37048
  for ( let i = 0, l = faces.length; i < l; i ++ ) {
36616
37049
 
@@ -37649,7 +38082,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
37649
38082
 
37650
38083
  this.thickness = 0;
37651
38084
  this.thicknessMap = null;
37652
- this.attenuationDistance = 0.0;
38085
+ this.attenuationDistance = Infinity;
37653
38086
  this.attenuationColor = new Color( 1, 1, 1 );
37654
38087
 
37655
38088
  this.specularIntensity = 1.0;
@@ -40437,7 +40870,10 @@ class FileLoader extends Loader {
40437
40870
 
40438
40871
  const callbacks = loading[ url ];
40439
40872
  const reader = response.body.getReader();
40440
- const contentLength = response.headers.get( 'Content-Length' );
40873
+
40874
+ // Nginx needs X-File-Size check
40875
+ // https://serverfault.com/questions/482875/why-does-nginx-remove-content-length-header-for-chunked-content
40876
+ const contentLength = response.headers.get( 'Content-Length' ) || response.headers.get( 'X-File-Size' );
40441
40877
  const total = contentLength ? parseInt( contentLength ) : 0;
40442
40878
  const lengthComputable = total !== 0;
40443
40879
  let loaded = 0;
@@ -41223,8 +41659,7 @@ class LightShadow {
41223
41659
  0.0, 0.0, 0.0, 1.0
41224
41660
  );
41225
41661
 
41226
- shadowMatrix.multiply( shadowCamera.projectionMatrix );
41227
- shadowMatrix.multiply( shadowCamera.matrixWorldInverse );
41662
+ shadowMatrix.multiply( _projScreenMatrix$1 );
41228
41663
 
41229
41664
  }
41230
41665
 
@@ -41340,7 +41775,7 @@ class SpotLightShadow extends LightShadow {
41340
41775
 
41341
41776
  class SpotLight extends Light {
41342
41777
 
41343
- constructor( color, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 1 ) {
41778
+ constructor( color, intensity, distance = 0, angle = Math.PI / 3, penumbra = 0, decay = 2 ) {
41344
41779
 
41345
41780
  super( color, intensity );
41346
41781
 
@@ -41356,7 +41791,7 @@ class SpotLight extends Light {
41356
41791
  this.distance = distance;
41357
41792
  this.angle = angle;
41358
41793
  this.penumbra = penumbra;
41359
- this.decay = decay; // for physically correct lights, should be 2.
41794
+ this.decay = decay;
41360
41795
 
41361
41796
  this.map = null;
41362
41797
 
@@ -41494,7 +41929,7 @@ class PointLightShadow extends LightShadow {
41494
41929
 
41495
41930
  class PointLight extends Light {
41496
41931
 
41497
- constructor( color, intensity, distance = 0, decay = 1 ) {
41932
+ constructor( color, intensity, distance = 0, decay = 2 ) {
41498
41933
 
41499
41934
  super( color, intensity );
41500
41935
 
@@ -41503,7 +41938,7 @@ class PointLight extends Light {
41503
41938
  this.type = 'PointLight';
41504
41939
 
41505
41940
  this.distance = distance;
41506
- this.decay = decay; // for physically correct lights, should be 2.
41941
+ this.decay = decay;
41507
41942
 
41508
41943
  this.shadow = new PointLightShadow();
41509
41944
 
@@ -42367,15 +42802,9 @@ class InstancedBufferGeometry extends BufferGeometry {
42367
42802
 
42368
42803
  }
42369
42804
 
42370
- clone() {
42371
-
42372
- return new this.constructor().copy( this );
42373
-
42374
- }
42375
-
42376
42805
  toJSON() {
42377
42806
 
42378
- const data = super.toJSON( this );
42807
+ const data = super.toJSON();
42379
42808
 
42380
42809
  data.instanceCount = this.instanceCount;
42381
42810
 
@@ -42639,6 +43068,8 @@ class ObjectLoader extends Loader {
42639
43068
 
42640
43069
  if ( metadata === undefined || metadata.type === undefined || metadata.type.toLowerCase() === 'geometry' ) {
42641
43070
 
43071
+ if ( onError !== undefined ) onError( new Error( 'THREE.ObjectLoader: Can\'t load ' + url ) );
43072
+
42642
43073
  console.error( 'THREE.ObjectLoader: Can\'t load ' + url );
42643
43074
  return;
42644
43075
 
@@ -43333,6 +43764,8 @@ class ObjectLoader extends Loader {
43333
43764
 
43334
43765
  }
43335
43766
 
43767
+ if ( data.backgroundBlurriness !== undefined ) object.backgroundBlurriness = data.backgroundBlurriness;
43768
+
43336
43769
  break;
43337
43770
 
43338
43771
  case 'PerspectiveCamera':
@@ -43567,7 +44000,7 @@ class ObjectLoader extends Loader {
43567
44000
 
43568
44001
  if ( child !== undefined ) {
43569
44002
 
43570
- object.addLevel( child, level.distance );
44003
+ object.addLevel( child, level.distance, level.hysteresis );
43571
44004
 
43572
44005
  }
43573
44006
 
@@ -43728,9 +44161,9 @@ class ImageBitmapLoader extends Loader {
43728
44161
 
43729
44162
  let _context;
43730
44163
 
43731
- const AudioContext = {
44164
+ class AudioContext {
43732
44165
 
43733
- getContext: function () {
44166
+ static getContext() {
43734
44167
 
43735
44168
  if ( _context === undefined ) {
43736
44169
 
@@ -43740,15 +44173,15 @@ const AudioContext = {
43740
44173
 
43741
44174
  return _context;
43742
44175
 
43743
- },
44176
+ }
43744
44177
 
43745
- setContext: function ( value ) {
44178
+ static setContext( value ) {
43746
44179
 
43747
44180
  _context = value;
43748
44181
 
43749
44182
  }
43750
44183
 
43751
- };
44184
+ }
43752
44185
 
43753
44186
  class AudioLoader extends Loader {
43754
44187
 
@@ -45518,6 +45951,13 @@ class PropertyBinding {
45518
45951
 
45519
45952
  case 'map':
45520
45953
 
45954
+ if ( 'map' in targetObject ) {
45955
+
45956
+ targetObject = targetObject.map;
45957
+ break;
45958
+
45959
+ }
45960
+
45521
45961
  if ( ! targetObject.material ) {
45522
45962
 
45523
45963
  console.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this );
@@ -48341,13 +48781,14 @@ class SpotLightHelper extends Object3D {
48341
48781
  super();
48342
48782
 
48343
48783
  this.light = light;
48344
- this.light.updateMatrixWorld();
48345
48784
 
48346
48785
  this.matrix = light.matrixWorld;
48347
48786
  this.matrixAutoUpdate = false;
48348
48787
 
48349
48788
  this.color = color;
48350
48789
 
48790
+ this.type = 'SpotLightHelper';
48791
+
48351
48792
  const geometry = new BufferGeometry();
48352
48793
 
48353
48794
  const positions = [
@@ -48390,7 +48831,8 @@ class SpotLightHelper extends Object3D {
48390
48831
 
48391
48832
  update() {
48392
48833
 
48393
- this.light.updateMatrixWorld();
48834
+ this.light.updateWorldMatrix( true, false );
48835
+ this.light.target.updateWorldMatrix( true, false );
48394
48836
 
48395
48837
  const coneLength = this.light.distance ? this.light.distance : 1000;
48396
48838
  const coneWidth = coneLength * Math.tan( this.light.angle );
@@ -48503,6 +48945,13 @@ class SkeletonHelper extends LineSegments {
48503
48945
 
48504
48946
  }
48505
48947
 
48948
+ dispose() {
48949
+
48950
+ this.geometry.dispose();
48951
+ this.material.dispose();
48952
+
48953
+ }
48954
+
48506
48955
  }
48507
48956
 
48508
48957
 
@@ -48536,7 +48985,6 @@ class PointLightHelper extends Mesh {
48536
48985
  super( geometry, material );
48537
48986
 
48538
48987
  this.light = light;
48539
- this.light.updateMatrixWorld();
48540
48988
 
48541
48989
  this.color = color;
48542
48990
 
@@ -48582,6 +49030,8 @@ class PointLightHelper extends Mesh {
48582
49030
 
48583
49031
  update() {
48584
49032
 
49033
+ this.light.updateWorldMatrix( true, false );
49034
+
48585
49035
  if ( this.color !== undefined ) {
48586
49036
 
48587
49037
  this.material.color.set( this.color );
@@ -48622,13 +49072,14 @@ class HemisphereLightHelper extends Object3D {
48622
49072
  super();
48623
49073
 
48624
49074
  this.light = light;
48625
- this.light.updateMatrixWorld();
48626
49075
 
48627
49076
  this.matrix = light.matrixWorld;
48628
49077
  this.matrixAutoUpdate = false;
48629
49078
 
48630
49079
  this.color = color;
48631
49080
 
49081
+ this.type = 'HemisphereLightHelper';
49082
+
48632
49083
  const geometry = new OctahedronGeometry( size );
48633
49084
  geometry.rotateY( Math.PI * 0.5 );
48634
49085
 
@@ -48680,6 +49131,8 @@ class HemisphereLightHelper extends Object3D {
48680
49131
 
48681
49132
  }
48682
49133
 
49134
+ this.light.updateWorldMatrix( true, false );
49135
+
48683
49136
  mesh.lookAt( _vector$1.setFromMatrixPosition( this.light.matrixWorld ).negate() );
48684
49137
 
48685
49138
  }
@@ -48725,6 +49178,13 @@ class GridHelper extends LineSegments {
48725
49178
 
48726
49179
  }
48727
49180
 
49181
+ dispose() {
49182
+
49183
+ this.geometry.dispose();
49184
+ this.material.dispose();
49185
+
49186
+ }
49187
+
48728
49188
  }
48729
49189
 
48730
49190
  class PolarGridHelper extends LineSegments {
@@ -48806,6 +49266,13 @@ class PolarGridHelper extends LineSegments {
48806
49266
 
48807
49267
  }
48808
49268
 
49269
+ dispose() {
49270
+
49271
+ this.geometry.dispose();
49272
+ this.material.dispose();
49273
+
49274
+ }
49275
+
48809
49276
  }
48810
49277
 
48811
49278
  const _v1 = /*@__PURE__*/ new Vector3();
@@ -48819,13 +49286,14 @@ class DirectionalLightHelper extends Object3D {
48819
49286
  super();
48820
49287
 
48821
49288
  this.light = light;
48822
- this.light.updateMatrixWorld();
48823
49289
 
48824
49290
  this.matrix = light.matrixWorld;
48825
49291
  this.matrixAutoUpdate = false;
48826
49292
 
48827
49293
  this.color = color;
48828
49294
 
49295
+ this.type = 'DirectionalLightHelper';
49296
+
48829
49297
  if ( size === undefined ) size = 1;
48830
49298
 
48831
49299
  let geometry = new BufferGeometry();
@@ -48863,6 +49331,9 @@ class DirectionalLightHelper extends Object3D {
48863
49331
 
48864
49332
  update() {
48865
49333
 
49334
+ this.light.updateWorldMatrix( true, false );
49335
+ this.light.target.updateWorldMatrix( true, false );
49336
+
48866
49337
  _v1.setFromMatrixPosition( this.light.matrixWorld );
48867
49338
  _v2.setFromMatrixPosition( this.light.target.matrixWorld );
48868
49339
  _v3.subVectors( _v2, _v1 );
@@ -49223,7 +49694,6 @@ class BoxHelper extends LineSegments {
49223
49694
 
49224
49695
  this.geometry.computeBoundingSphere();
49225
49696
 
49226
-
49227
49697
  }
49228
49698
 
49229
49699
  setFromObject( object ) {
@@ -49245,6 +49715,13 @@ class BoxHelper extends LineSegments {
49245
49715
 
49246
49716
  }
49247
49717
 
49718
+ dispose() {
49719
+
49720
+ this.geometry.dispose();
49721
+ this.material.dispose();
49722
+
49723
+ }
49724
+
49248
49725
  }
49249
49726
 
49250
49727
  class Box3Helper extends LineSegments {
@@ -49287,6 +49764,13 @@ class Box3Helper extends LineSegments {
49287
49764
 
49288
49765
  }
49289
49766
 
49767
+ dispose() {
49768
+
49769
+ this.geometry.dispose();
49770
+ this.material.dispose();
49771
+
49772
+ }
49773
+
49290
49774
  }
49291
49775
 
49292
49776
  class PlaneHelper extends Line {
@@ -49333,6 +49817,15 @@ class PlaneHelper extends Line {
49333
49817
 
49334
49818
  }
49335
49819
 
49820
+ dispose() {
49821
+
49822
+ this.geometry.dispose();
49823
+ this.material.dispose();
49824
+ this.children[ 0 ].geometry.dispose();
49825
+ this.children[ 0 ].material.dispose();
49826
+
49827
+ }
49828
+
49336
49829
  }
49337
49830
 
49338
49831
  const _axis = /*@__PURE__*/ new Vector3();
@@ -49426,6 +49919,15 @@ class ArrowHelper extends Object3D {
49426
49919
 
49427
49920
  }
49428
49921
 
49922
+ dispose() {
49923
+
49924
+ this.line.geometry.dispose();
49925
+ this.line.material.dispose();
49926
+ this.cone.geometry.dispose();
49927
+ this.cone.material.dispose();
49928
+
49929
+ }
49930
+
49429
49931
  }
49430
49932
 
49431
49933
  class AxesHelper extends LineSegments {
@@ -50260,4 +50762,4 @@ if ( typeof window !== 'undefined' ) {
50260
50762
 
50261
50763
  }
50262
50764
 
50263
- export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AlphaFormat, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AmbientLightProbe, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxBufferGeometry, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleBufferGeometry, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleBufferGeometry, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedTexture, CompressedTextureLoader, ConeBufferGeometry, ConeGeometry, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderBufferGeometry, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTexture2DArray, DataTexture3D, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronBufferGeometry, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeBufferGeometry, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, Float64BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, GLBufferAttribute, GLSL1, GLSL3, GreaterDepth, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, HemisphereLightProbe, IcosahedronBufferGeometry, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, ImmediateRenderObject, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheBufferGeometry, LatheGeometry, Layers, LessDepth, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearEncoding, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, 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, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronBufferGeometry, OctahedronGeometry, OneFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, Path, PerspectiveCamera, Plane, PlaneBufferGeometry, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronBufferGeometry, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, 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, RGBFormat, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingBufferGeometry, RingGeometry, SRGBColorSpace, Scene, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeBufferGeometry, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereBufferGeometry, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronBufferGeometry, TetrahedronGeometry, Texture, TextureLoader, TorusBufferGeometry, TorusGeometry, TorusKnotBufferGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeBufferGeometry, 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, WebGLCubeRenderTarget, WebGLMultipleRenderTargets, WebGLMultisampleRenderTarget, WebGLRenderTarget, WebGLRenderer, WebGLUtils, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, _SRGBAFormat, sRGBEncoding };
50765
+ export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AlphaFormat, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AmbientLightProbe, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxBufferGeometry, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleBufferGeometry, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleBufferGeometry, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, CompressedArrayTexture, CompressedTexture, CompressedTextureLoader, ConeBufferGeometry, ConeGeometry, CubeCamera, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderBufferGeometry, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTexture2DArray, DataTexture3D, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronBufferGeometry, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExtrudeBufferGeometry, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, Float64BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, GLBufferAttribute, GLSL1, GLSL3, GreaterDepth, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HalfFloatType, HemisphereLight, HemisphereLightHelper, HemisphereLightProbe, IcosahedronBufferGeometry, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, ImmediateRenderObject, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheBufferGeometry, LatheGeometry, Layers, LessDepth, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearEncoding, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, 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, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronBufferGeometry, OctahedronGeometry, OneFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, PMREMGenerator, Path, PerspectiveCamera, Plane, PlaneBufferGeometry, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronBufferGeometry, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, 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, RGBFormat, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, RingBufferGeometry, RingGeometry, SRGBColorSpace, Scene, ShaderChunk, ShaderLib, ShaderMaterial, ShadowMaterial, Shape, ShapeBufferGeometry, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereBufferGeometry, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronBufferGeometry, TetrahedronGeometry, Texture, TextureLoader, TorusBufferGeometry, TorusGeometry, TorusKnotBufferGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeBufferGeometry, 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, WebGLCubeRenderTarget, WebGLMultipleRenderTargets, WebGLMultisampleRenderTarget, WebGLRenderTarget, WebGLRenderer, WebGLUtils, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, _SRGBAFormat, sRGBEncoding };