@types/three 0.165.0 → 0.167.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 (330) hide show
  1. three/README.md +1 -1
  2. three/build/three.webgpu.d.ts +1 -0
  3. three/build/three.webgpu.min.d.ts +1 -0
  4. three/examples/jsm/Addons.d.ts +1 -1
  5. three/examples/jsm/animation/MMDPhysics.d.ts +4 -4
  6. three/examples/jsm/csm/CSM.d.ts +3 -4
  7. three/examples/jsm/csm/CSMFrustum.d.ts +1 -1
  8. three/examples/jsm/exporters/GLTFExporter.d.ts +6 -0
  9. three/examples/jsm/geometries/TeapotGeometry.d.ts +24 -0
  10. three/examples/jsm/helpers/ViewHelper.d.ts +8 -6
  11. three/examples/jsm/lights/RectAreaLightTexturesLib.d.ts +7 -0
  12. three/examples/jsm/lights/RectAreaLightUniformsLib.d.ts +4 -2
  13. three/examples/jsm/lines/LineMaterial.d.ts +2 -4
  14. three/examples/jsm/lines/webgpu/Line2.d.ts +14 -0
  15. three/examples/jsm/lines/webgpu/LineSegments2.d.ts +15 -0
  16. three/examples/jsm/loaders/DDSLoader.d.ts +8 -2
  17. three/examples/jsm/loaders/GLTFLoader.d.ts +3 -1
  18. three/examples/jsm/loaders/KTX2Loader.d.ts +1 -2
  19. three/examples/jsm/loaders/KTXLoader.d.ts +8 -2
  20. three/examples/jsm/loaders/LUTImageLoader.d.ts +18 -0
  21. three/examples/jsm/loaders/MaterialXLoader.d.ts +1 -2
  22. three/examples/jsm/loaders/PVRLoader.d.ts +2 -2
  23. three/examples/jsm/loaders/UltraHDRLoader.d.ts +21 -0
  24. three/package.json +6 -5
  25. three/src/Three.WebGPU.d.ts +184 -0
  26. three/src/Three.d.ts +26 -91
  27. three/src/animation/AnimationClip.d.ts +12 -4
  28. three/src/animation/AnimationUtils.d.ts +32 -7
  29. three/src/animation/KeyframeTrack.d.ts +9 -1
  30. three/src/animation/PropertyBinding.d.ts +12 -12
  31. three/src/cameras/OrthographicCamera.d.ts +27 -0
  32. three/src/cameras/PerspectiveCamera.d.ts +31 -0
  33. three/src/constants.d.ts +13 -1
  34. three/src/core/BufferAttribute.d.ts +11 -6
  35. three/src/core/BufferGeometry.d.ts +26 -3
  36. three/src/core/InterleavedBufferAttribute.d.ts +3 -3
  37. three/src/core/Object3D.d.ts +51 -6
  38. three/src/extras/DataUtils.d.ts +9 -2
  39. three/src/extras/ImageUtils.d.ts +6 -7
  40. three/src/extras/ShapeUtils.d.ts +5 -8
  41. three/src/extras/TextureUtils.d.ts +42 -0
  42. three/src/extras/core/Curve.d.ts +8 -2
  43. three/src/extras/core/CurvePath.d.ts +9 -1
  44. three/src/extras/core/Path.d.ts +9 -2
  45. three/src/extras/core/Shape.d.ts +9 -1
  46. three/src/lights/Light.d.ts +19 -2
  47. three/src/lights/LightShadow.d.ts +18 -2
  48. three/src/lights/webgpu/IESSpotLight.d.ts +6 -0
  49. three/src/loaders/Cache.d.ts +13 -8
  50. three/src/materials/Material.d.ts +185 -14
  51. three/src/materials/ShaderMaterial.d.ts +49 -2
  52. three/src/math/ColorManagement.d.ts +3 -0
  53. three/src/math/Euler.d.ts +4 -2
  54. three/src/math/Matrix2.d.ts +53 -0
  55. three/src/math/Matrix3.d.ts +67 -115
  56. three/src/math/Matrix4.d.ts +48 -100
  57. three/src/math/Quaternion.d.ts +5 -3
  58. three/src/math/Vector2.d.ts +1 -1
  59. three/src/math/Vector4.d.ts +6 -0
  60. three/{examples/jsm → src}/nodes/Nodes.d.ts +37 -7
  61. three/{examples/jsm → src}/nodes/accessors/BatchNode.d.ts +1 -1
  62. three/{examples/jsm → src}/nodes/accessors/BufferAttributeNode.d.ts +5 -1
  63. three/{examples/jsm → src}/nodes/accessors/CameraNode.d.ts +3 -1
  64. three/{examples/jsm → src}/nodes/accessors/CubeTextureNode.d.ts +11 -3
  65. three/{examples/jsm → src}/nodes/accessors/InstanceNode.d.ts +1 -1
  66. three/{examples/jsm → src}/nodes/accessors/MaterialNode.d.ts +11 -2
  67. three/{examples/jsm → src}/nodes/accessors/MaterialReferenceNode.d.ts +1 -1
  68. three/{examples/jsm → src}/nodes/accessors/ModelNode.d.ts +1 -1
  69. three/{examples/jsm → src}/nodes/accessors/NormalNode.d.ts +3 -3
  70. three/{examples/jsm → src}/nodes/accessors/Object3DNode.d.ts +1 -1
  71. three/{examples/jsm → src}/nodes/accessors/ReflectVectorNode.d.ts +3 -0
  72. three/{examples/jsm → src}/nodes/accessors/SkinningNode.d.ts +1 -1
  73. three/{examples/jsm → src}/nodes/accessors/StorageBufferNode.d.ts +7 -0
  74. three/src/nodes/accessors/StorageTextureNode.d.ts +40 -0
  75. three/{examples/jsm → src}/nodes/accessors/Texture3DNode.d.ts +3 -2
  76. three/{examples/jsm → src}/nodes/accessors/TextureNode.d.ts +9 -2
  77. three/{examples/jsm → src}/nodes/core/CacheNode.d.ts +4 -5
  78. three/{examples/jsm → src}/nodes/core/IndexNode.d.ts +3 -1
  79. three/{examples/jsm → src}/nodes/core/LightingModel.d.ts +12 -3
  80. three/src/nodes/core/MRTNode.d.ts +19 -0
  81. three/{examples/jsm → src}/nodes/core/Node.d.ts +6 -10
  82. three/{examples/jsm → src}/nodes/core/NodeBuilder.d.ts +13 -3
  83. three/{examples/jsm → src}/nodes/core/NodeCache.d.ts +13 -4
  84. three/{examples/jsm → src}/nodes/core/NodeFrame.d.ts +5 -2
  85. three/{examples/jsm → src}/nodes/core/NodeFunction.d.ts +2 -2
  86. three/{examples/jsm → src}/nodes/core/NodeUniform.d.ts +1 -1
  87. three/{examples/jsm → src}/nodes/core/NodeUtils.d.ts +6 -1
  88. three/{examples/jsm → src}/nodes/core/PropertyNode.d.ts +1 -0
  89. three/{examples/jsm → src}/nodes/core/UniformNode.d.ts +2 -0
  90. three/{examples/jsm → src}/nodes/core/VarNode.d.ts +2 -0
  91. three/{examples/jsm → src}/nodes/display/AnamorphicNode.d.ts +1 -1
  92. three/src/nodes/display/BloomNode.d.ts +35 -0
  93. three/{examples/jsm → src}/nodes/display/ColorAdjustmentNode.d.ts +0 -1
  94. three/{examples/jsm → src}/nodes/display/ColorSpaceNode.d.ts +1 -1
  95. three/src/nodes/display/DenoiseNode.d.ts +38 -0
  96. three/src/nodes/display/DepthOfFieldNode.d.ts +30 -0
  97. three/src/nodes/display/DotScreenNode.d.ts +27 -0
  98. three/src/nodes/display/FXAANode.d.ts +19 -0
  99. three/src/nodes/display/FilmNode.d.ts +25 -0
  100. three/src/nodes/display/GTAONode.d.ts +46 -0
  101. three/{examples/jsm → src}/nodes/display/GaussianBlurNode.d.ts +8 -5
  102. three/src/nodes/display/Lut3DNode.d.ts +30 -0
  103. three/{examples/jsm → src}/nodes/display/NormalMapNode.d.ts +1 -2
  104. three/src/nodes/display/PassNode.d.ts +62 -0
  105. three/src/nodes/display/PixelationPassNode.d.ts +67 -0
  106. three/src/nodes/display/RGBShiftNode.d.ts +24 -0
  107. three/src/nodes/display/RenderOutputNode.d.ts +28 -0
  108. three/src/nodes/display/SobelOperatorNode.d.ts +17 -0
  109. three/{examples/jsm → src}/nodes/display/ToneMappingNode.d.ts +1 -1
  110. three/src/nodes/display/TransitionNode.d.ts +41 -0
  111. three/{examples/jsm → src}/nodes/display/ViewportDepthNode.d.ts +4 -6
  112. three/{examples/jsm → src}/nodes/display/ViewportTextureNode.d.ts +1 -1
  113. three/src/nodes/functions/BSDF/LTC.d.ts +9 -0
  114. three/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts +1 -1
  115. three/src/nodes/functions/BasicLightingModel.d.ts +7 -0
  116. three/src/nodes/functions/PhongLightingModel.d.ts +7 -0
  117. three/{examples/jsm → src}/nodes/geometry/RangeNode.d.ts +4 -1
  118. three/{examples/jsm → src}/nodes/lighting/AnalyticLightNode.d.ts +1 -1
  119. three/src/nodes/lighting/BasicEnvironmentNode.d.ts +10 -0
  120. three/src/nodes/lighting/BasicLightMapNode.d.ts +8 -0
  121. three/{examples/jsm → src}/nodes/lighting/HemisphereLightNode.d.ts +1 -1
  122. three/{examples/jsm → src}/nodes/lighting/LightingNode.d.ts +2 -0
  123. three/{examples/jsm → src}/nodes/lighting/LightsNode.d.ts +1 -1
  124. three/{examples/jsm → src}/nodes/lighting/PointLightNode.d.ts +1 -1
  125. three/src/nodes/lighting/RectAreaLightNode.d.ts +21 -0
  126. three/{examples/jsm → src}/nodes/lighting/SpotLightNode.d.ts +1 -1
  127. three/{examples/jsm → src}/nodes/loaders/NodeLoader.d.ts +3 -1
  128. three/{examples/jsm → src}/nodes/loaders/NodeMaterialLoader.d.ts +1 -1
  129. three/{examples/jsm → src}/nodes/loaders/NodeObjectLoader.d.ts +3 -1
  130. three/src/nodes/materials/Line2NodeMaterial.d.ts +53 -0
  131. three/{examples/jsm → src}/nodes/materials/LineBasicNodeMaterial.d.ts +3 -1
  132. three/{examples/jsm → src}/nodes/materials/Materials.d.ts +2 -1
  133. three/{examples/jsm → src}/nodes/materials/MeshBasicNodeMaterial.d.ts +5 -1
  134. three/{examples/jsm → src}/nodes/materials/MeshMatcapNodeMaterial.d.ts +5 -1
  135. three/{examples/jsm → src}/nodes/materials/MeshNormalNodeMaterial.d.ts +4 -1
  136. three/{examples/jsm → src}/nodes/materials/MeshPhongNodeMaterial.d.ts +8 -4
  137. three/{examples/jsm → src}/nodes/materials/MeshPhysicalNodeMaterial.d.ts +21 -20
  138. three/src/nodes/materials/MeshSSSNodeMaterial.d.ts +16 -0
  139. three/{examples/jsm → src}/nodes/materials/MeshStandardNodeMaterial.d.ts +9 -5
  140. three/{examples/jsm → src}/nodes/materials/MeshToonNodeMaterial.d.ts +5 -1
  141. three/{examples/jsm → src}/nodes/materials/NodeMaterial.d.ts +54 -49
  142. three/{examples/jsm → src}/nodes/materials/PointsNodeMaterial.d.ts +3 -1
  143. three/{examples/jsm → src}/nodes/materials/ShadowNodeMaterial.d.ts +2 -1
  144. three/{examples/jsm → src}/nodes/materials/SpriteNodeMaterial.d.ts +5 -4
  145. three/{examples/jsm → src}/nodes/materialx/lib/mx_hsv.d.ts +1 -0
  146. three/src/nodes/materialx/lib/mx_noise.d.ts +359 -0
  147. three/{examples/jsm → src}/nodes/math/MathNode.d.ts +9 -1
  148. three/{examples/jsm → src}/nodes/pmrem/PMREMNode.d.ts +1 -1
  149. three/{examples/jsm → src}/nodes/utils/DiscardNode.d.ts +1 -0
  150. three/{examples/jsm → src}/nodes/utils/MaxMipLevelNode.d.ts +3 -3
  151. three/src/nodes/utils/PackingNode.d.ts +24 -0
  152. three/src/nodes/utils/RTTNode.d.ts +45 -0
  153. three/{examples/jsm → src}/nodes/utils/ReflectorNode.d.ts +3 -1
  154. three/src/objects/BatchedMesh.d.ts +58 -54
  155. three/src/objects/InstancedMesh.d.ts +15 -2
  156. three/src/objects/LOD.d.ts +17 -1
  157. three/src/objects/Mesh.d.ts +11 -1
  158. three/src/objects/Points.d.ts +0 -3
  159. three/src/objects/Skeleton.d.ts +10 -3
  160. three/src/objects/SkinnedMesh.d.ts +15 -3
  161. three/{examples/jsm → src}/renderers/common/Animation.d.ts +0 -1
  162. three/{examples/jsm → src}/renderers/common/Attributes.d.ts +4 -2
  163. three/{examples/jsm → src}/renderers/common/Backend.d.ts +1 -1
  164. three/{examples/jsm → src}/renderers/common/Background.d.ts +2 -1
  165. three/src/renderers/common/BindGroup.d.ts +9 -0
  166. three/{examples/jsm → src}/renderers/common/Bindings.d.ts +11 -14
  167. three/{examples/jsm → src}/renderers/common/ClippingContext.d.ts +6 -1
  168. three/{examples/jsm → src}/renderers/common/Color4.d.ts +1 -1
  169. three/{examples/jsm → src}/renderers/common/CubeRenderTarget.d.ts +4 -1
  170. three/{examples/jsm → src}/renderers/common/Geometries.d.ts +6 -3
  171. three/{examples/jsm → src}/renderers/common/Info.d.ts +7 -2
  172. three/{examples/jsm → src}/renderers/common/PostProcessing.d.ts +9 -1
  173. three/{examples/jsm/objects → src/renderers/common}/QuadMesh.d.ts +4 -2
  174. three/{examples/jsm → src}/renderers/common/RenderBundle.d.ts +2 -1
  175. three/{examples/jsm → src}/renderers/common/RenderBundles.d.ts +2 -1
  176. three/{examples/jsm → src}/renderers/common/RenderContext.d.ts +4 -1
  177. three/{examples/jsm → src}/renderers/common/RenderContexts.d.ts +3 -1
  178. three/{examples/jsm → src}/renderers/common/RenderList.d.ts +5 -1
  179. three/{examples/jsm → src}/renderers/common/RenderLists.d.ts +2 -1
  180. three/{examples/jsm → src}/renderers/common/RenderObject.d.ts +19 -16
  181. three/{examples/jsm → src}/renderers/common/RenderObjects.d.ts +5 -2
  182. three/{examples/jsm → src}/renderers/common/Renderer.d.ts +41 -29
  183. three/src/renderers/common/SampledTexture.d.ts +27 -0
  184. three/src/renderers/common/Sampler.d.ts +11 -0
  185. three/{examples/jsm → src}/renderers/common/StorageBufferAttribute.d.ts +1 -1
  186. three/{examples/jsm → src}/renderers/common/StorageInstancedBufferAttribute.d.ts +2 -1
  187. three/{examples/jsm → src}/renderers/common/StorageTexture.d.ts +1 -1
  188. three/{examples/jsm → src}/renderers/common/Textures.d.ts +4 -1
  189. three/{examples/jsm → src}/renderers/common/Uniform.d.ts +9 -4
  190. three/{examples/jsm → src}/renderers/common/UniformsGroup.d.ts +4 -2
  191. three/{examples/jsm → src}/renderers/common/extras/PMREMGenerator.d.ts +2 -1
  192. three/{examples/jsm → src}/renderers/common/nodes/NodeBuilderState.d.ts +8 -4
  193. three/src/renderers/common/nodes/NodeSampledTexture.d.ts +29 -0
  194. three/src/renderers/common/nodes/NodeSampler.d.ts +12 -0
  195. three/{examples/jsm → src}/renderers/common/nodes/NodeUniform.d.ts +10 -5
  196. three/{examples/jsm → src}/renderers/common/nodes/NodeUniformsGroup.d.ts +1 -3
  197. three/{examples/jsm → src}/renderers/common/nodes/Nodes.d.ts +22 -8
  198. three/src/renderers/shaders/ShaderLib.d.ts +3 -1
  199. three/src/renderers/shaders/UniformsLib.d.ts +3 -0
  200. three/src/renderers/shaders/UniformsUtils.d.ts +6 -3
  201. three/{examples/jsm/renderers/webgl → src/renderers/webgl-fallback}/WebGLBackend.d.ts +1 -1
  202. three/{examples/jsm → src}/renderers/webgpu/WebGPUBackend.d.ts +1 -1
  203. three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +125 -0
  204. three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +6 -0
  205. three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts +6 -0
  206. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +328 -0
  207. three/src/renderers/webxr/WebXRDepthSensing.d.ts +2 -0
  208. three/src/renderers/webxr/WebXRManager.d.ts +33 -23
  209. three/src/scenes/Fog.d.ts +7 -24
  210. three/src/scenes/FogExp2.d.ts +9 -3
  211. three/src/scenes/Scene.d.ts +21 -5
  212. three/src/textures/CompressedArrayTexture.d.ts +4 -4
  213. three/src/textures/CompressedTexture.d.ts +16 -8
  214. three/src/textures/Source.d.ts +15 -1
  215. three/src/textures/Texture.d.ts +40 -2
  216. three/examples/jsm/deprecated/Geometry.d.ts +0 -341
  217. three/examples/jsm/lights/IESSpotLight.d.ts +0 -5
  218. three/examples/jsm/nodes/display/PassNode.d.ts +0 -46
  219. three/examples/jsm/nodes/functions/PhongLightingModel.d.ts +0 -7
  220. three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +0 -17
  221. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +0 -129
  222. three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +0 -17
  223. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +0 -37
  224. three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +0 -3
  225. /three/{examples/jsm → src}/nodes/accessors/AccessorsUtils.d.ts +0 -0
  226. /three/{examples/jsm → src}/nodes/accessors/BitangentNode.d.ts +0 -0
  227. /three/{examples/jsm → src}/nodes/accessors/BufferNode.d.ts +0 -0
  228. /three/{examples/jsm → src}/nodes/accessors/ClippingNode.d.ts +0 -0
  229. /three/{examples/jsm → src}/nodes/accessors/ModelViewProjectionNode.d.ts +0 -0
  230. /three/{examples/jsm → src}/nodes/accessors/PointUVNode.d.ts +0 -0
  231. /three/{examples/jsm → src}/nodes/accessors/PositionNode.d.ts +0 -0
  232. /three/{examples/jsm → src}/nodes/accessors/ReferenceNode.d.ts +0 -0
  233. /three/{examples/jsm → src}/nodes/accessors/RendererReferenceNode.d.ts +0 -0
  234. /three/{examples/jsm → src}/nodes/accessors/TangentNode.d.ts +0 -0
  235. /three/{examples/jsm → src}/nodes/accessors/TextureBicubicNode.d.ts +0 -0
  236. /three/{examples/jsm → src}/nodes/accessors/UVNode.d.ts +0 -0
  237. /three/{examples/jsm → src}/nodes/accessors/UniformsNode.d.ts +0 -0
  238. /three/{examples/jsm → src}/nodes/accessors/UserDataNode.d.ts +0 -0
  239. /three/{examples/jsm → src}/nodes/accessors/VertexColorNode.d.ts +0 -0
  240. /three/{examples/jsm → src}/nodes/code/CodeNode.d.ts +0 -0
  241. /three/{examples/jsm → src}/nodes/code/ExpressionNode.d.ts +0 -0
  242. /three/{examples/jsm → src}/nodes/code/FunctionCallNode.d.ts +0 -0
  243. /three/{examples/jsm → src}/nodes/code/FunctionNode.d.ts +0 -0
  244. /three/{examples/jsm → src}/nodes/core/AssignNode.d.ts +0 -0
  245. /three/{examples/jsm → src}/nodes/core/AttributeNode.d.ts +0 -0
  246. /three/{examples/jsm → src}/nodes/core/BypassNode.d.ts +0 -0
  247. /three/{examples/jsm → src}/nodes/core/ConstNode.d.ts +0 -0
  248. /three/{examples/jsm → src}/nodes/core/ContextNode.d.ts +0 -0
  249. /three/{examples/jsm → src}/nodes/core/InputNode.d.ts +0 -0
  250. /three/{examples/jsm → src}/nodes/core/NodeAttribute.d.ts +0 -0
  251. /three/{examples/jsm → src}/nodes/core/NodeCode.d.ts +0 -0
  252. /three/{examples/jsm → src}/nodes/core/NodeFunctionInput.d.ts +0 -0
  253. /three/{examples/jsm → src}/nodes/core/NodeKeywords.d.ts +0 -0
  254. /three/{examples/jsm → src}/nodes/core/NodeParser.d.ts +0 -0
  255. /three/{examples/jsm → src}/nodes/core/NodeVar.d.ts +0 -0
  256. /three/{examples/jsm → src}/nodes/core/NodeVarying.d.ts +0 -0
  257. /three/{examples/jsm → src}/nodes/core/OutputStructNode.d.ts +0 -0
  258. /three/{examples/jsm → src}/nodes/core/StackNode.d.ts +0 -0
  259. /three/{examples/jsm → src}/nodes/core/StructTypeNode.d.ts +0 -0
  260. /three/{examples/jsm → src}/nodes/core/TempNode.d.ts +0 -0
  261. /three/{examples/jsm → src}/nodes/core/UniformGroup.d.ts +0 -0
  262. /three/{examples/jsm → src}/nodes/core/UniformGroupNode.d.ts +0 -0
  263. /three/{examples/jsm → src}/nodes/core/VaryingNode.d.ts +0 -0
  264. /three/{examples/jsm → src}/nodes/core/constants.d.ts +0 -0
  265. /three/{examples/jsm → src}/nodes/display/AfterImageNode.d.ts +0 -0
  266. /three/{examples/jsm → src}/nodes/display/BlendModeNode.d.ts +0 -0
  267. /three/{examples/jsm → src}/nodes/display/FrontFacingNode.d.ts +0 -0
  268. /three/{examples/jsm → src}/nodes/display/PosterizeNode.d.ts +0 -0
  269. /three/{examples/jsm → src}/nodes/display/ViewportDepthTextureNode.d.ts +0 -0
  270. /three/{examples/jsm → src}/nodes/display/ViewportNode.d.ts +0 -0
  271. /three/{examples/jsm → src}/nodes/display/ViewportSharedTextureNode.d.ts +0 -0
  272. /three/{examples/jsm → src}/nodes/fog/FogExp2Node.d.ts +0 -0
  273. /three/{examples/jsm → src}/nodes/fog/FogNode.d.ts +0 -0
  274. /three/{examples/jsm → src}/nodes/fog/FogRangeNode.d.ts +0 -0
  275. /three/{examples/jsm → src}/nodes/functions/BSDF/BRDF_GGX.d.ts +0 -0
  276. /three/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Lambert.d.ts +0 -0
  277. /three/{examples/jsm → src}/nodes/functions/BSDF/BRDF_Sheen.d.ts +0 -0
  278. /three/{examples/jsm → src}/nodes/functions/BSDF/DFGApprox.d.ts +0 -0
  279. /three/{examples/jsm → src}/nodes/functions/BSDF/D_GGX.d.ts +0 -0
  280. /three/{examples/jsm → src}/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts +0 -0
  281. /three/{examples/jsm → src}/nodes/functions/BSDF/F_Schlick.d.ts +0 -0
  282. /three/{examples/jsm → src}/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +0 -0
  283. /three/{examples/jsm → src}/nodes/functions/PhysicalLightingModel.d.ts +0 -0
  284. /three/{examples/jsm → src}/nodes/functions/ShadowMaskModel.d.ts +0 -0
  285. /three/{examples/jsm → src}/nodes/functions/ToonLightingModel.d.ts +0 -0
  286. /three/{examples/jsm → src}/nodes/functions/material/getGeometryRoughness.d.ts +0 -0
  287. /three/{examples/jsm → src}/nodes/functions/material/getRoughness.d.ts +0 -0
  288. /three/{examples/jsm → src}/nodes/gpgpu/ComputeNode.d.ts +0 -0
  289. /three/{examples/jsm → src}/nodes/lighting/AONode.d.ts +0 -0
  290. /three/{examples/jsm → src}/nodes/lighting/EnvironmentNode.d.ts +0 -0
  291. /three/{examples/jsm → src}/nodes/lighting/IrradianceNode.d.ts +0 -0
  292. /three/{examples/jsm → src}/nodes/lighting/LightUtils.d.ts +0 -0
  293. /three/{examples/jsm → src}/nodes/lighting/LightingContextNode.d.ts +0 -0
  294. /three/{examples/jsm → src}/nodes/materials/VolumeNodeMaterial.d.ts +0 -0
  295. /three/{examples/jsm → src}/nodes/materialx/MaterialXNodes.d.ts +0 -0
  296. /three/{examples/jsm → src}/nodes/materialx/lib/mx_transform_color.d.ts +0 -0
  297. /three/{examples/jsm → src}/nodes/math/CondNode.d.ts +0 -0
  298. /three/{examples/jsm → src}/nodes/math/HashNode.d.ts +0 -0
  299. /three/{examples/jsm → src}/nodes/math/MathUtils.d.ts +0 -0
  300. /three/{examples/jsm → src}/nodes/math/OperatorNode.d.ts +0 -0
  301. /three/{examples/jsm → src}/nodes/math/TriNoise3D.d.ts +0 -0
  302. /three/{examples/jsm → src}/nodes/procedural/CheckerNode.d.ts +0 -0
  303. /three/{examples/jsm → src}/nodes/shadernode/ShaderNode.d.ts +0 -0
  304. /three/{examples/jsm → src}/nodes/utils/ArrayElementNode.d.ts +0 -0
  305. /three/{examples/jsm → src}/nodes/utils/ConvertNode.d.ts +0 -0
  306. /three/{examples/jsm → src}/nodes/utils/EquirectUVNode.d.ts +0 -0
  307. /three/{examples/jsm → src}/nodes/utils/JoinNode.d.ts +0 -0
  308. /three/{examples/jsm → src}/nodes/utils/MatcapUVNode.d.ts +0 -0
  309. /three/{examples/jsm → src}/nodes/utils/OscNode.d.ts +0 -0
  310. /three/{examples/jsm → src}/nodes/utils/RemapNode.d.ts +0 -0
  311. /three/{examples/jsm → src}/nodes/utils/RotateNode.d.ts +0 -0
  312. /three/{examples/jsm → src}/nodes/utils/RotateUVNode.d.ts +0 -0
  313. /three/{examples/jsm → src}/nodes/utils/SplitNode.d.ts +0 -0
  314. /three/{examples/jsm → src}/nodes/utils/SpriteSheetUVNode.d.ts +0 -0
  315. /three/{examples/jsm → src}/nodes/utils/StoargeArrayElementNode.d.ts +0 -0
  316. /three/{examples/jsm → src}/nodes/utils/TimerNode.d.ts +0 -0
  317. /three/{examples/jsm → src}/nodes/utils/TriplanarTexturesNode.d.ts +0 -0
  318. /three/{examples/jsm → src}/renderers/common/Binding.d.ts +0 -0
  319. /three/{examples/jsm → src}/renderers/common/Buffer.d.ts +0 -0
  320. /three/{examples/jsm → src}/renderers/common/BufferUtils.d.ts +0 -0
  321. /three/{examples/jsm → src}/renderers/common/ChainMap.d.ts +0 -0
  322. /three/{examples/jsm → src}/renderers/common/ComputePipeline.d.ts +0 -0
  323. /three/{examples/jsm → src}/renderers/common/Constants.d.ts +0 -0
  324. /three/{examples/jsm → src}/renderers/common/DataMap.d.ts +0 -0
  325. /three/{examples/jsm → src}/renderers/common/Pipeline.d.ts +0 -0
  326. /three/{examples/jsm → src}/renderers/common/Pipelines.d.ts +0 -0
  327. /three/{examples/jsm → src}/renderers/common/ProgrammableStage.d.ts +0 -0
  328. /three/{examples/jsm → src}/renderers/common/RenderPipeline.d.ts +0 -0
  329. /three/{examples/jsm → src}/renderers/common/UniformBuffer.d.ts +0 -0
  330. /three/{examples/jsm → src}/renderers/webgpu/WebGPURenderer.d.ts +0 -0
