super-three 0.170.1 → 0.172.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 (413) hide show
  1. package/README.md +1 -1
  2. package/build/three.cjs +157 -49
  3. package/build/three.core.js +104 -42
  4. package/build/three.core.min.js +1 -1
  5. package/build/three.module.js +53 -8
  6. package/build/three.module.min.js +1 -1
  7. package/build/three.tsl.js +10 -5
  8. package/build/three.tsl.min.js +1 -1
  9. package/build/three.webgpu.js +21191 -1008
  10. package/build/three.webgpu.min.js +1 -1
  11. package/build/three.webgpu.nodes.js +21189 -1008
  12. package/build/three.webgpu.nodes.min.js +1 -1
  13. package/examples/jsm/Addons.js +0 -5
  14. package/examples/jsm/animation/CCDIKSolver.js +3 -2
  15. package/examples/jsm/controls/ArcballControls.js +28 -19
  16. package/examples/jsm/controls/OrbitControls.js +5 -4
  17. package/examples/jsm/csm/CSMShadowNode.js +16 -11
  18. package/examples/jsm/curves/NURBSCurve.js +1 -1
  19. package/examples/jsm/curves/NURBSUtils.js +3 -0
  20. package/examples/jsm/effects/OutlineEffect.js +1 -1
  21. package/examples/jsm/exporters/GLTFExporter.js +11 -7
  22. package/examples/jsm/exporters/KTX2Exporter.js +1 -1
  23. package/examples/jsm/exporters/PLYExporter.js +2 -2
  24. package/examples/jsm/helpers/TextureHelperGPU.js +15 -5
  25. package/examples/jsm/helpers/VertexNormalsHelper.js +2 -0
  26. package/examples/jsm/lights/LightProbeGenerator.js +3 -3
  27. package/examples/jsm/lines/webgpu/LineSegments2.js +15 -6
  28. package/examples/jsm/loaders/3MFLoader.js +6 -3
  29. package/examples/jsm/loaders/BVHLoader.js +1 -1
  30. package/examples/jsm/loaders/ColladaLoader.js +5 -5
  31. package/examples/jsm/loaders/DDSLoader.js +42 -0
  32. package/examples/jsm/loaders/GCodeLoader.js +1 -1
  33. package/examples/jsm/loaders/GLTFLoader.js +22 -2
  34. package/examples/jsm/loaders/KTX2Loader.js +6 -1
  35. package/examples/jsm/loaders/KTXLoader.js +4 -4
  36. package/examples/jsm/loaders/LDrawLoader.js +1 -1
  37. package/examples/jsm/loaders/LottieLoader.js +1 -1
  38. package/examples/jsm/loaders/MTLLoader.js +1 -0
  39. package/examples/jsm/loaders/NRRDLoader.js +1 -1
  40. package/examples/jsm/loaders/PLYLoader.js +7 -7
  41. package/examples/jsm/loaders/PVRLoader.js +1 -1
  42. package/examples/jsm/loaders/SVGLoader.js +2 -2
  43. package/examples/jsm/loaders/TDSLoader.js +1 -1
  44. package/examples/jsm/loaders/VRMLLoader.js +7 -7
  45. package/examples/jsm/loaders/lwo/IFFParser.js +4 -4
  46. package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +1 -1
  47. package/examples/jsm/math/ConvexHull.js +1 -1
  48. package/examples/jsm/math/OBB.js +17 -0
  49. package/examples/jsm/misc/ProgressiveLightMapGPU.js +10 -10
  50. package/examples/jsm/misc/Volume.js +20 -12
  51. package/examples/jsm/misc/VolumeSlice.js +2 -2
  52. package/examples/jsm/modifiers/CurveModifier.js +10 -8
  53. package/examples/jsm/modifiers/CurveModifierGPU.js +9 -7
  54. package/examples/jsm/modifiers/SimplifyModifier.js +2 -2
  55. package/examples/jsm/objects/GroundedSkybox.js +4 -4
  56. package/examples/jsm/objects/Sky.js +2 -2
  57. package/examples/jsm/objects/SkyMesh.js +3 -3
  58. package/examples/jsm/objects/Water2.js +1 -1
  59. package/examples/jsm/objects/Water2Mesh.js +2 -2
  60. package/examples/jsm/objects/WaterMesh.js +4 -4
  61. package/examples/jsm/postprocessing/BloomPass.js +2 -2
  62. package/examples/jsm/postprocessing/EffectComposer.js +1 -2
  63. package/examples/jsm/postprocessing/OutlinePass.js +4 -4
  64. package/examples/jsm/postprocessing/SAOPass.js +1 -2
  65. package/examples/jsm/postprocessing/SMAAPass.js +1 -3
  66. package/examples/jsm/postprocessing/SSAOPass.js +2 -4
  67. package/examples/jsm/postprocessing/SSRPass.js +2 -4
  68. package/examples/jsm/postprocessing/UnrealBloomPass.js +2 -2
  69. package/examples/jsm/renderers/SVGRenderer.js +6 -4
  70. package/examples/jsm/shaders/BokehShader2.js +1 -1
  71. package/examples/jsm/shaders/GodRaysShader.js +3 -3
  72. package/examples/jsm/shaders/SobelOperatorShader.js +1 -1
  73. package/examples/jsm/tsl/display/AfterImageNode.js +93 -4
  74. package/examples/jsm/tsl/display/AnaglyphPassNode.js +46 -2
  75. package/examples/jsm/tsl/display/AnamorphicNode.js +118 -5
  76. package/examples/jsm/tsl/display/BleachBypass.js +10 -0
  77. package/examples/jsm/tsl/display/BloomNode.js +233 -26
  78. package/examples/jsm/tsl/display/DenoiseNode.js +141 -25
  79. package/examples/jsm/tsl/display/DepthOfFieldNode.js +80 -1
  80. package/examples/jsm/tsl/display/DotScreenNode.js +50 -5
  81. package/examples/jsm/tsl/display/FXAANode.js +52 -3
  82. package/examples/jsm/tsl/display/FilmNode.js +47 -1
  83. package/examples/jsm/tsl/display/GTAONode.js +210 -14
  84. package/examples/jsm/tsl/display/GaussianBlurNode.js +152 -8
  85. package/examples/jsm/tsl/display/LensflareNode.js +131 -13
  86. package/examples/jsm/tsl/display/Lut3DNode.js +55 -1
  87. package/examples/jsm/tsl/display/MotionBlur.js +12 -2
  88. package/examples/jsm/tsl/display/OutlineNode.js +343 -26
  89. package/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +36 -2
  90. package/examples/jsm/tsl/display/PixelationPassNode.js +142 -9
  91. package/examples/jsm/tsl/display/RGBShiftNode.js +49 -2
  92. package/examples/jsm/tsl/display/SMAANode.js +187 -46
  93. package/examples/jsm/tsl/display/SSAAPassNode.js +110 -25
  94. package/examples/jsm/tsl/display/SSRNode.js +194 -21
  95. package/examples/jsm/tsl/display/Sepia.js +9 -0
  96. package/examples/jsm/tsl/display/SobelOperatorNode.js +54 -4
  97. package/examples/jsm/tsl/display/StereoCompositePassNode.js +79 -3
  98. package/examples/jsm/tsl/display/StereoPassNode.js +41 -3
  99. package/examples/jsm/tsl/display/TRAAPassNode.js +116 -21
  100. package/examples/jsm/tsl/display/TransitionNode.js +71 -6
  101. package/examples/jsm/tsl/display/hashBlur.js +14 -3
  102. package/examples/jsm/tsl/lighting/TiledLightsNode.js +40 -34
  103. package/examples/jsm/utils/BufferGeometryUtils.js +1 -1
  104. package/examples/jsm/utils/CameraUtils.js +4 -1
  105. package/examples/jsm/utils/GeometryUtils.js +22 -19
  106. package/examples/jsm/utils/SceneUtils.js +2 -2
  107. package/examples/jsm/webxr/XRControllerModelFactory.js +6 -1
  108. package/examples/jsm/webxr/XREstimatedLight.js +1 -1
  109. package/package.json +8 -3
  110. package/src/Three.Core.js +2 -0
  111. package/src/Three.Legacy.js +0 -21
  112. package/src/Three.TSL.js +9 -4
  113. package/src/Three.WebGPU.Nodes.js +2 -2
  114. package/src/Three.WebGPU.js +2 -2
  115. package/src/animation/PropertyBinding.js +2 -2
  116. package/src/cameras/PerspectiveCamera.js +18 -2
  117. package/src/constants.js +1 -1
  118. package/src/core/RenderTarget.js +18 -0
  119. package/src/core/RenderTarget3D.js +22 -0
  120. package/src/core/RenderTargetArray.js +22 -0
  121. package/src/extras/Earcut.js +1 -1
  122. package/src/extras/PMREMGenerator.js +20 -0
  123. package/src/extras/TextureUtils.js +6 -0
  124. package/src/helpers/CameraHelper.js +16 -13
  125. package/src/loaders/nodes/NodeLoader.js +59 -0
  126. package/src/loaders/nodes/NodeMaterialLoader.js +45 -0
  127. package/src/loaders/nodes/NodeObjectLoader.js +61 -0
  128. package/src/materials/nodes/InstancedPointsNodeMaterial.js +72 -19
  129. package/src/materials/nodes/Line2NodeMaterial.js +128 -34
  130. package/src/materials/nodes/LineBasicNodeMaterial.js +17 -2
  131. package/src/materials/nodes/LineDashedNodeMaterial.js +78 -5
  132. package/src/materials/nodes/MeshBasicNodeMaterial.js +56 -0
  133. package/src/materials/nodes/MeshLambertNodeMaterial.js +35 -0
  134. package/src/materials/nodes/MeshMatcapNodeMaterial.js +22 -2
  135. package/src/materials/nodes/MeshNormalNodeMaterial.js +21 -2
  136. package/src/materials/nodes/MeshPhongNodeMaterial.js +64 -1
  137. package/src/materials/nodes/MeshPhysicalNodeMaterial.js +269 -0
  138. package/src/materials/nodes/MeshSSSNodeMaterial.js +97 -6
  139. package/src/materials/nodes/MeshStandardNodeMaterial.js +78 -0
  140. package/src/materials/nodes/MeshToonNodeMaterial.js +28 -0
  141. package/src/materials/nodes/NodeMaterial.js +474 -21
  142. package/src/materials/nodes/PointsNodeMaterial.js +22 -13
  143. package/src/materials/nodes/ShadowNodeMaterial.js +29 -0
  144. package/src/materials/nodes/SpriteNodeMaterial.js +77 -19
  145. package/src/materials/nodes/VolumeNodeMaterial.js +80 -4
  146. package/src/materials/nodes/manager/NodeMaterialObserver.js +87 -0
  147. package/src/nodes/Nodes.js +1 -6
  148. package/src/nodes/TSL.js +2 -3
  149. package/src/nodes/accessors/AccessorsUtils.js +27 -0
  150. package/src/nodes/accessors/Arrays.js +24 -5
  151. package/src/nodes/accessors/BatchNode.js +39 -3
  152. package/src/nodes/accessors/Bitangent.js +37 -0
  153. package/src/nodes/accessors/BufferAttributeNode.js +178 -5
  154. package/src/nodes/accessors/BufferNode.js +63 -0
  155. package/src/nodes/accessors/BuiltinNode.js +38 -0
  156. package/src/nodes/accessors/Camera.js +49 -0
  157. package/src/nodes/accessors/ClippingNode.js +71 -2
  158. package/src/nodes/accessors/CubeTextureNode.js +64 -0
  159. package/src/nodes/accessors/InstanceNode.js +85 -2
  160. package/src/nodes/accessors/InstancedMeshNode.js +28 -3
  161. package/src/nodes/accessors/InstancedPointsMaterialNode.js +13 -0
  162. package/src/nodes/accessors/Lights.js +50 -1
  163. package/src/nodes/accessors/MaterialNode.js +302 -8
  164. package/src/nodes/accessors/MaterialProperties.js +7 -0
  165. package/src/nodes/accessors/MaterialReferenceNode.js +53 -13
  166. package/src/nodes/accessors/ModelNode.js +100 -5
  167. package/src/nodes/accessors/ModelViewProjectionNode.js +10 -38
  168. package/src/nodes/accessors/MorphNode.js +48 -4
  169. package/src/nodes/accessors/Normal.js +59 -3
  170. package/src/nodes/accessors/Object3DNode.js +102 -1
  171. package/src/nodes/accessors/PointUVNode.js +26 -0
  172. package/src/nodes/accessors/Position.js +53 -4
  173. package/src/nodes/accessors/ReferenceBaseNode.js +188 -0
  174. package/src/nodes/accessors/ReferenceNode.js +202 -2
  175. package/src/nodes/accessors/ReflectVector.js +24 -0
  176. package/src/nodes/accessors/RendererReferenceNode.js +46 -1
  177. package/src/nodes/accessors/SceneNode.js +54 -0
  178. package/src/nodes/accessors/SkinningNode.js +127 -1
  179. package/src/nodes/accessors/StorageBufferNode.js +168 -4
  180. package/src/nodes/accessors/StorageTextureNode.js +118 -0
  181. package/src/nodes/accessors/Tangent.js +36 -0
  182. package/src/nodes/accessors/Texture3DNode.js +89 -5
  183. package/src/nodes/accessors/TextureBicubic.js +12 -2
  184. package/src/nodes/accessors/TextureNode.js +309 -10
  185. package/src/nodes/accessors/TextureSizeNode.js +42 -0
  186. package/src/nodes/accessors/UV.js +10 -1
  187. package/src/nodes/accessors/UniformArrayNode.js +223 -23
  188. package/src/nodes/accessors/UserDataNode.js +46 -0
  189. package/src/nodes/accessors/VelocityNode.js +82 -0
  190. package/src/nodes/accessors/VertexColorNode.js +39 -2
  191. package/src/nodes/code/CodeNode.js +95 -1
  192. package/src/nodes/code/ExpressionNode.js +28 -0
  193. package/src/nodes/code/FunctionCallNode.js +37 -0
  194. package/src/nodes/code/FunctionNode.js +45 -0
  195. package/src/nodes/code/ScriptableNode.js +223 -1
  196. package/src/nodes/code/ScriptableValueNode.js +85 -1
  197. package/src/nodes/core/AssignNode.js +48 -2
  198. package/src/nodes/core/AttributeNode.js +43 -0
  199. package/src/nodes/core/BypassNode.js +47 -2
  200. package/src/nodes/core/CacheNode.js +53 -2
  201. package/src/nodes/core/ConstNode.js +24 -0
  202. package/src/nodes/core/ContextNode.js +65 -0
  203. package/src/nodes/core/IndexNode.js +68 -7
  204. package/src/nodes/core/InputNode.js +48 -0
  205. package/src/nodes/core/LightingModel.js +60 -0
  206. package/src/nodes/core/MRTNode.js +66 -0
  207. package/src/nodes/core/Node.js +337 -12
  208. package/src/nodes/core/NodeAttribute.js +38 -0
  209. package/src/nodes/core/NodeBuilder.js +945 -15
  210. package/src/nodes/core/NodeCache.js +41 -2
  211. package/src/nodes/core/NodeCode.js +31 -0
  212. package/src/nodes/core/NodeFrame.js +123 -2
  213. package/src/nodes/core/NodeFunction.js +46 -0
  214. package/src/nodes/core/NodeFunctionInput.js +44 -0
  215. package/src/nodes/core/NodeParser.js +11 -0
  216. package/src/nodes/core/NodeUniform.js +52 -0
  217. package/src/nodes/core/NodeUtils.js +141 -0
  218. package/src/nodes/core/NodeVar.js +30 -0
  219. package/src/nodes/core/NodeVarying.js +28 -0
  220. package/src/nodes/core/OutputStructNode.js +33 -2
  221. package/src/nodes/core/ParameterNode.js +28 -0
  222. package/src/nodes/core/PropertyNode.js +232 -0
  223. package/src/nodes/core/StackNode.js +78 -0
  224. package/src/nodes/core/StructTypeNode.js +39 -1
  225. package/src/nodes/core/TempNode.js +30 -4
  226. package/src/nodes/core/UniformGroupNode.js +82 -7
  227. package/src/nodes/core/UniformNode.js +66 -0
  228. package/src/nodes/core/VarNode.js +52 -0
  229. package/src/nodes/core/VaryingNode.js +83 -2
  230. package/src/nodes/core/constants.js +36 -0
  231. package/src/nodes/display/BumpMapNode.js +37 -0
  232. package/src/nodes/display/ColorAdjustment.js +53 -11
  233. package/src/nodes/display/ColorSpaceFunctions.js +16 -0
  234. package/src/nodes/display/ColorSpaceNode.js +82 -0
  235. package/src/nodes/display/FrontFacingNode.js +29 -0
  236. package/src/nodes/display/NormalMapNode.js +43 -0
  237. package/src/nodes/display/PassNode.js +298 -7
  238. package/src/nodes/display/PosterizeNode.js +33 -0
  239. package/src/nodes/display/RenderOutputNode.js +66 -1
  240. package/src/nodes/display/ScreenNode.js +87 -0
  241. package/src/nodes/display/ToneMappingFunctions.js +58 -10
  242. package/src/nodes/display/ToneMappingNode.js +55 -2
  243. package/src/nodes/display/ToonOutlinePassNode.js +73 -0
  244. package/src/nodes/display/ViewportDepthNode.js +122 -8
  245. package/src/nodes/display/ViewportDepthTextureNode.js +23 -0
  246. package/src/nodes/display/ViewportSharedTextureNode.js +23 -0
  247. package/src/nodes/display/ViewportTextureNode.js +57 -0
  248. package/src/nodes/fog/Fog.js +93 -0
  249. package/src/nodes/functions/BasicLightingModel.js +24 -0
  250. package/src/nodes/functions/PhongLightingModel.js +34 -2
  251. package/src/nodes/functions/PhysicalLightingModel.js +167 -8
  252. package/src/nodes/functions/ShadowMaskModel.js +23 -0
  253. package/src/nodes/functions/ToonLightingModel.js +20 -0
  254. package/src/nodes/functions/material/getAlphaHashThreshold.js +1 -3
  255. package/src/nodes/functions/material/getParallaxCorrectNormal.js +16 -1
  256. package/src/nodes/geometry/RangeNode.js +54 -2
  257. package/src/nodes/gpgpu/AtomicFunctionNode.js +157 -1
  258. package/src/nodes/gpgpu/BarrierNode.js +47 -0
  259. package/src/nodes/gpgpu/ComputeBuiltinNode.js +126 -0
  260. package/src/nodes/gpgpu/ComputeNode.js +106 -2
  261. package/src/nodes/gpgpu/WorkgroupInfoNode.js +115 -6
  262. package/src/nodes/lighting/AONode.js +18 -0
  263. package/src/nodes/lighting/AmbientLightNode.js +10 -0
  264. package/src/nodes/lighting/AnalyticLightNode.js +97 -2
  265. package/src/nodes/lighting/BasicEnvironmentNode.js +19 -0
  266. package/src/nodes/lighting/BasicLightMapNode.js +17 -0
  267. package/src/nodes/lighting/DirectionalLightNode.js +10 -0
  268. package/src/nodes/lighting/EnvironmentNode.js +18 -0
  269. package/src/nodes/lighting/HemisphereLightNode.js +31 -0
  270. package/src/nodes/lighting/IESSpotLightNode.js +11 -0
  271. package/src/nodes/lighting/IrradianceNode.js +17 -0
  272. package/src/nodes/lighting/LightProbeNode.js +20 -0
  273. package/src/nodes/lighting/LightUtils.js +12 -0
  274. package/src/nodes/lighting/LightingContextNode.js +48 -0
  275. package/src/nodes/lighting/LightingNode.js +15 -6
  276. package/src/nodes/lighting/LightsNode.js +132 -1
  277. package/src/nodes/lighting/PointLightNode.js +32 -1
  278. package/src/nodes/lighting/PointShadowNode.js +54 -1
  279. package/src/nodes/lighting/RectAreaLightNode.js +44 -6
  280. package/src/nodes/lighting/ShadowBaseNode.js +93 -0
  281. package/src/nodes/lighting/ShadowNode.js +240 -34
  282. package/src/nodes/lighting/SpotLightNode.js +43 -0
  283. package/src/nodes/math/ConditionalNode.js +70 -3
  284. package/src/nodes/math/Hash.js +9 -0
  285. package/src/nodes/math/MathNode.js +614 -11
  286. package/src/nodes/math/MathUtils.js +45 -1
  287. package/src/nodes/math/OperatorNode.js +233 -0
  288. package/src/nodes/math/TriNoise3D.js +18 -7
  289. package/src/nodes/parsers/GLSLNodeFunction.js +16 -0
  290. package/src/nodes/parsers/GLSLNodeParser.js +11 -0
  291. package/src/nodes/pmrem/PMREMNode.js +133 -0
  292. package/src/nodes/pmrem/PMREMUtils.js +1 -1
  293. package/src/nodes/procedural/Checker.js +9 -0
  294. package/src/nodes/tsl/TSLBase.js +2 -2
  295. package/src/nodes/utils/ArrayElementNode.js +38 -2
  296. package/src/nodes/utils/ConvertNode.js +31 -0
  297. package/src/nodes/utils/CubeMapNode.js +78 -0
  298. package/src/nodes/utils/Discard.js +16 -0
  299. package/src/nodes/utils/EquirectUVNode.js +31 -1
  300. package/src/nodes/utils/FlipNode.js +38 -0
  301. package/src/nodes/utils/FunctionOverloadingNode.js +53 -1
  302. package/src/nodes/utils/JoinNode.js +25 -0
  303. package/src/nodes/utils/LoopNode.js +74 -1
  304. package/src/nodes/utils/MatcapUVNode.js +17 -0
  305. package/src/nodes/utils/MaxMipLevelNode.js +49 -0
  306. package/src/nodes/utils/Oscillators.js +33 -0
  307. package/src/nodes/utils/Packing.js +17 -0
  308. package/src/nodes/utils/PostProcessingUtils.js +28 -23
  309. package/src/nodes/utils/RTTNode.js +123 -2
  310. package/src/nodes/utils/ReflectorNode.js +174 -4
  311. package/src/nodes/utils/RemapNode.js +79 -0
  312. package/src/nodes/utils/RotateNode.js +41 -0
  313. package/src/nodes/utils/SetNode.js +44 -1
  314. package/src/nodes/utils/SplitNode.js +55 -3
  315. package/src/nodes/utils/SpriteSheetUVNode.js +46 -0
  316. package/src/nodes/utils/SpriteUtils.js +17 -0
  317. package/src/nodes/utils/StorageArrayElementNode.js +40 -0
  318. package/src/nodes/utils/Timer.js +19 -0
  319. package/src/nodes/utils/TriplanarTexturesNode.js +84 -0
  320. package/src/nodes/utils/UVUtils.js +20 -0
  321. package/src/nodes/utils/ViewportUtils.js +13 -0
  322. package/src/objects/BatchedMesh.js +1 -2
  323. package/src/objects/ClippingGroup.js +49 -0
  324. package/src/renderers/WebGLRenderer.js +23 -4
  325. package/src/renderers/common/Animation.js +63 -0
  326. package/src/renderers/common/Attributes.js +36 -0
  327. package/src/renderers/common/Backend.js +467 -52
  328. package/src/renderers/common/Background.js +34 -1
  329. package/src/renderers/common/BindGroup.js +43 -0
  330. package/src/renderers/common/Binding.js +35 -0
  331. package/src/renderers/common/Bindings.js +93 -1
  332. package/src/renderers/common/Buffer.js +49 -0
  333. package/src/renderers/common/BufferUtils.js +27 -0
  334. package/src/renderers/common/BundleGroup.js +57 -0
  335. package/src/renderers/common/ChainMap.js +38 -1
  336. package/src/renderers/common/ClippingContext.js +107 -14
  337. package/src/renderers/common/Color4.js +36 -0
  338. package/src/renderers/common/ComputePipeline.js +24 -0
  339. package/src/renderers/common/CubeRenderTarget.js +13 -0
  340. package/src/renderers/common/DataMap.js +37 -1
  341. package/src/renderers/common/Geometries.js +98 -0
  342. package/src/renderers/common/IndirectStorageBufferAttribute.js +25 -2
  343. package/src/renderers/common/Info.js +87 -0
  344. package/src/renderers/common/Lighting.js +26 -0
  345. package/src/renderers/common/Pipeline.js +22 -0
  346. package/src/renderers/common/Pipelines.js +148 -5
  347. package/src/renderers/common/PostProcessing.js +75 -3
  348. package/src/renderers/common/ProgrammableStage.js +60 -2
  349. package/src/renderers/common/QuadMesh.js +54 -5
  350. package/src/renderers/common/RenderBundle.js +14 -8
  351. package/src/renderers/common/RenderBundles.js +33 -10
  352. package/src/renderers/common/RenderContext.js +169 -4
  353. package/src/renderers/common/RenderContexts.js +42 -2
  354. package/src/renderers/common/RenderList.js +178 -0
  355. package/src/renderers/common/RenderLists.js +31 -0
  356. package/src/renderers/common/RenderObject.js +328 -4
  357. package/src/renderers/common/RenderObjects.js +101 -7
  358. package/src/renderers/common/RenderPipeline.js +24 -0
  359. package/src/renderers/common/Renderer.js +1096 -31
  360. package/src/renderers/common/RendererUtils.js +193 -0
  361. package/src/renderers/common/SampledTexture.js +121 -0
  362. package/src/renderers/common/Sampler.js +30 -0
  363. package/src/renderers/common/StorageBuffer.js +24 -0
  364. package/src/renderers/common/StorageBufferAttribute.js +31 -2
  365. package/src/renderers/common/StorageInstancedBufferAttribute.js +31 -2
  366. package/src/renderers/common/StorageTexture.js +38 -0
  367. package/src/renderers/common/Textures.js +83 -0
  368. package/src/renderers/common/Uniform.js +188 -2
  369. package/src/renderers/common/UniformBuffer.js +19 -0
  370. package/src/renderers/common/UniformsGroup.js +139 -2
  371. package/src/renderers/common/extras/PMREMGenerator.js +24 -3
  372. package/src/renderers/common/nodes/NodeBuilderState.js +95 -1
  373. package/src/renderers/common/nodes/NodeLibrary.js +89 -0
  374. package/src/renderers/common/nodes/NodeSampledTexture.js +91 -2
  375. package/src/renderers/common/nodes/NodeSampler.js +28 -0
  376. package/src/renderers/common/nodes/NodeStorageBuffer.js +35 -0
  377. package/src/renderers/common/nodes/NodeUniform.js +189 -0
  378. package/src/renderers/common/nodes/NodeUniformBuffer.js +29 -0
  379. package/src/renderers/common/nodes/NodeUniformsGroup.js +31 -18
  380. package/src/renderers/common/nodes/Nodes.js +327 -60
  381. package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +2 -2
  382. package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +7 -7
  383. package/src/renderers/webgl-fallback/WebGLBackend.js +547 -29
  384. package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +0 -1
  385. package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +1 -1
  386. package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +1 -1
  387. package/src/renderers/webgpu/WebGPUBackend.js +480 -49
  388. package/src/renderers/webgpu/WebGPURenderer.Nodes.js +34 -0
  389. package/src/renderers/webgpu/WebGPURenderer.js +35 -0
  390. package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +20 -8
  391. package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +21 -8
  392. package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +59 -11
  393. package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +17 -0
  394. package/src/renderers/webgpu/nodes/WGSLNodeParser.js +11 -0
  395. package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +10 -8
  396. package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +9 -1
  397. package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +5 -9
  398. package/src/renderers/webgpu/utils/WebGPUUtils.js +30 -0
  399. package/src/renderers/webxr/WebXRDepthSensing.js +1 -1
  400. package/src/renderers/webxr/WebXRManager.js +7 -1
  401. package/src/textures/Data3DTexture.js +2 -2
  402. package/src/textures/Texture.js +4 -0
  403. package/examples/jsm/animation/MMDAnimationHelper.js +0 -1209
  404. package/examples/jsm/animation/MMDPhysics.js +0 -1408
  405. package/examples/jsm/exporters/MMDExporter.js +0 -223
  406. package/examples/jsm/libs/mmdparser.module.js +0 -11530
  407. package/examples/jsm/loaders/MMDLoader.js +0 -2298
  408. package/examples/jsm/shaders/MMDToonShader.js +0 -134
  409. package/src/nodes/core/UniformGroup.js +0 -13
  410. package/src/nodes/fog/FogExp2Node.js +0 -35
  411. package/src/nodes/fog/FogNode.js +0 -50
  412. package/src/nodes/fog/FogRangeNode.js +0 -36
  413. package/src/renderers/common/PostProcessingUtils.js +0 -86
