@types/three 0.159.0 → 0.161.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 (211) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +5 -1
  3. three/examples/jsm/capabilities/WebGPU.d.ts +2 -0
  4. three/examples/jsm/curves/NURBSUtils.d.ts +136 -10
  5. three/examples/jsm/curves/NURBSVolume.d.ts +23 -0
  6. three/examples/jsm/exporters/USDZExporter.d.ts +1 -0
  7. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -0
  8. three/examples/jsm/loaders/KTX2Loader.d.ts +45 -11
  9. three/examples/jsm/loaders/LUT3dlLoader.d.ts +29 -2
  10. three/examples/jsm/loaders/LUTCubeLoader.d.ts +37 -2
  11. three/examples/jsm/loaders/MaterialXLoader.d.ts +6 -0
  12. three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts +13 -0
  13. three/examples/jsm/misc/Timer.d.ts +80 -0
  14. three/examples/jsm/nodes/Nodes.d.ts +304 -61
  15. three/examples/jsm/nodes/accessors/BitangentNode.d.ts +9 -0
  16. three/examples/jsm/nodes/accessors/BufferNode.d.ts +4 -1
  17. three/examples/jsm/nodes/accessors/CameraNode.d.ts +24 -6
  18. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +17 -4
  19. three/examples/jsm/nodes/accessors/InstanceNode.d.ts +3 -0
  20. three/examples/jsm/nodes/accessors/MaterialNode.d.ts +12 -0
  21. three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +7 -0
  22. three/examples/jsm/nodes/accessors/ModelNode.d.ts +9 -1
  23. three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +3 -0
  24. three/examples/jsm/nodes/accessors/NormalNode.d.ts +8 -0
  25. three/examples/jsm/nodes/accessors/Object3DNode.d.ts +10 -6
  26. three/examples/jsm/nodes/accessors/PointUVNode.d.ts +3 -0
  27. three/examples/jsm/nodes/accessors/PositionNode.d.ts +8 -0
  28. three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +4 -1
  29. three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +3 -0
  30. three/examples/jsm/nodes/accessors/SkinningNode.d.ts +3 -0
  31. three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +8 -1
  32. three/examples/jsm/nodes/accessors/TangentNode.d.ts +9 -0
  33. three/examples/jsm/nodes/accessors/TextureBicubicNode.d.ts +18 -0
  34. three/examples/jsm/nodes/accessors/TextureNode.d.ts +21 -5
  35. three/examples/jsm/nodes/accessors/UVNode.d.ts +3 -0
  36. three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
  37. three/examples/jsm/nodes/accessors/VertexColorNode.d.ts +12 -0
  38. three/examples/jsm/nodes/code/CodeNode.d.ts +4 -0
  39. three/examples/jsm/nodes/code/ExpressionNode.d.ts +3 -0
  40. three/examples/jsm/nodes/code/FunctionCallNode.d.ts +13 -1
  41. three/examples/jsm/nodes/code/FunctionNode.d.ts +17 -0
  42. three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +1 -1
  43. three/examples/jsm/nodes/core/AssignNode.d.ts +17 -0
  44. three/examples/jsm/nodes/core/AttributeNode.d.ts +3 -0
  45. three/examples/jsm/nodes/core/BypassNode.d.ts +9 -0
  46. three/examples/jsm/nodes/core/CacheNode.d.ts +11 -0
  47. three/examples/jsm/nodes/core/ConstNode.d.ts +3 -3
  48. three/examples/jsm/nodes/core/ContextNode.d.ts +11 -0
  49. three/examples/jsm/nodes/core/IndexNode.d.ts +18 -0
  50. three/examples/jsm/nodes/core/InputNode.d.ts +4 -4
  51. three/examples/jsm/nodes/core/LightingModel.d.ts +36 -0
  52. three/examples/jsm/nodes/core/Node.d.ts +32 -8
  53. three/examples/jsm/nodes/core/NodeBuilder.d.ts +27 -23
  54. three/examples/jsm/nodes/core/NodeFrame.d.ts +18 -6
  55. three/examples/jsm/nodes/core/NodeUniform.d.ts +12 -8
  56. three/examples/jsm/nodes/core/NodeUtils.d.ts +6 -3
  57. three/examples/jsm/nodes/core/PropertyNode.d.ts +27 -1
  58. three/examples/jsm/nodes/core/UniformNode.d.ts +12 -4
  59. three/examples/jsm/nodes/core/VarNode.d.ts +10 -0
  60. three/examples/jsm/nodes/core/VaryingNode.d.ts +9 -0
  61. three/examples/jsm/nodes/core/constants.d.ts +31 -28
  62. three/examples/jsm/nodes/display/AfterImageNode.d.ts +25 -0
  63. three/examples/jsm/nodes/display/AnamorphicNode.d.ts +32 -0
  64. three/examples/jsm/nodes/display/BlendModeNode.d.ts +21 -6
  65. three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +29 -1
  66. three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +17 -0
  67. three/examples/jsm/nodes/display/FrontFacingNode.d.ts +4 -0
  68. three/examples/jsm/nodes/display/GaussianBlurNode.d.ts +28 -0
  69. three/examples/jsm/nodes/display/NormalMapNode.d.ts +13 -1
  70. three/examples/jsm/nodes/display/PassNode.d.ts +44 -0
  71. three/examples/jsm/nodes/display/PosterizeNode.d.ts +12 -0
  72. three/examples/jsm/nodes/display/ToneMappingNode.d.ts +8 -1
  73. three/examples/jsm/nodes/display/ViewportDepthNode.d.ts +32 -0
  74. three/examples/jsm/nodes/display/ViewportNode.d.ts +8 -0
  75. three/examples/jsm/nodes/display/ViewportSharedTextureNode.d.ts +18 -0
  76. three/examples/jsm/nodes/display/ViewportTextureNode.d.ts +33 -0
  77. three/examples/jsm/nodes/fog/FogExp2Node.d.ts +9 -0
  78. three/examples/jsm/nodes/fog/FogNode.d.ts +9 -0
  79. three/examples/jsm/nodes/fog/FogRangeNode.d.ts +9 -0
  80. three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +9 -2
  81. three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +3 -2
  82. three/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.d.ts +7 -0
  83. three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +3 -2
  84. three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +3 -2
  85. three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +3 -2
  86. three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +1 -1
  87. three/examples/jsm/nodes/functions/PhongLightingModel.d.ts +7 -0
  88. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +17 -8
  89. three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +1 -1
  90. three/examples/jsm/nodes/functions/material/getRoughness.d.ts +1 -1
  91. three/examples/jsm/nodes/geometry/RangeNode.d.ts +3 -0
  92. three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +13 -0
  93. three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +20 -8
  94. three/examples/jsm/nodes/lighting/LightsNode.d.ts +3 -0
  95. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +1 -2
  96. three/examples/jsm/nodes/materials/Materials.d.ts +9 -17
  97. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +2 -4
  98. three/examples/jsm/nodes/materials/MeshPhongNodeMaterial.d.ts +12 -0
  99. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +16 -7
  100. three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +17 -0
  101. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +1 -5
  102. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +55 -16
  103. three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +2 -8
  104. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +0 -10
  105. three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +43 -34
  106. three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +5 -3
  107. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +7 -5
  108. three/examples/jsm/nodes/math/CondNode.d.ts +13 -0
  109. three/examples/jsm/nodes/math/HashNode.d.ts +16 -0
  110. three/examples/jsm/nodes/math/MathNode.d.ts +140 -1
  111. three/examples/jsm/nodes/math/MathUtils.d.ts +16 -0
  112. three/examples/jsm/nodes/math/OperatorNode.d.ts +53 -1
  113. three/examples/jsm/nodes/math/TriNoise3D.d.ts +12 -0
  114. three/examples/jsm/nodes/procedural/CheckerNode.d.ts +9 -0
  115. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +124 -31
  116. three/examples/jsm/nodes/utils/DiscardNode.d.ts +16 -0
  117. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +4 -2
  118. three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +3 -0
  119. three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +6 -3
  120. three/examples/jsm/nodes/utils/OscNode.d.ts +6 -0
  121. three/examples/jsm/nodes/utils/ReflectorNode.d.ts +30 -0
  122. three/examples/jsm/nodes/utils/RemapNode.d.ts +24 -1
  123. three/examples/jsm/nodes/utils/RotateNode.d.ts +21 -0
  124. three/examples/jsm/nodes/utils/RotateUVNode.d.ts +9 -0
  125. three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +5 -1
  126. three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +7 -0
  127. three/examples/jsm/nodes/utils/TimerNode.d.ts +7 -1
  128. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +28 -7
  129. three/examples/jsm/objects/GroundedSkybox.d.ts +5 -0
  130. three/examples/jsm/objects/QuadMesh.d.ts +15 -0
  131. three/examples/jsm/postprocessing/{HBAOPass.d.ts → GTAOPass.d.ts} +25 -10
  132. three/examples/jsm/postprocessing/SSAOPass.d.ts +1 -1
  133. three/examples/jsm/renderers/common/Backend.d.ts +6 -2
  134. three/examples/jsm/renderers/common/Color4.d.ts +9 -0
  135. three/examples/jsm/renderers/common/Info.d.ts +7 -1
  136. three/examples/jsm/renderers/common/PostProcessing.d.ts +11 -0
  137. three/examples/jsm/renderers/common/Renderer.d.ts +243 -4
  138. three/examples/jsm/renderers/common/StorageTexture.d.ts +5 -0
  139. three/examples/jsm/renderers/webgl/WebGLBackend.d.ts +4 -2
  140. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +2 -2
  141. three/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.d.ts +3 -0
  142. three/examples/jsm/renderers/webgpu/WebGPUBackend.d.ts +15 -6
  143. three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +7 -7
  144. three/examples/jsm/shaders/{HBAOShader.d.ts → GTAOShader.d.ts} +23 -8
  145. three/examples/jsm/shaders/PoissonDenoiseShader.d.ts +1 -1
  146. three/examples/jsm/utils/BufferGeometryUtils.d.ts +0 -10
  147. three/examples/jsm/webxr/XRControllerModelFactory.d.ts +6 -5
  148. three/examples/jsm/webxr/XRHandMeshModel.d.ts +10 -2
  149. three/package.json +2 -2
  150. three/src/Three.d.ts +1 -0
  151. three/src/cameras/PerspectiveCamera.d.ts +13 -0
  152. three/src/constants.d.ts +4 -3
  153. three/src/core/InterleavedBufferAttribute.d.ts +12 -2
  154. three/src/core/Object3D.d.ts +13 -13
  155. three/src/core/UniformsGroup.d.ts +3 -3
  156. three/src/extras/core/Curve.d.ts +9 -9
  157. three/src/extras/core/CurvePath.d.ts +8 -7
  158. three/src/geometries/RingGeometry.d.ts +1 -1
  159. three/src/lights/PointLight.d.ts +7 -0
  160. three/src/loaders/MaterialLoader.d.ts +6 -3
  161. three/src/materials/LineBasicMaterial.d.ts +7 -0
  162. three/src/materials/LineDashedMaterial.d.ts +7 -1
  163. three/src/materials/Material.d.ts +17 -15
  164. three/src/materials/MeshBasicMaterial.d.ts +7 -0
  165. three/src/materials/MeshDepthMaterial.d.ts +6 -0
  166. three/src/materials/MeshDistanceMaterial.d.ts +7 -0
  167. three/src/materials/MeshLambertMaterial.d.ts +7 -0
  168. three/src/materials/MeshMatcapMaterial.d.ts +7 -0
  169. three/src/materials/MeshNormalMaterial.d.ts +7 -0
  170. three/src/materials/MeshPhongMaterial.d.ts +7 -0
  171. three/src/materials/MeshPhysicalMaterial.d.ts +6 -1
  172. three/src/materials/MeshStandardMaterial.d.ts +7 -2
  173. three/src/materials/MeshToonMaterial.d.ts +7 -0
  174. three/src/materials/PointsMaterial.d.ts +7 -0
  175. three/src/materials/RawShaderMaterial.d.ts +9 -0
  176. three/src/materials/ShaderMaterial.d.ts +17 -3
  177. three/src/materials/ShadowMaterial.d.ts +7 -0
  178. three/src/materials/SpriteMaterial.d.ts +7 -2
  179. three/src/math/Color.d.ts +1 -1
  180. three/src/math/Matrix4.d.ts +30 -30
  181. three/src/math/Quaternion.d.ts +27 -30
  182. three/src/math/Sphere.d.ts +5 -0
  183. three/src/math/Triangle.d.ts +8 -25
  184. three/src/math/Vector2.d.ts +24 -159
  185. three/src/math/Vector3.d.ts +46 -54
  186. three/src/math/Vector4.d.ts +25 -20
  187. three/src/objects/BatchedMesh.d.ts +2 -2
  188. three/src/objects/Bone.d.ts +2 -2
  189. three/src/objects/InstancedMesh.d.ts +2 -1
  190. three/src/objects/LOD.d.ts +2 -2
  191. three/src/objects/Line.d.ts +3 -2
  192. three/src/objects/LineLoop.d.ts +3 -1
  193. three/src/objects/LineSegments.d.ts +3 -1
  194. three/src/objects/Points.d.ts +3 -2
  195. three/src/objects/SkinnedMesh.d.ts +4 -8
  196. three/src/objects/Sprite.d.ts +2 -2
  197. three/src/renderers/shaders/ShaderLib.d.ts +18 -18
  198. three/src/renderers/shaders/UniformsUtils.d.ts +3 -2
  199. three/src/renderers/webgl/WebGLLights.d.ts +39 -37
  200. three/src/renderers/webgl/WebGLProgram.d.ts +0 -1
  201. three/src/renderers/webgl/WebGLPrograms.d.ts +226 -9
  202. three/src/renderers/webxr/WebXRDepthSensing.d.ts +27 -0
  203. three/src/renderers/webxr/WebXRManager.d.ts +2 -1
  204. three/src/textures/CompressedCubeTexture.d.ts +13 -0
  205. three/src/textures/DataArrayTexture.d.ts +1 -1
  206. three/src/textures/Source.d.ts +11 -1
  207. three/build/three.d.ts +0 -2
  208. three/build/three.min.d.ts +0 -2
  209. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +0 -310
  210. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +0 -166
  211. three/examples/jsm/objects/GroundProjectedSkybox.d.ts +0 -13