@@ -4,7 +4,7 @@
4
4
  * @see {@link https://threejs.org/docs/index.html#api/en/extras/DataUtils | Official Documentation}
5
5
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/DataUtils.js | Source}
6
6
  */
7
- export function toHalfFloat(val: number): number;
7
+ declare function toHalfFloat(val: number): number;
8
8
 
9
9
  /**
10
10
  * Returns a single precision floating point value from the given half precision floating point value.
@@ -12,4 +12,11 @@ export function toHalfFloat(val: number): number;
12
12
  * @see {@link https://threejs.org/docs/index.html#api/en/extras/DataUtils | Official Documentation}
13
13
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/DataUtils.js | Source}
14
14
  */
15
- export function fromHalfFloat(val: number): number;
15
+ declare function fromHalfFloat(val: number): number;
16
+
17
+ declare const DataUtils: {
18
+ toHalfFloat: typeof toHalfFloat;
19
+ fromHalfFloat: typeof fromHalfFloat;
20
+ };
21
+
22
+ export { DataUtils, fromHalfFloat, toHalfFloat };
@@ -1,17 +1,14 @@
1
- import { Mapping } from "../constants.js";
2
- import { Texture } from "../textures/Texture.js";
3
-
4
1
  /**
5
2
  * A class containing utility functions for images.
6
3
  * @see {@link https://threejs.org/docs/index.html#api/en/extras/ImageUtils | Official Documentation}
7
4
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/ImageUtils.js | Source}
8
5
  */