@@ -1,7 +1,5 @@
1
1
  export * from './animation/AnimationClipCreator.js';
2
2
  export * from './animation/CCDIKSolver.js';
3
- export * from './animation/MMDAnimationHelper.js';
4
- export * from './animation/MMDPhysics.js';
5
3
 
6
4
  export { default as WebGL } from './capabilities/WebGL.js';
7
5
 
@@ -40,7 +38,6 @@ export * from './exporters/DRACOExporter.js';
40
38
  export * from './exporters/EXRExporter.js';
41
39
  export * from './exporters/GLTFExporter.js';
42
40
  export * from './exporters/KTX2Exporter.js';
43
- export * from './exporters/MMDExporter.js';
44
41
  export * from './exporters/OBJExporter.js';
45
42
  export * from './exporters/PLYExporter.js';
46
43
  export * from './exporters/STLExporter.js';
@@ -105,7 +102,6 @@ export * from './loaders/LWOLoader.js';
105
102
  export * from './loaders/LottieLoader.js';
106
103
  export * from './loaders/MD2Loader.js';
107
104
  export * from './loaders/MDDLoader.js';
108
- export * from './loaders/MMDLoader.js';
109
105
  export * from './loaders/MTLLoader.js';
110
106
  export * from './loaders/NRRDLoader.js';
