@unikia/upe-renderer 0.186.110 → 0.187.11

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 (506) hide show
  1. package/README.md +5 -7
  2. package/UPSTREAM.md +4 -4
  3. package/build/three.core.js +853 -277
  4. package/build/three.module.js +1098 -1280
  5. package/build/three.tsl.js +41938 -686
  6. package/build/three.webgpu.js +10604 -49055
  7. package/build/three.webgpu.nodes.js +9249 -5788
  8. package/examples/jsm/Addons.js +2 -0
  9. package/examples/jsm/animation/CCDIKSolver.js +17 -5
  10. package/examples/jsm/controls/FirstPersonControls.js +1 -1
  11. package/examples/jsm/controls/OrbitControls.js +27 -14
  12. package/examples/jsm/csm/CSMShader.js +74 -3
  13. package/examples/jsm/curves/CurveExtras.js +4 -4
  14. package/examples/jsm/curves/NURBSCurve.js +14 -0
  15. package/examples/jsm/exporters/EXRExporter.js +673 -16
  16. package/examples/jsm/exporters/GLTFExporter.js +4 -4
  17. package/examples/jsm/exporters/KTX2Exporter.js +1 -1
  18. package/examples/jsm/exporters/OBJExporter.js +48 -5
  19. package/examples/jsm/exporters/PLYExporter.js +22 -11
  20. package/examples/jsm/generators/CityGenerator.js +3 -2
  21. package/examples/jsm/generators/city/SkyscraperGenerator.js +63 -21
  22. package/examples/jsm/gpgpu/BitonicSort.js +30 -23
  23. package/examples/jsm/helpers/VertexTangentsHelper.js +1 -1
  24. package/examples/jsm/inspector/Extension.js +1 -1
  25. package/examples/jsm/inspector/Inspector.js +6 -46
  26. package/examples/jsm/inspector/RendererInspector.js +43 -8
  27. package/examples/jsm/inspector/Storage.js +49 -0
  28. package/examples/jsm/inspector/extensions/color-grading/ColorGrading.js +32 -27
  29. package/examples/jsm/inspector/tabs/Parameters.js +5 -1
  30. package/examples/jsm/inspector/tabs/Performance.js +22 -7
  31. package/examples/jsm/inspector/tabs/Settings.js +1 -1
  32. package/examples/jsm/inspector/tabs/Timeline.js +83 -7
  33. package/examples/jsm/inspector/tabs/Viewer.js +25 -10
  34. package/examples/jsm/inspector/ui/Profiler.js +1 -1
  35. package/examples/jsm/inspector/ui/Style.js +21 -53
  36. package/examples/jsm/inspector/ui/Values.js +28 -3
  37. package/examples/jsm/libs/fflate.module.js +83 -56
  38. package/examples/jsm/libs/mikktspace.README.md +27 -0
  39. package/examples/jsm/libs/mikktspace.module.js +721 -109
  40. package/examples/jsm/lighting/ClusteredLighting.js +100 -2
  41. package/examples/jsm/lighting/LightMapper.js +295 -0
  42. package/examples/jsm/lighting/LightProbeGrid.js +242 -139
  43. package/examples/jsm/lighting/LightProbeGridWebGL.js +30 -14
  44. package/examples/jsm/lighting/vxgi/VXGIConeTracer.js +54 -5
  45. package/examples/jsm/lighting/vxgi/VXGIIrradiance.js +43 -0
  46. package/examples/jsm/lighting/vxgi/VXGINode.js +13 -56
  47. package/examples/jsm/lighting/vxgi/VXGISceneCollector.js +316 -1
  48. package/examples/jsm/lighting/vxgi/VXGIVolume.js +69 -59
  49. package/examples/jsm/lights/SunLight.js +9 -4
  50. package/examples/jsm/lights/SunLightNode.js +3 -3
  51. package/examples/jsm/lines/LineMaterial.js +26 -10
  52. package/examples/jsm/loaders/3DMLoader.js +10 -1
  53. package/examples/jsm/loaders/3MFLoader.js +5 -1
  54. package/examples/jsm/loaders/AMFLoader.js +2 -0
  55. package/examples/jsm/loaders/BVHLoader.js +2 -0
  56. package/examples/jsm/loaders/ColladaLoader.js +8 -0
  57. package/examples/jsm/loaders/DDSLoader.js +1 -1
  58. package/examples/jsm/loaders/DRACOLoader.js +5 -1
  59. package/examples/jsm/loaders/EXRLoader.js +120 -104
  60. package/examples/jsm/loaders/FBXLoader.js +4 -0
  61. package/examples/jsm/loaders/FontLoader.js +2 -0
  62. package/examples/jsm/loaders/GCodeLoader.js +5 -9
  63. package/examples/jsm/loaders/GLTFLoader.js +112 -31
  64. package/examples/jsm/loaders/GaussianSplatPLYLoader.js +2 -0
  65. package/examples/jsm/loaders/HDRCubeTextureLoader.js +3 -0
  66. package/examples/jsm/loaders/IESLoader.js +46 -12
  67. package/examples/jsm/loaders/JXLLoader.js +159 -0
  68. package/examples/jsm/loaders/KMZLoader.js +6 -0
  69. package/examples/jsm/loaders/KSPLATLoader.js +2 -0
  70. package/examples/jsm/loaders/KTX2Loader.js +49 -4
  71. package/examples/jsm/loaders/KTXLoader.js +5 -3
  72. package/examples/jsm/loaders/LDrawLoader.js +15 -22
  73. package/examples/jsm/loaders/LUT3dlLoader.js +5 -1
  74. package/examples/jsm/loaders/LUTCubeLoader.js +6 -2
  75. package/examples/jsm/loaders/LUTImageLoader.js +2 -0
  76. package/examples/jsm/loaders/LWOLoader.js +6 -0
  77. package/examples/jsm/loaders/MD2Loader.js +2 -0
  78. package/examples/jsm/loaders/MDDLoader.js +4 -0
  79. package/examples/jsm/loaders/MTLLoader.js +8 -0
  80. package/examples/jsm/loaders/MaterialXLoader.js +57 -5
  81. package/examples/jsm/loaders/NRRDLoader.js +4 -2
  82. package/examples/jsm/loaders/OBJLoader.js +10 -4
  83. package/examples/jsm/loaders/PCDLoader.js +6 -2
  84. package/examples/jsm/loaders/PDBLoader.js +5 -3
  85. package/examples/jsm/loaders/PLYLoader.js +39 -15
  86. package/examples/jsm/loaders/PVRLoader.js +2 -2
  87. package/examples/jsm/loaders/SPLATLoader.js +2 -0
  88. package/examples/jsm/loaders/SPZLoader.js +2 -0
  89. package/examples/jsm/loaders/STLLoader.js +3 -1
  90. package/examples/jsm/loaders/SVGLoader.js +27 -49
  91. package/examples/jsm/loaders/TDSLoader.js +4 -0
  92. package/examples/jsm/loaders/TGALoader.js +6 -5
  93. package/examples/jsm/loaders/TTFLoader.js +2 -0
  94. package/examples/jsm/loaders/USDLoader.js +14 -0
  95. package/examples/jsm/loaders/UltraHDRLoader.js +2 -0
  96. package/examples/jsm/loaders/VOXLoader.js +3 -0
  97. package/examples/jsm/loaders/VRMLLoader.js +4 -0
  98. package/examples/jsm/loaders/VTKLoader.js +2 -0
  99. package/examples/jsm/loaders/XYZLoader.js +2 -0
  100. package/examples/jsm/loaders/collada/ColladaComposer.js +15 -8
  101. package/examples/jsm/loaders/materialx/MaterialXDocument.js +610 -138
  102. package/examples/jsm/loaders/materialx/MaterialXInterfaceValidation.js +12 -95
  103. package/examples/jsm/loaders/materialx/MaterialXLog.js +4 -0
  104. package/examples/jsm/loaders/materialx/MaterialXNodeDefs.js +99 -0
  105. package/examples/jsm/loaders/materialx/MaterialXNodeInterfaceRegistry.js +760 -1
  106. package/examples/jsm/loaders/materialx/MaterialXNodeLibrary.js +222 -372
  107. package/examples/jsm/loaders/materialx/MaterialXSurfaceMappings.js +163 -259
  108. package/examples/jsm/loaders/materialx/MaterialXUtils.js +25 -0
  109. package/examples/jsm/loaders/materialx/compile/MaterialXCompileRegistry.js +161 -159
  110. package/examples/jsm/loaders/usd/USDAParser.js +56 -47
  111. package/examples/jsm/loaders/usd/USDComposer.js +25 -30
  112. package/examples/jsm/math/ColorConverter.js +7 -3
  113. package/examples/jsm/math/Lut.js +2 -2
  114. package/examples/jsm/math/OBB.js +3 -3
  115. package/examples/jsm/math/Octree.js +20 -17
  116. package/examples/jsm/objects/GaussianSplat.js +5 -4
  117. package/examples/jsm/objects/Reflector.js +5 -0
  118. package/examples/jsm/objects/SkyMesh.js +14 -7
  119. package/examples/jsm/objects/Water2Mesh.js +2 -2
  120. package/examples/jsm/physics/RapierPhysics.js +2 -2
  121. package/examples/jsm/pipelines/MeshletDrawingPipeline.js +5571 -0
  122. package/examples/jsm/pipelines/VisibilityBufferDrawingPipeline.js +954 -0
  123. package/examples/jsm/postprocessing/BokehPass.js +1 -1
  124. package/examples/jsm/postprocessing/GTAOPass.js +26 -18
  125. package/examples/jsm/renderers/SVGRenderer.js +3 -2
  126. package/examples/jsm/shaders/GTAOShader.js +7 -4
  127. package/examples/jsm/shaders/PoissonDenoiseShader.js +1 -10
  128. package/examples/jsm/tsl/WebGLNodesHandler.js +21 -9
  129. package/examples/jsm/tsl/display/AfterImageNode.js +3 -3
  130. package/examples/jsm/tsl/display/BilateralBlurNode.js +3 -3
  131. package/examples/jsm/tsl/display/BloomNode.js +3 -3
  132. package/examples/jsm/tsl/display/ChromaticAberrationNode.js +8 -19
  133. package/examples/jsm/tsl/display/DenoiseNode.js +5 -5
  134. package/examples/jsm/tsl/display/DepthOfFieldNode.js +3 -3
  135. package/examples/jsm/tsl/display/DotScreenNode.js +3 -3
  136. package/examples/jsm/tsl/display/FSR1Node.js +3 -3
  137. package/examples/jsm/tsl/display/FXAANode.js +3 -10
  138. package/examples/jsm/tsl/display/FilmNode.js +3 -3
  139. package/examples/jsm/tsl/display/GTAONode.js +33 -25
  140. package/examples/jsm/tsl/display/GaussianBlurNode.js +3 -3
  141. package/examples/jsm/tsl/display/GodraysNode.js +5 -19
  142. package/examples/jsm/tsl/display/ImportanceSampledEnvironment.js +8 -4
  143. package/examples/jsm/tsl/display/LensflareNode.js +3 -3
  144. package/examples/jsm/tsl/display/Lut3DNode.js +3 -3
  145. package/examples/jsm/tsl/display/OITPassNode.js +0 -11
  146. package/examples/jsm/tsl/display/OutlineNode.js +107 -5
  147. package/examples/jsm/tsl/display/PixelationPassNode.js +85 -193
  148. package/examples/jsm/tsl/display/RGBShiftNode.js +3 -3
  149. package/examples/jsm/tsl/display/RecurrentDenoiseNode.js +23 -126
  150. package/examples/jsm/tsl/display/SMAANode.js +3 -3
  151. package/examples/jsm/tsl/display/SSAONode.js +6 -20
  152. package/examples/jsm/tsl/display/SSGINode.js +36 -29
  153. package/examples/jsm/tsl/display/SSRNode.js +135 -63
  154. package/examples/jsm/tsl/display/SSSNode.js +6 -20
  155. package/examples/jsm/tsl/display/SharpenNode.js +3 -3
  156. package/examples/jsm/tsl/display/SobelOperatorNode.js +3 -3
  157. package/examples/jsm/tsl/display/TAAUNode.js +10 -42
  158. package/examples/jsm/tsl/display/TRAANode.js +11 -43
  159. package/examples/jsm/tsl/display/TemporalReprojectNode.js +42 -47
  160. package/examples/jsm/tsl/display/TransitionNode.js +3 -3
  161. package/examples/jsm/tsl/display/lensDirt.js +30 -0
  162. package/examples/jsm/tsl/lighting/ClusteredLightsNode.js +482 -121
  163. package/examples/jsm/tsl/lighting/DynamicLightsNode.js +41 -140
  164. package/examples/jsm/tsl/lighting/LightProbeGridNode.js +72 -25
  165. package/examples/jsm/tsl/lighting/data/AmbientLightDataNode.js +6 -0
  166. package/examples/jsm/tsl/lighting/data/DirectionalLightDataNode.js +6 -0
  167. package/examples/jsm/tsl/lighting/data/HemisphereLightDataNode.js +6 -0
  168. package/examples/jsm/tsl/lighting/data/PointLightDataNode.js +6 -0
  169. package/examples/jsm/tsl/lighting/data/SpotLightDataNode.js +6 -0
  170. package/examples/jsm/tsl/shadows/TileShadowNode.js +102 -14
  171. package/examples/jsm/tsl/utils/Raymarching.js +1 -1
  172. package/examples/jsm/tsl/utils/SoftParticles.js +5 -12
  173. package/examples/jsm/tsl/utils/SpecularHelpers.js +47 -70
  174. package/examples/jsm/tsl/utils/TAAUtils.js +6 -17
  175. package/examples/jsm/utils/BufferGeometryUtils.js +110 -88
  176. package/examples/jsm/utils/MeshletGeometryUtils.js +417 -0
  177. package/examples/jsm/utils/SceneOptimizer.js +2 -1
  178. package/examples/jsm/utils/SceneUtils.js +1 -1
  179. package/examples/jsm/utils/unwrapUVs.js +865 -0
  180. package/examples/jsm/webxr/XREstimatedLight.js +11 -4
  181. package/package.json +3 -3
  182. package/src/Three.TSL.js +2 -683
  183. package/src/Three.WebGPU.Nodes.js +2 -1
  184. package/src/Three.WebGPU.js +2 -1
  185. package/src/animation/AnimationAction.js +1 -1
  186. package/src/animation/AnimationUtils.js +1 -3
  187. package/src/animation/KeyframeTrack.js +19 -0
  188. package/src/cameras/ArrayCamera.js +12 -0
  189. package/src/cameras/CubeCamera.js +3 -3
  190. package/src/constants.js +1 -9
  191. package/src/core/BufferAttribute.js +57 -21
  192. package/src/core/BufferGeometry.js +5 -13
  193. package/src/core/Clock.js +1 -1
  194. package/src/core/InterleavedBuffer.js +28 -18
  195. package/src/core/InterleavedBufferAttribute.js +54 -20
  196. package/src/core/Object3D.js +19 -9
  197. package/src/core/Raycaster.js +2 -0
  198. package/src/core/RenderTarget.js +11 -5
  199. package/src/core/UniformsGroup.js +7 -3
  200. package/src/extras/PMREMGenerator.js +392 -685
  201. package/src/extras/core/Curve.js +4 -0
  202. package/src/extras/core/CurvePath.js +13 -0
  203. package/src/extras/core/ShapePath.js +1 -1
  204. package/src/geometries/EdgesGeometry.js +12 -10
  205. package/src/geometries/LatheGeometry.js +2 -0
  206. package/src/helpers/PolarGridHelper.js +1 -1
  207. package/src/lights/Light.js +11 -0
  208. package/src/lights/LightProbe.js +2 -0
  209. package/src/lights/LightShadow.js +2 -0
  210. package/src/loaders/AnimationLoader.js +2 -0
  211. package/src/loaders/AudioLoader.js +2 -0
  212. package/src/loaders/BufferGeometryLoader.js +2 -0
  213. package/src/loaders/CompressedTextureLoader.js +2 -0
  214. package/src/loaders/CubeTextureLoader.js +2 -0
  215. package/src/loaders/DataTextureLoader.js +2 -0
  216. package/src/loaders/FileLoader.js +2 -0
  217. package/src/loaders/ImageBitmapLoader.js +3 -1
  218. package/src/loaders/ImageLoader.js +1 -0
  219. package/src/loaders/Loader.js +47 -0
  220. package/src/loaders/MaterialLoader.js +2 -0
  221. package/src/loaders/ObjectLoader.js +27 -8
  222. package/src/loaders/TextureLoader.js +5 -3
  223. package/src/loaders/nodes/NodeLoader.js +2 -0
  224. package/src/materials/Material.js +21 -2
  225. package/src/materials/MeshDepthMaterial.js +1 -1
  226. package/src/materials/MeshDistanceMaterial.js +1 -1
  227. package/src/materials/MeshLambertMaterial.js +1 -1
  228. package/src/materials/MeshMatcapMaterial.js +1 -1
  229. package/src/materials/MeshNormalMaterial.js +1 -1
  230. package/src/materials/MeshPhongMaterial.js +1 -1
  231. package/src/materials/MeshPhysicalMaterial.js +90 -11
  232. package/src/materials/MeshStandardMaterial.js +1 -1
  233. package/src/materials/MeshToonMaterial.js +1 -1
  234. package/src/materials/nodes/Line2NodeMaterial.js +32 -10
  235. package/src/materials/nodes/MeshLambertNodeMaterial.js +13 -0
  236. package/src/materials/nodes/MeshPhongNodeMaterial.js +13 -0
  237. package/src/materials/nodes/MeshPhysicalNodeMaterial.js +40 -5
  238. package/src/materials/nodes/MeshToonNodeMaterial.js +13 -0
  239. package/src/materials/nodes/NodeMaterial.js +36 -16
  240. package/src/materials/nodes/NodeMaterialInstance.js +193 -0
  241. package/src/materials/nodes/NodeMaterials.js +1 -0
  242. package/src/materials/nodes/PointsNodeMaterial.js +1 -1
  243. package/src/materials/nodes/SpriteNodeMaterial.js +3 -3
  244. package/src/materials/nodes/manager/NodeMaterialObserver.js +191 -22
  245. package/src/math/Box3.js +2 -2
  246. package/src/math/Color.js +8 -8
  247. package/src/math/ColorManagement.js +2 -21
  248. package/src/math/FrustumArray.js +12 -0
  249. package/src/math/Interpolant.js +1 -1
  250. package/src/math/Line3.js +2 -4
  251. package/src/math/MathUtils.js +33 -46
  252. package/src/math/Matrix2.js +1 -1
  253. package/src/math/Matrix3.js +1 -1
  254. package/src/math/Matrix4.js +1 -1
  255. package/src/math/Triangle.js +2 -1
  256. package/src/math/Vector2.js +1 -1
  257. package/src/math/Vector3.js +1 -1
  258. package/src/math/Vector4.js +1 -1
  259. package/src/nodes/Nodes.js +1 -0
  260. package/src/nodes/TSL.js +2 -0
  261. package/src/nodes/accessors/Arrays.js +1 -1
  262. package/src/nodes/accessors/Batch.js +29 -23
  263. package/src/nodes/accessors/BufferAttributeNode.js +21 -1
  264. package/src/nodes/accessors/BuiltinNode.js +6 -0
  265. package/src/nodes/accessors/Camera.js +100 -93
  266. package/src/nodes/accessors/ClippingNode.js +17 -6
  267. package/src/nodes/accessors/CubeTextureNode.js +12 -24
  268. package/src/nodes/accessors/Instance.js +198 -160
  269. package/src/nodes/accessors/Lights.js +19 -6
  270. package/src/nodes/accessors/MaterialNode.js +33 -4
  271. package/src/nodes/accessors/Morph.js +81 -22
  272. package/src/nodes/accessors/Normal.js +0 -42
  273. package/src/nodes/accessors/Object3DNode.js +6 -0
  274. package/src/nodes/accessors/PointUVNode.js +6 -0
  275. package/src/nodes/accessors/ReferenceAttributeNode.js +279 -0
  276. package/src/nodes/accessors/ReferenceBaseNode.js +6 -0
  277. package/src/nodes/accessors/ReferenceNode.js +6 -0
  278. package/src/nodes/accessors/Skinning.js +57 -52
  279. package/src/nodes/accessors/StorageBufferNode.js +3 -12
  280. package/src/nodes/accessors/TextureBicubic.js +30 -27
  281. package/src/nodes/accessors/TextureNode.js +164 -78
  282. package/src/nodes/accessors/TextureSizeNode.js +6 -0
  283. package/src/nodes/accessors/UniformArrayNode.js +8 -15
  284. package/src/nodes/accessors/VelocityNode.js +13 -8
  285. package/src/nodes/code/CodeNode.js +6 -0
  286. package/src/nodes/code/ExpressionNode.js +6 -0
  287. package/src/nodes/code/FunctionCallNode.js +3 -3
  288. package/src/nodes/code/FunctionNode.js +15 -13
  289. package/src/nodes/core/ArrayNode.js +3 -3
  290. package/src/nodes/core/AssignNode.js +10 -9
  291. package/src/nodes/core/AttributeNode.js +39 -0
  292. package/src/nodes/core/BypassNode.js +6 -0
  293. package/src/nodes/core/ConstNode.js +31 -1
  294. package/src/nodes/core/ContextNode.js +11 -6
  295. package/src/nodes/core/IndexNode.js +6 -0
  296. package/src/nodes/core/InputNode.js +6 -0
  297. package/src/nodes/core/InspectorNode.js +17 -31
  298. package/src/nodes/core/IsolateNode.js +8 -0
  299. package/src/nodes/core/Node.js +367 -67
  300. package/src/nodes/core/NodeBuilder.js +664 -222
  301. package/src/nodes/core/NodeUtils.js +25 -0
  302. package/src/nodes/core/NodeVar.js +10 -1
  303. package/src/nodes/core/OutputStructNode.js +6 -0
  304. package/src/nodes/core/OverrideContextNode.js +38 -37
  305. package/src/nodes/core/PropertyNode.js +14 -0
  306. package/src/nodes/core/StackNode.js +33 -21
  307. package/src/nodes/core/StructNode.js +6 -0
  308. package/src/nodes/core/StructTypeNode.js +6 -0
  309. package/src/nodes/core/SubBuildNode.js +8 -0
  310. package/src/nodes/core/TempNode.js +10 -35
  311. package/src/nodes/core/UniformGroupNode.js +6 -0
  312. package/src/nodes/core/VarNode.js +43 -135
  313. package/src/nodes/core/VaryingNode.js +33 -2
  314. package/src/nodes/display/BlendModes.js +5 -40
  315. package/src/nodes/display/BumpMapNode.js +17 -7
  316. package/src/nodes/display/ColorAdjustment.js +22 -10
  317. package/src/nodes/display/ColorSpaceFunctions.js +2 -14
  318. package/src/nodes/display/ColorSpaceNode.js +3 -3
  319. package/src/nodes/display/FrontFacingNode.js +6 -0
  320. package/src/nodes/display/NormalMapNode.js +3 -3
  321. package/src/nodes/display/PassNode.js +75 -16
  322. package/src/nodes/display/RenderOutputNode.js +22 -5
  323. package/src/nodes/display/ScreenNode.js +6 -0
  324. package/src/nodes/display/ToneMappingFunctions.js +9 -51
  325. package/src/nodes/display/ToneMappingNode.js +3 -3
  326. package/src/nodes/display/ToonOutlinePassNode.js +66 -2
  327. package/src/nodes/display/ViewportDepthNode.js +34 -4
  328. package/src/nodes/functions/BSDF/BRDF_EON.js +65 -0
  329. package/src/nodes/functions/BSDF/BRDF_GGX.js +5 -3
  330. package/src/nodes/functions/BSDF/BRDF_Sheen.js +2 -16
  331. package/src/nodes/functions/BSDF/D_GGX.js +1 -8
  332. package/src/nodes/functions/BSDF/D_GGX_Anisotropic.js +7 -10
  333. package/src/nodes/functions/BSDF/LTC.js +20 -47
  334. package/src/nodes/functions/BSDF/Schlick_to_F0.js +1 -9
  335. package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +1 -9
  336. package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +10 -13
  337. package/src/nodes/functions/PhysicalLightingModel.js +84 -51
  338. package/src/nodes/functions/VolumetricLightingModel.js +1 -1
  339. package/src/nodes/functions/material/getAlphaHashThreshold.js +3 -9
  340. package/src/nodes/functions/material/getParallaxCorrectNormal.js +10 -11
  341. package/src/nodes/functions/material/getRoughness.js +3 -1
  342. package/src/nodes/geometry/RangeNode.js +52 -69
  343. package/src/nodes/gpgpu/AtomicFunctionNode.js +11 -6
  344. package/src/nodes/gpgpu/BarrierNode.js +6 -0
  345. package/src/nodes/gpgpu/ComputeBuiltinNode.js +6 -0
  346. package/src/nodes/gpgpu/ComputeNode.js +6 -0
  347. package/src/nodes/gpgpu/SubgroupFunctionNode.js +38 -29
  348. package/src/nodes/gpgpu/WorkgroupInfoNode.js +6 -0
  349. package/src/nodes/lighting/AnalyticLightNode.js +7 -14
  350. package/src/nodes/lighting/BasicEnvironmentNode.js +5 -1
  351. package/src/nodes/lighting/EnvironmentNode.js +58 -8
  352. package/src/nodes/lighting/IESSpotLightNode.js +19 -4
  353. package/src/nodes/lighting/LightProbeNode.js +2 -1
  354. package/src/nodes/lighting/LightUtils.js +2 -2
  355. package/src/nodes/lighting/LightingNode.js +6 -0
  356. package/src/nodes/lighting/LightsNode.js +26 -32
  357. package/src/nodes/lighting/PointShadowNode.js +92 -48
  358. package/src/nodes/lighting/ProjectorLightNode.js +1 -1
  359. package/src/nodes/lighting/RectAreaLightNode.js +13 -14
  360. package/src/nodes/lighting/ShadowBaseNode.js +9 -17
  361. package/src/nodes/lighting/ShadowFilterNode.js +26 -3
  362. package/src/nodes/lighting/ShadowNode.js +13 -11
  363. package/src/nodes/materialx/MaterialXColor.js +2 -14
  364. package/src/nodes/materialx/MaterialXColorTransform.js +1 -7
  365. package/src/nodes/materialx/MaterialXNodes.js +8 -11
  366. package/src/nodes/materialx/MaterialXNoise.js +195 -454
  367. package/src/nodes/math/BitcastNode.js +5 -5
  368. package/src/nodes/math/BitcountNode.js +18 -46
  369. package/src/nodes/math/ConditionalNode.js +92 -22
  370. package/src/nodes/math/Hash.js +1 -1
  371. package/src/nodes/math/MathNode.js +86 -64
  372. package/src/nodes/math/MathUtils.js +2 -2
  373. package/src/nodes/math/OperatorNode.js +42 -59
  374. package/src/nodes/math/PackFloatNode.js +9 -9
  375. package/src/nodes/math/Packed4x8IntegerNode.js +20 -52
  376. package/src/nodes/math/TriNoise3D.js +3 -23
  377. package/src/nodes/math/UnpackFloatNode.js +9 -9
  378. package/src/nodes/pmrem/PMREMNode.js +38 -75
  379. package/src/nodes/pmrem/PMREMUtils.js +108 -272
  380. package/src/nodes/procedural/Checker.js +1 -1
  381. package/src/nodes/tsl/TSLCore.js +199 -74
  382. package/src/nodes/utils/ArrayElementNode.js +19 -1
  383. package/src/nodes/utils/CubeMapNode.js +3 -3
  384. package/src/nodes/utils/DebugNode.js +2 -2
  385. package/src/nodes/utils/EventNode.js +6 -0
  386. package/src/nodes/utils/FlipNode.js +3 -3
  387. package/src/nodes/utils/FunctionOverloadingNode.js +7 -1
  388. package/src/nodes/utils/JoinNode.js +3 -3
  389. package/src/nodes/utils/LoopNode.js +14 -9
  390. package/src/nodes/utils/MemberNode.js +18 -0
  391. package/src/nodes/utils/PostProcessingUtils.js +20 -25
  392. package/src/nodes/utils/RTTNode.js +2 -0
  393. package/src/nodes/utils/ReflectorNode.js +24 -0
  394. package/src/nodes/utils/RotateNode.js +3 -3
  395. package/src/nodes/utils/SampleNode.js +6 -0
  396. package/src/nodes/utils/SetNode.js +3 -3
  397. package/src/nodes/utils/SplitNode.js +6 -0
  398. package/src/nodes/utils/UVUtils.js +2 -2
  399. package/src/objects/BatchedMesh.js +146 -15
  400. package/src/objects/InstancedMesh.js +12 -4
  401. package/src/objects/Line.js +20 -0
  402. package/src/objects/Mesh.js +8 -0
  403. package/src/objects/Points.js +20 -0
  404. package/src/objects/Skeleton.js +26 -0
  405. package/src/objects/SkinnedMesh.js +3 -3
  406. package/src/objects/Sprite.js +10 -0
  407. package/src/renderers/WebGLRenderer.js +104 -70
  408. package/src/renderers/common/Animation.js +5 -1
  409. package/src/renderers/common/Attributes.js +67 -57
  410. package/src/renderers/common/Backend.js +78 -3
  411. package/src/renderers/common/BindGroup.js +11 -0
  412. package/src/renderers/common/Binding.js +0 -11
  413. package/src/renderers/common/Bindings.js +116 -10
  414. package/src/renderers/common/Buffer.js +1 -1
  415. package/src/renderers/common/ClippingContext.js +12 -1
  416. package/src/renderers/common/ComputePipeline.js +17 -1
  417. package/src/renderers/common/DirectRenderPipeline.js +7 -3
  418. package/src/renderers/common/Geometries.js +170 -132
  419. package/src/renderers/common/Info.js +1 -1
  420. package/src/renderers/common/InspectorBase.js +5 -5
  421. package/src/renderers/common/Lighting.js +59 -0
  422. package/src/renderers/common/Pipelines.js +26 -12
  423. package/src/renderers/common/ProgrammableStage.js +1 -17
  424. package/src/renderers/common/RenderContext.js +21 -0
  425. package/src/renderers/common/RenderContexts.js +13 -4
  426. package/src/renderers/common/RenderObject.js +111 -35
  427. package/src/renderers/common/RenderObjects.js +37 -19
  428. package/src/renderers/common/Renderer.js +537 -295
  429. package/src/renderers/common/RendererUtils.js +15 -0
  430. package/src/renderers/common/StandardDrawingPipeline.js +343 -0
  431. package/src/renderers/common/Storage3DTexture.js +11 -0
  432. package/src/renderers/common/StorageArrayTexture.js +10 -0
  433. package/src/renderers/common/StorageTexture.js +0 -9
  434. package/src/renderers/common/Textures.js +144 -37
  435. package/src/renderers/common/UniformsGroup.js +19 -0
  436. package/src/renderers/common/XRManager.js +10 -91
  437. package/src/renderers/common/extras/PMREMGenerator.js +298 -576
  438. package/src/renderers/common/nodes/NodeBuilderState.js +7 -5
  439. package/src/renderers/common/nodes/NodeLibrary.js +11 -35
  440. package/src/renderers/common/nodes/NodeManager.js +80 -31
  441. package/src/renderers/common/nodes/NodeSampledTexture.js +14 -0
  442. package/src/renderers/common/nodes/NodeSampler.js +14 -0
  443. package/src/renderers/common/nodes/NodeStorageBuffer.js +1 -1
  444. package/src/renderers/common/nodes/NodeUniformBuffer.js +1 -14
  445. package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +13 -4
  446. package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +8 -8
  447. package/src/renderers/shaders/ShaderChunk/lightprobes_pars_fragment.glsl.js +23 -11
  448. package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +21 -2
  449. package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +1 -1
  450. package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +18 -2
  451. package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +104 -7
  452. package/src/renderers/shaders/ShaderChunk/morphcolor_vertex.glsl.js +11 -2
  453. package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +36 -20
  454. package/src/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl.js +5 -0
  455. package/src/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl.js +6 -0
  456. package/src/renderers/shaders/ShaderChunk/uv_vertex.glsl.js +5 -0
  457. package/src/renderers/shaders/ShaderChunk.js +0 -2
  458. package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +4 -18
  459. package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +0 -1
  460. package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +0 -1
  461. package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +8 -1
  462. package/src/renderers/shaders/ShaderLib.js +3 -0
  463. package/src/renderers/shaders/UniformsLib.js +4 -5
  464. package/src/renderers/webgl/WebGLBackground.js +3 -3
  465. package/src/renderers/webgl/WebGLBindingStates.js +4 -2
  466. package/src/renderers/webgl/WebGLCapabilities.js +7 -1
  467. package/src/renderers/webgl/WebGLEnvironments.js +2 -2
  468. package/src/renderers/webgl/WebGLGeometries.js +42 -14
  469. package/src/renderers/webgl/WebGLMaterials.js +15 -2
  470. package/src/renderers/webgl/WebGLOutput.js +37 -1
  471. package/src/renderers/webgl/WebGLProgram.js +13 -54
  472. package/src/renderers/webgl/WebGLPrograms.js +22 -8
  473. package/src/renderers/webgl/WebGLRenderStates.js +11 -8
  474. package/src/renderers/webgl/WebGLShadowMap.js +6 -4
  475. package/src/renderers/webgl/WebGLState.js +10 -6
  476. package/src/renderers/webgl/WebGLTextures.js +129 -77
  477. package/src/renderers/webgl/WebGLUniforms.js +44 -6
  478. package/src/renderers/webgl/WebGLUniformsGroups.js +75 -69
  479. package/src/renderers/webgl-fallback/WebGLBackend.js +206 -278
  480. package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +154 -20
  481. package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +45 -42
  482. package/src/renderers/webgl-fallback/utils/WebGLState.js +29 -4
  483. package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +129 -49
  484. package/src/renderers/webgl-fallback/utils/WebGLVertexArrayUtils.js +346 -0
  485. package/src/renderers/webgpu/WebGPUBackend.js +140 -82
  486. package/src/renderers/webgpu/WebGPURenderer.js +1 -1
  487. package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +10 -10
  488. package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +10 -10
  489. package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +135 -60
  490. package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +128 -55
  491. package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +1 -1
  492. package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +15 -12
  493. package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +55 -19
  494. package/src/renderers/webgpu/utils/WebGPUUtils.js +20 -3
  495. package/src/renderers/webxr/WebXRController.js +3 -3
  496. package/src/renderers/webxr/WebXRManager.js +5 -90
  497. package/src/scenes/Scene.js +4 -4
  498. package/src/textures/CompressedTexture.js +2 -2
  499. package/src/textures/DepthTexture.js +2 -2
  500. package/src/textures/FramebufferTexture.js +11 -0
  501. package/src/textures/Texture.js +29 -1
  502. package/src/textures/TextureSource.js +1 -1
  503. package/src/upe.js +1 -1
  504. package/src/utils.js +4 -4
  505. package/examples/jsm/libs/surfaceNet.js +0 -201
  506. package/src/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl.js +0 -186
