@plastic-software/three 0.180.0 → 0.181.1

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 (357) hide show
  1. package/build/three.cjs +943 -486
  2. package/build/three.core.js +506 -327
  3. package/build/three.core.min.js +1 -1
  4. package/build/three.module.js +435 -163
  5. package/build/three.module.min.js +1 -1
  6. package/build/three.tsl.js +8 -2
  7. package/build/three.tsl.min.js +1 -1
  8. package/build/three.webgpu.js +3753 -1177
  9. package/build/three.webgpu.min.js +1 -1
  10. package/build/three.webgpu.nodes.js +3752 -1176
  11. package/build/three.webgpu.nodes.min.js +1 -1
  12. package/examples/fonts/MPLUSRounded1c/MPLUSRounded1c-Regular.typeface.json.zip +0 -0
  13. package/examples/fonts/MPLUSRounded1c/OFL.txt +91 -0
  14. package/examples/jsm/animation/CCDIKSolver.js +1 -1
  15. package/examples/jsm/controls/ArcballControls.js +1 -1
  16. package/examples/jsm/controls/DragControls.js +1 -1
  17. package/examples/jsm/controls/FirstPersonControls.js +1 -1
  18. package/examples/jsm/controls/FlyControls.js +1 -1
  19. package/examples/jsm/controls/OrbitControls.js +2 -2
  20. package/examples/jsm/controls/PointerLockControls.js +2 -2
  21. package/examples/jsm/controls/TrackballControls.js +1 -1
  22. package/examples/jsm/controls/TransformControls.js +1 -1
  23. package/examples/jsm/effects/AsciiEffect.js +8 -8
  24. package/examples/jsm/exporters/DRACOExporter.js +2 -2
  25. package/examples/jsm/exporters/EXRExporter.js +1 -1
  26. package/examples/jsm/exporters/GLTFExporter.js +3 -3
  27. package/examples/jsm/exporters/USDZExporter.js +9 -2
  28. package/examples/jsm/geometries/DecalGeometry.js +2 -2
  29. package/examples/jsm/geometries/ParametricGeometry.js +1 -1
  30. package/examples/jsm/geometries/TeapotGeometry.js +2 -2
  31. package/examples/jsm/geometries/TextGeometry.js +3 -2
  32. package/examples/jsm/gpgpu/BitonicSort.js +715 -0
  33. package/examples/jsm/helpers/ViewHelper.js +43 -5
  34. package/examples/jsm/inspector/Inspector.js +427 -0
  35. package/examples/jsm/inspector/RendererInspector.js +415 -0
  36. package/examples/jsm/inspector/tabs/Console.js +204 -0
  37. package/examples/jsm/inspector/tabs/Parameters.js +332 -0
  38. package/examples/jsm/inspector/tabs/Performance.js +268 -0
  39. package/examples/jsm/inspector/tabs/Viewer.js +166 -0
  40. package/examples/jsm/inspector/ui/Graph.js +95 -0
  41. package/examples/jsm/inspector/ui/Item.js +170 -0
  42. package/examples/jsm/inspector/ui/List.js +75 -0
  43. package/examples/jsm/inspector/ui/Profiler.js +170 -0
  44. package/examples/jsm/inspector/ui/Style.js +654 -0
  45. package/examples/jsm/inspector/ui/Tab.js +46 -0
  46. package/examples/jsm/inspector/ui/Values.js +423 -0
  47. package/examples/jsm/inspector/ui/utils.js +56 -0
  48. package/examples/jsm/interactive/HTMLMesh.js +6 -10
  49. package/examples/jsm/interactive/InteractiveGroup.js +1 -1
  50. package/examples/jsm/interactive/SelectionBox.js +30 -0
  51. package/examples/jsm/lights/RectAreaLightTexturesLib.js +1 -1
  52. package/examples/jsm/loaders/3MFLoader.js +1 -1
  53. package/examples/jsm/loaders/ColladaLoader.js +2 -2
  54. package/examples/jsm/loaders/DDSLoader.js +1 -1
  55. package/examples/jsm/loaders/DRACOLoader.js +73 -22
  56. package/examples/jsm/loaders/FBXLoader.js +2 -2
  57. package/examples/jsm/loaders/FontLoader.js +23 -5
  58. package/examples/jsm/loaders/GLTFLoader.js +5 -3
  59. package/examples/jsm/loaders/KTX2Loader.js +28 -21
  60. package/examples/jsm/loaders/KTXLoader.js +2 -2
  61. package/examples/jsm/loaders/LDrawLoader.js +1 -1
  62. package/examples/jsm/loaders/LUT3dlLoader.js +2 -2
  63. package/examples/jsm/loaders/LUTCubeLoader.js +1 -1
  64. package/examples/jsm/loaders/LWOLoader.js +2 -2
  65. package/examples/jsm/loaders/MaterialXLoader.js +22 -5
  66. package/examples/jsm/loaders/OBJLoader.js +1 -1
  67. package/examples/jsm/loaders/PDBLoader.js +1 -1
  68. package/examples/jsm/loaders/SVGLoader.js +2 -2
  69. package/examples/jsm/loaders/UltraHDRLoader.js +1 -1
  70. package/examples/jsm/math/ConvexHull.js +1 -1
  71. package/examples/jsm/math/ImprovedNoise.js +1 -1
  72. package/examples/jsm/math/SimplexNoise.js +1 -1
  73. package/examples/jsm/misc/ProgressiveLightMap.js +9 -3
  74. package/examples/jsm/misc/ProgressiveLightMapGPU.js +7 -1
  75. package/examples/jsm/misc/TubePainter.js +383 -40
  76. package/examples/jsm/modifiers/SimplifyModifier.js +1 -1
  77. package/examples/jsm/objects/ReflectorForSSRPass.js +1 -0
  78. package/examples/jsm/objects/Sky.js +1 -1
  79. package/examples/jsm/objects/SkyMesh.js +1 -1
  80. package/examples/jsm/objects/Water.js +3 -3
  81. package/examples/jsm/objects/WaterMesh.js +6 -6
  82. package/examples/jsm/postprocessing/GlitchPass.js +2 -2
  83. package/examples/jsm/postprocessing/UnrealBloomPass.js +8 -6
  84. package/examples/jsm/renderers/CSS2DRenderer.js +16 -5
  85. package/examples/jsm/renderers/CSS3DRenderer.js +7 -6
  86. package/examples/jsm/renderers/SVGRenderer.js +1 -1
  87. package/examples/jsm/shaders/ACESFilmicToneMappingShader.js +1 -1
  88. package/examples/jsm/shaders/AfterimageShader.js +1 -1
  89. package/examples/jsm/shaders/BleachBypassShader.js +1 -1
  90. package/examples/jsm/shaders/BokehShader.js +1 -1
  91. package/examples/jsm/shaders/BokehShader2.js +1 -1
  92. package/examples/jsm/shaders/DotScreenShader.js +1 -1
  93. package/examples/jsm/shaders/FocusShader.js +1 -1
  94. package/examples/jsm/shaders/GTAOShader.js +2 -2
  95. package/examples/jsm/shaders/GodRaysShader.js +1 -1
  96. package/examples/jsm/shaders/KaleidoShader.js +1 -1
  97. package/examples/jsm/shaders/PoissonDenoiseShader.js +2 -2
  98. package/examples/jsm/shaders/SSRShader.js +1 -1
  99. package/examples/jsm/shaders/SepiaShader.js +1 -1
  100. package/examples/jsm/shaders/SubsurfaceScatteringShader.js +1 -1
  101. package/examples/jsm/shaders/TriangleBlurShader.js +1 -1
  102. package/examples/jsm/shaders/VignetteShader.js +1 -1
  103. package/examples/jsm/transpiler/TSLEncoder.js +7 -0
  104. package/examples/jsm/tsl/display/AfterImageNode.js +26 -24
  105. package/examples/jsm/tsl/display/AnamorphicNode.js +2 -1
  106. package/examples/jsm/tsl/display/BloomNode.js +4 -0
  107. package/examples/jsm/tsl/display/DenoiseNode.js +2 -0
  108. package/examples/jsm/tsl/display/DepthOfFieldNode.js +7 -0
  109. package/examples/jsm/tsl/display/GTAONode.js +45 -5
  110. package/examples/jsm/tsl/display/GaussianBlurNode.js +5 -3
  111. package/examples/jsm/tsl/display/OutlineNode.js +11 -0
  112. package/examples/jsm/tsl/display/SSGINode.js +654 -0
  113. package/examples/jsm/tsl/display/SSRNode.js +2 -0
  114. package/examples/jsm/tsl/display/SSSNode.js +488 -0
  115. package/examples/jsm/tsl/display/TRAANode.js +123 -6
  116. package/examples/jsm/tsl/display/boxBlur.js +1 -0
  117. package/examples/jsm/tsl/display/hashBlur.js +1 -0
  118. package/examples/jsm/tsl/lighting/TiledLightsNode.js +21 -1
  119. package/examples/jsm/webxr/XRControllerModelFactory.js +1 -1
  120. package/examples/jsm/webxr/XRHandModelFactory.js +2 -6
  121. package/package.json +5 -10
  122. package/src/Three.Core.js +3 -2
  123. package/src/Three.TSL.js +7 -1
  124. package/src/Three.WebGPU.Nodes.js +2 -0
  125. package/src/Three.WebGPU.js +2 -0
  126. package/src/animation/AnimationClip.js +3 -2
  127. package/src/animation/AnimationMixer.js +3 -3
  128. package/src/animation/AnimationObjectGroup.js +2 -1
  129. package/src/animation/KeyframeTrack.js +7 -6
  130. package/src/animation/PropertyBinding.js +12 -11
  131. package/src/audio/Audio.js +10 -9
  132. package/src/audio/PositionalAudio.js +1 -1
  133. package/src/cameras/OrthographicCamera.js +1 -1
  134. package/src/cameras/PerspectiveCamera.js +1 -1
  135. package/src/cameras/StereoCamera.js +2 -2
  136. package/src/constants.js +1 -1
  137. package/src/core/BufferGeometry.js +8 -8
  138. package/src/core/EventDispatcher.js +1 -1
  139. package/src/core/InterleavedBuffer.js +1 -1
  140. package/src/core/InterleavedBufferAttribute.js +3 -2
  141. package/src/core/Object3D.js +3 -2
  142. package/src/core/Raycaster.js +2 -1
  143. package/src/core/RenderTarget.js +10 -1
  144. package/src/extras/Controls.js +5 -4
  145. package/src/extras/DataUtils.js +2 -1
  146. package/src/extras/Earcut.js +6 -0
  147. package/src/extras/ImageUtils.js +2 -2
  148. package/src/extras/PMREMGenerator.js +268 -55
  149. package/src/extras/core/Curve.js +2 -1
  150. package/src/extras/core/Interpolations.js +7 -1
  151. package/src/extras/core/ShapePath.js +4 -4
  152. package/src/extras/lib/earcut.js +7 -7
  153. package/src/geometries/BoxGeometry.js +1 -0
  154. package/src/geometries/CapsuleGeometry.js +1 -0
  155. package/src/geometries/CircleGeometry.js +1 -0
  156. package/src/geometries/ConeGeometry.js +1 -0
  157. package/src/geometries/CylinderGeometry.js +1 -0
  158. package/src/geometries/DodecahedronGeometry.js +1 -0
  159. package/src/geometries/ExtrudeGeometry.js +8 -6
  160. package/src/geometries/IcosahedronGeometry.js +1 -0
  161. package/src/geometries/LatheGeometry.js +1 -0
  162. package/src/geometries/OctahedronGeometry.js +1 -0
  163. package/src/geometries/PlaneGeometry.js +1 -0
  164. package/src/geometries/RingGeometry.js +1 -0
  165. package/src/geometries/ShapeGeometry.js +1 -0
  166. package/src/geometries/SphereGeometry.js +1 -0
  167. package/src/geometries/TetrahedronGeometry.js +1 -0
  168. package/src/geometries/TorusGeometry.js +1 -0
  169. package/src/geometries/TorusKnotGeometry.js +1 -0
  170. package/src/geometries/TubeGeometry.js +1 -0
  171. package/src/helpers/CameraHelper.js +1 -1
  172. package/src/loaders/AnimationLoader.js +2 -1
  173. package/src/loaders/AudioLoader.js +2 -1
  174. package/src/loaders/BufferGeometryLoader.js +2 -2
  175. package/src/loaders/Cache.js +2 -2
  176. package/src/loaders/DataTextureLoader.js +1 -1
  177. package/src/loaders/FileLoader.js +3 -2
  178. package/src/loaders/ImageBitmapLoader.js +5 -4
  179. package/src/loaders/ImageLoader.js +1 -1
  180. package/src/loaders/Loader.js +3 -3
  181. package/src/loaders/LoadingManager.js +25 -3
  182. package/src/loaders/MaterialLoader.js +3 -2
  183. package/src/loaders/ObjectLoader.js +13 -13
  184. package/src/loaders/TextureLoader.js +1 -1
  185. package/src/loaders/nodes/NodeLoader.js +3 -2
  186. package/src/materials/Material.js +4 -3
  187. package/src/materials/MeshBasicMaterial.js +1 -0
  188. package/src/materials/MeshDepthMaterial.js +1 -0
  189. package/src/materials/MeshLambertMaterial.js +2 -1
  190. package/src/materials/MeshMatcapMaterial.js +22 -0
  191. package/src/materials/MeshNormalMaterial.js +1 -0
  192. package/src/materials/MeshPhongMaterial.js +2 -1
  193. package/src/materials/MeshPhysicalMaterial.js +2 -1
  194. package/src/materials/MeshStandardMaterial.js +8 -7
  195. package/src/materials/MeshToonMaterial.js +1 -0
  196. package/src/materials/PointsMaterial.js +1 -1
  197. package/src/materials/ShaderMaterial.js +2 -2
  198. package/src/materials/nodes/Line2NodeMaterial.js +2 -2
  199. package/src/materials/nodes/MeshSSSNodeMaterial.js +1 -1
  200. package/src/materials/nodes/NodeMaterial.js +62 -22
  201. package/src/materials/nodes/manager/NodeMaterialObserver.js +2 -1
  202. package/src/math/Color.js +6 -5
  203. package/src/math/ColorManagement.js +2 -2
  204. package/src/math/Cylindrical.js +1 -1
  205. package/src/math/Euler.js +2 -1
  206. package/src/math/MathUtils.js +13 -11
  207. package/src/math/Matrix2.js +1 -1
  208. package/src/math/Matrix3.js +2 -2
  209. package/src/math/Matrix4.js +7 -7
  210. package/src/math/Plane.js +1 -1
  211. package/src/math/Quaternion.js +68 -66
  212. package/src/math/Spherical.js +1 -1
  213. package/src/nodes/Nodes.js +1 -1
  214. package/src/nodes/TSL.js +1 -1
  215. package/src/nodes/accessors/CubeTextureNode.js +3 -2
  216. package/src/nodes/accessors/InstanceNode.js +22 -4
  217. package/src/nodes/accessors/Lights.js +10 -0
  218. package/src/nodes/accessors/Normal.js +5 -4
  219. package/src/nodes/accessors/Position.js +18 -2
  220. package/src/nodes/accessors/ReferenceNode.js +2 -1
  221. package/src/nodes/accessors/SceneNode.js +2 -1
  222. package/src/nodes/accessors/StorageBufferNode.js +2 -1
  223. package/src/nodes/accessors/StorageTextureNode.js +22 -0
  224. package/src/nodes/accessors/Texture3DNode.js +1 -1
  225. package/src/nodes/accessors/TextureNode.js +61 -27
  226. package/src/nodes/code/FunctionCallNode.js +5 -4
  227. package/src/nodes/core/ArrayNode.js +1 -0
  228. package/src/nodes/core/AttributeNode.js +2 -1
  229. package/src/nodes/core/ContextNode.js +5 -10
  230. package/src/nodes/core/IndexNode.js +2 -2
  231. package/src/nodes/core/InputNode.js +2 -1
  232. package/src/nodes/core/InspectorNode.js +128 -0
  233. package/src/nodes/core/{CacheNode.js → IsolateNode.js} +40 -7
  234. package/src/nodes/core/Node.js +137 -12
  235. package/src/nodes/core/NodeBuilder.js +135 -21
  236. package/src/nodes/core/NodeFrame.js +20 -20
  237. package/src/nodes/core/NodeFunction.js +2 -1
  238. package/src/nodes/core/NodeParser.js +2 -1
  239. package/src/nodes/core/NodeUtils.js +17 -90
  240. package/src/nodes/core/ParameterNode.js +31 -0
  241. package/src/nodes/core/PropertyNode.js +7 -0
  242. package/src/nodes/core/StackNode.js +16 -14
  243. package/src/nodes/core/UniformNode.js +2 -1
  244. package/src/nodes/core/VarNode.js +70 -12
  245. package/src/nodes/core/VaryingNode.js +3 -2
  246. package/src/nodes/display/BlendModes.js +5 -4
  247. package/src/nodes/display/BumpMapNode.js +1 -1
  248. package/src/nodes/display/ColorAdjustment.js +1 -1
  249. package/src/nodes/display/NormalMapNode.js +2 -1
  250. package/src/nodes/display/PassNode.js +51 -10
  251. package/src/nodes/display/RenderOutputNode.js +28 -2
  252. package/src/nodes/display/ScreenNode.js +2 -1
  253. package/src/nodes/display/ToneMappingNode.js +31 -4
  254. package/src/nodes/display/ToonOutlinePassNode.js +8 -0
  255. package/src/nodes/fog/Fog.js +3 -2
  256. package/src/nodes/functions/BSDF/BRDF_GGX_Multiscatter.js +52 -0
  257. package/src/nodes/functions/BSDF/DFGApprox.js +60 -19
  258. package/src/nodes/functions/BasicLightingModel.js +2 -1
  259. package/src/nodes/functions/PhysicalLightingModel.js +3 -2
  260. package/src/nodes/functions/VolumetricLightingModel.js +5 -5
  261. package/src/nodes/geometry/RangeNode.js +40 -4
  262. package/src/nodes/gpgpu/ComputeBuiltinNode.js +2 -1
  263. package/src/nodes/gpgpu/ComputeNode.js +17 -5
  264. package/src/nodes/gpgpu/SubgroupFunctionNode.js +25 -0
  265. package/src/nodes/gpgpu/WorkgroupInfoNode.js +2 -1
  266. package/src/nodes/lighting/EnvironmentNode.js +6 -6
  267. package/src/nodes/lighting/LightsNode.js +2 -3
  268. package/src/nodes/lighting/PointShadowNode.js +6 -0
  269. package/src/nodes/lighting/ShadowFilterNode.js +2 -0
  270. package/src/nodes/lighting/ShadowNode.js +75 -8
  271. package/src/nodes/math/ConditionalNode.js +6 -5
  272. package/src/nodes/math/MathNode.js +22 -4
  273. package/src/nodes/math/OperatorNode.js +3 -2
  274. package/src/nodes/pmrem/PMREMUtils.js +117 -2
  275. package/src/nodes/shapes/Shapes.js +1 -1
  276. package/src/nodes/tsl/TSLBase.js +5 -2
  277. package/src/nodes/tsl/TSLCore.js +36 -15
  278. package/src/nodes/utils/DebugNode.js +2 -1
  279. package/src/nodes/utils/EventNode.js +36 -0
  280. package/src/nodes/utils/FunctionOverloadingNode.js +37 -19
  281. package/src/nodes/utils/JoinNode.js +3 -2
  282. package/src/nodes/utils/LoopNode.js +20 -24
  283. package/src/nodes/utils/MemberNode.js +2 -1
  284. package/src/nodes/utils/PostProcessingUtils.js +28 -1
  285. package/src/nodes/utils/RTTNode.js +12 -2
  286. package/src/nodes/utils/ReflectorNode.js +10 -3
  287. package/src/objects/Line.js +2 -1
  288. package/src/objects/LineSegments.js +2 -1
  289. package/src/objects/Skeleton.js +3 -2
  290. package/src/objects/SkinnedMesh.js +3 -1
  291. package/src/objects/Sprite.js +2 -1
  292. package/src/renderers/WebGLRenderer.js +48 -32
  293. package/src/renderers/common/Animation.js +13 -1
  294. package/src/renderers/common/Backend.js +93 -30
  295. package/src/renderers/common/Background.js +2 -1
  296. package/src/renderers/common/Bindings.js +56 -2
  297. package/src/renderers/common/CanvasTarget.js +341 -0
  298. package/src/renderers/common/Geometries.js +26 -0
  299. package/src/renderers/common/Info.js +4 -2
  300. package/src/renderers/common/InspectorBase.js +146 -0
  301. package/src/renderers/common/PostProcessing.js +6 -25
  302. package/src/renderers/common/QuadMesh.js +7 -1
  303. package/src/renderers/common/RenderList.js +7 -3
  304. package/src/renderers/common/RenderObject.js +3 -1
  305. package/src/renderers/common/RenderObjects.js +1 -1
  306. package/src/renderers/common/Renderer.js +436 -228
  307. package/src/renderers/common/RendererUtils.js +9 -0
  308. package/src/renderers/common/SampledTexture.js +8 -0
  309. package/src/renderers/common/Sampler.js +37 -11
  310. package/src/renderers/common/StorageTexture.js +9 -1
  311. package/src/renderers/common/Textures.js +89 -35
  312. package/src/renderers/common/TimestampQueryPool.js +63 -1
  313. package/src/renderers/common/UniformsGroup.js +2 -1
  314. package/src/renderers/common/XRManager.js +7 -3
  315. package/src/renderers/common/extras/PMREMGenerator.js +160 -65
  316. package/src/renderers/common/nodes/NodeLibrary.js +4 -2
  317. package/src/renderers/common/nodes/NodeSampler.js +13 -1
  318. package/src/renderers/common/nodes/Nodes.js +38 -16
  319. package/src/renderers/shaders/DFGLUTData.js +64 -0
  320. package/src/renderers/shaders/ShaderChunk/common.glsl.js +0 -12
  321. package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +1 -1
  322. package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +1 -1
  323. package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +52 -18
  324. package/src/renderers/shaders/UniformsLib.js +1 -0
  325. package/src/renderers/shaders/UniformsUtils.js +25 -4
  326. package/src/renderers/webgl/WebGLCapabilities.js +2 -1
  327. package/src/renderers/webgl/WebGLExtensions.js +2 -25
  328. package/src/renderers/webgl/WebGLInfo.js +3 -1
  329. package/src/renderers/webgl/WebGLProgram.js +11 -10
  330. package/src/renderers/webgl/WebGLPrograms.js +2 -1
  331. package/src/renderers/webgl/WebGLShadowMap.js +2 -1
  332. package/src/renderers/webgl/WebGLState.js +15 -14
  333. package/src/renderers/webgl/WebGLTextures.js +18 -14
  334. package/src/renderers/webgl/WebGLUniformsGroups.js +5 -3
  335. package/src/renderers/webgl-fallback/WebGLBackend.js +22 -41
  336. package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +74 -11
  337. package/src/renderers/webgl-fallback/utils/WebGLConstants.js +2 -3
  338. package/src/renderers/webgl-fallback/utils/WebGLState.js +6 -5
  339. package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +117 -16
  340. package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +42 -12
  341. package/src/renderers/webgpu/WebGPUBackend.js +134 -108
  342. package/src/renderers/webgpu/WebGPURenderer.Nodes.js +2 -1
  343. package/src/renderers/webgpu/WebGPURenderer.js +3 -2
  344. package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +21 -19
  345. package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +2 -1
  346. package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +5 -3
  347. package/src/renderers/webgpu/utils/WebGPUConstants.js +5 -0
  348. package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +44 -16
  349. package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +6 -8
  350. package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +146 -74
  351. package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +29 -6
  352. package/src/renderers/webgpu/utils/WebGPUUtils.js +22 -2
  353. package/src/renderers/webxr/WebXRManager.js +3 -2
  354. package/src/textures/Source.js +2 -1
  355. package/src/textures/Texture.js +3 -2
  356. package/src/textures/VideoTexture.js +2 -0
  357. package/src/utils.js +67 -3
package/build/three.cjs CHANGED
@@ -5,7 +5,7 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const REVISION = '180';
8
+ const REVISION = '181';
9
9
 
10
10
  /**
11
11
  * Represents mouse buttons and interaction types in context of controls.
@@ -1684,10 +1684,161 @@ const InterpolationSamplingMode = {
1684
1684
  * @property {string} EITHER - Flat interpolation using either vertex.
1685
1685
  */
1686
1686
 
1687
+ function arrayNeedsUint32( array ) {
1688
+
1689
+ // assumes larger values usually on last
1690
+
1691
+ for ( let i = array.length - 1; i >= 0; -- i ) {
1692
+
1693
+ if ( array[ i ] >= 65535 ) return true; // account for PRIMITIVE_RESTART_FIXED_INDEX, #24565
1694
+
1695
+ }
1696
+
1697
+ return false;
1698
+
1699
+ }
1700
+
1701
+ const TYPED_ARRAYS = {
1702
+ Int8Array: Int8Array,
1703
+ Uint8Array: Uint8Array,
1704
+ Uint8ClampedArray: Uint8ClampedArray,
1705
+ Int16Array: Int16Array,
1706
+ Uint16Array: Uint16Array,
1707
+ Int32Array: Int32Array,
1708
+ Uint32Array: Uint32Array,
1709
+ Float32Array: Float32Array,
1710
+ Float64Array: Float64Array
1711
+ };
1712
+
1713
+ function getTypedArray( type, buffer ) {
1714
+
1715
+ return new TYPED_ARRAYS[ type ]( buffer );
1716
+
1717
+ }
1718
+
1719
+ function createElementNS( name ) {
1720
+
1721
+ return document.createElementNS( 'http://www.w3.org/1999/xhtml', name );
1722
+
1723
+ }
1724
+
1725
+ function createCanvasElement() {
1726
+
1727
+ const canvas = createElementNS( 'canvas' );
1728
+ canvas.style.display = 'block';
1729
+ return canvas;
1730
+
1731
+ }
1732
+
1733
+ const _cache = {};
1734
+
1735
+ let _setConsoleFunction = null;
1736
+
1737
+ function setConsoleFunction( fn ) {
1738
+
1739
+ _setConsoleFunction = fn;
1740
+
1741
+ }
1742
+
1743
+ function getConsoleFunction() {
1744
+
1745
+ return _setConsoleFunction;
1746
+
1747
+ }
1748
+
1749
+ function log( ...params ) {
1750
+
1751
+ const message = 'THREE.' + params.shift();
1752
+
1753
+ if ( _setConsoleFunction ) {
1754
+
1755
+ _setConsoleFunction( 'log', message, ...params );
1756
+
1757
+ } else {
1758
+
1759
+ console.log( message, ...params );
1760
+
1761
+ }
1762
+
1763
+ }
1764
+
1765
+ function warn( ...params ) {
1766
+
1767
+ const message = 'THREE.' + params.shift();
1768
+
1769
+ if ( _setConsoleFunction ) {
1770
+
1771
+ _setConsoleFunction( 'warn', message, ...params );
1772
+
1773
+ } else {
1774
+
1775
+ console.warn( message, ...params );
1776
+
1777
+ }
1778
+
1779
+ }
1780
+
1781
+ function error( ...params ) {
1782
+
1783
+ const message = 'THREE.' + params.shift();
1784
+
1785
+ if ( _setConsoleFunction ) {
1786
+
1787
+ _setConsoleFunction( 'error', message, ...params );
1788
+
1789
+ } else {
1790
+
1791
+ console.error( message, ...params );
1792
+
1793
+ }
1794
+
1795
+ }
1796
+
1797
+ function warnOnce( ...params ) {
1798
+
1799
+ const message = params.join( ' ' );
1800
+
1801
+ if ( message in _cache ) return;
1802
+
1803
+ _cache[ message ] = true;
1804
+
1805
+ warn( ...params );
1806
+
1807
+ }
1808
+
1809
+ function probeAsync( gl, sync, interval ) {
1810
+
1811
+ return new Promise( function ( resolve, reject ) {
1812
+
1813
+ function probe() {
1814
+
1815
+ switch ( gl.clientWaitSync( sync, gl.SYNC_FLUSH_COMMANDS_BIT, 0 ) ) {
1816
+
1817
+ case gl.WAIT_FAILED:
1818
+ reject();
1819
+ break;
1820
+
1821
+ case gl.TIMEOUT_EXPIRED:
1822
+ setTimeout( probe, interval );
1823
+ break;
1824
+
1825
+ default:
1826
+ resolve();
1827
+
1828
+ }
1829
+
1830
+ }
1831
+
1832
+ setTimeout( probe, interval );
1833
+
1834
+ } );
1835
+
1836
+ }
1837
+
1687
1838
  /**
1688
1839
  * This modules allows to dispatch event objects on custom JavaScript objects.
1689
1840
  *
1690
- * Main repository: [eventdispatcher.js]{@link https://github.com/mrdoob/eventdispatcher.js/}
1841
+ * Main repository: [eventdispatcher.js](https://github.com/mrdoob/eventdispatcher.js/)
1691
1842
  *
1692
1843
  * Code Example:
1693
1844
  * ```js
@@ -1822,7 +1973,7 @@ const DEG2RAD = Math.PI / 180;
1822
1973
  const RAD2DEG = 180 / Math.PI;
1823
1974
 
1824
1975
  /**
1825
- * Generate a [UUID]{@link https://en.wikipedia.org/wiki/Universally_unique_identifier}
1976
+ * Generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
1826
1977
  * (universally unique identifier).
1827
1978
  *
1828
1979
  * @return {string} The UUID.
@@ -1935,7 +2086,7 @@ function lerp( x, y, t ) {
1935
2086
  /**
1936
2087
  * Smoothly interpolate a number from `x` to `y` in a spring-like manner using a delta
1937
2088
  * time to maintain frame rate independent movement. For details, see
1938
- * [Frame rate independent damping using lerp]{@link http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/}.
2089
+ * [Frame rate independent damping using lerp](http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/).
1939
2090
  *
1940
2091
  * @param {number} x - The current point.
1941
2092
  * @param {number} y - The target point.
@@ -1970,7 +2121,7 @@ function pingpong( x, length = 1 ) {
1970
2121
  * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to
1971
2122
  * the `min` and `max`.
1972
2123
  *
1973
- * See [Smoothstep]{@link http://en.wikipedia.org/wiki/Smoothstep} for more details.
2124
+ * See [Smoothstep](http://en.wikipedia.org/wiki/Smoothstep) for more details.
1974
2125
  *
1975
2126
  * @param {number} x - The value to evaluate based on its position between min and max.
1976
2127
  * @param {number} min - The min value. Any x value below min will be `0`.
@@ -1989,7 +2140,7 @@ function smoothstep( x, min, max ) {
1989
2140
  }
1990
2141
 
1991
2142
  /**
1992
- * A [variation on smoothstep]{@link https://en.wikipedia.org/wiki/Smoothstep#Variations}
2143
+ * A [variation on smoothstep](https://en.wikipedia.org/wiki/Smoothstep#Variations)
1993
2144
  * that has zero 1st and 2nd order derivatives at x=0 and x=1.
1994
2145
  *
1995
2146
  * @param {number} x - The value to evaluate based on its position between min and max.
@@ -2129,7 +2280,7 @@ function floorPowerOfTwo( value ) {
2129
2280
  }
2130
2281
 
2131
2282
  /**
2132
- * Sets the given quaternion from the [Intrinsic Proper Euler Angles]{@link https://en.wikipedia.org/wiki/Euler_angles}
2283
+ * Sets the given quaternion from the [Intrinsic Proper Euler Angles](https://en.wikipedia.org/wiki/Euler_angles)
2133
2284
  * defined by the given angles and order.
2134
2285
  *
2135
2286
  * Rotations are applied to the axes in the order specified by order:
@@ -2185,7 +2336,7 @@ function setQuaternionFromProperEuler( q, a, b, c, order ) {
2185
2336
  break;
2186
2337
 
2187
2338
  default:
2188
- console.warn( 'THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order );
2339
+ warn( 'MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: ' + order );
2189
2340
 
2190
2341
  }
2191
2342
 
@@ -2294,7 +2445,7 @@ const MathUtils = {
2294
2445
  DEG2RAD: DEG2RAD,
2295
2446
  RAD2DEG: RAD2DEG,
2296
2447
  /**
2297
- * Generate a [UUID]{@link https://en.wikipedia.org/wiki/Universally_unique_identifier}
2448
+ * Generate a [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier)
2298
2449
  * (universally unique identifier).
2299
2450
  *
2300
2451
  * @static
@@ -2365,7 +2516,7 @@ const MathUtils = {
2365
2516
  /**
2366
2517
  * Smoothly interpolate a number from `x` to `y` in a spring-like manner using a delta
2367
2518
  * time to maintain frame rate independent movement. For details, see
2368
- * [Frame rate independent damping using lerp]{@link http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/}.
2519
+ * [Frame rate independent damping using lerp](http://www.rorydriscoll.com/2016/03/07/frame-rate-independent-damping-using-lerp/).
2369
2520
  *
2370
2521
  * @static
2371
2522
  * @method
@@ -2392,7 +2543,7 @@ const MathUtils = {
2392
2543
  * moved between `min` and `max`, but smoothed or slowed down the closer `x` is to
2393
2544
  * the `min` and `max`.
2394
2545
  *
2395
- * See [Smoothstep]{@link http://en.wikipedia.org/wiki/Smoothstep} for more details.
2546
+ * See [Smoothstep](http://en.wikipedia.org/wiki/Smoothstep) for more details.
2396
2547
  *
2397
2548
  * @static
2398
2549
  * @method
@@ -2403,7 +2554,7 @@ const MathUtils = {
2403
2554
  */
