super-three 0.152.0 → 0.154.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 (339) hide show
  1. package/build/three.cjs +778 -557
  2. package/build/three.js +778 -557
  3. package/build/three.min.js +1 -1
  4. package/build/three.module.js +769 -539
  5. package/build/three.module.min.js +1 -1
  6. package/examples/jsm/cameras/CinematicCamera.js +1 -2
  7. package/examples/jsm/capabilities/WebGPU.js +15 -1
  8. package/examples/jsm/controls/ArcballControls.js +2 -1
  9. package/examples/jsm/controls/FlyControls.js +25 -9
  10. package/examples/jsm/controls/OrbitControls.js +5 -1
  11. package/examples/jsm/csm/CSM.js +1 -3
  12. package/examples/jsm/effects/AnaglyphEffect.js +6 -20
  13. package/examples/jsm/effects/OutlineEffect.js +1 -1
  14. package/examples/jsm/effects/ParallaxBarrierEffect.js +3 -0
  15. package/examples/jsm/environments/RoomEnvironment.js +6 -2
  16. package/examples/jsm/exporters/GLTFExporter.js +74 -2
  17. package/examples/jsm/exporters/USDZExporter.js +170 -129
  18. package/examples/jsm/helpers/ViewHelper.js +1 -1
  19. package/examples/jsm/lines/LineMaterial.js +1 -1
  20. package/examples/jsm/loaders/3DMLoader.js +1 -1
  21. package/examples/jsm/loaders/3MFLoader.js +5 -1
  22. package/examples/jsm/loaders/AMFLoader.js +5 -1
  23. package/examples/jsm/loaders/ColladaLoader.js +4 -1
  24. package/examples/jsm/loaders/DRACOLoader.js +2 -0
  25. package/examples/jsm/loaders/FBXLoader.js +9 -2
  26. package/examples/jsm/loaders/GLTFLoader.js +230 -94
  27. package/examples/jsm/loaders/KTX2Loader.js +106 -47
  28. package/examples/jsm/loaders/LDrawLoader.js +4 -7
  29. package/examples/jsm/loaders/MMDLoader.js +40 -13
  30. package/examples/jsm/loaders/PCDLoader.js +25 -10
  31. package/examples/jsm/loaders/PDBLoader.js +7 -2
  32. package/examples/jsm/loaders/PLYLoader.js +30 -8
  33. package/examples/jsm/loaders/STLLoader.js +8 -3
  34. package/examples/jsm/loaders/VRMLLoader.js +55 -7
  35. package/examples/jsm/loaders/VTKLoader.js +12 -4
  36. package/examples/jsm/loaders/XYZLoader.js +9 -3
  37. package/examples/jsm/materials/MeshGouraudMaterial.js +2 -2
  38. package/examples/jsm/math/Lut.js +5 -4
  39. package/examples/jsm/math/MeshSurfaceSampler.js +82 -37
  40. package/examples/jsm/misc/GPUComputationRenderer.js +1 -0
  41. package/examples/jsm/misc/VolumeSlice.js +3 -1
  42. package/examples/jsm/nodes/Nodes.js +22 -16
  43. package/examples/jsm/nodes/accessors/BufferAttributeNode.js +99 -0
  44. package/examples/jsm/nodes/accessors/BufferNode.js +2 -2
  45. package/examples/jsm/nodes/accessors/CameraNode.js +25 -4
  46. package/examples/jsm/nodes/accessors/ExtendedMaterialNode.js +7 -1
  47. package/examples/jsm/nodes/accessors/InstanceNode.js +29 -12
  48. package/examples/jsm/nodes/accessors/MaterialNode.js +55 -47
  49. package/examples/jsm/nodes/accessors/MaterialReferenceNode.js +2 -2
  50. package/examples/jsm/nodes/accessors/ModelNode.js +3 -1
  51. package/examples/jsm/nodes/accessors/ModelViewProjectionNode.js +4 -9
  52. package/examples/jsm/nodes/accessors/MorphNode.js +70 -0
  53. package/examples/jsm/nodes/accessors/NormalNode.js +3 -2
  54. package/examples/jsm/nodes/accessors/Object3DNode.js +10 -2
  55. package/examples/jsm/nodes/accessors/ReferenceNode.js +2 -2
  56. package/examples/jsm/nodes/accessors/SceneNode.js +46 -0
  57. package/examples/jsm/nodes/accessors/SkinningNode.js +43 -62
  58. package/examples/jsm/nodes/accessors/StorageBufferNode.js +2 -2
  59. package/examples/jsm/nodes/accessors/TangentNode.js +2 -2
  60. package/examples/jsm/nodes/accessors/TextureBicubicNode.js +94 -0
  61. package/examples/jsm/nodes/accessors/TextureNode.js +68 -6
  62. package/examples/jsm/nodes/accessors/TextureSizeNode.js +35 -0
  63. package/examples/jsm/nodes/accessors/UVNode.js +1 -1
  64. package/examples/jsm/nodes/code/CodeNode.js +3 -0
  65. package/examples/jsm/nodes/code/FunctionNode.js +25 -4
  66. package/examples/jsm/nodes/core/AttributeNode.js +1 -1
  67. package/examples/jsm/nodes/core/BypassNode.js +2 -2
  68. package/examples/jsm/nodes/core/ContextNode.js +2 -0
  69. package/examples/jsm/nodes/core/IndexNode.js +66 -0
  70. package/examples/jsm/nodes/core/LightingModel.js +2 -1
  71. package/examples/jsm/nodes/core/Node.js +13 -16
  72. package/examples/jsm/nodes/core/NodeAttribute.js +2 -1
  73. package/examples/jsm/nodes/core/NodeBuilder.js +86 -8
  74. package/examples/jsm/nodes/core/NodeUtils.js +10 -0
  75. package/examples/jsm/nodes/core/PropertyNode.js +6 -2
  76. package/examples/jsm/nodes/core/StackNode.js +8 -1
  77. package/examples/jsm/nodes/core/UniformNode.js +1 -1
  78. package/examples/jsm/nodes/core/VarNode.js +1 -3
  79. package/examples/jsm/nodes/display/BlendModeNode.js +9 -9
  80. package/examples/jsm/nodes/display/ColorAdjustmentNode.js +7 -7
  81. package/examples/jsm/nodes/display/ColorSpaceNode.js +50 -49
  82. package/examples/jsm/nodes/display/NormalMapNode.js +3 -3
  83. package/examples/jsm/nodes/display/ToneMappingNode.js +24 -15
  84. package/examples/jsm/nodes/display/ViewportDepthNode.js +69 -0
  85. package/examples/jsm/nodes/display/ViewportDepthTextureNode.js +34 -0
  86. package/examples/jsm/nodes/display/ViewportSharedTextureNode.js +7 -6
  87. package/examples/jsm/nodes/display/ViewportTextureNode.js +33 -19
  88. package/examples/jsm/nodes/functions/BSDF/BRDF_BlinnPhong.js +5 -5
  89. package/examples/jsm/nodes/functions/BSDF/BRDF_GGX.js +10 -8
  90. package/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.js +2 -2
  91. package/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.js +43 -0
  92. package/examples/jsm/nodes/functions/BSDF/DFGApprox.js +4 -4
  93. package/examples/jsm/nodes/functions/BSDF/D_GGX.js +2 -2
  94. package/examples/jsm/nodes/functions/BSDF/EnvironmentBRDF.js +13 -0
  95. package/examples/jsm/nodes/functions/BSDF/F_Schlick.js +2 -4
  96. package/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +2 -2
  97. package/examples/jsm/nodes/functions/PhongLightingModel.js +7 -7
  98. package/examples/jsm/nodes/functions/PhysicalLightingModel.js +132 -19
  99. package/examples/jsm/nodes/functions/material/getGeometryRoughness.js +2 -2
  100. package/examples/jsm/nodes/functions/material/getRoughness.js +3 -3
  101. package/examples/jsm/nodes/geometry/RangeNode.js +33 -51
  102. package/examples/jsm/nodes/lighting/AnalyticLightNode.js +6 -3
  103. package/examples/jsm/nodes/lighting/DirectionalLightNode.js +2 -2
  104. package/examples/jsm/nodes/lighting/EnvironmentNode.js +107 -62
  105. package/examples/jsm/nodes/lighting/HemisphereLightNode.js +2 -2
  106. package/examples/jsm/nodes/lighting/LightUtils.js +2 -2
  107. package/examples/jsm/nodes/lighting/LightingContextNode.js +17 -15
  108. package/examples/jsm/nodes/lighting/PointLightNode.js +3 -3
  109. package/examples/jsm/nodes/lighting/SpotLightNode.js +3 -3
  110. package/examples/jsm/nodes/materials/LineBasicNodeMaterial.js +0 -15
  111. package/examples/jsm/nodes/materials/MeshBasicNodeMaterial.js +0 -15
  112. package/examples/jsm/nodes/materials/MeshNormalNodeMaterial.js +0 -10
  113. package/examples/jsm/nodes/materials/MeshPhongNodeMaterial.js +0 -9
  114. package/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.js +41 -0
  115. package/examples/jsm/nodes/materials/MeshStandardNodeMaterial.js +1 -14
  116. package/examples/jsm/nodes/materials/NodeMaterial.js +119 -29
  117. package/examples/jsm/nodes/materials/PointsNodeMaterial.js +0 -9
  118. package/examples/jsm/nodes/materials/SpriteNodeMaterial.js +0 -7
  119. package/examples/jsm/nodes/materialx/lib/mx_hsv.js +3 -3
  120. package/examples/jsm/nodes/materialx/lib/mx_noise.js +14 -14
  121. package/examples/jsm/nodes/materialx/lib/mx_transform_color.js +4 -4
  122. package/examples/jsm/nodes/math/MathNode.js +6 -0
  123. package/examples/jsm/nodes/math/OperatorNode.js +1 -1
  124. package/examples/jsm/nodes/procedural/CheckerNode.js +3 -3
  125. package/examples/jsm/nodes/shadernode/ShaderNode.js +60 -33
  126. package/examples/jsm/nodes/utils/EquirectUVNode.js +2 -3
  127. package/examples/jsm/nodes/utils/LoopNode.js +186 -0
  128. package/examples/jsm/nodes/utils/TriplanarTexturesNode.js +1 -1
  129. package/examples/jsm/objects/GroundProjectedSkybox.js +1 -1
  130. package/examples/jsm/objects/Lensflare.js +3 -4
  131. package/examples/jsm/objects/MarchingCubes.js +5 -1
  132. package/examples/jsm/objects/Reflector.js +4 -1
  133. package/examples/jsm/objects/Refractor.js +1 -1
  134. package/examples/jsm/objects/Sky.js +1 -1
  135. package/examples/jsm/objects/Water.js +2 -1
  136. package/examples/jsm/objects/Water2.js +1 -1
  137. package/examples/jsm/offscreen/scene.js +1 -0
  138. package/examples/jsm/physics/RapierPhysics.js +93 -133
  139. package/examples/jsm/postprocessing/AfterimagePass.js +3 -0
  140. package/examples/jsm/postprocessing/BloomPass.js +7 -2
  141. package/examples/jsm/postprocessing/BokehPass.js +3 -2
  142. package/examples/jsm/postprocessing/DotScreenPass.js +1 -0
  143. package/examples/jsm/postprocessing/EffectComposer.js +4 -1
  144. package/examples/jsm/postprocessing/FilmPass.js +1 -0
  145. package/examples/jsm/postprocessing/OutlinePass.js +8 -9
  146. package/examples/jsm/postprocessing/OutputPass.js +72 -0
  147. package/examples/jsm/postprocessing/RenderPixelatedPass.js +4 -3
  148. package/examples/jsm/postprocessing/SAOPass.js +4 -2
  149. package/examples/jsm/postprocessing/SMAAPass.js +5 -2
  150. package/examples/jsm/postprocessing/SSAARenderPass.js +5 -13
  151. package/examples/jsm/postprocessing/SSAOPass.js +4 -2
  152. package/examples/jsm/postprocessing/SSRPass.js +3 -1
  153. package/examples/jsm/postprocessing/SavePass.js +5 -2
  154. package/examples/jsm/postprocessing/ShaderPass.js +1 -0
  155. package/examples/jsm/postprocessing/TAARenderPass.js +17 -4
  156. package/examples/jsm/postprocessing/TexturePass.js +2 -1
  157. package/examples/jsm/postprocessing/UnrealBloomPass.js +13 -13
  158. package/examples/jsm/renderers/{webgpu/WebGPUAnimation.js → common/Animation.js} +2 -2
  159. package/examples/jsm/renderers/common/Attributes.js +75 -0
  160. package/examples/jsm/renderers/common/Backend.js +162 -0
  161. package/examples/jsm/renderers/common/Background.js +134 -0
  162. package/examples/jsm/renderers/common/Binding.js +11 -0
  163. package/examples/jsm/renderers/common/Bindings.js +169 -0
  164. package/examples/jsm/renderers/common/Buffer.js +38 -0
  165. package/examples/jsm/renderers/{webgpu/WebGPUBufferUtils.js → common/BufferUtils.js} +2 -2
  166. package/examples/jsm/renderers/{webgpu/WebGPUWeakMap.js → common/ChainMap.js} +11 -5
  167. package/examples/jsm/renderers/common/ComputePipeline.js +17 -0
  168. package/examples/jsm/renderers/common/Constants.js +14 -0
  169. package/examples/jsm/renderers/common/CubeRenderTarget.js +65 -0
  170. package/examples/jsm/renderers/common/DataMap.js +54 -0
  171. package/examples/jsm/renderers/{webgpu/WebGPUGeometries.js → common/Geometries.js} +38 -37
  172. package/examples/jsm/renderers/{webgpu/WebGPUInfo.js → common/Info.js} +2 -3
  173. package/examples/jsm/renderers/common/Pipeline.js +13 -0
  174. package/examples/jsm/renderers/common/Pipelines.js +321 -0
  175. package/examples/jsm/renderers/common/ProgrammableStage.js +18 -0
  176. package/examples/jsm/renderers/common/RenderContext.js +37 -0
  177. package/examples/jsm/renderers/common/RenderContexts.js +38 -0
  178. package/examples/jsm/renderers/{webgpu/WebGPURenderLists.js → common/RenderList.js} +2 -39
  179. package/examples/jsm/renderers/common/RenderLists.js +38 -0
  180. package/examples/jsm/renderers/common/RenderObject.js +113 -0
  181. package/examples/jsm/renderers/common/RenderObjects.js +92 -0
  182. package/examples/jsm/renderers/common/RenderPipeline.js +16 -0
  183. package/examples/jsm/renderers/{webgpu/WebGPURenderTarget.js → common/RenderTarget.js} +2 -2
  184. package/examples/jsm/renderers/common/Renderer.js +864 -0
  185. package/examples/jsm/renderers/common/SampledTexture.js +80 -0
  186. package/examples/jsm/renderers/common/Sampler.js +18 -0
  187. package/examples/jsm/renderers/common/StorageBuffer.js +17 -0
  188. package/examples/jsm/renderers/common/Textures.js +206 -0
  189. package/examples/jsm/renderers/{webgpu/WebGPUUniform.js → common/Uniform.js} +13 -9
  190. package/examples/jsm/renderers/common/UniformBuffer.js +15 -0
  191. package/examples/jsm/renderers/{webgpu/WebGPUUniformsGroup.js → common/UniformsGroup.js} +13 -13
  192. package/examples/jsm/renderers/{webgpu/nodes/WebGPUNodes.js → common/nodes/NodeRender.js} +3 -3
  193. package/examples/jsm/renderers/{webgpu/nodes/WebGPUNodeSampledTexture.js → common/nodes/NodeSampledTexture.js} +4 -4
  194. package/examples/jsm/renderers/{webgpu/nodes/WebGPUNodeSampler.js → common/nodes/NodeSampler.js} +3 -3
  195. package/examples/jsm/renderers/{webgpu/nodes/WebGPUNodeUniform.js → common/nodes/NodeUniform.js} +1 -1
  196. package/examples/jsm/renderers/common/nodes/Nodes.js +319 -0
  197. package/examples/jsm/renderers/webgl/nodes/GLSLNodeBuilder.js +340 -0
  198. package/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.js +23 -19
  199. package/examples/jsm/renderers/webgpu/WebGPUBackend.js +847 -0
  200. package/examples/jsm/renderers/webgpu/WebGPURenderer.js +15 -1131
  201. package/examples/jsm/renderers/webgpu/nodes/{WebGPUNodeBuilder.js → WGSLNodeBuilder.js} +75 -45
  202. package/examples/jsm/{nodes/parsers → renderers/webgpu/nodes}/WGSLNodeFunction.js +2 -2
  203. package/examples/jsm/{nodes/parsers → renderers/webgpu/nodes}/WGSLNodeParser.js +1 -1
  204. package/examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js +255 -0
  205. package/examples/jsm/renderers/webgpu/utils/WebGPUBindingUtils.js +145 -0
  206. package/examples/jsm/renderers/webgpu/{constants.js → utils/WebGPUConstants.js} +6 -7
  207. package/examples/jsm/renderers/webgpu/{WebGPURenderPipeline.js → utils/WebGPUPipelineUtils.js} +154 -247
  208. package/examples/jsm/renderers/webgpu/{WebGPUTextureUtils.js → utils/WebGPUTextureMipmapUtils.js} +3 -25
  209. package/examples/jsm/renderers/webgpu/{WebGPUTextures.js → utils/WebGPUTextureUtils.js} +392 -505
  210. package/examples/jsm/renderers/webgpu/utils/WebGPUUtils.js +92 -0
  211. package/examples/jsm/shaders/BleachBypassShader.js +2 -0
  212. package/examples/jsm/shaders/BlendShader.js +1 -2
  213. package/examples/jsm/shaders/BokehShader2.js +3 -0
  214. package/examples/jsm/shaders/ColorifyShader.js +2 -0
  215. package/examples/jsm/shaders/ConvolutionShader.js +2 -0
  216. package/examples/jsm/shaders/CopyShader.js +4 -2
  217. package/examples/jsm/shaders/DotScreenShader.js +2 -0
  218. package/examples/jsm/shaders/ExposureShader.js +44 -0
  219. package/examples/jsm/shaders/FilmShader.js +2 -0
  220. package/examples/jsm/shaders/GammaCorrectionShader.js +2 -0
  221. package/examples/jsm/shaders/HorizontalBlurShader.js +2 -0
  222. package/examples/jsm/shaders/OutputShader.js +61 -0
  223. package/examples/jsm/shaders/RGBShiftShader.js +2 -0
  224. package/examples/jsm/shaders/SepiaShader.js +2 -0
  225. package/examples/jsm/shaders/ToonShader.js +13 -5
  226. package/examples/jsm/shaders/VerticalBlurShader.js +2 -0
  227. package/examples/jsm/shaders/VignetteShader.js +2 -0
  228. package/examples/jsm/shaders/WaterRefractionShader.js +5 -2
  229. package/examples/jsm/utils/BufferGeometryUtils.js +17 -1
  230. package/examples/jsm/utils/TextureUtils.js +86 -0
  231. package/examples/jsm/webxr/OculusHandPointerModel.js +34 -13
  232. package/examples/jsm/webxr/XRHandPrimitiveModel.js +1 -0
  233. package/examples/jsm/webxr/XRPlanes.js +100 -0
  234. package/package.json +3 -1
  235. package/src/Three.Legacy.js +0 -228
  236. package/src/audio/PositionalAudio.js +8 -0
  237. package/src/cameras/Camera.js +5 -0
  238. package/src/cameras/CubeCamera.js +76 -13
  239. package/src/cameras/OrthographicCamera.js +1 -1
  240. package/src/cameras/PerspectiveCamera.js +1 -1
  241. package/src/constants.js +13 -1
  242. package/src/core/BufferAttribute.js +3 -25
  243. package/src/core/BufferGeometry.js +1 -8
  244. package/src/core/Object3D.js +1 -1
  245. package/src/extras/core/Curve.js +1 -1
  246. package/src/loaders/CubeTextureLoader.js +2 -0
  247. package/src/loaders/Loader.js +2 -0
  248. package/src/loaders/MaterialLoader.js +5 -0
  249. package/src/loaders/ObjectLoader.js +1 -0
  250. package/src/materials/Material.js +13 -1
  251. package/src/materials/MeshPhysicalMaterial.js +32 -6
  252. package/src/math/Color.js +16 -11
  253. package/src/math/Frustum.js +16 -2
  254. package/src/math/MathUtils.js +16 -0
  255. package/src/math/Matrix3.js +26 -6
  256. package/src/math/Matrix4.js +74 -19
  257. package/src/objects/InstancedMesh.js +3 -0
  258. package/src/objects/Mesh.js +14 -10
  259. package/src/objects/Skeleton.js +1 -3
  260. package/src/objects/SkinnedMesh.js +36 -8
  261. package/src/renderers/WebGLRenderer.js +126 -21
  262. package/src/renderers/shaders/ShaderChunk/alphahash_fragment.glsl.js +7 -0
  263. package/src/renderers/shaders/ShaderChunk/alphahash_pars_fragment.glsl.js +68 -0
  264. package/src/renderers/shaders/ShaderChunk/begin_vertex.glsl.js +6 -0
  265. package/src/renderers/shaders/ShaderChunk/common.glsl.js +6 -0
  266. package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +26 -3
  267. package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +9 -1
  268. package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +26 -0
  269. package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +52 -2
  270. package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +10 -2
  271. package/src/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl.js +1 -1
  272. package/src/renderers/shaders/ShaderChunk/{output_fragment.glsl.js → opaque_fragment.glsl.js} +1 -2
  273. package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +1 -1
  274. package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +3 -3
  275. package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +10 -5
  276. package/src/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl.js +6 -1
  277. package/src/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl.js +7 -1
  278. package/src/renderers/shaders/ShaderChunk/uv_vertex.glsl.js +6 -1
  279. package/src/renderers/shaders/ShaderChunk.js +10 -6
  280. package/src/renderers/shaders/ShaderLib/background.glsl.js +1 -1
  281. package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +1 -1
  282. package/src/renderers/shaders/ShaderLib/cube.glsl.js +1 -1
  283. package/src/renderers/shaders/ShaderLib/depth.glsl.js +2 -0
  284. package/src/renderers/shaders/ShaderLib/distanceRGBA.glsl.js +2 -0
  285. package/src/renderers/shaders/ShaderLib/equirect.glsl.js +1 -1
  286. package/src/renderers/shaders/ShaderLib/linedashed.glsl.js +2 -2
  287. package/src/renderers/shaders/ShaderLib/meshbasic.glsl.js +4 -2
  288. package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +4 -2
  289. package/src/renderers/shaders/ShaderLib/meshmatcap.glsl.js +4 -2
  290. package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +4 -2
  291. package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +12 -2
  292. package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +4 -2
  293. package/src/renderers/shaders/ShaderLib/points.glsl.js +4 -2
  294. package/src/renderers/shaders/ShaderLib/shadow.glsl.js +1 -1
  295. package/src/renderers/shaders/ShaderLib/sprite.glsl.js +4 -2
  296. package/src/renderers/shaders/ShaderLib.js +4 -1
  297. package/src/renderers/shaders/UniformsLib.js +2 -0
  298. package/src/renderers/webgl/WebGLBindingStates.js +13 -5
  299. package/src/renderers/webgl/WebGLGeometries.js +12 -0
  300. package/src/renderers/webgl/WebGLInfo.js +0 -1
  301. package/src/renderers/webgl/WebGLMaterials.js +18 -0
  302. package/src/renderers/webgl/WebGLObjects.js +23 -3
  303. package/src/renderers/webgl/WebGLProgram.js +43 -5
  304. package/src/renderers/webgl/WebGLPrograms.js +19 -7
  305. package/src/renderers/webgl/WebGLTextures.js +19 -1
  306. package/src/renderers/webvr/WebVRManager.js +12 -0
  307. package/src/renderers/webxr/WebXRManager.js +39 -99
  308. package/src/scenes/Scene.js +0 -14
  309. package/src/textures/DepthTexture.js +22 -0
  310. package/src/textures/FramebufferTexture.js +1 -3
  311. package/src/textures/Source.js +4 -0
  312. package/src/textures/Texture.js +1 -1
  313. package/examples/jsm/exporters/ColladaExporter.js +0 -725
  314. package/examples/jsm/geometries/LightningStrike.js +0 -1017
  315. package/examples/jsm/loaders/PRWMLoader.js +0 -299
  316. package/examples/jsm/nodes/core/InstanceIndexNode.js +0 -26
  317. package/examples/jsm/objects/LightningStorm.js +0 -245
  318. package/examples/jsm/postprocessing/AdaptiveToneMappingPass.js +0 -361
  319. package/examples/jsm/renderers/webgpu/WebGPUAttributes.js +0 -197
  320. package/examples/jsm/renderers/webgpu/WebGPUBackground.js +0 -190
  321. package/examples/jsm/renderers/webgpu/WebGPUBinding.js +0 -22
  322. package/examples/jsm/renderers/webgpu/WebGPUBindings.js +0 -270
  323. package/examples/jsm/renderers/webgpu/WebGPUBuffer.js +0 -43
  324. package/examples/jsm/renderers/webgpu/WebGPUComputePipelines.js +0 -78
  325. package/examples/jsm/renderers/webgpu/WebGPUProgrammableStage.js +0 -22
  326. package/examples/jsm/renderers/webgpu/WebGPUProperties.js +0 -44
  327. package/examples/jsm/renderers/webgpu/WebGPURenderObject.js +0 -40
  328. package/examples/jsm/renderers/webgpu/WebGPURenderObjects.js +0 -50
  329. package/examples/jsm/renderers/webgpu/WebGPURenderPipelines.js +0 -274
  330. package/examples/jsm/renderers/webgpu/WebGPURenderStates.js +0 -54
  331. package/examples/jsm/renderers/webgpu/WebGPUSampledTexture.js +0 -75
  332. package/examples/jsm/renderers/webgpu/WebGPUSampler.js +0 -29
  333. package/examples/jsm/renderers/webgpu/WebGPUStorageBuffer.js +0 -20
  334. package/examples/jsm/renderers/webgpu/WebGPUTextureRenderer.js +0 -38
  335. package/examples/jsm/renderers/webgpu/WebGPUUniformBuffer.js +0 -18
  336. package/examples/jsm/renderers/webgpu/WebGPUUtils.js +0 -88
  337. package/examples/jsm/shaders/ToneMapShader.js +0 -73
  338. /package/src/renderers/shaders/ShaderChunk/{encodings_fragment.glsl.js → colorspace_fragment.glsl.js} +0 -0
  339. /package/src/renderers/shaders/ShaderChunk/{encodings_pars_fragment.glsl.js → colorspace_pars_fragment.glsl.js} +0 -0