9
- export namespace ImageUtils {
6
+ declare class ImageUtils {
10
7
  /**
11
8
  * Returns a data URI containing a representation of the given image.
12
9
  * @param image The image object.
13
10
  */
14
- function getDataURL(
11
+ static getDataURL(
15
12
  image: HTMLImageElement | HTMLCanvasElement | CanvasImageSource | ImageBitmap | ImageData,
16
13
  ): string;
17
14
 
@@ -19,15 +16,17 @@ export namespace ImageUtils {
19
16
  * Converts the given sRGB image data to linear color space.
20
17
  * @param image
21
18
  */
22
- function sRGBToLinear(image: HTMLImageElement | HTMLCanvasElement | ImageBitmap): HTMLCanvasElement;
19
+ static sRGBToLinear(image: HTMLImageElement | HTMLCanvasElement | ImageBitmap): HTMLCanvasElement;
23
20
 
24
21
  /**
25
22
  * Converts the given sRGB image data to linear color space.
26
23
  * @param image
27
24
  */
28
- function sRGBToLinear(image: ImageData): {
25
+ static sRGBToLinear(image: ImageData): {
29
26
  data: ImageData["data"];
30
27
  width: ImageData["width"];
31
28
  height: ImageData["height"];
32
29
  };
33
30
  }
31
+
32
+ export { ImageUtils };
@@ -1,7 +1,4 @@
1
- export interface Vec2 {
2
- x: number;
3
- y: number;
4
- }
1
+ import { Vector2Like } from "../math/Vector2.js";
5
2
 
6
3
  /**
7
4
  * A class containing utility functions for shapes.
@@ -9,20 +6,20 @@ export interface Vec2 {
9
6
  * @see {@link https://threejs.org/docs/index.html#api/en/extras/ShapeUtils | Official Documentation}
10
7
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/ShapeUtils.js | Source}
11
8
  */
12
- export namespace ShapeUtils {
9
+ export class ShapeUtils {
13
10
  /**
14
11
  * Calculate area of a ( 2D ) contour polygon.
15
12
  */
16
- function area(contour: Vec2[]): number;
13
+ static area(contour: readonly Vector2Like[]): number;
17
14
 
18
15
  /**
19
16
  * Note that this is a linear function so it is necessary to calculate separately for x, y components of a polygon.
20
17
  * @remarks Used internally by {@link THREE.Path | Path}, {@link THREE.ExtrudeGeometry | ExtrudeGeometry} and {@link THREE.ShapeGeometry | ShapeGeometry}.
21
18
  */
22
- function isClockWise(pts: Vec2[]): boolean;
19
+ static isClockWise(pts: readonly Vector2Like[]): boolean;
23
20
 
24
21
  /**
25
22
  * Used internally by {@link THREE.ExtrudeGeometry | ExtrudeGeometry} and {@link THREE.ShapeGeometry | ShapeGeometry} to calculate faces in shapes with holes.
26
23
  */
27
- function triangulateShape(contour: Vec2[], holes: Vec2[][]): number[][];
24
+ static triangulateShape(contour: Vector2Like[], holes: Vector2Like[][]): number[][];
28
25
  }
@@ -0,0 +1,42 @@
1
+ import { CompressedPixelFormat, PixelFormat, TextureDataType } from "../constants.js";
2
+ import { Texture } from "../textures/Texture.js";
3
+
4
+ /**
5
+ * Scales the texture as large as possible within its surface without cropping or stretching the texture. The method
6
+ * preserves the original aspect ratio of the texture. Akin to CSS `object-fit: contain`.
7
+ */
8
+ declare function contain(texture: Texture, aspect: number): Texture;
9
+
10
+ /**
11
+ * Scales the texture to the smallest possible size to fill the surface, leaving no empty space. The method preserves
12
+ * the original aspect ratio of the texture. Akin to CSS `object-fit: cover`.
13
+ */
14
+ declare function cover(texture: Texture, aspect: number): Texture;
15
+
16
+ /**
17
+ * Configures the texture to the default transformation. Akin to CSS `object-fit: fill`.
18
+ */
19
+ declare function fill(texture: Texture): Texture;
20
+
21
+ /**
22
+ * Given the width, height, format, and type of a texture. Determines how many bytes must be used to represent the
23
+ * texture.
24
+ */
25
+ declare function getByteLength(
26
+ width: number,
27
+ height: number,
28
+ format: PixelFormat | CompressedPixelFormat,
29
+ type: TextureDataType,
30
+ ): number;
31
+
32
+ /**
33
+ * A class containing utility functions for textures.
34
+ */
35
+ declare const TextureUtils: {
36
+ contain: typeof contain;
37
+ cover: typeof cover;
38
+ fill: typeof fill;
39
+ getByteLength: typeof getByteLength;
40
+ };
41
+
42
+ export { contain, cover, fill, getByteLength, TextureUtils };
@@ -1,6 +1,12 @@
1
1
  import { Vector2 } from "../../math/Vector2.js";
2
2
  import { Vector3 } from "../../math/Vector3.js";
3
3
 
4
+ export interface CurveJSON {
5
+ metadata: { version: number; type: string; generator: string };
6
+ arcLengthDivisions: number;
7
+ type: string;
8
+ }
9
+
4
10
  /**
5
11
  * An abstract base class for creating a {@link Curve} object that contains methods for interpolation
6
12
  * @remarks
@@ -146,11 +152,11 @@ export abstract class Curve<TVector extends Vector2 | Vector3> {
146
152
  /**
147
153
  * Returns a JSON object representation of this instance.
148
154
  */
149
- toJSON(): {};
155
+ toJSON(): CurveJSON;
150
156
 
151
157
  /**
152
158
  * Copies the data from the given JSON object to this instance.
153
159
  * @param json
154
160
  */
155
- fromJSON(json: {}): this;
161
+ fromJSON(json: CurveJSON): this;
156
162
  }
@@ -1,6 +1,11 @@
1
1
  import { Vector2 } from "../../math/Vector2.js";
2
2
  import { Vector3 } from "../../math/Vector3.js";
3
- import { Curve } from "./Curve.js";
3
+ import { Curve, CurveJSON } from "./Curve.js";
4
+
5
+ export interface CurvePathJSON extends CurveJSON {
6
+ autoClose: boolean;
7
+ curves: CurveJSON[];
8
+ }
4
9
 
5
10
  /**
6
11
  * Curved Path - a curve path is simply a array of connected curves, but retains the api of a curve.
@@ -66,4 +71,7 @@ export class CurvePath<TVector extends Vector2 | Vector3> extends Curve<TVector>
66
71
  * @param divisions Number of pieces to divide the curve into. Expects a `Integer`. Default `40`
67
72
  */
68
73
  override getSpacedPoints(divisions?: number): TVector[];
74
+
75
+ toJSON(): CurvePathJSON;
76
+ fromJSON(json: CurvePathJSON): this;
69
77
  }
@@ -1,5 +1,9 @@
1
- import { Vector2 } from "../../math/Vector2.js";
2
- import { CurvePath } from "./CurvePath.js";
1
+ import { Vector2, Vector2Tuple } from "../../math/Vector2.js";
2
+ import { CurvePath, CurvePathJSON } from "./CurvePath.js";
3
+
4
+ export interface PathJSON extends CurvePathJSON {
5
+ currentPoint: Vector2Tuple;
6
+ }
3
7
 
4
8
  /**
5
9
  * A 2D {@link Path} representation.
@@ -156,4 +160,7 @@ export class Path extends CurvePath<Vector2> {
156
160
  * @param points An array of {@link Vector2 | Vector2's}
157
161
  */
158
162
  splineThru(pts: Vector2[]): this;
163
+
164
+ toJSON(): PathJSON;
165
+ fromJSON(json: PathJSON): this;
159
166
  }
@@ -1,5 +1,10 @@
1
1
  import { Vector2 } from "../../math/Vector2.js";
2
- import { Path } from "./Path.js";
2
+ import { Path, PathJSON } from "./Path.js";
3
+
4
+ export interface ShapeJSON extends PathJSON {
5
+ uuid: string;
6
+ holes: PathJSON[];
7
+ }
3
8
 
4
9
  /**
5
10
  * Defines an arbitrary 2d {@link Shape} plane using paths with optional holes
@@ -75,4 +80,7 @@ export class Shape extends Path {
75
80
  * @param divisions The fineness of the result. Expects a `Integer`
76
81
  */
77
82
  getPointsHoles(divisions: number): Vector2[][];
83
+
84
+ toJSON(): ShapeJSON;
85
+ fromJSON(json: ShapeJSON): this;
78
86
  }
@@ -1,6 +1,21 @@
1
- import { Object3D } from "../core/Object3D.js";
1
+ import { JSONMeta, Object3D, Object3DJSON } from "../core/Object3D.js";
2
2
  import { Color, ColorRepresentation } from "../math/Color.js";
3
- import { LightShadow } from "./LightShadow.js";
3
+ import { LightShadow, LightShadowJSON } from "./LightShadow.js";
4
+
5
+ export interface LightJSON extends Object3DJSON {
6
+ color: number;
7
+ intensity: number;
8
+
9
+ groundColor?: number;
10
+
11
+ distance?: number;
12
+ angle?: number;
13
+ decay?: number;
14
+ penumbra?: number;
15
+
16
+ shadow?: LightShadowJSON;
17
+ target?: string;
18
+ }
4
19
 
5
20
  /**
6
21
  * Abstract base class for lights.
@@ -62,4 +77,6 @@ export abstract class Light<TShadowSupport extends LightShadow | undefined = Lig
62
77
  * Call this method whenever this instance is no longer used in your app.
63
78
  */
64
79
  dispose(): void;
80
+
81
+ toJSON(meta?: JSONMeta): LightJSON;
65
82
  }