three/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 30 Nov 2023 20:07:36 GMT
11
+ * Last updated: Wed, 31 Jan 2024 17:07:12 GMT
12
12
  * Dependencies: [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer)
13
13
 
14
14
  # Credits
@@ -25,6 +25,7 @@ export * from './csm/CSMShader.js';
25
25
  export * as Curves from './curves/CurveExtras.js';
26
26
  export * from './curves/NURBSCurve.js';
27
27
  export * from './curves/NURBSSurface.js';
28
+ export * from './curves/NURBSVolume.js';
28
29
  export * as NURBSUtils from './curves/NURBSUtils.js';
29
30
 
30
31
  export * from './effects/AnaglyphEffect.js';
@@ -151,6 +152,7 @@ export * from './misc/MorphAnimMesh.js';
151
152
  export * from './misc/MorphBlendMesh.js';
152
153
  export * from './misc/ProgressiveLightMap.js';
153
154
  export * from './misc/RollerCoaster.js';
155
+ export * from './misc/Timer.js';
154
156
  export * from './misc/TubePainter.js';
155
157
  export * from './misc/Volume.js';
156
158
  export * from './misc/VolumeSlice.js';
@@ -160,7 +162,7 @@ export * from './modifiers/EdgeSplitModifier.js';
160
162
  export * from './modifiers/SimplifyModifier.js';