package/build/three.cjs CHANGED
@@ -5,7 +5,7 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const REVISION = '152';
8
+ const REVISION = '154';
9
9
 
10
10
  const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
11
11
  const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
@@ -180,6 +180,15 @@ const NotEqualStencilFunc = 517;
180
180
  const GreaterEqualStencilFunc = 518;
181
181
  const AlwaysStencilFunc = 519;
182
182
 
183
+ const NeverCompare = 512;
184
+ const LessCompare = 513;
185
+ const EqualCompare = 514;
186
+ const LessEqualCompare = 515;
187
+ const GreaterCompare = 516;
188
+ const NotEqualCompare = 517;
189
+ const GreaterEqualCompare = 518;
190
+ const AlwaysCompare = 519;
191
+
183
192
  const StaticDrawUsage = 35044;
184
193
  const DynamicDrawUsage = 35048;
185
194
  const StreamDrawUsage = 35040;
@@ -195,6 +204,9 @@ const GLSL3 = '300 es';
195
204
 
196
205
  const _SRGBAFormat = 1035; // fallback for WebGL 1
197
206
 
207
+ const WebGLCoordinateSystem = 2000;
208
+ const WebGPUCoordinateSystem = 2001;
209
+
198
210
  /**
199
211
  * https://github.com/mrdoob/eventdispatcher.js/
200
212
  */