@@ -1,11 +1,22 @@
1
1
  import { Camera } from "../cameras/Camera.js";
2
+ import { Object3DJSONObject } from "../core/Object3D.js";
2
3
  import { Frustum } from "../math/Frustum.js";
3
4
  import { Matrix4 } from "../math/Matrix4.js";
4
- import { Vector2 } from "../math/Vector2.js";
5
+ import { Vector2, Vector2Tuple } from "../math/Vector2.js";
5
6
  import { Vector4 } from "../math/Vector4.js";
6
7
  import { WebGLRenderTarget } from "../renderers/WebGLRenderTarget.js";
7
8
  import { Light } from "./Light.js";
8
9
 
10
+ export interface LightShadowJSON {
11
+ intensity?: number;
12
+ bias?: number;
13
+ normalBias?: number;
14
+ radius?: number;
15
+ mapSize?: Vector2Tuple;
16
+
17
+ camera: Omit<Object3DJSONObject, "matrix">;
18
+ }
19
+
9
20
  /**
10
21
  * Serves as a base class for the other shadow classes.
11
22
  * @see {@link https://threejs.org/docs/index.html#api/en/lights/shadows/LightShadow | Official Documentation}
@@ -24,6 +35,11 @@ export class LightShadow<TCamera extends Camera = Camera> {
24
35
  */
