super-three 0.171.0 → 0.173.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (455) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +1 -1
  3. package/build/three.cjs +594 -427
  4. package/build/three.core.js +515 -81
  5. package/build/three.core.min.js +2 -2
  6. package/build/three.module.js +79 -350
  7. package/build/three.module.min.js +2 -2
  8. package/build/three.tsl.js +20 -7
  9. package/build/three.tsl.min.js +2 -2
  10. package/build/three.webgpu.js +29362 -3427
  11. package/build/three.webgpu.min.js +2 -2
  12. package/build/three.webgpu.nodes.js +29361 -3427
  13. package/build/three.webgpu.nodes.min.js +2 -2
  14. package/examples/jsm/Addons.js +0 -5
  15. package/examples/jsm/animation/CCDIKSolver.js +9 -7
  16. package/examples/jsm/capabilities/WebGPU.js +1 -1
  17. package/examples/jsm/controls/ArcballControls.js +48 -37
  18. package/examples/jsm/controls/OrbitControls.js +5 -4
  19. package/examples/jsm/csm/CSMShadowNode.js +16 -11
  20. package/examples/jsm/curves/NURBSCurve.js +1 -1
  21. package/examples/jsm/curves/NURBSUtils.js +3 -0
  22. package/examples/jsm/effects/OutlineEffect.js +1 -1
  23. package/examples/jsm/exporters/GLTFExporter.js +34 -29
  24. package/examples/jsm/exporters/KTX2Exporter.js +1 -1
  25. package/examples/jsm/exporters/PLYExporter.js +2 -2
  26. package/examples/jsm/geometries/TextGeometry.js +1 -12
  27. package/examples/jsm/helpers/TextureHelperGPU.js +15 -5
  28. package/examples/jsm/helpers/VertexNormalsHelper.js +2 -0
  29. package/examples/jsm/interactive/InteractiveGroup.js +108 -51
  30. package/examples/jsm/libs/demuxer_mp4.js +109 -0
  31. package/examples/jsm/lights/LightProbeGenerator.js +3 -3
  32. package/examples/jsm/lines/webgpu/LineSegments2.js +15 -6
  33. package/examples/jsm/loaders/3MFLoader.js +6 -3
  34. package/examples/jsm/loaders/BVHLoader.js +1 -1
  35. package/examples/jsm/loaders/ColladaLoader.js +5 -5
  36. package/examples/jsm/loaders/DDSLoader.js +42 -0
  37. package/examples/jsm/loaders/GCodeLoader.js +4 -2
  38. package/examples/jsm/loaders/GLTFLoader.js +22 -4
  39. package/examples/jsm/loaders/KTX2Loader.js +6 -1
  40. package/examples/jsm/loaders/KTXLoader.js +4 -4
  41. package/examples/jsm/loaders/LDrawLoader.js +1 -1
  42. package/examples/jsm/loaders/LottieLoader.js +1 -1
  43. package/examples/jsm/loaders/MTLLoader.js +1 -0
  44. package/examples/jsm/loaders/NRRDLoader.js +1 -1
  45. package/examples/jsm/loaders/PLYLoader.js +7 -7
  46. package/examples/jsm/loaders/PVRLoader.js +1 -1
  47. package/examples/jsm/loaders/SVGLoader.js +2 -2
  48. package/examples/jsm/loaders/TDSLoader.js +1 -2
  49. package/examples/jsm/loaders/VRMLLoader.js +7 -7
  50. package/examples/jsm/loaders/lwo/IFFParser.js +4 -4
  51. package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +1 -1
  52. package/examples/jsm/materials/MeshGouraudMaterial.js +2 -0
  53. package/examples/jsm/math/ConvexHull.js +1 -1
  54. package/examples/jsm/math/OBB.js +17 -0
  55. package/examples/jsm/misc/GPUComputationRenderer.js +6 -7
  56. package/examples/jsm/misc/ProgressiveLightMap.js +4 -3
  57. package/examples/jsm/misc/ProgressiveLightMapGPU.js +14 -13
  58. package/examples/jsm/misc/Volume.js +27 -17
  59. package/examples/jsm/misc/VolumeSlice.js +7 -5
  60. package/examples/jsm/modifiers/CurveModifier.js +10 -8
  61. package/examples/jsm/modifiers/CurveModifierGPU.js +9 -7
  62. package/examples/jsm/modifiers/SimplifyModifier.js +2 -2
  63. package/examples/jsm/objects/GroundedSkybox.js +4 -4
  64. package/examples/jsm/objects/Sky.js +2 -2
  65. package/examples/jsm/objects/SkyMesh.js +3 -3
  66. package/examples/jsm/objects/Water2.js +1 -1
  67. package/examples/jsm/objects/Water2Mesh.js +2 -2
  68. package/examples/jsm/objects/WaterMesh.js +29 -24
  69. package/examples/jsm/physics/JoltPhysics.js +7 -7
  70. package/examples/jsm/physics/RapierPhysics.js +4 -4
  71. package/examples/jsm/postprocessing/BloomPass.js +2 -2
  72. package/examples/jsm/postprocessing/EffectComposer.js +1 -2
  73. package/examples/jsm/postprocessing/OutlinePass.js +4 -4
  74. package/examples/jsm/postprocessing/OutputPass.js +2 -0
  75. package/examples/jsm/postprocessing/SAOPass.js +1 -2
  76. package/examples/jsm/postprocessing/SMAAPass.js +1 -3
  77. package/examples/jsm/postprocessing/SSAOPass.js +2 -4
  78. package/examples/jsm/postprocessing/SSRPass.js +2 -4
  79. package/examples/jsm/postprocessing/UnrealBloomPass.js +2 -2
  80. package/examples/jsm/renderers/SVGRenderer.js +6 -4
  81. package/examples/jsm/shaders/BokehShader2.js +1 -1
  82. package/examples/jsm/shaders/GodRaysShader.js +3 -3
  83. package/examples/jsm/shaders/OutputShader.js +5 -1
  84. package/examples/jsm/shaders/SobelOperatorShader.js +1 -1
  85. package/examples/jsm/transpiler/GLSLDecoder.js +2 -2
  86. package/examples/jsm/transpiler/TSLEncoder.js +2 -0
  87. package/examples/jsm/tsl/display/AfterImageNode.js +93 -4
  88. package/examples/jsm/tsl/display/AnaglyphPassNode.js +46 -2
  89. package/examples/jsm/tsl/display/AnamorphicNode.js +118 -5
  90. package/examples/jsm/tsl/display/BleachBypass.js +10 -0
  91. package/examples/jsm/tsl/display/BloomNode.js +233 -26
  92. package/examples/jsm/tsl/display/DenoiseNode.js +141 -25
  93. package/examples/jsm/tsl/display/DepthOfFieldNode.js +80 -1
  94. package/examples/jsm/tsl/display/DotScreenNode.js +50 -5
  95. package/examples/jsm/tsl/display/FXAANode.js +52 -3
  96. package/examples/jsm/tsl/display/FilmNode.js +47 -1
  97. package/examples/jsm/tsl/display/GTAONode.js +210 -14
  98. package/examples/jsm/tsl/display/GaussianBlurNode.js +152 -8
  99. package/examples/jsm/tsl/display/LensflareNode.js +131 -13
  100. package/examples/jsm/tsl/display/Lut3DNode.js +55 -1
  101. package/examples/jsm/tsl/display/MotionBlur.js +12 -2
  102. package/examples/jsm/tsl/display/OutlineNode.js +343 -26
  103. package/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +36 -2
  104. package/examples/jsm/tsl/display/PixelationPassNode.js +142 -9
  105. package/examples/jsm/tsl/display/RGBShiftNode.js +49 -2
  106. package/examples/jsm/tsl/display/SMAANode.js +187 -46
  107. package/examples/jsm/tsl/display/SSAAPassNode.js +110 -25
  108. package/examples/jsm/tsl/display/SSRNode.js +194 -21
  109. package/examples/jsm/tsl/display/Sepia.js +9 -0
  110. package/examples/jsm/tsl/display/SobelOperatorNode.js +54 -4
  111. package/examples/jsm/tsl/display/StereoCompositePassNode.js +79 -3
  112. package/examples/jsm/tsl/display/StereoPassNode.js +41 -3
  113. package/examples/jsm/tsl/display/TRAAPassNode.js +116 -21
  114. package/examples/jsm/tsl/display/TransitionNode.js +71 -6
  115. package/examples/jsm/tsl/display/hashBlur.js +14 -3
  116. package/examples/jsm/tsl/lighting/TiledLightsNode.js +40 -34
  117. package/examples/jsm/utils/BufferGeometryUtils.js +1 -1
  118. package/examples/jsm/utils/CameraUtils.js +4 -1
  119. package/examples/jsm/utils/GeometryUtils.js +22 -19
  120. package/examples/jsm/utils/SceneUtils.js +2 -2
  121. package/examples/jsm/webxr/XRControllerModelFactory.js +6 -1
  122. package/examples/jsm/webxr/XREstimatedLight.js +1 -1
  123. package/package.json +8 -3
  124. package/src/Three.Core.js +4 -0
  125. package/src/Three.Legacy.js +0 -21
  126. package/src/Three.TSL.js +18 -5
  127. package/src/Three.WebGPU.Nodes.js +2 -2
  128. package/src/Three.WebGPU.js +2 -2
  129. package/src/animation/PropertyBinding.js +2 -2
  130. package/src/cameras/ArrayCamera.js +1 -0
  131. package/src/cameras/PerspectiveCamera.js +18 -2
  132. package/src/constants.js +6 -1
  133. package/src/core/BufferAttribute.js +4 -0
  134. package/src/core/EventDispatcher.js +8 -6
  135. package/src/core/RenderTarget.js +18 -0
  136. package/src/core/RenderTarget3D.js +22 -0
  137. package/src/core/RenderTargetArray.js +22 -0
  138. package/src/extras/Earcut.js +1 -1
  139. package/src/extras/ImageUtils.js +1 -11
  140. package/src/extras/PMREMGenerator.js +20 -0
  141. package/src/extras/TextureUtils.js +6 -0
  142. package/src/helpers/CameraHelper.js +16 -13
  143. package/src/loaders/nodes/NodeLoader.js +59 -0
  144. package/src/loaders/nodes/NodeMaterialLoader.js +45 -0
  145. package/src/loaders/nodes/NodeObjectLoader.js +61 -0
  146. package/src/materials/nodes/Line2NodeMaterial.js +128 -34
  147. package/src/materials/nodes/LineBasicNodeMaterial.js +17 -2
  148. package/src/materials/nodes/LineDashedNodeMaterial.js +78 -5
  149. package/src/materials/nodes/MeshBasicNodeMaterial.js +56 -0
  150. package/src/materials/nodes/MeshLambertNodeMaterial.js +35 -0
  151. package/src/materials/nodes/MeshMatcapNodeMaterial.js +22 -2
  152. package/src/materials/nodes/MeshNormalNodeMaterial.js +21 -2
  153. package/src/materials/nodes/MeshPhongNodeMaterial.js +64 -1
  154. package/src/materials/nodes/MeshPhysicalNodeMaterial.js +269 -0
  155. package/src/materials/nodes/MeshSSSNodeMaterial.js +97 -6
  156. package/src/materials/nodes/MeshStandardNodeMaterial.js +78 -0
  157. package/src/materials/nodes/MeshToonNodeMaterial.js +28 -0
  158. package/src/materials/nodes/NodeMaterial.js +476 -23
  159. package/src/materials/nodes/NodeMaterials.js +0 -1
  160. package/src/materials/nodes/PointsNodeMaterial.js +121 -10
  161. package/src/materials/nodes/ShadowNodeMaterial.js +29 -0
  162. package/src/materials/nodes/SpriteNodeMaterial.js +78 -20
  163. package/src/materials/nodes/VolumeNodeMaterial.js +80 -4
  164. package/src/materials/nodes/manager/NodeMaterialObserver.js +95 -0
  165. package/src/nodes/Nodes.js +5 -6
  166. package/src/nodes/TSL.js +6 -3
  167. package/src/nodes/accessors/AccessorsUtils.js +27 -0
  168. package/src/nodes/accessors/Arrays.js +47 -6
  169. package/src/nodes/accessors/BatchNode.js +42 -6
  170. package/src/nodes/accessors/Bitangent.js +37 -0
  171. package/src/nodes/accessors/BufferAttributeNode.js +178 -5
  172. package/src/nodes/accessors/BufferNode.js +63 -0
  173. package/src/nodes/accessors/BuiltinNode.js +38 -0
  174. package/src/nodes/accessors/Camera.js +113 -3
  175. package/src/nodes/accessors/ClippingNode.js +71 -2
  176. package/src/nodes/accessors/CubeTextureNode.js +64 -0
  177. package/src/nodes/accessors/InstanceNode.js +85 -2
  178. package/src/nodes/accessors/InstancedMeshNode.js +28 -3
  179. package/src/nodes/accessors/Lights.js +50 -1
  180. package/src/nodes/accessors/MaterialNode.js +306 -12
  181. package/src/nodes/accessors/MaterialProperties.js +7 -0
  182. package/src/nodes/accessors/MaterialReferenceNode.js +53 -13
  183. package/src/nodes/accessors/ModelNode.js +100 -5
  184. package/src/nodes/accessors/ModelViewProjectionNode.js +10 -38
  185. package/src/nodes/accessors/MorphNode.js +48 -4
  186. package/src/nodes/accessors/Normal.js +65 -5
  187. package/src/nodes/accessors/Object3DNode.js +101 -1
  188. package/src/nodes/accessors/PointUVNode.js +26 -0
  189. package/src/nodes/accessors/Position.js +56 -7
  190. package/src/nodes/accessors/ReferenceBaseNode.js +186 -0
  191. package/src/nodes/accessors/ReferenceNode.js +201 -2
  192. package/src/nodes/accessors/ReflectVector.js +24 -0
  193. package/src/nodes/accessors/RendererReferenceNode.js +46 -1
  194. package/src/nodes/accessors/SceneNode.js +54 -0
  195. package/src/nodes/accessors/SkinningNode.js +127 -1
  196. package/src/nodes/accessors/StorageBufferNode.js +209 -8
  197. package/src/nodes/accessors/StorageTextureNode.js +118 -0
  198. package/src/nodes/accessors/Tangent.js +38 -2
  199. package/src/nodes/accessors/Texture3DNode.js +91 -7
  200. package/src/nodes/accessors/TextureBicubic.js +12 -2
  201. package/src/nodes/accessors/TextureNode.js +316 -10
  202. package/src/nodes/accessors/TextureSizeNode.js +42 -0
  203. package/src/nodes/accessors/UV.js +10 -1
  204. package/src/nodes/accessors/UniformArrayNode.js +231 -25
  205. package/src/nodes/accessors/UserDataNode.js +46 -0
  206. package/src/nodes/accessors/VelocityNode.js +80 -0
  207. package/src/nodes/accessors/VertexColorNode.js +39 -2
  208. package/src/nodes/code/CodeNode.js +95 -1
  209. package/src/nodes/code/ExpressionNode.js +28 -0
  210. package/src/nodes/code/FunctionCallNode.js +37 -0
  211. package/src/nodes/code/FunctionNode.js +45 -0
  212. package/src/nodes/code/ScriptableNode.js +223 -1
  213. package/src/nodes/code/ScriptableValueNode.js +85 -1
  214. package/src/nodes/core/ArrayNode.js +125 -0
  215. package/src/nodes/core/AssignNode.js +48 -2
  216. package/src/nodes/core/AttributeNode.js +43 -0
  217. package/src/nodes/core/BypassNode.js +47 -2
  218. package/src/nodes/core/CacheNode.js +53 -2
  219. package/src/nodes/core/ConstNode.js +32 -0
  220. package/src/nodes/core/ContextNode.js +65 -0
  221. package/src/nodes/core/IndexNode.js +68 -7
  222. package/src/nodes/core/InputNode.js +48 -0
  223. package/src/nodes/core/LightingModel.js +60 -0
  224. package/src/nodes/core/MRTNode.js +66 -0
  225. package/src/nodes/core/Node.js +350 -12
  226. package/src/nodes/core/NodeAttribute.js +38 -0
  227. package/src/nodes/core/NodeBuilder.js +1166 -26
  228. package/src/nodes/core/NodeCache.js +41 -2
  229. package/src/nodes/core/NodeCode.js +31 -0
  230. package/src/nodes/core/NodeFrame.js +123 -2
  231. package/src/nodes/core/NodeFunction.js +46 -0
  232. package/src/nodes/core/NodeFunctionInput.js +44 -0
  233. package/src/nodes/core/NodeParser.js +11 -0
  234. package/src/nodes/core/NodeUniform.js +52 -0
  235. package/src/nodes/core/NodeUtils.js +152 -1
  236. package/src/nodes/core/NodeVar.js +47 -1
  237. package/src/nodes/core/NodeVarying.js +28 -0
  238. package/src/nodes/core/OutputStructNode.js +51 -10
  239. package/src/nodes/core/ParameterNode.js +28 -0
  240. package/src/nodes/core/PropertyNode.js +232 -0
  241. package/src/nodes/core/StackNode.js +98 -1
  242. package/src/nodes/core/StructNode.js +121 -0
  243. package/src/nodes/core/StructType.js +13 -0
  244. package/src/nodes/core/StructTypeNode.js +105 -6
  245. package/src/nodes/core/TempNode.js +31 -5
  246. package/src/nodes/core/UniformGroupNode.js +82 -7
  247. package/src/nodes/core/UniformNode.js +66 -0
  248. package/src/nodes/core/VarNode.js +146 -7
  249. package/src/nodes/core/VaryingNode.js +100 -3
  250. package/src/nodes/core/constants.js +36 -0
  251. package/src/nodes/display/BlendModes.js +88 -1
  252. package/src/nodes/display/BumpMapNode.js +37 -0
  253. package/src/nodes/display/ColorAdjustment.js +53 -11
  254. package/src/nodes/display/ColorSpaceFunctions.js +16 -0
  255. package/src/nodes/display/ColorSpaceNode.js +82 -0
  256. package/src/nodes/display/FrontFacingNode.js +29 -0
  257. package/src/nodes/display/NormalMapNode.js +43 -0
  258. package/src/nodes/display/PassNode.js +300 -7
  259. package/src/nodes/display/PosterizeNode.js +33 -0
  260. package/src/nodes/display/RenderOutputNode.js +66 -1
  261. package/src/nodes/display/ScreenNode.js +96 -0
  262. package/src/nodes/display/ToneMappingFunctions.js +58 -10
  263. package/src/nodes/display/ToneMappingNode.js +55 -2
  264. package/src/nodes/display/ToonOutlinePassNode.js +73 -0
  265. package/src/nodes/display/ViewportDepthNode.js +122 -8
  266. package/src/nodes/display/ViewportDepthTextureNode.js +23 -0
  267. package/src/nodes/display/ViewportSharedTextureNode.js +23 -0
  268. package/src/nodes/display/ViewportTextureNode.js +57 -0
  269. package/src/nodes/fog/Fog.js +110 -0
  270. package/src/nodes/functions/BasicLightingModel.js +24 -0
  271. package/src/nodes/functions/PhongLightingModel.js +34 -2
  272. package/src/nodes/functions/PhysicalLightingModel.js +167 -8
  273. package/src/nodes/functions/ShadowMaskModel.js +23 -0
  274. package/src/nodes/functions/ToonLightingModel.js +20 -0
  275. package/src/nodes/functions/material/getAlphaHashThreshold.js +1 -3
  276. package/src/nodes/functions/material/getParallaxCorrectNormal.js +16 -1
  277. package/src/nodes/geometry/RangeNode.js +54 -2
  278. package/src/nodes/gpgpu/AtomicFunctionNode.js +174 -2
  279. package/src/nodes/gpgpu/BarrierNode.js +47 -0
  280. package/src/nodes/gpgpu/ComputeBuiltinNode.js +134 -0
  281. package/src/nodes/gpgpu/ComputeNode.js +106 -2
  282. package/src/nodes/gpgpu/WorkgroupInfoNode.js +115 -6
  283. package/src/nodes/lighting/AONode.js +18 -0
  284. package/src/nodes/lighting/AmbientLightNode.js +10 -0
  285. package/src/nodes/lighting/AnalyticLightNode.js +97 -2
  286. package/src/nodes/lighting/BasicEnvironmentNode.js +19 -0
  287. package/src/nodes/lighting/BasicLightMapNode.js +17 -0
  288. package/src/nodes/lighting/DirectionalLightNode.js +10 -0
  289. package/src/nodes/lighting/EnvironmentNode.js +18 -0
  290. package/src/nodes/lighting/HemisphereLightNode.js +31 -0
  291. package/src/nodes/lighting/IESSpotLightNode.js +11 -0
  292. package/src/nodes/lighting/IrradianceNode.js +17 -0
  293. package/src/nodes/lighting/LightProbeNode.js +20 -0
  294. package/src/nodes/lighting/LightUtils.js +12 -0
  295. package/src/nodes/lighting/LightingContextNode.js +48 -0
  296. package/src/nodes/lighting/LightingNode.js +15 -6
  297. package/src/nodes/lighting/LightsNode.js +132 -1
  298. package/src/nodes/lighting/PointLightNode.js +32 -1
  299. package/src/nodes/lighting/PointShadowNode.js +54 -1
  300. package/src/nodes/lighting/RectAreaLightNode.js +44 -6
  301. package/src/nodes/lighting/ShadowBaseNode.js +93 -0
  302. package/src/nodes/lighting/ShadowNode.js +241 -35
  303. package/src/nodes/lighting/SpotLightNode.js +43 -0
  304. package/src/nodes/math/ConditionalNode.js +78 -4
  305. package/src/nodes/math/Hash.js +9 -0
  306. package/src/nodes/math/MathNode.js +627 -11
  307. package/src/nodes/math/MathUtils.js +45 -1
  308. package/src/nodes/math/OperatorNode.js +329 -18
  309. package/src/nodes/math/TriNoise3D.js +18 -7
  310. package/src/nodes/parsers/GLSLNodeFunction.js +16 -0
  311. package/src/nodes/parsers/GLSLNodeParser.js +11 -0
  312. package/src/nodes/pmrem/PMREMNode.js +133 -0
  313. package/src/nodes/pmrem/PMREMUtils.js +2 -2
  314. package/src/nodes/procedural/Checker.js +9 -0
  315. package/src/nodes/shapes/Shapes.js +33 -0
  316. package/src/nodes/tsl/TSLBase.js +3 -2
  317. package/src/nodes/tsl/TSLCore.js +22 -2
  318. package/src/nodes/utils/ArrayElementNode.js +39 -3
  319. package/src/nodes/utils/ConvertNode.js +31 -0
  320. package/src/nodes/utils/CubeMapNode.js +78 -0
  321. package/src/nodes/utils/Discard.js +16 -0
  322. package/src/nodes/utils/EquirectUVNode.js +31 -1
  323. package/src/nodes/utils/FlipNode.js +38 -0
  324. package/src/nodes/utils/FunctionOverloadingNode.js +53 -1
  325. package/src/nodes/utils/JoinNode.js +25 -0
  326. package/src/nodes/utils/LoopNode.js +82 -2
  327. package/src/nodes/utils/MatcapUVNode.js +17 -0
  328. package/src/nodes/utils/MaxMipLevelNode.js +49 -0
  329. package/src/nodes/utils/MemberNode.js +68 -0
  330. package/src/nodes/utils/Oscillators.js +33 -0
  331. package/src/nodes/utils/Packing.js +17 -0
  332. package/src/nodes/utils/PostProcessingUtils.js +28 -23
  333. package/src/nodes/utils/RTTNode.js +123 -2
  334. package/src/nodes/utils/ReflectorNode.js +174 -4
  335. package/src/nodes/utils/RemapNode.js +79 -0
  336. package/src/nodes/utils/RotateNode.js +41 -0
  337. package/src/nodes/utils/SetNode.js +44 -1
  338. package/src/nodes/utils/SplitNode.js +55 -3
  339. package/src/nodes/utils/SpriteSheetUVNode.js +46 -0
  340. package/src/nodes/utils/SpriteUtils.js +17 -0
  341. package/src/nodes/utils/StorageArrayElementNode.js +54 -0
  342. package/src/nodes/utils/Timer.js +40 -0
  343. package/src/nodes/utils/TriplanarTexturesNode.js +84 -0
  344. package/src/nodes/utils/UVUtils.js +20 -0
  345. package/src/nodes/utils/ViewportUtils.js +13 -0
  346. package/src/objects/BatchedMesh.js +2 -3
  347. package/src/objects/ClippingGroup.js +49 -0
  348. package/src/objects/Line.js +6 -6
  349. package/src/renderers/WebGLRenderer.js +30 -4
  350. package/src/renderers/common/Animation.js +85 -0
  351. package/src/renderers/common/Attributes.js +36 -0
  352. package/src/renderers/common/Backend.js +502 -44
  353. package/src/renderers/common/Background.js +48 -1
  354. package/src/renderers/common/BindGroup.js +43 -0
  355. package/src/renderers/common/Binding.js +35 -0
  356. package/src/renderers/common/Bindings.js +93 -1
  357. package/src/renderers/common/Buffer.js +49 -0
  358. package/src/renderers/common/BufferUtils.js +27 -0
  359. package/src/renderers/common/BundleGroup.js +57 -0
  360. package/src/renderers/common/ChainMap.js +45 -6
  361. package/src/renderers/common/ClippingContext.js +108 -15
  362. package/src/renderers/common/Color4.js +40 -0
  363. package/src/renderers/common/ComputePipeline.js +24 -0
  364. package/src/renderers/common/CubeRenderTarget.js +13 -0
  365. package/src/renderers/common/DataMap.js +37 -1
  366. package/src/renderers/common/Geometries.js +91 -14
  367. package/src/renderers/common/IndirectStorageBufferAttribute.js +25 -2
  368. package/src/renderers/common/Info.js +78 -35
  369. package/src/renderers/common/Lighting.js +34 -6
  370. package/src/renderers/common/Pipeline.js +22 -0
  371. package/src/renderers/common/Pipelines.js +148 -5
  372. package/src/renderers/common/PostProcessing.js +99 -11
  373. package/src/renderers/common/ProgrammableStage.js +60 -2
  374. package/src/renderers/common/QuadMesh.js +54 -5
  375. package/src/renderers/common/RenderBundle.js +14 -8
  376. package/src/renderers/common/RenderBundles.js +39 -10
  377. package/src/renderers/common/RenderContext.js +201 -2
  378. package/src/renderers/common/RenderContexts.js +59 -6
  379. package/src/renderers/common/RenderList.js +178 -0
  380. package/src/renderers/common/RenderLists.js +40 -3
  381. package/src/renderers/common/RenderObject.js +400 -17
  382. package/src/renderers/common/RenderObjects.js +103 -7
  383. package/src/renderers/common/RenderPipeline.js +24 -0
  384. package/src/renderers/common/Renderer.js +1170 -86
  385. package/src/renderers/common/RendererUtils.js +193 -0
  386. package/src/renderers/common/SampledTexture.js +120 -0
  387. package/src/renderers/common/Sampler.js +30 -0
  388. package/src/renderers/common/StorageBuffer.js +24 -0
  389. package/src/renderers/common/StorageBufferAttribute.js +31 -2
  390. package/src/renderers/common/StorageInstancedBufferAttribute.js +31 -2
  391. package/src/renderers/common/StorageTexture.js +38 -0
  392. package/src/renderers/common/Textures.js +97 -7
  393. package/src/renderers/common/TimestampQueryPool.js +39 -0
  394. package/src/renderers/common/Uniform.js +225 -3
  395. package/src/renderers/common/UniformBuffer.js +19 -0
  396. package/src/renderers/common/UniformsGroup.js +141 -2
  397. package/src/renderers/common/XRManager.js +1193 -0
  398. package/src/renderers/common/XRRenderTarget.js +74 -0
  399. package/src/renderers/common/extras/PMREMGenerator.js +76 -10
  400. package/src/renderers/common/nodes/NodeBuilderState.js +99 -5
  401. package/src/renderers/common/nodes/NodeLibrary.js +89 -0
  402. package/src/renderers/common/nodes/NodeSampledTexture.js +90 -2
  403. package/src/renderers/common/nodes/NodeSampler.js +28 -0
  404. package/src/renderers/common/nodes/NodeStorageBuffer.js +35 -0
  405. package/src/renderers/common/nodes/NodeUniform.js +243 -2
  406. package/src/renderers/common/nodes/NodeUniformBuffer.js +29 -0
  407. package/src/renderers/common/nodes/NodeUniformsGroup.js +31 -18
  408. package/src/renderers/common/nodes/Nodes.js +352 -78
  409. package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +2 -2
  410. package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +7 -7
  411. package/src/renderers/webgl/WebGLBackground.js +4 -0
  412. package/src/renderers/webgl-fallback/WebGLBackend.js +819 -116
  413. package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +347 -18
  414. package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +58 -1
  415. package/src/renderers/webgl-fallback/utils/WebGLCapabilities.js +28 -0
  416. package/src/renderers/webgl-fallback/utils/WebGLExtensions.js +45 -0
  417. package/src/renderers/webgl-fallback/utils/WebGLState.js +323 -11
  418. package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +168 -22
  419. package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +359 -0
  420. package/src/renderers/webgl-fallback/utils/WebGLUtils.js +43 -0
  421. package/src/renderers/webgpu/WebGPUBackend.js +578 -164
  422. package/src/renderers/webgpu/WebGPURenderer.Nodes.js +36 -0
  423. package/src/renderers/webgpu/WebGPURenderer.js +36 -0
  424. package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +20 -8
  425. package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +21 -8
  426. package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +674 -52
  427. package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +17 -0
  428. package/src/renderers/webgpu/nodes/WGSLNodeParser.js +11 -0
  429. package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +95 -14
  430. package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +94 -1
  431. package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +102 -3
  432. package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +98 -1
  433. package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +262 -18
  434. package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +274 -0
  435. package/src/renderers/webgpu/utils/WebGPUUtils.js +116 -4
  436. package/src/renderers/webxr/WebXRDepthSensing.js +1 -1
  437. package/src/renderers/webxr/WebXRManager.js +19 -2
  438. package/src/textures/Data3DTexture.js +2 -2
  439. package/src/textures/Texture.js +4 -0
  440. package/src/textures/VideoFrameTexture.js +35 -0
  441. package/examples/jsm/animation/MMDAnimationHelper.js +0 -1209
  442. package/examples/jsm/animation/MMDPhysics.js +0 -1408
  443. package/examples/jsm/exporters/MMDExporter.js +0 -223
  444. package/examples/jsm/geometries/InstancedPointsGeometry.js +0 -176
  445. package/examples/jsm/libs/mmdparser.module.js +0 -11530
  446. package/examples/jsm/loaders/MMDLoader.js +0 -2298
  447. package/examples/jsm/objects/InstancedPoints.js +0 -19
  448. package/examples/jsm/shaders/MMDToonShader.js +0 -134
  449. package/src/materials/nodes/InstancedPointsNodeMaterial.js +0 -156
  450. package/src/nodes/accessors/InstancedPointsMaterialNode.js +0 -24
  451. package/src/nodes/core/UniformGroup.js +0 -13
  452. package/src/nodes/fog/FogExp2Node.js +0 -35
  453. package/src/nodes/fog/FogNode.js +0 -50
  454. package/src/nodes/fog/FogRangeNode.js +0 -36
  455. package/src/renderers/common/PostProcessingUtils.js +0 -86