@@ -3,7 +3,7 @@
3
3
  * Copyright 2010-2026 Three.js Authors
4
4
  * SPDX-License-Identifier: MIT
5
5
  */
6
- const REVISION = '186';
6
+ const REVISION = '187';
7
7
 
8
8
  /**
9
9
  * Represents mouse buttons and interaction types in context of controls.
@@ -544,14 +544,6 @@ const EquirectangularReflectionMapping = 303;
544
544
  */
545
545
  const EquirectangularRefractionMapping = 304;
546
546
 
547
- /**
548
- * Reflection mapping for PMREM textures.
549
- *
550
- * @type {number}
551
- * @constant
552
- */
553
- const CubeUVReflectionMapping = 306;
554
-
555
547
  /**
556
548
  * The texture will simply repeat to infinity.
557
549
  *
@@ -2160,14 +2152,14 @@ function probeAsync( gl, sync, interval ) {
2160
2152
  * @type {Object}
2161
2153
  */
2162
2154
  const ReversedDepthFuncs = {
2163
- [ NeverDepth ]: AlwaysDepth,
2155
+ [ NeverDepth ]: NeverDepth,
2164
2156
  [ LessDepth ]: GreaterDepth,
2165
- [ EqualDepth ]: NotEqualDepth,
2157
+ [ EqualDepth ]: EqualDepth,
2166
2158
  [ LessEqualDepth ]: GreaterEqualDepth,
2167
2159
 
2168
- [ AlwaysDepth ]: NeverDepth,
2160
+ [ AlwaysDepth ]: AlwaysDepth,
2169
2161
  [ GreaterDepth ]: LessDepth,
2170
- [ NotEqualDepth ]: EqualDepth,
2162
+ [ NotEqualDepth ]: NotEqualDepth,
2171
2163
  [ GreaterEqualDepth ]: LessEqualDepth,
2172
2164
  };
2173
2165
 
@@ -2679,98 +2671,84 @@ function setQuaternionFromProperEuler( q, a, b, c, order ) {
2679
2671
  }
2680
2672
 
2681
2673
  /**
2682
- * Denormalizes the given value according to the given typed array.
2674
+ * Returns the factor used by {@link normalize} and {@link denormalize} for the given typed array,
2675
+ * or `undefined` if the values are not scaled (float arrays) or the array type is not supported.
2683
2676
  *
2684
- * @param {number} value - The value to denormalize.
2685
2677
  * @param {TypedArray} array - The typed array that defines the data type of the value.
2686
- * @return {number} The denormalize (float) value in the range `[0,1]`.
2678
+ * @return {number|undefined} The normalization factor.
2687
2679
  */