161
163
  export * from './modifiers/TessellateModifier.js';
162
164
 
163
- export * from './objects/GroundProjectedSkybox.js';
165
+ export * from './objects/GroundedSkybox.js';
164
166
  export * from './objects/Lensflare.js';
165
167
  export * from './objects/MarchingCubes.js';
166
168
  export * from './objects/Reflector.js';
@@ -183,6 +185,7 @@ export * from './postprocessing/DotScreenPass.js';
183
185
  export * from './postprocessing/EffectComposer.js';
184
186
  export * from './postprocessing/FilmPass.js';
185
187
  export * from './postprocessing/GlitchPass.js';
188
+ export * from './postprocessing/GTAOPass.js';
186
189
  export * from './postprocessing/HalftonePass.js';
187
190
  export * from './postprocessing/LUTPass.js';
188
191
  export * from './postprocessing/MaskPass.js';
@@ -230,6 +233,7 @@ export * from './shaders/FocusShader.js';
230
233
  export * from './shaders/FreiChenShader.js';
231
234
  export * from './shaders/GammaCorrectionShader.js';
232
235
  export * from './shaders/GodRaysShader.js';
236
+ export * from './shaders/GTAOShader.js';
233
237
  export * from './shaders/HalftoneShader.js';
234
238
  export * from './shaders/HorizontalBlurShader.js';