@@ -52,30 +52,36 @@ class TiledLightsNode extends LightsNode {
52
52
  this.maxLights = maxLights;
53
53
  this.tileSize = tileSize;
54
54
 
55
- this.bufferSize = null;
56
- this.lightIndexes = null;
57
- this.screenTileIndex = null;
58
- this.compute = null;
59
- this.lightsTexture = null;
60
-
61
- this.lightsCount = uniform( 0, 'int' );
62
- this.tileLightCount = 8;
63
- this.screenSize = uniform( new Vector2() );
64
- this.cameraProjectionMatrix = uniform( 'mat4' );
65
- this.cameraViewMatrix = uniform( 'mat4' );
55
+ this._bufferSize = null;
56
+ this._lightIndexes = null;
57
+ this._screenTileIndex = null;
58
+ this._compute = null;
59
+ this._lightsTexture = null;
60
+
61
+ this._lightsCount = uniform( 0, 'int' );
62
+ this._tileLightCount = 8;
63
+ this._screenSize = uniform( new Vector2() );
64
+ this._cameraProjectionMatrix = uniform( 'mat4' );
65
+ this._cameraViewMatrix = uniform( 'mat4' );
66
66
 
67
67
  this.updateBeforeType = NodeUpdateType.RENDER;
68
68
 
69
69
  }