2688
- function denormalize( value, array ) {
2680
+ function getNormalizationScale( array ) {
2689
2681
 
2690
2682
  switch ( array.constructor ) {
2691
2683
 
2692
- case Float32Array:
2693
-
2694
- return value;
2695
-
2696
2684
  case Uint32Array:
2697
2685
 
2698
- return value / 4294967295.0;
2686
+ return 4294967295.0;
2699
2687
 
2700
2688
  case Uint16Array:
2701
2689
 
2702
- return value / 65535.0;
2690
+ return 65535.0;
2703
2691
 
2704
2692
  case Uint8Array:
2705
2693
  case Uint8ClampedArray:
2706
2694
 
2707
- return value / 255.0;
2695
+ return 255.0;
2708
2696
 
2709
2697
  case Int32Array:
2710
2698
 
2711
- return Math.max( value / 2147483647.0, -1 );
2699
+ return 2147483647.0;
2712
2700
 
2713
2701
  case Int16Array:
2714
2702
 
2715
- return Math.max( value / 32767.0, -1 );
2703
+ return 32767.0;
2716
2704
 
2717
2705
  case Int8Array:
2718
2706
 
2719
- return Math.max( value / 127.0, -1 );
2707
+ return 127.0;
2720
2708
 
2721
2709
  default:
2722
2710
 
2723
- throw new Error( 'THREE.MathUtils: Invalid component type.' );
2711
+ return undefined;
2724
2712
 
2725
2713
  }
2726
2714
 
2727
2715
  }
2728
2716
 
2729
2717
  /**
2730
- * Normalizes the given value according to the given typed array.
2718
+ * Denormalizes the given value according to the given typed array.
2731
2719
  *
2732
- * @param {number} value - The float value in the range `[0,1]` to normalize.
2720
+ * @param {number} value - The value to denormalize.
2733
2721
  * @param {TypedArray} array - The typed array that defines the data type of the value.
2734
- * @return {number} The normalize value.
2722
+ * @return {number} The denormalized (float) value in the range `[0,1]` or `[-1,1]`
2735
2723
  */
2736
- function normalize( value, array ) {
2737
-
2738
- switch ( array.constructor ) {
2739
-
2740
- case Float32Array:
2741
-
2742
- return value;
2743
-
2744
- case Uint32Array:
2745
-
2746
- return Math.round( value * 4294967295.0 );
2747
-
2748
- case Uint16Array:
2749
-
2750
- return Math.round( value * 65535.0 );
2751
-
2752
- case Uint8Array:
2753
- case Uint8ClampedArray:
2724
+ function denormalize( value, array ) {
2754
2725
 
2755
- return Math.round( value * 255.0 );
2726
+ if ( array.constructor === Float32Array ) return value;
2756
2727
 
2757
- case Int32Array:
2728
+ const scale = getNormalizationScale( array );
2758
2729
 
2759
- return Math.round( value * 2147483647.0 );
2730
+ if ( scale === undefined ) throw new Error( 'THREE.MathUtils: Invalid component type.' );
2760
2731
 
2761
- case Int16Array:
2732
+ return Math.max( value / scale, -1 );
2762
2733
 
2763
- return Math.round( value * 32767.0 );
2734
+ }
2764
2735
 
2765
- case Int8Array:
2736
+ /**
2737
+ * Normalizes the given value according to the given typed array.
2738
+ *
2739
+ * @param {number} value - The float value in the range `[0,1]` or `[-1,1]` to normalize.
2740
+ * @param {TypedArray} array - The typed array that defines the data type of the value.
2741
+ * @return {number} The normalized value.
2742
+ */
2743
+ function normalize( value, array ) {
2766
2744
 
2767
- return Math.round( value * 127.0 );
2745
+ if ( array.constructor === Float32Array ) return value;
2768
2746
 
2769
- default:
2747
+ const scale = getNormalizationScale( array );
2770
2748
 
2771
- throw new Error( 'THREE.MathUtils: Invalid component type.' );
2749
+ if ( scale === undefined ) throw new Error( 'THREE.MathUtils: Invalid component type.' );
2772
2750
 
2773
- }
2751
+ return Math.round( value * scale );
2774
2752
 
2775
2753
  }
2776
2754
 
@@ -3060,7 +3038,7 @@ class Vector2 {
3060
3038
  * @readonly
3061
3039
  * @default true
3062
3040
  */
3063
- Vector2.prototype.isVector2 = true;
3041
+ this.prototype.isVector2 = true;
3064
3042
 
3065
3043
  }
3066
3044
 
@@ -4831,7 +4809,7 @@ class Vector3 {
4831
4809
  * @readonly
4832
4810
  * @default true
4833
4811
  */
4834
- Vector3.prototype.isVector3 = true;
4812
+ this.prototype.isVector3 = true;
4835
4813
 
4836
4814
  }
4837
4815
 
@@ -6093,7 +6071,7 @@ class Matrix3 {
6093
6071
  * @readonly
6094
6072
  * @default true
6095
6073
  */
6096
- Matrix3.prototype.isMatrix3 = true;
6074
+ this.prototype.isMatrix3 = true;
6097
6075
 
6098
6076
  }
6099
6077
 
@@ -6803,8 +6781,8 @@ function createColorManagement() {
6803
6781
  _getMatrix: function ( targetMatrix, sourceColorSpace, targetColorSpace ) {
6804
6782
 
6805
6783
  return targetMatrix
6806
- .copy( this.spaces[ sourceColorSpace ].toXYZ )
6807
- .multiply( this.spaces[ targetColorSpace ].fromXYZ );
6784
+ .copy( this.spaces[ targetColorSpace ].fromXYZ )
6785
+ .multiply( this.spaces[ sourceColorSpace ].toXYZ );
6808
6786
 
6809
6787
  },
6810
6788
 
@@ -6820,24 +6798,6 @@ function createColorManagement() {
6820
6798
 
6821
6799
  },
6822
6800
 
6823
- // Deprecated
6824
-
6825
- fromWorkingColorSpace: function ( color, targetColorSpace ) {
6826
-
6827
- warnOnce( 'ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().' ); // @deprecated, r177
6828
-
6829
- return ColorManagement.workingToColorSpace( color, targetColorSpace );
6830
-
6831
- },
6832
-
6833
- toWorkingColorSpace: function ( color, sourceColorSpace ) {
6834
-
6835
- warnOnce( 'ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().' ); // @deprecated, r177
6836
-
6837
- return ColorManagement.colorSpaceToWorking( color, sourceColorSpace );
6838
-
6839
- },
6840
-
6841
6801
  };
6842
6802
 
6843
6803
  /******************************************************************************
@@ -7116,7 +7076,7 @@ class TextureSource {
7116
7076
 
7117
7077
  } else if ( data !== null ) {
7118
7078
 
7119
- target.set( data.width, data.height, data.depth || 0 );
7079
+ target.set( data.width || 0, data.height || 0, data.depth || 0 );
7120
7080
 
7121
7081
  } else {
7122
7082
 
@@ -7366,7 +7326,7 @@ class Texture extends EventDispatcher {
7366
7326
  * How the texture is applied to the object. The value `UVMapping`
7367
7327
  * is the default, where texture or uv coordinates are used to apply the map.
7368
7328
  *
7369
- * @type {(UVMapping|CubeReflectionMapping|CubeRefractionMapping|EquirectangularReflectionMapping|EquirectangularRefractionMapping|CubeUVReflectionMapping)}
7329
+ * @type {(UVMapping|CubeReflectionMapping|CubeRefractionMapping|EquirectangularReflectionMapping|EquirectangularRefractionMapping)}
7370
7330
  * @default UVMapping
7371
7331
  */
7372
7332
  this.mapping = mapping;
@@ -7519,6 +7479,17 @@ class Texture extends EventDispatcher {
7519
7479
  */
7520
7480
  this.generateMipmaps = true;
7521
7481
 
7482
+ /**
7483
+ * Whether the renderer regenerates the mipmaps automatically whenever the
7484
+ * texture is uploaded, rendered to or copied into. Set this to `false` to
7485
+ * pause the regeneration and write the mip levels yourself. Requires
7486
+ * {@link Texture#generateMipmaps}.
7487
+ *
7488
+ * @type {boolean}
7489
+ * @default true
7490
+ */
7491
+ this.mipmapsAutoUpdate = true;
7492
+
7522
7493
  /**
7523
7494
  * If set to `true`, the alpha channel, if present, is multiplied into the
7524
7495
  * color channels when the texture is uploaded to the GPU.
@@ -7631,6 +7602,16 @@ class Texture extends EventDispatcher {
7631
7602
  */
7632
7603
  this.pmremVersion = 0;
7633
7604
 
7605
+ /**
7606
+ * Indicates whether this texture is a prefiltered cube environment map generated
7607
+ * by {@link PMREMGenerator}.
7608
+ *
7609
+ * @type {boolean}
7610
+ * @readonly
7611
+ * @default false
7612
+ */
7613
+ this.isPMREMTexture = false;
7614
+
7634
7615
  /**
7635
7616
  * Whether the texture should use one of the 16 bit integer formats which are normalized
7636
7617
  * to [0, 1] or [-1, 1] (depending on signed/unsigned) when sampled.
@@ -7766,6 +7747,7 @@ class Texture extends EventDispatcher {
7766
7747
  this.matrix.copy( source.matrix );
7767
7748
 
7768
7749
  this.generateMipmaps = source.generateMipmaps;
7750
+ this.mipmapsAutoUpdate = source.mipmapsAutoUpdate;
7769
7751
  this.premultiplyAlpha = source.premultiplyAlpha;
7770
7752
  this.flipY = source.flipY;
7771
7753
  this.unpackAlignment = source.unpackAlignment;
@@ -7773,6 +7755,7 @@ class Texture extends EventDispatcher {
7773
7755
 
7774
7756
  this.renderTarget = source.renderTarget;
7775
7757
  this.isRenderTargetTexture = source.isRenderTargetTexture;
7758
+ this.isPMREMTexture = source.isPMREMTexture;
7776
7759
  this.isArrayTexture = source.isArrayTexture;
7777
7760
 
7778
7761
  this.userData = JSON.parse( JSON.stringify( source.userData ) );
@@ -7884,6 +7867,7 @@ class Texture extends EventDispatcher {
7884
7867
  flipY: this.flipY,
7885
7868
 
7886
7869
  generateMipmaps: this.generateMipmaps,
7870
+ mipmapsAutoUpdate: this.mipmapsAutoUpdate,
7887
7871
  premultiplyAlpha: this.premultiplyAlpha,
7888
7872
  unpackAlignment: this.unpackAlignment
7889
7873
 
@@ -7905,6 +7889,10 @@ class Texture extends EventDispatcher {
7905
7889
  * Frees the GPU-related resources allocated by this instance. Call this
7906
7890
  * method whenever this instance is no longer used in your app.
7907
7891
  *
7892
+ * Textures that belong to a render target are managed by the render target.
7893
+ * Calling this method on such a texture only dispatches the dispose event but
7894
+ * does not free any GPU resources. Use {@link RenderTarget#dispose} instead.
7895
+ *
7908
7896
  * @fires Texture#dispose
7909
7897
  */
7910
7898
  dispose() {
@@ -8107,7 +8095,7 @@ class Vector4 {
8107
8095
  * @readonly
8108
8096
  * @default true
8109
8097
  */
8110
- Vector4.prototype.isVector4 = true;
8098
+ this.prototype.isVector4 = true;
8111
8099
 
8112
8100
  }
8113
8101
 
@@ -9147,6 +9135,7 @@ class RenderTarget extends EventDispatcher {
9147
9135
  *
9148
9136
  * @typedef {Object} RenderTarget~Options
9149
9137
  * @property {boolean} [generateMipmaps=false] - Whether to generate mipmaps or not.
9138
+ * @property {boolean} [mipmapsAutoUpdate=true] - Whether to regenerate mipmaps automatically after rendering or not.
9150
9139
  * @property {number} [magFilter=LinearFilter] - The mag filter.
9151
9140
  * @property {number} [minFilter=LinearFilter] - The min filter.
9152
9141
  * @property {number} [format=RGBAFormat] - The texture format.
@@ -9166,7 +9155,7 @@ class RenderTarget extends EventDispatcher {
9166
9155
  * @property {boolean} [storeMultisampledStencilBuffer=true] - Whether to store the multisampled stencil buffer or not. Setting to `false` saves memory bandwidth when the multisampled data are not needed after a render pass.
9167
9156
  * @property {?Texture} [depthTexture=null] - Reference to a depth texture.
9168
9157
  * @property {number} [samples=0] - The MSAA samples count.
9169
- * @property {number} [count=1] - Defines the number of color attachments . Must be at least `1`.
9158
+ * @property {number} [count=1] - Defines the number of color attachments. Use `0` for a depth-only render target (WebGPURenderer).
9170
9159
  * @property {number} [depth=1] - The texture depth.
9171
9160
  * @property {boolean} [multiview=false] - Whether this target is used for multiview rendering (WebGL OVR_multiview2 extension).
9172
9161
  * @property {boolean} [useArrayDepthTexture=false] - Whether to create the depth texture as an array texture for per-layer depth testing. This is separate from multiview so layered render targets can use array depth without the multiview extension.
@@ -9270,13 +9259,10 @@ class RenderTarget extends EventDispatcher {
9270
9259
  */
9271
9260
  this.textures = [];
9272
9261
 
9273
- const image = { width: width, height: height, depth: options.depth };
9274
- const texture = new Texture( image );
9275
-
9276
9262
  const count = options.count;
9277
9263
  for ( let i = 0; i < count; i ++ ) {
9278
9264
 
9279
- this.textures[ i ] = texture.clone();
9265
+ this.textures[ i ] = new Texture( { width: width, height: height, depth: options.depth } );
9280
9266
  this.textures[ i ].isRenderTargetTexture = true;
9281
9267
  this.textures[ i ].renderTarget = this;
9282
9268
 
@@ -9432,6 +9418,7 @@ class RenderTarget extends EventDispatcher {
9432
9418
  if ( options.colorSpace !== undefined ) values.colorSpace = options.colorSpace;
9433
9419
  if ( options.flipY !== undefined ) values.flipY = options.flipY;
9434
9420
  if ( options.generateMipmaps !== undefined ) values.generateMipmaps = options.generateMipmaps;
9421
+ if ( options.mipmapsAutoUpdate !== undefined ) values.mipmapsAutoUpdate = options.mipmapsAutoUpdate;
9435
9422
  if ( options.internalFormat !== undefined ) values.internalFormat = options.internalFormat;
9436
9423
 
9437
9424
  for ( let i = 0; i < this.textures.length; i ++ ) {
@@ -9596,6 +9583,10 @@ class RenderTarget extends EventDispatcher {
9596
9583
 
9597
9584
  }
9598
9585
 
9586
+ } else {
9587
+
9588
+ this.depthTexture = null;
9589
+
9599
9590
  }
9600
9591
 
9601
9592
  this.samples = source.samples;
@@ -9610,6 +9601,9 @@ class RenderTarget extends EventDispatcher {
9610
9601
  * Frees the GPU-related resources allocated by this instance. Call this
9611
9602
  * method whenever this instance is no longer used in your app.
9612
9603
  *
9604
+ * This also frees the resources of the render target's textures. There is
9605
+ * no need to dispose them separately.
9606
+ *
9613
9607
  * @fires RenderTarget#dispose
9614
9608
  */
9615
9609
  dispose() {
@@ -10058,7 +10052,7 @@ class Matrix4 {
10058
10052
  * @readonly
10059
10053
  * @default true
10060
10054
  */
10061
- Matrix4.prototype.isMatrix4 = true;
10055
+ this.prototype.isMatrix4 = true;
10062
10056
 
10063
10057
  }
10064
10058
 
@@ -12249,7 +12243,7 @@ class Object3D extends EventDispatcher {
12249
12243
 
12250
12244
  /**
12251
12245
  * Whether the 3D object is supposed to be static or not. If set to `true`, it means
12252
- * the 3D object is not going to be changed after the initial renderer. This includes
12246
+ * the 3D object is not going to be changed after the first render. This includes
12253
12247
  * geometry and material settings. A static 3D object can be processed by the renderer
12254
12248
  * slightly faster since certain state checks can be bypassed.
12255
12249
  *
@@ -12310,7 +12304,7 @@ class Object3D extends EventDispatcher {
12310
12304
  * A callback that is executed immediately before a 3D object is rendered.
12311
12305
  *
12312
12306
  * @param {Renderer|WebGLRenderer} renderer - The renderer.
12313
- * @param {Object3D} object - The 3D object.
12307
+ * @param {Object3D} scene - The scene.
12314
12308
  * @param {Camera} camera - The camera that is used to render the scene.
12315
12309
  * @param {BufferGeometry} geometry - The 3D object's geometry.
12316
12310
  * @param {Material} material - The 3D object's material.
@@ -12322,7 +12316,7 @@ class Object3D extends EventDispatcher {
12322
12316
  * A callback that is executed immediately after a 3D object is rendered.
12323
12317
  *
12324
12318
  * @param {Renderer|WebGLRenderer} renderer - The renderer.
12325
- * @param {Object3D} object - The 3D object.
12319
+ * @param {Object3D} scene - The scene.
12326
12320
  * @param {Camera} camera - The camera that is used to render the scene.
12327
12321
  * @param {BufferGeometry} geometry - The 3D object's geometry.
12328
12322
  * @param {Material} material - The 3D object's material.
@@ -12344,6 +12338,13 @@ class Object3D extends EventDispatcher {
12344
12338
 
12345
12339
  this.matrix.decompose( this.position, this.quaternion, this.scale );
12346
12340
 
12341
+ if ( this.pivot !== null ) {
12342
+
12343
+ // the matrix maps the pivot to position + pivot, see updateMatrix()
12344
+ this.position.copy( this.pivot ).applyMatrix4( this.matrix ).sub( this.pivot );
12345
+
12346
+ }
12347
+
12347
12348
  }
12348
12349
 
12349
12350
  /**
@@ -12952,15 +12953,18 @@ class Object3D extends EventDispatcher {
12952
12953
  raycast( /* raycaster, intersects */ ) {}
12953
12954
 
12954
12955
  /**
12955
- * Abstract method to test whether this 3D object intersects the given frustum.
12956
- * Renderable 3D objects such as {@link Mesh}, {@link Line} or {@link Points}
12957
- * implement this method in order to use frustum culling.
12956
+ * Returns `true` if this 3D object intersects the given frustum. Renderable 3D objects
12957
+ * such as {@link Mesh}, {@link Line} or {@link Points} override this method in order
12958
+ * to use frustum culling. The default implementation always returns `true`.
12958
12959
  *
12959
- * @abstract
12960
12960
  * @param {Frustum|FrustumArray} frustum - The frustum to test.
12961
- * @return {boolean|undefined} Whether this 3D object intersects the given frustum or not.
12961
+ * @return {boolean} Whether this 3D object intersects the given frustum or not.
12962
12962
  */
12963
- intersectsFrustum( /* frustum */ ) {}
12963
+ intersectsFrustum( /* frustum */ ) {
12964
+
12965
+ return true;
12966
+
12967
+ }
12964
12968
 
12965
12969
  /**
12966
12970
  * Executes the callback on this 3D object and all descendants.
@@ -13882,7 +13886,7 @@ class WebXRController {
13882
13886
  if ( jointPose !== null ) {
13883
13887
 
13884
13888
  joint.matrix.fromArray( jointPose.transform.matrix );
13885
- joint.matrix.decompose( joint.position, joint.rotation, joint.scale );
13889
+ joint.matrix.decompose( joint.position, joint.quaternion, joint.scale );
13886
13890
  joint.matrixWorldNeedsUpdate = true;
13887
13891
  joint.jointRadius = jointPose.radius;
13888
13892
 
@@ -13931,7 +13935,7 @@ class WebXRController {
13931
13935
  if ( gripPose !== null ) {
13932
13936
 
13933
13937
  grip.matrix.fromArray( gripPose.transform.matrix );
13934
- grip.matrix.decompose( grip.position, grip.rotation, grip.scale );
13938
+ grip.matrix.decompose( grip.position, grip.quaternion, grip.scale );
13935
13939
  grip.matrixWorldNeedsUpdate = true;
13936
13940
 
13937
13941
  if ( gripPose.linearVelocity ) {
@@ -13987,7 +13991,7 @@ class WebXRController {
13987
13991
  if ( inputPose !== null ) {
13988
13992
 
13989
13993
  targetRay.matrix.fromArray( inputPose.transform.matrix );
13990
- targetRay.matrix.decompose( targetRay.position, targetRay.rotation, targetRay.scale );
13994
+ targetRay.matrix.decompose( targetRay.position, targetRay.quaternion, targetRay.scale );
13991
13995
  targetRay.matrixWorldNeedsUpdate = true;
13992
13996
 
13993
13997
  if ( inputPose.linearVelocity ) {
@@ -14380,7 +14384,7 @@ class Color {
14380
14384
  case 'rgb':
14381
14385
  case 'rgba':
14382
14386
 
14383
- if ( color = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {
14387
+ if ( color = /^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d+(?:\.\d+)?|\.\d+)\s*)?$/.exec( components ) ) {
14384
14388
 
14385
14389
  // rgb(255,0,0) rgba(255,0,0,0.5)
14386
14390
 
@@ -14395,16 +14399,16 @@ class Color {
14395
14399
 
14396
14400
  }
14397
14401
 
14398
- if ( color = /^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {
14402
+ if ( color = /^\s*(\d+(?:\.\d+)?|\.\d+)\%\s*,\s*(\d+(?:\.\d+)?|\.\d+)\%\s*,\s*(\d+(?:\.\d+)?|\.\d+)\%\s*(?:,\s*(\d+(?:\.\d+)?|\.\d+)\s*)?$/.exec( components ) ) {
14399
14403
 
14400
- // rgb(100%,0%,0%) rgba(100%,0%,0%,0.5)
14404
+ // rgb(100%,0%,0%) rgba(100%,0%,0%,0.5) rgb(50.5%,0%,0%)
14401
14405
 
14402
14406
  handleAlpha( color[ 4 ] );
14403
14407
 
14404
14408
  return this.setRGB(
14405
- Math.min( 100, parseInt( color[ 1 ], 10 ) ) / 100,
14406
- Math.min( 100, parseInt( color[ 2 ], 10 ) ) / 100,
14407
- Math.min( 100, parseInt( color[ 3 ], 10 ) ) / 100,
14409
+ Math.min( 100, parseFloat( color[ 1 ] ) ) / 100,
14410
+ Math.min( 100, parseFloat( color[ 2 ] ) ) / 100,
14411
+ Math.min( 100, parseFloat( color[ 3 ] ) ) / 100,
14408
14412
  colorSpace
14409
14413
  );
14410
14414
 
@@ -14415,9 +14419,9 @@ class Color {
14415
14419
  case 'hsl':
14416
14420
  case 'hsla':
14417
14421
 
14418
- if ( color = /^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec( components ) ) {
14422
+ if ( color = /^\s*([+-]?(?:\d+(?:\.\d+)?|\.\d+))\s*,\s*(\d+(?:\.\d+)?|\.\d+)\%\s*,\s*(\d+(?:\.\d+)?|\.\d+)\%\s*(?:,\s*(\d+(?:\.\d+)?|\.\d+)\s*)?$/.exec( components ) ) {
14419
14423
 
14420
- // hsl(120,50%,50%) hsla(120,50%,50%,0.5)
14424
+ // hsl(120,50%,50%) hsla(120,50%,50%,0.5) hsl(-120,50%,50%)
14421
14425
 
14422
14426
  handleAlpha( color[ 4 ] );
14423
14427
 
@@ -15332,9 +15336,9 @@ class Scene extends Object3D {
15332
15336
 
15333
15337
  super.copy( source, recursive );
15334
15338
 
15335
- if ( source.background !== null ) this.background = source.background.clone();
15336
- if ( source.environment !== null ) this.environment = source.environment.clone();
15337
- if ( source.fog !== null ) this.fog = source.fog.clone();
15339
+ this.background = source.background !== null ? source.background.clone() : null;
15340
+ this.environment = source.environment !== null ? source.environment.clone() : null;
15341
+ this.fog = source.fog !== null ? source.fog.clone() : null;
15338
15342
 
15339
15343
  this.backgroundBlurriness = source.backgroundBlurriness;
15340
15344
  this.backgroundIntensity = source.backgroundIntensity;
@@ -15343,7 +15347,7 @@ class Scene extends Object3D {
15343
15347
  this.environmentIntensity = source.environmentIntensity;
15344
15348
  this.environmentRotation.copy( source.environmentRotation );
15345
15349
 
15346
- if ( source.overrideMaterial !== null ) this.overrideMaterial = source.overrideMaterial.clone();
15350
+ this.overrideMaterial = source.overrideMaterial !== null ? source.overrideMaterial.clone() : null;
15347
15351
 
15348
15352
  this.matrixAutoUpdate = source.matrixAutoUpdate;
15349
15353
 
@@ -15842,7 +15846,8 @@ class Triangle {
15842
15846
  }
15843
15847
 
15844
15848
  const vc = d1 * d4 - d3 * d2;
15845
- if ( vc <= 0 && d1 >= 0 && d3 <= 0 ) {
15849
+
15850
+ if ( vc <= 0 && d1 >= 0 && d3 <= 0 && d1 - d3 > 0 ) { // modification of the algorithm: d1 - d3 is the squared length of AB, so skip this region if a and b coincide
15846
15851
 
15847
15852
  v = d1 / ( d1 - d3 );
15848
15853
  // edge region of AB; barycentric coords (1-v, v, 0)
@@ -16217,9 +16222,9 @@ class Box3 {
16217
16222
  const positionAttribute = geometry.getAttribute( 'position' );
16218
16223
 
16219
16224
  // precise AABB computation based on vertex data requires at least a position attribute.
16220
- // instancing isn't supported so far and uses the normal (conservative) code path.
16225
+ // instancing and batching aren't supported so far and use the normal (conservative) code path.
16221
16226
 
16222
- if ( precise === true && positionAttribute !== undefined && object.isInstancedMesh !== true ) {
16227
+ if ( precise === true && positionAttribute !== undefined && object.isInstancedMesh !== true && object.isBatchedMesh !== true ) {
16223
16228
 
16224
16229
  for ( let i = 0, l = positionAttribute.count; i < l; i ++ ) {
16225
16230
 
@@ -17050,6 +17055,14 @@ class BufferAttribute extends EventDispatcher {
17050
17055
  */
17051
17056
  this.version = 0;
17052
17057
 
17058
+ /**
17059
+ * Cached normalization factor, see {@link MathUtils#getNormalizationScale}.
17060
+ *
17061
+ * @private
17062
+ * @type {number|undefined}
17063
+ */
17064
+ this._normalizationScale = array !== undefined ? getNormalizationScale( array ) : undefined;
17065
+
17053
17066
  }
17054
17067
 
17055
17068
  /**
@@ -17124,6 +17137,8 @@ class BufferAttribute extends EventDispatcher {
17124
17137
  this.usage = source.usage;
17125
17138
  this.gpuType = source.gpuType;
17126
17139
 
17140
+ this._normalizationScale = source._normalizationScale;
17141
+
17127
17142
  return this;
17128
17143
 
17129
17144
  }
@@ -17300,7 +17315,7 @@ class BufferAttribute extends EventDispatcher {
17300
17315
 
17301
17316
  let value = this.array[ index * this.itemSize + component ];
17302
17317
 
17303
- if ( this.normalized ) value = denormalize( value, this.array );
17318
+ if ( this.normalized ) value = this._denormalize( value );
17304
17319
 
17305
17320
  return value;
17306
17321
 
@@ -17316,7 +17331,7 @@ class BufferAttribute extends EventDispatcher {
17316
17331
  */
17317
17332
  setComponent( index, component, value ) {
17318
17333
 
17319
- if ( this.normalized ) value = normalize( value, this.array );
17334
+ if ( this.normalized ) value = this._normalize( value );
17320
17335
 
17321
17336
  this.array[ index * this.itemSize + component ] = value;
17322
17337
 
@@ -17334,7 +17349,7 @@ class BufferAttribute extends EventDispatcher {
17334
17349
 
17335
17350
  let x = this.array[ index * this.itemSize ];
17336
17351
 
17337
- if ( this.normalized ) x = denormalize( x, this.array );
17352
+ if ( this.normalized ) x = this._denormalize( x );
17338
17353
 
17339
17354
  return x;
17340
17355
 
@@ -17349,7 +17364,7 @@ class BufferAttribute extends EventDispatcher {
17349
17364
  */
17350
17365
  setX( index, x ) {
17351
17366
 
17352
- if ( this.normalized ) x = normalize( x, this.array );
17367
+ if ( this.normalized ) x = this._normalize( x );
17353
17368
 
17354
17369
  this.array[ index * this.itemSize ] = x;
17355
17370
 
@@ -17367,7 +17382,7 @@ class BufferAttribute extends EventDispatcher {
17367
17382
 
17368
17383
  let y = this.array[ index * this.itemSize + 1 ];
17369
17384
 
17370
- if ( this.normalized ) y = denormalize( y, this.array );
17385
+ if ( this.normalized ) y = this._denormalize( y );
17371
17386
 
17372
17387
  return y;
17373
17388
 
@@ -17382,7 +17397,7 @@ class BufferAttribute extends EventDispatcher {
17382
17397
  */
17383
17398
  setY( index, y ) {
17384
17399
 
17385
- if ( this.normalized ) y = normalize( y, this.array );
17400
+ if ( this.normalized ) y = this._normalize( y );
17386
17401
 
17387
17402
  this.array[ index * this.itemSize + 1 ] = y;
17388
17403
 
@@ -17400,7 +17415,7 @@ class BufferAttribute extends EventDispatcher {
17400
17415
 
17401
17416
  let z = this.array[ index * this.itemSize + 2 ];
17402
17417
 
17403
- if ( this.normalized ) z = denormalize( z, this.array );
17418
+ if ( this.normalized ) z = this._denormalize( z );
17404
17419
 
17405
17420
  return z;
17406
17421
 
@@ -17415,7 +17430,7 @@ class BufferAttribute extends EventDispatcher {
17415
17430
  */
17416
17431
  setZ( index, z ) {
17417
17432
 
17418
- if ( this.normalized ) z = normalize( z, this.array );
17433
+ if ( this.normalized ) z = this._normalize( z );
17419
17434
 
17420
17435
  this.array[ index * this.itemSize + 2 ] = z;
17421
17436
 
@@ -17433,7 +17448,7 @@ class BufferAttribute extends EventDispatcher {
17433
17448
 
17434
17449
  let w = this.array[ index * this.itemSize + 3 ];
17435
17450
 
17436
- if ( this.normalized ) w = denormalize( w, this.array );
17451
+ if ( this.normalized ) w = this._denormalize( w );
17437
17452
 
17438
17453
  return w;
17439
17454
 
@@ -17448,7 +17463,7 @@ class BufferAttribute extends EventDispatcher {
17448
17463
  */
17449
17464
  setW( index, w ) {
17450
17465
 
17451
- if ( this.normalized ) w = normalize( w, this.array );
17466
+ if ( this.normalized ) w = this._normalize( w );
17452
17467
 
17453
17468
  this.array[ index * this.itemSize + 3 ] = w;
17454
17469
 
@@ -17470,8 +17485,8 @@ class BufferAttribute extends EventDispatcher {
17470
17485
 
17471
17486
  if ( this.normalized ) {
17472
17487
 
17473
- x = normalize( x, this.array );
17474
- y = normalize( y, this.array );
17488
+ x = this._normalize( x );
17489
+ y = this._normalize( y );
17475
17490
 
17476
17491
  }
17477
17492
 
@@ -17497,9 +17512,9 @@ class BufferAttribute extends EventDispatcher {
17497
17512
 
17498
17513
  if ( this.normalized ) {
17499
17514
 
17500
- x = normalize( x, this.array );
17501
- y = normalize( y, this.array );
17502
- z = normalize( z, this.array );
17515
+ x = this._normalize( x );
17516
+ y = this._normalize( y );
17517
+ z = this._normalize( z );
17503
17518
 
17504
17519
  }
17505
17520
 
@@ -17527,10 +17542,10 @@ class BufferAttribute extends EventDispatcher {
17527
17542
 
17528
17543
  if ( this.normalized ) {
17529
17544
 
17530
- x = normalize( x, this.array );
17531
- y = normalize( y, this.array );
17532
- z = normalize( z, this.array );
17533
- w = normalize( w, this.array );
17545
+ x = this._normalize( x );
17546
+ y = this._normalize( y );
17547
+ z = this._normalize( z );
17548
+ w = this._normalize( w );
17534
17549
 
17535
17550
  }
17536
17551
 
@@ -17593,7 +17608,7 @@ class BufferAttribute extends EventDispatcher {
17593
17608
  }
17594
17609
 
17595
17610
  /**
17596
- * Disposes of the buffer attribute. Available only in {@link WebGPURenderer}.
17611
+ * Frees the GPU-related resources allocated by this instance. Available only in {@link WebGPURenderer}.
17597
17612
  */
17598
17613
  dispose() {
17599
17614
 
@@ -17601,6 +17616,32 @@ class BufferAttribute extends EventDispatcher {
17601
17616
 
17602
17617
  }
17603
17618
 
17619
+ /**
17620
+ * Denormalizes the value using cached normalization factor.
17621
+ *
17622
+ * @private
17623
+ */
17624
+ _denormalize( value ) {
17625
+
17626
+ const scale = this._normalizationScale;
17627
+
17628
+ return scale !== undefined ? Math.max( value / scale, -1 ) : denormalize( value, this.array );
17629
+
17630
+ }
17631
+
17632
+ /**
17633
+ * Normalizes the value using cached normalization factor.
17634
+ *
17635
+ * @private
17636
+ */
17637
+ _normalize( value ) {
17638
+
17639
+ const scale = this._normalizationScale;
17640
+
17641
+ return scale !== undefined ? Math.round( value * scale ) : normalize( value, this.array );
17642
+
17643
+ }
17644
+
17604
17645
  }
17605
17646
 
17606
17647
  /**
@@ -19227,6 +19268,7 @@ class BufferGeometry extends EventDispatcher {
19227
19268
  }
19228
19269
 
19229
19270
  const tan1 = [], tan2 = [];
19271
+ const used = new Uint8Array( positionAttribute.count );
19230
19272
 
19231
19273
  for ( let i = 0; i < positionAttribute.count; i ++ ) {
19232
19274
 
@@ -19248,6 +19290,8 @@ class BufferGeometry extends EventDispatcher {
19248
19290
 
19249
19291
  function handleTriangle( a, b, c ) {
19250
19292
 
19293
+ used[ a ] = used[ b ] = used[ c ] = 1;
19294
+
19251
19295
  vA.fromBufferAttribute( positionAttribute, a );
19252
19296
  vB.fromBufferAttribute( positionAttribute, b );
19253
19297
  vC.fromBufferAttribute( positionAttribute, c );
@@ -19336,20 +19380,9 @@ class BufferGeometry extends EventDispatcher {
19336
19380
 
19337
19381
  }
19338
19382
 
19339
- for ( let i = 0, il = groups.length; i < il; ++ i ) {
19340
-
19341
- const group = groups[ i ];
19383
+ for ( let i = 0, il = positionAttribute.count; i < il; ++ i ) {
19342
19384
 
19343
- const start = group.start;
19344
- const count = group.count;
19345
-
19346
- for ( let j = start, jl = start + count; j < jl; j += 3 ) {
19347
-
19348
- handleVertex( index.getX( j + 0 ) );
19349
- handleVertex( index.getX( j + 1 ) );
19350
- handleVertex( index.getX( j + 2 ) );
19351
-
19352
- }
19385
+ if ( used[ i ] ) handleVertex( i );
19353
19386
 
19354
19387
  }
19355
19388
 
@@ -20047,19 +20080,15 @@ class InterleavedBuffer {
20047
20080
 
20048
20081
  }
20049
20082
 
20050
- if ( this.array.buffer._uuid === undefined ) {
20083
+ const key = getArrayKey( this.array );
20051
20084
 
20052
- this.array.buffer._uuid = generateUUID();
20085
+ if ( data.arrayBuffers[ key ] === undefined ) {
20053
20086
 
20054
- }
20055
-
20056
- if ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {
20057
-
20058
- data.arrayBuffers[ this.array.buffer._uuid ] = this.array.slice( 0 ).buffer;
20087
+ data.arrayBuffers[ key ] = this.array.slice( 0 ).buffer;
20059
20088
 
20060
20089
  }
20061
20090
 
20062
- const array = new this.array.constructor( data.arrayBuffers[ this.array.buffer._uuid ] );
20091
+ const array = new this.array.constructor( data.arrayBuffers[ key ] );
20063
20092
 
20064
20093
  const ib = new this.constructor( array, this.stride );
20065
20094
  ib.setUsage( this.usage );
@@ -20098,17 +20127,11 @@ class InterleavedBuffer {
20098
20127
 
20099
20128
  }
20100
20129
 
20101
- // generate UUID for array buffer if necessary
20130
+ const key = getArrayKey( this.array );
20102
20131
 
20103
- if ( this.array.buffer._uuid === undefined ) {
20132
+ if ( data.arrayBuffers[ key ] === undefined ) {
20104
20133
 
20105
- this.array.buffer._uuid = generateUUID();
20106
-
20107
- }
20108
-
20109
- if ( data.arrayBuffers[ this.array.buffer._uuid ] === undefined ) {
20110
-
20111
- data.arrayBuffers[ this.array.buffer._uuid ] = Array.from( new Uint32Array( this.array.buffer ) );
20134
+ data.arrayBuffers[ key ] = Array.from( new Uint32Array( this.array.slice( 0 ).buffer ) );
20112
20135
 
20113
20136
  }
20114
20137
 
@@ -20116,7 +20139,7 @@ class InterleavedBuffer {
20116
20139
 
20117
20140
  const json = {
20118
20141
  uuid: this.uuid,
20119
- buffer: this.array.buffer._uuid,
20142
+ buffer: key,
20120
20143
  type: this.array.constructor.name,
20121
20144
  stride: this.stride
20122
20145
  };
@@ -20129,6 +20152,26 @@ class InterleavedBuffer {
20129
20152
 
20130
20153
  }
20131
20154
 
20155
+ // Returns the key under which the data of the given typed array is shared when cloning or serializing.
20156
+ // Interleaved buffers can be views at different offsets into the same array buffer (e.g. the interleaved
20157
+ // accessors of a glTF buffer view), so only views over the same range share their data.
20158
+
20159
+ function getArrayKey( array ) {
20160
+
20161
+ // generate UUID for array buffer if necessary
20162
+
20163
+ if ( array.buffer._uuid === undefined ) {
20164
+
20165
+ array.buffer._uuid = generateUUID();
20166
+
20167
+ }
20168
+
20169
+ if ( array.byteOffset === 0 && array.byteLength === array.buffer.byteLength ) return array.buffer._uuid;
20170
+
20171
+ return array.buffer._uuid + ':' + array.byteOffset + ':' + array.byteLength;
20172
+
20173
+ }
20174
+
20132
20175
  const _vector$8 = /*@__PURE__*/ new Vector3();
20133
20176
 
20134
20177
  /**
@@ -20192,6 +20235,14 @@ class InterleavedBufferAttribute {
20192
20235
  */
20193
20236
  this.normalized = normalized;
20194
20237
 
20238
+ /**
20239
+ * Cached normalization factor, see {@link MathUtils#getNormalizationScale}.
20240
+ *
20241
+ * @private
20242
+ * @type {number|undefined}
20243
+ */
20244
+ this._normalizationScale = interleavedBuffer !== undefined ? getNormalizationScale( interleavedBuffer.array ) : undefined;
20245
+
20195
20246
  }
20196
20247
 
20197
20248
  /**
@@ -20311,7 +20362,7 @@ class InterleavedBufferAttribute {
20311
20362
 
20312
20363
  let value = this.array[ index * this.data.stride + this.offset + component ];
20313
20364
 
20314
- if ( this.normalized ) value = denormalize( value, this.array );
20365
+ if ( this.normalized ) value = this._denormalize( value );
20315
20366
 
20316
20367
  return value;
20317
20368
 
@@ -20327,7 +20378,7 @@ class InterleavedBufferAttribute {
20327
20378
  */
20328
20379
  setComponent( index, component, value ) {
20329
20380
 
20330
- if ( this.normalized ) value = normalize( value, this.array );
20381
+ if ( this.normalized ) value = this._normalize( value );
20331
20382
 
20332
20383
  this.data.array[ index * this.data.stride + this.offset + component ] = value;
20333
20384
 
@@ -20344,7 +20395,7 @@ class InterleavedBufferAttribute {
20344
20395
  */
20345
20396
  setX( index, x ) {
20346
20397
 
20347
- if ( this.normalized ) x = normalize( x, this.array );
20398
+ if ( this.normalized ) x = this._normalize( x );
20348
20399
 
20349
20400
  this.data.array[ index * this.data.stride + this.offset ] = x;
20350
20401
 
@@ -20361,7 +20412,7 @@ class InterleavedBufferAttribute {
20361
20412
  */
20362
20413
  setY( index, y ) {
20363
20414
 
20364
- if ( this.normalized ) y = normalize( y, this.array );
20415
+ if ( this.normalized ) y = this._normalize( y );
20365
20416
 
20366
20417
  this.data.array[ index * this.data.stride + this.offset + 1 ] = y;
20367
20418
 
@@ -20378,7 +20429,7 @@ class InterleavedBufferAttribute {
20378
20429
  */
20379
20430
  setZ( index, z ) {
20380
20431
 
20381
- if ( this.normalized ) z = normalize( z, this.array );
20432
+ if ( this.normalized ) z = this._normalize( z );
20382
20433
 
20383
20434
  this.data.array[ index * this.data.stride + this.offset + 2 ] = z;
20384
20435
 
@@ -20395,7 +20446,7 @@ class InterleavedBufferAttribute {
20395
20446
  */
20396
20447
  setW( index, w ) {
20397
20448
 
20398
- if ( this.normalized ) w = normalize( w, this.array );
20449
+ if ( this.normalized ) w = this._normalize( w );
20399
20450
 
20400
20451
  this.data.array[ index * this.data.stride + this.offset + 3 ] = w;
20401
20452
 
@@ -20413,7 +20464,7 @@ class InterleavedBufferAttribute {
20413
20464
 
20414
20465
  let x = this.data.array[ index * this.data.stride + this.offset ];
20415
20466
 
20416
- if ( this.normalized ) x = denormalize( x, this.array );
20467
+ if ( this.normalized ) x = this._denormalize( x );
20417
20468
 
20418
20469
  return x;
20419
20470
 
@@ -20429,7 +20480,7 @@ class InterleavedBufferAttribute {
20429
20480
 
20430
20481
  let y = this.data.array[ index * this.data.stride + this.offset + 1 ];
20431
20482
 
20432
- if ( this.normalized ) y = denormalize( y, this.array );
20483
+ if ( this.normalized ) y = this._denormalize( y );
20433
20484
 
20434
20485
  return y;
20435
20486
 
@@ -20445,7 +20496,7 @@ class InterleavedBufferAttribute {
20445
20496
 
20446
20497
  let z = this.data.array[ index * this.data.stride + this.offset + 2 ];
20447
20498
 
20448
- if ( this.normalized ) z = denormalize( z, this.array );
20499
+ if ( this.normalized ) z = this._denormalize( z );
20449
20500
 
20450
20501
  return z;
20451
20502
 
@@ -20461,7 +20512,7 @@ class InterleavedBufferAttribute {
20461
20512
 
20462
20513
  let w = this.data.array[ index * this.data.stride + this.offset + 3 ];
20463
20514
 
20464
- if ( this.normalized ) w = denormalize( w, this.array );
20515
+ if ( this.normalized ) w = this._denormalize( w );
20465
20516
 
20466
20517
  return w;
20467
20518
 
@@ -20481,8 +20532,8 @@ class InterleavedBufferAttribute {
20481
20532
 
20482
20533
  if ( this.normalized ) {
20483
20534
 
20484
- x = normalize( x, this.array );
20485
- y = normalize( y, this.array );
20535
+ x = this._normalize( x );
20536
+ y = this._normalize( y );
20486
20537
 
20487
20538
  }
20488
20539
 
@@ -20508,9 +20559,9 @@ class InterleavedBufferAttribute {
20508
20559
 
20509
20560
  if ( this.normalized ) {
20510
20561
 
20511
- x = normalize( x, this.array );
20512
- y = normalize( y, this.array );
20513
- z = normalize( z, this.array );
20562
+ x = this._normalize( x );
20563
+ y = this._normalize( y );
20564
+ z = this._normalize( z );
20514
20565
 
20515
20566
  }
20516
20567
 
@@ -20538,10 +20589,10 @@ class InterleavedBufferAttribute {
20538
20589
 
20539
20590
  if ( this.normalized ) {
20540
20591
 
20541
- x = normalize( x, this.array );
20542
- y = normalize( y, this.array );
20543
- z = normalize( z, this.array );
20544
- w = normalize( w, this.array );
20592
+ x = this._normalize( x );
20593
+ y = this._normalize( y );
20594
+ z = this._normalize( z );
20595
+ w = this._normalize( w );
20545
20596
 
20546
20597
  }
20547
20598
 
@@ -20669,6 +20720,32 @@ class InterleavedBufferAttribute {
20669
20720
 
20670
20721
  }
20671
20722
 
20723
+ /**
20724
+ * Denormalizes the value using cached normalization factor.
20725
+ *
20726
+ * @private
20727
+ */
20728
+ _denormalize( value ) {
20729
+
20730
+ const scale = this._normalizationScale;
20731
+
20732
+ return scale !== undefined ? Math.max( value / scale, -1 ) : denormalize( value, this.data.array );
20733
+
20734
+ }
20735
+
20736
+ /**
20737
+ * Normalizes the value using cached normalization factor.
20738
+ *
20739
+ * @private
20740
+ */
20741
+ _normalize( value ) {
20742
+
20743
+ const scale = this._normalizationScale;
20744
+
20745
+ return scale !== undefined ? Math.round( value * scale ) : normalize( value, this.data.array );
20746
+
20747
+ }
20748
+
20672
20749
  }
20673
20750
 
20674
20751
  const _vector1 = /*@__PURE__*/ new Vector3();
@@ -21760,6 +21837,13 @@ class Material extends EventDispatcher {
21760
21837
  if ( this.shininess !== undefined ) data.shininess = this.shininess;
21761
21838
  if ( this.clearcoat !== undefined ) data.clearcoat = this.clearcoat;
21762
21839
  if ( this.clearcoatRoughness !== undefined ) data.clearcoatRoughness = this.clearcoatRoughness;
21840
+ if ( this.diffuseRoughness !== undefined ) data.diffuseRoughness = this.diffuseRoughness;
21841
+
21842
+ if ( this.diffuseRoughnessMap && this.diffuseRoughnessMap.isTexture ) {
21843
+
21844
+ data.diffuseRoughnessMap = this.diffuseRoughnessMap.toJSON( meta ).uuid;
21845
+
21846
+ }
21763
21847
 
21764
21848
  if ( this.clearcoatMap && this.clearcoatMap.isTexture ) {
21765
21849
 
@@ -21797,7 +21881,8 @@ class Material extends EventDispatcher {
21797
21881
 
21798
21882
  if ( this.iridescence !== undefined ) data.iridescence = this.iridescence;
21799
21883
  if ( this.iridescenceIOR !== undefined ) data.iridescenceIOR = this.iridescenceIOR;
21800
- if ( this.iridescenceThicknessRange !== undefined ) data.iridescenceThicknessRange = this.iridescenceThicknessRange;
21884
+ if ( this.iridescenceThicknessMinimum !== undefined ) data.iridescenceThicknessMinimum = this.iridescenceThicknessMinimum;
21885
+ if ( this.iridescenceThicknessMaximum !== undefined ) data.iridescenceThicknessMaximum = this.iridescenceThicknessMaximum;
21801
21886
 
21802
21887
  if ( this.iridescenceMap && this.iridescenceMap.isTexture ) {
21803
21888
 
@@ -21984,11 +22069,21 @@ class Material extends EventDispatcher {
21984
22069
  if ( json.shininess !== undefined ) this.shininess = json.shininess;
21985
22070
  if ( json.clearcoat !== undefined ) this.clearcoat = json.clearcoat;
21986
22071
  if ( json.clearcoatRoughness !== undefined ) this.clearcoatRoughness = json.clearcoatRoughness;
22072
+ if ( json.diffuseRoughness !== undefined ) this.diffuseRoughness = json.diffuseRoughness;
21987
22073
  if ( json.dispersion !== undefined ) this.dispersion = json.dispersion;
21988
22074
  if ( json.retroreflectivity !== undefined ) this.retroreflectivity = json.retroreflectivity;
21989
22075
  if ( json.iridescence !== undefined ) this.iridescence = json.iridescence;
21990
22076
  if ( json.iridescenceIOR !== undefined ) this.iridescenceIOR = json.iridescenceIOR;
21991
- if ( json.iridescenceThicknessRange !== undefined ) this.iridescenceThicknessRange = json.iridescenceThicknessRange;
22077
+ if ( json.iridescenceThicknessMinimum !== undefined ) this.iridescenceThicknessMinimum = json.iridescenceThicknessMinimum;
22078
+ if ( json.iridescenceThicknessMaximum !== undefined ) this.iridescenceThicknessMaximum = json.iridescenceThicknessMaximum;
22079
+
22080
+ if ( json.iridescenceThicknessRange !== undefined ) { // @deprecated r187
22081
+
22082
+ this.iridescenceThicknessMinimum = json.iridescenceThicknessRange[ 0 ];
22083
+ this.iridescenceThicknessMaximum = json.iridescenceThicknessRange[ 1 ];
22084
+
22085
+ }
22086
+
21992
22087
  if ( json.transmission !== undefined ) this.transmission = json.transmission;
21993
22088
  if ( json.thickness !== undefined ) this.thickness = json.thickness;
21994
22089
  if ( json.attenuationDistance !== undefined ) this.attenuationDistance = json.attenuationDistance;
@@ -22141,6 +22236,7 @@ class Material extends EventDispatcher {
22141
22236
  if ( json.clearcoatRoughnessMap !== undefined ) this.clearcoatRoughnessMap = textures[ json.clearcoatRoughnessMap ] || null;
22142
22237
  if ( json.clearcoatNormalMap !== undefined ) this.clearcoatNormalMap = textures[ json.clearcoatNormalMap ] || null;
22143
22238
  if ( json.clearcoatNormalScale !== undefined ) this.clearcoatNormalScale = new Vector2().fromArray( json.clearcoatNormalScale );
22239
+ if ( json.diffuseRoughnessMap !== undefined ) this.diffuseRoughnessMap = textures[ json.diffuseRoughnessMap ] || null;
22144
22240
 
22145
22241
  if ( json.iridescenceMap !== undefined ) this.iridescenceMap = textures[ json.iridescenceMap ] || null;
22146
22242
  if ( json.iridescenceThicknessMap !== undefined ) this.iridescenceThicknessMap = textures[ json.iridescenceThicknessMap ] || null;
@@ -22645,6 +22741,16 @@ class Sprite extends Object3D {
22645
22741
 
22646
22742
  }
22647
22743
 
22744
+ toJSON( meta ) {
22745
+
22746
+ const data = super.toJSON( meta );
22747
+
22748
+ data.object.center = this.center.toArray();
22749
+
22750
+ return data;
22751
+
22752
+ }
22753
+
22648
22754
  }
22649
22755
 
22650
22756
  function transformVertex( vertexPosition, mvPosition, center, scale, sin, cos ) {
@@ -24074,12 +24180,20 @@ class Mesh extends Object3D {
24074
24180
 
24075
24181
  this.morphTargetInfluences = source.morphTargetInfluences.slice();
24076
24182
 
24183
+ } else {
24184
+
24185
+ this.morphTargetInfluences = undefined;
24186
+
24077
24187
  }
24078
24188
 
24079
24189
  if ( source.morphTargetDictionary !== undefined ) {
24080
24190
 
24081
24191
  this.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary );
24082
24192
 
24193
+ } else {
24194
+
24195
+ this.morphTargetDictionary = undefined;
24196
+
24083
24197
  }
24084
24198
 
24085
24199
  this.material = Array.isArray( source.material ) ? source.material.slice() : source.material;
@@ -24624,8 +24738,8 @@ class SkinnedMesh extends Mesh {
24624
24738
 
24625
24739
  this.skeleton = source.skeleton;
24626
24740
 
24627
- if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
24628
- if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
24741
+ this.boundingBox = source.boundingBox !== null ? source.boundingBox.clone() : null;
24742
+ this.boundingSphere = source.boundingSphere !== null ? source.boundingSphere.clone() : null;
24629
24743
 
24630
24744
  return this;
24631
24745
 
@@ -24787,7 +24901,7 @@ class SkinnedMesh extends Mesh {
24787
24901
 
24788
24902
  } else {
24789
24903
 
24790
- _baseVector.set( ...target, 1 );
24904
+ _baseVector.set( target.x, target.y, target.z, 1 );
24791
24905
  target.set( 0, 0, 0 );
24792
24906
 
24793
24907
  }
@@ -25006,6 +25120,15 @@ class Skeleton {
25006
25120
  */
25007
25121
  this.boneMatrices = null;
25008
25122
 
25123
+ /**
25124
+ * An array buffer holding the bone data of the previous frame.
25125
+ * Required for computing velocity.
25126
+ *
25127
+ * @type {?Float32Array}
25128
+ * @default null
25129
+ */
25130
+ this.previousBoneMatrices = null;
25131
+
25009
25132
  /**
25010
25133
  * A texture holding the bone data for use
25011
25134
  * in the vertex shader.
@@ -25015,6 +25138,15 @@ class Skeleton {
25015
25138
  */
25016
25139
  this.boneTexture = null;
25017
25140
 
25141
+ /**
25142
+ * A texture holding the bone data of the previous frame.
25143
+ * Required for computing velocity.
25144
+ *
25145
+ * @type {?DataTexture}
25146
+ * @default null
25147
+ */
25148
+ this.previousBoneTexture = null;
25149
+
25018
25150
  this.init();
25019
25151
 
25020
25152
  }
@@ -25241,6 +25373,14 @@ class Skeleton {
25241
25373
 
25242
25374
  }
25243
25375
 
25376
+ if ( this.previousBoneTexture !== null ) {
25377
+
25378
+ this.previousBoneTexture.dispose();
25379
+
25380
+ this.previousBoneTexture = null;
25381
+
25382
+ }
25383
+
25244
25384
  }
25245
25385
 
25246
25386
  /**
@@ -25560,13 +25700,13 @@ class InstancedMesh extends Mesh {
25560
25700
 
25561
25701
  this.instanceMatrix.copy( source.instanceMatrix );
25562
25702
 
25563
- if ( source.morphTexture !== null ) this.morphTexture = source.morphTexture.clone();
25564
- if ( source.instanceColor !== null ) this.instanceColor = source.instanceColor.clone();
25703
+ this.morphTexture = source.morphTexture !== null ? source.morphTexture.clone() : null;
25704
+ this.instanceColor = source.instanceColor !== null ? source.instanceColor.clone() : null;
25565
25705
 
25566
25706
  this.count = source.count;
25567
25707
 
25568
- if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
25569
- if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
25708
+ this.boundingBox = source.boundingBox !== null ? source.boundingBox.clone() : null;
25709
+ this.boundingSphere = source.boundingSphere !== null ? source.boundingSphere.clone() : null;
25570
25710
 
25571
25711
  return this;
25572
25712
 
@@ -25772,6 +25912,14 @@ class InstancedMesh extends Mesh {
25772
25912
 
25773
25913
  super.dispose();
25774
25914
 
25915
+ this.instanceMatrix.dispose();
25916
+
25917
+ if ( this.instanceColor !== null ) {
25918
+
25919
+ this.instanceColor.dispose();
25920
+
25921
+ }
25922
+
25775
25923
  if ( this.morphTexture !== null ) {
25776
25924
 
25777
25925
  this.morphTexture.dispose();
@@ -26142,6 +26290,18 @@ class FrustumArray {
26142
26290
 
26143
26291
  }
26144
26292
 
26293
+ /**
26294
+ * Returns the cached frustum for the sub-camera at the given index.
26295
+ *
26296
+ * @param {number} index - The sub-camera index.
26297
+ * @return {Frustum|undefined} The cached frustum.
26298
+ */
26299
+ getFrustum( index ) {
26300
+
26301
+ return this._frustums[ index ];
26302
+
26303
+ }
26304
+
26145
26305
  /**
26146
26306
  * Returns `true` if the 3D object's bounding sphere is intersecting any cached frustum.
26147
26307
  *
@@ -26364,6 +26524,7 @@ const _frustumArray = /*@__PURE__*/ new FrustumArray();
26364
26524
  const _box$1 = /*@__PURE__*/ new Box3();
26365
26525
  const _sphere$2 = /*@__PURE__*/ new Sphere();
26366
26526
  const _vector$5 = /*@__PURE__*/ new Vector3();
26527
+ const _cameraPosition = /*@__PURE__*/ new Vector3();
26367
26528
  const _forward$1 = /*@__PURE__*/ new Vector3();
26368
26529
  const _temp = /*@__PURE__*/ new Vector3();
26369
26530
  const _renderList = /*@__PURE__*/ new MultiDrawRenderList();
@@ -26457,6 +26618,10 @@ function copyArrayContents( src, target ) {
26457
26618
  * scene.add( batchedMesh );
26458
26619
  * ```
26459
26620
  *
26621
+ * The first geometry added defines the layout of the batch. All subsequent geometries must
26622
+ * match its index usage and provide its attributes with the same itemSize and normalized
26623
+ * values. Additional attributes are ignored.
26624
+ *
26460
26625
  * @augments Mesh
26461
26626
  */
26462
26627
  class BatchedMesh extends Mesh {
@@ -26554,11 +26719,20 @@ class BatchedMesh extends Mesh {
26554
26719
  this._multiDrawCount = 0;
26555
26720
  this._multiDrawBytesPerElement = 1;
26556
26721
 
26722
+ // buffers for instanced draws, consecutive draws with the same range are merged
26723
+ this._mergedDrawCounts = new Int32Array( maxInstanceCount );
26724
+ this._mergedDrawStarts = new Int32Array( maxInstanceCount );
26725
+ this._mergedDrawInstanceCounts = new Int32Array( maxInstanceCount );
26726
+ this._mergedDrawCount = 0;
26727
+
26557
26728
  // Local matrix per geometry by using data texture
26558
26729
  this._matricesTexture = null;
26559
26730
  this._indirectTexture = null;
26560
26731
  this._colorsTexture = null;
26561
26732
 
26733
+ // previous frame matrices for motion vectors, created by the renderer
26734
+ this._previousMatricesTexture = null;
26735
+
26562
26736
  this._initMatricesTexture();
26563
26737
  this._initIndirectTexture();
26564
26738
 
@@ -26717,7 +26891,7 @@ class BatchedMesh extends Mesh {
26717
26891
  const dstAttribute = batchGeometry.getAttribute( attributeName );
26718
26892
  if ( srcAttribute.itemSize !== dstAttribute.itemSize || srcAttribute.normalized !== dstAttribute.normalized ) {
26719
26893
 
26720
- throw new Error( 'THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.' );
26894
+ throw new Error( `THREE.BatchedMesh: Added geometry attribute "${ attributeName }" has an inconsistent itemSize or normalized value.` );
26721
26895
 
26722
26896
  }
26723
26897
 
@@ -26774,7 +26948,7 @@ class BatchedMesh extends Mesh {
26774
26948
  /**
26775
26949
  * Computes the bounding box, updating {@link BatchedMesh#boundingBox}.
26776
26950
  * Bounding boxes aren't computed by default. They need to be explicitly computed,
26777
- * otherwise they are `null`.
26951
+ * otherwise they are `null`. Must be recomputed when instances change.
26778
26952
  */
26779
26953
  computeBoundingBox() {
26780
26954
 
@@ -26803,8 +26977,8 @@ class BatchedMesh extends Mesh {
26803
26977
 
26804
26978
  /**
26805
26979
  * Computes the bounding sphere, updating {@link BatchedMesh#boundingSphere}.
26806
- * Bounding spheres aren't computed by default. They need to be explicitly computed,
26807
- * otherwise they are `null`.
26980
+ * The engine computes the bounding sphere once when it is needed. Must be
26981
+ * recomputed when instances change.
26808
26982
  */
26809
26983
  computeBoundingSphere() {
26810
26984
 
@@ -27506,7 +27680,7 @@ class BatchedMesh extends Mesh {
27506
27680
 
27507
27681
  /**
27508
27682
  * Get the range representing the subset of triangles related to the attached geometry,
27509
- * indicating the starting offset and count, or `null` if invalid.
27683
+ * indicating the starting offset and count, or throws an error if invalid.
27510
27684
  *
27511
27685
  * @param {number} geometryId - The id of the geometry to get the range of.
27512
27686
  * @param {Object} [target] - The target object that is used to store the method's result.
@@ -27571,6 +27745,17 @@ class BatchedMesh extends Mesh {
27571
27745
 
27572
27746
  this._multiDrawCounts = multiDrawCounts;
27573
27747
  this._multiDrawStarts = multiDrawStarts;
27748
+
27749
+ const mergedDrawCounts = new Int32Array( maxInstanceCount );
27750
+ const mergedDrawStarts = new Int32Array( maxInstanceCount );
27751
+ const mergedDrawInstanceCounts = new Int32Array( maxInstanceCount );
27752
+ copyArrayContents( this._mergedDrawCounts, mergedDrawCounts );
27753
+ copyArrayContents( this._mergedDrawStarts, mergedDrawStarts );
27754
+ copyArrayContents( this._mergedDrawInstanceCounts, mergedDrawInstanceCounts );
27755
+
27756
+ this._mergedDrawCounts = mergedDrawCounts;
27757
+ this._mergedDrawStarts = mergedDrawStarts;
27758
+ this._mergedDrawInstanceCounts = mergedDrawInstanceCounts;
27574
27759
  this._maxInstanceCount = maxInstanceCount;
27575
27760
 
27576
27761
  // update texture data for instance sampling
@@ -27594,6 +27779,13 @@ class BatchedMesh extends Mesh {
27594
27779
 
27595
27780
  }
27596
27781
 
27782
+ if ( this._previousMatricesTexture !== null ) {
27783
+
27784
+ this._previousMatricesTexture.dispose();
27785
+ this._previousMatricesTexture = null;
27786
+
27787
+ }
27788
+
27597
27789
  }
27598
27790
 
27599
27791
  /**
@@ -27611,7 +27803,7 @@ class BatchedMesh extends Mesh {
27611
27803
  const requiredVertexLength = Math.max( ...validRanges.map( range => range.vertexStart + range.reservedVertexCount ) );
27612
27804
  if ( requiredVertexLength > maxVertexCount ) {
27613
27805
 
27614
- throw new Error( `THREE.BatchedMesh: Geometry vertex values are being used outside the range ${ maxIndexCount }. Cannot shrink further.` );
27806
+ throw new Error( `THREE.BatchedMesh: Geometry vertex values are being used outside the range ${ maxVertexCount }. Cannot shrink further.` );
27615
27807
 
27616
27808
  }
27617
27809
 
@@ -27659,6 +27851,8 @@ class BatchedMesh extends Mesh {
27659
27851
 
27660
27852
  }
27661
27853
 
27854
+ this._visibilityChanged = true;
27855
+
27662
27856
  }
27663
27857
 
27664
27858
  raycast( raycaster, intersects ) {
@@ -27756,6 +27950,9 @@ class BatchedMesh extends Mesh {
27756
27950
  this._multiDrawCounts = source._multiDrawCounts.slice();
27757
27951
  this._multiDrawStarts = source._multiDrawStarts.slice();
27758
27952
  this._multiDrawBytesPerElement = source._multiDrawBytesPerElement;
27953
+ this._mergedDrawCounts = source._mergedDrawCounts.slice();
27954
+ this._mergedDrawStarts = source._mergedDrawStarts.slice();
27955
+ this._mergedDrawInstanceCounts = source._mergedDrawInstanceCounts.slice();
27759
27956
 
27760
27957
  this._indirectTexture = source._indirectTexture.clone();
27761
27958
  this._indirectTexture.image.data = this._indirectTexture.image.data.slice();
@@ -27763,11 +27960,15 @@ class BatchedMesh extends Mesh {
27763
27960
  this._matricesTexture = source._matricesTexture.clone();
27764
27961
  this._matricesTexture.image.data = this._matricesTexture.image.data.slice();
27765
27962
 
27766
- if ( this._colorsTexture !== null ) {
27963
+ if ( source._colorsTexture !== null ) {
27767
27964
 
27768
27965
  this._colorsTexture = source._colorsTexture.clone();
27769
27966
  this._colorsTexture.image.data = this._colorsTexture.image.data.slice();
27770
27967
 
27968
+ } else {
27969
+
27970
+ this._colorsTexture = null;
27971
+
27771
27972
  }
27772
27973
 
27773
27974
  return this;
@@ -27798,9 +27999,26 @@ class BatchedMesh extends Mesh {
27798
27999
 
27799
28000
  }
27800
28001
 
28002
+ if ( this._previousMatricesTexture !== null ) {
28003
+
28004
+ this._previousMatricesTexture.dispose();
28005
+ this._previousMatricesTexture = null;
28006
+
28007
+ }
28008
+
27801
28009
  }
27802
28010
 
27803
- onBeforeRender( renderer, scene, camera, geometry, material/*, _group*/ ) {
28011
+ /**
28012
+ * Updates the draw parameters for the next draw. Depending on {@link BatchedMesh#perObjectFrustumCulled}
28013
+ * and {@link BatchedMesh#sortObjects}, this includes per-object frustum culling and sorting.
28014
+ *
28015
+ * @private
28016
+ * @param {Camera} camera - The camera of the next draw.
28017
+ * @param {BufferGeometry} geometry - The batch's geometry.
28018
+ * @param {Material} material - The material of the next draw.
28019
+ * @param {('multiDraw'|'merged')} [drawFormat='multiDraw'] - The format of the draw parameters.
28020
+ */
28021
+ _updateDrawParameters( camera, geometry, material, drawFormat = 'multiDraw' ) {
27804
28022
 
27805
28023
  // if visibility has not changed and frustum culling and object sorting is not required
27806
28024
  // then skip iterating over all items
@@ -27830,6 +28048,9 @@ class BatchedMesh extends Mesh {
27830
28048
  const instanceInfo = this._instanceInfo;
27831
28049
  const multiDrawStarts = this._multiDrawStarts;
27832
28050
  const multiDrawCounts = this._multiDrawCounts;
28051
+ const mergedDrawStarts = this._mergedDrawStarts;
28052
+ const mergedDrawCounts = this._mergedDrawCounts;
28053
+ const mergedDrawInstanceCounts = this._mergedDrawInstanceCounts;
27833
28054
  const geometryInfoList = this._geometryInfo;
27834
28055
  const perObjectFrustumCulled = this.perObjectFrustumCulled;
27835
28056
  const indirectTexture = this._indirectTexture;
@@ -27860,11 +28081,12 @@ class BatchedMesh extends Mesh {
27860
28081
  }
27861
28082
 
27862
28083
  let multiDrawCount = 0;
28084
+ let mergedDrawCount = 0;
27863
28085
  if ( this.sortObjects ) {
27864
28086
 
27865
28087
  // get the camera position in the local frame
27866
28088
  _matrix$1.copy( this.matrixWorld ).invert();
27867
- _vector$5.setFromMatrixPosition( camera.matrixWorld ).applyMatrix4( _matrix$1 );
28089
+ _cameraPosition.setFromMatrixPosition( camera.matrixWorld ).applyMatrix4( _matrix$1 );
27868
28090
  _forward$1.set( 0, 0, -1 ).transformDirection( camera.matrixWorld ).transformDirection( _matrix$1 );
27869
28091
 
27870
28092
  for ( let i = 0, l = instanceInfo.length; i < l; i ++ ) {
@@ -27889,7 +28111,7 @@ class BatchedMesh extends Mesh {
27889
28111
 
27890
28112
  // get the distance from camera used for sorting
27891
28113
  const geometryInfo = geometryInfoList[ geometryId ];
27892
- const z = _temp.subVectors( _sphere$2.center, _vector$5 ).dot( _forward$1 );
28114
+ const z = _temp.subVectors( _sphere$2.center, _cameraPosition ).dot( _forward$1 );
27893
28115
  _renderList.push( geometryInfo.start, geometryInfo.count, z, i );
27894
28116
 
27895
28117
  }
@@ -27914,8 +28136,31 @@ class BatchedMesh extends Mesh {
27914
28136
  for ( let i = 0, l = list.length; i < l; i ++ ) {
27915
28137
 
27916
28138
  const item = list[ i ];
27917
- multiDrawStarts[ multiDrawCount ] = item.start * bytesPerElement * multiDrawMultiplier;
27918
- multiDrawCounts[ multiDrawCount ] = item.count * multiDrawMultiplier;
28139
+ const start = item.start * bytesPerElement * multiDrawMultiplier;
28140
+ const count = item.count * multiDrawMultiplier;
28141
+
28142
+ if ( drawFormat === 'merged' ) {
28143
+
28144
+ if ( mergedDrawCount > 0 && mergedDrawStarts[ mergedDrawCount - 1 ] === start && mergedDrawCounts[ mergedDrawCount - 1 ] === count ) {
28145
+
28146
+ mergedDrawInstanceCounts[ mergedDrawCount - 1 ] ++;
28147
+
28148
+ } else {
28149
+
28150
+ mergedDrawStarts[ mergedDrawCount ] = start;
28151
+ mergedDrawCounts[ mergedDrawCount ] = count;
28152
+ mergedDrawInstanceCounts[ mergedDrawCount ] = 1;
28153
+ mergedDrawCount ++;
28154
+
28155
+ }
28156
+
28157
+ } else {
28158
+
28159
+ multiDrawStarts[ multiDrawCount ] = start;
28160
+ multiDrawCounts[ multiDrawCount ] = count;
28161
+
28162
+ }
28163
+
27919
28164
  indirectArray[ multiDrawCount ] = item.index;
27920
28165
  multiDrawCount ++;
27921
28166
 
@@ -27945,8 +28190,31 @@ class BatchedMesh extends Mesh {
27945
28190
  if ( ! culled ) {
27946
28191
 
27947
28192
  const geometryInfo = geometryInfoList[ geometryId ];
27948
- multiDrawStarts[ multiDrawCount ] = geometryInfo.start * bytesPerElement * multiDrawMultiplier;
27949
- multiDrawCounts[ multiDrawCount ] = geometryInfo.count * multiDrawMultiplier;
28193
+ const start = geometryInfo.start * bytesPerElement * multiDrawMultiplier;
28194
+ const count = geometryInfo.count * multiDrawMultiplier;
28195
+
28196
+ if ( drawFormat === 'merged' ) {
28197
+
28198
+ if ( mergedDrawCount > 0 && mergedDrawStarts[ mergedDrawCount - 1 ] === start && mergedDrawCounts[ mergedDrawCount - 1 ] === count ) {
28199
+
28200
+ mergedDrawInstanceCounts[ mergedDrawCount - 1 ] ++;
28201
+
28202
+ } else {
28203
+
28204
+ mergedDrawStarts[ mergedDrawCount ] = start;
28205
+ mergedDrawCounts[ mergedDrawCount ] = count;
28206
+ mergedDrawInstanceCounts[ mergedDrawCount ] = 1;
28207
+ mergedDrawCount ++;
28208
+
28209
+ }
28210
+
28211
+ } else {
28212
+
28213
+ multiDrawStarts[ multiDrawCount ] = start;
28214
+ multiDrawCounts[ multiDrawCount ] = count;
28215
+
28216
+ }
28217
+
27950
28218
  indirectArray[ multiDrawCount ] = i;
27951
28219
  multiDrawCount ++;
27952
28220
 
@@ -27960,14 +28228,37 @@ class BatchedMesh extends Mesh {
27960
28228
 
27961
28229
  indirectTexture.needsUpdate = true;
27962
28230
  this._multiDrawCount = multiDrawCount;
28231
+ this._mergedDrawCount = mergedDrawCount;
27963
28232
  this._multiDrawBytesPerElement = bytesPerElement;
27964
28233
  this._visibilityChanged = false;
27965
28234
 
27966
28235
  }
27967
28236
 
28237
+ onBeforeRender( renderer, scene, camera, geometry, material/*, _group*/ ) {
28238
+
28239
+ if ( renderer.isWebGPURenderer === true ) {
28240
+
28241
+ if ( this._visibilityChanged || this.perObjectFrustumCulled || this.sortObjects ) {
28242
+
28243
+ this._indirectTexture.needsUpdate = true;
28244
+
28245
+ }
28246
+
28247
+ } else {
28248
+
28249
+ this._updateDrawParameters( camera, geometry, material );
28250
+
28251
+ }
28252
+
28253
+ }
28254
+
27968
28255
  onBeforeShadow( renderer, object, camera, shadowCamera, geometry, depthMaterial/* , group */ ) {
27969
28256
 
27970
- this.onBeforeRender( renderer, null, shadowCamera, geometry, depthMaterial );
28257
+ if ( renderer.isWebGPURenderer !== true ) {
28258
+
28259
+ this._updateDrawParameters( shadowCamera, geometry, depthMaterial );
28260
+
28261
+ }
27971
28262
 
27972
28263
  }
27973
28264
 
@@ -28191,6 +28482,26 @@ class Line extends Object3D {
28191
28482
 
28192
28483
  super.copy( source, recursive );
28193
28484
 
28485
+ if ( source.morphTargetInfluences !== undefined ) {
28486
+
28487
+ this.morphTargetInfluences = source.morphTargetInfluences.slice();
28488
+
28489
+ } else {
28490
+
28491
+ this.morphTargetInfluences = undefined;
28492
+
28493
+ }
28494
+
28495
+ if ( source.morphTargetDictionary !== undefined ) {
28496
+
28497
+ this.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary );
28498
+
28499
+ } else {
28500
+
28501
+ this.morphTargetDictionary = undefined;
28502
+
28503
+ }
28504
+
28194
28505
  this.material = Array.isArray( source.material ) ? source.material.slice() : source.material;
28195
28506
  this.geometry = source.geometry;
28196
28507
 
@@ -28745,6 +29056,26 @@ class Points extends Object3D {
28745
29056
 
28746
29057
  super.copy( source, recursive );
28747
29058
 
29059
+ if ( source.morphTargetInfluences !== undefined ) {
29060
+
29061
+ this.morphTargetInfluences = source.morphTargetInfluences.slice();
29062
+
29063
+ } else {
29064
+
29065
+ this.morphTargetInfluences = undefined;
29066
+
29067
+ }
29068
+
29069
+ if ( source.morphTargetDictionary !== undefined ) {
29070
+
29071
+ this.morphTargetDictionary = Object.assign( {}, source.morphTargetDictionary );
29072
+
29073
+ } else {
29074
+
29075
+ this.morphTargetDictionary = undefined;
29076
+
29077
+ }
29078
+
28748
29079
  this.material = Array.isArray( source.material ) ? source.material.slice() : source.material;
28749
29080
  this.geometry = source.geometry;
28750
29081
 
@@ -29171,6 +29502,16 @@ class FramebufferTexture extends Texture {
29171
29502
 
29172
29503
  }
29173
29504
 
29505
+ copy( source ) {
29506
+
29507
+ super.copy( source );
29508
+
29509
+ this.source = new TextureSource( Object.assign( {}, source.image ) );
29510
+
29511
+ return this;
29512
+
29513
+ }
29514
+
29174
29515
  }
29175
29516
 
29176
29517
  /**
@@ -29185,7 +29526,7 @@ class CompressedTexture extends Texture {
29185
29526
  /**
29186
29527
  * Constructs a new compressed texture.
29187
29528
  *
29188
- * @param {Array<Object>} mipmaps - This array holds for all mipmaps (including the bases mip)
29529
+ * @param {Array<Object>} [mipmaps=[]] - This array holds for all mipmaps (including the bases mip)
29189
29530
  * the data and dimensions.
29190
29531
  * @param {number} width - The width of the texture.
29191
29532
  * @param {number} height - The height of the texture.
@@ -29199,7 +29540,7 @@ class CompressedTexture extends Texture {
29199
29540
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
29200
29541
  * @param {string} [colorSpace=NoColorSpace] - The color space.
29201
29542
  */
29202
- constructor( mipmaps, width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, colorSpace ) {
29543
+ constructor( mipmaps = [], width, height, format, type, mapping, wrapS, wrapT, magFilter, minFilter, anisotropy, colorSpace ) {
29203
29544
 
29204
29545
  super( null, mapping, wrapS, wrapT, magFilter, minFilter, format, type, anisotropy, colorSpace );
29205
29546
 
@@ -29608,8 +29949,8 @@ class DepthTexture extends Texture {
29608
29949
  * @param {number} [mapping=Texture.DEFAULT_MAPPING] - The texture mapping.
29609
29950
  * @param {number} [wrapS=ClampToEdgeWrapping] - The wrapS value.
29610
29951
  * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value.
29611
- * @param {number} [magFilter=LinearFilter] - The mag filter value.
29612
- * @param {number} [minFilter=LinearFilter] - The min filter value.
29952
+ * @param {number} [magFilter=NearestFilter] - The mag filter value.
29953
+ * @param {number} [minFilter=NearestFilter] - The min filter value.
29613
29954
  * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The anisotropy value.
29614
29955
  * @param {number} [format=DepthFormat] - The texture format.
29615
29956
  * @param {number} [depth=1] - The depth of the texture.
@@ -31264,7 +31605,7 @@ class EdgesGeometry extends BufferGeometry {
31264
31605
  const vertKeys = [ 'a', 'b', 'c' ];
31265
31606
  const hashes = new Array( 3 );
31266
31607
 
31267
- const edgeData = {};
31608
+ const edgeData = new Map();
31268
31609
  const vertices = [];
31269
31610
  for ( let i = 0; i < indexCount; i += 3 ) {
31270
31611
 
@@ -31313,29 +31654,31 @@ class EdgesGeometry extends BufferGeometry {
31313
31654
  const hash = `${ vecHash0 }_${ vecHash1 }`;
31314
31655
  const reverseHash = `${ vecHash1 }_${ vecHash0 }`;
31315
31656
 
31316
- if ( reverseHash in edgeData && edgeData[ reverseHash ] ) {
31657
+ const sibling = edgeData.get( reverseHash );
31658
+
31659
+ if ( sibling ) {
31317
31660
 
31318
31661
  // if we found a sibling edge add it into the vertex array if
31319
31662
  // it meets the angle threshold and delete the edge from the map.
31320
- if ( _normal.dot( edgeData[ reverseHash ].normal ) <= thresholdDot ) {
31663
+ if ( _normal.dot( sibling.normal ) <= thresholdDot ) {
31321
31664
 
31322
31665
  vertices.push( v0.x, v0.y, v0.z );
31323
31666
  vertices.push( v1.x, v1.y, v1.z );
31324
31667
 
31325
31668
  }
31326
31669
 
31327
- edgeData[ reverseHash ] = null;
31670
+ edgeData.set( reverseHash, null );
31328
31671
 
31329
- } else if ( ! ( hash in edgeData ) ) {
31672
+ } else if ( ! edgeData.has( hash ) ) {
31330
31673
 
31331
31674
  // if we've already got an edge here then skip adding a new one
31332
- edgeData[ hash ] = {
31675
+ edgeData.set( hash, {
31333
31676
 
31334
31677
  index0: indexArr[ j ],
31335
31678
  index1: indexArr[ jNext ],
31336
31679
  normal: _normal.clone(),
31337
31680
 
31338
- };
31681
+ } );
31339
31682
 
31340
31683
  }
31341
31684
 
@@ -31344,11 +31687,11 @@ class EdgesGeometry extends BufferGeometry {
31344
31687
  }
31345
31688
 
31346
31689
  // iterate over all remaining, unmatched edges and add them to the vertex array
31347
- for ( const key in edgeData ) {
31690
+ for ( const edge of edgeData.values() ) {
31348
31691
 
31349
- if ( edgeData[ key ] ) {
31692
+ if ( edge ) {
31350
31693
 
31351
- const { index0, index1 } = edgeData[ key ];
31694
+ const { index0, index1 } = edge;
31352
31695
  _v0.fromBufferAttribute( positionAttr, index0 );
31353
31696
  _v1$1.fromBufferAttribute( positionAttr, index1 );
31354
31697
 
@@ -31843,6 +32186,8 @@ class Curve {
31843
32186
 
31844
32187
  this.arcLengthDivisions = source.arcLengthDivisions;
31845
32188
 
32189
+ this.cacheArcLengths = null;
32190
+
31846
32191
  return this;
31847
32192
 
31848
32193
  }
@@ -31880,6 +32225,8 @@ class Curve {
31880
32225
 
31881
32226
  this.arcLengthDivisions = json.arcLengthDivisions;
31882
32227
 
32228
+ this.cacheArcLengths = null;
32229
+
31883
32230
  return this;
31884
32231
 
31885
32232
  }
@@ -33550,6 +33897,15 @@ class CurvePath extends Curve {
33550
33897
  */
33551
33898
  this.autoClose = false;
33552
33899
 
33900
+ /**
33901
+ * An internal cache that holds precomputed curve length values.
33902
+ *
33903
+ * @private
33904
+ * @type {?Array<number>}
33905
+ * @default null
33906
+ */
33907
+ this.cacheLengths = null;
33908
+
33553
33909
  }
33554
33910
 
33555
33911
  /**
@@ -33765,6 +34121,8 @@ class CurvePath extends Curve {
33765
34121
 
33766
34122
  this.autoClose = source.autoClose;
33767
34123
 
34124
+ this.cacheLengths = null;
34125
+
33768
34126
  return this;
33769
34127
 
33770
34128
  }
@@ -33801,6 +34159,8 @@ class CurvePath extends Curve {
33801
34159
 
33802
34160
  }
33803
34161
 
34162
+ this.cacheLengths = null;
34163
+
33804
34164
  return this;
33805
34165
 
33806
34166
  }
@@ -36112,6 +36472,8 @@ class LatheGeometry extends BufferGeometry {
36112
36472
 
36113
36473
  case ( points.length - 1 ): // special handling for last Vertex on path
36114
36474
 
36475
+ prevNormal.normalize();
36476
+
36115
36477
  initNormals.push( prevNormal.x, prevNormal.y, prevNormal.z );
36116
36478
 
36117
36479
  break;
@@ -38866,7 +39228,7 @@ class MeshStandardMaterial extends Material {
38866
39228
  * map set, this value is not applied.
38867
39229
  *
38868
39230
  * @type {number}
38869
- * @default 0
39231
+ * @default 1
38870
39232
  */
38871
39233
  this.displacementScale = 1;
38872
39234
 
@@ -39077,6 +39439,8 @@ class MeshStandardMaterial extends Material {
39077
39439
  * - Clearcoat: Some materials — like car paints, carbon fiber, and wet surfaces — require
39078
39440
  * a clear, reflective layer on top of another layer that may be irregular or rough.
39079
39441
  * Clearcoat approximates this effect, without the need for a separate transparent surface.
39442
+ * - Diffuse roughness: Produces the flatter appearance and enhanced backscattering of
39443
+ * rough diffuse surfaces such as clay, concrete, and unpolished materials.
39080
39444
  * - Iridescence: Allows to render the effect where hue varies depending on the viewing
39081
39445
  * angle and illumination angle. This can be seen on soap bubbles, oil films, or on the
39082
39446
  * wings of many insects.
@@ -39135,7 +39499,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
39135
39499
  * property provides additional rotation to the vectors in the texture.
39136
39500
  *
39137
39501
  * @type {number}
39138
- * @default 1
39502
+ * @default 0
39139
39503
  */
39140
39504
  this.anisotropyRotation = 0;
39141
39505
 
@@ -39204,6 +39568,18 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
39204
39568
  */
39205
39569
  this.clearcoatNormalMap = null;
39206
39570
 
39571
+ /**
39572
+ * The red channel of this texture is multiplied against `diffuseRoughness`,
39573
+ * for per-pixel control over the diffuse roughness.
39574
+ *
39575
+ * `diffuseRoughnessMap` represents non-color data. Any texture assigned must have
39576
+ * `texture.colorSpace = NoColorSpace` (default).
39577
+ *
39578
+ * @type {?Texture}
39579
+ * @default null
39580
+ */
39581
+ this.diffuseRoughnessMap = null;
39582
+
39207
39583
  /**
39208
39584
  * Index-of-refraction for non-metallic materials, from `1.0` to `2.333`.
39209
39585
  *
@@ -39258,20 +39634,29 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
39258
39634
  this.iridescenceIOR = 1.3;
39259
39635
 
39260
39636
  /**
39261
- *Array of exactly 2 elements, specifying minimum and maximum thickness of the iridescence layer.
39262
- Thickness of iridescence layer has an equivalent effect of the one `thickness` has on `ior`.
39637
+ * The minimum thickness of the iridescence layer in nanometers.
39263
39638
  *
39264
- * @type {Array<number,number>}
39265
- * @default [100,400]
39639
+ * @type {number}
39640
+ * @default 100
39641
+ */
39642
+ this.iridescenceThicknessMinimum = 100;
39643
+
39644
+ /**
39645
+ * The maximum thickness of the iridescence layer in nanometers. If no
39646
+ * `iridescenceThicknessMap` is defined, this value is used as the thickness.
39647
+ *
39648
+ * @type {number}
39649
+ * @default 400
39266
39650
  */
39267
- this.iridescenceThicknessRange = [ 100, 400 ];
39651
+ this.iridescenceThicknessMaximum = 400;
39268
39652
 
39269
39653
  /**
39270
39654
  * A texture that defines the thickness of the iridescence layer, stored in the green channel.
39271
- * Minimum and maximum values of thickness are defined by `iridescenceThicknessRange` array:
39272
- * - `0.0` in the green channel will result in thickness equal to first element of the array.
39273
- * - `1.0` in the green channel will result in thickness equal to second element of the array.
39274
- * - Values in-between will linearly interpolate between the elements of the array.
39655
+ * Minimum and maximum values of thickness are defined by `iridescenceThicknessMinimum` and
39656
+ * `iridescenceThicknessMaximum`:
39657
+ * - `0.0` in the green channel will result in thickness equal to `iridescenceThicknessMinimum`.
39658
+ * - `1.0` in the green channel will result in thickness equal to `iridescenceThicknessMaximum`.
39659
+ * - Values in-between will linearly interpolate between both values.
39275
39660
  *
39276
39661
  * `iridescenceThicknessMap` represents non-color data. Any texture assigned must have
39277
39662
  * `texture.colorSpace = NoColorSpace` (default).
@@ -39419,6 +39804,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
39419
39804
 
39420
39805
  this._anisotropy = 0;
39421
39806
  this._clearcoat = 0;
39807
+ this._diffuseRoughness = 0;
39422
39808
  this._dispersion = 0;
39423
39809
  this._iridescence = 0;
39424
39810
  this._retroreflectivity = 0;
@@ -39478,6 +39864,33 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
39478
39864
  this._clearcoat = value;
39479
39865
 
39480
39866
  }
39867
+
39868
+ /**
39869
+ * Roughness of the diffuse layer, from `0.0` to `1.0`. A value of `0.0`
39870
+ * uses Lambertian diffuse reflection. Values above `0.0` use the EON
39871
+ * energy-preserving rough diffuse model.
39872
+ *
39873
+ * @type {number}
39874
+ * @default 0
39875
+ */
39876
+ get diffuseRoughness() {
39877
+
39878
+ return this._diffuseRoughness;
39879
+
39880
+ }
39881
+
39882
+ set diffuseRoughness( value ) {
39883
+
39884
+ if ( this._diffuseRoughness > 0 !== value > 0 ) {
39885
+
39886
+ this.version ++;
39887
+
39888
+ }
39889
+
39890
+ this._diffuseRoughness = value;
39891
+
39892
+ }
39893
+
39481
39894
  /**
39482
39895
  * The intensity of the iridescence layer, simulating RGB color shift based on the angle between
39483
39896
  * the surface and the viewer, from `0.0` to `1.0`.
@@ -39610,6 +40023,30 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
39610
40023
 
39611
40024
  }
39612
40025
 
40026
+ /**
40027
+ * Array of exactly 2 elements, specifying minimum and maximum thickness of the iridescence layer.
40028
+ *
40029
+ * @deprecated since r187. Use {@link MeshPhysicalMaterial#iridescenceThicknessMinimum} and {@link MeshPhysicalMaterial#iridescenceThicknessMaximum} instead.
40030
+ * @type {Array<number,number>}
40031
+ * @default [100,400]
40032
+ */
40033
+ get iridescenceThicknessRange() {
40034
+
40035
+ warnOnce( 'MeshPhysicalMaterial: The "iridescenceThicknessRange" property has been replaced by "iridescenceThicknessMinimum" and "iridescenceThicknessMaximum".' ); // @deprecated r187
40036
+
40037
+ return [ this.iridescenceThicknessMinimum, this.iridescenceThicknessMaximum ];
40038
+
40039
+ }
40040
+
40041
+ set iridescenceThicknessRange( value ) {
40042
+
40043
+ warnOnce( 'MeshPhysicalMaterial: The "iridescenceThicknessRange" property has been replaced by "iridescenceThicknessMinimum" and "iridescenceThicknessMaximum".' ); // @deprecated r187
40044
+
40045
+ this.iridescenceThicknessMinimum = value[ 0 ];
40046
+ this.iridescenceThicknessMaximum = value[ 1 ];
40047
+
40048
+ }
40049
+
39613
40050
  copy( source ) {
39614
40051
 
39615
40052
  super.copy( source );
@@ -39631,6 +40068,8 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
39631
40068
  this.clearcoatRoughnessMap = source.clearcoatRoughnessMap;
39632
40069
  this.clearcoatNormalMap = source.clearcoatNormalMap;
39633
40070
  this.clearcoatNormalScale.copy( source.clearcoatNormalScale );
40071
+ this.diffuseRoughness = source.diffuseRoughness;
40072
+ this.diffuseRoughnessMap = source.diffuseRoughnessMap;
39634
40073
 
39635
40074
  this.dispersion = source.dispersion;
39636
40075
  this.ior = source.ior;
@@ -39638,7 +40077,8 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
39638
40077
  this.iridescence = source.iridescence;
39639
40078
  this.iridescenceMap = source.iridescenceMap;
39640
40079
  this.iridescenceIOR = source.iridescenceIOR;
39641
- this.iridescenceThicknessRange = [ ...source.iridescenceThicknessRange ];
40080
+ this.iridescenceThicknessMinimum = source.iridescenceThicknessMinimum;
40081
+ this.iridescenceThicknessMaximum = source.iridescenceThicknessMaximum;
39642
40082
  this.iridescenceThicknessMap = source.iridescenceThicknessMap;
39643
40083
 
39644
40084
  this.retroreflectivity = source.retroreflectivity;
@@ -39900,7 +40340,7 @@ class MeshPhongMaterial extends Material {
39900
40340
  * map set, this value is not applied.
39901
40341
  *
39902
40342
  * @type {number}
39903
- * @default 0
40343
+ * @default 1
39904
40344
  */
39905
40345
  this.displacementScale = 1;
39906
40346
 
@@ -40342,7 +40782,7 @@ class MeshToonMaterial extends Material {
40342
40782
  * map set, this value is not applied.
40343
40783
  *
40344
40784
  * @type {number}
40345
- * @default 0
40785
+ * @default 1
40346
40786
  */
40347
40787
  this.displacementScale = 1;
40348
40788
 
@@ -40576,7 +41016,7 @@ class MeshNormalMaterial extends Material {
40576
41016
  * map set, this value is not applied.
40577
41017
  *
40578
41018
  * @type {number}
40579
- * @default 0
41019
+ * @default 1
40580
41020
  */
40581
41021
  this.displacementScale = 1;
40582
41022
 
@@ -40864,7 +41304,7 @@ class MeshLambertMaterial extends Material {
40864
41304
  * map set, this value is not applied.
40865
41305
  *
40866
41306
  * @type {number}
40867
- * @default 0
41307
+ * @default 1
40868
41308
  */
40869
41309
  this.displacementScale = 1;
40870
41310
 
@@ -41175,7 +41615,7 @@ class MeshDepthMaterial extends Material {
41175
41615
  * map set, this value is not applied.
41176
41616
  *
41177
41617
  * @type {number}
41178
- * @default 0
41618
+ * @default 1
41179
41619
  */
41180
41620
  this.displacementScale = 1;
41181
41621
 
@@ -41325,7 +41765,7 @@ class MeshDistanceMaterial extends Material {
41325
41765
  * map set, this value is not applied.
41326
41766
  *
41327
41767
  * @type {number}
41328
- * @default 0
41768
+ * @default 1
41329
41769
  */
41330
41770
  this.displacementScale = 1;
41331
41771
 
@@ -41515,7 +41955,7 @@ class MeshMatcapMaterial extends Material {
41515
41955
  * map set, this value is not applied.
41516
41956
  *
41517
41957
  * @type {number}
41518
- * @default 0
41958
+ * @default 1
41519
41959
  */
41520
41960
  this.displacementScale = 1;
41521
41961
 
@@ -42031,10 +42471,8 @@ function makeClipAdditive( targetClip, referenceFrame = 0, referenceClip = targe
42031
42471
 
42032
42472
  // Interpolate to the reference value
42033
42473
  const interpolant = referenceTrack.createInterpolant();
42034
- const startIndex = referenceOffset;
42035
- const endIndex = referenceValueSize - referenceOffset;
42036
42474
  interpolant.evaluate( referenceTime );
42037
- referenceValue = interpolant.resultBuffer.slice( startIndex, endIndex );
42475
+ referenceValue = interpolant.resultBuffer.slice();
42038
42476
 
42039
42477
  }
42040
42478
 
@@ -42522,7 +42960,7 @@ class Interpolant {
42522
42960
  *
42523
42961
  * @param {number} i1 - An index into the sample value buffer.
42524
42962
  * @param {number} t0 - The previous interpolation factor.
42525
- * @param {number} t - The current interpolation factor.
42963
+ * @param {number} t1 - The next interpolation factor.
42526
42964
  */
42527
42965
  intervalChanged_( /* i1, t0, t1 */ ) {
42528
42966
 
@@ -43174,6 +43612,13 @@ class KeyframeTrack {
43174
43612
 
43175
43613
  }
43176
43614
 
43615
+ if ( hasTangents( this.settings ) ) {
43616
+
43617
+ shiftTangentTimes( this.settings.inTangents, timeOffset );
43618
+ shiftTangentTimes( this.settings.outTangents, timeOffset );
43619
+
43620
+ }
43621
+
43177
43622
  }
43178
43623
 
43179
43624
  return this;
@@ -43495,6 +43940,18 @@ class KeyframeTrack {
43495
43940
 
43496
43941
  }
43497
43942
 
43943
+ function shiftTangentTimes( tangents, timeOffset ) {
43944
+
43945
+ // tangents are [ time, value ] pairs, so only every second entry is a time
43946
+
43947
+ for ( let i = 0, n = tangents.length; i !== n; i += 2 ) {
43948
+
43949
+ tangents[ i ] += timeOffset;
43950
+
43951
+ }
43952
+
43953
+ }
43954
+
43498
43955
  function scaleTangentTimes( tangents, timeScale ) {
43499
43956
 
43500
43957
  // tangents are [ time, value ] pairs, so only every second entry is a time
@@ -44822,6 +45279,23 @@ class Loader {
44822
45279
  */
44823
45280
  this.requestHeader = {};
44824
45281
 
45282
+ /**
45283
+ * The request priority hint. Image loaders use `HTMLImageElement.fetchPriority`.
45284
+ *
45285
+ * @type {('high'|'low'|'auto')}
45286
+ * @default 'auto'
45287
+ */
45288
+ this.priority = 'auto';
45289
+
45290
+ /**
45291
+ * The HTTP cache mode passed to `fetch()`. This does not affect {@link Cache}
45292
+ * or loaders using `HTMLImageElement`.
45293
+ *
45294
+ * @type {('default'|'no-store'|'reload'|'no-cache'|'force-cache')}
45295
+ * @default 'default'
45296
+ */
45297
+ this.cache = 'default';
45298
+
44825
45299
  if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
44826
45300
 
44827
45301
  __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );
@@ -44940,6 +45414,36 @@ class Loader {
44940
45414
 
44941
45415
  }
44942
45416
 
45417
+ /**
45418
+ * Sets a browser scheduling hint. Browsers may ignore this hint.
45419
+ * Internally created loaders inherit it. Loaders supplied by the application
45420
+ * (for example decoder loaders or loading manager handlers) retain their own settings.
45421
+ *
45422
+ * @param {('high'|'low'|'auto')} value - The request priority hint.
45423
+ * @return {Loader} A reference to this instance.
45424
+ */
45425
+ setPriority( value ) {
45426
+
45427
+ this.priority = value;
45428
+ return this;
45429
+
45430
+ }
45431
+
45432
+ /**
45433
+ * Sets the HTTP cache mode for fetch requests. `no-cache` revalidates cached
45434
+ * responses; `no-store` bypasses the HTTP cache. This does not affect
45435
+ * {@link Cache} or image element requests.
45436
+ *
45437
+ * @param {('default'|'no-store'|'reload'|'no-cache'|'force-cache')} value - The HTTP cache mode.
45438
+ * @return {Loader} A reference to this instance.
45439
+ */
45440
+ setCache( value ) {
45441
+
45442
+ this.cache = value;
45443
+ return this;
45444
+
45445
+ }
45446
+
44943
45447
  /**
44944
45448
  * This method can be implemented in loaders for aborting ongoing requests.
44945
45449
  *
@@ -45108,6 +45612,8 @@ class FileLoader extends Loader {
45108
45612
  const req = new Request( url, {
45109
45613
  headers: new Headers( this.requestHeader ),
45110
45614
  credentials: this.withCredentials ? 'include' : 'same-origin',
45615
+ priority: this.priority,
45616
+ cache: this.cache,
45111
45617
  signal: ( typeof AbortSignal.any === 'function' ) ? AbortSignal.any( [ this._abortController.signal, this.manager.abortController.signal ] ) : this._abortController.signal
45112
45618
  } );
45113
45619
 
@@ -45379,6 +45885,8 @@ class AnimationLoader extends Loader {
45379
45885
  const scope = this;
45380
45886
 
45381
45887
  const loader = new FileLoader( this.manager );
45888
+ loader.setPriority( this.priority );
45889
+ loader.setCache( this.cache );
45382
45890
  loader.setPath( this.path );
45383
45891
  loader.setRequestHeader( this.requestHeader );
45384
45892
  loader.setWithCredentials( this.withCredentials );
@@ -45476,6 +45984,8 @@ class CompressedTextureLoader extends Loader {
45476
45984
  const texture = new CompressedTexture();
45477
45985
 
45478
45986
  const loader = new FileLoader( this.manager );
45987
+ loader.setPriority( this.priority );
45988
+ loader.setCache( this.cache );
45479
45989
  loader.setPath( this.path );
45480
45990
  loader.setResponseType( 'arraybuffer' );
45481
45991
  loader.setRequestHeader( this.requestHeader );
@@ -45734,6 +46244,7 @@ class ImageLoader extends Loader {
45734
46244
  Cache.add( `image:${url}`, image );
45735
46245
  scope.manager.itemStart( url );
45736
46246
 
46247
+ image.fetchPriority = this.priority;
45737
46248
  image.src = url;
45738
46249
 
45739
46250
  return image;
@@ -45801,6 +46312,8 @@ class CubeTextureLoader extends Loader {
45801
46312
  texture.colorSpace = SRGBColorSpace;
45802
46313
 
45803
46314
  const loader = new ImageLoader( this.manager );
46315
+ loader.setPriority( this.priority );
46316
+ loader.setCache( this.cache );
45804
46317
  loader.setCrossOrigin( this.crossOrigin );
45805
46318
  loader.setPath( this.path );
45806
46319
 
@@ -45880,6 +46393,8 @@ class DataTextureLoader extends Loader {
45880
46393
  const texture = new DataTexture();
45881
46394
 
45882
46395
  const loader = new FileLoader( this.manager );
46396
+ loader.setPriority( this.priority );
46397
+ loader.setCache( this.cache );
45883
46398
  loader.setResponseType( 'arraybuffer' );
45884
46399
  loader.setRequestHeader( this.requestHeader );
45885
46400
  loader.setPath( this.path );
@@ -46051,9 +46566,9 @@ class TextureLoader extends Loader {
46051
46566
  * may pop up in your scene once the respective loading process is finished.
46052
46567
  *
46053
46568
  * @param {string} url - The path/URL of the file to be loaded. This can also be a data URI.
46054
- * @param {function(Texture)} onLoad - Executed when the loading process has been finished.
46055
- * @param {onProgressCallback} onProgress - Unsupported in this loader.
46056
- * @param {onErrorCallback} onError - Executed when errors occur.
46569
+ * @param {function(Texture)} [onLoad] - Executed when the loading process has been finished.
46570
+ * @param {onProgressCallback} [onProgress] - Unsupported in this loader.
46571
+ * @param {onErrorCallback} [onError] - Executed when errors occur.
46057
46572
  * @return {Texture} The texture.
46058
46573
  */
46059
46574
  load( url, onLoad, onProgress, onError ) {
@@ -46061,6 +46576,8 @@ class TextureLoader extends Loader {
46061
46576
  const texture = new Texture();
46062
46577
 
46063
46578
  const loader = new ImageLoader( this.manager );
46579
+ loader.setPriority( this.priority );
46580
+ loader.setCache( this.cache );
46064
46581
  loader.setCrossOrigin( this.crossOrigin );
46065
46582
  loader.setPath( this.path );
46066
46583
 
@@ -46092,6 +46609,17 @@ class TextureLoader extends Loader {
46092
46609
  */
46093
46610
  class Light extends Object3D {
46094
46611
 
46612
+ /**
46613
+ * Registers the node class that `WebGPURenderer` uses to shade lights of this type.
46614
+ *
46615
+ * @param {AnalyticLightNode.constructor} lightNodeClass - The light node class.
46616
+ */
46617
+ static registerNode( lightNodeClass ) {
46618
+
46619
+ this.prototype._lightNode = lightNodeClass;
46620
+
46621
+ }
46622
+
46095
46623
  /**
46096
46624
  * Constructs a new light.
46097
46625
  *
@@ -46551,6 +47079,7 @@ class LightShadow {
46551
47079
  this.blurSamples = source.blurSamples;
46552
47080
 
46553
47081
  this.mapSize.copy( source.mapSize );
47082
+ this.mapType = source.mapType;
46554
47083
 
46555
47084
  this.biasNode = source.biasNode;
46556
47085
 
@@ -46585,6 +47114,7 @@ class LightShadow {
46585
47114
  object.radius = this.radius;
46586
47115
  object.blurSamples = this.blurSamples;
46587
47116
  object.mapSize = this.mapSize.toArray();
47117
+ object.mapType = this.mapType;
46588
47118
 
46589
47119
  object.camera = this.camera.toJSON( false ).object;
46590
47120
  delete object.camera.matrix;
@@ -48491,6 +49021,8 @@ class LightProbe extends Light {
48491
49021
  */
48492
49022
  this.isLightProbe = true;
48493
49023
 
49024
+ this.type = 'LightProbe';
49025
+
48494
49026
  /**
48495
49027
  * A light probe uses spherical harmonics to encode lighting information.
48496
49028
  *
@@ -48569,6 +49101,8 @@ class MaterialLoader extends Loader {
48569
49101
  const scope = this;
48570
49102
 
48571
49103
  const loader = new FileLoader( scope.manager );
49104
+ loader.setPriority( scope.priority );
49105
+ loader.setCache( scope.cache );
48572
49106
  loader.setPath( scope.path );
48573
49107
  loader.setRequestHeader( scope.requestHeader );
48574
49108
  loader.setWithCredentials( scope.withCredentials );
@@ -48862,6 +49396,8 @@ class BufferGeometryLoader extends Loader {
48862
49396
  const scope = this;
48863
49397
 
48864
49398
  const loader = new FileLoader( scope.manager );
49399
+ loader.setPriority( scope.priority );
49400
+ loader.setCache( scope.cache );
48865
49401
  loader.setPath( scope.path );
48866
49402
  loader.setRequestHeader( scope.requestHeader );
48867
49403
  loader.setWithCredentials( scope.withCredentials );
@@ -49103,6 +49639,8 @@ class ObjectLoader extends Loader {
49103
49639
  this.resourcePath = this.resourcePath || path;
49104
49640
 
49105
49641
  const loader = new FileLoader( this.manager );
49642
+ loader.setPriority( this.priority );
49643
+ loader.setCache( this.cache );
49106
49644
  loader.setPath( this.path );
49107
49645
  loader.setRequestHeader( this.requestHeader );
49108
49646
  loader.setWithCredentials( this.withCredentials );
@@ -49157,6 +49695,8 @@ class ObjectLoader extends Loader {
49157
49695
  this.resourcePath = this.resourcePath || path;
49158
49696
 
49159
49697
  const loader = new FileLoader( this.manager );
49698
+ loader.setPriority( this.priority );
49699
+ loader.setCache( this.cache );
49160
49700
  loader.setPath( this.path );
49161
49701
  loader.setRequestHeader( this.requestHeader );
49162
49702
  loader.setWithCredentials( this.withCredentials );
@@ -49502,6 +50042,8 @@ class ObjectLoader extends Loader {
49502
50042
  const manager = new LoadingManager( onLoad );
49503
50043
 
49504
50044
  loader = new ImageLoader( manager );
50045
+ loader.setPriority( this.priority );
50046
+ loader.setCache( this.cache );
49505
50047
  loader.setCrossOrigin( this.crossOrigin );
49506
50048
 
49507
50049
  for ( let i = 0, il = json.length; i < il; i ++ ) {
@@ -49599,6 +50141,8 @@ class ObjectLoader extends Loader {
49599
50141
  if ( json !== undefined && json.length > 0 ) {
49600
50142
 
49601
50143
  loader = new ImageLoader( this.manager );
50144
+ loader.setPriority( this.priority );
50145
+ loader.setCache( this.cache );
49602
50146
  loader.setCrossOrigin( this.crossOrigin );
49603
50147
 
49604
50148
  for ( let i = 0, il = json.length; i < il; i ++ ) {
@@ -49747,6 +50291,7 @@ class ObjectLoader extends Loader {
49747
50291
  if ( data.flipY !== undefined ) texture.flipY = data.flipY;
49748
50292
 
49749
50293
  if ( data.generateMipmaps !== undefined ) texture.generateMipmaps = data.generateMipmaps;
50294
+ if ( data.mipmapsAutoUpdate !== undefined ) texture.mipmapsAutoUpdate = data.mipmapsAutoUpdate;
49750
50295
  if ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha;
49751
50296
  if ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment;
49752
50297
  if ( data.compareFunction !== undefined ) texture.compareFunction = data.compareFunction;
@@ -49936,6 +50481,8 @@ class ObjectLoader extends Loader {
49936
50481
  object = new SpotLight( data.color, data.intensity, data.distance, data.angle, data.penumbra, data.decay );
49937
50482
  object.target = data.target || '';
49938
50483
 
50484
+ if ( data.map !== undefined ) object.map = getTexture( data.map );
50485
+
49939
50486
  break;
49940
50487
 
49941
50488
  case 'HemisphereLight':
@@ -50025,8 +50572,8 @@ class ObjectLoader extends Loader {
50025
50572
  } );
50026
50573
  object._instanceInfo = data.instanceInfo;
50027
50574
 
50028
- object._availableInstanceIds = data._availableInstanceIds;
50029
- object._availableGeometryIds = data._availableGeometryIds;
50575
+ object._availableInstanceIds = data.availableInstanceIds;
50576
+ object._availableGeometryIds = data.availableGeometryIds;
50030
50577
 
50031
50578
  object._nextIndexStart = data.nextIndexStart;
50032
50579
  object._nextVertexStart = data.nextVertexStart;
@@ -50097,6 +50644,8 @@ class ObjectLoader extends Loader {
50097
50644
 
50098
50645
  object = new Sprite( getMaterial( data.material ) );
50099
50646
 
50647
+ if ( data.center !== undefined ) object.center.fromArray( data.center );
50648
+
50100
50649
  break;
50101
50650
 
50102
50651
  case 'Group':
@@ -50121,12 +50670,21 @@ class ObjectLoader extends Loader {
50121
50670
 
50122
50671
  if ( data.name !== undefined ) object.name = data.name;
50123
50672
 
50673
+ if ( data.pivot !== undefined ) object.pivot = new Vector3().fromArray( data.pivot );
50674
+
50124
50675
  if ( data.matrix !== undefined ) {
50125
50676
 
50126
50677
  object.matrix.fromArray( data.matrix );
50127
50678
 
50128
50679
  if ( data.matrixAutoUpdate !== undefined ) object.matrixAutoUpdate = data.matrixAutoUpdate;
50129
- if ( object.matrixAutoUpdate ) object.matrix.decompose( object.position, object.quaternion, object.scale );
50680
+
50681
+ if ( object.matrixAutoUpdate ) {
50682
+
50683
+ object.matrix.decompose( object.position, object.quaternion, object.scale );
50684
+
50685
+ if ( object.pivot !== null ) object.position.copy( object.pivot ).applyMatrix4( object.matrix ).sub( object.pivot );
50686
+
50687
+ }
50130
50688
 
50131
50689
  } else {
50132
50690
 
@@ -50139,8 +50697,6 @@ class ObjectLoader extends Loader {
50139
50697
 
50140
50698
  if ( data.up !== undefined ) object.up.fromArray( data.up );
50141
50699
 
50142
- if ( data.pivot !== undefined ) object.pivot = new Vector3().fromArray( data.pivot );
50143
-
50144
50700
  if ( data.morphTargetDictionary !== undefined ) object.morphTargetDictionary = Object.assign( {}, data.morphTargetDictionary );
50145
50701
  if ( data.morphTargetInfluences !== undefined ) object.morphTargetInfluences = data.morphTargetInfluences.slice();
50146
50702
 
@@ -50157,6 +50713,7 @@ class ObjectLoader extends Loader {
50157
50713
  if ( data.shadow.focus !== undefined ) object.shadow.focus = data.shadow.focus;
50158
50714
  if ( data.shadow.aspect !== undefined ) object.shadow.aspect = data.shadow.aspect;
50159
50715
  if ( data.shadow.mapSize !== undefined ) object.shadow.mapSize.fromArray( data.shadow.mapSize );
50716
+ if ( data.shadow.mapType !== undefined ) object.shadow.mapType = data.shadow.mapType;
50160
50717
  if ( data.shadow.camera !== undefined ) object.shadow.camera = this.parseObject( data.shadow.camera );
50161
50718
 
50162
50719
  }
@@ -50278,8 +50835,7 @@ const TEXTURE_MAPPING = {
50278
50835
  CubeReflectionMapping: CubeReflectionMapping,
50279
50836
  CubeRefractionMapping: CubeRefractionMapping,
50280
50837
  EquirectangularReflectionMapping: EquirectangularReflectionMapping,
50281
- EquirectangularRefractionMapping: EquirectangularRefractionMapping,
50282
- CubeUVReflectionMapping: CubeUVReflectionMapping
50838
+ EquirectangularRefractionMapping: EquirectangularRefractionMapping
50283
50839
  };
50284
50840
 
50285
50841
  const TEXTURE_WRAPPING = {
@@ -50461,8 +51017,10 @@ class ImageBitmapLoader extends Loader {
50461
51017
  }
50462
51018
 
50463
51019
  const fetchOptions = {};
50464
- fetchOptions.credentials = ( this.crossOrigin === 'anonymous' ) ? 'same-origin' : 'include';
51020
+ fetchOptions.credentials = ( this.withCredentials || this.crossOrigin !== 'anonymous' ) ? 'include' : 'same-origin';
50465
51021
  fetchOptions.headers = this.requestHeader;
51022
+ fetchOptions.priority = this.priority;
51023
+ fetchOptions.cache = this.cache;
50466
51024
  fetchOptions.signal = ( typeof AbortSignal.any === 'function' ) ? AbortSignal.any( [ this._abortController.signal, this.manager.abortController.signal ] ) : this._abortController.signal;
50467
51025
 
50468
51026
  const promise = fetch( url, fetchOptions ).then( function ( res ) {
@@ -50600,6 +51158,8 @@ class AudioLoader extends Loader {
50600
51158
  const scope = this;
50601
51159
 
50602
51160
  const loader = new FileLoader( this.manager );
51161
+ loader.setPriority( this.priority );
51162
+ loader.setCache( this.cache );
50603
51163
  loader.setResponseType( 'arraybuffer' );
50604
51164
  loader.setPath( this.path );
50605
51165
  loader.setRequestHeader( this.requestHeader );
@@ -50998,9 +51558,9 @@ class CubeCamera extends Object3D {
50998
51558
 
50999
51559
  renderer.xr.enabled = false;
51000
51560
 
51001
- const generateMipmaps = renderTarget.texture.generateMipmaps;
51561
+ const mipmapsAutoUpdate = renderTarget.texture.mipmapsAutoUpdate;
51002
51562
 
51003
- renderTarget.texture.generateMipmaps = false;
51563
+ renderTarget.texture.mipmapsAutoUpdate = false;
51004
51564
 
51005
51565
  // https://github.com/mrdoob/three.js/issues/31413#issuecomment-3095966812
51006
51566
 
@@ -51039,7 +51599,7 @@ class CubeCamera extends Object3D {
51039
51599
  // mipmaps are generated during the last call of render()
51040
51600
  // at this point, all sides of the cube render target are defined
51041
51601
 
51042
- renderTarget.texture.generateMipmaps = generateMipmaps;
51602
+ renderTarget.texture.mipmapsAutoUpdate = mipmapsAutoUpdate;
51043
51603
 
51044
51604
  renderer.setRenderTarget( renderTarget, 5, activeMipmapLevel );
51045
51605
  if ( reversedDepthBuffer && renderer.autoClear === false ) renderer.clearDepth();
@@ -51102,6 +51662,18 @@ class ArrayCamera extends PerspectiveCamera {
51102
51662
  */
51103
51663
  this.cameras = array;
51104
51664
 
51665
+ /**
51666
+ * Whether 3D objects are frustum culled per sub camera or not.
51667
+ *
51668
+ * Since this requires an additional frustum test per sub camera, it should only be
51669
+ * enabled when the frustums of the sub cameras barely overlap. The property has
51670
+ * no effect with multiview rendering.
51671
+ *
51672
+ * @type {boolean}
51673
+ * @default false
51674
+ */
51675
+ this.perCameraFrustumCulled = false;
51676
+
51105
51677
  }
51106
51678
 
51107
51679
  }
@@ -54287,7 +54859,7 @@ class AnimationAction {
54287
54859
  * loop state).
54288
54860
  *
54289
54861
  * @type {number}
54290
- * @default Infinity
54862
+ * @default 0
54291
54863
  */
54292
54864
  this.time = 0;
54293
54865
 
@@ -56243,11 +56815,15 @@ class UniformsGroup extends EventDispatcher {
56243
56815
 
56244
56816
  for ( let i = 0, l = uniformsSource.length; i < l; i ++ ) {
56245
56817
 
56246
- const uniforms = Array.isArray( uniformsSource[ i ] ) ? uniformsSource[ i ] : [ uniformsSource[ i ] ];
56818
+ const uniform = uniformsSource[ i ];
56247
56819
 
56248
- for ( let j = 0; j < uniforms.length; j ++ ) {
56820
+ if ( Array.isArray( uniform ) ) {
56249
56821
 
56250
- this.uniforms.push( uniforms[ j ].clone() );
56822
+ this.uniforms.push( uniform.map( ( u ) => u.clone() ) );
56823
+
56824
+ } else {
56825
+
56826
+ this.uniforms.push( uniform.clone() );
56251
56827
 
56252
56828
  }
56253
56829
 
@@ -56678,6 +57254,8 @@ class Raycaster {
56678
57254
  * @property {Vector3} normal - Interpolated normal vector at point of intersection.
56679
57255
  * @property {number} instanceId - The index number of the instance where the ray
56680
57256
  * intersects the {@link InstancedMesh}.
57257
+ * @property {number} batchId - The index number of the instance where the ray
57258
+ * intersects the {@link BatchedMesh}.
56681
57259
  */
56682
57260
 
56683
57261
  /**
@@ -56825,7 +57403,7 @@ class Clock {
56825
57403
  * Whether the clock is running or not.
56826
57404
  *
56827
57405
  * @type {boolean}
56828
- * @default true
57406
+ * @default false
56829
57407
  */
56830
57408
  this.running = false;
56831
57409
 
@@ -57203,7 +57781,7 @@ class Matrix2 {
57203
57781
  * @readonly
57204
57782
  * @default true
57205
57783
  */
57206
- Matrix2.prototype.isMatrix2 = true;
57784
+ this.prototype.isMatrix2 = true;
57207
57785
 
57208
57786
  }
57209
57787
 
@@ -57793,7 +58371,7 @@ class Line3 {
57793
58371
  *
57794
58372
  * @param {number} t - A value between `[0,1]` to represent a position along the line segment.
57795
58373
  * @param {Vector3} target - The target vector that is used to store the method's result.
57796
- * @return {Vector3} The delta vector.
58374
+ * @return {Vector3} The point along the line segment.
57797
58375
  */
57798
58376
  at( t, target ) {
57799
58377
 
@@ -57888,9 +58466,7 @@ class Line3 {
57888
58466
  c1.copy( p1 );
57889
58467
  c2.copy( p2 );
57890
58468
 
57891
- c1.sub( c2 );
57892
-
57893
- return c1.dot( c1 );
58469
+ return c1.distanceToSquared( c2 );
57894
58470
 
57895
58471
  }
57896
58472
 
@@ -58671,7 +59247,7 @@ class PolarGridHelper extends LineSegments {
58671
59247
  *
58672
59248
  * @param {number} [radius=10] - The radius of the polar grid. This can be any positive number.
58673
59249
  * @param {number} [sectors=16] - The number of sectors the grid will be divided into. This can be any positive integer.
58674
- * @param {number} [rings=16] - The number of rings. This can be any positive integer.
59250
+ * @param {number} [rings=8] - The number of rings. This can be any positive integer.
58675
59251
  * @param {number} [divisions=64] - The number of line segments used for each circle. This can be any positive integer.
58676
59252
  * @param {number|Color|string} [color1=0x444444] - The first color used for grid elements.
58677
59253
  * @param {number|Color|string} [color2=0x888888] - The second color used for grid elements.
@@ -59836,7 +60412,7 @@ class ShapePath {
59836
60412
  * The paths that have been generated for this shape.
59837
60413
  *
59838
60414
  * @type {Array<Path>}
59839
- * @default null
60415
+ * @default []
59840
60416
  */
59841
60417
  this.subPaths = [];
59842
60418
 
@@ -60568,7 +61144,7 @@ class TextureUtils {
60568
61144
  *
60569
61145
  * @type {number}
60570
61146
  */
60571
- const UPE_REVISION = 10;
61147
+ const UPE_REVISION = 11;
60572
61148
 
60573
61149
  /**
60574
61150
  * The build's name: `r<three.js revision>p<our revision>`, such as `r186p10`.
@@ -60599,4 +61175,4 @@ if ( typeof window !== 'undefined' ) {
60599
61175
 
60600
61176
  }
60601
61177
 
60602
- export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, BezierInterpolant, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, Compatibility, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, Controls, CubeCamera, CubeDepthTexture, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubeUVReflectionMapping, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExternalTexture, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, FrustumArray, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HTMLTexture, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateBezier, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolationSamplingMode, InterpolationSamplingType, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, LightShadow, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialBlending, MaterialLoader, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoNormalPacking, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NormalGAPacking, NormalRGPacking, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, R11_EAC_Format, RAD2DEG, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RG11_EAC_Format, 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, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderObjectRefreshType, RenderTarget, RenderTarget3D, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, ReversedDepthFuncs, RingGeometry, SIGNED_R11_EAC_Format, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SIGNED_RG11_EAC_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TextureSource, TextureUtils, Timer, TimestampQuery, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UPE_RENDERER, UPE_REVISION, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsUtils, UnsignedByteType, UnsignedInt101111Type, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLRenderTarget, WebGPUCoordinateSystem, WebXRController, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, cloneUniforms, createCanvasElement, createElementNS, error, getByteLength, getConsoleFunction, getUnlitUniformColorSpace, isTypedArray, log, mergeUniforms, probeAsync, setConsoleFunction, warn, warnOnce, yieldToMain };
61178
+ export { ACESFilmicToneMapping, AddEquation, AddOperation, AdditiveAnimationBlendMode, AdditiveBlending, AgXToneMapping, AlphaFormat, AlwaysCompare, AlwaysDepth, AlwaysStencilFunc, AmbientLight, AnimationAction, AnimationClip, AnimationLoader, AnimationMixer, AnimationObjectGroup, AnimationUtils, ArcCurve, ArrayCamera, ArrowHelper, AttachedBindMode, Audio, AudioAnalyser, AudioContext, AudioListener, AudioLoader, AxesHelper, BackSide, BasicDepthPacking, BasicShadowMap, BatchedMesh, BezierInterpolant, Bone, BooleanKeyframeTrack, Box2, Box3, Box3Helper, BoxGeometry, BoxHelper, BufferAttribute, BufferGeometry, BufferGeometryLoader, ByteType, Cache, Camera, CameraHelper, CanvasTexture, CapsuleGeometry, CatmullRomCurve3, CineonToneMapping, CircleGeometry, ClampToEdgeWrapping, Clock, Color, ColorKeyframeTrack, ColorManagement, Compatibility, CompressedArrayTexture, CompressedCubeTexture, CompressedTexture, CompressedTextureLoader, ConeGeometry, ConstantAlphaFactor, ConstantColorFactor, Controls, CubeCamera, CubeDepthTexture, CubeReflectionMapping, CubeRefractionMapping, CubeTexture, CubeTextureLoader, CubicBezierCurve, CubicBezierCurve3, CubicInterpolant, CullFaceBack, CullFaceFront, CullFaceFrontBack, CullFaceNone, Curve, CurvePath, CustomBlending, CustomToneMapping, CylinderGeometry, Cylindrical, Data3DTexture, DataArrayTexture, DataTexture, DataTextureLoader, DataUtils, DecrementStencilOp, DecrementWrapStencilOp, DefaultLoadingManager, DepthFormat, DepthStencilFormat, DepthTexture, DetachedBindMode, DirectionalLight, DirectionalLightHelper, DiscreteInterpolant, DodecahedronGeometry, DoubleSide, DstAlphaFactor, DstColorFactor, DynamicCopyUsage, DynamicDrawUsage, DynamicReadUsage, EdgesGeometry, EllipseCurve, EqualCompare, EqualDepth, EqualStencilFunc, EquirectangularReflectionMapping, EquirectangularRefractionMapping, Euler, EventDispatcher, ExternalTexture, ExtrudeGeometry, FileLoader, Float16BufferAttribute, Float32BufferAttribute, FloatType, Fog, FogExp2, FramebufferTexture, FrontSide, Frustum, FrustumArray, GLBufferAttribute, GLSL1, GLSL3, GreaterCompare, GreaterDepth, GreaterEqualCompare, GreaterEqualDepth, GreaterEqualStencilFunc, GreaterStencilFunc, GridHelper, Group, HTMLTexture, HalfFloatType, HemisphereLight, HemisphereLightHelper, IcosahedronGeometry, ImageBitmapLoader, ImageLoader, ImageUtils, IncrementStencilOp, IncrementWrapStencilOp, InstancedBufferAttribute, InstancedBufferGeometry, InstancedInterleavedBuffer, InstancedMesh, Int16BufferAttribute, Int32BufferAttribute, Int8BufferAttribute, IntType, InterleavedBuffer, InterleavedBufferAttribute, Interpolant, InterpolateBezier, InterpolateDiscrete, InterpolateLinear, InterpolateSmooth, InterpolationSamplingMode, InterpolationSamplingType, InvertStencilOp, KeepStencilOp, KeyframeTrack, LOD, LatheGeometry, Layers, LessCompare, LessDepth, LessEqualCompare, LessEqualDepth, LessEqualStencilFunc, LessStencilFunc, Light, LightProbe, LightShadow, Line, Line3, LineBasicMaterial, LineCurve, LineCurve3, LineDashedMaterial, LineLoop, LineSegments, LinearFilter, LinearInterpolant, LinearMipMapLinearFilter, LinearMipMapNearestFilter, LinearMipmapLinearFilter, LinearMipmapNearestFilter, LinearSRGBColorSpace, LinearToneMapping, LinearTransfer, Loader, LoaderUtils, LoadingManager, LoopOnce, LoopPingPong, LoopRepeat, MOUSE, Material, MaterialBlending, MaterialLoader, MathUtils, Matrix2, Matrix3, Matrix4, MaxEquation, Mesh, MeshBasicMaterial, MeshDepthMaterial, MeshDistanceMaterial, MeshLambertMaterial, MeshMatcapMaterial, MeshNormalMaterial, MeshPhongMaterial, MeshPhysicalMaterial, MeshStandardMaterial, MeshToonMaterial, MinEquation, MirroredRepeatWrapping, MixOperation, MultiplyBlending, MultiplyOperation, NearestFilter, NearestMipMapLinearFilter, NearestMipMapNearestFilter, NearestMipmapLinearFilter, NearestMipmapNearestFilter, NeutralToneMapping, NeverCompare, NeverDepth, NeverStencilFunc, NoBlending, NoColorSpace, NoNormalPacking, NoToneMapping, NormalAnimationBlendMode, NormalBlending, NormalGAPacking, NormalRGPacking, NotEqualCompare, NotEqualDepth, NotEqualStencilFunc, NumberKeyframeTrack, Object3D, ObjectLoader, ObjectSpaceNormalMap, OctahedronGeometry, OneFactor, OneMinusConstantAlphaFactor, OneMinusConstantColorFactor, OneMinusDstAlphaFactor, OneMinusDstColorFactor, OneMinusSrcAlphaFactor, OneMinusSrcColorFactor, OrthographicCamera, PCFShadowMap, PCFSoftShadowMap, Path, PerspectiveCamera, Plane, PlaneGeometry, PlaneHelper, PointLight, PointLightHelper, Points, PointsMaterial, PolarGridHelper, PolyhedronGeometry, PositionalAudio, PropertyBinding, PropertyMixer, QuadraticBezierCurve, QuadraticBezierCurve3, Quaternion, QuaternionKeyframeTrack, QuaternionLinearInterpolant, R11_EAC_Format, RAD2DEG, RED_GREEN_RGTC2_Format, RED_RGTC1_Format, REVISION, RG11_EAC_Format, 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, RGBDepthPacking, RGBFormat, RGBIntegerFormat, RGB_BPTC_SIGNED_Format, RGB_BPTC_UNSIGNED_Format, RGB_ETC1_Format, RGB_ETC2_Format, RGB_PVRTC_2BPPV1_Format, RGB_PVRTC_4BPPV1_Format, RGB_S3TC_DXT1_Format, RGDepthPacking, RGFormat, RGIntegerFormat, RawShaderMaterial, Ray, Raycaster, RectAreaLight, RedFormat, RedIntegerFormat, ReinhardToneMapping, RenderObjectRefreshType, RenderTarget, RenderTarget3D, RepeatWrapping, ReplaceStencilOp, ReverseSubtractEquation, ReversedDepthFuncs, RingGeometry, SIGNED_R11_EAC_Format, SIGNED_RED_GREEN_RGTC2_Format, SIGNED_RED_RGTC1_Format, SIGNED_RG11_EAC_Format, SRGBColorSpace, SRGBTransfer, Scene, ShaderMaterial, ShadowMaterial, Shape, ShapeGeometry, ShapePath, ShapeUtils, ShortType, Skeleton, SkeletonHelper, SkinnedMesh, Source, Sphere, SphereGeometry, Spherical, SphericalHarmonics3, SplineCurve, SpotLight, SpotLightHelper, Sprite, SpriteMaterial, SrcAlphaFactor, SrcAlphaSaturateFactor, SrcColorFactor, StaticCopyUsage, StaticDrawUsage, StaticReadUsage, StereoCamera, StreamCopyUsage, StreamDrawUsage, StreamReadUsage, StringKeyframeTrack, SubtractEquation, SubtractiveBlending, TOUCH, TangentSpaceNormalMap, TetrahedronGeometry, Texture, TextureLoader, TextureSource, TextureUtils, Timer, TimestampQuery, TorusGeometry, TorusKnotGeometry, Triangle, TriangleFanDrawMode, TriangleStripDrawMode, TrianglesDrawMode, TubeGeometry, UPE_RENDERER, UPE_REVISION, UVMapping, Uint16BufferAttribute, Uint32BufferAttribute, Uint8BufferAttribute, Uint8ClampedBufferAttribute, Uniform, UniformsGroup, UniformsUtils, UnsignedByteType, UnsignedInt101111Type, UnsignedInt248Type, UnsignedInt5999Type, UnsignedIntType, UnsignedShort4444Type, UnsignedShort5551Type, UnsignedShortType, VSMShadowMap, Vector2, Vector3, Vector4, VectorKeyframeTrack, VideoFrameTexture, VideoTexture, WebGL3DRenderTarget, WebGLArrayRenderTarget, WebGLCoordinateSystem, WebGLRenderTarget, WebGPUCoordinateSystem, WebXRController, WireframeGeometry, WrapAroundEnding, ZeroCurvatureEnding, ZeroFactor, ZeroSlopeEnding, ZeroStencilOp, cloneUniforms, createCanvasElement, createElementNS, error, floorPowerOfTwo, generateUUID, getByteLength, getConsoleFunction, getUnlitUniformColorSpace, isTypedArray, log, mergeUniforms, probeAsync, setConsoleFunction, warn, warnOnce, yieldToMain };