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
@@ -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.170.1",
3
+ "version": "0.172.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
@@ -85,6 +85,8 @@ export { AnimationMixer } from './animation/AnimationMixer.js';
85
85
  export { AnimationClip } from './animation/AnimationClip.js';
86
86
  export { AnimationAction } from './animation/AnimationAction.js';
87
87
  export { RenderTarget } from './core/RenderTarget.js';
88
+ export { RenderTarget3D } from './core/RenderTarget3D.js';
89
+ export { RenderTargetArray } from './core/RenderTargetArray.js';
88
90
  export { Uniform } from './core/Uniform.js';
89
91
  export { UniformsGroup } from './core/UniformsGroup.js';
90
92
  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;
@@ -131,6 +130,7 @@ export const defined = TSL.defined;
131
130
  export const degrees = TSL.degrees;
132
131
  export const deltaTime = TSL.deltaTime;
133
132
  export const densityFog = TSL.densityFog;
133
+ export const densityFogFactor = TSL.densityFogFactor;
134
134
  export const depth = TSL.depth;
135
135
  export const depthPass = TSL.depthPass;
136
136
  export const difference = TSL.difference;
@@ -154,6 +154,7 @@ export const exp2 = TSL.exp2;
154
154
  export const expression = TSL.expression;
155
155
  export const faceDirection = TSL.faceDirection;
156
156
  export const faceForward = TSL.faceForward;
157
+ export const faceforward = TSL.faceforward;
157
158
  export const float = TSL.float;
158
159
  export const floor = TSL.floor;
159
160
  export const fog = TSL.fog;
@@ -182,8 +183,8 @@ export const grayscale = TSL.grayscale;
182
183
  export const greaterThan = TSL.greaterThan;
183
184
  export const greaterThanEqual = TSL.greaterThanEqual;
184
185
  export const hash = TSL.hash;
185
- export const highPrecisionModelNormalViewMatrix = TSL.highPrecisionModelNormalViewMatrix;
186
- export const highPrecisionModelViewMatrix = TSL.highPrecisionModelViewMatrix;
186
+ export const highpModelNormalViewMatrix = TSL.highpModelNormalViewMatrix;
187
+ export const highpModelViewMatrix = TSL.highpModelViewMatrix;
187
188
  export const hue = TSL.hue;
188
189
  export const instance = TSL.instance;
189
190
  export const instanceIndex = TSL.instanceIndex;
@@ -193,6 +194,7 @@ export const instancedDynamicBufferAttribute = TSL.instancedDynamicBufferAttribu
193
194
  export const instancedMesh = TSL.instancedMesh;
194
195
  export const int = TSL.int;
195
196
  export const inverseSqrt = TSL.inverseSqrt;
197
+ export const inversesqrt = TSL.inversesqrt;
196
198
  export const invocationLocalIndex = TSL.invocationLocalIndex;
197
199
  export const invocationSubgroupIndex = TSL.invocationSubgroupIndex;
198
200
  export const ior = TSL.ior;
@@ -222,11 +224,12 @@ export const log2 = TSL.log2;
222
224
  export const logarithmicDepthToViewZ = TSL.logarithmicDepthToViewZ;
223
225
  export const loop = TSL.loop;
224
226
  export const luminance = TSL.luminance;
227
+ export const mediumpModelViewMatrix = TSL.mediumpModelViewMatrix;
225
228
  export const mat2 = TSL.mat2;
226
229
  export const mat3 = TSL.mat3;
227
230
  export const mat4 = TSL.mat4;
228
231
  export const matcapUV = TSL.matcapUV;
229
- export const materialAOMap = TSL.materialAOMap;
232
+ export const materialAO = TSL.materialAO;
230
233
  export const materialAlphaTest = TSL.materialAlphaTest;
231
234
  export const materialAnisotropy = TSL.materialAnisotropy;
232
235
  export const materialAnisotropyVector = TSL.materialAnisotropyVector;
@@ -370,6 +373,7 @@ export const radians = TSL.radians;
370
373
  export const rand = TSL.rand;
371
374
  export const range = TSL.range;
372
375
  export const rangeFog = TSL.rangeFog;
376
+ export const rangeFogFactor = TSL.rangeFogFactor;
373
377
  export const reciprocal = TSL.reciprocal;
374
378
  export const reference = TSL.reference;
375
379
  export const referenceBuffer = TSL.referenceBuffer;
@@ -407,6 +411,7 @@ export const select = TSL.select;
407
411
  export const setCurrentStack = TSL.setCurrentStack;
408
412
  export const shaderStages = TSL.shaderStages;