235
239
  export * from './shaders/HorizontalTiltShiftShader.js';
@@ -1,5 +1,7 @@
1
1
  // tslint:disable-next-line:no-unnecessary-class
2
+
2
3
  export default class WebGPU {
3
4
  static isAvailable(): boolean;
5
+ static getStaticAdapter(): unknown;
4
6
  static getErrorMessage(): HTMLElement;
5
7
  }
@@ -1,20 +1,146 @@
1
1
  import { Vector3, Vector4 } from '../../../src/Three.js';
2
2
 
3
- export function findSpan(p: number, u: number, U: number[]): number;
4
- export function calcBasisFunctions(span: number, u: number, p: number, U: number[]): number[];
5
- export function calcBSplinePoint(p: number, U: number[], P: Vector4[], u: number): Vector4;
6
- export function calcBasisFunctionDerivatives(span: number, u: number, p: number, n: number, U: number[]): number[][];
7
- export function calcBSplineDerivatives(p: number, U: number[], P: Vector4[], u: number, nd: number): Vector4[];
3
+ /**
4
+ * Finds knot vector span.
5
+ * @param p degree
6
+ * @param u parametric value
7
+ * @param U knot vector
8
+ * @returns the span
9
+ */
10
+ export function findSpan(p: number, u: number, U: readonly number[]): number;
11
+
12
+ /**
13
+ * Calculate basis functions. See The NURBS Book, page 70, algorithm A2.2
14
+ * @param span span in which u lies
15
+ * @param u parametric point
16
+ * @param p degrees
17
+ * @param U knot vector
18
+ * @returns array[p+1] with basis function values
19
+ */
20
+ export function calcBasisFunctions(span: number, u: number, p: number, U: readonly number[]): number[];
21
+
22
+ /**
23
+ * Calculate B-Spline curve points. See The NURBS Book, page 82, algorithm A3.1.
24
+ * @param p degree of B-Spline
25
+ * @param U knot vector
26
+ * @param P control points (x, y, z, w)
27
+ * @param u parametric point
28
+ * @returns point for given u
29
+ */
30
+ export function calcBSplinePoint(p: number, U: readonly number[], P: readonly Vector4[], u: number): Vector4;
31
+
32
+ /**
33
+ * Calculate basis functions derivatives. See The NURBS Book, page 72, algorithm A2.3.
34
+ * @param span span in which u lies
35
+ * @param u parametric point
36
+ * @param p degree
37
+ * @param n number of derivatives to calculate
38
+ * @param U knot vector
39
+ * @returns array[n+1][p+1] with basis functions derivatives
40
+ */
41
+ export function calcBasisFunctionDerivatives(
42
+ span: number,
43
+ u: number,
44
+ p: number,
45
+ n: number,
46
+ U: readonly number[],
47
+ ): number[][];
48
+
49
+ /**
50
+ * Calculate derivatives of a B-Spline. See The NURBS Book, page 93, algorithm A3.2.
51
+ * @param p degree
52
+ * @param U knot vector
53
+ * @param P control points
54
+ * @param u Parametric points
55
+ * @param nd number of derivatives
56
+ * @returns array[d+1] with derivatives
57
+ */
58
+ export function calcBSplineDerivatives(
59
+ p: number,
60
+ U: readonly number[],
61
+ P: readonly Vector4[],
62
+ u: number,
63
+ nd: number,
64
+ ): Vector4[];
65
+
66
+ /**
67
+ * Calculate "K over I"
68
+ * @returns k!/(i!(k-i)!
69
+ */
8
70
  export function calcKoverI(k: number, i: number): number;