25
36
  camera: TCamera;
26
37
 
38
+ /**
39
+ * The intensity of the shadow. The default is `1`. Valid values are in the range `[0, 1]`.
40
+ */
41
+ intensity: number;
42
+
27
43
  /**
28
44
  * Shadow map bias, how much to add or subtract from the normalized depth when deciding whether a surface is in shadow.
29
45
  * @remark The Very tiny adjustments here (in the order of 0.0001) may help reduce artifacts in shadows.
@@ -122,7 +138,7 @@ export class LightShadow<TCamera extends Camera = Camera> {
122
138
  /**
123
139
  * Serialize this LightShadow.
124
140
  */
125
- toJSON(): {};
141
+ toJSON(): LightShadowJSON;
126
142
 
127
143
  /**
128
144
  * Gets the shadow cameras frustum
@@ -0,0 +1,6 @@
1
+ import { Texture } from "../../textures/Texture.js";
2
+ import { SpotLight } from "../SpotLight.js";
3
+
4
+ export default class IESSpotLight extends SpotLight {
5
+ iesMap: Texture | null;
6
+ }
@@ -1,16 +1,21 @@
1
- export namespace Cache {
1
+ declare const Cache: {
2
2
  /**
3
3
  * @default false
4
4
  */
5
- let enabled: boolean;
5
+ enabled: boolean;
6
6
 