409
413
  export const shadow = TSL.shadow;
414
+ export const shadowPositionWorld = TSL.shadowPositionWorld;
410
415
  export const sharedUniformGroup = TSL.sharedUniformGroup;
411
416
  export const sheen = TSL.sheen;
412
417
  export const sheenRoughness = TSL.sheenRoughness;
@@ -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
 
@@ -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 = '172';
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 };
@@ -54,6 +54,7 @@ class RenderTarget extends EventDispatcher {
54
54
 
55
55
  this.textures[ i ] = texture.clone();
56
56
  this.textures[ i ].isRenderTargetTexture = true;
57
+ this.textures[ i ].renderTarget = this;
57
58
 
58
59
  }
59
60
 
@@ -63,6 +64,7 @@ class RenderTarget extends EventDispatcher {
63
64
  this.resolveDepthBuffer = options.resolveDepthBuffer;
64
65
  this.resolveStencilBuffer = options.resolveStencilBuffer;
65
66
 
67
+ this._depthTexture = null;
66
68
  this.depthTexture = options.depthTexture;
67
69
 
68
70
  this.samples = options.samples;
@@ -81,6 +83,21 @@ class RenderTarget extends EventDispatcher {
81
83
 
82
84
  }
83
85
 
86
+ set depthTexture( current ) {
87
+
88
+ if ( this._depthTexture !== null ) this._depthTexture.renderTarget = null;
89
+ if ( current !== null ) current.renderTarget = this;
90
+
91
+ this._depthTexture = current;
92
+
93
+ }
94
+
95
+ get depthTexture() {
96
+
97
+ return this._depthTexture;
98
+
99
+ }
100
+
84
101
  setSize( width, height, depth = 1 ) {
85
102
 
86
103
  if ( this.width !== width || this.height !== height || this.depth !== depth ) {
@@ -129,6 +146,7 @@ class RenderTarget extends EventDispatcher {
129
146
 
130
147
  this.textures[ i ] = source.textures[ i ].clone();
131
148
  this.textures[ i ].isRenderTargetTexture = true;
149
+ this.textures[ i ].renderTarget = this;
132
150
 
133
151
  }
134
152
 
@@ -0,0 +1,22 @@
1
+ import { RenderTarget } from './RenderTarget.js';
2
+ import { Data3DTexture } from '../textures/Data3DTexture.js';
3
+
4
+ class RenderTarget3D extends RenderTarget {
5
+
6
+ constructor( width = 1, height = 1, depth = 1, options = {} ) {
7
+
8
+ super( width, height, options );
9
+
10
+ this.isRenderTarget3D = true;
11
+
12
+ this.depth = depth;
13
+
14
+ this.texture = new Data3DTexture( null, width, height, depth );
15
+
16
+ this.texture.isRenderTargetTexture = true;
17
+
18
+ }
19
+
20
+ }
21
+
22
+ export { RenderTarget3D };
@@ -0,0 +1,22 @@
1
+ import { RenderTarget } from './RenderTarget.js';
2
+ import { DataArrayTexture } from '../textures/DataArrayTexture.js';
3
+
4
+ class RenderTargetArray extends RenderTarget {
5
+
6
+ constructor( width = 1, height = 1, depth = 1, options = {} ) {
7
+
8
+ super( width, height, options );
9
+
10
+ this.isRenderTargetArray = true;
11
+
12
+ this.depth = depth;
13
+
14
+ this.texture = new DataArrayTexture( null, width, height, depth );
15
+
16
+ this.texture.isRenderTargetTexture = true;
17
+
18
+ }
19
+
20
+ }
21
+
22
+ export { RenderTargetArray };
@@ -591,7 +591,7 @@ function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {
591
591
  // check if a diagonal between two polygon nodes is valid (lies in polygon interior)
592
592
  function isValidDiagonal( a, b ) {
593
593
 
594
- return a.next.i !== b.i && a.prev.i !== b.i && ! intersectsPolygon( a, b ) && // dones't intersect other edges
594
+ return a.next.i !== b.i && a.prev.i !== b.i && ! intersectsPolygon( a, b ) && // doesn't intersect other edges
595
595
  ( locallyInside( a, b ) && locallyInside( b, a ) && middleInside( a, b ) && // locally visible
596
596
  ( area( a.prev, a, b.prev ) || area( a, b.prev, b ) ) || // does not create opposite-facing sectors
597
597
  equals( a, b ) && area( a.prev, a, a.next ) > 0 && area( b.prev, b, b.next ) > 0 ); // special zero-length case