111
107
  export * from './loaders/OBJLoader.js';
@@ -240,7 +236,6 @@ export * from './shaders/HueSaturationShader.js';
240
236
  export * from './shaders/KaleidoShader.js';
241
237
  export * from './shaders/LuminosityHighPassShader.js';
242
238
  export * from './shaders/LuminosityShader.js';
243
- export * from './shaders/MMDToonShader.js';
244
239
  export * from './shaders/MirrorShader.js';
245
240
  export * from './shaders/NormalMapShader.js';
246
241
  export * from './shaders/OutputShader.js';
@@ -111,8 +111,7 @@ class CCDIKSolver {
111
111
 
112
112
  const link = bones[ links[ j ].index ];
113
113
 
114
- // skip this link and following links.
115
- // this skip is used for MMD performance optimization.
114
+ // skip this link and following links
116
115
  if ( links[ j ].enabled === false ) break;
117
116
 
118
117
  const limitation = links[ j ].limitation;
@@ -331,6 +330,8 @@ class CCDIKHelper extends Object3D {
331
330
 
332
331
  /**
333
332
  * Updates IK bones visualization.
333
+ *
334
+ * @param {Boolean} force
334
335
  */
335
336
  updateMatrixWorld( force ) {
336
337
 
@@ -1183,7 +1183,7 @@ class ArcballControls extends Controls {
1183
1183
  * Remove a mouse action by specifying its mouse/key combination
1184
1184
  * @param {*} mouse A mouse button (0, 1, 2) or 'WHEEL' for wheel notches
1185
1185
  * @param {*} key The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed
1186
- * @returns {Boolean} True if the operation has been succesfully removed, false otherwise
1186
+ * @returns {Boolean} True if the operation has been successfully removed, false otherwise
1187
1187
  */
1188
1188
  unsetMouseAction( mouse, key = null ) {
1189
1189
 
@@ -1204,9 +1204,9 @@ class ArcballControls extends Controls {
1204
1204
 
1205
1205
  /**
1206
1206
  * Return the operation associated to a mouse/keyboard combination
1207
- * @param {*} mouse A mouse button (0, 1, 2) or 'WHEEL' for wheel notches
1208
- * @param {*} key The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed
1209
- * @returns The operation if it has been found, null otherwise
1207
+ * @param {0|1|2|'WHEEL'} mouse Mouse button index (0, 1, 2) or 'WHEEL' for wheel notches
1208
+ * @param {'CTRL'|'SHIFT'|null} key Keyboard modifier
1209
+ * @returns {string|null} The operation if it has been found, null otherwise
1210
1210
  */
1211
1211
  getOpFromAction( mouse, key ) {
1212
1212
 
@@ -1244,9 +1244,9 @@ class ArcballControls extends Controls {
1244
1244
 
1245
1245
  /**
1246
1246
  * Get the operation associated to mouse and key combination and returns the corresponding FSA state
1247
- * @param {Number} mouse Mouse button
1248
- * @param {String} key Keyboard modifier
1249
- * @returns The FSA state obtained from the operation associated to mouse/keyboard combination
1247
+ * @param {0|1|2} mouse Mouse button index (0, 1, 2)
1248
+ * @param {'CTRL'|'SHIFT'|null} key Keyboard modifier
1249
+ * @returns {STATE|null} The FSA state obtained from the operation associated to mouse/keyboard combination
1250
1250
  */
1251
1251
  getOpStateFromAction( mouse, key ) {
1252
1252
 
@@ -1402,10 +1402,12 @@ class ArcballControls extends Controls {
1402
1402
 
1403
1403
  /**
1404
1404
  * Calculate the angular speed
1405
+ *
1405
1406
  * @param {Number} p0 Position at t0
1406
1407
  * @param {Number} p1 Position at t1
1407
1408
  * @param {Number} t0 Initial time in milliseconds
1408
1409
  * @param {Number} t1 Ending time in milliseconds
1410
+ * @returns {Number}
1409
1411
  */
1410
1412
  calculateAngularSpeed( p0, p1, t0, t1 ) {
1411
1413
 
@@ -1450,7 +1452,7 @@ class ArcballControls extends Controls {
1450
1452
  }
1451
1453
 
1452
1454
  /**
1453
- * Calculate the trackball radius so that gizmo's diamater will be 2/3 of the minimum side of the camera frustum
1455
+ * Calculate the trackball radius so that gizmo's diameter will be 2/3 of the minimum side of the camera frustum
1454
1456
  * @param {Camera} camera
1455
1457
  * @returns {Number} The trackball radius
1456
1458
  */
@@ -1627,8 +1629,9 @@ class ArcballControls extends Controls {
1627
1629
 
1628
1630
  /**
1629
1631
  * Calculate the cursor position in NDC
1630
- * @param {number} x Cursor horizontal coordinate within the canvas
1631
- * @param {number} y Cursor vertical coordinate within the canvas
1632
+ *
1633
+ * @param {number} cursorX Cursor horizontal coordinate within the canvas
1634
+ * @param {number} cursorY Cursor vertical coordinate within the canvas
1632
1635
  * @param {HTMLElement} canvas The canvas where the renderer draws its output
1633
1636
  * @returns {Vector2} Cursor normalized position inside the canvas
1634
1637
  */
@@ -1643,8 +1646,9 @@ class ArcballControls extends Controls {
1643
1646
 
1644
1647
  /**
1645
1648
  * Calculate the cursor position inside the canvas x/y coordinates with the origin being in the center of the canvas
1646
- * @param {Number} x Cursor horizontal coordinate within the canvas
1647
- * @param {Number} y Cursor vertical coordinate within the canvas
1649
+ *
1650
+ * @param {Number} cursorX Cursor horizontal coordinate within the canvas
1651
+ * @param {Number} cursorY Cursor vertical coordinate within the canvas
1648
1652
  * @param {HTMLElement} canvas The canvas where the renderer draws its output
1649
1653
  * @returns {Vector2} Cursor position inside the canvas
1650
1654
  */
@@ -1940,9 +1944,11 @@ class ArcballControls extends Controls {
1940
1944
 
1941
1945
  /**
1942
1946
  * Perform pan operation moving camera between two points
1947
+ *
1943
1948
  * @param {Vector3} p0 Initial point
1944
1949
  * @param {Vector3} p1 Ending point
1945
- * @param {Boolean} adjust If movement should be adjusted considering camera distance (Perspective only)
1950
+ * @param {Boolean} [adjust=false] If movement should be adjusted considering camera distance (Perspective only)
1951
+ * @returns {Object}
1946
1952
  */
1947
1953
  pan( p0, p1, adjust = false ) {
1948
1954
 
@@ -2219,7 +2225,7 @@ class ArcballControls extends Controls {
2219
2225
 
2220
2226
  /**
2221
2227
  * Set camera fov
2222
- * @param {Number} value fov to be setted
2228
+ * @param {Number} value fov to be set
2223
2229
  */
2224
2230
  setFov( value ) {
2225
2231
 
@@ -2234,8 +2240,9 @@ class ArcballControls extends Controls {
2234
2240
 
2235
2241
  /**
2236
2242
  * Set values in transformation object
2237
- * @param {Matrix4} camera Transformation to be applied to the camera
2238
- * @param {Matrix4} gizmos Transformation to be applied to gizmos
2243
+ *
2244
+ * @param {Matrix4} [camera=null] Transformation to be applied to the camera
2245
+ * @param {Matrix4} [gizmos=null] Transformation to be applied to gizmos
2239
2246
  */
2240
2247
  setTransformationMatrices( camera = null, gizmos = null ) {
2241
2248
 
@@ -2279,9 +2286,10 @@ class ArcballControls extends Controls {
2279
2286
 
2280
2287
  /**
2281
2288
  * Rotate camera around its direction axis passing by a given point by a given angle
2289
+ *
2282
2290
  * @param {Vector3} point The point where the rotation axis is passing trough
2283
2291
  * @param {Number} angle Angle in radians
2284
- * @returns The computed transormation matix
2292
+ * @returns {Object} The computed transformation matrix
2285
2293
  */
2286
2294
  zRotate( point, angle ) {
2287
2295
 
@@ -2313,9 +2321,10 @@ class ArcballControls extends Controls {
2313
2321
 
2314
2322
  /**
2315
2323
  * Unproject the cursor on the 3D object surface
2324
+ *
2316
2325
  * @param {Vector2} cursor Cursor coordinates in NDC
2317
2326
  * @param {Camera} camera Virtual camera
2318
- * @returns {Vector3} The point of intersection with the model, if exist, null otherwise
2327
+ * @returns {Vector3|null} The point of intersection with the model, if exist, null otherwise
2319
2328
  */
2320
2329
  unprojectOnObj( cursor, camera ) {
2321
2330
 
@@ -2576,7 +2585,7 @@ class ArcballControls extends Controls {
2576
2585
  /**
2577
2586
  * Update the trackball FSA
2578
2587
  * @param {STATE} newState New state of the FSA
2579
- * @param {Boolean} updateMatrices If matriices state should be updated
2588
+ * @param {Boolean} updateMatrices If matrices state should be updated
2580
2589
  */
2581
2590
  updateTbState( newState, updateMatrices ) {
2582
2591
 
@@ -92,6 +92,7 @@ class OrbitControls extends Controls {
92
92
  // Set to false to disable rotating
93
93
  this.enableRotate = true;
94
94
  this.rotateSpeed = 1.0;
95
+ this.keyRotateSpeed = 1.0;
95
96
 
96
97
  // Set to false to disable panning
97
98
  this.enablePan = true;
@@ -786,7 +787,7 @@ class OrbitControls extends Controls {
786
787
 
787
788
  if ( this.enableRotate ) {
788
789
 
789
- this._rotateUp( _twoPI * this.rotateSpeed / this.domElement.clientHeight );
790
+ this._rotateUp( _twoPI * this.keyRotateSpeed / this.domElement.clientHeight );
790
791
 
791
792
  }
792
793
 
@@ -809,7 +810,7 @@ class OrbitControls extends Controls {
809
810
 
810
811
  if ( this.enableRotate ) {
811
812
 
812
- this._rotateUp( - _twoPI * this.rotateSpeed / this.domElement.clientHeight );
813
+ this._rotateUp( - _twoPI * this.keyRotateSpeed / this.domElement.clientHeight );
813
814
 
814
815
  }
815
816
 
@@ -832,7 +833,7 @@ class OrbitControls extends Controls {
832
833
 
833
834
  if ( this.enableRotate ) {
834
835
 
835
- this._rotateLeft( _twoPI * this.rotateSpeed / this.domElement.clientHeight );
836
+ this._rotateLeft( _twoPI * this.keyRotateSpeed / this.domElement.clientHeight );
836
837
 
837
838
  }
838
839
 
@@ -855,7 +856,7 @@ class OrbitControls extends Controls {
855
856
 
856
857
  if ( this.enableRotate ) {
857
858
 
858
- this._rotateLeft( - _twoPI * this.rotateSpeed / this.domElement.clientHeight );
859
+ this._rotateLeft( - _twoPI * this.keyRotateSpeed / this.domElement.clientHeight );
859
860
 
860
861
  }
861
862
 
@@ -6,8 +6,7 @@ import {
6
6
  Box3,
7
7
  Object3D,
8
8
  WebGLCoordinateSystem,
9
- NodeUpdateType,
10
- Node
9
+ ShadowBaseNode
11
10
  } from 'three/webgpu';
12
11
 
13
12
  import { CSMFrustum } from './CSMFrustum.js';
@@ -36,13 +35,12 @@ class LwLight extends Object3D {
36
35
 
37
36
  }
38
37
 
39
- class CSMShadowNode extends Node {
38
+ class CSMShadowNode extends ShadowBaseNode {
40
39
 
41
40
  constructor( light, data = {} ) {
42
41
 
43
- super();
42
+ super( light );
44
43
 
45
- this.light = light;
46
44
  this.camera = null;
47
45
  this.cascades = data.cascades || 3;
48
46
  this.maxFar = data.maxFar || 100000;
@@ -57,7 +55,6 @@ class CSMShadowNode extends Node {
57
55
  this._cascades = [];
58
56
  this.mainFrustum = null;
59
57
  this.frustums = [];
60
- this.updateBeforeType = NodeUpdateType.FRAME;
61
58
 
62
59
  this.lights = [];
63
60
 
@@ -78,6 +75,8 @@ class CSMShadowNode extends Node {
78
75
  for ( let i = 0; i < this.cascades; i ++ ) {
79
76
 
80
77
  const lwLight = new LwLight();
78
+ lwLight.castShadow = true;
79
+
81
80
  const lShadow = light.shadow.clone();
82
81
  lShadow.bias = lShadow.bias * ( i + 1 );
83
82
 
@@ -256,7 +255,7 @@ class CSMShadowNode extends Node {
256
255
  setupFade() {
257
256
 
258
257
  const cameraNear = reference( 'camera.near', 'float', this ).setGroup( renderGroup );
259
- const cascades = reference( '_cascades', 'vec2', this ).setGroup( renderGroup ).label( 'cacades' );
258
+ const cascades = reference( '_cascades', 'vec2', this ).setGroup( renderGroup ).label( 'cascades' );
260
259
 
261
260
  const shadowFar = uniform( 'float' ).setGroup( renderGroup ).label( 'shadowFar' )
262
261
  .onRenderUpdate( () => Math.min( this.maxFar, this.camera.far ) );
@@ -264,7 +263,9 @@ class CSMShadowNode extends Node {
264
263
  const linearDepth = viewZToOrthographicDepth( positionView.z, cameraNear, shadowFar ).toVar( 'linearDepth' );
265
264
  const lastCascade = this.cascades - 1;
266
265
 
267
- return Fn( () => {
266
+ return Fn( ( builder ) => {
267
+
268
+ this.setupShadowPosition( builder );
268
269
 
269
270
  const ret = vec4( 1, 1, 1, 1 ).toVar( 'shadowValue' );
270
271
 
@@ -310,7 +311,7 @@ class CSMShadowNode extends Node {
310
311
 
311
312
  if ( i === 0 ) {
312
313
 
313
- // dont fade at nearest edge
314
+ // don't fade at nearest edge
314
315
  ratio = linearDepth.greaterThan( cascadeCenter ).select( ratio, 1 );
315
316
 
316
317
  }
@@ -330,14 +331,16 @@ class CSMShadowNode extends Node {
330
331
  setupStandard() {
331
332
 
332
333
  const cameraNear = reference( 'camera.near', 'float', this ).setGroup( renderGroup );
333
- const cascades = reference( '_cascades', 'vec2', this ).setGroup( renderGroup ).label( 'cacades' );
334
+ const cascades = reference( '_cascades', 'vec2', this ).setGroup( renderGroup ).label( 'cascades' );
334
335
 
335
336
  const shadowFar = uniform( 'float' ).setGroup( renderGroup ).label( 'shadowFar' )
336
337
  .onRenderUpdate( () => Math.min( this.maxFar, this.camera.far ) );
337
338
 
338
339
  const linearDepth = viewZToOrthographicDepth( positionView.z, cameraNear, shadowFar ).toVar( 'linearDepth' );
339
340
 
340
- return Fn( () => {
341
+ return Fn( ( builder ) => {
342
+
343
+ this.setupShadowPosition( builder );
341
344
 
342
345
  const ret = vec4( 1, 1, 1, 1 ).toVar( 'shadowValue' );
343
346
  const cascade = vec2().toVar( 'cascade' );
@@ -430,6 +433,8 @@ class CSMShadowNode extends Node {
430
433
 
431
434
  }
432
435
 
436
+ super.dispose();
437
+
433
438
  }
434
439
 
435
440
  }
@@ -108,4 +108,4 @@ class NURBSCurve extends Curve {
108
108
 
109
109
  }
110
110
 
111
- export { NURBSCurve };
111
+ export { NURBSCurve };
@@ -513,13 +513,16 @@ function calcVolumePoint( p, q, r, U, V, W, P, u, v, w, target ) {
513
513
  }
514
514
 
515
515
  }
516
+
516
517
  const Sw = new Vector4( 0, 0, 0, 0 );
517
518
  for ( let m = 0; m <= r; ++ m ) {
519
+
518
520
  for ( let l = 0; l <= q; ++ l ) {
519
521
 
520
522
  Sw.add( temp[ m ][ l ].multiplyScalar( Nw[ m ] ).multiplyScalar( Nv[ l ] ) );
521
523
 
522
524
  }
525
+
523
526
  }
524
527
 
525
528
  Sw.divideScalar( Sw.w );
@@ -367,7 +367,7 @@ class OutlineEffect {
367
367
 
368
368
  let keys;
369
369
 
370
- // clear originialMaterials
370
+ // clear originalMaterials
371
371
  keys = Object.keys( originalMaterials );
372
372
 
373
373
  for ( let i = 0, il = keys.length; i < il; i ++ ) {
@@ -190,7 +190,8 @@ class GLTFExporter {
190
190
 
191
191
  /**
192
192
  * Parse scenes and generate GLTF output
193
- * @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes
193
+ *
194
+ * @param {Scene|THREE.Scenes} input Scene or Array of THREE.Scenes
194
195
  * @param {Function} onDone Callback on completed
195
196
  * @param {Function} onError Callback on errors
196
197
  * @param {Object} options options
@@ -543,9 +544,10 @@ class GLTFWriter {
543
544
 
544
545
  /**
545
546
  * Parse scenes and generate GLTF output
546
- * @param {Scene or [THREE.Scenes]} input Scene or Array of THREE.Scenes
547
- * @param {Function} onDone Callback on completed
548
- * @param {Object} options options
547
+ *
548
+ * @param {Scene|THREE.Scenes} input Scene or Array of THREE.Scenes
549
+ * @param {Function} onDone Callback on completed
550
+ * @param {Object} options options
549
551
  */
550
552
  async writeAsync( input, onDone, options = {} ) {
551
553
 
@@ -709,7 +711,9 @@ class GLTFWriter {
709
711
 
710
712
  /**
711
713
  * Returns ids for buffer attributes.
712
- * @param {Object} object
714
+ *
715
+ * @param {Object} attribute
716
+ * @param {boolean} [isRelativeCopy=false]
713
717
  * @return {Integer}
714
718
  */
715
719
  getUID( attribute, isRelativeCopy = false ) {
@@ -2262,7 +2266,7 @@ class GLTFWriter {
2262
2266
 
2263
2267
  /**
2264
2268
  * Process Object3D node
2265
- * @param {THREE.Object3D} node Object3D to processNodeAsync
2269
+ * @param {THREE.Object3D} object Object3D to processNodeAsync
2266
2270
  * @return {Integer} Index of the node in the nodes list
2267
2271
  */
2268
2272
  async processNodeAsync( object ) {
@@ -2370,7 +2374,7 @@ class GLTFWriter {
2370
2374
 
2371
2375
  /**
2372
2376
  * Process Scene
2373
- * @param {Scene} node Scene to process
2377
+ * @param {Scene} scene Scene to process
2374
2378
  */
2375
2379
  async processSceneAsync( scene ) {
2376
2380
 
@@ -120,7 +120,7 @@ const KHR_DF_CHANNEL_SAMPLE_LOWER_UPPER = {
120
120
  [ HalfFloatType ]: [ 0xbf800000, 0x3f800000 ],
121
121
  [ UnsignedByteType ]: [ 0, 255 ],
122
122
 
123
- }
123
+ };
124
124
 
125
125
  const ERROR_INPUT = 'THREE.KTX2Exporter: Supported inputs are DataTexture, Data3DTexture, or WebGLRenderer and WebGLRenderTarget.';
126
126
  const ERROR_FORMAT = 'THREE.KTX2Exporter: Supported formats are RGBAFormat, RGFormat, or RedFormat.';
@@ -124,7 +124,7 @@ class PLYExporter {
124
124
  if ( includeIndices && faceCount !== Math.floor( faceCount ) ) {
125
125
 
126
126
  // point cloud meshes will not have an index array and may not have a
127
- // number of vertices that is divisble by 3 (and therefore representable
127
+ // number of vertices that is divisible by 3 (and therefore representable
128
128
  // as triangles)
129
129
  console.error(
130
130
 
@@ -206,7 +206,7 @@ class PLYExporter {
206
206
  // 2 uv values at 4 bytes
207
207
  const vertexListLength = vertexCount * ( 4 * 3 + ( includeNormals ? 4 * 3 : 0 ) + ( includeColors ? 3 : 0 ) + ( includeUVs ? 4 * 2 : 0 ) );
208
208
 
209
- // 1 byte shape desciptor
209
+ // 1 byte shape descriptor
210
210
  // 3 vertex indices at ${indexByteCount} bytes
211
211
  const faceListLength = includeIndices ? faceCount * ( indexByteCount * 3 + 1 ) : 0;
212
212
  const output = new DataView( new ArrayBuffer( headerBin.length + vertexListLength + faceListLength ) );
@@ -1,11 +1,13 @@
1
1
  import {
2
+ NodeMaterial,
2
3
  BoxGeometry,
3
4
  BufferAttribute,
4
5
  Mesh,
5
6
  PlaneGeometry,
7
+ DoubleSide,
6
8
  Vector3,
7
9
  } from 'three';
8
- import { NodeMaterial, texture as textureNode, cubeTexture, texture3D, float, vec4 } from 'three/tsl';
10
+ import { texture as textureNode, cubeTexture, texture3D, float, vec4, attribute } from 'three/tsl';
9
11
  import { mergeGeometries } from '../utils/BufferGeometryUtils.js';
10
12
 
11
13
  class TextureHelper extends Mesh {
@@ -13,17 +15,25 @@ class TextureHelper extends Mesh {
13
15
  constructor( texture, width = 1, height = 1, depth = 1 ) {
14
16
 
15
17
  const material = new NodeMaterial();
18
+ material.side = DoubleSide;
19
+ material.transparent = true;
16
20
  material.name = 'TextureHelper';
17
21
 
18
22
  let colorNode;
19
23
 
24
+ const uvw = attribute( 'uvw' );
25
+
20
26
  if ( texture.isCubeTexture ) {
21
27
 
22
- colorNode = cubeTexture( texture );
28
+ colorNode = cubeTexture( texture ).sample( uvw );
23
29
 
24
30
  } else if ( texture.isData3DTexture || texture.isCompressed3DTexture ) {
25
31
 
26
- colorNode = texture3D( texture );
32
+ colorNode = texture3D( texture ).sample( uvw );
33
+
34
+ } else if ( texture.isDataArrayTexture || texture.isCompressedArrayTexture ) {
35
+
36
+ colorNode = textureNode( texture ).sample( uvw.xy ).depth( uvw.z );
27
37
 
28
38
  } else {
29
39
 
@@ -122,7 +132,7 @@ function createCubeGeometry( width, height, depth ) {
122
132
  }
123
133
 
124
134
  geometry.deleteAttribute( 'uv' );
125
- geometry.setAttribute( 'uv', uvw );
135
+ geometry.setAttribute( 'uvw', uvw );
126
136
 
127
137
  return geometry;
128
138
 
@@ -162,7 +172,7 @@ function createSliceGeometry( texture, width, height, depth ) {
162
172
  }
163
173
 
164
174
  geometry.deleteAttribute( 'uv' );
165
- geometry.setAttribute( 'uv', uvw );
175
+ geometry.setAttribute( 'uvw', uvw );
166
176
 
167
177
  geometries.push( geometry );
168
178
 
@@ -32,6 +32,8 @@ class VertexNormalsHelper extends LineSegments {
32
32
 
33
33
  this.matrixAutoUpdate = false;
34
34
 
35
+ this.isVertexNormalsHelper = true;
36
+
35
37
  this.update();
36
38
 
37
39
  }
@@ -99,7 +99,7 @@ class LightProbeGenerator {
99
99
  // evaluate SH basis functions in direction dir
100
100
  SphericalHarmonics3.getBasisAt( dir, shBasis );
101
101
 
102
- // accummuulate
102
+ // accumulate
103
103
  for ( let j = 0; j < 9; j ++ ) {
104
104
 
105
105
  shCoefficients[ j ].x += shBasis[ j ] * color.r * weight;
@@ -129,7 +129,7 @@ class LightProbeGenerator {
129
129
 
130
130
  static async fromCubeRenderTarget( renderer, cubeRenderTarget ) {
131
131
 
132
- const flip = renderer.coordinateSystem === WebGLCoordinateSystem ? -1 : 1;
132
+ const flip = renderer.coordinateSystem === WebGLCoordinateSystem ? - 1 : 1;
133
133
 
134
134
  // The renderTarget must be set to RGBA in order to make readRenderTargetPixels works
135
135
  let totalWeight = 0;
@@ -242,7 +242,7 @@ class LightProbeGenerator {
242
242
  // evaluate SH basis functions in direction dir
243
243
  SphericalHarmonics3.getBasisAt( dir, shBasis );
244
244
 
245
- // accummuulate
245
+ // accumulate
246
246
  for ( let j = 0; j < 9; j ++ ) {
247
247
 
248
248
  shCoefficients[ j ].x += shBasis[ j ] * color.r * weight;
@@ -9,9 +9,9 @@ import {
9
9
  Sphere,
10
10
  Vector3,
11
11
  Vector4,
12
- Line2NodeMaterial
12
+ Line2NodeMaterial,
13
+ Vector2
13
14
  } from 'three/webgpu';
14
-
15
15
  import { LineSegmentsGeometry } from '../../lines/LineSegmentsGeometry.js';
16
16
 
17
17
  const _start = new Vector3();
@@ -29,6 +29,7 @@ const _closestPoint = new Vector3();
29
29
  const _box = new Box3();
30
30
  const _sphere = new Sphere();
31
31
  const _clipToWorldVector = new Vector4();
32
+ const _viewport = new Vector4();
32
33
 
33
34
  let _ray, _lineWidth;
34
35
 
@@ -93,8 +94,7 @@ function raycastWorldUnits( lineSegments, intersects ) {
93
94
  function raycastScreenSpace( lineSegments, camera, intersects ) {
94
95
 
95
96
  const projectionMatrix = camera.projectionMatrix;
96
- const material = lineSegments.material;
97
- const resolution = material.resolution;
97
+ const resolution = lineSegments.resolution;
98
98
  const matrixWorld = lineSegments.matrixWorld;
99
99
 
100
100
  const geometry = lineSegments.geometry;
@@ -233,6 +233,8 @@ class LineSegments2 extends Mesh {
233
233
 
234
234
  this.type = 'LineSegments2';
235
235
 
236
+ this.resolution = new Vector2();
237
+
236
238
  }
237
239
 
238
240
  // for backwards-compatibility, but could be a method of LineSegmentsGeometry...
@@ -264,6 +266,13 @@ class LineSegments2 extends Mesh {
264
266
 
265
267
  }
266
268
 
269
+ onBeforeRender( renderer ) {
270
+
271
+ renderer.getViewport( _viewport );
272
+ this.resolution.set( _viewport.z, _viewport.w );
273
+
274
+ }
275
+
267
276
  raycast( raycaster, intersects ) {
268
277
 
269
278
  const worldUnits = this.material.worldUnits;
@@ -303,7 +312,7 @@ class LineSegments2 extends Mesh {
303
312
  } else {
304
313
 
305
314
  const distanceToSphere = Math.max( camera.near, _sphere.distanceToPoint( _ray.origin ) );
306
- sphereMargin = getWorldSpaceHalfWidth( camera, distanceToSphere, material.resolution );
315
+ sphereMargin = getWorldSpaceHalfWidth( camera, distanceToSphere, this.resolution );
307
316
 
308
317
  }
309
318
 
@@ -333,7 +342,7 @@ class LineSegments2 extends Mesh {
333
342
  } else {
334
343
 
335
344
  const distanceToBox = Math.max( camera.near, _box.distanceToPoint( _ray.origin ) );
336
- boxMargin = getWorldSpaceHalfWidth( camera, distanceToBox, material.resolution );
345
+ boxMargin = getWorldSpaceHalfWidth( camera, distanceToBox, this.resolution );
337
346
 
338
347
  }
339
348
 
@@ -386,8 +386,11 @@ class ThreeMFLoader extends Loader {
386
386
 
387
387
  const attrib = portNodes[ i ].attributes[ j ];
388
388
  if ( attrib.specified ) {
389
+
389
390
  args[ attrib.name ] = attrib.value;
391
+
390
392
  }
393
+
391
394
  }
392
395
 
393
396
  portArguments[ portNodes[ i ].getAttribute( 'identifier' ) ] = args;
@@ -415,19 +418,19 @@ class ThreeMFLoader extends Loader {
415
418
 
416
419
  if ( operatorNode.nodeName === 'i:in' || operatorNode.nodeName === 'i:out' ) {
417
420
 
418
- operations[ operatorNode.nodeName === 'i:in' ? "inputs" : "outputs" ] = parseImplicitIONode( operatorNode );
421
+ operations[ operatorNode.nodeName === 'i:in' ? 'inputs' : 'outputs' ] = parseImplicitIONode( operatorNode );
419
422
 
420
423
  } else {
421
424
 
422
425
  const inputNodes = operatorNode.children;
423
- let portArguments = { "op": operatorNode.nodeName.substring( 2 ), "identifier": operatorNode.getAttribute( 'identifier' ) };
426
+ const portArguments = { 'op': operatorNode.nodeName.substring( 2 ), 'identifier': operatorNode.getAttribute( 'identifier' ) };
424
427
  for ( let i = 0; i < inputNodes.length; i ++ ) {
425
428
 
426
429
  portArguments[ inputNodes[ i ].nodeName.substring( 2 ) ] = parseImplicitIONode( inputNodes[ i ] );
427
430
 
428
431
  }
429
432
 
430
- operations[ portArguments[ "identifier" ] ] = portArguments;
433
+ operations[ portArguments[ 'identifier' ] ] = portArguments;
431
434
 
432
435
  }
433
436
 
@@ -204,7 +204,7 @@ class BVHLoader extends Loader {
204
204
  }
205
205
 
206
206
  /*
207
- Recursively parses the HIERACHY section of the BVH file
207
+ Recursively parses the HIERARCHY section of the BVH file
208
208
 
209
209
  - lines: all lines of the file. lines are consumed as we go along.
210
210
  - firstline: line containing the node type and name e.g. 'JOINT hip'