2404
2555
  smoothstep: smoothstep,
2405
2556
  /**
2406
- * A [variation on smoothstep]{@link https://en.wikipedia.org/wiki/Smoothstep#Variations}
2557
+ * A [variation on smoothstep](https://en.wikipedia.org/wiki/Smoothstep#Variations)
2407
2558
  * that has zero 1st and 2nd order derivatives at x=0 and x=1.
2408
2559
  *
2409
2560
  * @static
@@ -2498,7 +2649,7 @@ const MathUtils = {
2498
2649
  */
2499
2650
  floorPowerOfTwo: floorPowerOfTwo,
2500
2651
  /**
2501
- * Sets the given quaternion from the [Intrinsic Proper Euler Angles]{@link https://en.wikipedia.org/wiki/Euler_angles}
2652
+ * Sets the given quaternion from the [Intrinsic Proper Euler Angles](https://en.wikipedia.org/wiki/Euler_angles)
2502
2653
  * defined by the given angles and order.
2503
2654
  *
2504
2655
  * Rotations are applied to the axes in the order specified by order:
@@ -3443,7 +3594,7 @@ class Quaternion {
3443
3594
 
3444
3595
  /**
3445
3596
  * Interpolates between two quaternions via SLERP. This implementation assumes the
3446
- * quaternion data are managed in flat arrays.
3597
+ * quaternion data are managed in flat arrays.
3447
3598
  *
3448
3599
  * @param {Array<number>} dst - The destination array.
3449
3600
  * @param {number} dstOffset - An offset into the destination array.
@@ -3456,65 +3607,78 @@ class Quaternion {
3456
3607
  */