9
- export function calcRationalCurveDerivatives(Pders: Vector4[]): Vector3[];
10
- export function calcNURBSDerivatives(p: number, U: number[], P: Vector4[], u: number, nd: number): Vector3[];
71
+
72
+ /**
73
+ * Calculate derivatives (0-nd) of rational curve. See The NURBS Book, page 127, algorithm A4.2.
74
+ * @param Pders result of function calcBSplineDerivatives
75
+ * @returns array with derivatives for rational curve.
76
+ */
77
+ export function calcRationalCurveDerivatives(Pders: readonly Vector4[]): Vector3[];
78
+
79
+ /**
80
+ * Calculate NURBS curve derivatives. See The NURBS Book, page 127, algorithm A4.2.
81
+ * @param p degree
82
+ * @param U knot vector
83
+ * @param P control points in homogeneous space
84
+ * @param u parametric points
85
+ * @param nd number of derivatives
86
+ * @returns array with derivatives
87
+ */
88
+ export function calcNURBSDerivatives(
89
+ p: number,
90
+ U: readonly number[],
91
+ P: readonly Vector4[],
92
+ u: number,
93
+ nd: number,
94
+ ): Vector3[];
95
+
96
+ /**
97
+ * Calculate rational B-Spline surface point. See The NURBS Book, page 134, algorithm A4.3.
98
+ * @param p degree of B-Spline surface
99
+ * @param q degree of B-Spline surface
100
+ * @param U knot vector
101
+ * @param V knot vector
102
+ * @param P control points (x, y, z, w)
103
+ * @param u parametric value
104
+ * @param v parametric value
105
+ * @param target
106
+ * @returns point for given (u, v)
107
+ */
11
108
  export function calcSurfacePoint(
12
109
  p: number,
13
110
  q: number,
14
- U: number[],
15
- V: number[],
16
- P: Vector4[],
111
+ U: readonly number[],
112
+ V: readonly number[],
113
+ P: readonly (readonly Vector4[])[],
114
+ u: number,
115
+ v: number,
116
+ target: Vector3,
117
+ ): Vector3;
118
+
119
+ /**
120
+ * Calculate rational B-Spline volume point. See The NURBS Book, page 134, algorithm A4.3.
121
+ * @param p degree of B-Spline volume
122
+ * @param q degree of B-Spline volume
123
+ * @param r degree of B-Spline volume
124
+ * @param U knot vector
125
+ * @param V knot vector
126
+ * @param W knot vector
127
+ * @param P control points (x, y, z, w)
128
+ * @param u parametric value
129
+ * @param v parametric value
130
+ * @param w parametric value
131
+ * @param target
132
+ * @returns point for given (u, v, w)
133
+ */
134
+ export function calcVolumePoint(
135
+ p: number,
136
+ q: number,
137
+ r: number,
138
+ U: readonly number[],
139
+ V: readonly number[],
140
+ W: readonly number[],
141
+ P: readonly (readonly (readonly Vector4[])[])[],
17
142
  u: number,
18
143
  v: number,
144
+ w: number,
19
145
  target: Vector3,
20
146
  ): Vector3;