7
7
  /**
8
8
  * @default {}
9
9
  */
10
- let files: any;
10
+ files: any;
11
11
 
12
- function add(key: string, file: any): void;
13
- function get(key: string): any;
14
- function remove(key: string): void;
15
- function clear(): void;
16
- }
12
+ add(key: string, file: any): void;
13
+
14
+ get(key: string): any;
15
+
16
+ remove(key: string): void;
17
+
18
+ clear(): void;
19
+ };
20
+
21
+ export { Cache };
@@ -4,7 +4,9 @@ import {
4
4
  BlendingDstFactor,
5
5
  BlendingEquation,
6
6
  BlendingSrcFactor,
7
+ Combine,
7
8
  DepthModes,
9
+ NormalMapTypes,
8
10
  PixelFormat,
9
11
  Side,
10
12
  StencilFunc,
@@ -12,13 +14,14 @@ import {
12
14
  } from "../constants.js";
13
15
  import { BufferGeometry } from "../core/BufferGeometry.js";
14
16
  import { EventDispatcher } from "../core/EventDispatcher.js";
15
- import { Object3D } from "../core/Object3D.js";
17
+ import { JSONMeta, Object3D } from "../core/Object3D.js";
16
18
  import { Color, ColorRepresentation } from "../math/Color.js";
17
19
  import { Plane } from "../math/Plane.js";
18
20
  import { Group } from "../objects/Group.js";
19
21
  import { WebGLProgramParametersWithUniforms } from "../renderers/webgl/WebGLPrograms.js";
20
22
  import { WebGLRenderer } from "../renderers/WebGLRenderer.js";
21
23
  import { Scene } from "../scenes/Scene.js";
24
+ import { EulerTuple, SourceJSON, TextureJSON, Vector2Tuple } from "../Three.js";
22
25
 
23
26
  export interface MaterialParameters {
24
27
  alphaHash?: boolean | undefined;
@@ -68,6 +71,165 @@ export interface MaterialParameters {
68
71
  userData?: Record<string, any> | undefined;
69
72
  }
70
73
 
74
+ export interface MaterialJSON {
75
+ metadata: { version: number; type: string; generator: string };
76
+
77
+ uuid: string;
78
+ type: string;
79
+
80
+ name?: string;
81
+
82
+ color?: number;
83
+ roughness?: number;
84
+ metalness?: number;
85
+
86
+ sheen?: number;
87
+ sheenColor?: number;
88
+ sheenRoughness?: number;
89
+ emissive?: number;
90
+ emissiveIntensity?: number;
91
+
92
+ specular?: number;
93
+ specularIntensity?: number;
94
+ specularColor?: number;
95
+ shininess?: number;
96
+ clearcoat?: number;
97
+ clearcoatRoughness?: number;
98
+ clearcoatMap?: string;
99
+ clearcoatRoughnessMap?: string;
100
+ clearcoatNormalMap?: string;
101
+ clearcoatNormalScale?: Vector2Tuple;
102
+
103
+ dispersion?: number;
104
+
105
+ iridescence?: number;
106
+ iridescenceIOR?: number;
107
+ iridescenceThicknessRange?: number;
108
+ iridescenceMap?: string;
109
+ iridescenceThicknessMap?: string;
110
+
111
+ anisotropy?: number;
112
+ anisotropyRotation?: number;
113
+ anisotropyMap?: string;
114
+
115
+ map?: string;
116
+ matcap?: string;
117
+ alphaMap?: string;
118
+
119
+ lightMap?: string;
120
+ lightMapIntensity?: number;
121
+
122
+ aoMap?: string;
123
+ aoMapIntensity?: number;
124
+
125
+ bumpMap?: string;
126
+ bumpScale?: number;
127
+
128
+ normalMap?: string;
129
+ normalMapType?: NormalMapTypes;
130
+ normalScale?: Vector2Tuple;
131
+
132
+ displacementMap?: string;
133
+ displacementScale?: number;
134
+ displacementBias?: number;
135
+
136
+ roughnessMap?: string;
137
+ metalnessMap?: string;
138
+
139
+ emissiveMap?: string;
140
+ specularMap?: string;
141
+ specularIntensityMap?: string;
142
+ specularColorMap?: string;
143
+
144
+ envMap?: string;
145
+ combine?: Combine;
146
+
147
+ envMapRotation?: EulerTuple;
148
+ envMapIntensity?: number;
149
+ reflectivity?: number;
150
+ refractionRatio?: number;
151
+
152
+ gradientMap?: string;
153
+
154
+ transmission?: number;
155
+ transmissionMap?: string;
156
+ thickness?: number;
157
+ thicknessMap?: string;
158
+ attenuationDistance?: number;
159
+ attenuationColor?: number;
160
+
161
+ size?: number;
162
+ shadowSide?: number;
163
+ sizeAttenuation?: boolean;
164
+
165
+ blending?: Blending;
166
+ side?: Side;
167
+ vertexColors?: boolean;
168
+
169
+ opacity?: number;
170
+ transparent?: boolean;
171
+
172
+ blendSrc?: BlendingSrcFactor;
173
+ blendDst?: BlendingDstFactor;
174
+ blendEquation?: BlendingEquation;
175
+ blendSrcAlpha?: number | null;
176
+ blendDstAlpha?: number | null;
177
+ blendEquationAlpha?: number | null;
178
+ blendColor?: number;
179
+ blendAlpha?: number;
180
+
181
+ depthFunc?: DepthModes;
182
+ depthTest?: boolean;
183
+ depthWrite?: boolean;
184
+ colorWrite?: boolean;
185
+
186
+ stencilWriteMask?: number;
187
+ stencilFunc?: StencilFunc;
188
+ stencilRef?: number;
189
+ stencilFuncMask?: number;
190
+ stencilFail?: StencilOp;
191
+ stencilZFail?: StencilOp;
192
+ stencilZPass?: StencilOp;
193
+ stencilWrite?: boolean;
194
+
195
+ rotation?: number;
196
+
197
+ polygonOffset?: boolean;
198
+ polygonOffsetFactor?: number;
199
+ polygonOffsetUnits?: number;
200
+
201
+ linewidth?: number;
202
+ dashSize?: number;
203
+ gapSize?: number;
204
+ scale?: number;
205
+
206
+ dithering?: boolean;
207
+
208
+ alphaTest?: number;
209
+ alphaHash?: boolean;
210
+ alphaToCoverage?: boolean;
211
+ premultipliedAlpha?: boolean;
212
+ forceSinglePass?: boolean;
213
+
214
+ wireframe?: boolean;
215
+ wireframeLinewidth?: number;
216
+ wireframeLinecap?: string;
217
+ wireframeLinejoin?: string;
218
+
219
+ flatShading?: boolean;
220
+
221
+ visible?: boolean;
222
+
223
+ toneMapped?: boolean;
224
+
225
+ fog?: boolean;
226
+
227
+ userData?: Record<string, unknown>;
228
+
229
+ textures?: Array<Omit<TextureJSON, "metadata">>;
230
+ images?: SourceJSON[];
231
+ }
232
+
71
233
  /**
72
234
  * Materials describe the appearance of objects. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.
73
235
  */
@@ -394,17 +556,6 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
394
556
  */
395
557
  set alphaTest(value: number);
396
558
 
397
- onBuild(object: Object3D, parameters: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer): void;
398
-
399
- onBeforeRender(
400
- renderer: WebGLRenderer,
401
- scene: Scene,
402
- camera: Camera,
403
- geometry: BufferGeometry,
404
- object: Object3D,
405
- group: Group,
406
- ): void;
407
-
408
559
  /**
409
560
  * An optional callback that is executed immediately before the shader program is compiled.
410
561
  * This function is called with the associated WebGL program parameters and renderer.
@@ -429,7 +580,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
429
580
  * Convert the material to three.js JSON format.
430
581
  * @param meta Object containing metadata such as textures or images for the material.
431
582
  */
432
- toJSON(meta?: any): any;
583
+ toJSON(meta?: JSONMeta): MaterialJSON;
433
584
 
434
585
  /**
435
586
  * Return a new material with the same parameters as this material.
@@ -443,7 +594,10 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
443
594
  copy(material: Material): this;
444
595
 
445
596
  /**
446
- * This disposes the material. Textures of a material don't get disposed. These needs to be disposed by {@link Texture}.
597
+ * Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer
598
+ * used in your app.
599
+ *
600
+ * Material textures must be disposed of by the dispose() method of {@link Texture}.
447
601
  */
448
602
  dispose(): void;
449
603
 
@@ -453,4 +607,21 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
453
607
  * @default false
454
608
  */
455
609
  set needsUpdate(value: boolean);
610
+
611
+ /**
612
+ * @deprecated onBuild() has been removed.
613
+ */
614
+ onBuild(object: Object3D, parameters: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer): void;
615
+
616
+ /**
617
+ * @deprecated onBeforeRender() has been removed.
618
+ */
619
+ onBeforeRender(
620
+ renderer: WebGLRenderer,
621
+ scene: Scene,
622
+ camera: Camera,
623
+ geometry: BufferGeometry,
624
+ object: Object3D,
625
+ group: Group,
626
+ ): void;
456
627
  }
@@ -1,7 +1,13 @@
1
1
  import { GLSLVersion } from "../constants.js";
2
+ import { JSONMeta } from "../core/Object3D.js";
2
3
  import { UniformsGroup } from "../core/UniformsGroup.js";
4
+ import { Matrix3, Matrix3Tuple } from "../math/Matrix3.js";
5
+ import { Matrix4, Matrix4Tuple } from "../math/Matrix4.js";
6
+ import { Vector2Tuple } from "../math/Vector2.js";
7
+ import { Vector3Tuple } from "../math/Vector3.js";
8
+ import { Vector4Tuple } from "../math/Vector4.js";
3
9
  import { IUniform } from "../renderers/shaders/UniformsLib.js";
4
- import { Material, MaterialParameters } from "./Material.js";
10
+ import { Material, MaterialJSON, MaterialParameters } from "./Material.js";
5
11
 
6
12
  export interface ShaderMaterialParameters extends MaterialParameters {
7
13
  uniforms?: { [uniform: string]: IUniform } | undefined;
@@ -23,6 +29,46 @@ export interface ShaderMaterialParameters extends MaterialParameters {
23
29
  glslVersion?: GLSLVersion | undefined;
24
30
  }
25
31
 
32
+ export type ShaderMaterialUniformJSON = {
33
+ type: "t";
34
+ value: string;
35
+ } | {
36
+ type: "c";
37
+ value: number;
38
+ } | {
39
+ type: "v2";
40
+ value: Vector2Tuple;
41
+ } | {
42
+ type: "v3";
43
+ value: Vector3Tuple;
44
+ } | {
45
+ type: "v4";
46
+ value: Vector4Tuple;
47
+ } | {
48
+ type: "m3";
49
+ value: Matrix3Tuple;
50
+ } | {
51
+ type: "m4";
52
+ value: Matrix4Tuple;
53
+ } | {
54
+ value: unknown;
55
+ };
56
+
57
+ export interface ShaderMaterialJSON extends MaterialJSON {
58
+ glslVersion: number | null;
59
+ uniforms: Record<string, ShaderMaterialUniformJSON>;
60
+
61
+ defines?: Record<string, unknown>;
62
+
63
+ vertexShader: string;
64
+ ragmentShader: string;
65
+
66
+ lights: boolean;
67
+ clipping: boolean;
68
+
69
+ extensions?: Record<string, boolean>;
70
+ }
71
+
26
72
  export class ShaderMaterial extends Material {
27
73
  constructor(parameters?: ShaderMaterialParameters);
28
74
 
@@ -116,5 +162,6 @@ export class ShaderMaterial extends Material {
116
162
  glslVersion: GLSLVersion | null;
117
163
 
118
164
  setValues(parameters: ShaderMaterialParameters): void;
119
- toJSON(meta: any): any;
165
+
166
+ toJSON(meta?: JSONMeta): ShaderMaterialJSON;
120
167
  }
@@ -8,6 +8,7 @@ import {
8
8
  SRGBColorSpace,
9
9
  } from "../constants.js";
10
10
  import { Color } from "./Color.js";
11
+ import { Vector3 } from "./Vector3.js";
11
12
 
12
13
  export type WorkingColorSpace = typeof LinearSRGBColorSpace | typeof LinearDisplayP3ColorSpace;
13
14
  export type DefinedColorSpace =
@@ -37,6 +38,8 @@ export interface ColorManagement {
37
38
  getPrimaries: (colorSpace: DefinedColorSpace) => ColorSpacePrimaries;
38
39
 
39
40
  getTransfer: (colorSpace: ColorSpace) => ColorSpaceTransfer;
41
+
42
+ getLuminanceCoefficients: (target: Vector3, colorSpace?: ColorSpace) => Vector3;
40
43
  }
41
44
 
42
45
  export const ColorManagement: ColorManagement;