70
70
 
71
+ customCacheKey() {
72
+
73
+ return this._compute.getCacheKey() + super.customCacheKey();
74
+
75
+ }
76
+
71
77
  updateLightsTexture() {
72
78
 
73
- const { lightsTexture, tiledLights } = this;
79
+ const { _lightsTexture: lightsTexture, tiledLights } = this;
74
80
 
75
81
  const data = lightsTexture.image.data;
76
82
  const lineSize = lightsTexture.image.width * 4;
77
83
 
78
- this.lightsCount.value = tiledLights.length;
84
+ this._lightsCount.value = tiledLights.length;
79
85
 
80
86
  for ( let i = 0; i < tiledLights.length; i ++ ) {
81
87
 
@@ -113,13 +119,13 @@ class TiledLightsNode extends LightsNode {
113
119
 
114
120
  this.updateLightsTexture( camera );
115
121
 
116
- this.cameraProjectionMatrix.value = camera.projectionMatrix;
117
- this.cameraViewMatrix.value = camera.matrixWorldInverse;
122
+ this._cameraProjectionMatrix.value = camera.projectionMatrix;
123
+ this._cameraViewMatrix.value = camera.matrixWorldInverse;
118
124
 
119
125
  renderer.getDrawingBufferSize( _size );
120
- this.screenSize.value.copy( _size );
126
+ this._screenSize.value.copy( _size );
121
127
 
122
- renderer.compute( this.compute );
128
+ renderer.compute( this._compute );
123
129
 
124
130
  }
125
131
 
@@ -153,7 +159,7 @@ class TiledLightsNode extends LightsNode {
153
159
 
154
160
  getBlock( block = 0 ) {
155
161
 
156
- return this.lightIndexes.element( this.screenTileIndex.mul( int( 2 ).add( int( block ) ) ) );
162
+ return this._lightIndexes.element( this._screenTileIndex.mul( int( 2 ).add( int( block ) ) ) );
157
163
 
158
164
  }
159
165
 
@@ -163,9 +169,9 @@ class TiledLightsNode extends LightsNode {
163
169
 
164
170
  const stride = int( 4 );
165
171
  const tileOffset = element.div( stride );
166
- const tileIndex = this.screenTileIndex.mul( int( 2 ) ).add( tileOffset );
172
+ const tileIndex = this._screenTileIndex.mul( int( 2 ) ).add( tileOffset );
167
173
 
168
- return this.lightIndexes.element( tileIndex ).element( element.modInt( stride ) );
174
+ return this._lightIndexes.element( tileIndex ).element( element.modInt( stride ) );
169
175
 
170
176
  }
171
177
 
@@ -173,11 +179,11 @@ class TiledLightsNode extends LightsNode {
173
179
 
174
180
  index = int( index );
175
181
 
176
- const dataA = textureLoad( this.lightsTexture, ivec2( index, 0 ) );
177
- const dataB = textureLoad( this.lightsTexture, ivec2( index, 1 ) );
182
+ const dataA = textureLoad( this._lightsTexture, ivec2( index, 0 ) );
183
+ const dataB = textureLoad( this._lightsTexture, ivec2( index, 1 ) );
178
184
 
179
185
  const position = dataA.xyz;
180
- const viewPosition = this.cameraViewMatrix.mul( position );
186
+ const viewPosition = this._cameraViewMatrix.mul( position );
181
187
  const distance = dataA.w;
182
188
  const color = dataB.rgb;
183
189
  const decay = dataB.w;
@@ -208,7 +214,7 @@ class TiledLightsNode extends LightsNode {
208
214
 
209
215
  Fn( () => {
210
216
 
211
- Loop( this.tileLightCount, ( { i } ) => {
217
+ Loop( this._tileLightCount, ( { i } ) => {
212
218
 
213
219
  const lightIndex = this.getTile( i );
214
220
 
@@ -246,7 +252,7 @@ class TiledLightsNode extends LightsNode {
246
252
  width = this.getBufferFitSize( width );
247
253
  height = this.getBufferFitSize( height );
248
254
 
249
- if ( ! this.bufferSize || this.bufferSize.width !== width || this.bufferSize.height !== height ) {
255
+ if ( ! this._bufferSize || this._bufferSize.width !== width || this._bufferSize.height !== height ) {
250
256
 
251
257
  this.create( width, height );
252
258
 
@@ -263,11 +269,11 @@ class TiledLightsNode extends LightsNode {
263
269
  const width = this.getBufferFitSize( _size.width );
264
270
  const height = this.getBufferFitSize( _size.height );
265
271
 
266
- if ( this.bufferSize === null ) {
272
+ if ( this._bufferSize === null ) {
267
273
 
268
274
  this.create( width, height );
269
275
 
270
- } else if ( this.bufferSize.width !== width || this.bufferSize.height !== height ) {
276
+ } else if ( this._bufferSize.width !== width || this._bufferSize.height !== height ) {
271
277
 
272
278
  this.create( width, height );
273
279
 
@@ -315,7 +321,7 @@ class TiledLightsNode extends LightsNode {
315
321
 
316
322
  const compute = Fn( () => {
317
323
 
318
- const { cameraProjectionMatrix, bufferSize, screenSize } = this;
324
+ const { _cameraProjectionMatrix: cameraProjectionMatrix, _bufferSize: bufferSize, _screenSize: screenSize } = this;
319
325
 
320
326
  const tiledBufferSize = bufferSize.clone().divideScalar( tileSize ).floor();
321
327
 
@@ -335,7 +341,7 @@ class TiledLightsNode extends LightsNode {
335
341
 
336
342
  Loop( this.maxLights, ( { i } ) => {
337
343
 
338
- If( index.greaterThanEqual( this.tileLightCount ).or( int( i ).greaterThanEqual( int( this.lightsCount ) ) ), () => {
344
+ If( index.greaterThanEqual( this._tileLightCount ).or( int( i ).greaterThanEqual( int( this._lightsCount ) ) ), () => {
339
345
 
340
346
  Return();
341
347
 
@@ -368,11 +374,11 @@ class TiledLightsNode extends LightsNode {
368
374
 
369
375
  // assigns
370
376
 
371
- this.bufferSize = bufferSize;
372
- this.lightIndexes = lightIndexes;
373
- this.screenTileIndex = screenTileIndex;
374
- this.compute = compute;
375
- this.lightsTexture = lightsTexture;
377
+ this._bufferSize = bufferSize;
378
+ this._lightIndexes = lightIndexes;
379
+ this._screenTileIndex = screenTileIndex;
380
+ this._compute = compute;
381
+ this._lightsTexture = lightsTexture;
376
382
 
377
383
  }
378
384
 
@@ -389,7 +389,7 @@ function mergeAttributes( attributes ) {
389
389
  }
390
390
 
391
391
  /**
392
- * @param {BufferAttribute}
392
+ * @param {BufferAttribute} attribute
393
393
  * @return {BufferAttribute}
394
394
  */
395
395
  export function deepCloneAttribute( attribute ) {
@@ -18,10 +18,13 @@ const _va = /*@__PURE__*/ new Vector3(), // from pe to pa
18
18
  * to exactly frame the corners of an arbitrary rectangle.
19
19
  * NOTE: This function ignores the standard parameters;
20
20
  * do not call updateProjectionMatrix() after this!
21
+ *
22
+ * @param {PerspectiveCamera} camera
21
23
  * @param {Vector3} bottomLeftCorner
22
24
  * @param {Vector3} bottomRightCorner
23
25
  * @param {Vector3} topLeftCorner
24
- * @param {boolean} estimateViewFrustum */
26
+ * @param {boolean} [estimateViewFrustum=false]
27
+ */
25
28
  function frameCorners( camera, bottomLeftCorner, bottomRightCorner, topLeftCorner, estimateViewFrustum = false ) {
26
29
 
27
30
  const pa = bottomLeftCorner, pb = bottomRightCorner, pc = topLeftCorner;
@@ -7,13 +7,14 @@ import { Vector3 } from 'three';
7
7
  * Based on work by:
8
8
  * @link http://www.openprocessing.org/sketch/15493
9
9
  *
10
- * @param center Center of Hilbert curve.
11
- * @param size Total width of Hilbert curve.
12
- * @param iterations Number of subdivisions.
13
- * @param v0 Corner index -X, -Z.
14
- * @param v1 Corner index -X, +Z.
15
- * @param v2 Corner index +X, +Z.
16
- * @param v3 Corner index +X, -Z.
10
+ * @param {Vector3} center - Center of Hilbert curve.
11
+ * @param {number} [size=10] - Total width of Hilbert curve.
12
+ * @param {number} [iterations=10] - Number of subdivisions.
13
+ * @param {number} [v0=0] - Corner index -X, -Z.
14
+ * @param {number} [v1=1] - Corner index -X, +Z.
15
+ * @param {number} [v2=2] - Corner index +X, +Z.
16
+ * @param {number} [v3=3] - Corner index +X, -Z.
17
+ * @returns {Array<Array<number>>} The Hilbert curve points.
17
18
  */
18
19
  function hilbert2D( center = new Vector3( 0, 0, 0 ), size = 10, iterations = 1, v0 = 0, v1 = 1, v2 = 2, v3 = 3 ) {
19
20
 
@@ -56,17 +57,18 @@ function hilbert2D( center = new Vector3( 0, 0, 0 ), size = 10, iterations = 1,
56
57
  * Based on work by:
57
58
  * @link https://openprocessing.org/user/5654
58
59
  *
59
- * @param center Center of Hilbert curve.
60
- * @param size Total width of Hilbert curve.
61
- * @param iterations Number of subdivisions.
62
- * @param v0 Corner index -X, +Y, -Z.
63
- * @param v1 Corner index -X, +Y, +Z.
64
- * @param v2 Corner index -X, -Y, +Z.
65
- * @param v3 Corner index -X, -Y, -Z.
66
- * @param v4 Corner index +X, -Y, -Z.
67
- * @param v5 Corner index +X, -Y, +Z.
68
- * @param v6 Corner index +X, +Y, +Z.
69
- * @param v7 Corner index +X, +Y, -Z.
60
+ * @param {Vector3} [center=new Vector3( 0, 0, 0 )] - Center of Hilbert curve.
61
+ * @param {number} [size=10] - Total width of Hilbert curve.
62
+ * @param {number} [iterations=1] - Number of subdivisions.
63
+ * @param {number} [v0=0] - Corner index -X, +Y, -Z.
64
+ * @param {number} [v1=1] - Corner index -X, +Y, +Z.
65
+ * @param {number} [v2=2] - Corner index -X, -Y, +Z.
66
+ * @param {number} [v3=3] - Corner index -X, -Y, -Z.
67
+ * @param {number} [v4=4] - Corner index +X, -Y, -Z.
68
+ * @param {number} [v5=5] - Corner index +X, -Y, +Z.
69
+ * @param {number} [v6=6] - Corner index +X, +Y, +Z.
70
+ * @param {number} [v7=7] - Corner index +X, +Y, -Z.
71
+ * @returns {Array<Array<number>>} - The Hilbert curve points.
70
72
  */
71
73
  function hilbert3D( center = new Vector3( 0, 0, 0 ), size = 10, iterations = 1, v0 = 0, v1 = 1, v2 = 2, v3 = 3, v4 = 4, v5 = 5, v6 = 6, v7 = 7 ) {
72
74
 
@@ -121,7 +123,8 @@ function hilbert3D( center = new Vector3( 0, 0, 0 ), size = 10, iterations = 1,
121
123
  *
122
124
  * https://gist.github.com/nitaku/6521802
123
125
  *
124
- * @param size The size of a single gosper island.
126
+ * @param {number} [size=1] - The size of a single gosper island.
127
+ * @return {Array<[number, number, number]>} The gosper island points.
125
128
  */
126
129
  function gosper( size = 1 ) {
127
130
 
@@ -174,8 +174,8 @@ function reduceVertices( object, func, initialValue ) {
174
174
  }
175
175
 
176
176
  /**
177
- * @param {InstancedMesh}
178
- * @param {function(int, int):int}
177
+ * @param {InstancedMesh} mesh
178
+ * @param {function(int, int):int} compareFn
179
179
  */
180
180
  function sortInstancedMesh( mesh, compareFn ) {
181
181
 
@@ -54,6 +54,8 @@ class XRControllerModel extends Object3D {
54
54
  /**
55
55
  * Polls data from the XRInputSource and updates the model's components to match
56
56
  * the real world data
57
+ *
58
+ * @param {Boolean} force
57
59
  */
58
60
  updateMatrixWorld( force ) {
59
61
 
@@ -107,8 +109,11 @@ class XRControllerModel extends Object3D {
107
109
 
108
110
  /**
109
111
  * Walks the model's tree to find the nodes needed to animate the components and
110
- * saves them to the motionContoller components for use in the frame loop. When
112
+ * saves them to the motionController components for use in the frame loop. When
111
113
  * touchpads are found, attaches a touch dot to them.
114
+ *
115
+ * @param {MotionController} motionController
116
+ * @param {Object3D} scene
112
117
  */
113
118
  function findNodes( motionController, scene ) {
114
119
 
@@ -79,7 +79,7 @@ class SessionLightProbe {
79
79
 
80
80
  onXRFrame( time, xrFrame ) {
81
81
 
82
- // If either this obejct or the XREstimatedLight has been destroyed, stop
82
+ // If either this object or the XREstimatedLight has been destroyed, stop
83
83
  // running the frame loop.
84
84
  if ( ! this.xrLight ) {
85
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "super-three",
3
- "version": "0.171.0",
3
+ "version": "0.173.0",
4
4
  "description": "JavaScript 3D library",
5
5
  "type": "module",
6
6
  "main": "./build/three.cjs",
@@ -22,7 +22,9 @@
22
22
  "type": "git",
23
23
  "url": "supermedium/three.js"
24
24
  },
25
- "sideEffects": [ "./src/nodes/**/*" ],
25
+ "sideEffects": [
26
+ "./src/nodes/**/*"
27
+ ],
26
28
  "files": [
27
29
  "build",
28
30
  "examples/jsm",
@@ -45,6 +47,7 @@
45
47
  "test": "npm run lint && npm run test-unit && npm run test-unit-addons",
46
48
  "build": "rollup -c utils/build/rollup.config.js",
47
49
  "build-module": "rollup -c utils/build/rollup.config.js --configOnlyModule",
50
+ "build-docs": "jsdoc -c utils/docs/jsdoc.config.json",
48
51
  "dev": "concurrently --names \"ROLLUP,HTTP\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8080\"",
49
52
  "dev-ssl": "concurrently --names \"ROLLUP,HTTPS\" -c \"bgBlue.bold,bgGreen.bold\" \"rollup -c utils/build/rollup.config.js -w -m inline\" \"servez -p 8080 --ssl\"",
50
53
  "lint-core": "eslint src",
@@ -90,9 +93,10 @@
90
93
  },
91
94
  "homepage": "https://threejs.org/",
92
95
  "devDependencies": {
93
- "@rollup/plugin-node-resolve": "^15.0.1",
96
+ "@rollup/plugin-node-resolve": "^16.0.0",
94
97
  "@rollup/plugin-terser": "^0.4.0",
95
98
  "chalk": "^5.2.0",
99
+ "clean-jsdoc-theme": "^4.3.0",
96
100
  "concurrently": "^9.0.0",
97
101
  "dpdm": "^3.14.0",
98
102
  "eslint": "^8.37.0",
@@ -102,6 +106,7 @@
102
106
  "eslint-plugin-import": "^2.27.5",
103
107
  "failonlyreporter": "^1.0.0",
104
108
  "jimp": "^1.6.0",
109
+ "jsdoc": "^4.0.4",
105
110
  "magic-string": "^0.30.0",
106
111
  "pixelmatch": "^6.0.0",
107
112
  "puppeteer": "^22.0.0",
package/src/Three.Core.js CHANGED
@@ -4,6 +4,7 @@ export { WebGLArrayRenderTarget } from './renderers/WebGLArrayRenderTarget.js';
4
4
  export { WebGL3DRenderTarget } from './renderers/WebGL3DRenderTarget.js';
5
5
  export { WebGLCubeRenderTarget } from './renderers/WebGLCubeRenderTarget.js';
6
6
  export { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
7
+ export { WebXRController } from './renderers/webxr/WebXRController.js';
7
8
  export { FogExp2 } from './scenes/FogExp2.js';
8
9
  export { Fog } from './scenes/Fog.js';
9
10
  export { Scene } from './scenes/Scene.js';
@@ -21,6 +22,7 @@ export { Line } from './objects/Line.js';
21
22
  export { Points } from './objects/Points.js';
22
23
  export { Group } from './objects/Group.js';
23
24
  export { VideoTexture } from './textures/VideoTexture.js';
25
+ export { VideoFrameTexture } from './textures/VideoFrameTexture.js';
24
26
  export { FramebufferTexture } from './textures/FramebufferTexture.js';
25
27
  export { Source } from './textures/Source.js';
26
28
  export { DataTexture } from './textures/DataTexture.js';
@@ -85,6 +87,8 @@ export { AnimationMixer } from './animation/AnimationMixer.js';
85
87
  export { AnimationClip } from './animation/AnimationClip.js';
86
88
  export { AnimationAction } from './animation/AnimationAction.js';
87
89
  export { RenderTarget } from './core/RenderTarget.js';
90
+ export { RenderTarget3D } from './core/RenderTarget3D.js';
91
+ export { RenderTargetArray } from './core/RenderTargetArray.js';
88
92
  export { Uniform } from './core/Uniform.js';
89
93
  export { UniformsGroup } from './core/UniformsGroup.js';
90
94
  export { InstancedBufferGeometry } from './core/InstancedBufferGeometry.js';
@@ -1,21 +0,0 @@
1
- import { WebGLRenderTarget } from './renderers/WebGLRenderTarget.js';
2
-
3
- export class WebGLMultipleRenderTargets extends WebGLRenderTarget { // @deprecated, r162
4
-
5
- constructor( width = 1, height = 1, count = 1, options = {} ) {
6
-
7
- console.warn( 'THREE.WebGLMultipleRenderTargets has been deprecated and will be removed in r172. Use THREE.WebGLRenderTarget and set the "count" parameter to enable MRT.' );
8
-
9
- super( width, height, { ...options, count } );
10
-
11
- this.isWebGLMultipleRenderTargets = true;
12
-
13
- }
14
-
15
- get texture() {
16
-
17
- return this.textures;
18
-
19
- }
20
-
21
- }
package/src/Three.TSL.js CHANGED
@@ -33,7 +33,6 @@ export const abs = TSL.abs;
33
33
  export const acesFilmicToneMapping = TSL.acesFilmicToneMapping;
34
34
  export const acos = TSL.acos;
35
35
  export const add = TSL.add;
36
- export const addMethodChaining = TSL.addMethodChaining;
37
36
  export const addNodeElement = TSL.addNodeElement;
38
37
  export const agxToneMapping = TSL.agxToneMapping;
39
38
  export const all = TSL.all;
@@ -44,6 +43,7 @@ export const anisotropyB = TSL.anisotropyB;
44
43
  export const anisotropyT = TSL.anisotropyT;
45
44
  export const any = TSL.any;
46
45
  export const append = TSL.append;
46
+ export const array = TSL.array;
47
47
  export const arrayBuffer = TSL.arrayBuffer;
48
48
  export const asin = TSL.asin;
49
49
  export const assign = TSL.assign;
@@ -58,6 +58,7 @@ export const atomicOr = TSL.atomicOr;
58
58
  export const atomicStore = TSL.atomicStore;
59
59
  export const atomicSub = TSL.atomicSub;
60
60
  export const atomicXor = TSL.atomicXor;
61
+ export const atomicLoad = TSL.atomicLoad;
61
62
  export const attenuationColor = TSL.attenuationColor;
62
63
  export const attenuationDistance = TSL.attenuationDistance;
63
64
  export const attribute = TSL.attribute;
@@ -94,6 +95,7 @@ export const bypass = TSL.bypass;
94
95
  export const cache = TSL.cache;
95
96
  export const call = TSL.call;
96
97
  export const cameraFar = TSL.cameraFar;
98
+ export const cameraIndex = TSL.cameraIndex;
97
99
  export const cameraNear = TSL.cameraNear;
98
100
  export const cameraNormalMatrix = TSL.cameraNormalMatrix;
99
101
  export const cameraPosition = TSL.cameraPosition;
@@ -115,6 +117,7 @@ export const colorSpaceToWorking = TSL.colorSpaceToWorking;
115
117
  export const colorToDirection = TSL.colorToDirection;
116
118
  export const compute = TSL.compute;
117
119
  export const cond = TSL.cond;
120
+ export const Const = TSL.Const;
118
121
  export const context = TSL.context;
119
122
  export const convert = TSL.convert;
120
123
  export const convertColorSpace = TSL.convertColorSpace;
@@ -131,6 +134,7 @@ export const defined = TSL.defined;
131
134
  export const degrees = TSL.degrees;
132
135
  export const deltaTime = TSL.deltaTime;
133
136
  export const densityFog = TSL.densityFog;
137
+ export const densityFogFactor = TSL.densityFogFactor;
134
138
  export const depth = TSL.depth;
135
139
  export const depthPass = TSL.depthPass;
136
140
  export const difference = TSL.difference;
@@ -154,6 +158,7 @@ export const exp2 = TSL.exp2;
154
158
  export const expression = TSL.expression;
155
159
  export const faceDirection = TSL.faceDirection;
156
160
  export const faceForward = TSL.faceForward;
161
+ export const faceforward = TSL.faceforward;
157
162
  export const float = TSL.float;
158
163
  export const floor = TSL.floor;
159
164
  export const fog = TSL.fog;
@@ -182,8 +187,8 @@ export const grayscale = TSL.grayscale;
182
187
  export const greaterThan = TSL.greaterThan;
183
188
  export const greaterThanEqual = TSL.greaterThanEqual;
184
189
  export const hash = TSL.hash;
185
- export const highPrecisionModelNormalViewMatrix = TSL.highPrecisionModelNormalViewMatrix;
186
- export const highPrecisionModelViewMatrix = TSL.highPrecisionModelViewMatrix;
190
+ export const highpModelNormalViewMatrix = TSL.highpModelNormalViewMatrix;
191
+ export const highpModelViewMatrix = TSL.highpModelViewMatrix;
187
192
  export const hue = TSL.hue;
188
193
  export const instance = TSL.instance;
189
194
  export const instanceIndex = TSL.instanceIndex;
@@ -193,6 +198,7 @@ export const instancedDynamicBufferAttribute = TSL.instancedDynamicBufferAttribu
193
198
  export const instancedMesh = TSL.instancedMesh;
194
199
  export const int = TSL.int;
195
200
  export const inverseSqrt = TSL.inverseSqrt;
201
+ export const inversesqrt = TSL.inversesqrt;
196
202
  export const invocationLocalIndex = TSL.invocationLocalIndex;
197
203
  export const invocationSubgroupIndex = TSL.invocationSubgroupIndex;
198
204
  export const ior = TSL.ior;
@@ -217,16 +223,18 @@ export const lights = TSL.lights;
217
223
  export const linearDepth = TSL.linearDepth;
218
224
  export const linearToneMapping = TSL.linearToneMapping;
219
225
  export const localId = TSL.localId;
226
+ export const globalId = TSL.globalId;
220
227
  export const log = TSL.log;
221
228
  export const log2 = TSL.log2;
222
229
  export const logarithmicDepthToViewZ = TSL.logarithmicDepthToViewZ;
223
230
  export const loop = TSL.loop;
224
231
  export const luminance = TSL.luminance;
232
+ export const mediumpModelViewMatrix = TSL.mediumpModelViewMatrix;
225
233
  export const mat2 = TSL.mat2;
226
234
  export const mat3 = TSL.mat3;
227
235
  export const mat4 = TSL.mat4;
228
236
  export const matcapUV = TSL.matcapUV;
229
- export const materialAOMap = TSL.materialAOMap;
237
+ export const materialAO = TSL.materialAO;
230
238
  export const materialAlphaTest = TSL.materialAlphaTest;
231
239
  export const materialAnisotropy = TSL.materialAnisotropy;
232
240
  export const materialAnisotropyVector = TSL.materialAnisotropyVector;
@@ -251,7 +259,7 @@ export const materialLineWidth = TSL.materialLineWidth;
251
259
  export const materialMetalness = TSL.materialMetalness;
252
260
  export const materialNormal = TSL.materialNormal;
253
261
  export const materialOpacity = TSL.materialOpacity;
254
- export const materialPointWidth = TSL.materialPointWidth;
262
+ export const materialPointSize = TSL.materialPointSize;
255
263
  export const materialReference = TSL.materialReference;
256
264
  export const materialReflectivity = TSL.materialReflectivity;
257
265
  export const materialRefractionRatio = TSL.materialRefractionRatio;
@@ -370,6 +378,7 @@ export const radians = TSL.radians;
370
378
  export const rand = TSL.rand;
371
379
  export const range = TSL.range;
372
380
  export const rangeFog = TSL.rangeFog;
381
+ export const rangeFogFactor = TSL.rangeFogFactor;
373
382
  export const reciprocal = TSL.reciprocal;
374
383
  export const reference = TSL.reference;
375
384
  export const referenceBuffer = TSL.referenceBuffer;
@@ -407,7 +416,9 @@ export const select = TSL.select;
407
416
  export const setCurrentStack = TSL.setCurrentStack;
408
417
  export const shaderStages = TSL.shaderStages;
409
418
  export const shadow = TSL.shadow;
419
+ export const shadowPositionWorld = TSL.shadowPositionWorld;
410
420
  export const sharedUniformGroup = TSL.sharedUniformGroup;
421
+ export const shapeCircle = TSL.shapeCircle;
411
422
  export const sheen = TSL.sheen;
412
423
  export const sheenRoughness = TSL.sheenRoughness;
413
424
  export const shiftLeft = TSL.shiftLeft;
@@ -433,6 +444,7 @@ export const storageBarrier = TSL.storageBarrier;
433
444
  export const storageObject = TSL.storageObject;
434
445
  export const storageTexture = TSL.storageTexture;
435
446
  export const string = TSL.string;
447
+ export const struct = TSL.struct;
436
448
  export const sub = TSL.sub;
437
449
  export const subgroupIndex = TSL.subgroupIndex;
438
450
  export const subgroupSize = TSL.subgroupSize;
@@ -491,6 +503,7 @@ export const uv = TSL.uv;
491
503
  export const uvec2 = TSL.uvec2;
492
504
  export const uvec3 = TSL.uvec3;
493
505
  export const uvec4 = TSL.uvec4;
506
+ export const Var = TSL.Var;
494
507
  export const varying = TSL.varying;
495
508
  export const varyingProperty = TSL.varyingProperty;
496
509
  export const vec2 = TSL.vec2;
@@ -7,8 +7,8 @@ export { default as BundleGroup } from './renderers/common/BundleGroup.js';
7
7
  export { default as QuadMesh } from './renderers/common/QuadMesh.js';
8
8
  export { default as PMREMGenerator } from './renderers/common/extras/PMREMGenerator.js';
9
9
  export { default as PostProcessing } from './renderers/common/PostProcessing.js';
10
- import * as PostProcessingUtils from './renderers/common/PostProcessingUtils.js';
11
- export { PostProcessingUtils };
10
+ import * as RendererUtils from './renderers/common/RendererUtils.js';
11
+ export { RendererUtils };
12
12
  export { default as StorageTexture } from './renderers/common/StorageTexture.js';
13
13
  export { default as StorageBufferAttribute } from './renderers/common/StorageBufferAttribute.js';
14
14
  export { default as StorageInstancedBufferAttribute } from './renderers/common/StorageInstancedBufferAttribute.js';
@@ -7,8 +7,8 @@ export { default as BundleGroup } from './renderers/common/BundleGroup.js';
7
7
  export { default as QuadMesh } from './renderers/common/QuadMesh.js';
8
8
  export { default as PMREMGenerator } from './renderers/common/extras/PMREMGenerator.js';
9
9
  export { default as PostProcessing } from './renderers/common/PostProcessing.js';
10
- import * as PostProcessingUtils from './renderers/common/PostProcessingUtils.js';
11
- export { PostProcessingUtils };
10
+ import * as RendererUtils from './renderers/common/RendererUtils.js';
11
+ export { RendererUtils };
12
12
  export { default as StorageTexture } from './renderers/common/StorageTexture.js';
13
13
  export { default as StorageBufferAttribute } from './renderers/common/StorageBufferAttribute.js';
14
14
  export { default as StorageInstancedBufferAttribute } from './renderers/common/StorageInstancedBufferAttribute.js';
@@ -569,11 +569,11 @@ class PropertyBinding {
569
569
 
570
570
  this.targetObject = targetObject;
571
571
 
572
- if ( targetObject.needsUpdate !== undefined ) { // material
572
+ if ( targetObject.isMaterial === true ) {
573
573
 
574
574
  versioning = this.Versioning.NeedsUpdate;
575
575
 
576
- } else if ( targetObject.matrixWorldNeedsUpdate !== undefined ) { // node transform
576
+ } else if ( targetObject.isObject3D === true ) {
577
577
 
578
578
  versioning = this.Versioning.MatrixWorldNeedsUpdate;
579
579
 
@@ -9,6 +9,7 @@ class ArrayCamera extends PerspectiveCamera {
9
9
  this.isArrayCamera = true;
10
10
 
11
11
  this.cameras = array;
12
+ this.index = 0;
12
13
 
13
14
  }
14
15
 
@@ -62,7 +62,7 @@ class PerspectiveCamera extends Camera {
62
62
  * The default film gauge is 35, so that the focal length can be specified for
63
63
  * a 35mm (full frame) camera.
64
64
  *
65
- * Values for focal length and film gauge must have the same unit.
65
+ * @param {number} focalLength - Values for focal length and film gauge must have the same unit.
66
66
  */
67
67
  setFocalLength( focalLength ) {
68
68
 
@@ -76,6 +76,8 @@ class PerspectiveCamera extends Camera {
76
76
 
77
77
  /**
78
78
  * Calculates the focal length from the current .fov and .filmGauge.
79
+ *
80
+ * @returns {number}
79
81
  */
80
82
  getFocalLength() {
81
83
 
@@ -109,6 +111,10 @@ class PerspectiveCamera extends Camera {
109
111
  /**
110
112
  * Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction.
111
113
  * Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle.
114
+ *
115
+ * @param {number} distance
116
+ * @param {Vector2} minTarget
117
+ * @param {Vector2} maxTarget
112
118
  */
113
119
  getViewBounds( distance, minTarget, maxTarget ) {
114
120
 
@@ -124,7 +130,10 @@ class PerspectiveCamera extends Camera {
124
130
 
125
131
  /**
126
132
  * Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.
127
- * Copies the result into the target Vector2, where x is width and y is height.
133
+ *
134
+ * @param {number} distance
135
+ * @param {Vector2} target - Vector2 target used to store result where x is width and y is height.
136
+ * @returns {Vector2}
128
137
  */
129
138
  getViewSize( distance, target ) {
130
139
 
@@ -168,6 +177,13 @@ class PerspectiveCamera extends Camera {
168
177
  * camera.setViewOffset( fullWidth, fullHeight, w * 2, h * 1, w, h );
169
178
  *
170
179
  * Note there is no reason monitors have to be the same size or in a grid.
180
+ *
181
+ * @param {number} fullWidth
182
+ * @param {number} fullHeight
183
+ * @param {number} x
184
+ * @param {number} y
185
+ * @param {number} width
186
+ * @param {number} height
171
187
  */
172
188
  setViewOffset( fullWidth, fullHeight, x, y, width, height ) {
173
189
 
package/src/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- export const REVISION = '171';
1
+ export const REVISION = '173';
2
2
 
3
3
  export const MOUSE = { LEFT: 0, MIDDLE: 1, RIGHT: 2, ROTATE: 0, DOLLY: 1, PAN: 2 };
4
4
  export const TOUCH = { ROTATE: 0, PAN: 1, DOLLY_PAN: 2, DOLLY_ROTATE: 3 };
@@ -209,3 +209,8 @@ export const GLSL3 = '300 es';
209
209
 
210
210
  export const WebGLCoordinateSystem = 2000;
211
211
  export const WebGPUCoordinateSystem = 2001;
212
+
213
+ export const TimestampQuery = {
214
+ COMPUTE: 'compute',
215
+ RENDER: 'render'
216
+ };
@@ -7,6 +7,8 @@ import { fromHalfFloat, toHalfFloat } from '../extras/DataUtils.js';
7
7
  const _vector = /*@__PURE__*/ new Vector3();
8
8
  const _vector2 = /*@__PURE__*/ new Vector2();
9
9
 
10
+ let _id = 0;
11
+
10
12
  class BufferAttribute {
11
13
 
12
14
  constructor( array, itemSize, normalized = false ) {
@@ -19,6 +21,8 @@ class BufferAttribute {
19
21
 
20
22
  this.isBufferAttribute = true;
21
23
 
24
+ Object.defineProperty( this, 'id', { value: _id ++ } );
25
+
22
26
  this.name = '';
23
27
 
24
28
  this.array = array;