@@ -0,0 +1,23 @@
1
+ import { Vector3, Vector4 } from '../../../src/Three.js';
2
+
3
+ export class NURBSVolume {
4
+ degree1: number;
5
+ degree2: number;
6
+ degree3: number;
7
+ knots1: readonly number[];
8
+ knots2: readonly number[];
9
+ knots3: readonly number[];
10
+ controlPoints: Vector4[][][];
11
+
12
+ constructor(
13
+ degree1: number,
14
+ degree2: number,
15
+ degree3: number,
16
+ knots1: readonly number[],
17
+ knots2: readonly number[],
18
+ knots3: readonly number[],
19
+ controlPoints: Vector4[][][],
20
+ );
21
+
22
+ getPoint(t1: number, t2: number, t3: number, target: Vector3): void;
23
+ }
@@ -2,6 +2,7 @@ import { Object3D } from '../../../src/Three.js';
2
2
 
3
3
  export interface USDZExporterOptions {
4
4
  quickLookCompatible?: boolean;
5
+ maxTextureSize?: number;
5
6
  }
6
7
 
7
8
  export class USDZExporter {
@@ -131,6 +131,7 @@ export class GLTFParser {
131
131
  }
132
132
 
133
133
  export interface GLTFLoaderPlugin {
134
+ readonly name: string;
134
135
  beforeRoot?: (() => Promise<void> | null) | undefined;
135
136
  afterRoot?: ((result: GLTF) => Promise<void> | null) | undefined;
136
137
  loadNode?: ((nodeIndex: number) => Promise<Object3D> | null) | undefined;
@@ -1,17 +1,51 @@
1
- import { LoadingManager, CompressedTextureLoader, CompressedTexture, WebGLRenderer } from '../../../src/Three.js';
1
+ import { LoadingManager, Loader, CompressedTexture, WebGLRenderer } from '../../../src/Three.js';
2
2
  import WebGPURenderer from '../renderers/webgpu/WebGPURenderer.js';
3
+ import Renderer from '../renderers/common/Renderer.js';
4
+ import { WorkerPool } from '../utils/WorkerPool.js';
5
+
6
+ export interface KTX2LoaderWorkerConfig {
7
+ astcSupported: boolean;
8
+ etc1Supported: boolean;
9
+ etc2Supported: boolean;
10
+ dxtSupported: boolean;
11
+ bptcSupported: boolean;
12
+ pvrtcSupported: boolean;
13
+ }
14
+
15
+ export class KTX2Loader extends Loader<CompressedTexture> {
16
+ transcoderPath: string;
17
+ transcoderBinary: ArrayBuffer | null;
18
+ transcoderPending: Promise<void> | null;
19
+
20
+ workerPool: WorkerPool;
21
+ workerSourceURL: string;
22
+ workerConfig: KTX2LoaderWorkerConfig;
3
23
 
4
- export class KTX2Loader extends CompressedTextureLoader {
5
24
  constructor(manager?: LoadingManager);
6
25
 
7
- setTranscoderPath(path: string): KTX2Loader;
8
- setWorkerLimit(limit: number): KTX2Loader;
9
- detectSupport(renderer: WebGLRenderer | WebGPURenderer): KTX2Loader;
10
- dispose(): KTX2Loader;
26
+ /**
27
+ * The WASM transcoder and JS wrapper are available from the examples/jsm/libs/basis directory.
28
+ * @param path Path to folder containing the WASM transcoder and JS wrapper.
29
+ */
30
+ setTranscoderPath(path: string): this;
31
+
32
+ /**
33
+ * Sets the maximum number of web workers to be allocated by this instance.
34
+ * @param limit Maximum number of workers. Default is '4'.
35
+ */
36
+ setWorkerLimit(limit: number): this;
37
+
38
+ detectSupportAsync(renderer: Renderer): Promise<this>;
39
+
40
+ /**
41
+ * Detects hardware support for available compressed texture formats, to determine the output format for the
42
+ * transcoder. Must be called before loading a texture.
43
+ * @param renderer A renderer instance.
44
+ */
45
+ detectSupport(renderer: WebGLRenderer | WebGPURenderer): this;
11
46
 
12
- parse(
13
- buffer: ArrayBuffer,
14
- onLoad: (texture: CompressedTexture) => void,
15
- onError?: (event: ErrorEvent) => void,
16
- ): KTX2Loader;
47
+ /**
48
+ * Disposes the loader object, de-allocating any Web Workers created.
49
+ */
50
+ dispose(): this;
17
51
  }
@@ -1,4 +1,4 @@
1
- import { Loader, LoadingManager, DataTexture, Data3DTexture } from '../../../src/Three.js';
1
+ import { Loader, LoadingManager, DataTexture, Data3DTexture, UnsignedByteType, FloatType } from '../../../src/Three.js';
2
2
 
3
3
  export interface LUT3dlResult {
4
4
  size: number;
@@ -6,8 +6,35 @@ export interface LUT3dlResult {
6
6
  texture3D: Data3DTexture;
7
7
  }
8
8
 
9
+ /**
10
+ * A 3D LUT loader that supports the .3dl file format.
11
+ *
12
+ * Based on the following references:
13
+ *
14
+ * http://download.autodesk.com/us/systemdocs/help/2011/lustre/index.html?url=./files/WSc4e151a45a3b785a24c3d9a411df9298473-7ffd.htm,topicNumber=d0e9492
15
+ * https://community.foundry.com/discuss/topic/103636/format-spec-for-3dl?mode=Post&postID=895258
16
+ */
9
17
  export class LUT3dlLoader extends Loader<LUT3dlResult> {
18
+ type: typeof UnsignedByteType | typeof FloatType;
19
+
20
+ /**
21
+ * Creates a new {@link LUT3dlLoader}.
22
+ * @param manager The LoadingManager to use. Defaults to {@link DefaultLoadingManager}
23
+ */
10
24
  constructor(manager?: LoadingManager);
11
25
 
12
- parse(data: string): LUT3dlResult;
26
+ /**
27
+ * Sets the desired texture type. Only {@link THREE.UnsignedByteType} and {@link THREE.FloatType} are supported. The
28
+ * default is {@link THREE.UnsignedByteType}.
29
+ * @param type The texture type. See the Textures texture constants page for details.
30
+ */
31
+ setType(type: typeof UnsignedByteType | typeof FloatType): this;
32
+
33
+ /**
34
+ * Parse a 3dl data string and fire {@link onLoad} callback when complete. The argument to {@link onLoad} will be an
35
+ * object containing the following LUT data: {@link LUT3dlResult.size}, {@link LUT3dlResult.texture} and
36
+ * {@link LUT3dlResult.texture3D}.
37
+ * @param input The 3dl data string.
38
+ */
39
+ parse(input: string): LUT3dlResult;
13
40
  }
@@ -1,4 +1,12 @@
1
- import { Loader, LoadingManager, Vector3, DataTexture, Data3DTexture } from '../../../src/Three.js';
1
+ import {
2
+ Loader,
3
+ LoadingManager,
4
+ Vector3,
5
+ DataTexture,
6
+ Data3DTexture,
7
+ UnsignedByteType,
8
+ FloatType,
9
+ } from '../../../src/Three.js';
2
10
 
3
11
  export interface LUTCubeResult {
4
12
  title: string;
@@ -9,8 +17,35 @@ export interface LUTCubeResult {
9
17
  texture3D: Data3DTexture;
10
18
  }
11
19
 
20
+ /**
21
+ * A 3D LUT loader that supports the .cube file format.
22
+ *
23
+ * Based on the following reference:
24
+ *
25
+ * https://wwwimages2.adobe.com/content/dam/acom/en/products/speedgrade/cc/pdfs/cube-lut-specification-1.0.pdf
26
+ */
12
27
  export class LUTCubeLoader extends Loader<LUTCubeResult> {
28
+ type: typeof UnsignedByteType | typeof FloatType;
29
+
30
+ /**
31
+ * Creates a new {@link LUTCubeLoader}.
32
+ * @param manager The LoadingManager to use. Defaults to {@link DefaultLoadingManager}
33
+ */
13
34
  constructor(manager?: LoadingManager);
14
35
 
15
- parse(data: string): LUTCubeResult;
36
+ /**
37
+ * Sets the desired texture type. Only {@link THREE.UnsignedByteType} and {@link THREE.FloatType} are supported. The
38
+ * default is {@link THREE.UnsignedByteType}.
39
+ * @param type The texture type. See the Textures texture constants page for details.
40
+ */
41
+ setType(type: typeof UnsignedByteType | typeof FloatType): this;
42
+
43
+ /**
44
+ * Parse a cube data string and fire {@link onLoad} callback when complete. The argument to {@link onLoad} will be
45
+ * an object containing the following LUT data: {@link LUTCubeResult.title}, {@link LUTCubeResult.size},
46
+ * {@link LUTCubeResult.domainMin}, {@link LUTCubeResult.domainMax}, {@link LUTCubeResult.texture} and
47
+ * {@link LUTCubeResult.texture3D}.
48
+ * @param input The cube data string.
49
+ */
50
+ parse(input: string): LUTCubeResult;
16
51
  }
@@ -0,0 +1,6 @@
1
+ import { Loader, LoadingManager } from '../../../src/Three.js';
2
+ import { MeshPhysicalNodeMaterial } from '../nodes/Nodes.js';
3
+
4
+ export class MaterialXLoader extends Loader<{ materials: Record<string, MeshPhysicalNodeMaterial> }> {
5
+ constructor(manager?: LoadingManager);
6
+ }
@@ -0,0 +1,13 @@
1
+ import { MeshPhysicalMaterial, MeshPhysicalMaterialParameters, Texture } from '../../../src/Three.js';
2
+
3
+ export interface MeshPostProcessingMaterialParameters extends MeshPhysicalMaterialParameters {
4
+ aoPassMap?: Texture | null | undefined;
5
+ aoPassMapScale?: number | undefined;
6
+ }
7
+
8
+ export class MeshPostProcessingMaterial extends MeshPhysicalMaterial {
9
+ constructor(parameters: MeshPostProcessingMaterialParameters);
10
+
11
+ get aoPassMap(): Texture | null | undefined;
12
+ set aoPassMap(aoPassMap: Texture | null | undefined);
13
+ }
@@ -0,0 +1,80 @@
1
+ /**
2
+ * This class is an alternative to {@link THREE.Clock} with a different API design and behavior
3
+ * The goal is to avoid the conceptual flaws that became apparent in {@link THREE.Clock} over time.
4
+ *
5
+ * - {@link Timer} has an {@link .update()} method that updates its internal state. That makes it possible to call
6
+ * {@link .getDelta()} and {@link .getElapsed()} multiple times per simulation step without getting different values.
7
+ * - The class uses the Page Visibility API to avoid large time delta values when the app is inactive (e.g. tab switched
8
+ * or browser hidden).
9
+ * - It's possible to configure a fixed time delta and a time scale value (similar to Unity's Time interface).
10
+ *
11
+ * @example
12
+ * const timer = new Timer();
13
+ *
14
+ * function animate() {
15
+ * requestAnimationFrame(animate);
16
+ * timer.update();
17
+ * const delta = timer.getDelta();
18
+ * // do something with delta
19
+ * renderer.render(scene, camera);
20
+ * }
21
+ *
22
+ * @see https://threejs.org/examples/#webgl_morphtargets_sphere
23
+ */
24
+ export class Timer {
25
+ constructor();
26
+
27
+ /**
28
+ * Disables the usage of a fixed delta time.
29
+ */
30
+ disableFixedDelta(): this;
31
+
32
+ /**
33
+ * Can be used to free all internal resources. Usually called when the timer instance isn't required anymore.
34
+ */
35
+ dispose(): this;
36
+
37
+ /**
38
+ * Enables the usage of a fixed delta time.
39
+ */
40
+ enableFixedDelta(): this;
41
+
42
+ /**
43
+ * Returns the time delta in seconds.
44
+ */
45
+ getDelta(): number;
46
+
47
+ /**
48
+ * Returns the elapsed time in seconds.
49
+ */
50
+ getElapsed(): number;
51
+
52
+ /**
53
+ * Returns the fixed time delta that has been previously configured via {@link .setFixedDelta()}.
54
+ */
55
+ getFixedDelta(): number;
56
+
57
+ getTimescale(): number;
58
+
59
+ /**
60
+ * Resets the time computation for the current simulation step.
61
+ */
62
+ reset(): this;
63
+
64
+ /**
65
+ * Defines a fixed time delta value which is used to update the timer per simulation step.
66
+ */
67
+ setFixedDelta(fixedDelta: number): this;
68
+
69
+ /**
70
+ * Sets a time scale that scales the time delta in {@link .update()}.
71
+ * @param timescale
72
+ */
73
+ setTimescale(timescale: number): this;
74
+
75
+ /**
76
+ * Updates the internal state of the timer. This method should be called once per simulation step and before you
77
+ * perform queries against the timer (e.g. via {@link .getDelta()}).
78
+ */
79
+ update(): this;
80
+ }