@@ -517,6 +529,10 @@ function denormalize( value, array ) {
517
529
 
518
530
  return value;
519
531
 
532
+ case Uint32Array:
533
+
534
+ return value / 4294967295.0;
535
+
520
536
  case Uint16Array:
521
537
 
522
538
  return value / 65535.0;
@@ -525,6 +541,10 @@ function denormalize( value, array ) {
525
541
 
526
542
  return value / 255.0;
527
543
 
544
+ case Int32Array:
545
+
546
+ return Math.max( value / 2147483647.0, - 1.0 );
547
+
528
548
  case Int16Array:
529
549
 
530
550
  return Math.max( value / 32767.0, - 1.0 );
@@ -549,6 +569,10 @@ function normalize( value, array ) {
549
569
 
550
570
  return value;
551
571
 
572
+ case Uint32Array:
573
+
574
+ return Math.round( value * 4294967295.0 );
575
+
552
576
  case Uint16Array:
553
577
 
554
578
  return Math.round( value * 65535.0 );
@@ -557,6 +581,10 @@ function normalize( value, array ) {
557
581
 
558
582
  return Math.round( value * 255.0 );
559
583
 
584
+ case Int32Array:
585
+
586
+ return Math.round( value * 2147483647.0 );
587
+
560
588
  case Int16Array:
561
589
 
562
590
  return Math.round( value * 32767.0 );
@@ -1079,7 +1107,7 @@ class Vector2 {
1079
1107
 
1080
1108
  class Matrix3 {
1081
1109
 
1082
- constructor() {
1110
+ constructor( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {
1083
1111
 
1084
1112
  Matrix3.prototype.isMatrix3 = true;
1085
1113
 
@@ -1091,6 +1119,12 @@ class Matrix3 {
1091
1119
 
1092
1120
  ];
1093
1121
 
1122
+ if ( n11 !== undefined ) {
1123
+
1124
+ this.set( n11, n12, n13, n21, n22, n23, n31, n32, n33 );
1125
+
1126
+ }
1127
+
1094
1128
  }
1095
1129
 
1096
1130
  set( n11, n12, n13, n21, n22, n23, n31, n32, n33 ) {
@@ -1340,13 +1374,27 @@ class Matrix3 {
1340
1374
 
1341
1375
  makeTranslation( x, y ) {
1342
1376
 
1343
- this.set(
1377
+ if ( x.isVector2 ) {
1344
1378
 
1345
- 1, 0, x,
1346
- 0, 1, y,
1347
- 0, 0, 1
1379
+ this.set(
1348
1380
 
1349
- );
1381
+ 1, 0, x.x,
1382
+ 0, 1, x.y,
1383
+ 0, 0, 1
1384
+
1385
+ );
1386
+
1387
+ } else {
1388
+
1389
+ this.set(
1390
+
1391
+ 1, 0, x,
1392
+ 0, 1, y,
1393
+ 0, 0, 1
1394
+
1395
+ );
1396
+
1397
+ }
1350
1398
 
1351
1399
  return this;
1352
1400
 
@@ -1750,12 +1798,16 @@ class ImageUtils {
1750
1798
 
1751
1799
  }
1752
1800
 
1801
+ let sourceId = 0;
1802
+
1753
1803
  class Source {
1754
1804
 
1755
1805
  constructor( data = null ) {
1756
1806
 
1757
1807
  this.isSource = true;
1758
1808
 
1809
+ Object.defineProperty( this, 'id', { value: sourceId ++ } );
1810
+
1759
1811
  this.uuid = generateUUID();
1760
1812
 
1761
1813
  this.data = data;
@@ -2019,7 +2071,7 @@ class Texture extends EventDispatcher {
2019
2071
  const output = {
2020
2072
 
2021
2073
  metadata: {
2022
- version: 4.5,
2074
+ version: 4.6,
2023
2075
  type: 'Texture',
2024
2076
  generator: 'Texture.toJSON'
2025
2077
  },
@@ -5760,7 +5812,7 @@ class Ray {
5760
5812
 
5761
5813
  class Matrix4 {
5762
5814
 
5763
- constructor() {
5815
+ constructor( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {
5764
5816
 
5765
5817
  Matrix4.prototype.isMatrix4 = true;
5766
5818
 
@@ -5773,6 +5825,12 @@ class Matrix4 {
5773
5825
 
5774
5826
  ];
5775
5827
 
5828
+ if ( n11 !== undefined ) {
5829
+
5830
+ this.set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 );
5831
+
5832
+ }
5833
+
5776
5834
  }
5777
5835
 
5778
5836
  set( n11, n12, n13, n14, n21, n22, n23, n24, n31, n32, n33, n34, n41, n42, n43, n44 ) {
@@ -6312,14 +6370,29 @@ class Matrix4 {
6312
6370
 
6313
6371
  makeTranslation( x, y, z ) {
6314
6372
 
6315
- this.set(
6373
+ if ( x.isVector3 ) {
6316
6374
 
6317
- 1, 0, 0, x,
6318
- 0, 1, 0, y,
6319
- 0, 0, 1, z,
6320
- 0, 0, 0, 1
6375
+ this.set(
6321
6376
 
6322
- );
6377
+ 1, 0, 0, x.x,
6378
+ 0, 1, 0, x.y,
6379
+ 0, 0, 1, x.z,
6380
+ 0, 0, 0, 1
6381
+
6382
+ );
6383
+
6384
+ } else {
6385
+
6386
+ this.set(
6387
+
6388
+ 1, 0, 0, x,
6389
+ 0, 1, 0, y,
6390
+ 0, 0, 1, z,
6391
+ 0, 0, 0, 1
6392
+
6393
+ );
6394
+
6395
+ }
6323
6396
 
6324
6397
  return this;
6325
6398
 
@@ -6510,7 +6583,7 @@ class Matrix4 {
6510
6583
 
6511
6584
  }
6512
6585
 
6513
- makePerspective( left, right, top, bottom, near, far ) {
6586
+ makePerspective( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {
6514
6587
 
6515
6588
  const te = this.elements;
6516
6589
  const x = 2 * near / ( right - left );
@@ -6518,19 +6591,35 @@ class Matrix4 {
6518
6591
 
6519
6592
  const a = ( right + left ) / ( right - left );
6520
6593
  const b = ( top + bottom ) / ( top - bottom );
6521
- const c = - ( far + near ) / ( far - near );
6522
- const d = - 2 * far * near / ( far - near );
6523
6594
 
6524
- te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0;
6525
- te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0;
6526
- te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d;
6595
+ let c, d;
6596
+
6597
+ if ( coordinateSystem === WebGLCoordinateSystem ) {
6598
+
6599
+ c = - ( far + near ) / ( far - near );
6600
+ d = ( - 2 * far * near ) / ( far - near );
6601
+
6602
+ } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
6603
+
6604
+ c = - far / ( far - near );
6605
+ d = ( - far * near ) / ( far - near );
6606
+
6607
+ } else {
6608
+
6609
+ throw new Error( 'THREE.Matrix4.makePerspective(): Invalid coordinate system: ' + coordinateSystem );
6610
+
6611
+ }
6612
+
6613
+ te[ 0 ] = x; te[ 4 ] = 0; te[ 8 ] = a; te[ 12 ] = 0;
6614
+ te[ 1 ] = 0; te[ 5 ] = y; te[ 9 ] = b; te[ 13 ] = 0;
6615
+ te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = c; te[ 14 ] = d;
6527
6616
  te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = - 1; te[ 15 ] = 0;
6528
6617
 
6529
6618
  return this;
6530
6619
 
6531
6620
  }
6532
6621
 
6533
- makeOrthographic( left, right, top, bottom, near, far ) {
6622
+ makeOrthographic( left, right, top, bottom, near, far, coordinateSystem = WebGLCoordinateSystem ) {
6534
6623
 
6535
6624
  const te = this.elements;
6536
6625
  const w = 1.0 / ( right - left );
@@ -6539,12 +6628,29 @@ class Matrix4 {
6539
6628
 
6540
6629
  const x = ( right + left ) * w;
6541
6630
  const y = ( top + bottom ) * h;
6542
- const z = ( far + near ) * p;
6543
6631
 
6544
- te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x;
6545
- te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y;
6546
- te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = - 2 * p; te[ 14 ] = - z;
6547
- te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1;
6632
+ let z, zInv;
6633
+
6634
+ if ( coordinateSystem === WebGLCoordinateSystem ) {
6635
+
6636
+ z = ( far + near ) * p;
6637
+ zInv = - 2 * p;
6638
+
6639
+ } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
6640
+
6641
+ z = near * p;
6642
+ zInv = - 1 * p;
6643
+
6644
+ } else {
6645
+
6646
+ throw new Error( 'THREE.Matrix4.makeOrthographic(): Invalid coordinate system: ' + coordinateSystem );
6647
+
6648
+ }
6649
+
6650
+ te[ 0 ] = 2 * w; te[ 4 ] = 0; te[ 8 ] = 0; te[ 12 ] = - x;
6651
+ te[ 1 ] = 0; te[ 5 ] = 2 * h; te[ 9 ] = 0; te[ 13 ] = - y;
6652
+ te[ 2 ] = 0; te[ 6 ] = 0; te[ 10 ] = zInv; te[ 14 ] = - z;
6653
+ te[ 3 ] = 0; te[ 7 ] = 0; te[ 11 ] = 0; te[ 15 ] = 1;
6548
6654
 
6549
6655
  return this;
6550
6656
 
@@ -7669,7 +7775,7 @@ class Object3D extends EventDispatcher {
7669
7775
  };
7670
7776
 
7671
7777
  output.metadata = {
7672
- version: 4.5,
7778
+ version: 4.6,
7673
7779
  type: 'Object',
7674
7780
  generator: 'Object3D.toJSON'
7675
7781
  };
@@ -8295,6 +8401,7 @@ class Material extends EventDispatcher {
8295
8401
 
8296
8402
  this.opacity = 1;
8297
8403
  this.transparent = false;
8404
+ this.alphaHash = false;
8298
8405
 
8299
8406
  this.blendSrc = SrcAlphaFactor;
8300
8407
  this.blendDst = OneMinusSrcAlphaFactor;
@@ -8435,7 +8542,7 @@ class Material extends EventDispatcher {
8435
8542
 
8436
8543
  const data = {
8437
8544
  metadata: {
8438
- version: 4.5,
8545
+ version: 4.6,
8439
8546
  type: 'Material',
8440
8547
  generator: 'Material.toJSON'
8441
8548
  }
@@ -8500,6 +8607,15 @@ class Material extends EventDispatcher {
8500
8607
 
8501
8608
  }
8502
8609
 
8610
+ if ( this.anisotropy !== undefined ) data.anisotropy = this.anisotropy;
8611
+ if ( this.anisotropyRotation !== undefined ) data.anisotropyRotation = this.anisotropyRotation;
8612
+
8613
+ if ( this.anisotropyMap && this.anisotropyMap.isTexture ) {
8614
+
8615
+ data.anisotropyMap = this.anisotropyMap.toJSON( meta ).uuid;
8616
+
8617
+ }
8618
+
8503
8619
  if ( this.map && this.map.isTexture ) data.map = this.map.toJSON( meta ).uuid;
8504
8620
  if ( this.matcap && this.matcap.isTexture ) data.matcap = this.matcap.toJSON( meta ).uuid;
8505
8621
  if ( this.alphaMap && this.alphaMap.isTexture ) data.alphaMap = this.alphaMap.toJSON( meta ).uuid;
@@ -8614,6 +8730,7 @@ class Material extends EventDispatcher {
8614
8730
  if ( this.dithering === true ) data.dithering = true;
8615
8731
 
8616
8732
  if ( this.alphaTest > 0 ) data.alphaTest = this.alphaTest;
8733
+ if ( this.alphaHash === true ) data.alphaHash = this.alphaHash;
8617
8734
  if ( this.alphaToCoverage === true ) data.alphaToCoverage = this.alphaToCoverage;
8618
8735
  if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha;
8619
8736
  if ( this.forceSinglePass === true ) data.forceSinglePass = this.forceSinglePass;
@@ -8735,6 +8852,7 @@ class Material extends EventDispatcher {
8735
8852
  this.dithering = source.dithering;
8736
8853
 
8737
8854
  this.alphaTest = source.alphaTest;
8855
+ this.alphaHash = source.alphaHash;
8738
8856
  this.alphaToCoverage = source.alphaToCoverage;
8739
8857
  this.premultipliedAlpha = source.premultipliedAlpha;
8740
8858
  this.forceSinglePass = source.forceSinglePass;
@@ -8812,30 +8930,35 @@ class Color {
8812
8930
  this.g = 1;
8813
8931
  this.b = 1;
8814
8932
 
8933
+ return this.set( r, g, b );
8934
+
8935
+ }
8936
+
8937
+ set( r, g, b ) {
8938
+
8815
8939
  if ( g === undefined && b === undefined ) {
8816
8940
 
8817
8941
  // r is THREE.Color, hex or string
8818
- return this.set( r );
8819
8942
 
8820
- }
8943
+ const value = r;
8821
8944
 
8822
- return this.setRGB( r, g, b );
8945
+ if ( value && value.isColor ) {
8823
8946
 
8824
- }
8947
+ this.copy( value );
8825
8948
 
8826
- set( value ) {
8949
+ } else if ( typeof value === 'number' ) {
8827
8950
 
8828
- if ( value && value.isColor ) {
8951
+ this.setHex( value );
8829
8952
 
8830
- this.copy( value );
8953
+ } else if ( typeof value === 'string' ) {
8831
8954
 
8832
- } else if ( typeof value === 'number' ) {
8955
+ this.setStyle( value );
8833
8956
 
8834
- this.setHex( value );
8957
+ }
8835
8958
 
8836
- } else if ( typeof value === 'string' ) {
8959
+ } else {
8837
8960
 
8838
- this.setStyle( value );
8961
+ this.setRGB( r, g, b );
8839
8962
 
8840
8963
  }
8841
8964
 
@@ -9649,6 +9772,7 @@ class BufferAttribute {
9649
9772
 
9650
9773
  this.usage = StaticDrawUsage;
9651
9774
  this.updateRange = { offset: 0, count: - 1 };
9775
+ this.gpuType = FloatType;
9652
9776
 
9653
9777
  this.version = 0;
9654
9778
 
@@ -9679,6 +9803,7 @@ class BufferAttribute {
9679
9803
  this.normalized = source.normalized;
9680
9804
 
9681
9805
  this.usage = source.usage;
9806
+ this.gpuType = source.gpuType;
9682
9807
 
9683
9808
  return this;
9684
9809
 
@@ -9965,30 +10090,6 @@ class BufferAttribute {
9965
10090
 
9966
10091
  }
9967
10092
 
9968
- copyColorsArray() { // @deprecated, r144
9969
-
9970
- console.error( 'THREE.BufferAttribute: copyColorsArray() was removed in r144.' );
9971
-
9972
- }
9973
-
9974
- copyVector2sArray() { // @deprecated, r144
9975
-
9976
- console.error( 'THREE.BufferAttribute: copyVector2sArray() was removed in r144.' );
9977
-
9978
- }
9979
-
9980
- copyVector3sArray() { // @deprecated, r144
9981
-
9982
- console.error( 'THREE.BufferAttribute: copyVector3sArray() was removed in r144.' );
9983
-
9984
- }
9985
-
9986
- copyVector4sArray() { // @deprecated, r144
9987
-
9988
- console.error( 'THREE.BufferAttribute: copyVector4sArray() was removed in r144.' );
9989
-
9990
- }
9991
-
9992
10093
  }
9993
10094
 
9994
10095
  //
@@ -10952,13 +11053,6 @@ class BufferGeometry extends EventDispatcher {
10952
11053
 
10953
11054
  }
10954
11055
 
10955
- merge() { // @deprecated, r144
10956
-
10957
- console.error( 'THREE.BufferGeometry.merge() has been removed. Use THREE.BufferGeometryUtils.mergeGeometries() instead.' );
10958
- return this;
10959
-
10960
- }
10961
-
10962
11056
  normalizeNormals() {
10963
11057
 
10964
11058
  const normals = this.attributes.normal;
@@ -11081,7 +11175,7 @@ class BufferGeometry extends EventDispatcher {
11081
11175
 
11082
11176
  const data = {
11083
11177
  metadata: {
11084
- version: 4.5,
11178
+ version: 4.6,
11085
11179
  type: 'BufferGeometry',
11086
11180
  generator: 'BufferGeometry.toJSON'
11087
11181
  }
@@ -11309,9 +11403,9 @@ class BufferGeometry extends EventDispatcher {
11309
11403
 
11310
11404
  }
11311
11405
 
11312
- const _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();
11313
- const _ray$2 = /*@__PURE__*/ new Ray();
11314
- const _sphere$4 = /*@__PURE__*/ new Sphere();
11406
+ const _inverseMatrix$3 = /*@__PURE__*/ new Matrix4();
11407
+ const _ray$3 = /*@__PURE__*/ new Ray();
11408
+ const _sphere$5 = /*@__PURE__*/ new Sphere();
11315
11409
  const _sphereHitAt = /*@__PURE__*/ new Vector3();
11316
11410
 
11317
11411
  const _vA$1 = /*@__PURE__*/ new Vector3();
@@ -11455,41 +11549,45 @@ class Mesh extends Object3D {
11455
11549
 
11456
11550
  if ( material === undefined ) return;
11457
11551
 
11458
- // Checking boundingSphere distance to ray
11552
+ // test with bounding sphere in world space
11459
11553
 
11460
11554
  if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
11461
11555
 
11462
- _sphere$4.copy( geometry.boundingSphere );
11463
- _sphere$4.applyMatrix4( matrixWorld );
11556
+ _sphere$5.copy( geometry.boundingSphere );
11557
+ _sphere$5.applyMatrix4( matrixWorld );
11558
+
11559
+ // check distance from ray origin to bounding sphere
11464
11560
 
11465
- _ray$2.copy( raycaster.ray ).recast( raycaster.near );
11561
+ _ray$3.copy( raycaster.ray ).recast( raycaster.near );
11466
11562
 
11467
- if ( _sphere$4.containsPoint( _ray$2.origin ) === false ) {
11563
+ if ( _sphere$5.containsPoint( _ray$3.origin ) === false ) {
11468
11564
 
11469
- if ( _ray$2.intersectSphere( _sphere$4, _sphereHitAt ) === null ) return;
11565
+ if ( _ray$3.intersectSphere( _sphere$5, _sphereHitAt ) === null ) return;
11470
11566
 
11471
- if ( _ray$2.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;
11567
+ if ( _ray$3.origin.distanceToSquared( _sphereHitAt ) > ( raycaster.far - raycaster.near ) ** 2 ) return;
11472
11568
 
11473
11569
  }
11474
11570
 
11475
- //
11571
+ // convert ray to local space of mesh
11476
11572
 
11477
- _inverseMatrix$2.copy( matrixWorld ).invert();
11478
- _ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );
11573
+ _inverseMatrix$3.copy( matrixWorld ).invert();
11574
+ _ray$3.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$3 );
11479
11575
 
11480
- // Check boundingBox before continuing
11576
+ // test with bounding box in local space
11481
11577
 
11482
11578
  if ( geometry.boundingBox !== null ) {
11483
11579
 
11484
- if ( _ray$2.intersectsBox( geometry.boundingBox ) === false ) return;
11580
+ if ( _ray$3.intersectsBox( geometry.boundingBox ) === false ) return;
11485
11581
 
11486
11582
  }
11487
11583
 
11488
- this._computeIntersections( raycaster, intersects );
11584
+ // test for intersections with geometry
11585
+
11586
+ this._computeIntersections( raycaster, intersects, _ray$3 );
11489
11587
 
11490
11588
  }
11491
11589
 
11492
- _computeIntersections( raycaster, intersects ) {
11590
+ _computeIntersections( raycaster, intersects, rayLocalSpace ) {
11493
11591
 
11494
11592
  let intersection;
11495
11593
 
@@ -11524,7 +11622,7 @@ class Mesh extends Object3D {
11524
11622
  const b = index.getX( j + 1 );
11525
11623
  const c = index.getX( j + 2 );
11526
11624
 
11527
- intersection = checkGeometryIntersection( this, groupMaterial, raycaster, _ray$2, uv, uv1, normal, a, b, c );
11625
+ intersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
11528
11626
 
11529
11627
  if ( intersection ) {
11530
11628
 
@@ -11549,7 +11647,7 @@ class Mesh extends Object3D {
11549
11647
  const b = index.getX( i + 1 );
11550
11648
  const c = index.getX( i + 2 );
11551
11649
 
11552
- intersection = checkGeometryIntersection( this, material, raycaster, _ray$2, uv, uv1, normal, a, b, c );
11650
+ intersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
11553
11651
 
11554
11652
  if ( intersection ) {
11555
11653
 
@@ -11582,7 +11680,7 @@ class Mesh extends Object3D {
11582
11680
  const b = j + 1;
11583
11681
  const c = j + 2;
11584
11682
 
11585
- intersection = checkGeometryIntersection( this, groupMaterial, raycaster, _ray$2, uv, uv1, normal, a, b, c );
11683
+ intersection = checkGeometryIntersection( this, groupMaterial, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
11586
11684
 
11587
11685
  if ( intersection ) {
11588
11686
 
@@ -11607,7 +11705,7 @@ class Mesh extends Object3D {
11607
11705
  const b = i + 1;
11608
11706
  const c = i + 2;
11609
11707
 
11610
- intersection = checkGeometryIntersection( this, material, raycaster, _ray$2, uv, uv1, normal, a, b, c );
11708
+ intersection = checkGeometryIntersection( this, material, raycaster, rayLocalSpace, uv, uv1, normal, a, b, c );
11611
11709
 
11612
11710
  if ( intersection ) {
11613
11711
 
@@ -11684,7 +11782,7 @@ function checkGeometryIntersection( object, material, raycaster, ray, uv, uv1, n
11684
11782
  _uvC$1.fromBufferAttribute( uv1, c );
11685
11783
 
11686
11784
  intersection.uv1 = Triangle.getInterpolation( _intersectionPoint, _vA$1, _vB$1, _vC$1, _uvA$1, _uvB$1, _uvC$1, new Vector2() );
11687
- intersection.uv2 = intersection.uv1; // Backwards compatibility
11785
+ intersection.uv2 = intersection.uv1; // @deprecated, r152
11688
11786
 
11689
11787
  }
11690
11788
 
@@ -12197,6 +12295,8 @@ class Camera extends Object3D {
12197
12295
  this.projectionMatrix = new Matrix4();
12198
12296
  this.projectionMatrixInverse = new Matrix4();
12199
12297
 
12298
+ this.coordinateSystem = WebGLCoordinateSystem;
12299
+
12200
12300
  }
12201
12301
 
12202
12302
  copy( source, recursive ) {
@@ -12208,6 +12308,8 @@ class Camera extends Object3D {
12208
12308
  this.projectionMatrix.copy( source.projectionMatrix );
12209
12309
  this.projectionMatrixInverse.copy( source.projectionMatrixInverse );
12210
12310
 
12311
+ this.coordinateSystem = source.coordinateSystem;
12312
+
12211
12313
  return this;
12212
12314
 
12213
12315
  }
@@ -12445,7 +12547,7 @@ class PerspectiveCamera extends Camera {
12445
12547
  const skew = this.filmOffset;
12446
12548
  if ( skew !== 0 ) left += near * skew / this.getFilmWidth();
12447
12549
 
12448
- this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far );
12550
+ this.projectionMatrix.makePerspective( left, left + width, top, top - height, near, this.far, this.coordinateSystem );
12449
12551
 
12450
12552
  this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
12451
12553
 
@@ -12487,51 +12589,114 @@ class CubeCamera extends Object3D {
12487
12589
  this.type = 'CubeCamera';
12488
12590
 
12489
12591
  this.renderTarget = renderTarget;
12592
+ this.coordinateSystem = null;
12490
12593
 
12491
12594
  const cameraPX = new PerspectiveCamera( fov, aspect, near, far );
12492
12595
  cameraPX.layers = this.layers;
12493
- cameraPX.up.set( 0, 1, 0 );
12494
- cameraPX.lookAt( 1, 0, 0 );
12495
12596
  this.add( cameraPX );
12496
12597
 
12497
12598
  const cameraNX = new PerspectiveCamera( fov, aspect, near, far );
12498
12599
  cameraNX.layers = this.layers;
12499
- cameraNX.up.set( 0, 1, 0 );
12500
- cameraNX.lookAt( - 1, 0, 0 );
12501
12600
  this.add( cameraNX );
12502
12601
 
12503
12602
  const cameraPY = new PerspectiveCamera( fov, aspect, near, far );
12504
12603
  cameraPY.layers = this.layers;
12505
- cameraPY.up.set( 0, 0, - 1 );
12506
- cameraPY.lookAt( 0, 1, 0 );
12507
12604
  this.add( cameraPY );
12508
12605
 
12509
12606
  const cameraNY = new PerspectiveCamera( fov, aspect, near, far );
12510
12607
  cameraNY.layers = this.layers;
12511
- cameraNY.up.set( 0, 0, 1 );
12512
- cameraNY.lookAt( 0, - 1, 0 );
12513
12608
  this.add( cameraNY );
12514
12609
 
12515
12610
  const cameraPZ = new PerspectiveCamera( fov, aspect, near, far );
12516
12611
  cameraPZ.layers = this.layers;
12517
- cameraPZ.up.set( 0, 1, 0 );
12518
- cameraPZ.lookAt( 0, 0, 1 );
12519
12612
  this.add( cameraPZ );
12520
12613
 
12521
12614
  const cameraNZ = new PerspectiveCamera( fov, aspect, near, far );
12522
12615
  cameraNZ.layers = this.layers;
12523
- cameraNZ.up.set( 0, 1, 0 );
12524
- cameraNZ.lookAt( 0, 0, - 1 );
12525
12616
  this.add( cameraNZ );
12526
12617
 
12527
12618
  }
12528
12619
 
12620
+ updateCoordinateSystem() {
12621
+
12622
+ const coordinateSystem = this.coordinateSystem;
12623
+
12624
+ const cameras = this.children.concat();
12625
+
12626
+ const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = cameras;
12627
+
12628
+ for ( const camera of cameras ) this.remove( camera );
12629
+
12630
+ if ( coordinateSystem === WebGLCoordinateSystem ) {
12631
+
12632
+ cameraPX.up.set( 0, 1, 0 );
12633
+ cameraPX.lookAt( 1, 0, 0 );
12634
+
12635
+ cameraNX.up.set( 0, 1, 0 );
12636
+ cameraNX.lookAt( - 1, 0, 0 );
12637
+
12638
+ cameraPY.up.set( 0, 0, - 1 );
12639
+ cameraPY.lookAt( 0, 1, 0 );
12640
+
12641
+ cameraNY.up.set( 0, 0, 1 );
12642
+ cameraNY.lookAt( 0, - 1, 0 );
12643
+
12644
+ cameraPZ.up.set( 0, 1, 0 );
12645
+ cameraPZ.lookAt( 0, 0, 1 );
12646
+
12647
+ cameraNZ.up.set( 0, 1, 0 );
12648
+ cameraNZ.lookAt( 0, 0, - 1 );
12649
+
12650
+ } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
12651
+
12652
+ cameraPX.up.set( 0, - 1, 0 );
12653
+ cameraPX.lookAt( - 1, 0, 0 );
12654
+
12655
+ cameraNX.up.set( 0, - 1, 0 );
12656
+ cameraNX.lookAt( 1, 0, 0 );
12657
+
12658
+ cameraPY.up.set( 0, 0, 1 );
12659
+ cameraPY.lookAt( 0, 1, 0 );
12660
+
12661
+ cameraNY.up.set( 0, 0, - 1 );
12662
+ cameraNY.lookAt( 0, - 1, 0 );
12663
+
12664
+ cameraPZ.up.set( 0, - 1, 0 );
12665
+ cameraPZ.lookAt( 0, 0, 1 );
12666
+
12667
+ cameraNZ.up.set( 0, - 1, 0 );
12668
+ cameraNZ.lookAt( 0, 0, - 1 );
12669
+
12670
+ } else {
12671
+
12672
+ throw new Error( 'THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: ' + coordinateSystem );
12673
+
12674
+ }
12675
+
12676
+ for ( const camera of cameras ) {
12677
+
12678
+ this.add( camera );
12679
+
12680
+ camera.updateMatrixWorld();
12681
+
12682
+ }
12683
+
12684
+ }
12685
+
12529
12686
  update( renderer, scene ) {
12530
12687
 
12531
12688
  if ( this.parent === null ) this.updateMatrixWorld();
12532
12689
 
12533
12690
  const renderTarget = this.renderTarget;
12534
12691
 
12692
+ if ( this.coordinateSystem !== renderer.coordinateSystem ) {
12693
+
12694
+ this.coordinateSystem = renderer.coordinateSystem;
12695
+
12696
+ this.updateCoordinateSystem();
12697
+
12698
+ }
12699
+
12535
12700
  const [ cameraPX, cameraNX, cameraPY, cameraNY, cameraPZ, cameraNZ ] = this.children;
12536
12701
 
12537
12702
  const currentRenderTarget = renderer.getRenderTarget();
@@ -12951,7 +13116,7 @@ class Plane {
12951
13116
 
12952
13117
  }
12953
13118
 
12954
- const _sphere$3 = /*@__PURE__*/ new Sphere();
13119
+ const _sphere$4 = /*@__PURE__*/ new Sphere();
12955
13120
  const _vector$6 = /*@__PURE__*/ new Vector3();
12956
13121
 
12957
13122
  class Frustum {
@@ -12991,7 +13156,7 @@ class Frustum {
12991
13156
 
12992
13157
  }
12993
13158
 
12994
- setFromProjectionMatrix( m ) {
13159
+ setFromProjectionMatrix( m, coordinateSystem = WebGLCoordinateSystem ) {
12995
13160
 
12996
13161
  const planes = this.planes;
12997
13162
  const me = m.elements;
@@ -13005,7 +13170,20 @@ class Frustum {
13005
13170
  planes[ 2 ].setComponents( me3 + me1, me7 + me5, me11 + me9, me15 + me13 ).normalize();
13006
13171
  planes[ 3 ].setComponents( me3 - me1, me7 - me5, me11 - me9, me15 - me13 ).normalize();
13007
13172
  planes[ 4 ].setComponents( me3 - me2, me7 - me6, me11 - me10, me15 - me14 ).normalize();
13008
- planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize();
13173
+
13174
+ if ( coordinateSystem === WebGLCoordinateSystem ) {
13175
+
13176
+ planes[ 5 ].setComponents( me3 + me2, me7 + me6, me11 + me10, me15 + me14 ).normalize();
13177
+
13178
+ } else if ( coordinateSystem === WebGPUCoordinateSystem ) {
13179
+
13180
+ planes[ 5 ].setComponents( me2, me6, me10, me14 ).normalize();
13181
+
13182
+ } else {
13183
+
13184
+ throw new Error( 'THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: ' + coordinateSystem );
13185
+
13186
+ }
13009
13187
 
13010
13188
  return this;
13011
13189
 
@@ -13017,7 +13195,7 @@ class Frustum {
13017
13195
 
13018
13196
  if ( object.boundingSphere === null ) object.computeBoundingSphere();
13019
13197
 
13020
- _sphere$3.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );
13198
+ _sphere$4.copy( object.boundingSphere ).applyMatrix4( object.matrixWorld );
13021
13199
 
13022
13200
  } else {
13023
13201
 
@@ -13025,21 +13203,21 @@ class Frustum {
13025
13203
 
13026
13204
  if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
13027
13205
 
13028
- _sphere$3.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );
13206
+ _sphere$4.copy( geometry.boundingSphere ).applyMatrix4( object.matrixWorld );
13029
13207
 
13030
13208
  }
13031
13209
 
13032
- return this.intersectsSphere( _sphere$3 );
13210
+ return this.intersectsSphere( _sphere$4 );
13033
13211
 
13034
13212
  }
13035
13213
 
13036
13214
  intersectsSprite( sprite ) {
13037
13215
 
13038
- _sphere$3.center.set( 0, 0, 0 );
13039
- _sphere$3.radius = 0.7071067811865476;
13040
- _sphere$3.applyMatrix4( sprite.matrixWorld );
13216
+ _sphere$4.center.set( 0, 0, 0 );
13217
+ _sphere$4.radius = 0.7071067811865476;
13218
+ _sphere$4.applyMatrix4( sprite.matrixWorld );
13041
13219
 
13042
- return this.intersectsSphere( _sphere$3 );
13220
+ return this.intersectsSphere( _sphere$4 );
13043
13221
 
13044
13222
  }
13045
13223
 
@@ -13456,6 +13634,10 @@ class PlaneGeometry extends BufferGeometry {
13456
13634
 
13457
13635
  }
13458
13636
 
13637
+ var alphahash_fragment = "#ifdef USE_ALPHAHASH\n\tif ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;\n#endif";
13638
+
13639
+ var alphahash_pars_fragment = "#ifdef USE_ALPHAHASH\n\tconst float ALPHA_HASH_SCALE = 0.05;\n\tfloat hash2D( vec2 value ) {\n\t\treturn fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );\n\t}\n\tfloat hash3D( vec3 value ) {\n\t\treturn hash2D( vec2( hash2D( value.xy ), value.z ) );\n\t}\n\tfloat getAlphaHashThreshold( vec3 position ) {\n\t\tfloat maxDeriv = max(\n\t\t\tlength( dFdx( position.xyz ) ),\n\t\t\tlength( dFdy( position.xyz ) )\n\t\t);\n\t\tfloat pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );\n\t\tvec2 pixScales = vec2(\n\t\t\texp2( floor( log2( pixScale ) ) ),\n\t\t\texp2( ceil( log2( pixScale ) ) )\n\t\t);\n\t\tvec2 alpha = vec2(\n\t\t\thash3D( floor( pixScales.x * position.xyz ) ),\n\t\t\thash3D( floor( pixScales.y * position.xyz ) )\n\t\t);\n\t\tfloat lerpFactor = fract( log2( pixScale ) );\n\t\tfloat x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;\n\t\tfloat a = min( lerpFactor, 1.0 - lerpFactor );\n\t\tvec3 cases = vec3(\n\t\t\tx * x / ( 2.0 * a * ( 1.0 - a ) ),\n\t\t\t( x - 0.5 * a ) / ( 1.0 - a ),\n\t\t\t1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )\n\t\t);\n\t\tfloat threshold = ( x < ( 1.0 - a ) )\n\t\t\t? ( ( x < a ) ? cases.x : cases.y )\n\t\t\t: cases.z;\n\t\treturn clamp( threshold , 1.0e-6, 1.0 );\n\t}\n#endif";
13640
+
13459
13641
  var alphamap_fragment = "#ifdef USE_ALPHAMAP\n\tdiffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;\n#endif";
13460
13642
 
13461
13643
  var alphamap_pars_fragment = "#ifdef USE_ALPHAMAP\n\tuniform sampler2D alphaMap;\n#endif";
@@ -13468,7 +13650,7 @@ var aomap_fragment = "#ifdef USE_AOMAP\n\tfloat ambientOcclusion = ( texture2D(
13468
13650
 
13469
13651
  var aomap_pars_fragment = "#ifdef USE_AOMAP\n\tuniform sampler2D aoMap;\n\tuniform float aoMapIntensity;\n#endif";
13470
13652
 
13471
- var begin_vertex = "vec3 transformed = vec3( position );";
13653
+ var begin_vertex = "vec3 transformed = vec3( position );\n#ifdef USE_ALPHAHASH\n\tvPosition = vec3( position );\n#endif";
13472
13654
 
13473
13655
  var beginnormal_vertex = "vec3 objectNormal = vec3( normal );\n#ifdef USE_TANGENT\n\tvec3 objectTangent = vec3( tangent.xyz );\n#endif";
13474
13656
 
@@ -13494,7 +13676,7 @@ var color_pars_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvarying vec4 vColor;\
13494
13676
 
13495
13677
  var color_vertex = "#if defined( USE_COLOR_ALPHA )\n\tvColor = vec4( 1.0 );\n#elif defined( USE_COLOR ) || defined( USE_INSTANCING_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";
13496
13678
 
13497
- 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};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\n};\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}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\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} // validated";
13679
+ 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};\nstruct GeometricContext {\n\tvec3 position;\n\tvec3 normal;\n\tvec3 viewDir;\n#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal;\n#endif\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}\nfloat luminance( const in vec3 rgb ) {\n\tconst vec3 weights = vec3( 0.2126729, 0.7151522, 0.0721750 );\n\treturn dot( weights, rgb );\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} // validated";
13498
13680
 
13499
13681
  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_v0 0.339\n\t#define cubeUV_m0 - 2.0\n\t#define cubeUV_r1 0.8\n\t#define cubeUV_v1 0.276\n\t#define cubeUV_m1 - 1.0\n\t#define cubeUV_r4 0.4\n\t#define cubeUV_v4 0.046\n\t#define cubeUV_m4 2.0\n\t#define cubeUV_r5 0.305\n\t#define cubeUV_v5 0.016\n\t#define cubeUV_m5 3.0\n\t#define cubeUV_r6 0.21\n\t#define cubeUV_v6 0.0038\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";
13500
13682
 
@@ -13508,9 +13690,9 @@ var emissivemap_fragment = "#ifdef USE_EMISSIVEMAP\n\tvec4 emissiveColor = textu
13508
13690
 
13509
13691
  var emissivemap_pars_fragment = "#ifdef USE_EMISSIVEMAP\n\tuniform sampler2D emissiveMap;\n#endif";
13510
13692
 
13511
- var encodings_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
13693
+ var colorspace_fragment = "gl_FragColor = linearToOutputTexel( gl_FragColor );";
13512
13694
 
13513
- var encodings_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}";
13695
+ var colorspace_pars_fragment = "vec4 LinearToLinear( in vec4 value ) {\n\treturn value;\n}\nvec4 LinearTosRGB( in vec4 value ) {\n\treturn vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );\n}";
13514
13696
 
13515
13697
  var envmap_fragment = "#ifdef USE_ENVMAP\n\t#ifdef ENV_WORLDPOS\n\t\tvec3 cameraToFrag;\n\t\tif ( isOrthographic ) {\n\t\t\tcameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );\n\t\t} else {\n\t\t\tcameraToFrag = normalize( vWorldPosition - cameraPosition );\n\t\t}\n\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t#ifdef ENVMAP_MODE_REFLECTION\n\t\t\tvec3 reflectVec = reflect( cameraToFrag, worldNormal );\n\t\t#else\n\t\t\tvec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );\n\t\t#endif\n\t#else\n\t\tvec3 reflectVec = vReflect;\n\t#endif\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 envColor = textureCube( envMap, vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );\n\t#else\n\t\tvec4 envColor = vec4( 0.0 );\n\t#endif\n\t#ifdef ENVMAP_BLENDING_MULTIPLY\n\t\toutgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_MIX )\n\t\toutgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );\n\t#elif defined( ENVMAP_BLENDING_ADD )\n\t\toutgoingLight += envColor.xyz * specularStrength * reflectivity;\n\t#endif\n#endif";
13516
13698
 
@@ -13542,7 +13724,7 @@ var lights_lambert_pars_fragment = "varying vec3 vViewPosition;\nstruct LambertM
13542
13724
 
13543
13725
  var lights_pars_begin = "uniform bool receiveShadow;\nuniform vec3 ambientLightColor;\nuniform vec3 lightProbe[ 9 ];\nvec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {\n\tfloat x = normal.x, y = normal.y, z = normal.z;\n\tvec3 result = shCoefficients[ 0 ] * 0.886227;\n\tresult += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;\n\tresult += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;\n\tresult += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;\n\tresult += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;\n\tresult += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;\n\tresult += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );\n\tresult += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;\n\tresult += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );\n\treturn result;\n}\nvec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {\n\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\tvec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );\n\treturn irradiance;\n}\nvec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {\n\tvec3 irradiance = ambientLightColor;\n\treturn irradiance;\n}\nfloat getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {\n\t#if defined ( LEGACY_LIGHTS )\n\t\tif ( cutoffDistance > 0.0 && decayExponent > 0.0 ) {\n\t\t\treturn pow( saturate( - lightDistance / cutoffDistance + 1.0 ), decayExponent );\n\t\t}\n\t\treturn 1.0;\n\t#else\n\t\tfloat distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );\n\t\tif ( cutoffDistance > 0.0 ) {\n\t\t\tdistanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );\n\t\t}\n\t\treturn distanceFalloff;\n\t#endif\n}\nfloat getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {\n\treturn smoothstep( coneCosine, penumbraCosine, angleCosine );\n}\n#if NUM_DIR_LIGHTS > 0\n\tstruct DirectionalLight {\n\t\tvec3 direction;\n\t\tvec3 color;\n\t};\n\tuniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];\n\tvoid getDirectionalLightInfo( const in DirectionalLight directionalLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tlight.color = directionalLight.color;\n\t\tlight.direction = directionalLight.direction;\n\t\tlight.visible = true;\n\t}\n#endif\n#if NUM_POINT_LIGHTS > 0\n\tstruct PointLight {\n\t\tvec3 position;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t};\n\tuniform PointLight pointLights[ NUM_POINT_LIGHTS ];\n\tvoid getPointLightInfo( const in PointLight pointLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = pointLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat lightDistance = length( lVector );\n\t\tlight.color = pointLight.color;\n\t\tlight.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );\n\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t}\n#endif\n#if NUM_SPOT_LIGHTS > 0\n\tstruct SpotLight {\n\t\tvec3 position;\n\t\tvec3 direction;\n\t\tvec3 color;\n\t\tfloat distance;\n\t\tfloat decay;\n\t\tfloat coneCos;\n\t\tfloat penumbraCos;\n\t};\n\tuniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];\n\tvoid getSpotLightInfo( const in SpotLight spotLight, const in GeometricContext geometry, out IncidentLight light ) {\n\t\tvec3 lVector = spotLight.position - geometry.position;\n\t\tlight.direction = normalize( lVector );\n\t\tfloat angleCos = dot( light.direction, spotLight.direction );\n\t\tfloat spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );\n\t\tif ( spotAttenuation > 0.0 ) {\n\t\t\tfloat lightDistance = length( lVector );\n\t\t\tlight.color = spotLight.color * spotAttenuation;\n\t\t\tlight.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );\n\t\t\tlight.visible = ( light.color != vec3( 0.0 ) );\n\t\t} else {\n\t\t\tlight.color = vec3( 0.0 );\n\t\t\tlight.visible = false;\n\t\t}\n\t}\n#endif\n#if NUM_RECT_AREA_LIGHTS > 0\n\tstruct RectAreaLight {\n\t\tvec3 color;\n\t\tvec3 position;\n\t\tvec3 halfWidth;\n\t\tvec3 halfHeight;\n\t};\n\tuniform sampler2D ltc_1;\tuniform sampler2D ltc_2;\n\tuniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];\n#endif\n#if NUM_HEMI_LIGHTS > 0\n\tstruct HemisphereLight {\n\t\tvec3 direction;\n\t\tvec3 skyColor;\n\t\tvec3 groundColor;\n\t};\n\tuniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];\n\tvec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {\n\t\tfloat dotNL = dot( normal, hemiLight.direction );\n\t\tfloat hemiDiffuseWeight = 0.5 * dotNL + 0.5;\n\t\tvec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );\n\t\treturn irradiance;\n\t}\n#endif";
13544
13726
 
13545
- var envmap_physical_pars_fragment = "#if defined( USE_ENVMAP )\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#if defined( ENVMAP_TYPE_CUBE_UV )\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n#endif";
13727
+ var envmap_physical_pars_fragment = "#ifdef USE_ENVMAP\n\tvec3 getIBLIrradiance( const in vec3 normal ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 worldNormal = inverseTransformDirection( normal, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, worldNormal, 1.0 );\n\t\t\treturn PI * envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\tvec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {\n\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\tvec3 reflectVec = reflect( - viewDir, normal );\n\t\t\treflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );\n\t\t\treflectVec = inverseTransformDirection( reflectVec, viewMatrix );\n\t\t\tvec4 envMapColor = textureCubeUV( envMap, reflectVec, roughness );\n\t\t\treturn envMapColor.rgb * envMapIntensity;\n\t\t#else\n\t\t\treturn vec3( 0.0 );\n\t\t#endif\n\t}\n\t#ifdef USE_ANISOTROPY\n\t\tvec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {\n\t\t\t#ifdef ENVMAP_TYPE_CUBE_UV\n\t\t\t\tvec3 bentNormal = cross( bitangent, viewDir );\n\t\t\t\tbentNormal = normalize( cross( bentNormal, bitangent ) );\n\t\t\t\tbentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );\n\t\t\t\treturn getIBLRadiance( viewDir, bentNormal, roughness );\n\t\t\t#else\n\t\t\t\treturn vec3( 0.0 );\n\t\t\t#endif\n\t\t}\n\t#endif\n#endif";
13546
13728
 
13547
13729
  var lights_toon_fragment = "ToonMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb;";
13548
13730
 
@@ -13552,13 +13734,13 @@ var lights_phong_fragment = "BlinnPhongMaterial material;\nmaterial.diffuseColor
13552
13734
 
13553
13735
  var lights_phong_pars_fragment = "varying vec3 vViewPosition;\nstruct BlinnPhongMaterial {\n\tvec3 diffuseColor;\n\tvec3 specularColor;\n\tfloat specularShininess;\n\tfloat specularStrength;\n};\nvoid RE_Direct_BlinnPhong( const in IncidentLight directLight, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n\treflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometry.viewDir, geometry.normal, material.specularColor, material.specularShininess ) * material.specularStrength;\n}\nvoid RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in GeometricContext geometry, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {\n\treflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\n#define RE_Direct\t\t\t\tRE_Direct_BlinnPhong\n#define RE_IndirectDiffuse\t\tRE_IndirectDiffuse_BlinnPhong";
13554
13736
 
13555
- var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef 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_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";
13737
+ var lights_physical_fragment = "PhysicalMaterial material;\nmaterial.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );\nvec3 dxy = max( abs( dFdx( geometryNormal ) ), abs( dFdy( geometryNormal ) ) );\nfloat geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );\nmaterial.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;\nmaterial.roughness = min( material.roughness, 1.0 );\n#ifdef IOR\n\tmaterial.ior = ior;\n\t#ifdef 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_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\tanisotropyV /= material.anisotropy;\n\tmaterial.anisotropy = saturate( material.anisotropy );\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";
13556
13738
 
13557
- var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\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};\nvec3 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = 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_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\tfloat V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );\n\tfloat D = D_GGX( alpha, dotNH );\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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, 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( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, 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}";
13739
+ var lights_physical_pars_fragment = "struct PhysicalMaterial {\n\tvec3 diffuseColor;\n\tfloat roughness;\n\tvec3 specularColor;\n\tfloat specularF90;\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 clearcoatSpecular = vec3( 0.0 );\nvec3 sheenSpecular = 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\t\tvec3 normal = geometry.normal;\n\t\tvec3 viewDir = geometry.viewDir;\n\t\tvec3 position = geometry.position;\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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {\n\tfloat dotNL = saturate( dot( geometry.normal, directLight.direction ) );\n\tvec3 irradiance = dotNL * directLight.color;\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNLcc = saturate( dot( geometry.clearcoatNormal, directLight.direction ) );\n\t\tvec3 ccIrradiance = dotNLcc * directLight.color;\n\t\tclearcoatSpecular += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometry.viewDir, geometry.clearcoatNormal, material );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * BRDF_Sheen( directLight.direction, geometry.viewDir, geometry.normal, material.sheenColor, material.sheenRoughness );\n\t#endif\n\treflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometry.viewDir, geometry.normal, material );\n\treflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );\n}\nvoid RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in GeometricContext geometry, 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 GeometricContext geometry, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatSpecular += clearcoatRadiance * EnvironmentBRDF( geometry.clearcoatNormal, geometry.viewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );\n\t#endif\n\t#ifdef USE_SHEEN\n\t\tsheenSpecular += irradiance * material.sheenColor * IBLSheenBRDF( geometry.normal, geometry.viewDir, 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( geometry.normal, geometry.viewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );\n\t#else\n\t\tcomputeMultiscattering( geometry.normal, geometry.viewDir, 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}";
13558
13740
 
13559
13741
  var lights_fragment_begin = "\nGeometricContext geometry;\ngeometry.position = - vViewPosition;\ngeometry.normal = normal;\ngeometry.viewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );\n#ifdef USE_CLEARCOAT\n\tgeometry.clearcoatNormal = clearcoatNormal;\n#endif\n#ifdef USE_IRIDESCENCE\n\tfloat dotNVi = saturate( dot( normal, geometry.viewDir ) );\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, geometry, 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.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, 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.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, 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.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;\n\t\t#endif\n\t\tRE_Direct( directLight, geometry, 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, geometry, 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\tirradiance += getLightProbeIrradiance( lightProbe, geometry.normal );\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 ], geometry.normal );\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";
13560
13742
 
13561
- var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif";
13743
+ var lights_fragment_maps = "#if defined( RE_IndirectDiffuse )\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\tvec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;\n\t\tirradiance += lightMapIrradiance;\n\t#endif\n\t#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )\n\t\tiblIrradiance += getIBLIrradiance( geometry.normal );\n\t#endif\n#endif\n#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )\n\t#ifdef USE_ANISOTROPY\n\t\tradiance += getIBLAnisotropyRadiance( geometry.viewDir, geometry.normal, material.roughness, material.anisotropyB, material.anisotropy );\n\t#else\n\t\tradiance += getIBLRadiance( geometry.viewDir, geometry.normal, material.roughness );\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tclearcoatRadiance += getIBLRadiance( geometry.viewDir, geometry.clearcoatNormal, material.clearcoatRoughness );\n\t#endif\n#endif";
13562
13744
 
13563
13745
  var lights_fragment_end = "#if defined( RE_IndirectDiffuse )\n\tRE_IndirectDiffuse( irradiance, geometry, material, reflectedLight );\n#endif\n#if defined( RE_IndirectSpecular )\n\tRE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometry, material, reflectedLight );\n#endif";
13564
13746
 
@@ -13590,7 +13772,7 @@ var morphtarget_pars_vertex = "#ifdef USE_MORPHTARGETS\n\tuniform float morphTar
13590
13772
 
13591
13773
  var morphtarget_vertex = "#ifdef USE_MORPHTARGETS\n\ttransformed *= morphTargetBaseInfluence;\n\t#ifdef MORPHTARGETS_TEXTURE\n\t\tfor ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {\n\t\t\tif ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];\n\t\t}\n\t#else\n\t\ttransformed += morphTarget0 * morphTargetInfluences[ 0 ];\n\t\ttransformed += morphTarget1 * morphTargetInfluences[ 1 ];\n\t\ttransformed += morphTarget2 * morphTargetInfluences[ 2 ];\n\t\ttransformed += morphTarget3 * morphTargetInfluences[ 3 ];\n\t\t#ifndef USE_MORPHNORMALS\n\t\t\ttransformed += morphTarget4 * morphTargetInfluences[ 4 ];\n\t\t\ttransformed += morphTarget5 * morphTargetInfluences[ 5 ];\n\t\t\ttransformed += morphTarget6 * morphTargetInfluences[ 6 ];\n\t\t\ttransformed += morphTarget7 * morphTargetInfluences[ 7 ];\n\t\t#endif\n\t#endif\n#endif";
13592
13774
 
13593
- var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_NORMALMAP_TANGENTSPACE\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal, vNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;";
13775
+ var normal_fragment_begin = "float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;\n#ifdef FLAT_SHADED\n\tvec3 fdx = dFdx( vViewPosition );\n\tvec3 fdy = dFdy( vViewPosition );\n\tvec3 normal = normalize( cross( fdx, fdy ) );\n#else\n\tvec3 normal = normalize( vNormal );\n\t#ifdef DOUBLE_SIDED\n\t\tnormal *= faceDirection;\n\t#endif\n#endif\n#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn = getTangentFrame( - vViewPosition, normal,\n\t\t#if defined( USE_NORMALMAP )\n\t\t\tvNormalMapUv\n\t\t#elif defined( USE_CLEARCOAT_NORMALMAP )\n\t\t\tvClearcoatNormalMapUv\n\t\t#else\n\t\t\tvUv\n\t\t#endif\n\t\t);\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn[0] *= faceDirection;\n\t\ttbn[1] *= faceDirection;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\t#ifdef USE_TANGENT\n\t\tmat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );\n\t#else\n\t\tmat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );\n\t#endif\n\t#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )\n\t\ttbn2[0] *= faceDirection;\n\t\ttbn2[1] *= faceDirection;\n\t#endif\n#endif\nvec3 geometryNormal = normal;";
13594
13776
 
13595
13777
  var normal_fragment_maps = "#ifdef USE_NORMALMAP_OBJECTSPACE\n\tnormal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\t#ifdef FLIP_SIDED\n\t\tnormal = - normal;\n\t#endif\n\t#ifdef DOUBLE_SIDED\n\t\tnormal = normal * faceDirection;\n\t#endif\n\tnormal = normalize( normalMatrix * normal );\n#elif defined( USE_NORMALMAP_TANGENTSPACE )\n\tvec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;\n\tmapN.xy *= normalScale;\n\tnormal = normalize( tbn * mapN );\n#elif defined( USE_BUMPMAP )\n\tnormal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );\n#endif";
13596
13778
 
@@ -13600,7 +13782,7 @@ var normal_pars_vertex = "#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n\t#ifdef
13600
13782
 
13601
13783
  var normal_vertex = "#ifndef FLAT_SHADED\n\tvNormal = normalize( transformedNormal );\n\t#ifdef USE_TANGENT\n\t\tvTangent = normalize( transformedTangent );\n\t\tvBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );\n\t#endif\n#endif";
13602
13784
 
13603
- var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif";
13785
+ var normalmap_pars_fragment = "#ifdef USE_NORMALMAP\n\tuniform sampler2D normalMap;\n\tuniform vec2 normalScale;\n#endif\n#ifdef USE_NORMALMAP_OBJECTSPACE\n\tuniform mat3 normalMatrix;\n#endif\n#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )\n\tmat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {\n\t\tvec3 q0 = dFdx( eye_pos.xyz );\n\t\tvec3 q1 = dFdy( eye_pos.xyz );\n\t\tvec2 st0 = dFdx( uv.st );\n\t\tvec2 st1 = dFdy( uv.st );\n\t\tvec3 N = surf_norm;\n\t\tvec3 q1perp = cross( q1, N );\n\t\tvec3 q0perp = cross( N, q0 );\n\t\tvec3 T = q1perp * st0.x + q0perp * st1.x;\n\t\tvec3 B = q1perp * st0.y + q0perp * st1.y;\n\t\tfloat det = max( dot( T, T ), dot( B, B ) );\n\t\tfloat scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );\n\t\treturn mat3( T * scale, B * scale, N );\n\t}\n#endif";
13604
13786
 
13605
13787
  var clearcoat_normal_fragment_begin = "#ifdef USE_CLEARCOAT\n\tvec3 clearcoatNormal = geometryNormal;\n#endif";
13606
13788
 
@@ -13610,7 +13792,7 @@ var clearcoat_pars_fragment = "#ifdef USE_CLEARCOATMAP\n\tuniform sampler2D clea
13610
13792
 
13611
13793
  var iridescence_pars_fragment = "#ifdef USE_IRIDESCENCEMAP\n\tuniform sampler2D iridescenceMap;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform sampler2D iridescenceThicknessMap;\n#endif";
13612
13794
 
13613
- var output_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha + 0.1;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );";
13795
+ var opaque_fragment = "#ifdef OPAQUE\ndiffuseColor.a = 1.0;\n#endif\n#ifdef USE_TRANSMISSION\ndiffuseColor.a *= material.transmissionAlpha;\n#endif\ngl_FragColor = vec4( outgoingLight, diffuseColor.a );";
13614
13796
 
13615
13797
  var packing = "vec3 packNormalToRGB( const in vec3 normal ) {\n\treturn normalize( normal ) * 0.5 + 0.5;\n}\nvec3 unpackRGBToNormal( const in vec3 rgb ) {\n\treturn 2.0 * rgb.xyz - 1.0;\n}\nconst float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;\nconst vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. );\nconst vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. );\nconst float ShiftRight8 = 1. / 256.;\nvec4 packDepthToRGBA( const in float v ) {\n\tvec4 r = vec4( fract( v * PackFactors ), v );\n\tr.yzw -= r.xyz * ShiftRight8;\treturn r * PackUpscale;\n}\nfloat unpackRGBAToDepth( const in vec4 v ) {\n\treturn dot( v, UnpackFactors );\n}\nvec2 packDepthToRG( in highp float v ) {\n\treturn packDepthToRGBA( v ).yx;\n}\nfloat unpackRGToDepth( const in highp vec2 v ) {\n\treturn unpackRGBAToDepth( vec4( v.xy, 0.0, 0.0 ) );\n}\nvec4 pack2HalfToRGBA( vec2 v ) {\n\tvec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );\n\treturn vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );\n}\nvec2 unpackRGBATo2Half( vec4 v ) {\n\treturn vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );\n}\nfloat viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( viewZ + near ) / ( near - far );\n}\nfloat orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn depth * ( near - far ) - near;\n}\nfloat viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {\n\treturn ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );\n}\nfloat perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {\n\treturn ( near * far ) / ( ( far - near ) * depth - far );\n}";
13616
13798
 
@@ -13648,59 +13830,59 @@ var specularmap_pars_fragment = "#ifdef USE_SPECULARMAP\n\tuniform sampler2D spe
13648
13830
 
13649
13831
  var tonemapping_fragment = "#if defined( TONE_MAPPING )\n\tgl_FragColor.rgb = toneMapping( gl_FragColor.rgb );\n#endif";
13650
13832
 
13651
- var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn toneMappingExposure * color;\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }";
13833
+ var tonemapping_pars_fragment = "#ifndef saturate\n#define saturate( a ) clamp( a, 0.0, 1.0 )\n#endif\nuniform float toneMappingExposure;\nvec3 LinearToneMapping( vec3 color ) {\n\treturn saturate( toneMappingExposure * color );\n}\nvec3 ReinhardToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\treturn saturate( color / ( vec3( 1.0 ) + color ) );\n}\nvec3 OptimizedCineonToneMapping( vec3 color ) {\n\tcolor *= toneMappingExposure;\n\tcolor = max( vec3( 0.0 ), color - 0.004 );\n\treturn pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );\n}\nvec3 RRTAndODTFit( vec3 v ) {\n\tvec3 a = v * ( v + 0.0245786 ) - 0.000090537;\n\tvec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;\n\treturn a / b;\n}\nvec3 ACESFilmicToneMapping( vec3 color ) {\n\tconst mat3 ACESInputMat = mat3(\n\t\tvec3( 0.59719, 0.07600, 0.02840 ),\t\tvec3( 0.35458, 0.90834, 0.13383 ),\n\t\tvec3( 0.04823, 0.01566, 0.83777 )\n\t);\n\tconst mat3 ACESOutputMat = mat3(\n\t\tvec3( 1.60475, -0.10208, -0.00327 ),\t\tvec3( -0.53108, 1.10813, -0.07276 ),\n\t\tvec3( -0.07367, -0.00605, 1.07602 )\n\t);\n\tcolor *= toneMappingExposure / 0.6;\n\tcolor = ACESInputMat * color;\n\tcolor = RRTAndODTFit( color );\n\tcolor = ACESOutputMat * color;\n\treturn saturate( color );\n}\nvec3 CustomToneMapping( vec3 color ) { return color; }";
13652
13834
 
13653
- var transmission_fragment = "#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmission = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmission.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmission.rgb, material.transmission );\n#endif";
13835
+ var transmission_fragment = "#ifdef USE_TRANSMISSION\n\tmaterial.transmission = transmission;\n\tmaterial.transmissionAlpha = 1.0;\n\tmaterial.thickness = thickness;\n\tmaterial.attenuationDistance = attenuationDistance;\n\tmaterial.attenuationColor = attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tmaterial.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tmaterial.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;\n\t#endif\n\tvec3 pos = vWorldPosition;\n\tvec3 v = normalize( cameraPosition - pos );\n\tvec3 n = inverseTransformDirection( normal, viewMatrix );\n\tvec4 transmitted = getIBLVolumeRefraction(\n\t\tn, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,\n\t\tpos, modelMatrix, viewMatrix, projectionMatrix, material.ior, material.thickness,\n\t\tmaterial.attenuationColor, material.attenuationDistance );\n\tmaterial.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );\n\ttotalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );\n#endif";
13654
13836
 
13655
- var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 applyVolumeAttenuation( const in vec3 radiance, const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn radiance;\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance * radiance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 attenuatedColor = applyVolumeAttenuation( transmittedLight.rgb, length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor * diffuseColor, transmittedLight.a );\n\t}\n#endif";
13837
+ var transmission_pars_fragment = "#ifdef USE_TRANSMISSION\n\tuniform float transmission;\n\tuniform float thickness;\n\tuniform float attenuationDistance;\n\tuniform vec3 attenuationColor;\n\t#ifdef USE_TRANSMISSIONMAP\n\t\tuniform sampler2D transmissionMap;\n\t#endif\n\t#ifdef USE_THICKNESSMAP\n\t\tuniform sampler2D thicknessMap;\n\t#endif\n\tuniform vec2 transmissionSamplerSize;\n\tuniform sampler2D transmissionSamplerMap;\n\tuniform mat4 modelMatrix;\n\tuniform mat4 projectionMatrix;\n\tvarying vec3 vWorldPosition;\n\tfloat w0( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );\n\t}\n\tfloat w1( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );\n\t}\n\tfloat w2( float a ){\n\t\treturn ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );\n\t}\n\tfloat w3( float a ) {\n\t\treturn ( 1.0 / 6.0 ) * ( a * a * a );\n\t}\n\tfloat g0( float a ) {\n\t\treturn w0( a ) + w1( a );\n\t}\n\tfloat g1( float a ) {\n\t\treturn w2( a ) + w3( a );\n\t}\n\tfloat h0( float a ) {\n\t\treturn - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );\n\t}\n\tfloat h1( float a ) {\n\t\treturn 1.0 + w3( a ) / ( w2( a ) + w3( a ) );\n\t}\n\tvec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {\n\t\tuv = uv * texelSize.zw + 0.5;\n\t\tvec2 iuv = floor( uv );\n\t\tvec2 fuv = fract( uv );\n\t\tfloat g0x = g0( fuv.x );\n\t\tfloat g1x = g1( fuv.x );\n\t\tfloat h0x = h0( fuv.x );\n\t\tfloat h1x = h1( fuv.x );\n\t\tfloat h0y = h0( fuv.y );\n\t\tfloat h1y = h1( fuv.y );\n\t\tvec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\tvec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;\n\t\treturn g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +\n\t\t\tg1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );\n\t}\n\tvec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {\n\t\tvec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );\n\t\tvec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );\n\t\tvec2 fLodSizeInv = 1.0 / fLodSize;\n\t\tvec2 cLodSizeInv = 1.0 / cLodSize;\n\t\tvec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );\n\t\tvec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );\n\t\treturn mix( fSample, cSample, fract( lod ) );\n\t}\n\tvec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {\n\t\tvec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );\n\t\tvec3 modelScale;\n\t\tmodelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );\n\t\tmodelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );\n\t\tmodelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );\n\t\treturn normalize( refractionVector ) * thickness * modelScale;\n\t}\n\tfloat applyIorToRoughness( const in float roughness, const in float ior ) {\n\t\treturn roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );\n\t}\n\tvec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {\n\t\tfloat lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );\n\t\treturn textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );\n\t}\n\tvec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tif ( isinf( attenuationDistance ) ) {\n\t\t\treturn vec3( 1.0 );\n\t\t} else {\n\t\t\tvec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;\n\t\t\tvec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );\t\t\treturn transmittance;\n\t\t}\n\t}\n\tvec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,\n\t\tconst in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,\n\t\tconst in mat4 viewMatrix, const in mat4 projMatrix, const in float ior, const in float thickness,\n\t\tconst in vec3 attenuationColor, const in float attenuationDistance ) {\n\t\tvec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );\n\t\tvec3 refractedRayExit = position + transmissionRay;\n\t\tvec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );\n\t\tvec2 refractionCoords = ndcPos.xy / ndcPos.w;\n\t\trefractionCoords += 1.0;\n\t\trefractionCoords /= 2.0;\n\t\tvec4 transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );\n\t\tvec3 transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );\n\t\tvec3 attenuatedColor = transmittance * transmittedLight.rgb;\n\t\tvec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );\n\t\tfloat transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;\n\t\treturn vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );\n\t}\n#endif";
13656
13838
 
13657
- var uv_pars_fragment = "#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif";
13839
+ var uv_pars_fragment = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif";
13658
13840
 
13659
- var uv_pars_vertex = "#ifdef USE_UV\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif";
13841
+ var uv_pars_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvarying vec2 vUv;\n#endif\n#ifdef USE_MAP\n\tuniform mat3 mapTransform;\n\tvarying vec2 vMapUv;\n#endif\n#ifdef USE_ALPHAMAP\n\tuniform mat3 alphaMapTransform;\n\tvarying vec2 vAlphaMapUv;\n#endif\n#ifdef USE_LIGHTMAP\n\tuniform mat3 lightMapTransform;\n\tvarying vec2 vLightMapUv;\n#endif\n#ifdef USE_AOMAP\n\tuniform mat3 aoMapTransform;\n\tvarying vec2 vAoMapUv;\n#endif\n#ifdef USE_BUMPMAP\n\tuniform mat3 bumpMapTransform;\n\tvarying vec2 vBumpMapUv;\n#endif\n#ifdef USE_NORMALMAP\n\tuniform mat3 normalMapTransform;\n\tvarying vec2 vNormalMapUv;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tuniform mat3 displacementMapTransform;\n\tvarying vec2 vDisplacementMapUv;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tuniform mat3 emissiveMapTransform;\n\tvarying vec2 vEmissiveMapUv;\n#endif\n#ifdef USE_METALNESSMAP\n\tuniform mat3 metalnessMapTransform;\n\tvarying vec2 vMetalnessMapUv;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tuniform mat3 roughnessMapTransform;\n\tvarying vec2 vRoughnessMapUv;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tuniform mat3 anisotropyMapTransform;\n\tvarying vec2 vAnisotropyMapUv;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tuniform mat3 clearcoatMapTransform;\n\tvarying vec2 vClearcoatMapUv;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tuniform mat3 clearcoatNormalMapTransform;\n\tvarying vec2 vClearcoatNormalMapUv;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tuniform mat3 clearcoatRoughnessMapTransform;\n\tvarying vec2 vClearcoatRoughnessMapUv;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tuniform mat3 sheenColorMapTransform;\n\tvarying vec2 vSheenColorMapUv;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tuniform mat3 sheenRoughnessMapTransform;\n\tvarying vec2 vSheenRoughnessMapUv;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tuniform mat3 iridescenceMapTransform;\n\tvarying vec2 vIridescenceMapUv;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tuniform mat3 iridescenceThicknessMapTransform;\n\tvarying vec2 vIridescenceThicknessMapUv;\n#endif\n#ifdef USE_SPECULARMAP\n\tuniform mat3 specularMapTransform;\n\tvarying vec2 vSpecularMapUv;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tuniform mat3 specularColorMapTransform;\n\tvarying vec2 vSpecularColorMapUv;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tuniform mat3 specularIntensityMapTransform;\n\tvarying vec2 vSpecularIntensityMapUv;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tuniform mat3 transmissionMapTransform;\n\tvarying vec2 vTransmissionMapUv;\n#endif\n#ifdef USE_THICKNESSMAP\n\tuniform mat3 thicknessMapTransform;\n\tvarying vec2 vThicknessMapUv;\n#endif";
13660
13842
 
13661
- var uv_vertex = "#ifdef USE_UV\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif";
13843
+ var uv_vertex = "#if defined( USE_UV ) || defined( USE_ANISOTROPY )\n\tvUv = vec3( uv, 1 ).xy;\n#endif\n#ifdef USE_MAP\n\tvMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ALPHAMAP\n\tvAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_LIGHTMAP\n\tvLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_AOMAP\n\tvAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_BUMPMAP\n\tvBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_NORMALMAP\n\tvNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_DISPLACEMENTMAP\n\tvDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_EMISSIVEMAP\n\tvEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_METALNESSMAP\n\tvMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ROUGHNESSMAP\n\tvRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_ANISOTROPYMAP\n\tvAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOATMAP\n\tvClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_NORMALMAP\n\tvClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_CLEARCOAT_ROUGHNESSMAP\n\tvClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCEMAP\n\tvIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_IRIDESCENCE_THICKNESSMAP\n\tvIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_COLORMAP\n\tvSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SHEEN_ROUGHNESSMAP\n\tvSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULARMAP\n\tvSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_COLORMAP\n\tvSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_SPECULAR_INTENSITYMAP\n\tvSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_TRANSMISSIONMAP\n\tvTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;\n#endif\n#ifdef USE_THICKNESSMAP\n\tvThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;\n#endif";
13662
13844
 
13663
13845
  var worldpos_vertex = "#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0\n\tvec4 worldPosition = vec4( transformed, 1.0 );\n\t#ifdef USE_INSTANCING\n\t\tworldPosition = instanceMatrix * worldPosition;\n\t#endif\n\tworldPosition = modelMatrix * worldPosition;\n#endif";
13664
13846
 
13665
13847
  const vertex$h = "varying vec2 vUv;\nuniform mat3 uvTransform;\nvoid main() {\n\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\tgl_Position = vec4( position.xy, 1.0, 1.0 );\n}";
13666
13848
 
13667
- const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
13849
+ const fragment$h = "uniform sampler2D t2D;\nuniform float backgroundIntensity;\nvarying vec2 vUv;\nvoid main() {\n\tvec4 texColor = texture2D( t2D, vUv );\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
13668
13850
 
13669
13851
  const vertex$g = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
13670
13852
 
13671
- const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
13853
+ const fragment$g = "#ifdef ENVMAP_TYPE_CUBE\n\tuniform samplerCube envMap;\n#elif defined( ENVMAP_TYPE_CUBE_UV )\n\tuniform sampler2D envMap;\n#endif\nuniform float flipEnvMap;\nuniform float backgroundBlurriness;\nuniform float backgroundIntensity;\nvarying vec3 vWorldDirection;\n#include <cube_uv_reflection_fragment>\nvoid main() {\n\t#ifdef ENVMAP_TYPE_CUBE\n\t\tvec4 texColor = textureCube( envMap, vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );\n\t#elif defined( ENVMAP_TYPE_CUBE_UV )\n\t\tvec4 texColor = textureCubeUV( envMap, vWorldDirection, backgroundBlurriness );\n\t#else\n\t\tvec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );\n\t#endif\n\ttexColor.rgb *= backgroundIntensity;\n\tgl_FragColor = texColor;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
13672
13854
 
13673
13855
  const vertex$f = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n\tgl_Position.z = gl_Position.w;\n}";
13674
13856
 
13675
- const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
13857
+ const fragment$f = "uniform samplerCube tCube;\nuniform float tFlip;\nuniform float opacity;\nvarying vec3 vWorldDirection;\nvoid main() {\n\tvec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );\n\tgl_FragColor = texColor;\n\tgl_FragColor.a *= opacity;\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
13676
13858
 
13677
13859
  const vertex$e = "#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvHighPrecisionZW = gl_Position.zw;\n}";
13678
13860
 
13679
- const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}";
13861
+ const fragment$e = "#if DEPTH_PACKING == 3200\n\tuniform float opacity;\n#endif\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvarying vec2 vHighPrecisionZW;\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#if DEPTH_PACKING == 3200\n\t\tdiffuseColor.a = opacity;\n\t#endif\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <logdepthbuf_fragment>\n\tfloat fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;\n\t#if DEPTH_PACKING == 3200\n\t\tgl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );\n\t#elif DEPTH_PACKING == 3201\n\t\tgl_FragColor = packDepthToRGBA( fragCoordZ );\n\t#endif\n}";
13680
13862
 
13681
13863
  const vertex$d = "#define DISTANCE\nvarying vec3 vWorldPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <skinbase_vertex>\n\t#ifdef USE_DISPLACEMENTMAP\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <worldpos_vertex>\n\t#include <clipping_planes_vertex>\n\tvWorldPosition = worldPosition.xyz;\n}";
13682
13864
 
13683
- const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}";
13865
+ const fragment$d = "#define DISTANCE\nuniform vec3 referencePosition;\nuniform float nearDistance;\nuniform float farDistance;\nvarying vec3 vWorldPosition;\n#include <common>\n#include <packing>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main () {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( 1.0 );\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\tfloat dist = length( vWorldPosition - referencePosition );\n\tdist = ( dist - nearDistance ) / ( farDistance - nearDistance );\n\tdist = saturate( dist );\n\tgl_FragColor = packDepthToRGBA( dist );\n}";
13684
13866
 
13685
13867
  const vertex$c = "varying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvWorldDirection = transformDirection( position, modelMatrix );\n\t#include <begin_vertex>\n\t#include <project_vertex>\n}";
13686
13868
 
13687
- const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n}";
13869
+ const fragment$c = "uniform sampler2D tEquirect;\nvarying vec3 vWorldDirection;\n#include <common>\nvoid main() {\n\tvec3 direction = normalize( vWorldDirection );\n\tvec2 sampleUV = equirectUv( direction );\n\tgl_FragColor = texture2D( tEquirect, sampleUV );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n}";
13688
13870
 
13689
13871
  const vertex$b = "uniform float scale;\nattribute float lineDistance;\nvarying float vLineDistance;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\tvLineDistance = scale * lineDistance;\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";
13690
13872
 
13691
- const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";
13873
+ const fragment$b = "uniform vec3 diffuse;\nuniform float opacity;\nuniform float dashSize;\nuniform float totalSize;\nvarying float vLineDistance;\n#include <common>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tif ( mod( vLineDistance, totalSize ) > dashSize ) {\n\t\tdiscard;\n\t}\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";
13692
13874
 
13693
13875
  const vertex$a = "#include <common>\n#include <uv_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )\n\t\t#include <beginnormal_vertex>\n\t\t#include <morphnormal_vertex>\n\t\t#include <skinbase_vertex>\n\t\t#include <skinnormal_vertex>\n\t\t#include <defaultnormal_vertex>\n\t#endif\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <fog_vertex>\n}";
13694
13876
 
13695
- const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13877
+ const fragment$a = "uniform vec3 diffuse;\nuniform float opacity;\n#ifndef FLAT_SHADED\n\tvarying vec3 vNormal;\n#endif\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\t#ifdef USE_LIGHTMAP\n\t\tvec4 lightMapTexel = texture2D( lightMap, vLightMapUv );\n\t\treflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;\n\t#else\n\t\treflectedLight.indirectDiffuse += vec3( 1.0 );\n\t#endif\n\t#include <aomap_fragment>\n\treflectedLight.indirectDiffuse *= diffuseColor.rgb;\n\tvec3 outgoingLight = reflectedLight.indirectDiffuse;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13696
13878
 
13697
13879
  const vertex$9 = "#define LAMBERT\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
13698
13880
 
13699
- const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13881
+ const fragment$9 = "#define LAMBERT\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_lambert_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_lambert_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13700
13882
 
13701
13883
  const vertex$8 = "#define MATCAP\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <color_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n\tvViewPosition = - mvPosition.xyz;\n}";
13702
13884
 
13703
- const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13885
+ const fragment$8 = "#define MATCAP\nuniform vec3 diffuse;\nuniform float opacity;\nuniform sampler2D matcap;\nvarying vec3 vViewPosition;\n#include <common>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <normal_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\tvec3 viewDir = normalize( vViewPosition );\n\tvec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );\n\tvec3 y = cross( viewDir, x );\n\tvec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;\n\t#ifdef USE_MATCAP\n\t\tvec4 matcapColor = texture2D( matcap, uv );\n\t#else\n\t\tvec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );\n\t#endif\n\tvec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13704
13886
 
13705
13887
  const vertex$7 = "#define NORMAL\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvarying vec3 vViewPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )\n\tvViewPosition = - mvPosition.xyz;\n#endif\n}";
13706
13888
 
@@ -13708,29 +13890,31 @@ const fragment$7 = "#define NORMAL\nuniform float opacity;\n#if defined( FLAT_SH
13708
13890
 
13709
13891
  const vertex$6 = "#define PHONG\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <envmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <envmap_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
13710
13892
 
13711
- const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13893
+ const fragment$6 = "#define PHONG\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform vec3 specular;\nuniform float shininess;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_phong_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <specularmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <specularmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_phong_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;\n\t#include <envmap_fragment>\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13712
13894
 
13713
13895
  const vertex$5 = "#define STANDARD\nvarying vec3 vViewPosition;\n#ifdef USE_TRANSMISSION\n\tvarying vec3 vWorldPosition;\n#endif\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n#ifdef USE_TRANSMISSION\n\tvWorldPosition = worldPosition.xyz;\n#endif\n}";
13714
13896
 
13715
- const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13897
+ const fragment$5 = "#define STANDARD\n#ifdef PHYSICAL\n\t#define IOR\n\t#define USE_SPECULAR\n#endif\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float roughness;\nuniform float metalness;\nuniform float opacity;\n#ifdef IOR\n\tuniform float ior;\n#endif\n#ifdef USE_SPECULAR\n\tuniform float specularIntensity;\n\tuniform vec3 specularColor;\n\t#ifdef USE_SPECULAR_COLORMAP\n\t\tuniform sampler2D specularColorMap;\n\t#endif\n\t#ifdef USE_SPECULAR_INTENSITYMAP\n\t\tuniform sampler2D specularIntensityMap;\n\t#endif\n#endif\n#ifdef USE_CLEARCOAT\n\tuniform float clearcoat;\n\tuniform float clearcoatRoughness;\n#endif\n#ifdef USE_IRIDESCENCE\n\tuniform float iridescence;\n\tuniform float iridescenceIOR;\n\tuniform float iridescenceThicknessMinimum;\n\tuniform float iridescenceThicknessMaximum;\n#endif\n#ifdef USE_SHEEN\n\tuniform vec3 sheenColor;\n\tuniform float sheenRoughness;\n\t#ifdef USE_SHEEN_COLORMAP\n\t\tuniform sampler2D sheenColorMap;\n\t#endif\n\t#ifdef USE_SHEEN_ROUGHNESSMAP\n\t\tuniform sampler2D sheenRoughnessMap;\n\t#endif\n#endif\n#ifdef USE_ANISOTROPY\n\tuniform vec2 anisotropyVector;\n\t#ifdef USE_ANISOTROPYMAP\n\t\tuniform sampler2D anisotropyMap;\n\t#endif\n#endif\nvarying vec3 vViewPosition;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <iridescence_fragment>\n#include <cube_uv_reflection_fragment>\n#include <envmap_common_pars_fragment>\n#include <envmap_physical_pars_fragment>\n#include <fog_pars_fragment>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_physical_pars_fragment>\n#include <transmission_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <clearcoat_pars_fragment>\n#include <iridescence_pars_fragment>\n#include <roughnessmap_pars_fragment>\n#include <metalnessmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <roughnessmap_fragment>\n\t#include <metalnessmap_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <clearcoat_normal_fragment_begin>\n\t#include <clearcoat_normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_physical_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;\n\tvec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;\n\t#include <transmission_fragment>\n\tvec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;\n\t#ifdef USE_SHEEN\n\t\tfloat sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );\n\t\toutgoingLight = outgoingLight * sheenEnergyComp + sheenSpecular;\n\t#endif\n\t#ifdef USE_CLEARCOAT\n\t\tfloat dotNVcc = saturate( dot( geometry.clearcoatNormal, geometry.viewDir ) );\n\t\tvec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );\n\t\toutgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + clearcoatSpecular * material.clearcoat;\n\t#endif\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13716
13898
 
13717
13899
  const vertex$4 = "#define TOON\nvarying vec3 vViewPosition;\n#include <common>\n#include <uv_pars_vertex>\n#include <displacementmap_pars_vertex>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <normal_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <shadowmap_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <normal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <displacementmap_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\tvViewPosition = - mvPosition.xyz;\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
13718
13900
 
13719
- const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13901
+ const fragment$4 = "#define TOON\nuniform vec3 diffuse;\nuniform vec3 emissive;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <dithering_pars_fragment>\n#include <color_pars_fragment>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <aomap_pars_fragment>\n#include <lightmap_pars_fragment>\n#include <emissivemap_pars_fragment>\n#include <gradientmap_pars_fragment>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <normal_pars_fragment>\n#include <lights_toon_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <bumpmap_pars_fragment>\n#include <normalmap_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\tReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );\n\tvec3 totalEmissiveRadiance = emissive;\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <color_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\t#include <normal_fragment_begin>\n\t#include <normal_fragment_maps>\n\t#include <emissivemap_fragment>\n\t#include <lights_toon_fragment>\n\t#include <lights_fragment_begin>\n\t#include <lights_fragment_maps>\n\t#include <lights_fragment_end>\n\t#include <aomap_fragment>\n\tvec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n\t#include <dithering_fragment>\n}";
13720
13902
 
13721
13903
  const vertex$3 = "uniform float size;\nuniform float scale;\n#include <common>\n#include <color_pars_vertex>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\n#ifdef USE_POINTS_UV\n\tvarying vec2 vUv;\n\tuniform mat3 uvTransform;\n#endif\nvoid main() {\n\t#ifdef USE_POINTS_UV\n\t\tvUv = ( uvTransform * vec3( uv, 1 ) ).xy;\n\t#endif\n\t#include <color_vertex>\n\t#include <morphcolor_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <project_vertex>\n\tgl_PointSize = size;\n\t#ifdef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );\n\t#endif\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <worldpos_vertex>\n\t#include <fog_vertex>\n}";
13722
13904
 
13723
- const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";
13905
+ const fragment$3 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <color_pars_fragment>\n#include <map_particle_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_particle_fragment>\n\t#include <color_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n\t#include <premultiplied_alpha_fragment>\n}";
13724
13906
 
13725
13907
  const vertex$2 = "#include <common>\n#include <fog_pars_vertex>\n#include <morphtarget_pars_vertex>\n#include <skinning_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <shadowmap_pars_vertex>\nvoid main() {\n\t#include <beginnormal_vertex>\n\t#include <morphnormal_vertex>\n\t#include <skinbase_vertex>\n\t#include <skinnormal_vertex>\n\t#include <defaultnormal_vertex>\n\t#include <begin_vertex>\n\t#include <morphtarget_vertex>\n\t#include <skinning_vertex>\n\t#include <project_vertex>\n\t#include <logdepthbuf_vertex>\n\t#include <worldpos_vertex>\n\t#include <shadowmap_vertex>\n\t#include <fog_vertex>\n}";
13726
13908
 
13727
- const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}";
13909
+ const fragment$2 = "uniform vec3 color;\nuniform float opacity;\n#include <common>\n#include <packing>\n#include <fog_pars_fragment>\n#include <bsdfs>\n#include <lights_pars_begin>\n#include <logdepthbuf_pars_fragment>\n#include <shadowmap_pars_fragment>\n#include <shadowmask_pars_fragment>\nvoid main() {\n\t#include <logdepthbuf_fragment>\n\tgl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}";
13728
13910
 
13729
13911
  const vertex$1 = "uniform float rotation;\nuniform vec2 center;\n#include <common>\n#include <uv_pars_vertex>\n#include <fog_pars_vertex>\n#include <logdepthbuf_pars_vertex>\n#include <clipping_planes_pars_vertex>\nvoid main() {\n\t#include <uv_vertex>\n\tvec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n\tvec2 scale;\n\tscale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n\tscale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n\t#ifndef USE_SIZEATTENUATION\n\t\tbool isPerspective = isPerspectiveMatrix( projectionMatrix );\n\t\tif ( isPerspective ) scale *= - mvPosition.z;\n\t#endif\n\tvec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;\n\tvec2 rotatedPosition;\n\trotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n\trotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n\tmvPosition.xy += rotatedPosition;\n\tgl_Position = projectionMatrix * mvPosition;\n\t#include <logdepthbuf_vertex>\n\t#include <clipping_planes_vertex>\n\t#include <fog_vertex>\n}";
13730
13912
 
13731
- const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <output_fragment>\n\t#include <tonemapping_fragment>\n\t#include <encodings_fragment>\n\t#include <fog_fragment>\n}";
13913
+ const fragment$1 = "uniform vec3 diffuse;\nuniform float opacity;\n#include <common>\n#include <uv_pars_fragment>\n#include <map_pars_fragment>\n#include <alphamap_pars_fragment>\n#include <alphatest_pars_fragment>\n#include <alphahash_pars_fragment>\n#include <fog_pars_fragment>\n#include <logdepthbuf_pars_fragment>\n#include <clipping_planes_pars_fragment>\nvoid main() {\n\t#include <clipping_planes_fragment>\n\tvec3 outgoingLight = vec3( 0.0 );\n\tvec4 diffuseColor = vec4( diffuse, opacity );\n\t#include <logdepthbuf_fragment>\n\t#include <map_fragment>\n\t#include <alphamap_fragment>\n\t#include <alphatest_fragment>\n\t#include <alphahash_fragment>\n\toutgoingLight = diffuseColor.rgb;\n\t#include <opaque_fragment>\n\t#include <tonemapping_fragment>\n\t#include <colorspace_fragment>\n\t#include <fog_fragment>\n}";
13732
13914
 
13733
13915
  const ShaderChunk = {
13916
+ alphahash_fragment: alphahash_fragment,
13917
+ alphahash_pars_fragment: alphahash_pars_fragment,
13734
13918
  alphamap_fragment: alphamap_fragment,
13735
13919
  alphamap_pars_fragment: alphamap_pars_fragment,
13736
13920
  alphatest_fragment: alphatest_fragment,
@@ -13757,8 +13941,8 @@ const ShaderChunk = {
13757
13941
  displacementmap_vertex: displacementmap_vertex,
13758
13942
  emissivemap_fragment: emissivemap_fragment,
13759
13943
  emissivemap_pars_fragment: emissivemap_pars_fragment,
13760
- encodings_fragment: encodings_fragment,
13761
- encodings_pars_fragment: encodings_pars_fragment,
13944
+ colorspace_fragment: colorspace_fragment,
13945
+ colorspace_pars_fragment: colorspace_pars_fragment,
13762
13946
  envmap_fragment: envmap_fragment,
13763
13947
  envmap_common_pars_fragment: envmap_common_pars_fragment,
13764
13948
  envmap_pars_fragment: envmap_pars_fragment,
@@ -13808,7 +13992,7 @@ const ShaderChunk = {
13808
13992
  clearcoat_normal_fragment_maps: clearcoat_normal_fragment_maps,
13809
13993
  clearcoat_pars_fragment: clearcoat_pars_fragment,
13810
13994
  iridescence_pars_fragment: iridescence_pars_fragment,
13811
- output_fragment: output_fragment,
13995
+ opaque_fragment: opaque_fragment,
13812
13996
  packing: packing,
13813
13997
  premultiplied_alpha_fragment: premultiplied_alpha_fragment,
13814
13998
  project_vertex: project_vertex,
@@ -14074,6 +14258,7 @@ const UniformsLib = {
14074
14258
  scale: { value: 1.0 },
14075
14259
  map: { value: null },
14076
14260
  alphaMap: { value: null },
14261
+ alphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },
14077
14262
  alphaTest: { value: 0 },
14078
14263
  uvTransform: { value: /*@__PURE__*/ new Matrix3() }
14079
14264
 
@@ -14088,6 +14273,7 @@ const UniformsLib = {
14088
14273
  map: { value: null },
14089
14274
  mapTransform: { value: /*@__PURE__*/ new Matrix3() },
14090
14275
  alphaMap: { value: null },
14276
+ alphaMapTransform: { value: /*@__PURE__*/ new Matrix3() },
14091
14277
  alphaTest: { value: 0 }
14092
14278
 
14093
14279
  }
@@ -14431,7 +14617,10 @@ ShaderLib.physical = {
14431
14617
  specularColorMapTransform: { value: /*@__PURE__*/ new Matrix3() },
14432
14618
  specularIntensity: { value: 1 },
14433
14619
  specularIntensityMap: { value: null },
14434
- specularIntensityMapTransform: { value: /*@__PURE__*/ new Matrix3() }
14620
+ specularIntensityMapTransform: { value: /*@__PURE__*/ new Matrix3() },
14621
+ anisotropyVector: { value: /*@__PURE__*/ new Vector2() },
14622
+ anisotropyMap: { value: null },
14623
+ anisotropyMapTransform: { value: /*@__PURE__*/ new Matrix3() },
14435
14624
  }
14436
14625
  ] ),
14437
14626
 
@@ -14993,9 +15182,9 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
14993
15182
 
14994
15183
  }
14995
15184
 
14996
- function vertexAttribPointer( index, size, type, normalized, stride, offset ) {
15185
+ function vertexAttribPointer( index, size, type, normalized, stride, offset, integer ) {
14997
15186
 
14998
- if ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT ) ) {
15187
+ if ( integer === true ) {
14999
15188
 
15000
15189
  gl.vertexAttribIPointer( index, size, type, stride, offset );
15001
15190
 
@@ -15053,6 +15242,10 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
15053
15242
  const type = attribute.type;
15054
15243
  const bytesPerElement = attribute.bytesPerElement;
15055
15244
 
15245
+ // check for integer attributes (WebGL 2 only)
15246
+
15247
+ const integer = ( capabilities.isWebGL2 === true && ( type === gl.INT || type === gl.UNSIGNED_INT || geometryAttribute.gpuType === IntType ) );
15248
+
15056
15249
  if ( geometryAttribute.isInterleavedBufferAttribute ) {
15057
15250
 
15058
15251
  const data = geometryAttribute.data;
@@ -15093,7 +15286,8 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
15093
15286
  type,
15094
15287
  normalized,
15095
15288
  stride * bytesPerElement,
15096
- ( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement
15289
+ ( offset + ( size / programAttribute.locationSize ) * i ) * bytesPerElement,
15290
+ integer
15097
15291
  );
15098
15292
 
15099
15293
  }
@@ -15134,7 +15328,8 @@ function WebGLBindingStates( gl, extensions, attributes, capabilities ) {
15134
15328
  type,
15135
15329
  normalized,
15136
15330
  size * bytesPerElement,
15137
- ( size / programAttribute.locationSize ) * i * bytesPerElement
15331
+ ( size / programAttribute.locationSize ) * i * bytesPerElement,
15332
+ integer
15138
15333
  );
15139
15334
 
15140
15335
  }
@@ -15842,7 +16037,7 @@ class OrthographicCamera extends Camera {
15842
16037
 
15843
16038
  }
15844
16039
 
15845
- this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far );
16040
+ this.projectionMatrix.makeOrthographic( left, right, top, bottom, this.near, this.far, this.coordinateSystem );
15846
16041
 
15847
16042
  this.projectionMatrixInverse.copy( this.projectionMatrix ).invert();
15848
16043
 
@@ -16983,6 +17178,18 @@ function WebGLGeometries( gl, attributes, info, bindingStates ) {
16983
17178
 
16984
17179
  }
16985
17180
 
17181
+ for ( const name in geometry.morphAttributes ) {
17182
+
17183
+ const array = geometry.morphAttributes[ name ];
17184
+
17185
+ for ( let i = 0, l = array.length; i < l; i ++ ) {
17186
+
17187
+ attributes.remove( array[ i ] );
17188
+
17189
+ }
17190
+
17191
+ }
17192
+
16986
17193
  geometry.removeEventListener( 'dispose', onGeometryDispose );
16987
17194
 
16988
17195
  delete geometries[ geometry.id ];
@@ -17272,7 +17479,6 @@ function WebGLInfo( gl ) {
17272
17479
 
17273
17480
  function reset() {
17274
17481
 
17275
- render.frame ++;
17276
17482
  render.calls = 0;
17277
17483
  render.triangles = 0;
17278
17484
  render.points = 0;
@@ -17613,11 +17819,31 @@ function WebGLObjects( gl, geometries, attributes, info ) {
17613
17819
 
17614
17820
  }
17615
17821
 
17616
- attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );
17822
+ if ( updateMap.get( object ) !== frame ) {
17823
+
17824
+ attributes.update( object.instanceMatrix, gl.ARRAY_BUFFER );
17825
+
17826
+ if ( object.instanceColor !== null ) {
17827
+
17828
+ attributes.update( object.instanceColor, gl.ARRAY_BUFFER );
17829
+
17830
+ }
17831
+
17832
+ updateMap.set( object, frame );
17833
+
17834
+ }
17835
+
17836
+ }
17837
+
17838
+ if ( object.isSkinnedMesh ) {
17617
17839
 
17618
- if ( object.instanceColor !== null ) {
17840
+ const skeleton = object.skeleton;
17619
17841
 
17620
- attributes.update( object.instanceColor, gl.ARRAY_BUFFER );
17842
+ if ( updateMap.get( skeleton ) !== frame ) {
17843
+
17844
+ skeleton.update();
17845
+
17846
+ updateMap.set( skeleton, frame );
17621
17847
 
17622
17848
  }
17623
17849
 
@@ -17697,6 +17923,7 @@ function WebGLObjects( gl, geometries, attributes, info ) {
17697
17923
  *
17698
17924
  */
17699
17925
 
17926
+
17700
17927
  const emptyTexture = /*@__PURE__*/ new Texture();
17701
17928
  const emptyArrayTexture = /*@__PURE__*/ new DataArrayTexture();
17702
17929
  const empty3dTexture = /*@__PURE__*/ new Data3DTexture();
@@ -19013,13 +19240,30 @@ function resolveIncludes( string ) {
19013
19240
 
19014
19241
  }
19015
19242
 
19243
+ const shaderChunkMap = new Map( [
19244
+ [ 'encodings_fragment', 'colorspace_fragment' ], // @deprecated, r154
19245
+ [ 'encodings_pars_fragment', 'colorspace_pars_fragment' ], // @deprecated, r154
19246
+ [ 'output_fragment', 'opaque_fragment' ], // @deprecated, r154
19247
+ ] );
19248
+
19016
19249
  function includeReplacer( match, include ) {
19017
19250
 
19018
- const string = ShaderChunk[ include ];
19251
+ let string = ShaderChunk[ include ];
19019
19252
 
19020
19253
  if ( string === undefined ) {
19021
19254
 
19022
- throw new Error( 'Can not resolve #include <' + include + '>' );
19255
+ const newInclude = shaderChunkMap.get( include );
19256
+
19257
+ if ( newInclude !== undefined ) {
19258
+
19259
+ string = ShaderChunk[ newInclude ];
19260
+ console.warn( 'THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.', include, newInclude );
19261
+
19262
+ } else {
19263
+
19264
+ throw new Error( 'Can not resolve #include <' + include + '>' );
19265
+
19266
+ }
19023
19267
 
19024
19268
  }
19025
19269
 
@@ -19220,6 +19464,9 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19220
19464
 
19221
19465
  prefixVertex = [
19222
19466
 
19467
+ '#define SHADER_TYPE ' + parameters.shaderType,
19468
+ '#define SHADER_NAME ' + parameters.shaderName,
19469
+
19223
19470
  customDefines
19224
19471
 
19225
19472
  ].filter( filterEmptyLine ).join( '\n' );
@@ -19233,6 +19480,10 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19233
19480
  prefixFragment = [
19234
19481
 
19235
19482
  customExtensions,
19483
+
19484
+ '#define SHADER_TYPE ' + parameters.shaderType,
19485
+ '#define SHADER_NAME ' + parameters.shaderName,
19486
+
19236
19487
  customDefines
19237
19488
 
19238
19489
  ].filter( filterEmptyLine ).join( '\n' );
@@ -19249,6 +19500,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19249
19500
 
19250
19501
  generatePrecision( parameters ),
19251
19502
 
19503
+ '#define SHADER_TYPE ' + parameters.shaderType,
19252
19504
  '#define SHADER_NAME ' + parameters.shaderName,
19253
19505
 
19254
19506
  customDefines,
@@ -19271,6 +19523,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19271
19523
  parameters.displacementMap ? '#define USE_DISPLACEMENTMAP' : '',
19272
19524
  parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
19273
19525
 
19526
+ parameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '',
19527
+
19274
19528
  parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',
19275
19529
  parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',
19276
19530
  parameters.clearcoatNormalMap ? '#define USE_CLEARCOAT_NORMALMAP' : '',
@@ -19285,6 +19539,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19285
19539
  parameters.roughnessMap ? '#define USE_ROUGHNESSMAP' : '',
19286
19540
  parameters.metalnessMap ? '#define USE_METALNESSMAP' : '',
19287
19541
  parameters.alphaMap ? '#define USE_ALPHAMAP' : '',
19542
+ parameters.alphaHash ? '#define USE_ALPHAHASH' : '',
19288
19543
 
19289
19544
  parameters.transmission ? '#define USE_TRANSMISSION' : '',
19290
19545
  parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
@@ -19307,6 +19562,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19307
19562
  parameters.metalnessMapUv ? '#define METALNESSMAP_UV ' + parameters.metalnessMapUv : '',
19308
19563
  parameters.roughnessMapUv ? '#define ROUGHNESSMAP_UV ' + parameters.roughnessMapUv : '',
19309
19564
 
19565
+ parameters.anisotropyMapUv ? '#define ANISOTROPYMAP_UV ' + parameters.anisotropyMapUv : '',
19566
+
19310
19567
  parameters.clearcoatMapUv ? '#define CLEARCOATMAP_UV ' + parameters.clearcoatMapUv : '',
19311
19568
  parameters.clearcoatNormalMapUv ? '#define CLEARCOAT_NORMALMAP_UV ' + parameters.clearcoatNormalMapUv : '',
19312
19569
  parameters.clearcoatRoughnessMapUv ? '#define CLEARCOAT_ROUGHNESSMAP_UV ' + parameters.clearcoatRoughnessMapUv : '',
@@ -19326,7 +19583,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19326
19583
 
19327
19584
  //
19328
19585
 
19329
- parameters.vertexTangents ? '#define USE_TANGENT' : '',
19586
+ parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',
19330
19587
  parameters.vertexColors ? '#define USE_COLOR' : '',
19331
19588
  parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
19332
19589
  parameters.vertexUv1s ? '#define USE_UV1' : '',
@@ -19353,6 +19610,8 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19353
19610
 
19354
19611
  parameters.sizeAttenuation ? '#define USE_SIZEATTENUATION' : '',
19355
19612
 
19613
+ parameters.useLegacyLights ? '#define LEGACY_LIGHTS' : '',
19614
+
19356
19615
  parameters.logarithmicDepthBuffer ? '#define USE_LOGDEPTHBUF' : '',
19357
19616
  ( parameters.logarithmicDepthBuffer && parameters.rendererExtensionFragDepth ) ? '#define USE_LOGDEPTHBUF_EXT' : '',
19358
19617
 
@@ -19456,6 +19715,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19456
19715
 
19457
19716
  generatePrecision( parameters ),
19458
19717
 
19718
+ '#define SHADER_TYPE ' + parameters.shaderType,
19459
19719
  '#define SHADER_NAME ' + parameters.shaderName,
19460
19720
 
19461
19721
  customDefines,
@@ -19480,6 +19740,9 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19480
19740
  parameters.normalMapTangentSpace ? '#define USE_NORMALMAP_TANGENTSPACE' : '',
19481
19741
  parameters.emissiveMap ? '#define USE_EMISSIVEMAP' : '',
19482
19742
 
19743
+ parameters.anisotropy ? '#define USE_ANISOTROPY' : '',
19744
+ parameters.anisotropyMap ? '#define USE_ANISOTROPYMAP' : '',
19745
+
19483
19746
  parameters.clearcoat ? '#define USE_CLEARCOAT' : '',
19484
19747
  parameters.clearcoatMap ? '#define USE_CLEARCOATMAP' : '',
19485
19748
  parameters.clearcoatRoughnessMap ? '#define USE_CLEARCOAT_ROUGHNESSMAP' : '',
@@ -19498,6 +19761,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19498
19761
 
19499
19762
  parameters.alphaMap ? '#define USE_ALPHAMAP' : '',
19500
19763
  parameters.alphaTest ? '#define USE_ALPHATEST' : '',
19764
+ parameters.alphaHash ? '#define USE_ALPHAHASH' : '',
19501
19765
 
19502
19766
  parameters.sheen ? '#define USE_SHEEN' : '',
19503
19767
  parameters.sheenColorMap ? '#define USE_SHEEN_COLORMAP' : '',
@@ -19507,7 +19771,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19507
19771
  parameters.transmissionMap ? '#define USE_TRANSMISSIONMAP' : '',
19508
19772
  parameters.thicknessMap ? '#define USE_THICKNESSMAP' : '',
19509
19773
 
19510
- parameters.vertexTangents ? '#define USE_TANGENT' : '',
19774
+ parameters.vertexTangents && parameters.flatShading === false ? '#define USE_TANGENT' : '',
19511
19775
  parameters.vertexColors || parameters.instancingColor ? '#define USE_COLOR' : '',
19512
19776
  parameters.vertexAlphas ? '#define USE_COLOR_ALPHA' : '',
19513
19777
  parameters.vertexUv1s ? '#define USE_UV1' : '',
@@ -19544,7 +19808,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19544
19808
  parameters.dithering ? '#define DITHERING' : '',
19545
19809
  parameters.opaque ? '#define OPAQUE' : '',
19546
19810
 
19547
- ShaderChunk[ 'encodings_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below
19811
+ ShaderChunk[ 'colorspace_pars_fragment' ], // this code is required here because it is used by the various encoding/decoding function defined below
19548
19812
  getTexelEncodingFunction( 'linearToOutputTexel', parameters.outputColorSpace ),
19549
19813
 
19550
19814
  parameters.useDepthPacking ? '#define DEPTH_PACKING ' + parameters.depthPacking : '',
@@ -19751,6 +20015,7 @@ function WebGLProgram( renderer, cacheKey, parameters, bindingStates ) {
19751
20015
 
19752
20016
  //
19753
20017
 
20018
+ this.type = parameters.shaderType;
19754
20019
  this.name = parameters.shaderName;
19755
20020
  this.id = programIdCount ++;
19756
20021
  this.cacheKey = cacheKey;
@@ -19918,11 +20183,9 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
19918
20183
 
19919
20184
  function getChannel( value ) {
19920
20185
 
19921
- if ( value === 1 ) return 'uv1';
19922
- if ( value === 2 ) return 'uv2';
19923
- if ( value === 3 ) return 'uv3';
20186
+ if ( value === 0 ) return 'uv';
19924
20187
 
19925
- return 'uv';
20188
+ return `uv${ value }`;
19926
20189
 
19927
20190
  }
19928
20191
 
@@ -20004,11 +20267,14 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20004
20267
  const HAS_METALNESSMAP = !! material.metalnessMap;
20005
20268
  const HAS_ROUGHNESSMAP = !! material.roughnessMap;
20006
20269
 
20270
+ const HAS_ANISOTROPY = material.anisotropy > 0;
20007
20271
  const HAS_CLEARCOAT = material.clearcoat > 0;
20008
20272
  const HAS_IRIDESCENCE = material.iridescence > 0;
20009
20273
  const HAS_SHEEN = material.sheen > 0;
20010
20274
  const HAS_TRANSMISSION = material.transmission > 0;
20011
20275
 
20276
+ const HAS_ANISOTROPYMAP = HAS_ANISOTROPY && !! material.anisotropyMap;
20277
+
20012
20278
  const HAS_CLEARCOATMAP = HAS_CLEARCOAT && !! material.clearcoatMap;
20013
20279
  const HAS_CLEARCOAT_NORMALMAP = HAS_CLEARCOAT && !! material.clearcoatNormalMap;
20014
20280
  const HAS_CLEARCOAT_ROUGHNESSMAP = HAS_CLEARCOAT && !! material.clearcoatRoughnessMap;
@@ -20032,6 +20298,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20032
20298
 
20033
20299
  const HAS_ALPHATEST = material.alphaTest > 0;
20034
20300
 
20301
+ const HAS_ALPHAHASH = !! material.alphaHash;
20302
+
20035
20303
  const HAS_EXTENSIONS = !! material.extensions;
20036
20304
 
20037
20305
  const HAS_ATTRIBUTE_UV1 = !! geometry.attributes.uv1;
@@ -20043,7 +20311,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20043
20311
  isWebGL2: IS_WEBGL2,
20044
20312
 
20045
20313
  shaderID: shaderID,
20046
- shaderName: material.type,
20314
+ shaderType: material.type,
20315
+ shaderName: material.name,
20047
20316
 
20048
20317
  vertexShader: vertexShader,
20049
20318
  fragmentShader: fragmentShader,
@@ -20081,6 +20350,9 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20081
20350
  metalnessMap: HAS_METALNESSMAP,
20082
20351
  roughnessMap: HAS_ROUGHNESSMAP,
20083
20352
 
20353
+ anisotropy: HAS_ANISOTROPY,
20354
+ anisotropyMap: HAS_ANISOTROPYMAP,
20355
+
20084
20356
  clearcoat: HAS_CLEARCOAT,
20085
20357
  clearcoatMap: HAS_CLEARCOATMAP,
20086
20358
  clearcoatNormalMap: HAS_CLEARCOAT_NORMALMAP,
@@ -20108,6 +20380,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20108
20380
 
20109
20381
  alphaMap: HAS_ALPHAMAP,
20110
20382
  alphaTest: HAS_ALPHATEST,
20383
+ alphaHash: HAS_ALPHAHASH,
20111
20384
 
20112
20385
  combine: material.combine,
20113
20386
 
@@ -20124,6 +20397,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20124
20397
  metalnessMapUv: HAS_METALNESSMAP && getChannel( material.metalnessMap.channel ),
20125
20398
  roughnessMapUv: HAS_ROUGHNESSMAP && getChannel( material.roughnessMap.channel ),
20126
20399
 
20400
+ anisotropyMapUv: HAS_ANISOTROPYMAP && getChannel( material.anisotropyMap.channel ),
20401
+
20127
20402
  clearcoatMapUv: HAS_CLEARCOATMAP && getChannel( material.clearcoatMap.channel ),
20128
20403
  clearcoatNormalMapUv: HAS_CLEARCOAT_NORMALMAP && getChannel( material.clearcoatNormalMap.channel ),
20129
20404
  clearcoatRoughnessMapUv: HAS_CLEARCOAT_ROUGHNESSMAP && getChannel( material.clearcoatRoughnessMap.channel ),
@@ -20145,7 +20420,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20145
20420
 
20146
20421
  //
20147
20422
 
20148
- vertexTangents: HAS_NORMALMAP && !! geometry.attributes.tangent,
20423
+ vertexTangents: !! geometry.attributes.tangent && ( HAS_NORMALMAP || HAS_ANISOTROPY ),
20149
20424
  vertexColors: material.vertexColors,
20150
20425
  vertexAlphas: material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4,
20151
20426
  vertexUv1s: HAS_ATTRIBUTE_UV1,
@@ -20277,6 +20552,7 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20277
20552
  array.push( parameters.emissiveMapUv );
20278
20553
  array.push( parameters.metalnessMapUv );
20279
20554
  array.push( parameters.roughnessMapUv );
20555
+ array.push( parameters.anisotropyMapUv );
20280
20556
  array.push( parameters.clearcoatMapUv );
20281
20557
  array.push( parameters.clearcoatNormalMapUv );
20282
20558
  array.push( parameters.clearcoatRoughnessMapUv );
@@ -20350,6 +20626,8 @@ function WebGLPrograms( renderer, cubemaps, cubeuvmaps, extensions, capabilities
20350
20626
  _programLayers.enable( 15 );
20351
20627
  if ( parameters.vertexTangents )
20352
20628
  _programLayers.enable( 16 );
20629
+ if ( parameters.anisotropy )
20630
+ _programLayers.enable( 17 );
20353
20631
 
20354
20632
  array.push( _programLayers.mask );
20355
20633
  _programLayers.disableAll();
@@ -23730,6 +24008,17 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
23730
24008
  [ LinearMipmapLinearFilter ]: _gl.LINEAR_MIPMAP_LINEAR
23731
24009
  };
23732
24010
 
24011
+ const compareToGL = {
24012
+ [ NeverCompare ]: _gl.NEVER,
24013
+ [ AlwaysCompare ]: _gl.ALWAYS,
24014
+ [ LessCompare ]: _gl.LESS,
24015
+ [ LessEqualCompare ]: _gl.LEQUAL,
24016
+ [ EqualCompare ]: _gl.EQUAL,
24017
+ [ GreaterEqualCompare ]: _gl.GEQUAL,
24018
+ [ GreaterCompare ]: _gl.GREATER,
24019
+ [ NotEqualCompare ]: _gl.NOTEQUAL
24020
+ };
24021
+
23733
24022
  function setTextureParameters( textureType, texture, supportsMips ) {
23734
24023
 
23735
24024
  if ( supportsMips ) {
@@ -23774,6 +24063,13 @@ function WebGLTextures( _gl, extensions, state, properties, capabilities, utils,
23774
24063
 
23775
24064
  }
23776
24065
 
24066
+ if ( texture.compareFunction ) {
24067
+
24068
+ _gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_MODE, _gl.COMPARE_REF_TO_TEXTURE );
24069
+ _gl.texParameteri( textureType, _gl.TEXTURE_COMPARE_FUNC, compareToGL[ texture.compareFunction ] );
24070
+
24071
+ }
24072
+
23777
24073
  if ( extensions.has( 'EXT_texture_filter_anisotropic' ) === true ) {
23778
24074
 
23779
24075
  const extension = extensions.get( 'EXT_texture_filter_anisotropic' );
@@ -25507,6 +25803,7 @@ class ArrayCamera extends PerspectiveCamera {
25507
25803
  * @author mrdoob / http://mrdoob.com/
25508
25804
  */
25509
25805
 
25806
+
25510
25807
  var cameraLPos = new Vector3();
25511
25808
  var cameraRPos = new Vector3();
25512
25809
 
@@ -25569,6 +25866,7 @@ function setProjectionFromUnion( camera, cameraL, cameraR ) {
25569
25866
  * @author mrdoob / http://mrdoob.com/
25570
25867
  */
25571
25868
 
25869
+
25572
25870
  function WebVRManager( renderer ) {
25573
25871
 
25574
25872
  var renderWidth, renderHeight;
@@ -25980,6 +26278,18 @@ function WebVRManager( renderer ) {
25980
26278
 
25981
26279
  };
25982
26280
 
26281
+ // Dummy getEnvironmentBlendMode to have the same API as WebXR
26282
+
26283
+ this.getEnvironmentBlendMode = function () {
26284
+
26285
+ if ( scope.isPresenting ) {
26286
+
26287
+ return 'opaque';
26288
+
26289
+ }
26290
+
26291
+ };
26292
+
25983
26293
  //
25984
26294
 
25985
26295
  this.getStandingMatrix = function () {
@@ -26400,8 +26710,30 @@ class DepthTexture extends Texture {
26400
26710
  this.flipY = false;
26401
26711
  this.generateMipmaps = false;
26402
26712
 
26713
+ this.compareFunction = null;
26714
+
26715
+ }
26716
+
26717
+
26718
+ copy( source ) {
26719
+
26720
+ super.copy( source );
26721
+
26722
+ this.compareFunction = source.compareFunction;
26723
+
26724
+ return this;
26725
+
26403
26726
  }
26404
26727
 
26728
+ toJSON( meta ) {
26729
+
26730
+ const data = super.toJSON( meta );
26731
+
26732
+ if ( this.compareFunction !== null ) data.compareFunction = this.compareFunction;
26733
+
26734
+ return data;
26735
+
26736
+ }
26405
26737
 
26406
26738
  }
26407
26739
 
@@ -26438,9 +26770,6 @@ class WebXRManager extends EventDispatcher {
26438
26770
  const controllers = [];
26439
26771
  const controllerInputSources = [];
26440
26772
 
26441
- const planes = new Set();
26442
- const planesLastChangedTimes = new Map();
26443
-
26444
26773
  //
26445
26774
 
26446
26775
  const cameraL = new PerspectiveCamera();
@@ -26453,9 +26782,9 @@ class WebXRManager extends EventDispatcher {
26453
26782
 
26454
26783
  const cameras = [ cameraL, cameraR ];
26455
26784
 
26456
- const cameraVR = new ArrayCamera();
26457
- cameraVR.layers.enable( 1 );
26458
- cameraVR.layers.enable( 2 );
26785
+ const cameraXR = new ArrayCamera();
26786
+ cameraXR.layers.enable( 1 );
26787
+ cameraXR.layers.enable( 2 );
26459
26788
 
26460
26789
  let _currentDepthNear = null;
26461
26790
  let _currentDepthFar = null;
@@ -26940,28 +27269,28 @@ class WebXRManager extends EventDispatcher {
26940
27269
 
26941
27270
  if ( session === null ) return;
26942
27271
 
26943
- cameraVR.near = cameraR.near = cameraL.near = camera.near;
26944
- cameraVR.far = cameraR.far = cameraL.far = camera.far;
27272
+ cameraXR.near = cameraR.near = cameraL.near = camera.near;
27273
+ cameraXR.far = cameraR.far = cameraL.far = camera.far;
26945
27274
 
26946
- if ( _currentDepthNear !== cameraVR.near || _currentDepthFar !== cameraVR.far ) {
27275
+ if ( _currentDepthNear !== cameraXR.near || _currentDepthFar !== cameraXR.far ) {
26947
27276
 
26948
27277
  // Note that the new renderState won't apply until the next frame. See #18320
26949
27278
 
26950
27279
  session.updateRenderState( {
26951
- depthNear: cameraVR.near,
26952
- depthFar: cameraVR.far
27280
+ depthNear: cameraXR.near,
27281
+ depthFar: cameraXR.far
26953
27282
  } );
26954
27283
 
26955
- _currentDepthNear = cameraVR.near;
26956
- _currentDepthFar = cameraVR.far;
27284
+ _currentDepthNear = cameraXR.near;
27285
+ _currentDepthFar = cameraXR.far;
26957
27286
 
26958
27287
  }
26959
27288
 
26960
- const cameras = cameraVR.cameras;
27289
+ const cameras = cameraXR.cameras;
26961
27290
  var object = poseTarget || camera;
26962
27291
  const parent = object.parent;
26963
27292
 
26964
- updateCamera( cameraVR, parent );
27293
+ updateCamera( cameraXR, parent );
26965
27294
 
26966
27295
  for ( let i = 0; i < cameras.length; i ++ ) {
26967
27296
 
@@ -26973,39 +27302,41 @@ class WebXRManager extends EventDispatcher {
26973
27302
 
26974
27303
  if ( cameras.length === 2 ) {
26975
27304
 
26976
- setProjectionFromUnion( cameraVR, cameraL, cameraR );
27305
+ setProjectionFromUnion( cameraXR, cameraL, cameraR );
26977
27306
 
26978
27307
  } else {
26979
27308
 
26980
27309
  // assume single camera setup (AR)
26981
27310
 
26982
- cameraVR.projectionMatrix.copy( cameraL.projectionMatrix );
27311
+ cameraXR.projectionMatrix.copy( cameraL.projectionMatrix );
26983
27312
 
26984
27313
  }
26985
27314
 
26986
- // update user camera and its children
26987
- updateUserCamera( camera, cameraVR, object );
27315
+ updateUserCamera( camera, cameraXR, object );
26988
27316
 
26989
27317
  };
26990
27318
 
26991
- function updateUserCamera( camera, cameraVR, object ) {
27319
+ function updateUserCamera( camera, cameraXR, object ) {
26992
27320
 
26993
- cameraVR.matrixWorld.decompose( cameraVR.position, cameraVR.quaternion, cameraVR.scale );
27321
+ cameraXR.matrixWorld.decompose( cameraXR.position, cameraXR.quaternion, cameraXR.scale );
26994
27322
 
26995
- object.matrixWorld.copy( cameraVR.matrixWorld );
26996
- object.matrix.copy( cameraVR.matrix );
26997
- object.matrix.decompose( object.position, object.quaternion, object.scale );
27323
+ if ( object.parent === null ) {
26998
27324
 
26999
- const children = object.children;
27325
+ object.matrix.copy( cameraXR.matrixWorld );
27000
27326
 
27001
- for ( let i = 0, l = children.length; i < l; i ++ ) {
27327
+ } else {
27002
27328
 
27003
- children[ i ].updateMatrixWorld( true );
27329
+ object.matrix.copy( object.parent.matrixWorld );
27330
+ object.matrix.invert();
27331
+ object.matrix.multiply( cameraXR.matrixWorld );
27004
27332
 
27005
27333
  }
27006
27334
 
27007
- camera.projectionMatrix.copy( cameraVR.projectionMatrix );
27008
- camera.projectionMatrixInverse.copy( cameraVR.projectionMatrixInverse );
27335
+ object.matrix.decompose( object.position, object.quaternion, object.scale );
27336
+ object.updateMatrixWorld( true );
27337
+
27338
+ camera.projectionMatrix.copy( cameraXR.projectionMatrix );
27339
+ camera.projectionMatrixInverse.copy( cameraXR.projectionMatrixInverse );
27009
27340
 
27010
27341
  if ( camera.isPerspectiveCamera ) {
27011
27342
 
@@ -27018,7 +27349,7 @@ class WebXRManager extends EventDispatcher {
27018
27349
 
27019
27350
  this.getCamera = function () {
27020
27351
 
27021
- return cameraVR;
27352
+ return cameraXR;
27022
27353
 
27023
27354
  };
27024
27355
 
@@ -27055,12 +27386,6 @@ class WebXRManager extends EventDispatcher {
27055
27386
 
27056
27387
  };
27057
27388
 
27058
- this.getPlanes = function () {
27059
-
27060
- return planes;
27061
-
27062
- };
27063
-
27064
27389
  // Animation Loop
27065
27390
 
27066
27391
  let onAnimationFrameCallback = null;
@@ -27081,14 +27406,14 @@ class WebXRManager extends EventDispatcher {
27081
27406
 
27082
27407
  }
27083
27408
 
27084
- let cameraVRNeedsUpdate = false;
27409
+ let cameraXRNeedsUpdate = false;
27085
27410
 
27086
- // check if it's necessary to rebuild cameraVR's camera list
27411
+ // check if it's necessary to rebuild cameraXR's camera list
27087
27412
 
27088
- if ( views.length !== cameraVR.cameras.length ) {
27413
+ if ( views.length !== cameraXR.cameras.length ) {
27089
27414
 
27090
- cameraVR.cameras.length = 0;
27091
- cameraVRNeedsUpdate = true;
27415
+ cameraXR.cameras.length = 0;
27416
+ cameraXRNeedsUpdate = true;
27092
27417
 
27093
27418
  }
27094
27419
 
@@ -27140,14 +27465,14 @@ class WebXRManager extends EventDispatcher {
27140
27465
 
27141
27466
  if ( i === 0 ) {
27142
27467
 
27143
- cameraVR.matrix.copy( camera.matrix );
27144
- cameraVR.matrix.decompose( cameraVR.position, cameraVR.quaternion, cameraVR.scale );
27468
+ cameraXR.matrix.copy( camera.matrix );
27469
+ cameraXR.matrix.decompose( cameraXR.position, cameraXR.quaternion, cameraXR.scale );
27145
27470
 
27146
27471
  }
27147
27472
 
27148
- if ( cameraVRNeedsUpdate === true ) {
27473
+ if ( cameraXRNeedsUpdate === true ) {
27149
27474
 
27150
- cameraVR.cameras.push( camera );
27475
+ cameraXR.cameras.push( camera );
27151
27476
 
27152
27477
  }
27153
27478
 
@@ -27174,60 +27499,7 @@ class WebXRManager extends EventDispatcher {
27174
27499
 
27175
27500
  if ( frame.detectedPlanes ) {
27176
27501
 
27177
- scope.dispatchEvent( { type: 'planesdetected', data: frame.detectedPlanes } );
27178
-
27179
- let planesToRemove = null;
27180
-
27181
- for ( const plane of planes ) {
27182
-
27183
- if ( ! frame.detectedPlanes.has( plane ) ) {
27184
-
27185
- if ( planesToRemove === null ) {
27186
-
27187
- planesToRemove = [];
27188
-
27189
- }
27190
-
27191
- planesToRemove.push( plane );
27192
-
27193
- }
27194
-
27195
- }
27196
-
27197
- if ( planesToRemove !== null ) {
27198
-
27199
- for ( const plane of planesToRemove ) {
27200
-
27201
- planes.delete( plane );
27202
- planesLastChangedTimes.delete( plane );
27203
- scope.dispatchEvent( { type: 'planeremoved', data: plane } );
27204
-
27205
- }
27206
-
27207
- }
27208
-
27209
- for ( const plane of frame.detectedPlanes ) {
27210
-
27211
- if ( ! planes.has( plane ) ) {
27212
-
27213
- planes.add( plane );
27214
- planesLastChangedTimes.set( plane, frame.lastChangedTime );
27215
- scope.dispatchEvent( { type: 'planeadded', data: plane } );
27216
-
27217
- } else {
27218
-
27219
- const lastKnownTime = planesLastChangedTimes.get( plane );
27220
-
27221
- if ( plane.lastChangedTime > lastKnownTime ) {
27222
-
27223
- planesLastChangedTimes.set( plane, plane.lastChangedTime );
27224
- scope.dispatchEvent( { type: 'planechanged', data: plane } );
27225
-
27226
- }
27227
-
27228
- }
27229
-
27230
- }
27502
+ scope.dispatchEvent( { type: 'planesdetected', data: frame } );
27231
27503
 
27232
27504
  }
27233
27505
 
@@ -27539,6 +27811,8 @@ function WebGLMaterials( renderer, properties ) {
27539
27811
 
27540
27812
  uniforms.alphaMap.value = material.alphaMap;
27541
27813
 
27814
+ refreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );
27815
+
27542
27816
  }
27543
27817
 
27544
27818
  if ( material.alphaTest > 0 ) {
@@ -27567,6 +27841,8 @@ function WebGLMaterials( renderer, properties ) {
27567
27841
 
27568
27842
  uniforms.alphaMap.value = material.alphaMap;
27569
27843
 
27844
+ refreshTransformUniform( material.alphaMap, uniforms.alphaMapTransform );
27845
+
27570
27846
  }
27571
27847
 
27572
27848
  if ( material.alphaTest > 0 ) {
@@ -27748,6 +28024,20 @@ function WebGLMaterials( renderer, properties ) {
27748
28024
 
27749
28025
  }
27750
28026
 
28027
+ if ( material.anisotropy > 0 ) {
28028
+
28029
+ uniforms.anisotropyVector.value.set( material.anisotropy * Math.cos( material.anisotropyRotation ), material.anisotropy * Math.sin( material.anisotropyRotation ) );
28030
+
28031
+ if ( material.anisotropyMap ) {
28032
+
28033
+ uniforms.anisotropyMap.value = material.anisotropyMap;
28034
+
28035
+ refreshTransformUniform( material.anisotropyMap, uniforms.anisotropyMapTransform );
28036
+
28037
+ }
28038
+
28039
+ }
28040
+
27751
28041
  uniforms.specularIntensity.value = material.specularIntensity;
27752
28042
  uniforms.specularColor.value.copy( material.specularColor );
27753
28043
 
@@ -28246,6 +28536,9 @@ class WebGLRenderer {
28246
28536
 
28247
28537
  }
28248
28538
 
28539
+ const uintClearColor = new Uint32Array( 4 );
28540
+ const intClearColor = new Int32Array( 4 );
28541
+
28249
28542
  let currentRenderList = null;
28250
28543
  let currentRenderState = null;
28251
28544
 
@@ -28322,6 +28615,9 @@ class WebGLRenderer {
28322
28615
  const _currentScissor = new Vector4();
28323
28616
  let _currentScissorTest = null;
28324
28617
 
28618
+ const _currentClearColor = new Color( 0x000000 );
28619
+ let _currentClearAlpha = 0;
28620
+
28325
28621
  //
28326
28622
 
28327
28623
  let _width = canvas.width;
@@ -28352,6 +28648,7 @@ class WebGLRenderer {
28352
28648
 
28353
28649
  const _projScreenMatrix = new Matrix4();
28354
28650
 
28651
+ const _vector2 = new Vector2();
28355
28652
  const _vector3 = new Vector3();
28356
28653
 
28357
28654
  const _emptyScene = { background: null, fog: null, environment: null, overrideMaterial: null, isScene: true };
@@ -28429,6 +28726,12 @@ class WebGLRenderer {
28429
28726
 
28430
28727
  }
28431
28728
 
28729
+ if ( typeof WebGLRenderingContext !== 'undefined' && _gl instanceof WebGLRenderingContext ) { // @deprecated, r153
28730
+
28731
+ console.warn( 'THREE.WebGLRenderer: WebGL 1 support was deprecated in r153 and will be removed in r163.' );
28732
+
28733
+ }
28734
+
28432
28735
  // Some experimental-webgl implementations do not have getShaderPrecisionFormat
28433
28736
 
28434
28737
  if ( _gl.getShaderPrecisionFormat === undefined ) {
@@ -28710,7 +29013,63 @@ class WebGLRenderer {
28710
29013
 
28711
29014
  let bits = 0;
28712
29015
 
28713
- if ( color ) bits |= _gl.COLOR_BUFFER_BIT;
29016
+ if ( color ) {
29017
+
29018
+ // check if we're trying to clear an integer target
29019
+ let isIntegerFormat = false;
29020
+ if ( _currentRenderTarget !== null ) {
29021
+
29022
+ const targetFormat = _currentRenderTarget.texture.format;
29023
+ isIntegerFormat = targetFormat === RGBAIntegerFormat ||
29024
+ targetFormat === RGIntegerFormat ||
29025
+ targetFormat === RedIntegerFormat;
29026
+
29027
+ }
29028
+
29029
+ // use the appropriate clear functions to clear the target if it's a signed
29030
+ // or unsigned integer target
29031
+ if ( isIntegerFormat ) {
29032
+
29033
+ const targetType = _currentRenderTarget.texture.type;
29034
+ const isUnsignedType = targetType === UnsignedByteType ||
29035
+ targetType === UnsignedIntType ||
29036
+ targetType === UnsignedShortType ||
29037
+ targetType === UnsignedInt248Type ||
29038
+ targetType === UnsignedShort4444Type ||
29039
+ targetType === UnsignedShort5551Type;
29040
+
29041
+ const clearColor = background.getClearColor();
29042
+ const a = background.getClearAlpha();
29043
+ const r = clearColor.r;
29044
+ const g = clearColor.g;
29045
+ const b = clearColor.b;
29046
+
29047
+ if ( isUnsignedType ) {
29048
+
29049
+ uintClearColor[ 0 ] = r;
29050
+ uintClearColor[ 1 ] = g;
29051
+ uintClearColor[ 2 ] = b;
29052
+ uintClearColor[ 3 ] = a;
29053
+ _gl.clearBufferuiv( _gl.COLOR, 0, uintClearColor );
29054
+
29055
+ } else {
29056
+
29057
+ intClearColor[ 0 ] = r;
29058
+ intClearColor[ 1 ] = g;
29059
+ intClearColor[ 2 ] = b;
29060
+ intClearColor[ 3 ] = a;
29061
+ _gl.clearBufferiv( _gl.COLOR, 0, intClearColor );
29062
+
29063
+ }
29064
+
29065
+ } else {
29066
+
29067
+ bits |= _gl.COLOR_BUFFER_BIT;
29068
+
29069
+ }
29070
+
29071
+ }
29072
+
28714
29073
  if ( depth ) bits |= _gl.DEPTH_BUFFER_BIT;
28715
29074
  if ( stencil ) bits |= _gl.STENCIL_BUFFER_BIT;
28716
29075
 
@@ -29169,6 +29528,8 @@ class WebGLRenderer {
29169
29528
 
29170
29529
  //
29171
29530
 
29531
+ this.info.render.frame ++;
29532
+
29172
29533
  if ( _clippingEnabled === true ) clipping.beginShadows();
29173
29534
 
29174
29535
  const shadowsArray = currentRenderState.state.shadowsArray;
@@ -29181,6 +29542,7 @@ class WebGLRenderer {
29181
29542
 
29182
29543
  if ( this.info.autoReset === true ) this.info.reset();
29183
29544
 
29545
+
29184
29546
  //
29185
29547
 
29186
29548
  background.render( currentRenderList, scene );
@@ -29314,28 +29676,24 @@ class WebGLRenderer {
29314
29676
 
29315
29677
  if ( ! object.frustumCulled || _frustum.intersectsObject( object ) ) {
29316
29678
 
29317
- if ( object.isSkinnedMesh ) {
29318
-
29319
- // update skeleton only once in a frame
29320
-
29321
- if ( object.skeleton.frame !== info.render.frame ) {
29679
+ const geometry = objects.update( object );
29680
+ const material = object.material;
29322
29681
 
29323
- object.skeleton.update();
29324
- object.skeleton.frame = info.render.frame;
29682
+ if ( sortObjects ) {
29325
29683
 
29326
- }
29684
+ if ( object.boundingSphere !== undefined ) {
29327
29685
 
29328
- }
29686
+ if ( object.boundingSphere === null ) object.computeBoundingSphere();
29687
+ _vector3.copy( object.boundingSphere.center );
29329
29688
 
29330
- const geometry = objects.update( object );
29331
- const material = object.material;
29689
+ } else {
29332
29690
 
29333
- if ( sortObjects ) {
29691
+ if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
29692
+ _vector3.copy( geometry.boundingSphere.center );
29334
29693
 
29335
- if ( geometry.boundingSphere === null ) geometry.computeBoundingSphere();
29694
+ }
29336
29695
 
29337
29696
  _vector3
29338
- .copy( geometry.boundingSphere.center )
29339
29697
  .applyMatrix4( object.matrixWorld )
29340
29698
  .applyMatrix4( _projScreenMatrix );
29341
29699
 
@@ -29410,15 +29768,15 @@ class WebGLRenderer {
29410
29768
 
29411
29769
  function renderTransmissionPass( opaqueObjects, transmissiveObjects, scene, camera ) {
29412
29770
 
29413
- if ( _transmissionRenderTarget === null ) {
29771
+ const isWebGL2 = capabilities.isWebGL2;
29414
29772
 
29415
- const isWebGL2 = capabilities.isWebGL2;
29773
+ if ( _transmissionRenderTarget === null ) {
29416
29774
 
29417
- _transmissionRenderTarget = new WebGLRenderTarget( 1024, 1024, {
29775
+ _transmissionRenderTarget = new WebGLRenderTarget( 1, 1, {
29418
29776
  generateMipmaps: true,
29419
29777
  type: extensions.has( 'EXT_color_buffer_half_float' ) ? HalfFloatType : UnsignedByteType,
29420
29778
  minFilter: LinearMipmapLinearFilter,
29421
- samples: ( isWebGL2 && antialias === true ) ? 4 : 0
29779
+ samples: ( isWebGL2 ) ? 4 : 0
29422
29780
  } );
29423
29781
 
29424
29782
  // debug
@@ -29433,10 +29791,27 @@ class WebGLRenderer {
29433
29791
 
29434
29792
  }
29435
29793
 
29794
+ _this.getDrawingBufferSize( _vector2 );
29795
+
29796
+ if ( isWebGL2 ) {
29797
+
29798
+ _transmissionRenderTarget.setSize( _vector2.x, _vector2.y );
29799
+
29800
+ } else {
29801
+
29802
+ _transmissionRenderTarget.setSize( floorPowerOfTwo( _vector2.x ), floorPowerOfTwo( _vector2.y ) );
29803
+
29804
+ }
29805
+
29436
29806
  //
29437
29807
 
29438
29808
  const currentRenderTarget = _this.getRenderTarget();
29439
29809
  _this.setRenderTarget( _transmissionRenderTarget );
29810
+
29811
+ _this.getClearColor( _currentClearColor );
29812
+ _currentClearAlpha = _this.getClearAlpha();
29813
+ if ( _currentClearAlpha < 1 ) _this.setClearColor( 0xffffff, 0.5 );
29814
+
29440
29815
  _this.clear();
29441
29816
 
29442
29817
  // Turn off the features which can affect the frag color for opaque objects pass.
@@ -29487,6 +29862,8 @@ class WebGLRenderer {
29487
29862
 
29488
29863
  _this.setRenderTarget( currentRenderTarget );
29489
29864
 
29865
+ _this.setClearColor( _currentClearColor, _currentClearAlpha );
29866
+
29490
29867
  _this.toneMapping = currentToneMapping;
29491
29868
 
29492
29869
  }
@@ -29690,7 +30067,7 @@ class WebGLRenderer {
29690
30067
  const colorSpace = ( _currentRenderTarget === null ) ? _this.outputColorSpace : ( _currentRenderTarget.isXRRenderTarget === true ? _currentRenderTarget.texture.colorSpace : LinearSRGBColorSpace );
29691
30068
  const envMap = ( material.isMeshStandardMaterial ? cubeuvmaps : cubemaps ).get( material.envMap || environment );
29692
30069
  const vertexAlphas = material.vertexColors === true && !! geometry.attributes.color && geometry.attributes.color.itemSize === 4;
29693
- const vertexTangents = !! material.normalMap && !! geometry.attributes.tangent;
30070
+ const vertexTangents = !! geometry.attributes.tangent && ( !! material.normalMap || material.anisotropy > 0 );
29694
30071
  const morphTargets = !! geometry.morphAttributes.position;
29695
30072
  const morphNormals = !! geometry.morphAttributes.normal;
29696
30073
  const morphColors = !! geometry.morphAttributes.color;
@@ -30490,6 +30867,12 @@ class WebGLRenderer {
30490
30867
 
30491
30868
  }
30492
30869
 
30870
+ get coordinateSystem() {
30871
+
30872
+ return WebGLCoordinateSystem;
30873
+
30874
+ }
30875
+
30493
30876
  get physicallyCorrectLights() { // @deprecated, r150
30494
30877
 
30495
30878
  console.warn( 'THREE.WebGLRenderer: the property .physicallyCorrectLights has been removed. Set renderer.useLegacyLights instead.' );
@@ -30647,20 +31030,6 @@ class Scene extends Object3D {
30647
31030
 
30648
31031
  }
30649
31032
 
30650
- get autoUpdate() { // @deprecated, r144
30651
-
30652
- console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' );
30653
- return this.matrixWorldAutoUpdate;
30654
-
30655
- }
30656
-
30657
- set autoUpdate( value ) { // @deprecated, r144
30658
-
30659
- console.warn( 'THREE.Scene: autoUpdate was renamed to matrixWorldAutoUpdate in r144.' );
30660
- this.matrixWorldAutoUpdate = value;
30661
-
30662
- }
30663
-
30664
31033
  }
30665
31034
 
30666
31035
  class InterleavedBuffer {
@@ -31567,7 +31936,9 @@ const _vector3 = /*@__PURE__*/ new Vector3();
31567
31936
  const _matrix4 = /*@__PURE__*/ new Matrix4();
31568
31937
  const _vertex = /*@__PURE__*/ new Vector3();
31569
31938
 
31570
-
31939
+ const _sphere$3 = /*@__PURE__*/ new Sphere();
31940
+ const _inverseMatrix$2 = /*@__PURE__*/ new Matrix4();
31941
+ const _ray$2 = /*@__PURE__*/ new Ray();
31571
31942
 
31572
31943
  class SkinnedMesh extends Mesh {
31573
31944
 
@@ -31646,22 +32017,47 @@ class SkinnedMesh extends Mesh {
31646
32017
 
31647
32018
  this.skeleton = source.skeleton;
31648
32019
 
32020
+ if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
32021
+ if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
32022
+
31649
32023
  return this;
31650
32024
 
31651
32025
  }
31652
32026
 
31653
- // raycast( raycaster, intersects ) {
32027
+ raycast( raycaster, intersects ) {
31654
32028
 
31655
- // if ( this.boundingSphere === null ) this.computeBoundingSphere();
32029
+ const material = this.material;
32030
+ const matrixWorld = this.matrixWorld;
32031
+
32032
+ if ( material === undefined ) return;
32033
+
32034
+ // test with bounding sphere in world space
32035
+
32036
+ if ( this.boundingSphere === null ) this.computeBoundingSphere();
32037
+
32038
+ _sphere$3.copy( this.boundingSphere );
32039
+ _sphere$3.applyMatrix4( matrixWorld );
32040
+
32041
+ if ( raycaster.ray.intersectsSphere( _sphere$3 ) === false ) return;
32042
+
32043
+ // convert ray to local space of skinned mesh
31656
32044
 
31657
- // _sphere.copy( this.boundingSphere );
31658
- // _sphere.applyMatrix4( this.matrixWorld );
32045
+ _inverseMatrix$2.copy( matrixWorld ).invert();
32046
+ _ray$2.copy( raycaster.ray ).applyMatrix4( _inverseMatrix$2 );
32047
+
32048
+ // test with bounding box in local space
32049
+
32050
+ if ( this.boundingBox !== null ) {
31659
32051
 
31660
- // if ( raycaster.ray.intersectsSphere( _sphere ) === false ) return;
32052
+ if ( _ray$2.intersectsBox( this.boundingBox ) === false ) return;
31661
32053
 
31662
- // this._computeIntersections( raycaster, intersects );
32054
+ }
32055
+
32056
+ // test for intersections with geometry
31663
32057
 
31664
- // }
32058
+ this._computeIntersections( raycaster, intersects, _ray$2 );
32059
+
32060
+ }
31665
32061
 
31666
32062
  getVertexPosition( index, target ) {
31667
32063
 
@@ -31836,8 +32232,6 @@ class Skeleton {
31836
32232
  this.boneTexture = null;
31837
32233
  this.boneTextureSize = 0;
31838
32234
 
31839
- this.frame = - 1;
31840
-
31841
32235
  this.init();
31842
32236
 
31843
32237
  }
@@ -32062,7 +32456,7 @@ class Skeleton {
32062
32456
 
32063
32457
  const data = {
32064
32458
  metadata: {
32065
- version: 4.5,
32459
+ version: 4.6,
32066
32460
  type: 'Skeleton',
32067
32461
  generator: 'Skeleton.toJSON'
32068
32462
  },
@@ -32233,6 +32627,9 @@ class InstancedMesh extends Mesh {
32233
32627
 
32234
32628
  this.count = source.count;
32235
32629
 
32630
+ if ( source.boundingBox !== null ) this.boundingBox = source.boundingBox.clone();
32631
+ if ( source.boundingSphere !== null ) this.boundingSphere = source.boundingSphere.clone();
32632
+
32236
32633
  return this;
32237
32634
 
32238
32635
  }
@@ -32908,14 +33305,12 @@ class VideoTexture extends Texture {
32908
33305
 
32909
33306
  class FramebufferTexture extends Texture {
32910
33307
 
32911
- constructor( width, height, format ) {
33308
+ constructor( width, height ) {
32912
33309
 
32913
33310
  super( { width, height } );
32914
33311
 
32915
33312
  this.isFramebufferTexture = true;
32916
33313
 
32917
- this.format = format;
32918
-
32919
33314
  this.magFilter = NearestFilter;
32920
33315
  this.minFilter = NearestFilter;
32921
33316
 
@@ -33366,7 +33761,7 @@ class Curve {
33366
33761
 
33367
33762
  const data = {
33368
33763
  metadata: {
33369
- version: 4.5,
33764
+ version: 4.6,
33370
33765
  type: 'Curve',
33371
33766
  generator: 'Curve.toJSON'
33372
33767
  }
@@ -37008,6 +37403,7 @@ function addContour( vertices, contour ) {
37008
37403
  * }
37009
37404
  */
37010
37405
 
37406
+
37011
37407
  class ExtrudeGeometry extends BufferGeometry {
37012
37408
 
37013
37409
  constructor( shapes = new Shape( [ new Vector2( 0.5, 0.5 ), new Vector2( - 0.5, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), options = {} ) {
@@ -39154,6 +39550,9 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
39154
39550
 
39155
39551
  this.type = 'MeshPhysicalMaterial';
39156
39552
 
39553
+ this.anisotropyRotation = 0;
39554
+ this.anisotropyMap = null;
39555
+
39157
39556
  this.clearcoatMap = null;
39158
39557
  this.clearcoatRoughness = 0.0;
39159
39558
  this.clearcoatRoughnessMap = null;
@@ -39197,30 +39596,31 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
39197
39596
  this.specularColor = new Color( 1, 1, 1 );
39198
39597
  this.specularColorMap = null;
39199
39598
 
39200
- this._sheen = 0.0;
39599
+ this._anisotropy = 0;
39201
39600
  this._clearcoat = 0;
39202
39601
  this._iridescence = 0;
39602
+ this._sheen = 0.0;
39203
39603
  this._transmission = 0;
39204
39604
 
39205
39605
  this.setValues( parameters );
39206
39606
 
39207
39607
  }
39208
39608
 
39209
- get sheen() {
39609
+ get anisotropy() {
39210
39610
 
39211
- return this._sheen;
39611
+ return this._anisotropy;
39212
39612
 
39213
39613
  }
39214
39614
 
39215
- set sheen( value ) {
39615
+ set anisotropy( value ) {
39216
39616
 
39217
- if ( this._sheen > 0 !== value > 0 ) {
39617
+ if ( this._anisotropy > 0 !== value > 0 ) {
39218
39618
 
39219
39619
  this.version ++;
39220
39620
 
39221
39621
  }
39222
39622
 
39223
- this._sheen = value;
39623
+ this._anisotropy = value;
39224
39624
 
39225
39625
  }
39226
39626
 
@@ -39260,6 +39660,24 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
39260
39660
 
39261
39661
  }
39262
39662
 
39663
+ get sheen() {
39664
+
39665
+ return this._sheen;
39666
+
39667
+ }
39668
+
39669
+ set sheen( value ) {
39670
+
39671
+ if ( this._sheen > 0 !== value > 0 ) {
39672
+
39673
+ this.version ++;
39674
+
39675
+ }
39676
+
39677
+ this._sheen = value;
39678
+
39679
+ }
39680
+
39263
39681
  get transmission() {
39264
39682
 
39265
39683
  return this._transmission;
@@ -39289,6 +39707,10 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
39289
39707
 
39290
39708
  };
39291
39709
 
39710
+ this.anisotropy = source.anisotropy;
39711
+ this.anisotropyRotation = source.anisotropyRotation;
39712
+ this.anisotropyMap = source.anisotropyMap;
39713
+
39292
39714
  this.clearcoat = source.clearcoat;
39293
39715
  this.clearcoatMap = source.clearcoatMap;
39294
39716
  this.clearcoatRoughness = source.clearcoatRoughness;
@@ -41868,6 +42290,8 @@ class Loader {
41868
42290
 
41869
42291
  }
41870
42292
 
42293
+ Loader.DEFAULT_MATERIAL_NAME = '__DEFAULT';
42294
+
41871
42295
  const loading = {};
41872
42296
 
41873
42297
  class HttpError extends Error {
@@ -42430,6 +42854,7 @@ class CubeTextureLoader extends Loader {
42430
42854
  load( urls, onLoad, onProgress, onError ) {
42431
42855
 
42432
42856
  const texture = new CubeTexture();
42857
+ texture.colorSpace = SRGBColorSpace;
42433
42858
 
42434
42859
  const loader = new ImageLoader( this.manager );
42435
42860
  loader.setCrossOrigin( this.crossOrigin );
@@ -43573,6 +43998,8 @@ class MaterialLoader extends Loader {
43573
43998
  if ( json.thickness !== undefined ) material.thickness = json.thickness;
43574
43999
  if ( json.attenuationDistance !== undefined ) material.attenuationDistance = json.attenuationDistance;
43575
44000
  if ( json.attenuationColor !== undefined && material.attenuationColor !== undefined ) material.attenuationColor.setHex( json.attenuationColor );
44001
+ if ( json.anisotropy !== undefined ) material.anisotropy = json.anisotropy;
44002
+ if ( json.anisotropyRotation !== undefined ) material.anisotropyRotation = json.anisotropyRotation;
43576
44003
  if ( json.fog !== undefined ) material.fog = json.fog;
43577
44004
  if ( json.flatShading !== undefined ) material.flatShading = json.flatShading;
43578
44005
  if ( json.blending !== undefined ) material.blending = json.blending;
@@ -43582,6 +44009,7 @@ class MaterialLoader extends Loader {
43582
44009
  if ( json.opacity !== undefined ) material.opacity = json.opacity;
43583
44010
  if ( json.transparent !== undefined ) material.transparent = json.transparent;
43584
44011
  if ( json.alphaTest !== undefined ) material.alphaTest = json.alphaTest;
44012
+ if ( json.alphaHash !== undefined ) material.alphaHash = json.alphaHash;
43585
44013
  if ( json.depthTest !== undefined ) material.depthTest = json.depthTest;
43586
44014
  if ( json.depthWrite !== undefined ) material.depthWrite = json.depthWrite;
43587
44015
  if ( json.colorWrite !== undefined ) material.colorWrite = json.colorWrite;
@@ -43776,6 +44204,8 @@ class MaterialLoader extends Loader {
43776
44204
  if ( json.transmissionMap !== undefined ) material.transmissionMap = getTexture( json.transmissionMap );
43777
44205
  if ( json.thicknessMap !== undefined ) material.thicknessMap = getTexture( json.thicknessMap );
43778
44206
 
44207
+ if ( json.anisotropyMap !== undefined ) material.anisotropyMap = getTexture( json.anisotropyMap );
44208
+
43779
44209
  if ( json.sheenColorMap !== undefined ) material.sheenColorMap = getTexture( json.sheenColorMap );
43780
44210
  if ( json.sheenRoughnessMap !== undefined ) material.sheenRoughnessMap = getTexture( json.sheenRoughnessMap );
43781
44211
 
@@ -44763,6 +45193,7 @@ class ObjectLoader extends Loader {
44763
45193
  if ( data.generateMipmaps !== undefined ) texture.generateMipmaps = data.generateMipmaps;
44764
45194
  if ( data.premultiplyAlpha !== undefined ) texture.premultiplyAlpha = data.premultiplyAlpha;
44765
45195
  if ( data.unpackAlignment !== undefined ) texture.unpackAlignment = data.unpackAlignment;
45196
+ if ( data.compareFunction !== undefined ) texture.compareFunction = data.compareFunction;
44766
45197
 
44767
45198
  if ( data.userData !== undefined ) texture.userData = data.userData;
44768
45199
 
@@ -46114,6 +46545,14 @@ class PositionalAudio extends Audio {
46114
46545
 
46115
46546
  }
46116
46547
 
46548
+ connect() {
46549
+
46550
+ super.connect();
46551
+
46552
+ this.panner.connect( this.gain );
46553
+
46554
+ }
46555
+
46117
46556
  disconnect() {
46118
46557
 
46119
46558
  super.disconnect();
@@ -49459,6 +49898,7 @@ function intersectObject( object, raycaster, intersects, recursive ) {
49459
49898
  * The azimuthal angle (theta) is measured from the positive z-axis.
49460
49899
  */
49461
49900
 
49901
+
49462
49902
  class Spherical {
49463
49903
 
49464
49904
  constructor( radius = 1, phi = 0, theta = 0 ) {
@@ -51409,216 +51849,6 @@ class ShapePath {
51409
51849
 
51410
51850
  }
51411
51851
 
51412
- class BoxBufferGeometry extends BoxGeometry { // @deprecated, r144
51413
-
51414
- constructor( width, height, depth, widthSegments, heightSegments, depthSegments ) {
51415
-
51416
- console.warn( 'THREE.BoxBufferGeometry has been renamed to THREE.BoxGeometry.' );
51417
- super( width, height, depth, widthSegments, heightSegments, depthSegments );
51418
-
51419
-
51420
- }
51421
-
51422
- }
51423
-
51424
- class CapsuleBufferGeometry extends CapsuleGeometry { // @deprecated, r144
51425
-
51426
- constructor( radius, length, capSegments, radialSegments ) {
51427
-
51428
- console.warn( 'THREE.CapsuleBufferGeometry has been renamed to THREE.CapsuleGeometry.' );
51429
- super( radius, length, capSegments, radialSegments );
51430
-
51431
- }
51432
-
51433
- }
51434
-
51435
- class CircleBufferGeometry extends CircleGeometry { // @deprecated, r144
51436
-
51437
- constructor( radius, segments, thetaStart, thetaLength ) {
51438
-
51439
- console.warn( 'THREE.CircleBufferGeometry has been renamed to THREE.CircleGeometry.' );
51440
- super( radius, segments, thetaStart, thetaLength );
51441
-
51442
- }
51443
-
51444
- }
51445
-
51446
- class ConeBufferGeometry extends ConeGeometry { // @deprecated, r144
51447
-
51448
- constructor( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {
51449
-
51450
- console.warn( 'THREE.ConeBufferGeometry has been renamed to THREE.ConeGeometry.' );
51451
- super( radius, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );
51452
-
51453
- }
51454
-
51455
- }
51456
-
51457
- class CylinderBufferGeometry extends CylinderGeometry { // @deprecated, r144
51458
-
51459
- constructor( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength ) {
51460
-
51461
- console.warn( 'THREE.CylinderBufferGeometry has been renamed to THREE.CylinderGeometry.' );
51462
- super( radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded, thetaStart, thetaLength );
51463
-
51464
- }
51465
-
51466
- }
51467
-
51468
- class DodecahedronBufferGeometry extends DodecahedronGeometry { // @deprecated, r144
51469
-
51470
- constructor( radius, detail ) {
51471
-
51472
- console.warn( 'THREE.DodecahedronBufferGeometry has been renamed to THREE.DodecahedronGeometry.' );
51473
- super( radius, detail );
51474
-
51475
- }
51476
-
51477
- }
51478
-
51479
- class ExtrudeBufferGeometry extends ExtrudeGeometry { // @deprecated, r144
51480
-
51481
- constructor( shapes, options ) {
51482
-
51483
- console.warn( 'THREE.ExtrudeBufferGeometry has been renamed to THREE.ExtrudeGeometry.' );
51484
- super( shapes, options );
51485
-
51486
- }
51487
-
51488
- }
51489
-
51490
- class IcosahedronBufferGeometry extends IcosahedronGeometry { // @deprecated, r144
51491
-
51492
- constructor( radius, detail ) {
51493
-
51494
- console.warn( 'THREE.IcosahedronBufferGeometry has been renamed to THREE.IcosahedronGeometry.' );
51495
- super( radius, detail );
51496
-
51497
- }
51498
-
51499
- }
51500
-
51501
- class LatheBufferGeometry extends LatheGeometry { // @deprecated, r144
51502
-
51503
- constructor( points, segments, phiStart, phiLength ) {
51504
-
51505
- console.warn( 'THREE.LatheBufferGeometry has been renamed to THREE.LatheGeometry.' );
51506
- super( points, segments, phiStart, phiLength );
51507
-
51508
- }
51509
-
51510
- }
51511
-
51512
- class OctahedronBufferGeometry extends OctahedronGeometry { // @deprecated, r144
51513
-
51514
- constructor( radius, detail ) {
51515
-
51516
- console.warn( 'THREE.OctahedronBufferGeometry has been renamed to THREE.OctahedronGeometry.' );
51517
- super( radius, detail );
51518
-
51519
- }
51520
-
51521
- }
51522
-
51523
- class PlaneBufferGeometry extends PlaneGeometry { // @deprecated, r144
51524
-
51525
- constructor( width, height, widthSegments, heightSegments ) {
51526
-
51527
- console.warn( 'THREE.PlaneBufferGeometry has been renamed to THREE.PlaneGeometry.' );
51528
- super( width, height, widthSegments, heightSegments );
51529
-
51530
- }
51531
-
51532
- }
51533
-
51534
- class PolyhedronBufferGeometry extends PolyhedronGeometry { // @deprecated, r144
51535
-
51536
- constructor( vertices, indices, radius, detail ) {
51537
-
51538
- console.warn( 'THREE.PolyhedronBufferGeometry has been renamed to THREE.PolyhedronGeometry.' );
51539
- super( vertices, indices, radius, detail );
51540
-
51541
- }
51542
-
51543
- }
51544
-
51545
- class RingBufferGeometry extends RingGeometry { // @deprecated, r144
51546
-
51547
- constructor( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength ) {
51548
-
51549
- console.warn( 'THREE.RingBufferGeometry has been renamed to THREE.RingGeometry.' );
51550
- super( innerRadius, outerRadius, thetaSegments, phiSegments, thetaStart, thetaLength );
51551
-
51552
- }
51553
-
51554
- }
51555
-
51556
- class ShapeBufferGeometry extends ShapeGeometry { // @deprecated, r144
51557
-
51558
- constructor( shapes, curveSegments ) {
51559
-
51560
- console.warn( 'THREE.ShapeBufferGeometry has been renamed to THREE.ShapeGeometry.' );
51561
- super( shapes, curveSegments );
51562
-
51563
- }
51564
-
51565
- }
51566
-
51567
- class SphereBufferGeometry extends SphereGeometry { // @deprecated, r144
51568
-
51569
- constructor( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength ) {
51570
-
51571
- console.warn( 'THREE.SphereBufferGeometry has been renamed to THREE.SphereGeometry.' );
51572
- super( radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength );
51573
-
51574
- }
51575
-
51576
- }
51577
-
51578
- class TetrahedronBufferGeometry extends TetrahedronGeometry { // @deprecated, r144
51579
-
51580
- constructor( radius, detail ) {
51581
-
51582
- console.warn( 'THREE.TetrahedronBufferGeometry has been renamed to THREE.TetrahedronGeometry.' );
51583
- super( radius, detail );
51584
-
51585
- }
51586
-
51587
- }
51588
-
51589
- class TorusBufferGeometry extends TorusGeometry { // @deprecated, r144
51590
-
51591
- constructor( radius, tube, radialSegments, tubularSegments, arc ) {
51592
-
51593
- console.warn( 'THREE.TorusBufferGeometry has been renamed to THREE.TorusGeometry.' );
51594
- super( radius, tube, radialSegments, tubularSegments, arc );
51595
-
51596
- }
51597
-
51598
- }
51599
-
51600
- class TorusKnotBufferGeometry extends TorusKnotGeometry { // @deprecated, r144
51601
-
51602
- constructor( radius, tube, tubularSegments, radialSegments, p, q ) {
51603
-
51604
- console.warn( 'THREE.TorusKnotBufferGeometry has been renamed to THREE.TorusKnotGeometry.' );
51605
- super( radius, tube, tubularSegments, radialSegments, p, q );
51606
-
51607
- }
51608
-
51609
- }
51610
-
51611
- class TubeBufferGeometry extends TubeGeometry { // @deprecated, r144
51612
-
51613
- constructor( path, tubularSegments, radius, radialSegments, closed ) {
51614
-
51615
- console.warn( 'THREE.TubeBufferGeometry has been renamed to THREE.TubeGeometry.' );
51616
- super( path, tubularSegments, radius, radialSegments, closed );
51617
-
51618
- }
51619
-
51620
- }
51621
-
51622
51852
  if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
51623
51853
 
51624
51854
  __THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
@@ -51647,6 +51877,7 @@ exports.AddOperation = AddOperation;
51647
51877
  exports.AdditiveAnimationBlendMode = AdditiveAnimationBlendMode;
51648
51878
  exports.AdditiveBlending = AdditiveBlending;
51649
51879
  exports.AlphaFormat = AlphaFormat;
51880
+ exports.AlwaysCompare = AlwaysCompare;
51650
51881
  exports.AlwaysDepth = AlwaysDepth;
51651
51882
  exports.AlwaysStencilFunc = AlwaysStencilFunc;
51652
51883
  exports.AmbientLight = AmbientLight;
@@ -51674,7 +51905,6 @@ exports.BooleanKeyframeTrack = BooleanKeyframeTrack;
51674
51905
  exports.Box2 = Box2;
51675
51906
  exports.Box3 = Box3;
51676
51907
  exports.Box3Helper = Box3Helper;
51677
- exports.BoxBufferGeometry = BoxBufferGeometry;
51678
51908
  exports.BoxGeometry = BoxGeometry;
51679
51909
  exports.BoxHelper = BoxHelper;
51680
51910
  exports.BufferAttribute = BufferAttribute;
@@ -51685,11 +51915,9 @@ exports.Cache = Cache;
51685
51915
  exports.Camera = Camera;
51686
51916
  exports.CameraHelper = CameraHelper;
51687
51917
  exports.CanvasTexture = CanvasTexture;
51688
- exports.CapsuleBufferGeometry = CapsuleBufferGeometry;
51689
51918
  exports.CapsuleGeometry = CapsuleGeometry;
51690
51919
  exports.CatmullRomCurve3 = CatmullRomCurve3;
51691
51920
  exports.CineonToneMapping = CineonToneMapping;
51692
- exports.CircleBufferGeometry = CircleBufferGeometry;
51693
51921
  exports.CircleGeometry = CircleGeometry;
51694
51922
  exports.ClampToEdgeWrapping = ClampToEdgeWrapping;
51695
51923
  exports.Clock = Clock;
@@ -51699,7 +51927,6 @@ exports.ColorManagement = ColorManagement;
51699
51927
  exports.CompressedArrayTexture = CompressedArrayTexture;
51700
51928
  exports.CompressedTexture = CompressedTexture;
51701
51929
  exports.CompressedTextureLoader = CompressedTextureLoader;
51702
- exports.ConeBufferGeometry = ConeBufferGeometry;
51703
51930
  exports.ConeGeometry = ConeGeometry;
51704
51931
  exports.CubeCamera = CubeCamera;
51705
51932
  exports.CubeReflectionMapping = CubeReflectionMapping;
@@ -51718,7 +51945,6 @@ exports.Curve = Curve;
51718
51945
  exports.CurvePath = CurvePath;
51719
51946
  exports.CustomBlending = CustomBlending;
51720
51947
  exports.CustomToneMapping = CustomToneMapping;
51721
- exports.CylinderBufferGeometry = CylinderBufferGeometry;
51722
51948
  exports.CylinderGeometry = CylinderGeometry;
51723
51949
  exports.Cylindrical = Cylindrical;
51724
51950
  exports.Data3DTexture = Data3DTexture;
@@ -51736,7 +51962,6 @@ exports.DirectionalLight = DirectionalLight;
51736
51962
  exports.DirectionalLightHelper = DirectionalLightHelper;
51737
51963
  exports.DiscreteInterpolant = DiscreteInterpolant;
51738
51964
  exports.DisplayP3ColorSpace = DisplayP3ColorSpace;
51739
- exports.DodecahedronBufferGeometry = DodecahedronBufferGeometry;
51740
51965
  exports.DodecahedronGeometry = DodecahedronGeometry;
51741
51966
  exports.DoubleSide = DoubleSide;
51742
51967
  exports.DstAlphaFactor = DstAlphaFactor;
@@ -51746,13 +51971,13 @@ exports.DynamicDrawUsage = DynamicDrawUsage;
51746
51971
  exports.DynamicReadUsage = DynamicReadUsage;
51747
51972
  exports.EdgesGeometry = EdgesGeometry;
51748
51973
  exports.EllipseCurve = EllipseCurve;
51974
+ exports.EqualCompare = EqualCompare;
51749
51975
  exports.EqualDepth = EqualDepth;
51750
51976
  exports.EqualStencilFunc = EqualStencilFunc;
51751
51977
  exports.EquirectangularReflectionMapping = EquirectangularReflectionMapping;
51752
51978
  exports.EquirectangularRefractionMapping = EquirectangularRefractionMapping;
51753
51979
  exports.Euler = Euler;
51754
51980
  exports.EventDispatcher = EventDispatcher;
51755
- exports.ExtrudeBufferGeometry = ExtrudeBufferGeometry;
51756
51981
  exports.ExtrudeGeometry = ExtrudeGeometry;
51757
51982
  exports.FileLoader = FileLoader;
51758
51983
  exports.Float16BufferAttribute = Float16BufferAttribute;
@@ -51767,7 +51992,9 @@ exports.Frustum = Frustum;
51767
51992
  exports.GLBufferAttribute = GLBufferAttribute;
51768
51993
  exports.GLSL1 = GLSL1;
51769
51994
  exports.GLSL3 = GLSL3;
51995
+ exports.GreaterCompare = GreaterCompare;
51770
51996
  exports.GreaterDepth = GreaterDepth;
51997
+ exports.GreaterEqualCompare = GreaterEqualCompare;
51771
51998
  exports.GreaterEqualDepth = GreaterEqualDepth;
51772
51999
  exports.GreaterEqualStencilFunc = GreaterEqualStencilFunc;
51773
52000
  exports.GreaterStencilFunc = GreaterStencilFunc;
@@ -51777,7 +52004,6 @@ exports.HalfFloatType = HalfFloatType;
51777
52004
  exports.HemisphereLight = HemisphereLight;
51778
52005
  exports.HemisphereLightHelper = HemisphereLightHelper;
51779
52006
  exports.HemisphereLightProbe = HemisphereLightProbe;
51780
- exports.IcosahedronBufferGeometry = IcosahedronBufferGeometry;
51781
52007
  exports.IcosahedronGeometry = IcosahedronGeometry;
51782
52008
  exports.ImageBitmapLoader = ImageBitmapLoader;
51783
52009
  exports.ImageLoader = ImageLoader;
@@ -51802,10 +52028,11 @@ exports.InvertStencilOp = InvertStencilOp;
51802
52028
  exports.KeepStencilOp = KeepStencilOp;
51803
52029
  exports.KeyframeTrack = KeyframeTrack;
51804
52030
  exports.LOD = LOD;
51805
- exports.LatheBufferGeometry = LatheBufferGeometry;
51806
52031
  exports.LatheGeometry = LatheGeometry;
51807
52032
  exports.Layers = Layers;
52033
+ exports.LessCompare = LessCompare;
51808
52034
  exports.LessDepth = LessDepth;
52035
+ exports.LessEqualCompare = LessEqualCompare;
51809
52036
  exports.LessEqualDepth = LessEqualDepth;
51810
52037
  exports.LessEqualStencilFunc = LessEqualStencilFunc;
51811
52038
  exports.LessStencilFunc = LessStencilFunc;
@@ -51864,6 +52091,7 @@ exports.NearestMipMapLinearFilter = NearestMipMapLinearFilter;
51864
52091
  exports.NearestMipMapNearestFilter = NearestMipMapNearestFilter;
51865
52092
  exports.NearestMipmapLinearFilter = NearestMipmapLinearFilter;
51866
52093
  exports.NearestMipmapNearestFilter = NearestMipmapNearestFilter;
52094
+ exports.NeverCompare = NeverCompare;
51867
52095
  exports.NeverDepth = NeverDepth;
51868
52096
  exports.NeverStencilFunc = NeverStencilFunc;
51869
52097
  exports.NoBlending = NoBlending;
@@ -51871,13 +52099,13 @@ exports.NoColorSpace = NoColorSpace;
51871
52099
  exports.NoToneMapping = NoToneMapping;
51872
52100
  exports.NormalAnimationBlendMode = NormalAnimationBlendMode;
51873
52101
  exports.NormalBlending = NormalBlending;
52102
+ exports.NotEqualCompare = NotEqualCompare;
51874
52103
  exports.NotEqualDepth = NotEqualDepth;
51875
52104
  exports.NotEqualStencilFunc = NotEqualStencilFunc;
51876
52105
  exports.NumberKeyframeTrack = NumberKeyframeTrack;
51877
52106
  exports.Object3D = Object3D;
51878
52107
  exports.ObjectLoader = ObjectLoader;
51879
52108
  exports.ObjectSpaceNormalMap = ObjectSpaceNormalMap;
51880
- exports.OctahedronBufferGeometry = OctahedronBufferGeometry;
51881
52109
  exports.OctahedronGeometry = OctahedronGeometry;
51882
52110
  exports.OneFactor = OneFactor;
51883
52111
  exports.OneMinusDstAlphaFactor = OneMinusDstAlphaFactor;
@@ -51891,7 +52119,6 @@ exports.PMREMGenerator = PMREMGenerator;
51891
52119
  exports.Path = Path;
51892
52120
  exports.PerspectiveCamera = PerspectiveCamera;
51893
52121
  exports.Plane = Plane;
51894
- exports.PlaneBufferGeometry = PlaneBufferGeometry;
51895
52122
  exports.PlaneGeometry = PlaneGeometry;
51896
52123
  exports.PlaneHelper = PlaneHelper;
51897
52124
  exports.PointLight = PointLight;
@@ -51899,7 +52126,6 @@ exports.PointLightHelper = PointLightHelper;
51899
52126
  exports.Points = Points;
51900
52127
  exports.PointsMaterial = PointsMaterial;
51901
52128
  exports.PolarGridHelper = PolarGridHelper;
51902
- exports.PolyhedronBufferGeometry = PolyhedronBufferGeometry;
51903
52129
  exports.PolyhedronGeometry = PolyhedronGeometry;
51904
52130
  exports.PositionalAudio = PositionalAudio;
51905
52131
  exports.PropertyBinding = PropertyBinding;
@@ -51953,7 +52179,6 @@ exports.ReinhardToneMapping = ReinhardToneMapping;
51953
52179
  exports.RepeatWrapping = RepeatWrapping;
51954
52180
  exports.ReplaceStencilOp = ReplaceStencilOp;
51955
52181
  exports.ReverseSubtractEquation = ReverseSubtractEquation;
51956
- exports.RingBufferGeometry = RingBufferGeometry;
51957
52182
  exports.RingGeometry = RingGeometry;
51958
52183
  exports.SIGNED_RED_GREEN_RGTC2_Format = SIGNED_RED_GREEN_RGTC2_Format;
51959
52184
  exports.SIGNED_RED_RGTC1_Format = SIGNED_RED_RGTC1_Format;
@@ -51964,7 +52189,6 @@ exports.ShaderLib = ShaderLib;
51964
52189
  exports.ShaderMaterial = ShaderMaterial;
51965
52190
  exports.ShadowMaterial = ShadowMaterial;
51966
52191
  exports.Shape = Shape;
51967
- exports.ShapeBufferGeometry = ShapeBufferGeometry;
51968
52192
  exports.ShapeGeometry = ShapeGeometry;
51969
52193
  exports.ShapePath = ShapePath;
51970
52194
  exports.ShapeUtils = ShapeUtils;
@@ -51974,7 +52198,6 @@ exports.SkeletonHelper = SkeletonHelper;
51974
52198
  exports.SkinnedMesh = SkinnedMesh;
51975
52199
  exports.Source = Source;
51976
52200
  exports.Sphere = Sphere;
51977
- exports.SphereBufferGeometry = SphereBufferGeometry;
51978
52201
  exports.SphereGeometry = SphereGeometry;
51979
52202
  exports.Spherical = Spherical;
51980
52203
  exports.SphericalHarmonics3 = SphericalHarmonics3;
@@ -51998,19 +52221,15 @@ exports.SubtractEquation = SubtractEquation;
51998
52221
  exports.SubtractiveBlending = SubtractiveBlending;
51999
52222
  exports.TOUCH = TOUCH;
52000
52223
  exports.TangentSpaceNormalMap = TangentSpaceNormalMap;
52001
- exports.TetrahedronBufferGeometry = TetrahedronBufferGeometry;
52002
52224
  exports.TetrahedronGeometry = TetrahedronGeometry;
52003
52225
  exports.Texture = Texture;
52004
52226
  exports.TextureLoader = TextureLoader;
52005
- exports.TorusBufferGeometry = TorusBufferGeometry;
52006
52227
  exports.TorusGeometry = TorusGeometry;
52007
- exports.TorusKnotBufferGeometry = TorusKnotBufferGeometry;
52008
52228
  exports.TorusKnotGeometry = TorusKnotGeometry;
52009
52229
  exports.Triangle = Triangle;
52010
52230
  exports.TriangleFanDrawMode = TriangleFanDrawMode;
52011
52231
  exports.TriangleStripDrawMode = TriangleStripDrawMode;
52012
52232
  exports.TrianglesDrawMode = TrianglesDrawMode;
52013
- exports.TubeBufferGeometry = TubeBufferGeometry;
52014
52233
  exports.TubeGeometry = TubeGeometry;
52015
52234
  exports.TwoPassDoubleSide = TwoPassDoubleSide;
52016
52235
  exports.UVMapping = UVMapping;
@@ -52037,11 +52256,13 @@ exports.VideoTexture = VideoTexture;
52037
52256
  exports.WebGL1Renderer = WebGL1Renderer;
52038
52257
  exports.WebGL3DRenderTarget = WebGL3DRenderTarget;
52039
52258
  exports.WebGLArrayRenderTarget = WebGLArrayRenderTarget;
52259
+ exports.WebGLCoordinateSystem = WebGLCoordinateSystem;
52040
52260
  exports.WebGLCubeRenderTarget = WebGLCubeRenderTarget;
52041
52261
  exports.WebGLMultipleRenderTargets = WebGLMultipleRenderTargets;
52042
52262
  exports.WebGLRenderTarget = WebGLRenderTarget;
52043
52263
  exports.WebGLRenderer = WebGLRenderer;
52044
52264
  exports.WebGLUtils = WebGLUtils;
52265
+ exports.WebGPUCoordinateSystem = WebGPUCoordinateSystem;
52045
52266
  exports.WireframeGeometry = WireframeGeometry;
52046
52267
  exports.WrapAroundEnding = WrapAroundEnding;
52047
52268
  exports.ZeroCurvatureEnding = ZeroCurvatureEnding;