3457
3608
  static slerpFlat( dst, dstOffset, src0, srcOffset0, src1, srcOffset1, t ) {
3458
3609
 
3459
- // fuzz-free, array-based Quaternion SLERP operation
3460
-
3461
3610
  let x0 = src0[ srcOffset0 + 0 ],
3462
3611
  y0 = src0[ srcOffset0 + 1 ],
3463
3612
  z0 = src0[ srcOffset0 + 2 ],
3464
3613
  w0 = src0[ srcOffset0 + 3 ];
3465
3614
 
3466
- const x1 = src1[ srcOffset1 + 0 ],
3615
+ let x1 = src1[ srcOffset1 + 0 ],
3467
3616
  y1 = src1[ srcOffset1 + 1 ],
3468
3617
  z1 = src1[ srcOffset1 + 2 ],
3469
3618
  w1 = src1[ srcOffset1 + 3 ];
3470
3619
 
3471
- if ( t === 0 ) {
3620
+ if ( t <= 0 ) {
3472
3621
 
3473
3622
  dst[ dstOffset + 0 ] = x0;
3474
3623
  dst[ dstOffset + 1 ] = y0;
3475
3624
  dst[ dstOffset + 2 ] = z0;
3476
3625
  dst[ dstOffset + 3 ] = w0;
3626
+
3477
3627
  return;
3478
3628
 
3479
3629
  }
3480
3630
 
3481
- if ( t === 1 ) {
3631
+ if ( t >= 1 ) {
3482
3632
 
3483
3633
  dst[ dstOffset + 0 ] = x1;
3484
3634
  dst[ dstOffset + 1 ] = y1;
3485
3635
  dst[ dstOffset + 2 ] = z1;
3486
3636
  dst[ dstOffset + 3 ] = w1;
3637
+
3487
3638
  return;
3488
3639
 
3489
3640
  }
3490
3641
 
3491
3642
  if ( w0 !== w1 || x0 !== x1 || y0 !== y1 || z0 !== z1 ) {
3492
3643
 
3493
- let s = 1 - t;
3494
- const cos = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1,
3495
- dir = ( cos >= 0 ? 1 : -1 ),
3496
- sqrSin = 1 - cos * cos;
3644
+ let dot = x0 * x1 + y0 * y1 + z0 * z1 + w0 * w1;
3497
3645
 
3498
- // Skip the Slerp for tiny steps to avoid numeric problems:
3499
- if ( sqrSin > Number.EPSILON ) {
3646
+ if ( dot < 0 ) {
3500
3647
 
3501
- const sin = Math.sqrt( sqrSin ),
3502
- len = Math.atan2( sin, cos * dir );
3648
+ x1 = - x1;
3649
+ y1 = - y1;
3650
+ z1 = - z1;
3651
+ w1 = - w1;
3503
3652
 
3504
- s = Math.sin( s * len ) / sin;
3505
- t = Math.sin( t * len ) / sin;
3653
+ dot = - dot;
3506
3654
 
3507
3655
  }
3508
3656
 
3509
- const tDir = t * dir;
3657
+ let s = 1 - t;
3658
+
3659
+ if ( dot < 0.9995 ) {
3660
+
3661
+ // slerp
3510
3662
 
3511
- x0 = x0 * s + x1 * tDir;
3512
- y0 = y0 * s + y1 * tDir;
3513
- z0 = z0 * s + z1 * tDir;
3514
- w0 = w0 * s + w1 * tDir;
3663
+ const theta = Math.acos( dot );
3664
+ const sin = Math.sin( theta );
3515
3665
 
3516
- // Normalize in case we just did a lerp:
3517
- if ( s === 1 - t ) {
3666
+ s = Math.sin( s * theta ) / sin;
3667
+ t = Math.sin( t * theta ) / sin;
3668
+
3669
+ x0 = x0 * s + x1 * t;
3670
+ y0 = y0 * s + y1 * t;
3671
+ z0 = z0 * s + z1 * t;
3672
+ w0 = w0 * s + w1 * t;
3673
+
3674
+ } else {
3675
+
3676
+ // for small angles, lerp then normalize
3677
+
3678
+ x0 = x0 * s + x1 * t;
3679
+ y0 = y0 * s + y1 * t;
3680
+ z0 = z0 * s + z1 * t;
3681
+ w0 = w0 * s + w1 * t;
3518
3682
 
3519
3683
  const f = 1 / Math.sqrt( x0 * x0 + y0 * y0 + z0 * z0 + w0 * w0 );
3520
3684
 
@@ -3768,7 +3932,7 @@ class Quaternion {
3768
3932
  break;
3769
3933
 
3770
3934
  default:
3771
- console.warn( 'THREE.Quaternion: .setFromEuler() encountered an unknown order: ' + order );
3935
+ warn( 'Quaternion: .setFromEuler() encountered an unknown order: ' + order );
3772
3936
 
3773
3937
  }
3774
3938
 
@@ -4124,68 +4288,56 @@ class Quaternion {
4124
4288
  */
4125
4289
  slerp( qb, t ) {
4126
4290
 
4127
- if ( t === 0 ) return this;
4128
- if ( t === 1 ) return this.copy( qb );
4129
-
4130
- const x = this._x, y = this._y, z = this._z, w = this._w;
4291
+ if ( t <= 0 ) return this;
4131
4292
 
4132
- // http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/
4293
+ if ( t >= 1 ) return this.copy( qb ); // copy calls _onChangeCallback()
4133
4294
 
4134
- let cosHalfTheta = w * qb._w + x * qb._x + y * qb._y + z * qb._z;
4295
+ let x = qb._x, y = qb._y, z = qb._z, w = qb._w;
4135
4296
 
4136
- if ( cosHalfTheta < 0 ) {
4297
+ let dot = this.dot( qb );
4137
4298
 
4138
- this._w = - qb._w;
4139
- this._x = - qb._x;
4140
- this._y = - qb._y;
4141
- this._z = - qb._z;
4299
+ if ( dot < 0 ) {
4142
4300
 
4143
- cosHalfTheta = - cosHalfTheta;
4301
+ x = - x;
4302
+ y = - y;
4303
+ z = - z;
4304
+ w = - w;
4144
4305
 
4145
- } else {
4146
-
4147
- this.copy( qb );
4306
+ dot = - dot;
4148
4307
 
4149
4308
  }
4150
4309
 
4151
- if ( cosHalfTheta >= 1.0 ) {
4310
+ let s = 1 - t;
4152
4311
 
4153
- this._w = w;
4154
- this._x = x;
4155
- this._y = y;
4156
- this._z = z;
4312
+ if ( dot < 0.9995 ) {
4157
4313
 
4158
- return this;
4314
+ // slerp
4159
4315
 
4160
- }
4316
+ const theta = Math.acos( dot );
4317
+ const sin = Math.sin( theta );
4161
4318
 
4162
- const sqrSinHalfTheta = 1.0 - cosHalfTheta * cosHalfTheta;
4319
+ s = Math.sin( s * theta ) / sin;
4320
+ t = Math.sin( t * theta ) / sin;
4163
4321
 
4164
- if ( sqrSinHalfTheta <= Number.EPSILON ) {
4322
+ this._x = this._x * s + x * t;
4323
+ this._y = this._y * s + y * t;
4324
+ this._z = this._z * s + z * t;
4325
+ this._w = this._w * s + w * t;
4165
4326
 
4166
- const s = 1 - t;
4167
- this._w = s * w + t * this._w;
4168
- this._x = s * x + t * this._x;
4169
- this._y = s * y + t * this._y;
4170
- this._z = s * z + t * this._z;
4327
+ this._onChangeCallback();
4171
4328
 
4172
- this.normalize(); // normalize calls _onChangeCallback()
4173
-
4174
- return this;
4329
+ } else {
4175
4330
 
4176
- }
4331
+ // for small angles, lerp then normalize
4177
4332
 
4178
- const sinHalfTheta = Math.sqrt( sqrSinHalfTheta );
4179
- const halfTheta = Math.atan2( sinHalfTheta, cosHalfTheta );
4180
- const ratioA = Math.sin( ( 1 - t ) * halfTheta ) / sinHalfTheta,
4181
- ratioB = Math.sin( t * halfTheta ) / sinHalfTheta;
4333
+ this._x = this._x * s + x * t;
4334
+ this._y = this._y * s + y * t;
4335
+ this._z = this._z * s + z * t;
4336
+ this._w = this._w * s + w * t;
4182
4337
 
4183
- this._w = ( w * ratioA + this._w * ratioB );
4184
- this._x = ( x * ratioA + this._x * ratioB );
4185
- this._y = ( y * ratioA + this._y * ratioB );
4186
- this._z = ( z * ratioA + this._z * ratioB );
4338
+ this.normalize(); // normalize calls _onChangeCallback()
4187
4339
 
4188
- this._onChangeCallback();
4340
+ }
4189
4341
 
4190
4342
  return this;
4191
4343
 
@@ -5600,7 +5752,7 @@ const _quaternion$4 = /*@__PURE__*/ new Quaternion();
5600
5752
  * A Note on Row-Major and Column-Major Ordering:
5601
5753
  *
5602
5754
  * The constructor and {@link Matrix3#set} method take arguments in
5603
- * [row-major]{@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order}
5755
+ * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order)
5604
5756
  * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order.
5605
5757
  * This means that calling:
5606
5758
  * ```js
@@ -5874,7 +6026,7 @@ class Matrix3 {
5874
6026
  }
5875
6027
 
5876
6028
  /**
5877
- * Inverts this matrix, using the [analytic method]{@link https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution}.
6029
+ * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution).
5878
6030
  * You can not invert with a determinant of zero. If you attempt this, the method produces
5879
6031
  * a zero matrix instead.
5880
6032
  *
@@ -6206,93 +6358,6 @@ class Matrix3 {
6206
6358
 
6207
6359
  const _m3 = /*@__PURE__*/ new Matrix3();
6208
6360
 
6209
- function arrayNeedsUint32( array ) {
6210
-
6211
- // assumes larger values usually on last
6212
-
6213
- for ( let i = array.length - 1; i >= 0; -- i ) {
6214
-
6215
- if ( array[ i ] >= 65535 ) return true; // account for PRIMITIVE_RESTART_FIXED_INDEX, #24565
6216
-
6217
- }
6218
-
6219
- return false;
6220
-
6221
- }
6222
-
6223
- const TYPED_ARRAYS = {
6224
- Int8Array: Int8Array,
6225
- Uint8Array: Uint8Array,
6226
- Uint8ClampedArray: Uint8ClampedArray,
6227
- Int16Array: Int16Array,
6228
- Uint16Array: Uint16Array,
6229
- Int32Array: Int32Array,
6230
- Uint32Array: Uint32Array,
6231
- Float32Array: Float32Array,
6232
- Float64Array: Float64Array
6233
- };
6234
-
6235
- function getTypedArray( type, buffer ) {
6236
-
6237
- return new TYPED_ARRAYS[ type ]( buffer );
6238
-
6239
- }
6240
-
6241
- function createElementNS( name ) {
6242
-
6243
- return document.createElementNS( 'http://www.w3.org/1999/xhtml', name );
6244
-
6245
- }
6246
-
6247
- function createCanvasElement() {
6248
-
6249
- const canvas = createElementNS( 'canvas' );
6250
- canvas.style.display = 'block';
6251
- return canvas;
6252
-
6253
- }
6254
-
6255
- const _cache = {};
6256
-
6257
- function warnOnce( message ) {
6258
-
6259
- if ( message in _cache ) return;
6260
-
6261
- _cache[ message ] = true;
6262
-
6263
- console.warn( message );
6264
-
6265
- }
6266
-
6267
- function probeAsync( gl, sync, interval ) {
6268
-
6269
- return new Promise( function ( resolve, reject ) {
6270
-
6271
- function probe() {
6272
-
6273
- switch ( gl.clientWaitSync( sync, gl.SYNC_FLUSH_COMMANDS_BIT, 0 ) ) {
6274
-
6275
- case gl.WAIT_FAILED:
6276
- reject();
6277
- break;
6278
-
6279
- case gl.TIMEOUT_EXPIRED:
6280
- setTimeout( probe, interval );
6281
- break;
6282
-
6283
- default:
6284
- resolve();
6285
-
6286
- }
6287
-
6288
- }
6289
-
6290
- setTimeout( probe, interval );
6291
-
6292
- } );
6293
-
6294
- }
6295
-
6296
6361
  const LINEAR_REC709_TO_XYZ = /*@__PURE__*/ new Matrix3().set(
6297
6362
  0.4123908, 0.3575843, 0.1804808,
6298
6363
  0.2126390, 0.7151687, 0.0721923,
@@ -6438,7 +6503,7 @@ function createColorManagement() {
6438
6503
 
6439
6504
  fromWorkingColorSpace: function ( color, targetColorSpace ) {
6440
6505
 
6441
- warnOnce( 'THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().' ); // @deprecated, r177
6506
+ warnOnce( 'ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace().' ); // @deprecated, r177
6442
6507
 
6443
6508
  return ColorManagement.workingToColorSpace( color, targetColorSpace );
6444
6509
 
@@ -6446,7 +6511,7 @@ function createColorManagement() {
6446
6511
 
6447
6512
  toWorkingColorSpace: function ( color, sourceColorSpace ) {
6448
6513
 
6449
- warnOnce( 'THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().' ); // @deprecated, r177
6514
+ warnOnce( 'ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking().' ); // @deprecated, r177
6450
6515
 
6451
6516
  return ColorManagement.colorSpaceToWorking( color, sourceColorSpace );
6452
6517
 
@@ -6629,7 +6694,7 @@ class ImageUtils {
6629
6694
 
6630
6695
  } else {
6631
6696
 
6632
- console.warn( 'THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.' );
6697
+ warn( 'ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied.' );
6633
6698
  return image;
6634
6699
 
6635
6700
  }
@@ -6854,7 +6919,7 @@ function serializeImage( image ) {
6854
6919
 
6855
6920
  } else {
6856
6921
 
6857
- console.warn( 'THREE.Texture: Unable to serialize Texture.' );
6922
+ warn( 'Texture: Unable to serialize Texture.' );
6858
6923
  return {};
6859
6924
 
6860
6925
  }
@@ -7368,7 +7433,7 @@ class Texture extends EventDispatcher {
7368
7433
 
7369
7434
  if ( newValue === undefined ) {
7370
7435
 
7371
- console.warn( `THREE.Texture.setValues(): parameter '${ key }' has value of undefined.` );
7436
+ warn( `Texture.setValues(): parameter '${ key }' has value of undefined.` );
7372
7437
  continue;
7373
7438
 
7374
7439
  }
@@ -7377,7 +7442,7 @@ class Texture extends EventDispatcher {
7377
7442
 
7378
7443
  if ( currentValue === undefined ) {
7379
7444
 
7380
- console.warn( `THREE.Texture.setValues(): property '${ key }' does not exist.` );
7445
+ warn( `Texture.setValues(): property '${ key }' does not exist.` );
7381
7446
  continue;
7382
7447
 
7383
7448
  }
@@ -8994,7 +9059,16 @@ class RenderTarget extends EventDispatcher {
8994
9059
  this.textures[ i ].image.width = width;
8995
9060
  this.textures[ i ].image.height = height;
8996
9061
  this.textures[ i ].image.depth = depth;
8997
- this.textures[ i ].isArrayTexture = this.textures[ i ].image.depth > 1;
9062
+
9063
+ if ( this.textures[ i ].isData3DTexture !== true ) { // Fix for #31693
9064
+
9065
+ // TODO: Reconsider setting isArrayTexture flag here and in the ctor of Texture.
9066
+ // Maybe a method `isArrayTexture()` or just a getter could replace a flag since
9067
+ // both are evaluated on each call?
9068
+
9069
+ this.textures[ i ].isArrayTexture = this.textures[ i ].image.depth > 1;
9070
+
9071
+ }
8998
9072
 
8999
9073
  }
9000
9074
 
@@ -11311,7 +11385,7 @@ class Ray {
11311
11385
  * Represents a 4x4 matrix.
11312
11386
  *
11313
11387
  * The most common use of a 4x4 matrix in 3D computer graphics is as a transformation matrix.
11314
- * For an introduction to transformation matrices as used in WebGL, check out [this tutorial]{@link https://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices}
11388
+ * For an introduction to transformation matrices as used in WebGL, check out [this tutorial](https://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-matrices)
11315
11389
  *
11316
11390
  * This allows a 3D vector representing a point in 3D space to undergo
11317
11391
  * transformations such as translation, rotation, shear, scale, reflection,
@@ -11321,7 +11395,7 @@ class Ray {
11321
11395
  * A Note on Row-Major and Column-Major Ordering:
11322
11396
  *
11323
11397
  * The constructor and {@link Matrix3#set} method take arguments in
11324
- * [row-major]{@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order}
11398
+ * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order)
11325
11399
  * order, while internally they are stored in the {@link Matrix3#elements} array in column-major order.
11326
11400
  * This means that calling:
11327
11401
  * ```js
@@ -11615,7 +11689,7 @@ class Matrix4 {
11615
11689
  * Sets the rotation component (the upper left 3x3 matrix) of this matrix to
11616
11690
  * the rotation specified by the given Euler angles. The rest of
11617
11691
  * the matrix is set to the identity. Depending on the {@link Euler#order},
11618
- * there are six possible outcomes. See [this page]{@link https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix}
11692
+ * there are six possible outcomes. See [this page](https://en.wikipedia.org/wiki/Euler_angles#Rotation_matrix)
11619
11693
  * for a complete list.
11620
11694
  *
11621
11695
  * @param {Euler} euler - The Euler angles.
@@ -11745,7 +11819,7 @@ class Matrix4 {
11745
11819
 
11746
11820
  /**
11747
11821
  * Sets the rotation component of this matrix to the rotation specified by
11748
- * the given Quaternion as outlined [here]{@link https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion}
11822
+ * the given Quaternion as outlined [here](https://en.wikipedia.org/wiki/Rotation_matrix#Quaternion)
11749
11823
  * The rest of the matrix is set to the identity.
11750
11824
  *
11751
11825
  * @param {Quaternion} q - The Quaternion.
@@ -11907,7 +11981,7 @@ class Matrix4 {
11907
11981
  /**
11908
11982
  * Computes and returns the determinant of this matrix.
11909
11983
  *
11910
- * Based on the method outlined [here]{@link http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html}.
11984
+ * Based on the method outlined [here](http://www.euclideanspace.com/maths/algebra/matrix/functions/inverse/fourD/index.html).
11911
11985
  *
11912
11986
  * @return {number} The determinant.
11913
11987
  */
@@ -12014,7 +12088,7 @@ class Matrix4 {
12014
12088
  }
12015
12089
 
12016
12090
  /**
12017
- * Inverts this matrix, using the [analytic method]{@link https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution}.
12091
+ * Inverts this matrix, using the [analytic method](https://en.wikipedia.org/wiki/Invertible_matrix#Analytic_solution).
12018
12092
  * You can not invert with a determinant of zero. If you attempt this, the method produces
12019
12093
  * a zero matrix instead.
12020
12094
  *
@@ -12217,7 +12291,7 @@ class Matrix4 {
12217
12291
  * the given angle.
12218
12292
  *
12219
12293
  * This is a somewhat controversial but mathematically sound alternative to
12220
- * rotating via Quaternions. See the discussion [here]{@link https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199}.
12294
+ * rotating via Quaternions. See the discussion [here](https://www.gamedev.net/articles/programming/math-and-physics/do-we-really-need-quaternions-r1199).
12221
12295
  *
12222
12296
  * @param {Vector3} axis - The normalized rotation axis.
12223
12297
  * @param {number} angle - The rotation in radians.
@@ -12906,7 +12980,7 @@ class Euler {
12906
12980
 
12907
12981
  default:
12908
12982
 
12909
- console.warn( 'THREE.Euler: .setFromRotationMatrix() encountered an unknown order: ' + order );
12983
+ warn( 'Euler: .setFromRotationMatrix() encountered an unknown order: ' + order );
12910
12984
 
12911
12985
  }
12912
12986
 
@@ -13892,7 +13966,7 @@ class Object3D extends EventDispatcher {
13892
13966
 
13893
13967
  if ( object === this ) {
13894
13968
 
13895
- console.error( 'THREE.Object3D.add: object can\'t be added as a child of itself.', object );
13969
+ error( 'Object3D.add: object can\'t be added as a child of itself.', object );
13896
13970
  return this;
13897
13971
 
13898
13972
  }
@@ -13911,7 +13985,7 @@ class Object3D extends EventDispatcher {
13911
13985
 
13912
13986
  } else {
13913
13987
 
13914
- console.error( 'THREE.Object3D.add: object not an instance of THREE.Object3D.', object );
13988
+ error( 'Object3D.add: object not an instance of THREE.Object3D.', object );
13915
13989
 
13916
13990
  }
13917
13991
 
@@ -15582,7 +15656,7 @@ class Color {
15582
15656
  /**
15583
15657
  * Sets this color from a CSS-style string. For example, `rgb(250, 0,0)`,
15584
15658
  * `rgb(100%, 0%, 0%)`, `hsl(0, 100%, 50%)`, `#ff0000`, `#f00`, or `red` ( or
15585
- * any [X11 color name]{@link https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart} -
15659
+ * any [X11 color name](https://en.wikipedia.org/wiki/X11_color_names#Color_name_chart) -
15586
15660
  * all 140 color names are supported).
15587
15661
  *
15588
15662
  * @param {string} style - Color as a CSS-style string.
@@ -15597,7 +15671,7 @@ class Color {
15597
15671
 
15598
15672
  if ( parseFloat( string ) < 1 ) {
15599
15673
 
15600
- console.warn( 'THREE.Color: Alpha component of ' + style + ' will be ignored.' );
15674
+ warn( 'Color: Alpha component of ' + style + ' will be ignored.' );
15601
15675
 
15602
15676
  }
15603
15677
 
@@ -15673,7 +15747,7 @@ class Color {
15673
15747
 
15674
15748
  default:
15675
15749
 
15676
- console.warn( 'THREE.Color: Unknown color model ' + style );
15750
+ warn( 'Color: Unknown color model ' + style );
15677
15751
 
15678
15752
  }
15679
15753
 
@@ -15701,7 +15775,7 @@ class Color {
15701
15775
 
15702
15776
  } else {
15703
15777
 
15704
- console.warn( 'THREE.Color: Invalid hex color ' + style );
15778
+ warn( 'Color: Invalid hex color ' + style );
15705
15779
 
15706
15780
  }
15707
15781
 
@@ -15741,7 +15815,7 @@ class Color {
15741
15815
  } else {
15742
15816
 
15743
15817
  // unknown color
15744
- console.warn( 'THREE.Color: Unknown color ' + style );
15818
+ warn( 'Color: Unknown color ' + style );
15745
15819
 
15746
15820
  }
15747
15821
 
@@ -16789,7 +16863,7 @@ class Material extends EventDispatcher {
16789
16863
  *
16790
16864
  * This method can only be used when rendering with {@link WebGLRenderer}. The
16791
16865
  * recommended approach when customizing materials is to use `WebGPURenderer` with the new
16792
- * Node Material system and [TSL]{@link https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language}.
16866
+ * Node Material system and [TSL](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language).
16793
16867
  *
16794
16868
  * @param {{vertexShader:string,fragmentShader:string,uniforms:Object}} shaderobject - The object holds the uniforms and the vertex and fragment shader source.
16795
16869
  * @param {WebGLRenderer} renderer - A reference to the renderer.
@@ -16828,7 +16902,7 @@ class Material extends EventDispatcher {
16828
16902
 
16829
16903
  if ( newValue === undefined ) {
16830
16904
 
16831
- console.warn( `THREE.Material: parameter '${ key }' has value of undefined.` );
16905
+ warn( `Material: parameter '${ key }' has value of undefined.` );
16832
16906
  continue;
16833
16907
 
16834
16908
  }
@@ -16837,7 +16911,7 @@ class Material extends EventDispatcher {
16837
16911
 
16838
16912
  if ( currentValue === undefined ) {
16839
16913
 
16840
- console.warn( `THREE.Material: '${ key }' is not a property of THREE.${ this.type }.` );
16914
+ warn( `Material: '${ key }' is not a property of THREE.${ this.type }.` );
16841
16915
  continue;
16842
16916
 
16843
16917
  }
@@ -17284,6 +17358,7 @@ class Material extends EventDispatcher {
17284
17358
  * This material is not affected by lights.
17285
17359
  *
17286
17360
  * @augments Material
17361
+ * @demo scenes/material-browser.html#MeshBasicMaterial
17287
17362
  */
17288
17363
  class MeshBasicMaterial extends Material {
17289
17364
 
@@ -17669,7 +17744,7 @@ function _generateTables() {
17669
17744
  */
17670
17745
  function toHalfFloat( val ) {
17671
17746
 
17672
- if ( Math.abs( val ) > 65504 ) console.warn( 'THREE.DataUtils.toHalfFloat(): Value out of range.' );
17747
+ if ( Math.abs( val ) > 65504 ) warn( 'DataUtils.toHalfFloat(): Value out of range.' );
17673
17748
 
17674
17749
  val = clamp( val, -65504, 65504 );
17675
17750
 
@@ -19340,7 +19415,7 @@ class BufferGeometry extends EventDispatcher {
19340
19415
 
19341
19416
  if ( points.length > positionAttribute.count ) {
19342
19417
 
19343
- console.warn( 'THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.' );
19418
+ warn( 'BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry.' );
19344
19419
 
19345
19420
  }
19346
19421
 
@@ -19370,7 +19445,7 @@ class BufferGeometry extends EventDispatcher {
19370
19445
 
19371
19446
  if ( position && position.isGLBufferAttribute ) {
19372
19447
 
19373
- console.error( 'THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );
19448
+ error( 'BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.', this );
19374
19449
 
19375
19450
  this.boundingBox.set(
19376
19451
  new Vector3( - Infinity, - Infinity, - Infinity ),
@@ -19421,7 +19496,7 @@ class BufferGeometry extends EventDispatcher {
19421
19496
 
19422
19497
  if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {
19423
19498
 
19424
- console.error( 'THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this );
19499
+ error( 'BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this );
19425
19500
 
19426
19501
  }
19427
19502
 
@@ -19445,7 +19520,7 @@ class BufferGeometry extends EventDispatcher {
19445
19520
 
19446
19521
  if ( position && position.isGLBufferAttribute ) {
19447
19522
 
19448
- console.error( 'THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );
19523
+ error( 'BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.', this );
19449
19524
 
19450
19525
  this.boundingSphere.set( new Vector3(), Infinity );
19451
19526
 
@@ -19536,7 +19611,7 @@ class BufferGeometry extends EventDispatcher {
19536
19611
 
19537
19612
  if ( isNaN( this.boundingSphere.radius ) ) {
19538
19613
 
19539
- console.error( 'THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this );
19614
+ error( 'BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.', this );
19540
19615
 
19541
19616
  }
19542
19617
 
@@ -19564,7 +19639,7 @@ class BufferGeometry extends EventDispatcher {
19564
19639
  attributes.normal === undefined ||
19565
19640
  attributes.uv === undefined ) {
19566
19641
 
19567
- console.error( 'THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' );
19642
+ error( 'BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)' );
19568
19643
  return;
19569
19644
 
19570
19645
  }
@@ -19874,7 +19949,7 @@ class BufferGeometry extends EventDispatcher {
19874
19949
 
19875
19950
  if ( this.index === null ) {
19876
19951
 
19877
- console.warn( 'THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.' );
19952
+ warn( 'BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed.' );
19878
19953
  return this;
19879
19954
 
19880
19955
  }
@@ -20684,6 +20759,7 @@ function checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, n
20684
20759
  * ```
20685
20760
  *
20686
20761
  * @augments BufferGeometry
20762
+ * @demo scenes/geometry-browser.html#BoxGeometry
20687
20763
  */
20688
20764
  class BoxGeometry extends BufferGeometry {
20689
20765
 
@@ -20884,8 +20960,20 @@ class BoxGeometry extends BufferGeometry {
20884
20960
 
20885
20961
  }
20886
20962
 
20887
- // Uniform Utilities
20963
+ /**
20964
+ * Provides utility functions for managing uniforms.
20965
+ *
20966
+ * @module UniformsUtils
20967
+ */
20888
20968
 
20969
+ /**
20970
+ * Clones the given uniform definitions by performing a deep-copy. That means
20971
+ * if the value of a uniform refers to an object like a Vector3 or Texture,
20972
+ * the cloned uniform will refer to a new object reference.
20973
+ *
20974
+ * @param {Object} src - An object representing uniform definitions.
20975
+ * @return {Object} The cloned uniforms.
20976
+ */
20889
20977
  function cloneUniforms( src ) {
20890
20978
 
20891
20979
  const dst = {};
@@ -20905,7 +20993,7 @@ function cloneUniforms( src ) {
20905
20993
 
20906
20994
  if ( property.isRenderTargetTexture ) {
20907
20995
 
20908
- console.warn( 'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().' );
20996
+ warn( 'UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms().' );
20909
20997
  dst[ u ][ p ] = null;
20910
20998
 
20911
20999
  } else {
@@ -20932,6 +21020,14 @@ function cloneUniforms( src ) {
20932
21020
 
20933
21021
  }
20934
21022
 
21023
+ /**
21024
+ * Merges the given uniform definitions into a single object. Since the
21025
+ * method internally uses cloneUniforms(), it performs a deep-copy when
21026
+ * producing the merged uniform definitions.
21027
+ *
21028
+ * @param {Array} uniforms - An array of objects containing uniform definitions.
21029
+ * @return {Object} The merged uniforms.
21030
+ */
20935
21031
  function mergeUniforms( uniforms ) {
20936
21032
 
20937
21033
  const merged = {};
@@ -21009,7 +21105,7 @@ var default_fragment = "void main() {\n\tgl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0
21009
21105
  * - You can use the directive `#pragma unroll_loop_start` and `#pragma unroll_loop_end`
21010
21106
  * in order to unroll a `for` loop in GLSL by the shader preprocessor. The directive has
21011
21107
  * to be placed right above the loop. The loop formatting has to correspond to a defined standard.
21012
- * - The loop has to be [normalized]{@link https://en.wikipedia.org/wiki/Normalized_loop}.
21108
+ * - The loop has to be [normalized](https://en.wikipedia.org/wiki/Normalized_loop).
21013
21109
  * - The loop variable has to be *i*.
21014
21110
  * - The value `UNROLLED_LOOP_INDEX` will be replaced with the explicitly
21015
21111
  * value of *i* for the given iteration and can be used in preprocessor
@@ -21215,7 +21311,7 @@ class ShaderMaterial extends Material {
21215
21311
  };
21216
21312
 
21217
21313
  /**
21218
- * If set, this calls [gl.bindAttribLocation]{@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation}
21314
+ * If set, this calls [gl.bindAttribLocation](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation)
21219
21315
  * to bind a generic vertex index to an attribute variable.
21220
21316
  *
21221
21317
  * @type {string|undefined}
@@ -21502,7 +21598,7 @@ const _minTarget = /*@__PURE__*/ new Vector2();
21502
21598
  const _maxTarget = /*@__PURE__*/ new Vector2();
21503
21599
 
21504
21600
  /**
21505
- * Camera that uses [perspective projection]{@link https://en.wikipedia.org/wiki/Perspective_(graphical)}.
21601
+ * Camera that uses [perspective projection](https://en.wikipedia.org/wiki/Perspective_(graphical)).
21506
21602
  *
21507
21603
  * This projection mode is designed to mimic the way the human eye sees. It
21508
21604
  * is the most common projection mode used for rendering a 3D scene.
@@ -23185,7 +23281,7 @@ class Scene extends Object3D {
23185
23281
  * "Interleaved" means that multiple attributes, possibly of different types,
23186
23282
  * (e.g., position, normal, uv, color) are packed into a single array buffer.
23187
23283
  *
23188
- * An introduction into interleaved arrays can be found here: [Interleaved array basics]{@link https://blog.tojicode.com/2011/05/interleaved-array-basics.html}
23284
+ * An introduction into interleaved arrays can be found here: [Interleaved array basics](https://blog.tojicode.com/2011/05/interleaved-array-basics.html)
23189
23285
  */
23190
23286
  class InterleavedBuffer {
23191
23287
 
@@ -23905,7 +24001,7 @@ class InterleavedBufferAttribute {
23905
24001
 
23906
24002
  if ( data === undefined ) {
23907
24003
 
23908
- console.log( 'THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' );
24004
+ log( 'InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.' );
23909
24005
 
23910
24006
  const array = [];
23911
24007
 
@@ -23955,7 +24051,7 @@ class InterleavedBufferAttribute {
23955
24051
 
23956
24052
  if ( data === undefined ) {
23957
24053
 
23958
- console.log( 'THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' );
24054
+ log( 'InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.' );
23959
24055
 
23960
24056
  const array = [];
23961
24057
 
@@ -24263,7 +24359,7 @@ class Sprite extends Object3D {
24263
24359
 
24264
24360
  if ( raycaster.camera === null ) {
24265
24361
 
24266
- console.error( 'THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' );
24362
+ error( 'Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' );
24267
24363
 
24268
24364
  }
24269
24365
 
@@ -24724,6 +24820,7 @@ const _ray$2 = /*@__PURE__*/ new Ray();
24724
24820
  * or {@link FBXLoader } import respective models.
24725
24821
  *
24726
24822
  * @augments Mesh
24823
+ * @demo scenes/bones-browser.html
24727
24824
  */
24728
24825
  class SkinnedMesh extends Mesh {
24729
24826
 
@@ -24991,7 +25088,7 @@ class SkinnedMesh extends Mesh {
24991
25088
 
24992
25089
  } else {
24993
25090
 
24994
- console.warn( 'THREE.SkinnedMesh: Unrecognized bindMode: ' + this.bindMode );
25091
+ warn( 'SkinnedMesh: Unrecognized bindMode: ' + this.bindMode );
24995
25092
 
24996
25093
  }
24997
25094
 
@@ -25260,7 +25357,7 @@ class Skeleton {
25260
25357
 
25261
25358
  if ( bones.length !== boneInverses.length ) {
25262
25359
 
25263
- console.warn( 'THREE.Skeleton: Number of inverse bone matrices does not match amount of bones.' );
25360
+ warn( 'Skeleton: Number of inverse bone matrices does not match amount of bones.' );
25264
25361
 
25265
25362
  this.boneInverses = [];
25266
25363
 
@@ -25478,7 +25575,7 @@ class Skeleton {
25478
25575
 
25479
25576
  if ( bone === undefined ) {
25480
25577
 
25481
- console.warn( 'THREE.Skeleton: No bone found with UUID:', uuid );
25578
+ warn( 'Skeleton: No bone found with UUID:', uuid );
25482
25579
  bone = new Bone();
25483
25580
 
25484
25581
  }
@@ -25990,7 +26087,7 @@ const _normalMatrix = /*@__PURE__*/ new Matrix3();
25990
26087
 
25991
26088
  /**
25992
26089
  * A two dimensional surface that extends infinitely in 3D space, represented
25993
- * in [Hessian normal form]{@link http://mathworld.wolfram.com/HessianNormalForm.html}
26090
+ * in [Hessian normal form](http://mathworld.wolfram.com/HessianNormalForm.html)
25994
26091
  * by a unit length normal vector and a constant.
25995
26092
  */
25996
26093
  class Plane {
@@ -28769,7 +28866,7 @@ class Line extends Object3D {
28769
28866
 
28770
28867
  } else {
28771
28868
 
28772
- console.warn( 'THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );
28869
+ warn( 'Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );
28773
28870
 
28774
28871
  }
28775
28872
 
@@ -29010,7 +29107,7 @@ class LineSegments extends Line {
29010
29107
 
29011
29108
  } else {
29012
29109
 
29013
- console.warn( 'THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );
29110
+ warn( 'LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.' );
29014
29111
 
29015
29112
  }
29016
29113
 
@@ -29141,7 +29238,7 @@ class PointsMaterial extends Material {
29141
29238
  /**
29142
29239
  * Defines the size of the points in pixels.
29143
29240
  *
29144
- * Might be capped if the value exceeds hardware dependent parameters like [gl.ALIASED_POINT_SIZE_RANGE]{@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParamete}.
29241
+ * Might be capped if the value exceeds hardware dependent parameters like [gl.ALIASED_POINT_SIZE_RANGE](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/getParamete).
29145
29242
  *
29146
29243
  * @type {number}
29147
29244
  * @default 1
@@ -29521,6 +29618,8 @@ class VideoTexture extends Texture {
29521
29618
 
29522
29619
  this.source.data.cancelVideoFrameCallback( this._requestVideoFrameCallbackId );
29523
29620
 
29621
+ this._requestVideoFrameCallbackId = 0;
29622
+
29524
29623
  }
29525
29624
 
29526
29625
  super.dispose();
@@ -30096,6 +30195,7 @@ class ExternalTexture extends Texture {
30096
30195
  * ```
30097
30196
  *
30098
30197
  * @augments BufferGeometry
30198
+ * @demo scenes/geometry-browser.html#CapsuleGeometry
30099
30199
  */
30100
30200
  class CapsuleGeometry extends BufferGeometry {
30101
30201
 
@@ -30313,6 +30413,7 @@ class CapsuleGeometry extends BufferGeometry {
30313
30413
  * ```
30314
30414
  *
30315
30415
  * @augments BufferGeometry
30416
+ * @demo scenes/geometry-browser.html#CircleGeometry
30316
30417
  */
30317
30418
  class CircleGeometry extends BufferGeometry {
30318
30419
 
@@ -30442,6 +30543,7 @@ class CircleGeometry extends BufferGeometry {
30442
30543
  * ```
30443
30544
  *
30444
30545
  * @augments BufferGeometry
30546
+ * @demo scenes/geometry-browser.html#CylinderGeometry
30445
30547
  */
30446
30548
  class CylinderGeometry extends BufferGeometry {
30447
30549
 
@@ -30767,6 +30869,7 @@ class CylinderGeometry extends BufferGeometry {
30767
30869
  * ```
30768
30870
  *
30769
30871
  * @augments CylinderGeometry
30872
+ * @demo scenes/geometry-browser.html#ConeGeometry
30770
30873
  */
30771
30874
  class ConeGeometry extends CylinderGeometry {
30772
30875
 
@@ -31175,6 +31278,7 @@ class PolyhedronGeometry extends BufferGeometry {
31175
31278
  * ```
31176
31279
  *
31177
31280
  * @augments PolyhedronGeometry
31281
+ * @demo scenes/geometry-browser.html#DodecahedronGeometry
31178
31282
  */
31179
31283
  class DodecahedronGeometry extends PolyhedronGeometry {
31180
31284
 
@@ -31494,7 +31598,7 @@ class Curve {
31494
31598
  */
31495
31599
  getPoint( /* t, optionalTarget */ ) {
31496
31600
 
31497
- console.warn( 'THREE.Curve: .getPoint() not implemented.' );
31601
+ warn( 'Curve: .getPoint() not implemented.' );
31498
31602
 
31499
31603
  }
31500
31604
 
@@ -32552,7 +32656,13 @@ class CatmullRomCurve3 extends Curve {
32552
32656
 
32553
32657
  }
32554
32658
 
32555
- // Bezier Curves formulas obtained from: https://en.wikipedia.org/wiki/B%C3%A9zier_curve
32659
+ /**
32660
+ * Interpolations contains spline and Bézier functions internally used by concrete curve classes.
32661
+ *
32662
+ * Bezier Curves formulas obtained from: https://en.wikipedia.org/wiki/B%C3%A9zier_curve
32663
+ *
32664
+ * @module Interpolations
32665
+ */
32556
32666
 
32557
32667
  /**
32558
32668
  * Computes a point on a Catmull-Rom spline.
@@ -34334,8 +34444,8 @@ class Shape extends Path {
34334
34444
  }
34335
34445
 
34336
34446
  /* eslint-disable */
34337
- // copy of mapbox/earcut version 3.0.1
34338
- // https://github.com/mapbox/earcut/tree/v3.0.1
34447
+ // copy of mapbox/earcut version 3.0.2
34448
+ // https://github.com/mapbox/earcut/tree/v3.0.2
34339
34449
 
34340
34450
  function earcut(data, holeIndices, dim = 2) {
34341
34451
 
@@ -34352,10 +34462,10 @@ function earcut(data, holeIndices, dim = 2) {
34352
34462
 
34353
34463
  // if the shape is not too simple, we'll use z-order curve hash later; calculate polygon bbox
34354
34464
  if (data.length > 80 * dim) {
34355
- minX = Infinity;
34356
- minY = Infinity;
34357
- let maxX = -Infinity;
34358
- let maxY = -Infinity;
34465
+ minX = data[0];
34466
+ minY = data[1];
34467
+ let maxX = minX;
34468
+ let maxY = minY;
34359
34469
 
34360
34470
  for (let i = dim; i < outerLen; i += dim) {
34361
34471
  const x = data[i];
@@ -34631,7 +34741,7 @@ function compareXYSlope(a, b) {
34631
34741
  return result;
34632
34742
  }
34633
34743
 
34634
- // find a bridge between vertices that connects hole with an outer ring and and link it
34744
+ // find a bridge between vertices that connects hole with an outer ring and link it
34635
34745
  function eliminateHole(hole, outerNode) {
34636
34746
  const bridge = findHoleBridge(hole, outerNode);
34637
34747
  if (!bridge) {
@@ -34969,6 +35079,12 @@ function signedArea(data, start, end, dim) {
34969
35079
  return sum;
34970
35080
  }
34971
35081
 
35082
+ /**
35083
+ * An implementation of the earcut polygon triangulation algorithm.
35084
+ * The code is a port of [mapbox/earcut](https://github.com/mapbox/earcut).
35085
+ *
35086
+ * @see https://github.com/mapbox/earcut
35087
+ */
34972
35088
  class Earcut {
34973
35089
 
34974
35090
  /**
@@ -35119,6 +35235,7 @@ function addContour( vertices, contour ) {
35119
35235
  * ```
35120
35236
  *
35121
35237
  * @augments BufferGeometry
35238
+ * @demo scenes/geometry-browser.html#ExtrudeGeometry
35122
35239
  */
35123
35240
  class ExtrudeGeometry extends BufferGeometry {
35124
35241
 
@@ -35207,7 +35324,7 @@ class ExtrudeGeometry extends BufferGeometry {
35207
35324
 
35208
35325
  splineTube = extrudePath.computeFrenetFrames( steps, false );
35209
35326
 
35210
- // console.log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);
35327
+ // log(splineTube, 'splineTube', splineTube.normals.length, 'steps', steps, 'extrudePts', extrudePts.length);
35211
35328
 
35212
35329
  binormal = new Vector3();
35213
35330
  normal = new Vector3();
@@ -35312,7 +35429,7 @@ class ExtrudeGeometry extends BufferGeometry {
35312
35429
 
35313
35430
  function scalePt2( pt, vec, size ) {
35314
35431
 
35315
- if ( ! vec ) console.error( 'THREE.ExtrudeGeometry: vec does not exist' );
35432
+ if ( ! vec ) error( 'ExtrudeGeometry: vec does not exist' );
35316
35433
 
35317
35434
  return pt.clone().addScaledVector( vec, size );
35318
35435
 
@@ -35427,14 +35544,14 @@ class ExtrudeGeometry extends BufferGeometry {
35427
35544
 
35428
35545
  if ( direction_eq ) {
35429
35546
 
35430
- // console.log("Warning: lines are a straight sequence");
35547
+ // log("Warning: lines are a straight sequence");
35431
35548
  v_trans_x = - v_prev_y;
35432
35549
  v_trans_y = v_prev_x;
35433
35550
  shrink_by = Math.sqrt( v_prev_lensq );
35434
35551
 
35435
35552
  } else {
35436
35553
 
35437
- // console.log("Warning: lines are a straight spike");
35554
+ // log("Warning: lines are a straight spike");
35438
35555
  v_trans_x = v_prev_x;
35439
35556
  v_trans_y = v_prev_y;
35440
35557
  shrink_by = Math.sqrt( v_prev_lensq / 2 );
@@ -35456,7 +35573,7 @@ class ExtrudeGeometry extends BufferGeometry {
35456
35573
  if ( k === il ) k = 0;
35457
35574
 
35458
35575
  // (j)---(i)---(k)
35459
- // console.log('i,j,k', i, j , k)
35576
+ // log('i,j,k', i, j , k)
35460
35577
 
35461
35578
  contourMovements[ i ] = getBevelVec( contour[ i ], contour[ j ], contour[ k ] );
35462
35579
 
@@ -35753,7 +35870,7 @@ class ExtrudeGeometry extends BufferGeometry {
35753
35870
  let k = i - 1;
35754
35871
  if ( k < 0 ) k = contour.length - 1;
35755
35872
 
35756
- //console.log('b', i,j, i-1, k,vertices.length);
35873
+ //log('b', i,j, i-1, k,vertices.length);
35757
35874
 
35758
35875
  for ( let s = 0, sl = ( steps + bevelSegments * 2 ); s < sl; s ++ ) {
35759
35876
 
@@ -35993,6 +36110,7 @@ function toJSON$1( shapes, options, data ) {
35993
36110
  * ```
35994
36111
  *
35995
36112
  * @augments PolyhedronGeometry
36113
+ * @demo scenes/geometry-browser.html#IcosahedronGeometry
35996
36114
  */
35997
36115
  class IcosahedronGeometry extends PolyhedronGeometry {
35998
36116
 
@@ -36067,6 +36185,7 @@ class IcosahedronGeometry extends PolyhedronGeometry {
36067
36185
  * ```
36068
36186
  *
36069
36187
  * @augments BufferGeometry
36188
+ * @demo scenes/geometry-browser.html#LatheGeometry
36070
36189
  */
36071
36190
  class LatheGeometry extends BufferGeometry {
36072
36191
 
@@ -36284,6 +36403,7 @@ class LatheGeometry extends BufferGeometry {
36284
36403
  * ```
36285
36404
  *
36286
36405
  * @augments PolyhedronGeometry
36406
+ * @demo scenes/geometry-browser.html#OctahedronGeometry
36287
36407
  */
36288
36408
  class OctahedronGeometry extends PolyhedronGeometry {
36289
36409
 
@@ -36350,6 +36470,7 @@ class OctahedronGeometry extends PolyhedronGeometry {
36350
36470
  * ```
36351
36471
  *
36352
36472
  * @augments BufferGeometry
36473
+ * @demo scenes/geometry-browser.html#PlaneGeometry
36353
36474
  */
36354
36475
  class PlaneGeometry extends BufferGeometry {
36355
36476
 
@@ -36478,6 +36599,7 @@ class PlaneGeometry extends BufferGeometry {
36478
36599
  * ```
36479
36600
  *
36480
36601
  * @augments BufferGeometry
36602
+ * @demo scenes/geometry-browser.html#RingGeometry
36481
36603
  */
36482
36604
  class RingGeometry extends BufferGeometry {
36483
36605
 
@@ -36639,6 +36761,7 @@ class RingGeometry extends BufferGeometry {
36639
36761
  * ```
36640
36762
  *
36641
36763
  * @augments BufferGeometry
36764
+ * @demo scenes/geometry-browser.html#ShapeGeometry
36642
36765
  */
36643
36766
  class ShapeGeometry extends BufferGeometry {
36644
36767
 
@@ -36860,6 +36983,7 @@ function toJSON( shapes, data ) {
36860
36983
  * ```
36861
36984
  *
36862
36985
  * @augments BufferGeometry
36986
+ * @demo scenes/geometry-browser.html#SphereGeometry
36863
36987
  */
36864
36988
  class SphereGeometry extends BufferGeometry {
36865
36989
 
@@ -37029,6 +37153,7 @@ class SphereGeometry extends BufferGeometry {
37029
37153
  * ```
37030
37154
  *
37031
37155
  * @augments PolyhedronGeometry
37156
+ * @demo scenes/geometry-browser.html#TetrahedronGeometry
37032
37157
  */
37033
37158
  class TetrahedronGeometry extends PolyhedronGeometry {
37034
37159
 
@@ -37092,6 +37217,7 @@ class TetrahedronGeometry extends PolyhedronGeometry {
37092
37217
  * ```
37093
37218
  *
37094
37219
  * @augments BufferGeometry
37220
+ * @demo scenes/geometry-browser.html#TorusGeometry
37095
37221
  */
37096
37222
  class TorusGeometry extends BufferGeometry {
37097
37223
 
@@ -37244,6 +37370,7 @@ class TorusGeometry extends BufferGeometry {
37244
37370
  * ```
37245
37371
  *
37246
37372
  * @augments BufferGeometry
37373
+ * @demo scenes/geometry-browser.html#TorusKnotGeometry
37247
37374
  */
37248
37375
  class TorusKnotGeometry extends BufferGeometry {
37249
37376
 
@@ -37456,6 +37583,7 @@ class TorusKnotGeometry extends BufferGeometry {
37456
37583
  * ```
37457
37584
  *
37458
37585
  * @augments BufferGeometry
37586
+ * @demo scenes/geometry-browser.html#TubeGeometry
37459
37587
  */
37460
37588
  class TubeGeometry extends BufferGeometry {
37461
37589
 
@@ -38003,9 +38131,9 @@ class RawShaderMaterial extends ShaderMaterial {
38003
38131
  * A standard physically based material, using Metallic-Roughness workflow.
38004
38132
  *
38005
38133
  * Physically based rendering (PBR) has recently become the standard in many
38006
- * 3D applications, such as [Unity]{@link https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/},
38007
- * [Unreal]{@link https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/} and
38008
- * [3D Studio Max]{@link http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017}.
38134
+ * 3D applications, such as [Unity](https://blogs.unity3d.com/2014/10/29/physically-based-shading-in-unity-5-a-primer/),
38135
+ * [Unreal](https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/PhysicallyBased/) and
38136
+ * [3D Studio Max](http://area.autodesk.com/blogs/the-3ds-max-blog/what039s-new-for-rendering-in-3ds-max-2017).
38009
38137
  *
38010
38138
  * This approach differs from older approaches in that instead of using
38011
38139
  * approximations for the way in which light interacts with a surface, a
@@ -38021,16 +38149,17 @@ class RawShaderMaterial extends ShaderMaterial {
38021
38149
  * Note that for best results you should always specify an environment map when using this material.
38022
38150
  *
38023
38151
  * For a non-technical introduction to the concept of PBR and how to set up a
38024
- * PBR material, check out these articles by the people at [marmoset]{@link https://www.marmoset.co}:
38152
+ * PBR material, check out these articles by the people at [marmoset](https://www.marmoset.co):
38025
38153
  *
38026
- * - [Basic Theory of Physically Based Rendering]{@link https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/}
38027
- * - [Physically Based Rendering and You Can Too]{@link https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/}
38154
+ * - [Basic Theory of Physically Based Rendering](https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/)
38155
+ * - [Physically Based Rendering and You Can Too](https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/)
38028
38156
  *
38029
38157
  * Technical details of the approach used in three.js (and most other PBR systems) can be found is this
38030
- * [paper from Disney]{@link https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf}
38158
+ * [paper from Disney](https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf)
38031
38159
  * (pdf), by Brent Burley.
38032
38160
  *
38033
38161
  * @augments Material
38162
+ * @demo scenes/material-browser.html#MeshStandardMaterial
38034
38163
  */
38035
38164
  class MeshStandardMaterial extends Material {
38036
38165
 
@@ -38440,6 +38569,7 @@ class MeshStandardMaterial extends Material {
38440
38569
  * best results, always specify an environment map when using this material.
38441
38570
  *
38442
38571
  * @augments MeshStandardMaterial
38572
+ * @demo scenes/material-browser.html#MeshPhysicalMaterial
38443
38573
  */
38444
38574
  class MeshPhysicalMaterial extends MeshStandardMaterial {
38445
38575
 
@@ -38736,7 +38866,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
38736
38866
  }
38737
38867
 
38738
38868
  /**
38739
- * The anisotropy strength.
38869
+ * The anisotropy strength, from `0.0` to `1.0`.
38740
38870
  *
38741
38871
  * @type {number}
38742
38872
  * @default 0
@@ -38948,7 +39078,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
38948
39078
  /**
38949
39079
  * A material for shiny surfaces with specular highlights.
38950
39080
  *
38951
- * The material uses a non-physically based [Blinn-Phong]{@link https://en.wikipedia.org/wiki/Blinn-Phong_shading_model}
39081
+ * The material uses a non-physically based [Blinn-Phong](https://en.wikipedia.org/wiki/Blinn-Phong_shading_model)
38952
39082
  * model for calculating reflectance. Unlike the Lambertian model used in the
38953
39083
  * {@link MeshLambertMaterial} this can simulate shiny surfaces with specular
38954
39084
  * highlights (such as varnished wood). `MeshPhongMaterial` uses per-fragment shading.
@@ -38958,6 +39088,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
38958
39088
  * some graphical accuracy.
38959
39089
  *
38960
39090
  * @augments Material
39091
+ * @demo scenes/material-browser.html#MeshPhongMaterial
38961
39092
  */
38962
39093
  class MeshPhongMaterial extends Material {
38963
39094
 
@@ -39353,6 +39484,7 @@ class MeshPhongMaterial extends Material {
39353
39484
  * A material implementing toon shading.
39354
39485
  *
39355
39486
  * @augments Material
39487
+ * @demo scenes/material-browser.html#MeshToonMaterial
39356
39488
  */
39357
39489
  class MeshToonMaterial extends Material {
39358
39490
 
@@ -39667,6 +39799,7 @@ class MeshToonMaterial extends Material {
39667
39799
  * A material that maps the normal vectors to RGB colors.
39668
39800
  *
39669
39801
  * @augments Material
39802
+ * @demo scenes/material-browser.html#MeshNormalMaterial
39670
39803
  */
39671
39804
  class MeshNormalMaterial extends Material {
39672
39805
 
@@ -39835,7 +39968,7 @@ class MeshNormalMaterial extends Material {
39835
39968
  /**
39836
39969
  * A material for non-shiny surfaces, without specular highlights.
39837
39970
  *
39838
- * The material uses a non-physically based [Lambertian]{@link https://en.wikipedia.org/wiki/Lambertian_reflectance}
39971
+ * The material uses a non-physically based [Lambertian](https://en.wikipedia.org/wiki/Lambertian_reflectance)
39839
39972
  * model for calculating reflectance. This can simulate some surfaces (such
39840
39973
  * as untreated wood or stone) well, but cannot simulate shiny surfaces with
39841
39974
  * specular highlights (such as varnished wood). `MeshLambertMaterial` uses per-fragment
@@ -39847,6 +39980,7 @@ class MeshNormalMaterial extends Material {
39847
39980
  * {@link MeshPhysicalMaterial}, at the cost of some graphical accuracy.
39848
39981
  *
39849
39982
  * @augments Material
39983
+ * @demo scenes/material-browser.html#MeshLambertMaterial
39850
39984
  */
39851
39985
  class MeshLambertMaterial extends Material {
39852
39986
 
@@ -40222,6 +40356,7 @@ class MeshLambertMaterial extends Material {
40222
40356
  * near and far plane. White is nearest, black is farthest.
40223
40357
  *
40224
40358
  * @augments Material
40359
+ * @demo scenes/material-browser.html#MeshDepthMaterial
40225
40360
  */
40226
40361
  class MeshDepthMaterial extends Material {
40227
40362
 
@@ -40486,6 +40621,7 @@ class MeshDistanceMaterial extends Material {
40486
40621
  * shadows.
40487
40622
  *
40488
40623
  * @augments Material
40624
+ * @demo scenes/material-browser.html#MeshMatcapMaterial
40489
40625
  */
40490
40626
  class MeshMatcapMaterial extends Material {
40491
40627
 
@@ -40637,6 +40773,24 @@ class MeshMatcapMaterial extends Material {
40637
40773
  */
40638
40774
  this.alphaMap = null;
40639
40775
 
40776
+ /**
40777
+ * Renders the geometry as a wireframe.
40778
+ *
40779
+ * @type {boolean}
40780
+ * @default false
40781
+ */
40782
+ this.wireframe = false;
40783
+
40784
+ /**
40785
+ * Controls the thickness of the wireframe.
40786
+ *
40787
+ * Can only be used with {@link SVGRenderer}.
40788
+ *
40789
+ * @type {number}
40790
+ * @default 1
40791
+ */
40792
+ this.wireframeLinewidth = 1;
40793
+
40640
40794
  /**
40641
40795
  * Whether the material is rendered with flat shading or not.
40642
40796
  *
@@ -40683,6 +40837,9 @@ class MeshMatcapMaterial extends Material {
40683
40837
 
40684
40838
  this.alphaMap = source.alphaMap;
40685
40839
 
40840
+ this.wireframe = source.wireframe;
40841
+ this.wireframeLinewidth = source.wireframeLinewidth;
40842
+
40686
40843
  this.flatShading = source.flatShading;
40687
40844
 
40688
40845
  this.fog = source.fog;
@@ -42003,7 +42160,7 @@ class KeyframeTrack {
42003
42160
 
42004
42161
  }
42005
42162
 
42006
- console.warn( 'THREE.KeyframeTrack:', message );
42163
+ warn( 'KeyframeTrack:', message );
42007
42164
  return this;
42008
42165
 
42009
42166
  }
@@ -42163,7 +42320,7 @@ class KeyframeTrack {
42163
42320
  const valueSize = this.getValueSize();
42164
42321
  if ( valueSize - Math.floor( valueSize ) !== 0 ) {
42165
42322
 
42166
- console.error( 'THREE.KeyframeTrack: Invalid value size in track.', this );
42323
+ error( 'KeyframeTrack: Invalid value size in track.', this );
42167
42324
  valid = false;
42168
42325
 
42169
42326
  }
@@ -42175,7 +42332,7 @@ class KeyframeTrack {
42175
42332
 
42176
42333
  if ( nKeys === 0 ) {
42177
42334
 
42178
- console.error( 'THREE.KeyframeTrack: Track is empty.', this );
42335
+ error( 'KeyframeTrack: Track is empty.', this );
42179
42336
  valid = false;
42180
42337
 
42181
42338
  }
@@ -42188,7 +42345,7 @@ class KeyframeTrack {
42188
42345
 
42189
42346
  if ( typeof currTime === 'number' && isNaN( currTime ) ) {
42190
42347
 
42191
- console.error( 'THREE.KeyframeTrack: Time is not a valid number.', this, i, currTime );
42348
+ error( 'KeyframeTrack: Time is not a valid number.', this, i, currTime );
42192
42349
  valid = false;
42193
42350
  break;
42194
42351
 
@@ -42196,7 +42353,7 @@ class KeyframeTrack {
42196
42353
 
42197
42354
  if ( prevTime !== null && prevTime > currTime ) {
42198
42355
 
42199
- console.error( 'THREE.KeyframeTrack: Out of order keys.', this, i, currTime, prevTime );
42356
+ error( 'KeyframeTrack: Out of order keys.', this, i, currTime, prevTime );
42200
42357
  valid = false;
42201
42358
  break;
42202
42359
 
@@ -42216,7 +42373,7 @@ class KeyframeTrack {
42216
42373
 
42217
42374
  if ( isNaN( value ) ) {
42218
42375
 
42219
- console.error( 'THREE.KeyframeTrack: Value is not a valid number.', this, i, value );
42376
+ error( 'KeyframeTrack: Value is not a valid number.', this, i, value );
42220
42377
  valid = false;
42221
42378
  break;
42222
42379
 
@@ -42986,11 +43143,11 @@ class AnimationClip {
42986
43143
  */
42987
43144
  static parseAnimation( animation, bones ) {
42988
43145
 
42989
- console.warn( 'THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185' );
43146
+ warn( 'AnimationClip: parseAnimation() is deprecated and will be removed with r185' );
42990
43147
 
42991
43148
  if ( ! animation ) {
42992
43149
 
42993
- console.error( 'THREE.AnimationClip: No animation in JSONLoader data.' );
43150
+ error( 'AnimationClip: No animation in JSONLoader data.' );
42994
43151
  return null;
42995
43152
 
42996
43153
  }
@@ -43342,7 +43499,7 @@ const Cache = {
43342
43499
 
43343
43500
  if ( this.enabled === false ) return;
43344
43501
 
43345
- // console.log( 'THREE.Cache', 'Adding key:', key );
43502
+ // log( 'Cache', 'Adding key:', key );
43346
43503
 
43347
43504
  this.files[ key ] = file;
43348
43505
 
@@ -43359,7 +43516,7 @@ const Cache = {
43359
43516
 
43360
43517
  if ( this.enabled === false ) return;
43361
43518
 
43362
- // console.log( 'THREE.Cache', 'Checking key:', key );
43519
+ // log( 'Cache', 'Checking key:', key );
43363
43520
 
43364
43521
  return this.files[ key ];
43365
43522
 
@@ -43464,9 +43621,10 @@ class LoadingManager {
43464
43621
  /**
43465
43622
  * Used for aborting ongoing requests in loaders using this manager.
43466
43623
  *
43467
- * @type {AbortController}
43624
+ * @private
43625
+ * @type {AbortController | null}
43468
43626
  */
43469
- this.abortController = new AbortController();
43627
+ this._abortController = null;
43470
43628
 
43471
43629
  /**
43472
43630
  * This should be called by any loader using the manager when the loader
@@ -43677,8 +43835,9 @@ class LoadingManager {
43677
43835
  */
43678
43836
  this.abort = function () {
43679
43837
 
43838
+
43680
43839
  this.abortController.abort();
43681
- this.abortController = new AbortController();
43840
+ this._abortController = null;
43682
43841
 
43683
43842
  return this;
43684
43843
 
@@ -43686,6 +43845,26 @@ class LoadingManager {
43686
43845
 
43687
43846
  }
43688
43847
 
43848
+ // TODO: Revert this back to a single member variable once this issue has been fixed
43849
+ // https://github.com/cloudflare/workerd/issues/3657
43850
+
43851
+ /**
43852
+ * Used for aborting ongoing requests in loaders using this manager.
43853
+ *
43854
+ * @type {AbortController}
43855
+ */
43856
+ get abortController() {
43857
+
43858
+ if ( ! this._abortController ) {
43859
+
43860
+ this._abortController = new AbortController();
43861
+
43862
+ }
43863
+
43864
+ return this._abortController;
43865
+
43866
+ }
43867
+
43689
43868
  }
43690
43869
 
43691
43870
  /**
@@ -43750,7 +43929,7 @@ class Loader {
43750
43929
  this.resourcePath = '';
43751
43930
 
43752
43931
  /**
43753
- * The [request header]{@link https://developer.mozilla.org/en-US/docs/Glossary/Request_header}
43932
+ * The [request header](https://developer.mozilla.org/en-US/docs/Glossary/Request_header)
43754
43933
  * used in HTTP request.
43755
43934
  *
43756
43935
  * @type {Object<string, any>}
@@ -43815,7 +43994,7 @@ class Loader {
43815
43994
 
43816
43995
  /**
43817
43996
  * Whether the XMLHttpRequest uses credentials such as cookies, authorization
43818
- * headers or TLS client certificates, see [XMLHttpRequest.withCredentials]{@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials}.
43997
+ * headers or TLS client certificates, see [XMLHttpRequest.withCredentials](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials).
43819
43998
  *
43820
43999
  * Note: This setting has no effect if you are loading files locally or from the same domain.
43821
44000
  *
@@ -43858,7 +44037,7 @@ class Loader {
43858
44037
  /**
43859
44038
  * Sets the given request header.
43860
44039
  *
43861
- * @param {Object} requestHeader - A [request header]{@link https://developer.mozilla.org/en-US/docs/Glossary/Request_header}
44040
+ * @param {Object} requestHeader - A [request header](https://developer.mozilla.org/en-US/docs/Glossary/Request_header)
43862
44041
  * for configuring the HTTP request.
43863
44042
  * @return {Loader} A reference to this instance.
43864
44043
  */
@@ -43950,7 +44129,7 @@ class FileLoader extends Loader {
43950
44129
 
43951
44130
  /**
43952
44131
  * The expected mime type. Valid values can be found
43953
- * [here]{@link hhttps://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#mimetype}
44132
+ * [here](hhttps://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#mimetype)
43954
44133
  *
43955
44134
  * @type {string}
43956
44135
  */
@@ -44056,7 +44235,7 @@ class FileLoader extends Loader {
44056
44235
 
44057
44236
  if ( response.status === 0 ) {
44058
44237
 
44059
- console.warn( 'THREE.FileLoader: HTTP Status 0 received.' );
44238
+ warn( 'FileLoader: HTTP Status 0 received.' );
44060
44239
 
44061
44240
  }
44062
44241
 
@@ -44326,7 +44505,7 @@ class AnimationLoader extends Loader {
44326
44505
 
44327
44506
  } else {
44328
44507
 
44329
- console.error( e );
44508
+ error( e );
44330
44509
 
44331
44510
  }
44332
44511
 
@@ -44521,7 +44700,7 @@ const _loading = new WeakMap();
44521
44700
  * ```
44522
44701
  * Please note that `ImageLoader` has dropped support for progress
44523
44702
  * events in `r84`. For an `ImageLoader` that supports progress events, see
44524
- * [this thread]{@link https://github.com/mrdoob/three.js/issues/10439#issuecomment-275785639}.
44703
+ * [this thread](https://github.com/mrdoob/three.js/issues/10439#issuecomment-275785639).
44525
44704
  *
44526
44705
  * @augments Loader
44527
44706
  */
@@ -44830,7 +45009,7 @@ class DataTextureLoader extends Loader {
44830
45009
 
44831
45010
  } else {
44832
45011
 
44833
- console.error( error );
45012
+ error( error );
44834
45013
  return;
44835
45014
 
44836
45015
  }
@@ -44925,7 +45104,7 @@ class DataTextureLoader extends Loader {
44925
45104
  * ```
44926
45105
  * Please note that `TextureLoader` has dropped support for progress
44927
45106
  * events in `r84`. For a `TextureLoader` that supports progress events, see
44928
- * [this thread]{@link https://github.com/mrdoob/three.js/issues/10439#issuecomment-293260145}.
45107
+ * [this thread](https://github.com/mrdoob/three.js/issues/10439#issuecomment-293260145).
44929
45108
  *
44930
45109
  * @augments Loader
44931
45110
  */
@@ -45928,7 +46107,7 @@ class PointLight extends Light {
45928
46107
  }
45929
46108
 
45930
46109
  /**
45931
- * Camera that uses [orthographic projection]{@link https://en.wikipedia.org/wiki/Orthographic_projection}.
46110
+ * Camera that uses [orthographic projection](https://en.wikipedia.org/wiki/Orthographic_projection).
45932
46111
  *
45933
46112
  * In this projection mode, an object's size in the rendered image stays
45934
46113
  * constant regardless of its distance from the camera. This can be useful
@@ -46928,7 +47107,7 @@ class MaterialLoader extends Loader {
46928
47107
 
46929
47108
  } else {
46930
47109
 
46931
- console.error( e );
47110
+ error( e );
46932
47111
 
46933
47112
  }
46934
47113
 
@@ -46954,7 +47133,7 @@ class MaterialLoader extends Loader {
46954
47133
 
46955
47134
  if ( textures[ name ] === undefined ) {
46956
47135
 
46957
- console.warn( 'THREE.MaterialLoader: Undefined texture', name );
47136
+ warn( 'MaterialLoader: Undefined texture', name );
46958
47137
 
46959
47138
  }
46960
47139
 
@@ -47446,7 +47625,7 @@ class BufferGeometryLoader extends Loader {
47446
47625
 
47447
47626
  } else {
47448
47627
 
47449
- console.error( e );
47628
+ error( e );
47450
47629
 
47451
47630
  }
47452
47631
 
@@ -47619,7 +47798,7 @@ class BufferGeometryLoader extends Loader {
47619
47798
  }
47620
47799
 
47621
47800
  /**
47622
- * A loader for loading a JSON resource in the [JSON Object/Scene format]{@link https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4}.
47801
+ * A loader for loading a JSON resource in the [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4).
47623
47802
  * The files are internally loaded via {@link FileLoader}.
47624
47803
  *
47625
47804
  * ```js
@@ -47678,7 +47857,7 @@ class ObjectLoader extends Loader {
47678
47857
 
47679
47858
  if ( onError !== undefined ) onError( error );
47680
47859
 
47681
- console.error( 'THREE:ObjectLoader: Can\'t parse ' + url + '.', error.message );
47860
+ error( 'ObjectLoader: Can\'t parse ' + url + '.', error.message );
47682
47861
 
47683
47862
  return;
47684
47863
 
@@ -47690,7 +47869,7 @@ class ObjectLoader extends Loader {
47690
47869
 
47691
47870
  if ( onError !== undefined ) onError( new Error( 'THREE.ObjectLoader: Can\'t load ' + url ) );
47692
47871
 
47693
- console.error( 'THREE.ObjectLoader: Can\'t load ' + url );
47872
+ error( 'ObjectLoader: Can\'t load ' + url );
47694
47873
  return;
47695
47874
 
47696
47875
  }
@@ -47900,7 +48079,7 @@ class ObjectLoader extends Loader {
47900
48079
 
47901
48080
  } else {
47902
48081
 
47903
- console.warn( `THREE.ObjectLoader: Unsupported geometry type "${ data.type }"` );
48082
+ warn( `ObjectLoader: Unsupported geometry type "${ data.type }"` );
47904
48083
 
47905
48084
  }
47906
48085
 
@@ -48191,7 +48370,7 @@ class ObjectLoader extends Loader {
48191
48370
 
48192
48371
  if ( typeof value === 'number' ) return value;
48193
48372
 
48194
- console.warn( 'THREE.ObjectLoader.parseTexture: Constant should be in numeric form.', value );
48373
+ warn( 'ObjectLoader.parseTexture: Constant should be in numeric form.', value );
48195
48374
 
48196
48375
  return type[ value ];
48197
48376
 
@@ -48207,13 +48386,13 @@ class ObjectLoader extends Loader {
48207
48386
 
48208
48387
  if ( data.image === undefined ) {
48209
48388
 
48210
- console.warn( 'THREE.ObjectLoader: No "image" specified for', data.uuid );
48389
+ warn( 'ObjectLoader: No "image" specified for', data.uuid );
48211
48390
 
48212
48391
  }
48213
48392
 
48214
48393
  if ( images[ data.image ] === undefined ) {
48215
48394
 
48216
- console.warn( 'THREE.ObjectLoader: Undefined image', data.image );
48395
+ warn( 'ObjectLoader: Undefined image', data.image );
48217
48396
 
48218
48397
  }
48219
48398
 
@@ -48301,7 +48480,7 @@ class ObjectLoader extends Loader {
48301
48480
 
48302
48481
  if ( geometries[ name ] === undefined ) {
48303
48482
 
48304
- console.warn( 'THREE.ObjectLoader: Undefined geometry', name );
48483
+ warn( 'ObjectLoader: Undefined geometry', name );
48305
48484
 
48306
48485
  }
48307
48486
 
@@ -48323,7 +48502,7 @@ class ObjectLoader extends Loader {
48323
48502
 
48324
48503
  if ( materials[ uuid ] === undefined ) {
48325
48504
 
48326
- console.warn( 'THREE.ObjectLoader: Undefined material', uuid );
48505
+ warn( 'ObjectLoader: Undefined material', uuid );
48327
48506
 
48328
48507
  }
48329
48508
 
@@ -48337,7 +48516,7 @@ class ObjectLoader extends Loader {
48337
48516
 
48338
48517
  if ( materials[ name ] === undefined ) {
48339
48518
 
48340
- console.warn( 'THREE.ObjectLoader: Undefined material', name );
48519
+ warn( 'ObjectLoader: Undefined material', name );
48341
48520
 
48342
48521
  }
48343
48522
 
@@ -48349,7 +48528,7 @@ class ObjectLoader extends Loader {
48349
48528
 
48350
48529
  if ( textures[ uuid ] === undefined ) {
48351
48530
 
48352
- console.warn( 'THREE.ObjectLoader: Undefined texture', uuid );
48531
+ warn( 'ObjectLoader: Undefined texture', uuid );
48353
48532
 
48354
48533
  }
48355
48534
 
@@ -48750,7 +48929,7 @@ class ObjectLoader extends Loader {
48750
48929
 
48751
48930
  if ( skeleton === undefined ) {
48752
48931
 
48753
- console.warn( 'THREE.ObjectLoader: No skeleton found with UUID:', child.skeleton );
48932
+ warn( 'ObjectLoader: No skeleton found with UUID:', child.skeleton );
48754
48933
 
48755
48934
  } else {
48756
48935
 
@@ -48821,7 +49000,7 @@ const TEXTURE_FILTER = {
48821
49000
  const _errorMap = new WeakMap();
48822
49001
 
48823
49002
  /**
48824
- * A loader for loading images as an [ImageBitmap]{@link https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap}.
49003
+ * A loader for loading images as an [ImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap).
48825
49004
  * An `ImageBitmap` provides an asynchronous and resource efficient pathway to prepare
48826
49005
  * textures for rendering.
48827
49006
  *
@@ -48865,13 +49044,13 @@ class ImageBitmapLoader extends Loader {
48865
49044
 
48866
49045
  if ( typeof createImageBitmap === 'undefined' ) {
48867
49046
 
48868
- console.warn( 'THREE.ImageBitmapLoader: createImageBitmap() not supported.' );
49047
+ warn( 'ImageBitmapLoader: createImageBitmap() not supported.' );
48869
49048
 
48870
49049
  }
48871
49050
 
48872
49051
  if ( typeof fetch === 'undefined' ) {
48873
49052
 
48874
- console.warn( 'THREE.ImageBitmapLoader: fetch() not supported.' );
49053
+ warn( 'ImageBitmapLoader: fetch() not supported.' );
48875
49054
 
48876
49055
  }
48877
49056
 
@@ -48895,7 +49074,7 @@ class ImageBitmapLoader extends Loader {
48895
49074
 
48896
49075
  /**
48897
49076
  * Sets the given loader options. The structure of the object must match the `options` parameter of
48898
- * [createImageBitmap]{@link https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap}.
49077
+ * [createImageBitmap](https://developer.mozilla.org/en-US/docs/Web/API/Window/createImageBitmap).
48899
49078
  *
48900
49079
  * @param {Object} options - The loader options to set.
48901
49080
  * @return {ImageBitmapLoader} A reference to this image bitmap loader.
@@ -49151,7 +49330,7 @@ class AudioLoader extends Loader {
49151
49330
 
49152
49331
  } else {
49153
49332
 
49154
- console.error( e );
49333
+ error( e );
49155
49334
 
49156
49335
  }
49157
49336
 
@@ -49170,8 +49349,8 @@ const _projectionMatrix = /*@__PURE__*/ new Matrix4();
49170
49349
  /**
49171
49350
  * A special type of camera that uses two perspective cameras with
49172
49351
  * stereoscopic projection. Can be used for rendering stereo effects
49173
- * like [3D Anaglyph]{@link https://en.wikipedia.org/wiki/Anaglyph_3D} or
49174
- * [Parallax Barrier]{@link https://en.wikipedia.org/wiki/parallax_barrier}.
49352
+ * like [3D Anaglyph](https://en.wikipedia.org/wiki/Anaglyph_3D) or
49353
+ * [Parallax Barrier](https://en.wikipedia.org/wiki/parallax_barrier).
49175
49354
  */
49176
49355
  class StereoCamera {
49177
49356
 
@@ -49694,7 +49873,7 @@ class AudioListener extends Object3D {
49694
49873
  /**
49695
49874
  * Represents a non-positional ( global ) audio object.
49696
49875
  *
49697
- * This and related audio modules make use of the [Web Audio API]{@link https://www.w3.org/TR/webaudio-1.1/}.
49876
+ * This and related audio modules make use of the [Web Audio API](https://www.w3.org/TR/webaudio-1.1/).
49698
49877
  *
49699
49878
  * ```js
49700
49879
  * // create an AudioListener and add it to the camera
@@ -50005,14 +50184,14 @@ class Audio extends Object3D {
50005
50184
 
50006
50185
  if ( this.isPlaying === true ) {
50007
50186
 
50008
- console.warn( 'THREE.Audio: Audio is already playing.' );
50187
+ warn( 'Audio: Audio is already playing.' );
50009
50188
  return;
50010
50189
 
50011
50190
  }
50012
50191
 
50013
50192
  if ( this.hasPlaybackControl === false ) {
50014
50193
 
50015
- console.warn( 'THREE.Audio: this Audio has no playback control.' );
50194
+ warn( 'Audio: this Audio has no playback control.' );
50016
50195
  return;
50017
50196
 
50018
50197
  }
@@ -50049,7 +50228,7 @@ class Audio extends Object3D {
50049
50228
 
50050
50229
  if ( this.hasPlaybackControl === false ) {
50051
50230
 
50052
- console.warn( 'THREE.Audio: this Audio has no playback control.' );
50231
+ warn( 'Audio: this Audio has no playback control.' );
50053
50232
  return;
50054
50233
 
50055
50234
  }
@@ -50091,7 +50270,7 @@ class Audio extends Object3D {
50091
50270
 
50092
50271
  if ( this.hasPlaybackControl === false ) {
50093
50272
 
50094
- console.warn( 'THREE.Audio: this Audio has no playback control.' );
50273
+ warn( 'Audio: this Audio has no playback control.' );
50095
50274
  return;
50096
50275
 
50097
50276
  }
@@ -50284,7 +50463,7 @@ class Audio extends Object3D {
50284
50463
 
50285
50464
  if ( this.hasPlaybackControl === false ) {
50286
50465
 
50287
- console.warn( 'THREE.Audio: this Audio has no playback control.' );
50466
+ warn( 'Audio: this Audio has no playback control.' );
50288
50467
  return;
50289
50468
 
50290
50469
  }
@@ -50333,7 +50512,7 @@ class Audio extends Object3D {
50333
50512
 
50334
50513
  if ( this.hasPlaybackControl === false ) {
50335
50514
 
50336
- console.warn( 'THREE.Audio: this Audio has no playback control.' );
50515
+ warn( 'Audio: this Audio has no playback control.' );
50337
50516
  return false;
50338
50517
 
50339
50518
  }
@@ -50354,7 +50533,7 @@ class Audio extends Object3D {
50354
50533
 
50355
50534
  if ( this.hasPlaybackControl === false ) {
50356
50535
 
50357
- console.warn( 'THREE.Audio: this Audio has no playback control.' );
50536
+ warn( 'Audio: this Audio has no playback control.' );
50358
50537
  return;
50359
50538
 
50360
50539
  }
@@ -50432,7 +50611,7 @@ class Audio extends Object3D {
50432
50611
 
50433
50612
  if ( source.sourceType !== 'buffer' ) {
50434
50613
 
50435
- console.warn( 'THREE.Audio: Audio source type cannot be copied.' );
50614
+ warn( 'Audio: Audio source type cannot be copied.' );
50436
50615
 
50437
50616
  return this;
50438
50617
 
@@ -50617,7 +50796,7 @@ class PositionalAudio extends Audio {
50617
50796
  * Defines which algorithm to use to reduce the volume of the audio source
50618
50797
  * as it moves away from the listener.
50619
50798
  *
50620
- * Read [the spec]{@link https://www.w3.org/TR/webaudio-1.1/#enumdef-distancemodeltype}
50799
+ * Read [the spec](https://www.w3.org/TR/webaudio-1.1/#enumdef-distancemodeltype)
50621
50800
  * for more details.
50622
50801
  *
50623
50802
  * @param {('linear'|'inverse'|'exponential')} value - The distance model to set.
@@ -51699,7 +51878,7 @@ class PropertyBinding {
51699
51878
  // ensure there is a value node
51700
51879
  if ( ! targetObject ) {
51701
51880
 
51702
- console.warn( 'THREE.PropertyBinding: No target node found for track: ' + this.path + '.' );
51881
+ warn( 'PropertyBinding: No target node found for track: ' + this.path + '.' );
51703
51882
  return;
51704
51883
 
51705
51884
  }
@@ -51715,14 +51894,14 @@ class PropertyBinding {
51715
51894
 
51716
51895
  if ( ! targetObject.material ) {
51717
51896
 
51718
- console.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this );
51897
+ error( 'PropertyBinding: Can not bind to material as node does not have a material.', this );
51719
51898
  return;
51720
51899
 
51721
51900
  }
51722
51901
 
51723
51902
  if ( ! targetObject.material.materials ) {
51724
51903
 
51725
- console.error( 'THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this );
51904
+ error( 'PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.', this );
51726
51905
  return;
51727
51906
 
51728
51907
  }
@@ -51735,7 +51914,7 @@ class PropertyBinding {
51735
51914
 
51736
51915
  if ( ! targetObject.skeleton ) {
51737
51916
 
51738
- console.error( 'THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.', this );
51917
+ error( 'PropertyBinding: Can not bind to bones as node does not have a skeleton.', this );
51739
51918
  return;
51740
51919
 
51741
51920
  }
@@ -51770,14 +51949,14 @@ class PropertyBinding {
51770
51949
 
51771
51950
  if ( ! targetObject.material ) {
51772
51951
 
51773
- console.error( 'THREE.PropertyBinding: Can not bind to material as node does not have a material.', this );
51952
+ error( 'PropertyBinding: Can not bind to material as node does not have a material.', this );
51774
51953
  return;
51775
51954
 
51776
51955
  }
51777
51956
 
51778
51957
  if ( ! targetObject.material.map ) {
51779
51958
 
51780
- console.error( 'THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.', this );
51959
+ error( 'PropertyBinding: Can not bind to material.map as node.material does not have a map.', this );
51781
51960
  return;
51782
51961
 
51783
51962
  }
@@ -51789,7 +51968,7 @@ class PropertyBinding {
51789
51968
 
51790
51969
  if ( targetObject[ objectName ] === undefined ) {
51791
51970
 
51792
- console.error( 'THREE.PropertyBinding: Can not bind to objectName of node undefined.', this );
51971
+ error( 'PropertyBinding: Can not bind to objectName of node undefined.', this );
51793
51972
  return;
51794
51973
 
51795
51974
  }
@@ -51803,7 +51982,7 @@ class PropertyBinding {
51803
51982
 
51804
51983
  if ( targetObject[ objectIndex ] === undefined ) {
51805
51984
 
51806
- console.error( 'THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject );
51985
+ error( 'PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.', this, targetObject );
51807
51986
  return;
51808
51987
 
51809
51988
  }
@@ -51821,7 +52000,7 @@ class PropertyBinding {
51821
52000
 
51822
52001
  const nodeName = parsedPath.nodeName;
51823
52002
 
51824
- console.error( 'THREE.PropertyBinding: Trying to update property for track: ' + nodeName +
52003
+ error( 'PropertyBinding: Trying to update property for track: ' + nodeName +
51825
52004
  '.' + propertyName + ' but it wasn\'t found.', targetObject );
51826
52005
  return;
51827
52006
 
@@ -51856,14 +52035,14 @@ class PropertyBinding {
51856
52035
  // support resolving morphTarget names into indices.
51857
52036
  if ( ! targetObject.geometry ) {
51858
52037
 
51859
- console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this );
52038
+ error( 'PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.', this );
51860
52039
  return;
51861
52040
 
51862
52041
  }
51863
52042
 
51864
52043
  if ( ! targetObject.geometry.morphAttributes ) {
51865
52044
 
51866
- console.error( 'THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this );
52045
+ error( 'PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.', this );
51867
52046
  return;
51868
52047
 
51869
52048
  }
@@ -52155,7 +52334,7 @@ class AnimationObjectGroup {
52155
52334
 
52156
52335
  } else if ( objects[ index ] !== knownObject ) {
52157
52336
 
52158
- console.error( 'THREE.AnimationObjectGroup: Different objects with the same UUID ' +
52337
+ error( 'AnimationObjectGroup: Different objects with the same UUID ' +
52159
52338
  'detected. Clean the caches or recreate your infrastructure when reloading scenes.' );
52160
52339
 
52161
52340
  } // else the object is already where we want it to be
@@ -53950,7 +54129,7 @@ class AnimationMixer extends EventDispatcher {
53950
54129
  /**
53951
54130
  * Deactivates all previously scheduled actions on this mixer.
53952
54131
  *
53953
- * @return {AnimationMixer} A reference to thi animation mixer.
54132
+ * @return {AnimationMixer} A reference to this animation mixer.
53954
54133
  */
53955
54134
  stopAllAction() {
53956
54135
 
@@ -53974,7 +54153,7 @@ class AnimationMixer extends EventDispatcher {
53974
54153
  * time from {@link Clock} or {@link Timer}.
53975
54154
  *
53976
54155
  * @param {number} deltaTime - The delta time in seconds.
53977
- * @return {AnimationMixer} A reference to thi animation mixer.
54156
+ * @return {AnimationMixer} A reference to this animation mixer.
53978
54157
  */
53979
54158
  update( deltaTime ) {
53980
54159
 
@@ -54020,7 +54199,7 @@ class AnimationMixer extends EventDispatcher {
54020
54199
  * input parameter will be scaled by {@link AnimationMixer#timeScale}
54021
54200
  *
54022
54201
  * @param {number} time - The time to set in seconds.
54023
- * @return {AnimationMixer} A reference to thi animation mixer.
54202
+ * @return {AnimationMixer} A reference to this animation mixer.
54024
54203
  */
54025
54204
  setTime( time ) {
54026
54205
 
@@ -54795,7 +54974,7 @@ class Raycaster {
54795
54974
 
54796
54975
  } else {
54797
54976
 
54798
- console.error( 'THREE.Raycaster: Unsupported camera type: ' + camera.type );
54977
+ error( 'Raycaster: Unsupported camera type: ' + camera.type );
54799
54978
 
54800
54979
  }
54801
54980
 
@@ -55107,7 +55286,7 @@ function handleVisibilityChange() {
55107
55286
 
55108
55287
  /**
55109
55288
  * This class can be used to represent points in 3D space as
55110
- * [Spherical coordinates]{@link https://en.wikipedia.org/wiki/Spherical_coordinate_system}.
55289
+ * [Spherical coordinates](https://en.wikipedia.org/wiki/Spherical_coordinate_system).
55111
55290
  */
55112
55291
  class Spherical {
55113
55292
 
@@ -55251,7 +55430,7 @@ class Spherical {
55251
55430
 
55252
55431
  /**
55253
55432
  * This class can be used to represent points in 3D space as
55254
- * [Cylindrical coordinates]{@link https://en.wikipedia.org/wiki/Cylindrical_coordinate_system}.
55433
+ * [Cylindrical coordinates](https://en.wikipedia.org/wiki/Cylindrical_coordinate_system).
55255
55434
  */
55256
55435
  class Cylindrical {
55257
55436
 
@@ -55374,7 +55553,7 @@ class Cylindrical {
55374
55553
  * A Note on Row-Major and Column-Major Ordering:
55375
55554
  *
55376
55555
  * The constructor and {@link Matrix2#set} method take arguments in
55377
- * [row-major]{@link https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order}
55556
+ * [row-major](https://en.wikipedia.org/wiki/Row-_and_column-major_order#Column-major_order)
55378
55557
  * order, while internally they are stored in the {@link Matrix2#elements} array in column-major order.
55379
55558
  * This means that calling:
55380
55559
  * ```js
@@ -57110,7 +57289,7 @@ const _camera = /*@__PURE__*/ new Camera();
57110
57289
  * This helps with visualizing what a camera contains in its frustum. It
57111
57290
  * visualizes the frustum of a camera using a line segments.
57112
57291
  *
57113
- * Based on frustum visualization in [lightgl.js shadowmap example]{@link https://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html}.
57292
+ * Based on frustum visualization in [lightgl.js shadowmap example](https://github.com/evanw/lightgl.js/blob/master/tests/shadowmap.html).
57114
57293
  *
57115
57294
  * `CameraHelper` must be a child of the scene.
57116
57295
  *
@@ -58222,7 +58401,7 @@ class ShapePath {
58222
58401
  let holesFirst = ! isClockWise( subPaths[ 0 ].getPoints() );
58223
58402
  holesFirst = isCCW ? ! holesFirst : holesFirst;
58224
58403
 
58225
- // console.log("Holes first", holesFirst);
58404
+ // log("Holes first", holesFirst);
58226
58405
 
58227
58406
  const betterShapeHoles = [];
58228
58407
  const newShapes = [];
@@ -58250,13 +58429,13 @@ class ShapePath {
58250
58429
  if ( holesFirst ) mainIdx ++;
58251
58430
  newShapeHoles[ mainIdx ] = [];
58252
58431
 
58253
- //console.log('cw', i);
58432
+ //log('cw', i);
58254
58433
 
58255
58434
  } else {
58256
58435
 
58257
58436
  newShapeHoles[ mainIdx ].push( { h: tmpPath, p: tmpPoints[ 0 ] } );
58258
58437
 
58259
- //console.log('ccw', i);
58438
+ //log('ccw', i);
58260
58439
 
58261
58440
  }
58262
58441
 
@@ -58341,7 +58520,7 @@ class ShapePath {
58341
58520
 
58342
58521
  }
58343
58522
 
58344
- //console.log("shape", shapes);
58523
+ //log("shape", shapes);
58345
58524
 
58346
58525
  return shapes;
58347
58526
 
@@ -58361,7 +58540,7 @@ class Controls extends EventDispatcher {
58361
58540
  * Constructs a new controls instance.
58362
58541
  *
58363
58542
  * @param {Object3D} object - The object that is managed by the controls.
58364
- * @param {?HTMLDOMElement} domElement - The HTML element used for event listeners.
58543
+ * @param {?HTMLElement} domElement - The HTML element used for event listeners.
58365
58544
  */
58366
58545
  constructor( object, domElement = null ) {
58367
58546
 
@@ -58377,7 +58556,7 @@ class Controls extends EventDispatcher {
58377
58556
  /**
58378
58557
  * The HTML element used for event listeners.
58379
58558
  *
58380
- * @type {?HTMLDOMElement}
58559
+ * @type {?HTMLElement}
58381
58560
  * @default null
58382
58561
  */
58383
58562
  this.domElement = domElement;
@@ -58427,13 +58606,13 @@ class Controls extends EventDispatcher {
58427
58606
  * Connects the controls to the DOM. This method has so called "side effects" since
58428
58607
  * it adds the module's event listeners to the DOM.
58429
58608
  *
58430
- * @param {HTMLDOMElement} element - The DOM element to connect to.
58609
+ * @param {HTMLElement} element - The DOM element to connect to.
58431
58610
  */
58432
58611
  connect( element ) {
58433
58612
 
58434
58613
  if ( element === undefined ) {
58435
58614
 
58436
- console.warn( 'THREE.Controls: connect() now requires an element.' ); // @deprecated, the warning can be removed with r185
58615
+ warn( 'Controls: connect() now requires an element.' ); // @deprecated, the warning can be removed with r185
58437
58616
  return;
58438
58617
 
58439
58618
  }
@@ -58767,7 +58946,7 @@ if ( typeof window !== 'undefined' ) {
58767
58946
 
58768
58947
  if ( window.__THREE__ ) {
58769
58948
 
58770
- console.warn( 'WARNING: Multiple instances of Three.js being imported.' );
58949
+ warn( 'WARNING: Multiple instances of Three.js being imported.' );
58771
58950
 
58772
58951
  } else {
58773
58952
 
@@ -59110,7 +59289,7 @@ var color_pars_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\
59110
59289
 
59111
59290
  var color_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )\n\tvColor = vec3( 1.0 );\n#endif\n#ifdef USE_COLOR\n\tvColor *= color;\n#endif\n#ifdef USE_INSTANCING_COLOR\n\tvColor.xyz *= instanceColor.xyz;\n#endif\n#ifdef USE_BATCHING_COLOR\n\tvec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );\n\tvColor.xyz *= batchingColor.xyz;\n#endif";
59112
59291
 
59113
- var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nmat3 transposeMat3( const in mat3 m ) {\n\tmat3 tmp;\n\ttmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );\n\ttmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );\n\ttmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );\n\treturn tmp;\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\n#if defined( USE_MAP_TRIPLANAR ) || \\\n defined( USE_ALPHAMAP_TRIPLANAR ) || \\\n defined( USE_NORMALMAP_TRIPLANAR ) || \\\n defined( USE_ROUGHNESSMAP_TRIPLANAR ) || \\\n defined( USE_AOMAP_TRIPLANAR ) || \\\n defined( USE_METALNESSMAP_TRIPLANAR ) || \\\n defined( USE_CLEARCOAT_NORMALMAP_TRIPLANAR )\n #define USE_TRIPLANAR\n#endif\n#if defined( USE_MAP_TRIPLANAR ) || \\\n defined( USE_ALPHAMAP_TRIPLANAR ) || \\\n defined( USE_ROUGHNESSMAP_TRIPLANAR ) || \\\n defined( USE_AOMAP_TRIPLANAR ) || \\\n defined( USE_METALNESSMAP_TRIPLANAR )\n vec4 texture2DTriplanar( sampler2D map, mat3 uvTransform, vec3 coords, vec3 weights ) {\n return weights.x * texture2D( map, (uvTransform * vec3(coords.zy, 1)).xy ) +\n weights.y * texture2D( map, (uvTransform * vec3(coords.xz, 1)).xy ) +\n weights.z * texture2D( map, (uvTransform * vec3(coords.xy, 1)).xy );\n \n }\n#endif\n#if defined( USE_NORMALMAP_TRIPLANAR ) || defined( USE_CLEARCOAT_NORMALMAP_TRIPLANAR )\n vec3 texture2DTriplanarNormal( sampler2D normalMap, mat3 uvTransform, vec2 normalMapScale, vec3 normal, vec3 coords, vec3 weights ) {\n \n vec2 uvX = coords.zy; vec2 uvY = coords.xz; vec2 uvZ = coords.xy; \n vec3 tnormalX = texture2D( normalMap, (uvTransform * vec3(uvX, 1)).xy ).xyz * 2.0 - 1.0;\n vec3 tnormalY = texture2D( normalMap, (uvTransform * vec3(uvY, 1)).xy ).xyz * 2.0 - 1.0;\n vec3 tnormalZ = texture2D( normalMap, (uvTransform * vec3(uvZ, 1)).xy ).xyz * 2.0 - 1.0;\n tnormalX.xy *= normalMapScale;\n tnormalY.xy *= normalMapScale;\n tnormalZ.xy *= normalMapScale;\n \n tnormalX = vec3(\n tnormalX.xy + normal.zy,\n abs(tnormalX.z) * normal.x\n );\n tnormalY = vec3(\n tnormalY.xy + normal.xz,\n abs(tnormalY.z) * normal.y\n );\n tnormalZ = vec3(\n tnormalZ.xy + normal.xy,\n abs(tnormalZ.z) * normal.z\n );\n \n return normalize(\n tnormalX.zyx * weights.x +\n tnormalY.xzy * weights.y +\n tnormalZ.xyz * weights.z\n );\n }\n#endif\n#if defined( USE_MAP_CYLINDRICAL ) || \\\n defined( USE_ALPHAMAP_CYLINDRICAL ) || \\\n defined( USE_NORMALMAP_CYLINDRICAL ) || \\\n defined( USE_ROUGHNESSMAP_CYLINDRICAL ) || \\\n defined( USE_AOMAP_CYLINDRICAL ) || \\\n defined( USE_METALNESSMAP_CYLINDRICAL ) || \\\n defined( USE_CLEARCOAT_NORMALMAP_CYLINDRICAL )\n #define USE_CYLINDRICAL\n#endif";
59292
+ var common = "#define PI 3.141592653589793\n#define PI2 6.283185307179586\n#define PI_HALF 1.5707963267948966\n#define RECIPROCAL_PI 0.3183098861837907\n#define RECIPROCAL_PI2 0.15915494309189535\n#define EPSILON 1e-6\n#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\n#define whiteComplement( a ) ( 1.0 - saturate( a ) )\nfloat pow2( const in float x ) { return x*x; }\nvec3 pow2( const in vec3 x ) { return x*x; }\nfloat pow3( const in float x ) { return x*x*x; }\nfloat pow4( const in float x ) { float x2 = x*x; return x2*x2; }\nfloat max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }\nfloat average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }\nhighp float rand( const in vec2 uv ) {\n\tconst highp float a = 12.9898, b = 78.233, c = 43758.5453;\n\thighp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );\n\treturn fract( sin( sn ) * c );\n}\n#ifdef HIGH_PRECISION\n\tfloat precisionSafeLength( vec3 v ) { return length( v ); }\n#else\n\tfloat precisionSafeLength( vec3 v ) {\n\t\tfloat maxComponent = max3( abs( v ) );\n\t\treturn length( v / maxComponent ) * maxComponent;\n\t}\n#endif\nstruct IncidentLight {\n\tvec3 color;\n\tvec3 direction;\n\tbool visible;\n};\nstruct ReflectedLight {\n\tvec3 directDiffuse;\n\tvec3 directSpecular;\n\tvec3 indirectDiffuse;\n\tvec3 indirectSpecular;\n};\n#ifdef USE_ALPHAHASH\n\tvarying vec3 vPosition;\n#endif\nvec3 transformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );\n}\nvec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {\n\treturn normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );\n}\nbool isPerspectiveMatrix( mat4 m ) {\n\treturn m[ 2 ][ 3 ] == - 1.0;\n}\nvec2 equirectUv( in vec3 dir ) {\n\tfloat u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;\n\tfloat v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;\n\treturn vec2( u, v );\n}\nvec3 BRDF_Lambert( const in vec3 diffuseColor ) {\n\treturn RECIPROCAL_PI * diffuseColor;\n}\nvec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\nfloat F_Schlick( const in float f0, const in float f90, const in float dotVH ) {\n\tfloat fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );\n\treturn f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );\n}\n#if defined( USE_MAP_TRIPLANAR ) || \\\n defined( USE_ALPHAMAP_TRIPLANAR ) || \\\n defined( USE_NORMALMAP_TRIPLANAR ) || \\\n defined( USE_ROUGHNESSMAP_TRIPLANAR ) || \\\n defined( USE_AOMAP_TRIPLANAR ) || \\\n defined( USE_METALNESSMAP_TRIPLANAR ) || \\\n defined( USE_CLEARCOAT_NORMALMAP_TRIPLANAR )\n #define USE_TRIPLANAR\n#endif\n#if defined( USE_MAP_TRIPLANAR ) || \\\n defined( USE_ALPHAMAP_TRIPLANAR ) || \\\n defined( USE_ROUGHNESSMAP_TRIPLANAR ) || \\\n defined( USE_AOMAP_TRIPLANAR ) || \\\n defined( USE_METALNESSMAP_TRIPLANAR )\n vec4 texture2DTriplanar( sampler2D map, mat3 uvTransform, vec3 coords, vec3 weights ) {\n return weights.x * texture2D( map, (uvTransform * vec3(coords.zy, 1)).xy ) +\n weights.y * texture2D( map, (uvTransform * vec3(coords.xz, 1)).xy ) +\n weights.z * texture2D( map, (uvTransform * vec3(coords.xy, 1)).xy );\n \n }\n#endif\n#if defined( USE_NORMALMAP_TRIPLANAR ) || defined( USE_CLEARCOAT_NORMALMAP_TRIPLANAR )\n vec3 texture2DTriplanarNormal( sampler2D normalMap, mat3 uvTransform, vec2 normalMapScale, vec3 normal, vec3 coords, vec3 weights ) {\n \n vec2 uvX = coords.zy; vec2 uvY = coords.xz; vec2 uvZ = coords.xy; \n vec3 tnormalX = texture2D( normalMap, (uvTransform * vec3(uvX, 1)).xy ).xyz * 2.0 - 1.0;\n vec3 tnormalY = texture2D( normalMap, (uvTransform * vec3(uvY, 1)).xy ).xyz * 2.0 - 1.0;\n vec3 tnormalZ = texture2D( normalMap, (uvTransform * vec3(uvZ, 1)).xy ).xyz * 2.0 - 1.0;\n tnormalX.xy *= normalMapScale;\n tnormalY.xy *= normalMapScale;\n tnormalZ.xy *= normalMapScale;\n \n tnormalX = vec3(\n tnormalX.xy + normal.zy,\n abs(tnormalX.z) * normal.x\n );\n tnormalY = vec3(\n tnormalY.xy + normal.xz,\n abs(tnormalY.z) * normal.y\n );\n tnormalZ = vec3(\n tnormalZ.xy + normal.xy,\n abs(tnormalZ.z) * normal.z\n );\n \n return normalize(\n tnormalX.zyx * weights.x +\n tnormalY.xzy * weights.y +\n tnormalZ.xyz * weights.z\n );\n }\n#endif\n#if defined( USE_MAP_CYLINDRICAL ) || \\\n defined( USE_ALPHAMAP_CYLINDRICAL ) || \\\n defined( USE_NORMALMAP_CYLINDRICAL ) || \\\n defined( USE_ROUGHNESSMAP_CYLINDRICAL ) || \\\n defined( USE_AOMAP_CYLINDRICAL ) || \\\n defined( USE_METALNESSMAP_CYLINDRICAL ) || \\\n defined( USE_CLEARCOAT_NORMALMAP_CYLINDRICAL )\n #define USE_CYLINDRICAL\n#endif";
59114
59293
 
59115
59294
  var cube_uv_reflection_fragment = "#ifdef ENVMAP_TYPE_CUBE_UV\n\t#define cubeUV_minMipLevel 4.0\n\t#define cubeUV_minTileSize 16.0\n\tfloat getFace( vec3 direction ) {\n\t\tvec3 absDirection = abs( direction );\n\t\tfloat face = - 1.0;\n\t\tif ( absDirection.x > absDirection.z ) {\n\t\t\tif ( absDirection.x > absDirection.y )\n\t\t\t\tface = direction.x > 0.0 ? 0.0 : 3.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t} else {\n\t\t\tif ( absDirection.z > absDirection.y )\n\t\t\t\tface = direction.z > 0.0 ? 2.0 : 5.0;\n\t\t\telse\n\t\t\t\tface = direction.y > 0.0 ? 1.0 : 4.0;\n\t\t}\n\t\treturn face;\n\t}\n\tvec2 getUV( vec3 direction, float face ) {\n\t\tvec2 uv;\n\t\tif ( face == 0.0 ) {\n\t\t\tuv = vec2( direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 1.0 ) {\n\t\t\tuv = vec2( - direction.x, - direction.z ) / abs( direction.y );\n\t\t} else if ( face == 2.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.y ) / abs( direction.z );\n\t\t} else if ( face == 3.0 ) {\n\t\t\tuv = vec2( - direction.z, direction.y ) / abs( direction.x );\n\t\t} else if ( face == 4.0 ) {\n\t\t\tuv = vec2( - direction.x, direction.z ) / abs( direction.y );\n\t\t} else {\n\t\t\tuv = vec2( direction.x, direction.y ) / abs( direction.z );\n\t\t}\n\t\treturn 0.5 * ( uv + 1.0 );\n\t}\n\tvec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {\n\t\tfloat face = getFace( direction );\n\t\tfloat filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );\n\t\tmipInt = max( mipInt, cubeUV_minMipLevel );\n\t\tfloat faceSize = exp2( mipInt );\n\t\thighp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;\n\t\tif ( face > 2.0 ) {\n\t\t\tuv.y += faceSize;\n\t\t\tface -= 3.0;\n\t\t}\n\t\tuv.x += face * faceSize;\n\t\tuv.x += filterInt * 3.0 * cubeUV_minTileSize;\n\t\tuv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );\n\t\tuv.x *= CUBEUV_TEXEL_WIDTH;\n\t\tuv.y *= CUBEUV_TEXEL_HEIGHT;\n\t\t#ifdef texture2DGradEXT\n\t\t\treturn texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;\n\t\t#else\n\t\t\treturn texture2D( envMap, uv ).rgb;\n\t\t#endif\n\t}\n\t#define cubeUV_r0 1.0\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_m6 4.0\n\tfloat roughnessToMip( float roughness ) {\n\t\tfloat mip = 0.0;\n\t\tif ( roughness >= cubeUV_r1 ) {\n\t\t\tmip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;\n\t\t} else if ( roughness >= cubeUV_r4 ) {\n\t\t\tmip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;\n\t\t} else if ( roughness >= cubeUV_r5 ) {\n\t\t\tmip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;\n\t\t} else if ( roughness >= cubeUV_r6 ) {\n\t\t\tmip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;\n\t\t} else {\n\t\t\tmip = - 2.0 * log2( 1.16 * roughness );\t\t}\n\t\treturn mip;\n\t}\n\tvec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {\n\t\tfloat mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );\n\t\tfloat mipF = fract( mip );\n\t\tfloat mipInt = floor( mip );\n\t\tvec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );\n\t\tif ( mipF == 0.0 ) {\n\t\t\treturn vec4( color0, 1.0 );\n\t\t} else {\n\t\t\tvec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );\n\t\t\treturn vec4( mix( color0, color1, mipF ), 1.0 );\n\t\t}\n\t}\n#endif";
59116
59295
 
@@ -59130,7 +59309,7 @@ var colorspace_pars_fragment = "vec4 LinearTransferOETF( in vec4 value ) {\n\tre
59130
59309
 
59131
59310
  var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif";
59132
59311
 
59133
- var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n\t\n#endif";
59312
+ var envmap_common_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float envMapIntensity;\n\tuniform float flipEnvMap;\n\tuniform mat3 envMapRotation;\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tuniform samplerCube envMap;\n\t#else\n\t\tuniform sampler2D envMap;\n\t#endif\n#endif";
59134
59313
 
59135
59314
  var envmap_pars_fragment = "#ifdef USE_ENVMAP\n\tuniform float reflectivity;\n\t#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )\n\t\t#define ENV_WORLDPOS\n\t#endif\n\t#ifdef ENV_WORLDPOS\n\t\tvarying vec3 vWorldPosition;\n\t\tuniform float refractionRatio;\n\t#else\n\t\tvarying vec3 vReflect;\n\t#endif\n#endif";
59136
59315
 
@@ -59156,7 +59335,7 @@ var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertM
59156
59335
 
59157
59336
  var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\n#if defined( USE_LIGHT_PROBES )\n\tuniform vec3 lightProbe[ 9 ];\n#endif\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\tif ( cutoffDistance > 0.0 ) {\n\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t}\n\treturn distanceFalloff;\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometryPosition;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif";
59158
59337
 
59159
- var envmap_physical_pars_fragment = "#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif";
59338
+ var envmap_physical_pars_fragment = "#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif";
59160
59339
 
59161
59340
  var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
59162
59341
 
@@ -59168,7 +59347,7 @@ var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhong
59168
59347
 
59169
59348
  var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef USE_SPECULAR\n\t\tfloat specularIntensityFactor = specularIntensity;\n\t\tvec3 specularColorFactor = specularColor;\n\t\t#ifdef USE_SPECULAR_COLORMAP\n\t\t\tspecularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;\n\t\t#endif\n\t\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\t\tspecularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;\n\t\t#endif\n\t\tmaterial.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );\n\t#else\n\t\tfloat specularIntensityFactor = 1.0;\n\t\tvec3 specularColorFactor = vec3( 1.0 );\n\t\tmaterial.specularF90 = 1.0;\n\t#endif\n\tmaterial.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );\n#else\n\tmaterial.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );\n\tmaterial.specularF90 = 1.0;\n#endif\n#ifdef USE_CLEARCOAT\n\tmaterial.clearcoat = clearcoat;\n\tmaterial.clearcoatRoughness = clearcoatRoughness;\n\tmaterial.clearcoatF0 = vec3( 0.04 );\n\tmaterial.clearcoatF90 = 1.0;\n\t#ifdef USE_CLEARCOATMAP\n\t\tmaterial.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;\n\t#endif\n\t#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\t\tmaterial.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;\n\t#endif\n\tmaterial.clearcoat = saturate( material.clearcoat );\tmaterial.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );\n\tmaterial.clearcoatRoughness += geometryRoughness;\n\tmaterial.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );\n#endif\n#ifdef USE_DISPERSION\n\tmaterial.dispersion = dispersion;\n#endif\n#ifdef USE_IRIDESCENCE\n\tmaterial.iridescence = iridescence;\n\tmaterial.iridescenceIOR = iridescenceIOR;\n\t#ifdef USE_IRIDESCENCEMAP\n\t\tmaterial.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;\n\t#endif\n\t#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\t\tmaterial.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;\n\t#else\n\t\tmaterial.iridescenceThickness = iridescenceThicknessMaximum;\n\t#endif\n#endif\n#ifdef USE_SHEEN\n\tmaterial.sheenColor = sheenColor;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tmaterial.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;\n\t#endif\n\tmaterial.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tmaterial.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\t#ifdef USE_ANISOTROPYMAP\n\t\tmat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );\n\t\tvec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;\n\t\tvec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;\n\t#else\n\t\tvec2 anisotropyV = anisotropyVector;\n\t#endif\n\tmaterial.anisotropy = length( anisotropyV );\n\tif( material.anisotropy == 0.0 ) {\n\t\tanisotropyV = vec2( 1.0, 0.0 );\n\t} else {\n\t\tanisotropyV /= material.anisotropy;\n\t\tmaterial.anisotropy = saturate( material.anisotropy );\n\t}\n\tmaterial.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );\n\tmaterial.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;\n\tmaterial.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;\n#endif";
59170
59349
 
59171
- var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tconst vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );\n\tconst vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );\n\tvec4 r = roughness * c0 + c1;\n\tfloat a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;\n\tvec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;\n\treturn fab;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";
59350
+ var lights_physical_pars_fragment = "uniform sampler2D dfgLUT;\nstruct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\n\tfloat dispersion;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat clearcoat;\n\t\tfloat clearcoatRoughness;\n\t\tvec3 clearcoatF0;\n\t\tfloat clearcoatF90;\n\t#endif\n\t#ifdef USE_IRIDESCENCE\n\t\tfloat iridescence;\n\t\tfloat iridescenceIOR;\n\t\tfloat iridescenceThickness;\n\t\tvec3 iridescenceFresnel;\n\t\tvec3 iridescenceF0;\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tvec3 sheenColor;\n\t\tfloat sheenRoughness;\n\t#endif\n\t#ifdef IOR\n\t\tfloat ior;\n\t#endif\n\t#ifdef USE_TRANSMISSION\n\t\tfloat transmission;\n\t\tfloat transmissionAlpha;\n\t\tfloat thickness;\n\t\tfloat attenuationDistance;\n\t\tvec3 attenuationColor;\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat anisotropy;\n\t\tfloat alphaT;\n\t\tvec3 anisotropyT;\n\t\tvec3 anisotropyB;\n\t#endif\n};\nvec3 clearcoatSpecularDirect = vec3( 0.0 );\nvec3 clearcoatSpecularIndirect = vec3( 0.0 );\nvec3 sheenSpecularDirect = vec3( 0.0 );\nvec3 sheenSpecularIndirect = vec3(0.0 );\nvec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {\n float x = clamp( 1.0 - dotVH, 0.0, 1.0 );\n float x2 = x * x;\n float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );\n return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );\n}\nfloat V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {\n\tfloat a2 = pow2( alpha );\n\tfloat gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );\n\tfloat gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );\n\treturn 0.5 / max( gv + gl, EPSILON );\n}\nfloat D_GGX( const in float alpha, const in float dotNH ) {\n\tfloat a2 = pow2( alpha );\n\tfloat denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;\n\treturn RECIPROCAL_PI * a2 / pow2( denom );\n}\n#ifdef USE_ANISOTROPY\n\tfloat V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {\n\t\tfloat gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );\n\t\tfloat gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );\n\t\tfloat v = 0.5 / ( gv + gl );\n\t\treturn saturate(v);\n\t}\n\tfloat D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {\n\t\tfloat a2 = alphaT * alphaB;\n\t\thighp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );\n\t\thighp float v2 = dot( v, v );\n\t\tfloat w2 = a2 / v2;\n\t\treturn RECIPROCAL_PI * a2 * pow2 ( w2 );\n\t}\n#endif\n#ifdef USE_CLEARCOAT\n\tvec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {\n\t\tvec3 f0 = material.clearcoatF0;\n\t\tfloat f90 = material.clearcoatF90;\n\t\tfloat roughness = material.clearcoatRoughness;\n\t\tfloat alpha = pow2( roughness );\n\t\tvec3 halfDir = normalize( lightDir + viewDir );\n\t\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\t\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\t\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\t\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\t\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t\treturn F * ( V * D );\n\t}\n#endif\nvec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 f0 = material.specularColor;\n\tfloat f90 = material.specularF90;\n\tfloat roughness = material.roughness;\n\tfloat alpha = pow2( roughness );\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat dotVH = saturate( dot( viewDir, halfDir ) );\n\tvec3 F = F_Schlick( f0, f90, dotVH );\n\t#ifdef USE_IRIDESCENCE\n\t\tF = mix( F, material.iridescenceFresnel, material.iridescence );\n\t#endif\n\t#ifdef USE_ANISOTROPY\n\t\tfloat dotTL = dot( material.anisotropyT, lightDir );\n\t\tfloat dotTV = dot( material.anisotropyT, viewDir );\n\t\tfloat dotTH = dot( material.anisotropyT, halfDir );\n\t\tfloat dotBL = dot( material.anisotropyB, lightDir );\n\t\tfloat dotBV = dot( material.anisotropyB, viewDir );\n\t\tfloat dotBH = dot( material.anisotropyB, halfDir );\n\t\tfloat V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );\n\t\tfloat D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );\n\t#else\n\t\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\t\tfloat D = D_GGX( alpha, dotNH );\n\t#endif\n\treturn F * ( V * D );\n}\nvec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {\n\tconst float LUT_SIZE = 64.0;\n\tconst float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;\n\tconst float LUT_BIAS = 0.5 / LUT_SIZE;\n\tfloat dotNV = saturate( dot( N, V ) );\n\tvec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );\n\tuv = uv * LUT_SCALE + LUT_BIAS;\n\treturn uv;\n}\nfloat LTC_ClippedSphereFormFactor( const in vec3 f ) {\n\tfloat l = length( f );\n\treturn max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );\n}\nvec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {\n\tfloat x = dot( v1, v2 );\n\tfloat y = abs( x );\n\tfloat a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;\n\tfloat b = 3.4175940 + ( 4.1616724 + y ) * y;\n\tfloat v = a / b;\n\tfloat theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;\n\treturn cross( v1, v2 ) * theta_sintheta;\n}\nvec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {\n\tvec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];\n\tvec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];\n\tvec3 lightNormal = cross( v1, v2 );\n\tif( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );\n\tvec3 T1, T2;\n\tT1 = normalize( V - N * dot( V, N ) );\n\tT2 = - cross( N, T1 );\n\tmat3 mat = mInv * transpose( mat3( T1, T2, N ) );\n\tvec3 coords[ 4 ];\n\tcoords[ 0 ] = mat * ( rectCoords[ 0 ] - P );\n\tcoords[ 1 ] = mat * ( rectCoords[ 1 ] - P );\n\tcoords[ 2 ] = mat * ( rectCoords[ 2 ] - P );\n\tcoords[ 3 ] = mat * ( rectCoords[ 3 ] - P );\n\tcoords[ 0 ] = normalize( coords[ 0 ] );\n\tcoords[ 1 ] = normalize( coords[ 1 ] );\n\tcoords[ 2 ] = normalize( coords[ 2 ] );\n\tcoords[ 3 ] = normalize( coords[ 3 ] );\n\tvec3 vectorFormFactor = vec3( 0.0 );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );\n\tvectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );\n\tfloat result = LTC_ClippedSphereFormFactor( vectorFormFactor );\n\treturn vec3( result );\n}\n#if defined( USE_SHEEN )\nfloat D_Charlie( float roughness, float dotNH ) {\n\tfloat alpha = pow2( roughness );\n\tfloat invAlpha = 1.0 / alpha;\n\tfloat cos2h = dotNH * dotNH;\n\tfloat sin2h = max( 1.0 - cos2h, 0.0078125 );\n\treturn ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );\n}\nfloat V_Neubelt( float dotNV, float dotNL ) {\n\treturn saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );\n}\nvec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {\n\tvec3 halfDir = normalize( lightDir + viewDir );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat dotNH = saturate( dot( normal, halfDir ) );\n\tfloat D = D_Charlie( sheenRoughness, dotNH );\n\tfloat V = V_Neubelt( dotNV, dotNL );\n\treturn sheenColor * ( D * V );\n}\n#endif\nfloat IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tfloat r2 = roughness * roughness;\n\tfloat a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;\n\tfloat b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;\n\tfloat DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );\n\treturn saturate( DG * RECIPROCAL_PI );\n}\nvec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 uv = vec2( roughness, dotNV );\n\treturn texture2D( dfgLUT, uv ).rg;\n}\nvec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\treturn specularColor * fab.x + specularF90 * fab.y;\n}\n#ifdef USE_IRIDESCENCE\nvoid computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#else\nvoid computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {\n#endif\n\tvec2 fab = DFGApprox( normal, viewDir, roughness );\n\t#ifdef USE_IRIDESCENCE\n\t\tvec3 Fr = mix( specularColor, iridescenceF0, iridescence );\n\t#else\n\t\tvec3 Fr = specularColor;\n\t#endif\n\tvec3 FssEss = Fr * fab.x + specularF90 * fab.y;\n\tfloat Ess = fab.x + fab.y;\n\tfloat Ems = 1.0 - Ess;\n\tvec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;\tvec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );\n\tsingleScatter += FssEss;\n\tmultiScatter += Fms * Ems;\n}\nvec3 BRDF_GGX_Multiscatter( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {\n\tvec3 singleScatter = BRDF_GGX( lightDir, viewDir, normal, material );\n\tfloat dotNL = saturate( dot( normal, lightDir ) );\n\tfloat dotNV = saturate( dot( normal, viewDir ) );\n\tvec2 dfgV = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNV * dotNV), 0.0, dotNV), material.roughness );\n\tvec2 dfgL = DFGApprox( vec3(0.0, 0.0, 1.0), vec3(sqrt(1.0 - dotNL * dotNL), 0.0, dotNL), material.roughness );\n\tvec3 FssEss_V = material.specularColor * dfgV.x + material.specularF90 * dfgV.y;\n\tvec3 FssEss_L = material.specularColor * dfgL.x + material.specularF90 * dfgL.y;\n\tfloat Ess_V = dfgV.x + dfgV.y;\n\tfloat Ess_L = dfgL.x + dfgL.y;\n\tfloat Ems_V = 1.0 - Ess_V;\n\tfloat Ems_L = 1.0 - Ess_L;\n\tvec3 Favg = material.specularColor + ( 1.0 - material.specularColor ) * 0.047619;\n\tvec3 Fms = FssEss_V * FssEss_L * Favg / ( 1.0 - Ems_V * Ems_L * Favg * Favg + EPSILON );\n\tfloat compensationFactor = Ems_V * Ems_L;\n\tvec3 multiScatter = Fms * compensationFactor;\n\treturn singleScatter + multiScatter;\n}\n#if NUM_RECT_AREA_LIGHTS > 0\n\tvoid RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometryNormal;\n\t\tvec3 viewDir = geometryViewDir;\n\t\tvec3 position = geometryPosition;\n\t\tvec3 lightPos = rectAreaLight.position;\n\t\tvec3 halfWidth = rectAreaLight.halfWidth;\n\t\tvec3 halfHeight = rectAreaLight.halfHeight;\n\t\tvec3 lightColor = rectAreaLight.color;\n\t\tfloat roughness = material.roughness;\n\t\tvec3 rectCoords[ 4 ];\n\t\trectCoords[ 0 ] = lightPos + halfWidth - halfHeight;\t\trectCoords[ 1 ] = lightPos - halfWidth - halfHeight;\n\t\trectCoords[ 2 ] = lightPos - halfWidth + halfHeight;\n\t\trectCoords[ 3 ] = lightPos + halfWidth + halfHeight;\n\t\tvec2 uv = LTC_Uv( normal, viewDir, roughness );\n\t\tvec4 t1 = texture2D( ltc_1, uv );\n\t\tvec4 t2 = texture2D( ltc_2, uv );\n\t\tmat3 mInv = mat3(\n\t\t\tvec3( t1.x, 0, t1.y ),\n\t\t\tvec3( 0, 1, 0 ),\n\t\t\tvec3( t1.z, 0, t1.w )\n\t\t);\n\t\tvec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );\n\t\treflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );\n\t\treflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );\n\t}\n#endif\nvoid RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometryNormal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX_Multiscatter( directLight.direction, geometryViewDir, geometryNormal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );\n\t#endif\n\tvec3 singleScattering = vec3( 0.0 );\n\tvec3 multiScattering = vec3( 0.0 );\n\tvec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;\n\t#ifdef USE_IRIDESCENCE\n\t\tcomputeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );\n\t#endif\n\tvec3 totalScattering = singleScattering + multiScattering;\n\tvec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );\n\treflectedLight.indirectSpecular += radiance * singleScattering;\n\treflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;\n\treflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;\n}\n#define RE_Direct\t\t\t\tRE_Direct_Physical\n#define RE_Direct_RectArea\t\tRE_Direct_RectArea_Physical\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_Physical\n#define RE_IndirectSpecular\t\tRE_IndirectSpecular_Physical\nfloat computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {\n\treturn saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );\n}";
59172
59351
 
59173
59352
  var lights_fragment_begin = "\nvec3 geometryPosition = - vViewPosition;\nvec3 geometryNormal = normal;\nvec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\nvec3 geometryClearcoatNormal = vec3( 0.0 );\n#ifdef USE_CLEARCOAT\n\tgeometryClearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometryViewDir ) );\n\tif ( material.iridescenceThickness == 0.0 ) {\n\t\tmaterial.iridescence = 0.0;\n\t} else {\n\t\tmaterial.iridescence = saturate( material.iridescence );\n\t}\n\tif ( material.iridescence > 0.0 ) {\n\t\tmaterial.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );\n\t\tmaterial.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );\n\t}\n#endif\nIncidentLight directLight;\n#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )\n\tPointLight pointLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0\n\tPointLightShadow pointLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {\n\t\tpointLight = pointLights[ i ];\n\t\tgetPointLightInfo( pointLight, geometryPosition, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )\n\t\tpointLightShadow = pointLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )\n\tSpotLight spotLight;\n\tvec4 spotColor;\n\tvec3 spotLightCoord;\n\tbool inSpotLightMap;\n\t#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0\n\tSpotLightShadow spotLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {\n\t\tspotLight = spotLights[ i ];\n\t\tgetSpotLightInfo( spotLight, geometryPosition, directLight );\n\t\t#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX\n\t\t#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\t#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS\n\t\t#else\n\t\t#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )\n\t\t#endif\n\t\t#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )\n\t\t\tspotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;\n\t\t\tinSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );\n\t\t\tspotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );\n\t\t\tdirectLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;\n\t\t#endif\n\t\t#undef SPOT_LIGHT_MAP_INDEX\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )\n\t\tspotLightShadow = spotLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )\n\tDirectionalLight directionalLight;\n\t#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0\n\tDirectionalLightShadow directionalLightShadow;\n\t#endif\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {\n\t\tdirectionalLight = directionalLights[ i ];\n\t\tgetDirectionalLightInfo( directionalLight, directLight );\n\t\t#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )\n\t\tdirectionalLightShadow = directionalLightShadows[ i ];\n\t\tdirectLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )\n\tRectAreaLight rectAreaLight;\n\t#pragma unroll_loop_start\n\tfor ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {\n\t\trectAreaLight = rectAreaLights[ i ];\n\t\tRE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );\n\t}\n\t#pragma unroll_loop_end\n#endif\n#if defined( RE_IndirectDiffuse )\n\tvec3 iblIrradiance = vec3( 0.0 );\n\tvec3 irradiance = getAmbientLightIrradiance( ambientLightColor );\n\t#if defined( USE_LIGHT_PROBES )\n\t\tirradiance += getLightProbeIrradiance( lightProbe, geometryNormal );\n\t#endif\n\t#if ( NUM_HEMI_LIGHTS > 0 )\n\t\t#pragma unroll_loop_start\n\t\tfor ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {\n\t\t\tirradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );\n\t\t}\n\t\t#pragma unroll_loop_end\n\t#endif\n#endif\n#if defined( RE_IndirectSpecular )\n\tvec3 radiance = vec3( 0.0 );\n\tvec3 clearcoatRadiance = vec3( 0.0 );\n#endif";
59174
59353
 
@@ -59530,6 +59709,7 @@ const UniformsLib = {
59530
59709
  reflectivity: { value: 1.0 }, // basic, lambert, phong
59531
59710
  ior: { value: 1.5 }, // physical
59532
59711
  refractionRatio: { value: 0.98 }, // basic, lambert, phong
59712
+ dfgLUT: { value: null } // DFG LUT for physically-based rendering
59533
59713
 
59534
59714
  },
59535
59715
 
@@ -61126,7 +61306,7 @@ function WebGLCapabilities( gl, extensions, parameters, utils ) {
61126
61306
 
61127
61307
  if ( maxPrecision !== precision ) {
61128
61308
 
61129
- console.warn( 'THREE.WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' );
61309
+ warn( 'WebGLRenderer:', precision, 'not supported, using', maxPrecision, 'instead.' );
61130
61310
  precision = maxPrecision;
61131
61311
 
61132
61312
  }
@@ -61443,16 +61623,18 @@ function WebGLCubeMaps( renderer ) {
61443
61623
 
61444
61624
  const LOD_MIN = 4;
61445
61625
 
61446
- // The standard deviations (radians) associated with the extra mips. These are
61447
- // chosen to approximate a Trowbridge-Reitz distribution function times the
61448
- // geometric shadowing function. These sigma values squared must match the
61449
- // variance #defines in cube_uv_reflection_fragment.glsl.js.
61626
+ // The standard deviations (radians) associated with the extra mips.
61627
+ // Used for scene blur in fromScene() method.
61450
61628
  const EXTRA_LOD_SIGMA = [ 0.125, 0.215, 0.35, 0.446, 0.526, 0.582 ];
61451
61629
 
61452
61630
  // The maximum length of the blur for loop. Smaller sigmas will use fewer
61453
61631
  // samples and exit early, but not recompile the shader.
61632
+ // Used for scene blur in fromScene() method.
61454
61633
  const MAX_SAMPLES = 20;
61455
61634
 
61635
+ // GGX VNDF importance sampling configuration
61636
+ const GGX_SAMPLES = 256;
61637
+
61456
61638
  const _flatCamera = /*@__PURE__*/ new OrthographicCamera();
61457
61639
  const _clearColor = /*@__PURE__*/ new Color();
61458
61640
  let _oldTarget = null;
@@ -61460,24 +61642,6 @@ let _oldActiveCubeFace = 0;
61460
61642
  let _oldActiveMipmapLevel = 0;
61461
61643
  let _oldXrEnabled = false;
61462
61644
 
61463
- // Golden Ratio
61464
- const PHI = ( 1 + Math.sqrt( 5 ) ) / 2;
61465
- const INV_PHI = 1 / PHI;
61466
-
61467
- // Vertices of a dodecahedron (except the opposites, which represent the
61468
- // same axis), used as axis directions evenly spread on a sphere.
61469
- const _axisDirections = [
61470
- /*@__PURE__*/ new Vector3( - PHI, INV_PHI, 0 ),
61471
- /*@__PURE__*/ new Vector3( PHI, INV_PHI, 0 ),
61472
- /*@__PURE__*/ new Vector3( - INV_PHI, 0, PHI ),
61473
- /*@__PURE__*/ new Vector3( INV_PHI, 0, PHI ),
61474
- /*@__PURE__*/ new Vector3( 0, PHI, - INV_PHI ),
61475
- /*@__PURE__*/ new Vector3( 0, PHI, INV_PHI ),
61476
- /*@__PURE__*/ new Vector3( -1, 1, -1 ),
61477
- /*@__PURE__*/ new Vector3( 1, 1, -1 ),
61478
- /*@__PURE__*/ new Vector3( -1, 1, 1 ),
61479
- /*@__PURE__*/ new Vector3( 1, 1, 1 ) ];
61480
-
61481
61645
  const _origin = /*@__PURE__*/ new Vector3();
61482
61646
 
61483
61647
  /**
@@ -61491,9 +61655,11 @@ const _origin = /*@__PURE__*/ new Vector3();
61491
61655
  * higher roughness levels. In this way we maintain resolution to smoothly
61492
61656
  * interpolate diffuse lighting while limiting sampling computation.
61493
61657
  *
61494
- * Paper: Fast, Accurate Image-Based Lighting:
61495
- * {@link https://drive.google.com/file/d/15y8r_UpKlU9SvV4ILb0C3qCPecS8pvLz/view}
61496
- */
61658
+ * The prefiltering uses GGX VNDF (Visible Normal Distribution Function)
61659
+ * importance sampling based on "Sampling the GGX Distribution of Visible Normals"
61660
+ * (Heitz, 2018) to generate environment maps that accurately match the GGX BRDF
61661
+ * used in material rendering for physically-based image-based lighting.
61662
+ */
61497
61663
  class PMREMGenerator {
61498
61664
 
61499
61665
  /**
@@ -61508,15 +61674,17 @@ class PMREMGenerator {
61508
61674
 
61509
61675
  this._lodMax = 0;
61510
61676
  this._cubeSize = 0;
61511
- this._lodPlanes = [];
61512
61677
  this._sizeLods = [];
61513
61678
  this._sigmas = [];
61679
+ this._lodMeshes = [];
61680
+
61681
+ this._backgroundBox = null;
61514
61682
 
61515
- this._blurMaterial = null;
61516
61683
  this._cubemapMaterial = null;
61517
61684
  this._equirectMaterial = null;
61518
61685
 
61519
- this._compileMaterial( this._blurMaterial );
61686
+ this._blurMaterial = null;
61687
+ this._ggxMaterial = null;
61520
61688
 
61521
61689
  }
61522
61690
 
@@ -61641,6 +61809,13 @@ class PMREMGenerator {
61641
61809
  if ( this._cubemapMaterial !== null ) this._cubemapMaterial.dispose();
61642
61810
  if ( this._equirectMaterial !== null ) this._equirectMaterial.dispose();
61643
61811
 
61812
+ if ( this._backgroundBox !== null ) {
61813
+
61814
+ this._backgroundBox.geometry.dispose();
61815
+ this._backgroundBox.material.dispose();
61816
+
61817
+ }
61818
+
61644
61819
  }
61645
61820
 
61646
61821
  // private interface
@@ -61655,12 +61830,13 @@ class PMREMGenerator {
61655
61830
  _dispose() {
61656
61831
 
61657
61832
  if ( this._blurMaterial !== null ) this._blurMaterial.dispose();
61833
+ if ( this._ggxMaterial !== null ) this._ggxMaterial.dispose();
61658
61834
 
61659
61835
  if ( this._pingPongRenderTarget !== null ) this._pingPongRenderTarget.dispose();
61660
61836
 
61661
- for ( let i = 0; i < this._lodPlanes.length; i ++ ) {
61837
+ for ( let i = 0; i < this._lodMeshes.length; i ++ ) {
61662
61838
 
61663
- this._lodPlanes[ i ].dispose();
61839
+ this._lodMeshes[ i ].geometry.dispose();
61664
61840
 
61665
61841
  }
61666
61842
 
@@ -61732,7 +61908,7 @@ class PMREMGenerator {
61732
61908
  this._pingPongRenderTarget = _createRenderTarget( width, height, params );
61733
61909
 
61734
61910
  const { _lodMax } = this;
61735
- ( { sizeLods: this._sizeLods, lodPlanes: this._lodPlanes, sigmas: this._sigmas } = _createPlanes( _lodMax ) );
61911
+ ( { lodMeshes: this._lodMeshes, sizeLods: this._sizeLods, sigmas: this._sigmas } = _createPlanes( _lodMax ) );
61736
61912
 
61737
61913
  this._blurMaterial = _getBlurShader( _lodMax, width, height );
61738
61914
 
@@ -61744,8 +61920,8 @@ class PMREMGenerator {
61744
61920
 
61745
61921
  _compileMaterial( material ) {
61746
61922
 
61747
- const tmpMesh = new Mesh( this._lodPlanes[ 0 ], material );
61748
- this._renderer.compile( tmpMesh, _flatCamera );
61923
+ const mesh = new Mesh( new BufferGeometry(), material );
61924
+ this._renderer.compile( mesh, _flatCamera );
61749
61925
 
61750
61926
  }
61751
61927
 
@@ -61776,16 +61952,25 @@ class PMREMGenerator {
61776
61952
 
61777
61953
  }
61778
61954
 
61779
- const backgroundMaterial = new MeshBasicMaterial( {
61780
- name: 'PMREM.Background',
61781
- side: BackSide,
61782
- depthWrite: false,
61783
- depthTest: false,
61784
- } );
61955
+ if ( this._backgroundBox === null ) {
61785
61956
 
61786
- const backgroundBox = new Mesh( new BoxGeometry(), backgroundMaterial );
61957
+ this._backgroundBox = new Mesh(
61958
+ new BoxGeometry(),
61959
+ new MeshBasicMaterial( {
61960
+ name: 'PMREM.Background',
61961
+ side: BackSide,
61962
+ depthWrite: false,
61963
+ depthTest: false,
61964
+ } )
61965
+ );
61966
+
61967
+ }
61968
+
61969
+ const backgroundBox = this._backgroundBox;
61970
+ const backgroundMaterial = backgroundBox.material;
61787
61971
 
61788
61972
  let useSolidColor = false;
61973
+
61789
61974
  const background = scene.background;
61790
61975
 
61791
61976
  if ( background ) {
@@ -61846,9 +62031,6 @@ class PMREMGenerator {
61846
62031
 
61847
62032
  }
61848
62033
 
61849
- backgroundBox.geometry.dispose();
61850
- backgroundBox.material.dispose();
61851
-
61852
62034
  renderer.toneMapping = toneMapping;
61853
62035
  renderer.autoClear = originalAutoClear;
61854
62036
  scene.background = background;
@@ -61882,7 +62064,9 @@ class PMREMGenerator {
61882
62064
  }
61883
62065
 
61884
62066
  const material = isCubeTexture ? this._cubemapMaterial : this._equirectMaterial;
61885
- const mesh = new Mesh( this._lodPlanes[ 0 ], material );
62067
+
62068
+ const mesh = this._lodMeshes[ 0 ];
62069
+ mesh.material = material;
61886
62070
 
61887
62071
  const uniforms = material.uniforms;
61888
62072
 
@@ -61902,19 +62086,82 @@ class PMREMGenerator {
61902
62086
  const renderer = this._renderer;
61903
62087
  const autoClear = renderer.autoClear;
61904
62088
  renderer.autoClear = false;
61905
- const n = this._lodPlanes.length;
61906
62089
 
62090
+ const n = this._lodMeshes.length;
62091
+
62092
+ // Use GGX VNDF importance sampling
61907
62093
  for ( let i = 1; i < n; i ++ ) {
61908
62094
 
61909
- const sigma = Math.sqrt( this._sigmas[ i ] * this._sigmas[ i ] - this._sigmas[ i - 1 ] * this._sigmas[ i - 1 ] );
62095
+ this._applyGGXFilter( cubeUVRenderTarget, i - 1, i );
62096
+
62097
+ }
62098
+
62099
+ renderer.autoClear = autoClear;
62100
+
62101
+ }
62102
+
62103
+ /**
62104
+ * Applies GGX VNDF importance sampling filter to generate a prefiltered environment map.
62105
+ * Uses Monte Carlo integration with VNDF importance sampling to accurately represent the
62106
+ * GGX BRDF for physically-based rendering. Reads from the previous LOD level and
62107
+ * applies incremental roughness filtering to avoid over-blurring.
62108
+ *
62109
+ * @private
62110
+ * @param {WebGLRenderTarget} cubeUVRenderTarget
62111
+ * @param {number} lodIn - Source LOD level to read from
62112
+ * @param {number} lodOut - Target LOD level to write to
62113
+ */
62114
+ _applyGGXFilter( cubeUVRenderTarget, lodIn, lodOut ) {
62115
+
62116
+ const renderer = this._renderer;
62117
+ const pingPongRenderTarget = this._pingPongRenderTarget;
61910
62118
 
61911
- const poleAxis = _axisDirections[ ( n - i - 1 ) % _axisDirections.length ];
62119
+ if ( this._ggxMaterial === null ) {
61912
62120
 
61913
- this._blur( cubeUVRenderTarget, i - 1, i, sigma, poleAxis );
62121
+ const width = 3 * Math.max( this._cubeSize, 16 );
62122
+ const height = 4 * this._cubeSize;
62123
+ this._ggxMaterial = _getGGXShader( this._lodMax, width, height );
61914
62124
 
61915
62125
  }
61916
62126
 
61917
- renderer.autoClear = autoClear;
62127
+ const ggxMaterial = this._ggxMaterial;
62128
+ const ggxMesh = this._lodMeshes[ lodOut ];
62129
+ ggxMesh.material = ggxMaterial;
62130
+
62131
+ const ggxUniforms = ggxMaterial.uniforms;
62132
+
62133
+ // Calculate incremental roughness between LOD levels
62134
+ const targetRoughness = lodOut / ( this._lodMeshes.length - 1 );
62135
+ const sourceRoughness = lodIn / ( this._lodMeshes.length - 1 );
62136
+ const incrementalRoughness = Math.sqrt( targetRoughness * targetRoughness - sourceRoughness * sourceRoughness );
62137
+
62138
+ // Apply blur strength mapping for better quality across the roughness range
62139
+ const blurStrength = 0.05 + targetRoughness * 0.95;
62140
+ const adjustedRoughness = incrementalRoughness * blurStrength;
62141
+
62142
+ // Calculate viewport position based on output LOD level
62143
+ const { _lodMax } = this;
62144
+ const outputSize = this._sizeLods[ lodOut ];
62145
+ const x = 3 * outputSize * ( lodOut > _lodMax - LOD_MIN ? lodOut - _lodMax + LOD_MIN : 0 );
62146
+ const y = 4 * ( this._cubeSize - outputSize );
62147
+
62148
+ // Read from previous LOD with incremental roughness
62149
+ ggxUniforms[ 'envMap' ].value = cubeUVRenderTarget.texture;
62150
+ ggxUniforms[ 'roughness' ].value = adjustedRoughness;
62151
+ ggxUniforms[ 'mipInt' ].value = _lodMax - lodIn; // Sample from input LOD
62152
+
62153
+ _setViewport( pingPongRenderTarget, x, y, 3 * outputSize, 2 * outputSize );
62154
+ renderer.setRenderTarget( pingPongRenderTarget );
62155
+ renderer.render( ggxMesh, _flatCamera );
62156
+
62157
+ // Copy from pingPong back to cubeUV (simple direct copy)
62158
+ ggxUniforms[ 'envMap' ].value = pingPongRenderTarget.texture;
62159
+ ggxUniforms[ 'roughness' ].value = 0.0; // Direct copy
62160
+ ggxUniforms[ 'mipInt' ].value = _lodMax - lodOut; // Read from the level we just wrote
62161
+
62162
+ _setViewport( cubeUVRenderTarget, x, y, 3 * outputSize, 2 * outputSize );
62163
+ renderer.setRenderTarget( cubeUVRenderTarget );
62164
+ renderer.render( ggxMesh, _flatCamera );
61918
62165
 
61919
62166
  }
61920
62167
 
@@ -61925,6 +62172,8 @@ class PMREMGenerator {
61925
62172
  * the poles) to approximate the orthogonally-separable blur. It is least
61926
62173
  * accurate at the poles, but still does a decent job.
61927
62174
  *
62175
+ * Used for initial scene blur in fromScene() method when sigma > 0.
62176
+ *
61928
62177
  * @private
61929
62178
  * @param {WebGLRenderTarget} cubeUVRenderTarget
61930
62179
  * @param {number} lodIn
@@ -61963,7 +62212,7 @@ class PMREMGenerator {
61963
62212
 
61964
62213
  if ( direction !== 'latitudinal' && direction !== 'longitudinal' ) {
61965
62214
 
61966
- console.error(
62215
+ error(
61967
62216
  'blur direction must be either latitudinal or longitudinal!' );
61968
62217
 
61969
62218
  }
@@ -61971,7 +62220,9 @@ class PMREMGenerator {
61971
62220
  // Number of standard deviations at which to cut off the discrete approximation.
61972
62221
  const STANDARD_DEVIATIONS = 3;
61973
62222
 
61974
- const blurMesh = new Mesh( this._lodPlanes[ lodOut ], blurMaterial );
62223
+ const blurMesh = this._lodMeshes[ lodOut ];
62224
+ blurMesh.material = blurMaterial;
62225
+
61975
62226
  const blurUniforms = blurMaterial.uniforms;
61976
62227
 
61977
62228
  const pixels = this._sizeLods[ lodIn ] - 1;
@@ -61981,7 +62232,7 @@ class PMREMGenerator {
61981
62232
 
61982
62233
  if ( samples > MAX_SAMPLES ) {
61983
62234
 
61984
- console.warn( `sigmaRadians, ${
62235
+ warn( `sigmaRadians, ${
61985
62236
  sigmaRadians}, is too large and will clip, as it requested ${
61986
62237
  samples} samples when the maximum is set to ${MAX_SAMPLES}` );
61987
62238
 
@@ -62045,9 +62296,9 @@ class PMREMGenerator {
62045
62296
 
62046
62297
  function _createPlanes( lodMax ) {
62047
62298
 
62048
- const lodPlanes = [];
62049
62299
  const sizeLods = [];
62050
62300
  const sigmas = [];
62301
+ const lodMeshes = [];
62051
62302
 
62052
62303
  let lod = lodMax;
62053
62304
 
@@ -62109,7 +62360,7 @@ function _createPlanes( lodMax ) {
62109
62360
  planes.setAttribute( 'position', new BufferAttribute( position, positionSize ) );
62110
62361
  planes.setAttribute( 'uv', new BufferAttribute( uv, uvSize ) );
62111
62362
  planes.setAttribute( 'faceIndex', new BufferAttribute( faceIndex, faceIndexSize ) );
62112
- lodPlanes.push( planes );
62363
+ lodMeshes.push( new Mesh( planes, null ) );
62113
62364
 
62114
62365
  if ( lod > LOD_MIN ) {
62115
62366
 
@@ -62119,7 +62370,7 @@ function _createPlanes( lodMax ) {
62119
62370
 
62120
62371
  }
62121
62372
 
62122
- return { lodPlanes, sizeLods, sigmas };
62373
+ return { lodMeshes, sizeLods, sigmas };
62123
62374
 
62124
62375
  }
62125
62376
 
@@ -62140,6 +62391,147 @@ function _setViewport( target, x, y, width, height ) {
62140
62391
 
62141
62392
  }
62142
62393
 
62394
+ function _getGGXShader( lodMax, width, height ) {
62395
+
62396
+ const shaderMaterial = new ShaderMaterial( {
62397
+
62398
+ name: 'PMREMGGXConvolution',
62399
+
62400
+ defines: {
62401
+ 'GGX_SAMPLES': GGX_SAMPLES,
62402
+ 'CUBEUV_TEXEL_WIDTH': 1.0 / width,
62403
+ 'CUBEUV_TEXEL_HEIGHT': 1.0 / height,
62404
+ 'CUBEUV_MAX_MIP': `${lodMax}.0`,
62405
+ },
62406
+
62407
+ uniforms: {
62408
+ 'envMap': { value: null },
62409
+ 'roughness': { value: 0.0 },
62410
+ 'mipInt': { value: 0 }
62411
+ },
62412
+
62413
+ vertexShader: _getCommonVertexShader(),
62414
+
62415
+ fragmentShader: /* glsl */`
62416
+
62417
+ precision highp float;
62418
+ precision highp int;
62419
+
62420
+ varying vec3 vOutputDirection;
62421
+
62422
+ uniform sampler2D envMap;
62423
+ uniform float roughness;
62424
+ uniform float mipInt;
62425
+
62426
+ #define ENVMAP_TYPE_CUBE_UV
62427
+ #include <cube_uv_reflection_fragment>
62428
+
62429
+ #define PI 3.14159265359
62430
+
62431
+ // Van der Corput radical inverse
62432
+ float radicalInverse_VdC(uint bits) {
62433
+ bits = (bits << 16u) | (bits >> 16u);
62434
+ bits = ((bits & 0x55555555u) << 1u) | ((bits & 0xAAAAAAAAu) >> 1u);
62435
+ bits = ((bits & 0x33333333u) << 2u) | ((bits & 0xCCCCCCCCu) >> 2u);
62436
+ bits = ((bits & 0x0F0F0F0Fu) << 4u) | ((bits & 0xF0F0F0F0u) >> 4u);
62437
+ bits = ((bits & 0x00FF00FFu) << 8u) | ((bits & 0xFF00FF00u) >> 8u);
62438
+ return float(bits) * 2.3283064365386963e-10; // / 0x100000000
62439
+ }
62440
+
62441
+ // Hammersley sequence
62442
+ vec2 hammersley(uint i, uint N) {
62443
+ return vec2(float(i) / float(N), radicalInverse_VdC(i));
62444
+ }
62445
+
62446
+ // GGX VNDF importance sampling (Eric Heitz 2018)
62447
+ // "Sampling the GGX Distribution of Visible Normals"
62448
+ // https://jcgt.org/published/0007/04/01/
62449
+ vec3 importanceSampleGGX_VNDF(vec2 Xi, vec3 V, float roughness) {
62450
+ float alpha = roughness * roughness;
62451
+
62452
+ // Section 3.2: Transform view direction to hemisphere configuration
62453
+ vec3 Vh = normalize(vec3(alpha * V.x, alpha * V.y, V.z));
62454
+
62455
+ // Section 4.1: Orthonormal basis
62456
+ float lensq = Vh.x * Vh.x + Vh.y * Vh.y;
62457
+ vec3 T1 = lensq > 0.0 ? vec3(-Vh.y, Vh.x, 0.0) / sqrt(lensq) : vec3(1.0, 0.0, 0.0);
62458
+ vec3 T2 = cross(Vh, T1);
62459
+
62460
+ // Section 4.2: Parameterization of projected area
62461
+ float r = sqrt(Xi.x);
62462
+ float phi = 2.0 * PI * Xi.y;
62463
+ float t1 = r * cos(phi);
62464
+ float t2 = r * sin(phi);
62465
+ float s = 0.5 * (1.0 + Vh.z);
62466
+ t2 = (1.0 - s) * sqrt(1.0 - t1 * t1) + s * t2;
62467
+
62468
+ // Section 4.3: Reprojection onto hemisphere
62469
+ vec3 Nh = t1 * T1 + t2 * T2 + sqrt(max(0.0, 1.0 - t1 * t1 - t2 * t2)) * Vh;
62470
+
62471
+ // Section 3.4: Transform back to ellipsoid configuration
62472
+ return normalize(vec3(alpha * Nh.x, alpha * Nh.y, max(0.0, Nh.z)));
62473
+ }
62474
+
62475
+ void main() {
62476
+ vec3 N = normalize(vOutputDirection);
62477
+ vec3 V = N; // Assume view direction equals normal for pre-filtering
62478
+
62479
+ vec3 prefilteredColor = vec3(0.0);
62480
+ float totalWeight = 0.0;
62481
+
62482
+ // For very low roughness, just sample the environment directly
62483
+ if (roughness < 0.001) {
62484
+ gl_FragColor = vec4(bilinearCubeUV(envMap, N, mipInt), 1.0);
62485
+ return;
62486
+ }
62487
+
62488
+ // Tangent space basis for VNDF sampling
62489
+ vec3 up = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
62490
+ vec3 tangent = normalize(cross(up, N));
62491
+ vec3 bitangent = cross(N, tangent);
62492
+
62493
+ for(uint i = 0u; i < uint(GGX_SAMPLES); i++) {
62494
+ vec2 Xi = hammersley(i, uint(GGX_SAMPLES));
62495
+
62496
+ // For PMREM, V = N, so in tangent space V is always (0, 0, 1)
62497
+ vec3 H_tangent = importanceSampleGGX_VNDF(Xi, vec3(0.0, 0.0, 1.0), roughness);
62498
+
62499
+ // Transform H back to world space
62500
+ vec3 H = normalize(tangent * H_tangent.x + bitangent * H_tangent.y + N * H_tangent.z);
62501
+ vec3 L = normalize(2.0 * dot(V, H) * H - V);
62502
+
62503
+ float NdotL = max(dot(N, L), 0.0);
62504
+
62505
+ if(NdotL > 0.0) {
62506
+ // Sample environment at fixed mip level
62507
+ // VNDF importance sampling handles the distribution filtering
62508
+ vec3 sampleColor = bilinearCubeUV(envMap, L, mipInt);
62509
+
62510
+ // Weight by NdotL for the split-sum approximation
62511
+ // VNDF PDF naturally accounts for the visible microfacet distribution
62512
+ prefilteredColor += sampleColor * NdotL;
62513
+ totalWeight += NdotL;
62514
+ }
62515
+ }
62516
+
62517
+ if (totalWeight > 0.0) {
62518
+ prefilteredColor = prefilteredColor / totalWeight;
62519
+ }
62520
+
62521
+ gl_FragColor = vec4(prefilteredColor, 1.0);
62522
+ }
62523
+ `,
62524
+
62525
+ blending: NoBlending,
62526
+ depthTest: false,
62527
+ depthWrite: false
62528
+
62529
+ } );
62530
+
62531
+ return shaderMaterial;
62532
+
62533
+ }
62534
+
62143
62535
  function _getBlurShader( lodMax, width, height ) {
62144
62536
 
62145
62537
  const weights = new Float32Array( MAX_SAMPLES );
@@ -62522,30 +62914,7 @@ function WebGLExtensions( gl ) {
62522
62914
 
62523
62915
  }
62524
62916
 
62525
- let extension;
62526
-
62527
- switch ( name ) {
62528
-
62529
- case 'WEBGL_depth_texture':
62530
- extension = gl.getExtension( 'WEBGL_depth_texture' ) || gl.getExtension( 'MOZ_WEBGL_depth_texture' ) || gl.getExtension( 'WEBKIT_WEBGL_depth_texture' );
62531
- break;
62532
-
62533
- case 'EXT_texture_filter_anisotropic':
62534
- extension = gl.getExtension( 'EXT_texture_filter_anisotropic' ) || gl.getExtension( 'MOZ_EXT_texture_filter_anisotropic' ) || gl.getExtension( 'WEBKIT_EXT_texture_filter_anisotropic' );
62535
- break;
62536
-
62537
- case 'WEBGL_compressed_texture_s3tc':
62538
- extension = gl.getExtension( 'WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'MOZ_WEBGL_compressed_texture_s3tc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_s3tc' );
62539
- break;
62540
-
62541
- case 'WEBGL_compressed_texture_pvrtc':
62542
- extension = gl.getExtension( 'WEBGL_compressed_texture_pvrtc' ) || gl.getExtension( 'WEBKIT_WEBGL_compressed_texture_pvrtc' );
62543
- break;
62544
-
62545
- default:
62546
- extension = gl.getExtension( name );
62547
-
62548
- }
62917
+ const extension = gl.getExtension( name );
62549
62918
 
62550
62919
  extensions[ name ] = extension;
62551
62920
 
@@ -62578,7 +62947,7 @@ function WebGLExtensions( gl ) {
62578
62947
 
62579
62948
  if ( extension === null ) {
62580
62949
 
62581
- warnOnce( 'THREE.WebGLRenderer: ' + name + ' extension not supported.' );
62950
+ warnOnce( 'WebGLRenderer: ' + name + ' extension not supported.' );
62582
62951
 
62583
62952
  }
62584
62953
 
@@ -62908,7 +63277,7 @@ function WebGLInfo( gl ) {
62908
63277
  break;
62909
63278
 
62910
63279
  default:
62911
- console.error( 'THREE.WebGLInfo: Unknown draw mode:', mode );
63280
+ error( 'WebGLInfo: Unknown draw mode:', mode );
62912
63281
  break;
62913
63282
 
62914
63283
  }
@@ -64397,7 +64766,7 @@ function getEncodingComponents( colorSpace ) {
64397
64766
  return [ encodingMatrix, 'sRGBTransferOETF' ];
64398
64767
 
64399
64768
  default:
64400
- console.warn( 'THREE.WebGLProgram: Unsupported color space: ', colorSpace );
64769
+ warn( 'WebGLProgram: Unsupported color space: ', colorSpace );
64401
64770
  return [ encodingMatrix, 'LinearTransferOETF' ];
64402
64771
 
64403
64772
  }
@@ -64417,7 +64786,7 @@ function getShaderErrors( gl, shader, type ) {
64417
64786
  if ( errorMatches ) {
64418
64787
 
64419
64788
  // --enable-privileged-webgl-extension
64420
- // console.log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) );
64789
+ // log( '**' + type + '**', gl.getExtension( 'WEBGL_debug_shaders' ).getTranslatedShaderSource( shader ) );
64421
64790
 
64422
64791
  const errorLine = parseInt( errorMatches[ 1 ] );
64423
64792
  return type.toUpperCase() + '\n\n' + errors + '\n\n' + handleSource( gl.getShaderSource( shader ), errorLine );
@@ -64481,7 +64850,7 @@ function getToneMappingFunction( functionName, toneMapping ) {
64481
64850
  break;
64482
64851
 
64483
64852
  default:
64484
- console.warn( 'THREE.WebGLProgram: Unsupported toneMapping:', toneMapping );
64853
+ warn( 'WebGLProgram: Unsupported toneMapping:', toneMapping );
64485
64854
  toneMappingName = 'Linear';
64486
64855
 
64487
64856
  }
@@ -64559,7 +64928,7 @@ function fetchAttributeLocations( gl, program ) {
64559
64928
  if ( info.type === gl.FLOAT_MAT3 ) locationSize = 3;
64560
64929
  if ( info.type === gl.FLOAT_MAT4 ) locationSize = 4;
64561
64930
 
64562
- // console.log( 'THREE.WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i );
64931
+ // log( 'WebGLProgram: ACTIVE VERTEX ATTRIBUTE:', name, i );
64563
64932
 
64564
64933
  attributes[ name ] = {
64565
64934
  type: info.type,
@@ -64629,7 +64998,7 @@ function includeReplacer( match, include ) {
64629
64998
  if ( newInclude !== undefined ) {
64630
64999
 
64631
65000
  string = ShaderChunk[ newInclude ];
64632
- console.warn( 'THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include, newInclude );
65001
+ warn( 'WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include, newInclude );
64633
65002
 
64634
65003
  } else {
64635
65004
 
@@ -64825,7 +65194,7 @@ function generateCubeUVSize( parameters ) {
64825
65194
  function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
64826
65195
 
64827
65196
  // TODO Send this event to Three.js DevTools
64828
- // console.log( 'WebGLProgram', cacheKey );
65197
+ // log( 'WebGLProgram', cacheKey );
64829
65198
 
64830
65199
  const gl = renderer.getContext();
64831
65200
 
@@ -65262,8 +65631,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
65262
65631
  const vertexGlsl = versionString + prefixVertex + vertexShader;
65263
65632
  const fragmentGlsl = versionString + prefixFragment + fragmentShader;
65264
65633
 
65265
- // console.log( '*VERTEX*', vertexGlsl );
65266
- // console.log( '*FRAGMENT*', fragmentGlsl );
65634
+ // log( '*VERTEX*', vertexGlsl );
65635
+ // log( '*FRAGMENT*', fragmentGlsl );
65267
65636
 
65268
65637
  const glVertexShader = WebGLShader( gl, gl.VERTEX_SHADER, vertexGlsl );
65269
65638
  const glFragmentShader = WebGLShader( gl, gl.FRAGMENT_SHADER, fragmentGlsl );
@@ -65317,7 +65686,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
65317
65686
  const vertexErrors = getShaderErrors( gl, glVertexShader, 'vertex' );
65318
65687
  const fragmentErrors = getShaderErrors( gl, glFragmentShader, 'fragment' );
65319
65688
 
65320
- console.error(
65689
+ error(
65321
65690
  'THREE.WebGLProgram: Shader Error ' + gl.getError() + ' - ' +
65322
65691
  'VALIDATE_STATUS ' + gl.getProgramParameter( program, gl.VALIDATE_STATUS ) + '\n\n' +
65323
65692
  'Material Name: ' + self.name + '\n' +
@@ -65331,7 +65700,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
65331
65700
 
65332
65701
  } else if ( programLog !== '' ) {
65333
65702
 
65334
- console.warn( 'THREE.WebGLProgram: Program Info Log:', programLog );
65703
+ warn( 'WebGLProgram: Program Info Log:', programLog );
65335
65704
 
65336
65705
  } else if ( vertexLog === '' || fragmentLog === '' ) {
65337
65706
 
@@ -65641,7 +66010,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
65641
66010
 
65642
66011
  if ( precision !== material.precision ) {
65643
66012
 
65644
- console.warn( 'THREE.WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.' );
66013
+ warn( 'WebGLProgram.getParameters:', material.precision, 'not supported, using', precision, 'instead.' );
65645
66014
 
65646
66015
  }
65647
66016
 
@@ -67316,7 +67685,7 @@ function WebGLShadowMap( renderer, objects, capabilities ) {
67316
67685
 
67317
67686
  if ( shadow === undefined ) {
67318
67687
 
67319
- console.warn( 'THREE.WebGLShadowMap:', light, 'has no shadow.' );
67688
+ warn( 'WebGLShadowMap:', light, 'has no shadow.' );
67320
67689
  continue;
67321
67690
 
67322
67691
  }
@@ -68304,7 +68673,7 @@ function WebGLState( gl, extensions ) {
68304
68673
  break;
68305
68674
 
68306
68675
  default:
68307
- console.error( 'THREE.WebGLState: Invalid blending: ', blending );
68676
+ error( 'WebGLState: Invalid blending: ', blending );
68308
68677
  break;
68309
68678
 
68310
68679
  }
@@ -68322,15 +68691,15 @@ function WebGLState( gl, extensions ) {
68322
68691
  break;
68323
68692
 
68324
68693
  case SubtractiveBlending:
68325
- console.error( 'THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true' );
68694
+ error( 'WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true' );
68326
68695
  break;
68327
68696
 
68328
68697
  case MultiplyBlending:
68329
- console.error( 'THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true' );
68698
+ error( 'WebGLState: MultiplyBlending requires material.premultipliedAlpha = true' );
68330
68699
  break;
68331
68700
 
68332
68701
  default:
68333
- console.error( 'THREE.WebGLState: Invalid blending: ', blending );
68702
+ error( 'WebGLState: Invalid blending: ', blending );
68334
68703
  break;
68335
68704
 
68336
68705
  }
@@ -68617,7 +68986,7 @@ function WebGLState( gl, extensions ) {
68617
68986
 
68618
68987
  } catch ( error ) {
68619
68988
 
68620
- console.error( 'THREE.WebGLState:', error );
68989
+ error( 'WebGLState:', error );
68621
68990
 
68622
68991
  }
68623
68992
 
@@ -68631,7 +69000,7 @@ function WebGLState( gl, extensions ) {
68631
69000
 
68632
69001
  } catch ( error ) {
68633
69002
 
68634
- console.error( 'THREE.WebGLState:', error );
69003
+ error( 'WebGLState:', error );
68635
69004
 
68636
69005
  }
68637
69006
 
@@ -68645,7 +69014,7 @@ function WebGLState( gl, extensions ) {
68645
69014
 
68646
69015
  } catch ( error ) {
68647
69016
 
68648
- console.error( 'THREE.WebGLState:', error );
69017
+ error( 'WebGLState:', error );
68649
69018
 
68650
69019
  }
68651
69020
 
@@ -68659,7 +69028,7 @@ function WebGLState( gl, extensions ) {
68659
69028
 
68660
69029
  } catch ( error ) {
68661
69030
 
68662
- console.error( 'THREE.WebGLState:', error );
69031
+ error( 'WebGLState:', error );
68663
69032
 
68664
69033
  }
68665
69034
 
@@ -68673,7 +69042,7 @@ function WebGLState( gl, extensions ) {
68673
69042
 
68674
69043
  } catch ( error ) {
68675
69044
 
68676
- console.error( 'THREE.WebGLState:', error );
69045
+ error( 'WebGLState:', error );
68677
69046
 
68678
69047
  }
68679
69048
 
@@ -68687,7 +69056,7 @@ function WebGLState( gl, extensions ) {
68687
69056
 
68688
69057
  } catch ( error ) {
68689
69058
 
68690
- console.error( 'THREE.WebGLState:', error );
69059
+ error( 'WebGLState:', error );
68691
69060
 
68692
69061
  }
68693
69062
 
@@ -68701,7 +69070,7 @@ function WebGLState( gl, extensions ) {
68701
69070
 
68702
69071
  } catch ( error ) {
68703
69072
 
68704
- console.error( 'THREE.WebGLState:', error );
69073
+ error( 'WebGLState:', error );
68705
69074
 
68706
69075
  }
68707
69076
 
@@ -68715,7 +69084,7 @@ function WebGLState( gl, extensions ) {
68715
69084
 
68716
69085
  } catch ( error ) {
68717
69086
 
68718
- console.error( 'THREE.WebGLState:', error );
69087
+ error( 'WebGLState:', error );
68719
69088
 
68720
69089
  }
68721
69090
 
@@ -68729,7 +69098,7 @@ function WebGLState( gl, extensions ) {
68729
69098
 
68730
69099
  } catch ( error ) {
68731
69100
 
68732
- console.error( 'THREE.WebGLState:', error );
69101
+ error( 'WebGLState:', error );
68733
69102
 
68734
69103
  }
68735
69104
 
@@ -68743,7 +69112,7 @@ function WebGLState( gl, extensions ) {
68743
69112
 
68744
69113
  } catch ( error ) {
68745
69114
 
68746
- console.error( 'THREE.WebGLState:', error );
69115
+ error( 'WebGLState:', error );
68747
69116
 
68748
69117
  }
68749
69118
 
@@ -69040,7 +69409,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
69040
69409
  const context = canvas.getContext( '2d' );
69041
69410
  context.drawImage( image, 0, 0, width, height );
69042
69411
 
69043
- console.warn( 'THREE.WebGLRenderer: Texture has been resized from (' + dimensions.width + 'x' + dimensions.height + ') to (' + width + 'x' + height + ').' );
69412
+ warn( 'WebGLRenderer: Texture has been resized from (' + dimensions.width + 'x' + dimensions.height + ') to (' + width + 'x' + height + ').' );
69044
69413
 
69045
69414
  return canvas;
69046
69415
 
@@ -69048,7 +69417,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
69048
69417
 
69049
69418
  if ( 'data' in image ) {
69050
69419
 
69051
- console.warn( 'THREE.WebGLRenderer: Image in DataTexture is too big (' + dimensions.width + 'x' + dimensions.height + ').' );
69420
+ warn( 'WebGLRenderer: Image in DataTexture is too big (' + dimensions.width + 'x' + dimensions.height + ').' );
69052
69421
 
69053
69422
  }
69054
69423
 
@@ -69089,7 +69458,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
69089
69458
 
69090
69459
  if ( _gl[ internalFormatName ] !== undefined ) return _gl[ internalFormatName ];
69091
69460
 
69092
- console.warn( 'THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format \'' + internalFormatName + '\'' );
69461
+ warn( 'WebGLRenderer: Attempt to use non-existing WebGL internal format \'' + internalFormatName + '\'' );
69093
69462
 
69094
69463
  }
69095
69464
 
@@ -69202,7 +69571,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
69202
69571
  } else if ( depthType === UnsignedShortType ) {
69203
69572
 
69204
69573
  glInternalFormat = _gl.DEPTH24_STENCIL8;
69205
- console.warn( 'DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.' );
69574
+ warn( 'DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.' );
69206
69575
 
69207
69576
  }
69208
69577
 
@@ -69432,7 +69801,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
69432
69801
 
69433
69802
  if ( textureUnit >= capabilities.maxTextures ) {
69434
69803
 
69435
- console.warn( 'THREE.WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures );
69804
+ warn( 'WebGLTextures: Trying to use ' + textureUnit + ' texture units while this GPU supports only ' + capabilities.maxTextures );
69436
69805
 
69437
69806
  }
69438
69807
 
@@ -69479,11 +69848,11 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
69479
69848
 
69480
69849
  if ( image === null ) {
69481
69850
 
69482
- console.warn( 'THREE.WebGLRenderer: Texture marked for update but no image data found.' );
69851
+ warn( 'WebGLRenderer: Texture marked for update but no image data found.' );
69483
69852
 
69484
69853
  } else if ( image.complete === false ) {
69485
69854
 
69486
- console.warn( 'THREE.WebGLRenderer: Texture marked for update but image is incomplete' );
69855
+ warn( 'WebGLRenderer: Texture marked for update but image is incomplete' );
69487
69856
 
69488
69857
  } else {
69489
69858
 
@@ -69511,6 +69880,10 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
69511
69880
  uploadTexture( textureProperties, texture, slot );
69512
69881
  return;
69513
69882
 
69883
+ } else if ( texture.isExternalTexture ) {
69884
+
69885
+ textureProperties.__webglTexture = texture.sourceTexture ? texture.sourceTexture : null;
69886
+
69514
69887
  }
69515
69888
 
69516
69889
  state.bindTexture( _gl.TEXTURE_2D_ARRAY, textureProperties.__webglTexture, _gl.TEXTURE0 + slot );
@@ -69580,7 +69953,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
69580
69953
  ( texture.magFilter === LinearFilter || texture.magFilter === LinearMipmapNearestFilter || texture.magFilter === NearestMipmapLinearFilter || texture.magFilter === LinearMipmapLinearFilter ||
69581
69954
  texture.minFilter === LinearFilter || texture.minFilter === LinearMipmapNearestFilter || texture.minFilter === NearestMipmapLinearFilter || texture.minFilter === LinearMipmapLinearFilter ) ) {
69582
69955
 
69583
- console.warn( 'THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.' );
69956
+ warn( 'WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device.' );
69584
69957
 
69585
69958
  }
69586
69959
 
@@ -69989,7 +70362,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
69989
70362
 
69990
70363
  } else {
69991
70364
 
69992
- console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );
70365
+ warn( 'WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );
69993
70366
 
69994
70367
  }
69995
70368
 
@@ -70045,7 +70418,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
70045
70418
 
70046
70419
  } else {
70047
70420
 
70048
- console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );
70421
+ warn( 'WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()' );
70049
70422
 
70050
70423
  }
70051
70424
 
@@ -70339,7 +70712,7 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
70339
70712
 
70340
70713
  } else {
70341
70714
 
70342
- console.warn( 'THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()' );
70715
+ warn( 'WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()' );
70343
70716
 
70344
70717
  }
70345
70718
 
@@ -71232,13 +71605,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
71232
71605
 
71233
71606
  if ( format !== RGBAFormat || type !== UnsignedByteType ) {
71234
71607
 
71235
- console.warn( 'THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.' );
71608
+ warn( 'WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType.' );
71236
71609
 
71237
71610
  }
71238
71611
 
71239
71612
  } else {
71240
71613
 
71241
- console.error( 'THREE.WebGLTextures: Unsupported texture color space:', colorSpace );
71614
+ error( 'WebGLTextures: Unsupported texture color space:', colorSpace );
71242
71615
 
71243
71616
  }
71244
71617
 
@@ -71914,7 +72287,7 @@ class WebXRManager extends EventDispatcher {
71914
72287
 
71915
72288
  if ( scope.isPresenting === true ) {
71916
72289
 
71917
- console.warn( 'THREE.WebXRManager: Cannot change framebuffer scale while presenting.' );
72290
+ warn( 'WebXRManager: Cannot change framebuffer scale while presenting.' );
71918
72291
 
71919
72292
  }
71920
72293
 
@@ -71936,7 +72309,7 @@ class WebXRManager extends EventDispatcher {
71936
72309
 
71937
72310
  if ( scope.isPresenting === true ) {
71938
72311
 
71939
- console.warn( 'THREE.WebXRManager: Cannot change reference space type while presenting.' );
72312
+ warn( 'WebXRManager: Cannot change reference space type while presenting.' );
71940
72313
 
71941
72314
  }
71942
72315
 
@@ -73414,7 +73787,7 @@ function WebGLUniformsGroups( gl, info, capabilities, state ) {
73414
73787
 
73415
73788
  }
73416
73789
 
73417
- console.error( 'THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.' );
73790
+ error( 'WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached.' );
73418
73791
 
73419
73792
  return 0;
73420
73793
 
@@ -73669,11 +74042,11 @@ function WebGLUniformsGroups( gl, info, capabilities, state ) {
73669
74042
 
73670
74043
  } else if ( value.isTexture ) {
73671
74044
 
73672
- console.warn( 'THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group.' );
74045
+ warn( 'WebGLRenderer: Texture samplers can not be part of an uniforms group.' );
73673
74046
 
73674
74047
  } else {
73675
74048
 
73676
- console.warn( 'THREE.WebGLRenderer: Unsupported uniform value type.', value );
74049
+ warn( 'WebGLRenderer: Unsupported uniform value type.', value );
73677
74050
 
73678
74051
  }
73679
74052
 
@@ -73722,6 +74095,69 @@ function WebGLUniformsGroups( gl, info, capabilities, state ) {
73722
74095
 
73723
74096
  }
73724
74097
 
74098
+ /**
74099
+ * Precomputed DFG LUT for Image-Based Lighting
74100
+ * Resolution: 32x32
74101
+ * Samples: 4096 per texel
74102
+ * Format: RG16F (2 half floats per texel: scale, bias)
74103
+ */
74104
+
74105
+
74106
+ const DATA = new Uint16Array( [
74107
+ 0x2cd9, 0x3b64, 0x2d0e, 0x3b43, 0x2e20, 0x3aa7, 0x3061, 0x39fb, 0x325e, 0x397c, 0x3454, 0x3908, 0x357d, 0x3893, 0x3698, 0x381e, 0x379d, 0x375b, 0x3845, 0x3689, 0x38af, 0x35ca, 0x390d, 0x351e, 0x395f, 0x3484, 0x39a8, 0x33f9, 0x39e6, 0x330a, 0x3a1c, 0x3239, 0x3a4b, 0x3183, 0x3a73, 0x30e5, 0x3a95, 0x305b, 0x3ab1, 0x2fc6, 0x3ac9, 0x2ef7, 0x3ade, 0x2e43, 0x3aee, 0x2da7, 0x3afc, 0x2d1f, 0x3b07, 0x2ca9, 0x3b10, 0x2c42, 0x3b17, 0x2bd1, 0x3b1c, 0x2b34, 0x3b1f, 0x2aaa, 0x3b22, 0x2a31, 0x3b23, 0x29c7, 0x3b23, 0x2968,
74108
+ 0x32d4, 0x3a4b, 0x32dc, 0x3a45, 0x3308, 0x3a26, 0x3378, 0x39d0, 0x3425, 0x394a, 0x34c9, 0x38be, 0x359c, 0x383e, 0x3688, 0x3796, 0x3778, 0x36c4, 0x382f, 0x3603, 0x3898, 0x3553, 0x38f7, 0x34b3, 0x394b, 0x3424, 0x3994, 0x334c, 0x39d3, 0x326c, 0x3a08, 0x31a9, 0x3a35, 0x30fe, 0x3a5a, 0x306a, 0x3a78, 0x2fd1, 0x3a90, 0x2ef1, 0x3aa2, 0x2e2e, 0x3ab0, 0x2d86, 0x3aba, 0x2cf3, 0x3ac1, 0x2c74, 0x3ac4, 0x2c05, 0x3ac4, 0x2b49, 0x3ac2, 0x2aa1, 0x3abd, 0x2a0c, 0x3ab7, 0x298b, 0x3aaf, 0x2918, 0x3aa6, 0x28b3, 0x3a9b, 0x285a,
74109
+ 0x3559, 0x3954, 0x355a, 0x3951, 0x3566, 0x3944, 0x3582, 0x391e, 0x35b6, 0x38d3, 0x360a, 0x386a, 0x3684, 0x37ed, 0x3720, 0x370d, 0x37d3, 0x3641, 0x3847, 0x3588, 0x38a3, 0x34e2, 0x38fa, 0x344d, 0x3948, 0x3391, 0x398d, 0x32a6, 0x39c8, 0x31d6, 0x39fa, 0x3121, 0x3a22, 0x3082, 0x3a43, 0x2ff0, 0x3a5c, 0x2f01, 0x3a6f, 0x2e32, 0x3a7c, 0x2d7e, 0x3a84, 0x2ce2, 0x3a87, 0x2c5b, 0x3a87, 0x2bcc, 0x3a83, 0x2b00, 0x3a7b, 0x2a4e, 0x3a71, 0x29b3, 0x3a66, 0x292c, 0x3a58, 0x28b4, 0x3a4b, 0x284b, 0x3a3d, 0x27dc, 0x3a2e, 0x2739,
74110
+ 0x3709, 0x387c, 0x370a, 0x387b, 0x3710, 0x3874, 0x3720, 0x385f, 0x373d, 0x3834, 0x376a, 0x37e1, 0x37ac, 0x3732, 0x3805, 0x3675, 0x383f, 0x35bc, 0x3883, 0x3511, 0x38cb, 0x3476, 0x3912, 0x33d8, 0x3955, 0x32e2, 0x3991, 0x3208, 0x39c6, 0x3149, 0x39f1, 0x30a1, 0x3a15, 0x300f, 0x3a30, 0x2f21, 0x3a44, 0x2e45, 0x3a51, 0x2d87, 0x3a59, 0x2ce2, 0x3a5b, 0x2c53, 0x3a58, 0x2bb0, 0x3a52, 0x2ada, 0x3a49, 0x2a1f, 0x3a40, 0x297d, 0x3a34, 0x28f0, 0x3a25, 0x2874, 0x3a13, 0x2807, 0x3a00, 0x274e, 0x39eb, 0x26a6, 0x39d5, 0x2611,
74111
+ 0x3840, 0x3780, 0x3840, 0x377e, 0x3842, 0x3776, 0x3846, 0x375e, 0x384f, 0x372a, 0x385b, 0x36d3, 0x386c, 0x3659, 0x3885, 0x35c7, 0x38a8, 0x352d, 0x38d4, 0x3497, 0x3906, 0x340c, 0x393b, 0x331a, 0x3970, 0x323a, 0x39a0, 0x3172, 0x39cb, 0x30c3, 0x39ef, 0x302a, 0x3a0c, 0x2f4a, 0x3a21, 0x2e63, 0x3a2f, 0x2d9b, 0x3a37, 0x2ced, 0x3a39, 0x2c57, 0x3a37, 0x2baa, 0x3a34, 0x2ac9, 0x3a2c, 0x2a05, 0x3a20, 0x295d, 0x3a11, 0x28ca, 0x39ff, 0x2849, 0x39eb, 0x27b2, 0x39d5, 0x26ed, 0x39be, 0x2640, 0x39a5, 0x25aa, 0x398b, 0x2523,
74112
+ 0x38e2, 0x363b, 0x38e2, 0x363b, 0x38e3, 0x3635, 0x38e6, 0x3626, 0x38ea, 0x3606, 0x38f0, 0x35cd, 0x38f8, 0x3579, 0x3903, 0x350e, 0x3915, 0x3495, 0x392d, 0x3418, 0x394c, 0x3340, 0x3970, 0x3261, 0x3995, 0x3197, 0x39b8, 0x30e4, 0x39d8, 0x3046, 0x39f3, 0x2f76, 0x3a08, 0x2e86, 0x3a16, 0x2db5, 0x3a1e, 0x2cff, 0x3a22, 0x2c61, 0x3a24, 0x2bb3, 0x3a20, 0x2ac7, 0x3a17, 0x29fc, 0x3a0a, 0x294c, 0x39fa, 0x28b2, 0x39e7, 0x282e, 0x39d1, 0x2773, 0x39b9, 0x26a9, 0x399f, 0x25fa, 0x3985, 0x255f, 0x3968, 0x24d6, 0x394a, 0x245d,
74113
+ 0x396e, 0x3524, 0x396e, 0x3524, 0x396e, 0x3520, 0x396f, 0x3517, 0x3971, 0x3502, 0x3973, 0x34dd, 0x3975, 0x34a5, 0x3978, 0x3458, 0x397e, 0x33f9, 0x3987, 0x3332, 0x3997, 0x326b, 0x39aa, 0x31ac, 0x39c0, 0x30fb, 0x39d7, 0x305c, 0x39eb, 0x2f9e, 0x39fc, 0x2ea7, 0x3a07, 0x2dcf, 0x3a0f, 0x2d13, 0x3a16, 0x2c70, 0x3a17, 0x2bc4, 0x3a14, 0x2ad0, 0x3a0a, 0x29fc, 0x39fd, 0x2945, 0x39ed, 0x28a6, 0x39d9, 0x281d, 0x39c2, 0x274a, 0x39a9, 0x267c, 0x398e, 0x25c7, 0x3971, 0x2528, 0x3952, 0x249e, 0x3931, 0x2425, 0x3910, 0x2374,
74114
+ 0x39e5, 0x3436, 0x39e5, 0x3435, 0x39e5, 0x3434, 0x39e5, 0x342e, 0x39e5, 0x3420, 0x39e5, 0x3408, 0x39e3, 0x33c4, 0x39e1, 0x3359, 0x39df, 0x32d3, 0x39de, 0x323a, 0x39e1, 0x319a, 0x39e7, 0x30fb, 0x39f0, 0x3065, 0x39f9, 0x2fb6, 0x3a02, 0x2ec0, 0x3a08, 0x2de6, 0x3a0d, 0x2d26, 0x3a12, 0x2c7e, 0x3a13, 0x2bda, 0x3a0e, 0x2adc, 0x3a05, 0x2a02, 0x39f8, 0x2945, 0x39e7, 0x28a1, 0x39d3, 0x2813, 0x39bc, 0x2730, 0x39a2, 0x265c, 0x3985, 0x25a3, 0x3966, 0x2501, 0x3945, 0x2475, 0x3923, 0x23f3, 0x3901, 0x231c, 0x38dd, 0x225e,
74115
+ 0x3a4b, 0x32d6, 0x3a4a, 0x32d6, 0x3a4a, 0x32d4, 0x3a4a, 0x32cc, 0x3a48, 0x32bb, 0x3a47, 0x329d, 0x3a43, 0x326b, 0x3a3d, 0x3222, 0x3a36, 0x31c2, 0x3a2e, 0x314f, 0x3a28, 0x30d2, 0x3a23, 0x3052, 0x3a20, 0x2fab, 0x3a1e, 0x2ec2, 0x3a1b, 0x2def, 0x3a19, 0x2d31, 0x3a1a, 0x2c89, 0x3a18, 0x2beb, 0x3a11, 0x2aea, 0x3a07, 0x2a0a, 0x39fa, 0x2948, 0x39e9, 0x28a1, 0x39d4, 0x280f, 0x39bd, 0x2721, 0x39a2, 0x2647, 0x3985, 0x258b, 0x3964, 0x24e5, 0x3942, 0x2455, 0x391f, 0x23b3, 0x38fb, 0x22d8, 0x38d4, 0x2219, 0x38ad, 0x2172,
74116
+ 0x3aa0, 0x3180, 0x3aa0, 0x3180, 0x3aa0, 0x317f, 0x3a9f, 0x317b, 0x3a9d, 0x3170, 0x3a99, 0x315d, 0x3a95, 0x313d, 0x3a8d, 0x310c, 0x3a82, 0x30ca, 0x3a76, 0x3077, 0x3a69, 0x3019, 0x3a5c, 0x2f68, 0x3a4f, 0x2e9e, 0x3a42, 0x2dde, 0x3a37, 0x2d2b, 0x3a30, 0x2c89, 0x3a29, 0x2bef, 0x3a1f, 0x2af0, 0x3a12, 0x2a0f, 0x3a03, 0x294a, 0x39f1, 0x28a0, 0x39dc, 0x280c, 0x39c5, 0x2717, 0x39a9, 0x2638, 0x398b, 0x2578, 0x396a, 0x24d0, 0x3947, 0x243f, 0x3923, 0x2380, 0x38fc, 0x22a4, 0x38d4, 0x21e4, 0x38ac, 0x213c, 0x3883, 0x20a8,
74117
+ 0x3ae8, 0x3062, 0x3ae8, 0x3062, 0x3ae7, 0x3061, 0x3ae6, 0x305f, 0x3ae4, 0x305a, 0x3ae0, 0x304f, 0x3ada, 0x303b, 0x3ad1, 0x301b, 0x3ac5, 0x2fdd, 0x3ab6, 0x2f6a, 0x3aa4, 0x2ede, 0x3a91, 0x2e45, 0x3a7c, 0x2da5, 0x3a67, 0x2d0a, 0x3a57, 0x2c77, 0x3a48, 0x2bdc, 0x3a38, 0x2ae5, 0x3a27, 0x2a0a, 0x3a16, 0x2947, 0x3a02, 0x289d, 0x39eb, 0x2808, 0x39d3, 0x270d, 0x39b6, 0x262b, 0x3997, 0x256a, 0x3976, 0x24bf, 0x3952, 0x242b, 0x392d, 0x2358, 0x3904, 0x227a, 0x38db, 0x21b8, 0x38b2, 0x2110, 0x3887, 0x207d, 0x385b, 0x1ff6,
74118
+ 0x3b23, 0x2ee8, 0x3b23, 0x2ee8, 0x3b22, 0x2ee8, 0x3b21, 0x2ee7, 0x3b1f, 0x2ee3, 0x3b1a, 0x2ed6, 0x3b14, 0x2ec1, 0x3b0b, 0x2e99, 0x3afe, 0x2e60, 0x3aee, 0x2e12, 0x3ad8, 0x2dad, 0x3ac1, 0x2d3d, 0x3aa5, 0x2cc3, 0x3a8b, 0x2c48, 0x3a76, 0x2ba2, 0x3a60, 0x2ac0, 0x3a49, 0x29f2, 0x3a32, 0x2938, 0x3a1b, 0x2893, 0x3a02, 0x27ff, 0x39e8, 0x26ff, 0x39ca, 0x261e, 0x39aa, 0x255b, 0x3988, 0x24b0, 0x3964, 0x241c, 0x393d, 0x2336, 0x3913, 0x2257, 0x38e9, 0x2195, 0x38be, 0x20eb, 0x3891, 0x2059, 0x3864, 0x1fae, 0x3837, 0x1ecd,
74119
+ 0x3b54, 0x2d61, 0x3b54, 0x2d61, 0x3b53, 0x2d61, 0x3b52, 0x2d62, 0x3b4f, 0x2d61, 0x3b4b, 0x2d5c, 0x3b45, 0x2d51, 0x3b3b, 0x2d3d, 0x3b2e, 0x2d1a, 0x3b1d, 0x2ce7, 0x3b06, 0x2ca3, 0x3aeb, 0x2c52, 0x3acb, 0x2bee, 0x3ab0, 0x2b31, 0x3a94, 0x2a74, 0x3a77, 0x29bf, 0x3a5a, 0x2915, 0x3a3f, 0x287a, 0x3a22, 0x27de, 0x3a05, 0x26e4, 0x39e5, 0x2609, 0x39c3, 0x2547, 0x39a0, 0x249f, 0x397b, 0x240c, 0x3953, 0x2314, 0x3928, 0x2238, 0x38fd, 0x2175, 0x38d0, 0x20cb, 0x38a2, 0x2038, 0x3873, 0x1f71, 0x3844, 0x1e90, 0x3815, 0x1dce,
74120
+ 0x3b7c, 0x2c22, 0x3b7c, 0x2c22, 0x3b7b, 0x2c23, 0x3b7a, 0x2c25, 0x3b77, 0x2c27, 0x3b73, 0x2c26, 0x3b6d, 0x2c23, 0x3b64, 0x2c1a, 0x3b57, 0x2c07, 0x3b46, 0x2bd1, 0x3b2e, 0x2b79, 0x3b0f, 0x2b07, 0x3aef, 0x2a86, 0x3ad1, 0x29f8, 0x3ab0, 0x2967, 0x3a8e, 0x28d7, 0x3a6d, 0x284e, 0x3a4c, 0x279f, 0x3a2b, 0x26b7, 0x3a08, 0x25e5, 0x39e4, 0x252c, 0x39be, 0x2488, 0x3998, 0x23f0, 0x396f, 0x22f2, 0x3943, 0x2215, 0x3917, 0x2155, 0x38e8, 0x20ae, 0x38b9, 0x201c, 0x3888, 0x1f38, 0x3857, 0x1e5a, 0x3826, 0x1d9a, 0x37eb, 0x1cf0,
74121
+ 0x3b9c, 0x2a43, 0x3b9c, 0x2a43, 0x3b9b, 0x2a46, 0x3b9a, 0x2a4a, 0x3b98, 0x2a50, 0x3b93, 0x2a54, 0x3b8e, 0x2a59, 0x3b85, 0x2a56, 0x3b79, 0x2a45, 0x3b67, 0x2a24, 0x3b4f, 0x29ee, 0x3b2f, 0x29a4, 0x3b10, 0x294b, 0x3aef, 0x28e5, 0x3ac9, 0x2877, 0x3aa4, 0x2809, 0x3a7e, 0x2739, 0x3a59, 0x266d, 0x3a34, 0x25af, 0x3a0c, 0x2503, 0x39e4, 0x2468, 0x39bb, 0x23bb, 0x3990, 0x22c6, 0x3963, 0x21f0, 0x3936, 0x2133, 0x3906, 0x208f, 0x38d5, 0x1ffd, 0x38a3, 0x1f04, 0x3870, 0x1e28, 0x383d, 0x1d69, 0x380b, 0x1cc3, 0x37b0, 0x1c32,
74122
+ 0x3bb5, 0x28aa, 0x3bb5, 0x28ab, 0x3bb5, 0x28ad, 0x3bb4, 0x28b2, 0x3bb2, 0x28b9, 0x3bae, 0x28c2, 0x3ba8, 0x28ca, 0x3ba0, 0x28d1, 0x3b94, 0x28cd, 0x3b83, 0x28c1, 0x3b6a, 0x28a3, 0x3b4b, 0x2876, 0x3b2d, 0x283d, 0x3b09, 0x27ea, 0x3ae1, 0x274b, 0x3ab9, 0x26a6, 0x3a8f, 0x25fe, 0x3a67, 0x255d, 0x3a3d, 0x24c5, 0x3a11, 0x2439, 0x39e6, 0x2371, 0x39b9, 0x228d, 0x398a, 0x21c1, 0x395a, 0x210b, 0x3929, 0x206c, 0x38f7, 0x1fc1, 0x38c3, 0x1ecb, 0x388f, 0x1df6, 0x385a, 0x1d3a, 0x3825, 0x1c99, 0x37e1, 0x1c08, 0x3779, 0x1b1b,
74123
+ 0x3bc9, 0x26d3, 0x3bc9, 0x26d4, 0x3bc9, 0x26d9, 0x3bc8, 0x26e3, 0x3bc6, 0x26ef, 0x3bc2, 0x2705, 0x3bbd, 0x271a, 0x3bb6, 0x2731, 0x3baa, 0x273c, 0x3b9a, 0x273d, 0x3b81, 0x2726, 0x3b65, 0x26f7, 0x3b46, 0x26af, 0x3b20, 0x2650, 0x3af7, 0x25e1, 0x3acd, 0x256a, 0x3aa1, 0x24eb, 0x3a75, 0x246f, 0x3a46, 0x23ee, 0x3a17, 0x230d, 0x39e9, 0x223e, 0x39b7, 0x2183, 0x3985, 0x20d8, 0x3953, 0x2043, 0x391e, 0x1f7a, 0x38e9, 0x1e8d, 0x38b3, 0x1dbf, 0x387c, 0x1d0b, 0x3845, 0x1c6c, 0x380e, 0x1bc4, 0x37b0, 0x1ad2, 0x3745, 0x19fd,
74124
+ 0x3bd9, 0x24e4, 0x3bd9, 0x24e5, 0x3bd9, 0x24e8, 0x3bd8, 0x24f2, 0x3bd5, 0x24fe, 0x3bd2, 0x2512, 0x3bce, 0x252b, 0x3bc6, 0x2544, 0x3bbc, 0x255a, 0x3bac, 0x256b, 0x3b93, 0x2569, 0x3b7a, 0x2557, 0x3b5b, 0x252f, 0x3b34, 0x24f7, 0x3b0c, 0x24ad, 0x3adf, 0x2458, 0x3ab1, 0x23f8, 0x3a82, 0x233f, 0x3a4f, 0x2286, 0x3a1e, 0x21d5, 0x39eb, 0x2130, 0x39b6, 0x2098, 0x3982, 0x200e, 0x394b, 0x1f25, 0x3914, 0x1e45, 0x38dc, 0x1d83, 0x38a3, 0x1cd6, 0x386b, 0x1c3d, 0x3831, 0x1b71, 0x37f2, 0x1a87, 0x3782, 0x19bc, 0x3714, 0x1909,
74125
+ 0x3be5, 0x22d8, 0x3be5, 0x22d9, 0x3be4, 0x22df, 0x3be4, 0x22ef, 0x3be1, 0x2305, 0x3bde, 0x232a, 0x3bda, 0x2358, 0x3bd4, 0x2392, 0x3bcb, 0x23ca, 0x3bbb, 0x23f4, 0x3ba3, 0x2405, 0x3b8c, 0x2405, 0x3b6c, 0x23ec, 0x3b47, 0x23ae, 0x3b1d, 0x2353, 0x3af0, 0x22e2, 0x3ac0, 0x2261, 0x3a8e, 0x21d9, 0x3a5a, 0x214e, 0x3a26, 0x20c7, 0x39ee, 0x2045, 0x39b7, 0x1f97, 0x397f, 0x1eba, 0x3945, 0x1df0, 0x390b, 0x1d3a, 0x38d0, 0x1c9a, 0x3895, 0x1c0a, 0x385a, 0x1b18, 0x381f, 0x1a39, 0x37c9, 0x1975, 0x3756, 0x18cc, 0x36e6, 0x1836,
74126
+ 0x3bed, 0x20a8, 0x3bed, 0x20a9, 0x3bed, 0x20ae, 0x3bed, 0x20bb, 0x3beb, 0x20cf, 0x3be8, 0x20ef, 0x3be4, 0x2119, 0x3bde, 0x214f, 0x3bd6, 0x2189, 0x3bc6, 0x21b8, 0x3bb1, 0x21de, 0x3b9a, 0x21f2, 0x3b7b, 0x21f2, 0x3b57, 0x21d8, 0x3b2d, 0x21a4, 0x3b00, 0x215f, 0x3acf, 0x2108, 0x3a99, 0x20a8, 0x3a64, 0x2043, 0x3a2c, 0x1fba, 0x39f2, 0x1ef3, 0x39b8, 0x1e36, 0x397c, 0x1d86, 0x3940, 0x1ce5, 0x3903, 0x1c52, 0x38c6, 0x1b9e, 0x3888, 0x1ab3, 0x384a, 0x19e4, 0x380e, 0x192b, 0x37a3, 0x188b, 0x372d, 0x17f7, 0x36ba, 0x1701,
74127
+ 0x3bf4, 0x1e23, 0x3bf4, 0x1e25, 0x3bf4, 0x1e2d, 0x3bf3, 0x1e41, 0x3bf1, 0x1e64, 0x3bef, 0x1e9c, 0x3beb, 0x1ee1, 0x3be6, 0x1f40, 0x3bde, 0x1fa7, 0x3bce, 0x2001, 0x3bbd, 0x202f, 0x3ba6, 0x204e, 0x3b88, 0x205f, 0x3b64, 0x205b, 0x3b3b, 0x2044, 0x3b0e, 0x201f, 0x3adb, 0x1fcf, 0x3aa6, 0x1f4e, 0x3a6e, 0x1ec1, 0x3a33, 0x1e2b, 0x39f7, 0x1d95, 0x39ba, 0x1d06, 0x397b, 0x1c7d, 0x393c, 0x1bfc, 0x38fc, 0x1b13, 0x38bc, 0x1a40, 0x387c, 0x1983, 0x383c, 0x18da, 0x37fa, 0x1842, 0x377f, 0x177f, 0x3706, 0x1695, 0x3691, 0x15c8,
74128
+ 0x3bf8, 0x1bca, 0x3bf8, 0x1bcc, 0x3bf8, 0x1bd8, 0x3bf8, 0x1bf7, 0x3bf6, 0x1c1b, 0x3bf4, 0x1c45, 0x3bf1, 0x1c83, 0x3bec, 0x1cce, 0x3be4, 0x1d21, 0x3bd5, 0x1d78, 0x3bc5, 0x1dd1, 0x3bb0, 0x1e17, 0x3b93, 0x1e4a, 0x3b70, 0x1e5f, 0x3b48, 0x1e57, 0x3b1b, 0x1e35, 0x3ae7, 0x1df6, 0x3ab2, 0x1da4, 0x3a77, 0x1d44, 0x3a3a, 0x1cdb, 0x39fc, 0x1c6e, 0x39bb, 0x1c03, 0x397a, 0x1b35, 0x3938, 0x1a72, 0x38f5, 0x19bb, 0x38b3, 0x1914, 0x3870, 0x187d, 0x382e, 0x17eb, 0x37db, 0x16f9, 0x375c, 0x1621, 0x36e1, 0x1565, 0x3669, 0x14be,
74129
+ 0x3bfb, 0x18b9, 0x3bfb, 0x18ba, 0x3bfb, 0x18c3, 0x3bfb, 0x18da, 0x3bf9, 0x190a, 0x3bf7, 0x1948, 0x3bf5, 0x19ac, 0x3bf0, 0x1a20, 0x3be9, 0x1ab3, 0x3bdb, 0x1b49, 0x3bcd, 0x1be6, 0x3bb7, 0x1c34, 0x3b9c, 0x1c6d, 0x3b7a, 0x1c8e, 0x3b54, 0x1c9e, 0x3b26, 0x1c96, 0x3af2, 0x1c75, 0x3abc, 0x1c47, 0x3a80, 0x1c09, 0x3a42, 0x1b85, 0x3a01, 0x1aec, 0x39be, 0x1a50, 0x397a, 0x19b5, 0x3935, 0x1921, 0x38f0, 0x1895, 0x38aa, 0x1814, 0x3866, 0x173a, 0x3821, 0x1665, 0x37be, 0x15a4, 0x373c, 0x14f9, 0x36be, 0x1460, 0x3644, 0x13b3,
74130
+ 0x3bfd, 0x156b, 0x3bfd, 0x156c, 0x3bfd, 0x1578, 0x3bfd, 0x1598, 0x3bfc, 0x15dd, 0x3bfa, 0x163c, 0x3bf7, 0x16cb, 0x3bf3, 0x177b, 0x3beb, 0x1833, 0x3be0, 0x18ad, 0x3bd2, 0x192e, 0x3bbd, 0x19a6, 0x3ba4, 0x1a0c, 0x3b83, 0x1a5a, 0x3b5d, 0x1a8c, 0x3b30, 0x1a9b, 0x3afd, 0x1a86, 0x3ac6, 0x1a5c, 0x3a89, 0x1a11, 0x3a49, 0x19b7, 0x3a06, 0x194f, 0x39c1, 0x18e3, 0x397a, 0x1873, 0x3933, 0x1805, 0x38eb, 0x173a, 0x38a3, 0x1676, 0x385c, 0x15bf, 0x3816, 0x1519, 0x37a2, 0x1482, 0x371d, 0x13f7, 0x369c, 0x1306, 0x3620, 0x1231,
74131
+ 0x3bff, 0x11cb, 0x3bff, 0x11cd, 0x3bfe, 0x11dd, 0x3bfe, 0x1219, 0x3bfd, 0x126b, 0x3bfb, 0x12e9, 0x3bf9, 0x13c5, 0x3bf5, 0x1460, 0x3bee, 0x150f, 0x3be3, 0x15c9, 0x3bd6, 0x168a, 0x3bc3, 0x174f, 0x3baa, 0x1806, 0x3b8b, 0x184f, 0x3b66, 0x1888, 0x3b39, 0x18a6, 0x3b07, 0x18ad, 0x3acf, 0x189c, 0x3a92, 0x1876, 0x3a50, 0x1840, 0x3a0c, 0x17fd, 0x39c4, 0x176a, 0x397b, 0x16ce, 0x3931, 0x1634, 0x38e6, 0x1599, 0x389c, 0x1508, 0x3852, 0x147f, 0x380a, 0x1401, 0x3788, 0x131c, 0x36ff, 0x124a, 0x367c, 0x1190, 0x35fe, 0x10ea,
74132
+ 0x3bff, 0x0daa, 0x3bff, 0x0dad, 0x3bff, 0x0dc0, 0x3bff, 0x0e0e, 0x3bfe, 0x0e87, 0x3bfc, 0x0f14, 0x3bfb, 0x1029, 0x3bf7, 0x10d1, 0x3bf0, 0x11d3, 0x3be6, 0x12c9, 0x3bd9, 0x13fc, 0x3bc7, 0x1499, 0x3bb0, 0x152a, 0x3b92, 0x15ab, 0x3b6e, 0x1615, 0x3b42, 0x165a, 0x3b10, 0x1681, 0x3ad8, 0x1683, 0x3a9a, 0x1665, 0x3a57, 0x1629, 0x3a11, 0x15dd, 0x39c8, 0x1580, 0x397c, 0x1518, 0x3930, 0x14ae, 0x38e3, 0x1441, 0x3896, 0x13b1, 0x384a, 0x12e9, 0x37ff, 0x122f, 0x376f, 0x1182, 0x36e3, 0x10e5, 0x365e, 0x1057, 0x35de, 0x0fac,
74133
+ 0x3c00, 0x08ea, 0x3c00, 0x08ed, 0x3c00, 0x0902, 0x3c00, 0x0961, 0x3bff, 0x09f3, 0x3bfd, 0x0abc, 0x3bfb, 0x0c1f, 0x3bf8, 0x0d15, 0x3bf1, 0x0e5b, 0x3be8, 0x0fb4, 0x3bdc, 0x10b0, 0x3bcb, 0x1190, 0x3bb5, 0x126c, 0x3b97, 0x132c, 0x3b74, 0x13de, 0x3b4a, 0x1432, 0x3b18, 0x145e, 0x3ae0, 0x1472, 0x3aa2, 0x146f, 0x3a5f, 0x1456, 0x3a17, 0x142e, 0x39cc, 0x13ee, 0x397e, 0x136b, 0x392f, 0x12e1, 0x38df, 0x124f, 0x3890, 0x11bd, 0x3842, 0x1131, 0x37eb, 0x10ac, 0x3757, 0x102e, 0x36c9, 0x0f76, 0x3640, 0x0ea3, 0x35bf, 0x0de4,
74134
+ 0x3c00, 0x039b, 0x3c00, 0x039d, 0x3c00, 0x03b2, 0x3c00, 0x041c, 0x3bff, 0x04be, 0x3bfd, 0x05d6, 0x3bfc, 0x0764, 0x3bf8, 0x08e2, 0x3bf2, 0x0a67, 0x3bea, 0x0c1b, 0x3bde, 0x0d41, 0x3bcd, 0x0e5f, 0x3bb8, 0x0f8c, 0x3b9c, 0x1057, 0x3b7a, 0x10e5, 0x3b51, 0x1155, 0x3b20, 0x11a5, 0x3ae8, 0x11da, 0x3aaa, 0x11ef, 0x3a66, 0x11e5, 0x3a1d, 0x11c1, 0x39d0, 0x1185, 0x3980, 0x113b, 0x392e, 0x10e5, 0x38dc, 0x1087, 0x388b, 0x1028, 0x383b, 0x0f94, 0x37d9, 0x0edb, 0x3741, 0x0e2c, 0x36af, 0x0d89, 0x3625, 0x0cf2, 0x35a1, 0x0c69,
74135
+ 0x3c00, 0x0107, 0x3c00, 0x0108, 0x3c00, 0x0110, 0x3c00, 0x0145, 0x3bff, 0x0197, 0x3bfe, 0x0224, 0x3bfc, 0x030c, 0x3bf8, 0x0478, 0x3bf3, 0x062c, 0x3beb, 0x0833, 0x3be0, 0x0979, 0x3bd0, 0x0aeb, 0x3bbc, 0x0c3d, 0x3ba0, 0x0d01, 0x3b80, 0x0dbd, 0x3b57, 0x0e69, 0x3b27, 0x0eeb, 0x3af0, 0x0f53, 0x3ab1, 0x0f8a, 0x3a6c, 0x0f9f, 0x3a22, 0x0f8b, 0x39d4, 0x0f5b, 0x3982, 0x0f0f, 0x392f, 0x0eac, 0x38da, 0x0e3d, 0x3886, 0x0dc9, 0x3834, 0x0d51, 0x37c7, 0x0cd9, 0x372c, 0x0c65, 0x3697, 0x0bef, 0x360a, 0x0b20, 0x3585, 0x0a62,
74136
+ 0x3c00, 0x0031, 0x3c00, 0x0031, 0x3c00, 0x0034, 0x3c00, 0x004b, 0x3bff, 0x006f, 0x3bfe, 0x00c9, 0x3bfc, 0x011b, 0x3bf9, 0x0207, 0x3bf4, 0x02d6, 0x3bec, 0x0415, 0x3be1, 0x0587, 0x3bd2, 0x0703, 0x3bbf, 0x087d, 0x3ba5, 0x096a, 0x3b85, 0x0a59, 0x3b5d, 0x0b32, 0x3b2e, 0x0bee, 0x3af7, 0x0c44, 0x3ab8, 0x0c7c, 0x3a73, 0x0c9c, 0x3a28, 0x0ca4, 0x39d8, 0x0c98, 0x3985, 0x0c77, 0x392f, 0x0c4a, 0x38d9, 0x0c10, 0x3882, 0x0ba0, 0x382e, 0x0b14, 0x37b6, 0x0a84, 0x3717, 0x09f5, 0x3680, 0x0969, 0x35f0, 0x08e6, 0x356a, 0x086a,
74137
+ 0x3c00, 0x0004, 0x3c00, 0x0004, 0x3c00, 0x0004, 0x3c00, 0x000d, 0x3bff, 0x0021, 0x3bfe, 0x003b, 0x3bfd, 0x0070, 0x3bf9, 0x00c7, 0x3bf4, 0x012e, 0x3bed, 0x01c8, 0x3be3, 0x0274, 0x3bd4, 0x033b, 0x3bc1, 0x043a, 0x3ba8, 0x0534, 0x3b89, 0x0641, 0x3b62, 0x073b, 0x3b34, 0x0815, 0x3afd, 0x087c, 0x3abf, 0x08d0, 0x3a7a, 0x090a, 0x3a2e, 0x092c, 0x39dd, 0x0936, 0x3988, 0x0928, 0x3930, 0x0907, 0x38d7, 0x08d7, 0x387f, 0x089b, 0x3828, 0x0855, 0x37a7, 0x080b, 0x3704, 0x077b, 0x366a, 0x06e1, 0x35d8, 0x0649, 0x3550, 0x05b8,
74138
+ 0x3c00, 0x0000, 0x3c00, 0x0000, 0x3c00, 0x0000, 0x3c00, 0x0003, 0x3bff, 0x0012, 0x3bfe, 0x001a, 0x3bfd, 0x0035, 0x3bfa, 0x0050, 0x3bf4, 0x0061, 0x3bed, 0x00a5, 0x3be4, 0x00ee, 0x3bd6, 0x0146, 0x3bc3, 0x01ab, 0x3bab, 0x0211, 0x3b8d, 0x028e, 0x3b67, 0x0303, 0x3b39, 0x0375, 0x3b04, 0x03e2, 0x3ac6, 0x0441, 0x3a80, 0x0492, 0x3a34, 0x04cd, 0x39e1, 0x04f2, 0x398b, 0x0504, 0x3931, 0x0502, 0x38d6, 0x04ec, 0x387c, 0x04c7, 0x3822, 0x0496, 0x3798, 0x045c, 0x36f2, 0x041a, 0x3655, 0x03d5, 0x35c1, 0x038e, 0x3537, 0x0347
74139
+ ] );
74140
+
74141
+ let lut = null;
74142
+
74143
+ function getDFGLUT() {
74144
+
74145
+ if ( lut === null ) {
74146
+
74147
+ lut = new DataTexture( DATA, 32, 32, RGFormat, HalfFloatType );
74148
+ lut.minFilter = LinearFilter;
74149
+ lut.magFilter = LinearFilter;
74150
+ lut.wrapS = ClampToEdgeWrapping;
74151
+ lut.wrapT = ClampToEdgeWrapping;
74152
+ lut.generateMipmaps = false;
74153
+ lut.needsUpdate = true;
74154
+
74155
+ }
74156
+
74157
+ return lut;
74158
+
74159
+ }
74160
+
73725
74161
  /**
73726
74162
  * This renderer uses WebGL 2 to display scenes.
73727
74163
  *
@@ -73777,6 +74213,21 @@ class WebGLRenderer {
73777
74213
 
73778
74214
  }
73779
74215
 
74216
+ const INTEGER_FORMATS = new Set( [
74217
+ RGBAIntegerFormat,
74218
+ RGIntegerFormat,
74219
+ RedIntegerFormat
74220
+ ] );
74221
+
74222
+ const UNSIGNED_TYPES = new Set( [
74223
+ UnsignedByteType,
74224
+ UnsignedIntType,
74225
+ UnsignedShortType,
74226
+ UnsignedInt248Type,
74227
+ UnsignedShort4444Type,
74228
+ UnsignedShort5551Type
74229
+ ] );
74230
+
73780
74231
  const uintClearColor = new Uint32Array( 4 );
73781
74232
  const intClearColor = new Int32Array( 4 );
73782
74233
 
@@ -73798,7 +74249,7 @@ class WebGLRenderer {
73798
74249
  * document.body.appendChild( renderer.domElement );
73799
74250
  * ```
73800
74251
  *
73801
- * @type {DOMElement}
74252
+ * @type {HTMLCanvasElement|OffscreenCanvas}
73802
74253
  */
73803
74254
  this.domElement = canvas;
73804
74255
 
@@ -74051,7 +74502,7 @@ class WebGLRenderer {
74051
74502
 
74052
74503
  } catch ( error ) {
74053
74504
 
74054
- console.error( 'THREE.WebGLRenderer: ' + error.message );
74505
+ error( 'WebGLRenderer: ' + error.message );
74055
74506
  throw error;
74056
74507
 
74057
74508
  }
@@ -74288,7 +74739,7 @@ class WebGLRenderer {
74288
74739
 
74289
74740
  if ( xr.isPresenting ) {
74290
74741
 
74291
- console.warn( 'THREE.WebGLRenderer: Can\'t change size while VR device is presenting.' );
74742
+ warn( 'WebGLRenderer: Can\'t change size while VR device is presenting.' );
74292
74743
  return;
74293
74744
 
74294
74745
  }
@@ -74550,9 +75001,7 @@ class WebGLRenderer {
74550
75001
  if ( _currentRenderTarget !== null ) {
74551
75002
 
74552
75003
  const targetFormat = _currentRenderTarget.texture.format;
74553
- isIntegerFormat = targetFormat === RGBAIntegerFormat ||
74554
- targetFormat === RGIntegerFormat ||
74555
- targetFormat === RedIntegerFormat;
75004
+ isIntegerFormat = INTEGER_FORMATS.has( targetFormat );
74556
75005
 
74557
75006
  }
74558
75007
 
@@ -74561,12 +75010,7 @@ class WebGLRenderer {
74561
75010
  if ( isIntegerFormat ) {
74562
75011
 
74563
75012
  const targetType = _currentRenderTarget.texture.type;
74564
- const isUnsignedType = targetType === UnsignedByteType ||
74565
- targetType === UnsignedIntType ||
74566
- targetType === UnsignedShortType ||
74567
- targetType === UnsignedInt248Type ||
74568
- targetType === UnsignedShort4444Type ||
74569
- targetType === UnsignedShort5551Type;
75013
+ const isUnsignedType = UNSIGNED_TYPES.has( targetType );
74570
75014
 
74571
75015
  const clearColor = background.getClearColor();
74572
75016
  const a = background.getClearAlpha();
@@ -74680,7 +75124,7 @@ class WebGLRenderer {
74680
75124
 
74681
75125
  event.preventDefault();
74682
75126
 
74683
- console.log( 'THREE.WebGLRenderer: Context Lost.' );
75127
+ log( 'WebGLRenderer: Context Lost.' );
74684
75128
 
74685
75129
  _isContextLost = true;
74686
75130
 
@@ -74688,7 +75132,7 @@ class WebGLRenderer {
74688
75132
 
74689
75133
  function onContextRestore( /* event */ ) {
74690
75134
 
74691
- console.log( 'THREE.WebGLRenderer: Context Restored.' );
75135
+ log( 'WebGLRenderer: Context Restored.' );
74692
75136
 
74693
75137
  _isContextLost = false;
74694
75138
 
@@ -74710,7 +75154,7 @@ class WebGLRenderer {
74710
75154
 
74711
75155
  function onContextCreationError( event ) {
74712
75156
 
74713
- console.error( 'THREE.WebGLRenderer: A WebGL context could not be created. Reason: ', event.statusMessage );
75157
+ error( 'WebGLRenderer: A WebGL context could not be created. Reason: ', event.statusMessage );
74714
75158
 
74715
75159
  }
74716
75160
 
@@ -74883,7 +75327,7 @@ class WebGLRenderer {
74883
75327
  if ( object._multiDrawInstances !== null ) {
74884
75328
 
74885
75329
  // @deprecated, r174
74886
- warnOnce( 'THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.' );
75330
+ warnOnce( 'WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection.' );
74887
75331
  renderer.renderMultiDrawInstances( object._multiDrawStarts, object._multiDrawCounts, object._multiDrawCount, object._multiDrawInstances );
74888
75332
 
74889
75333
  } else {
@@ -75159,6 +75603,13 @@ class WebGLRenderer {
75159
75603
 
75160
75604
  if ( typeof self !== 'undefined' ) animation.setContext( self );
75161
75605
 
75606
+ /**
75607
+ * Applications are advised to always define the animation loop
75608
+ * with this method and not manually with `requestAnimationFrame()`
75609
+ * for best compatibility.
75610
+ *
75611
+ * @param {?onAnimationCallback} callback - The application's animation loop.
75612
+ */
75162
75613
  this.setAnimationLoop = function ( callback ) {
75163
75614
 
75164
75615
  onAnimationFrameCallback = callback;
@@ -75191,7 +75642,7 @@ class WebGLRenderer {
75191
75642
 
75192
75643
  if ( camera !== undefined && camera.isCamera !== true ) {
75193
75644
 
75194
- console.error( 'THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.' );
75645
+ error( 'WebGLRenderer.render: camera is not an instance of THREE.Camera.' );
75195
75646
  return;
75196
75647
 
75197
75648
  }
@@ -75489,9 +75940,7 @@ class WebGLRenderer {
75489
75940
 
75490
75941
  function renderScene( currentRenderList, scene, camera, viewport ) {
75491
75942
 
75492
- const opaqueObjects = currentRenderList.opaque;
75493
- const transmissiveObjects = currentRenderList.transmissive;
75494
- const transparentObjects = currentRenderList.transparent;
75943
+ const { opaque: opaqueObjects, transmissive: transmissiveObjects, transparent: transparentObjects } = currentRenderList;
75495
75944
 
75496
75945
  currentRenderState.setupLightsView( camera );
75497
75946
 
@@ -75596,10 +76045,7 @@ class WebGLRenderer {
75596
76045
 
75597
76046
  const renderItem = transmissiveObjects[ i ];
75598
76047
 
75599
- const object = renderItem.object;
75600
- const geometry = renderItem.geometry;
75601
- const material = renderItem.material;
75602
- const group = renderItem.group;
76048
+ const { object, geometry, material, group } = renderItem;
75603
76049
 
75604
76050
  if ( material.side === DoubleSide && object.layers.test( camera.layers ) ) {
75605
76051
 
@@ -75646,9 +76092,7 @@ class WebGLRenderer {
75646
76092
 
75647
76093
  const renderItem = renderList[ i ];
75648
76094
 
75649
- const object = renderItem.object;
75650
- const geometry = renderItem.geometry;
75651
- const group = renderItem.group;
76095
+ const { object, geometry, group } = renderItem;
75652
76096
  let material = renderItem.material;
75653
76097
 
75654
76098
  if ( material.allowOverride === true && overrideMaterial !== null ) {
@@ -76187,6 +76631,13 @@ class WebGLRenderer {
76187
76631
 
76188
76632
  }
76189
76633
 
76634
+ // Set DFG LUT for physically-based materials
76635
+ if ( m_uniforms.dfgLUT !== undefined ) {
76636
+
76637
+ m_uniforms.dfgLUT.value = getDFGLUT();
76638
+
76639
+ }
76640
+
76190
76641
  if ( refreshMaterial ) {
76191
76642
 
76192
76643
  p_uniforms.setValue( _gl, 'toneMappingExposure', _this.toneMappingExposure );
@@ -76533,7 +76984,7 @@ class WebGLRenderer {
76533
76984
 
76534
76985
  if ( ! ( renderTarget && renderTarget.isWebGLRenderTarget ) ) {
76535
76986
 
76536
- console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' );
76987
+ error( 'WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.' );
76537
76988
  return;
76538
76989
 
76539
76990
  }
@@ -76558,14 +77009,14 @@ class WebGLRenderer {
76558
77009
 
76559
77010
  if ( ! capabilities.textureFormatReadable( textureFormat ) ) {
76560
77011
 
76561
- console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );
77012
+ error( 'WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.' );
76562
77013
  return;
76563
77014
 
76564
77015
  }
76565
77016
 
76566
77017
  if ( ! capabilities.textureTypeReadable( textureType ) ) {
76567
77018
 
76568
- console.error( 'THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );
77019
+ error( 'WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.' );
76569
77020
  return;
76570
77021
 
76571
77022
  }
@@ -77515,3 +77966,9 @@ exports.ZeroFactor = ZeroFactor;
77515
77966
  exports.ZeroSlopeEnding = ZeroSlopeEnding;
77516
77967
  exports.ZeroStencilOp = ZeroStencilOp;
77517
77968
  exports.createCanvasElement = createCanvasElement;
77969
+ exports.error = error;
77970
+ exports.getConsoleFunction = getConsoleFunction;
77971
+ exports.log = log;
77972
+ exports.setConsoleFunction = setConsoleFunction;
77973
+ exports.warn = warn;
77974
+ exports.warnOnce = warnOnce;