@types/three 0.169.0 → 0.171.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 (194) hide show
  1. three/README.md +1 -1
  2. three/build/three.core.d.ts +1 -0
  3. three/build/three.core.min.d.ts +1 -0
  4. three/build/three.tsl.d.ts +1 -0
  5. three/build/three.tsl.min.d.ts +1 -0
  6. three/examples/jsm/Addons.d.ts +3 -3
  7. three/examples/jsm/animation/MMDAnimationHelper.d.ts +4 -0
  8. three/examples/jsm/animation/MMDPhysics.d.ts +4 -0
  9. three/examples/jsm/controls/ArcballControls.d.ts +6 -1
  10. three/examples/jsm/controls/TransformControls.d.ts +45 -1
  11. three/examples/jsm/csm/CSMFrustum.d.ts +8 -2
  12. three/examples/jsm/csm/CSMHelper.d.ts +2 -1
  13. three/examples/jsm/csm/CSMShadowNode.d.ts +45 -0
  14. three/examples/jsm/curves/NURBSCurve.d.ts +12 -1
  15. three/examples/jsm/exporters/GLTFExporter.d.ts +43 -10
  16. three/examples/jsm/exporters/MMDExporter.d.ts +4 -0
  17. three/examples/jsm/exporters/USDZExporter.d.ts +4 -0
  18. three/examples/jsm/geometries/DecalGeometry.d.ts +10 -4
  19. three/examples/jsm/geometries/TeapotGeometry.d.ts +2 -2
  20. three/examples/jsm/helpers/TextureHelperGPU.d.ts +10 -0
  21. three/examples/jsm/lighting/TiledLighting.d.ts +10 -0
  22. three/examples/jsm/lines/Wireframe.d.ts +5 -2
  23. three/examples/jsm/lines/WireframeGeometry2.d.ts +1 -1
  24. three/examples/jsm/lines/webgpu/Wireframe.d.ts +13 -0
  25. three/examples/jsm/loaders/EXRLoader.d.ts +2 -2
  26. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -2
  27. three/examples/jsm/loaders/KTX2Loader.d.ts +1 -0
  28. three/examples/jsm/loaders/LDrawLoader.d.ts +10 -0
  29. three/examples/jsm/loaders/MMDLoader.d.ts +4 -0
  30. three/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts +9 -0
  31. three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts +9 -0
  32. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +0 -1
  33. three/examples/jsm/math/ColorSpaces.d.ts +11 -0
  34. three/examples/jsm/misc/ProgressiveLightMap.d.ts +8 -10
  35. three/examples/jsm/misc/ProgressiveLightMapGPU.d.ts +27 -0
  36. three/examples/jsm/objects/SkyMesh.d.ts +2 -2
  37. three/examples/jsm/objects/Water2Mesh.d.ts +13 -2
  38. three/examples/jsm/objects/WaterMesh.d.ts +11 -2
  39. three/examples/jsm/renderers/SVGRenderer.d.ts +2 -2
  40. three/{src/nodes → examples/jsm/tsl}/display/AfterImageNode.d.ts +2 -5
  41. three/{src/nodes → examples/jsm/tsl}/display/AnaglyphPassNode.d.ts +2 -3
  42. three/{src/nodes → examples/jsm/tsl}/display/AnamorphicNode.d.ts +2 -4
  43. three/examples/jsm/tsl/display/BleachBypass.d.ts +4 -0
  44. three/{src/nodes → examples/jsm/tsl}/display/BloomNode.d.ts +2 -5
  45. three/{src/nodes → examples/jsm/tsl}/display/DenoiseNode.d.ts +3 -8
  46. three/{src/nodes → examples/jsm/tsl}/display/DepthOfFieldNode.d.ts +2 -5
  47. three/{src/nodes → examples/jsm/tsl}/display/DotScreenNode.d.ts +2 -5
  48. three/{src/nodes → examples/jsm/tsl}/display/FXAANode.d.ts +2 -3
  49. three/{src/nodes → examples/jsm/tsl}/display/FilmNode.d.ts +2 -3
  50. three/{src/nodes → examples/jsm/tsl}/display/GTAONode.d.ts +5 -14
  51. three/{src/nodes → examples/jsm/tsl}/display/GaussianBlurNode.d.ts +13 -5
  52. three/examples/jsm/tsl/display/LensflareNode.d.ts +35 -0
  53. three/{src/nodes → examples/jsm/tsl}/display/Lut3DNode.d.ts +2 -6
  54. three/{src/nodes → examples/jsm/tsl}/display/MotionBlur.d.ts +2 -2
  55. three/examples/jsm/tsl/display/OutlineNode.d.ts +32 -0
  56. three/{src/nodes → examples/jsm/tsl}/display/ParallaxBarrierPassNode.d.ts +2 -3
  57. three/{src/nodes → examples/jsm/tsl}/display/PixelationPassNode.d.ts +2 -5
  58. three/{src/nodes → examples/jsm/tsl}/display/RGBShiftNode.d.ts +2 -4
  59. three/examples/jsm/tsl/display/SMAANode.d.ts +18 -0
  60. three/{src/nodes → examples/jsm/tsl}/display/SSAAPassNode.d.ts +2 -7
  61. three/examples/jsm/tsl/display/SSRNode.d.ts +38 -0
  62. three/examples/jsm/tsl/display/Sepia.d.ts +4 -0
  63. three/{src/nodes → examples/jsm/tsl}/display/SobelOperatorNode.d.ts +2 -3
  64. three/{src/nodes → examples/jsm/tsl}/display/StereoCompositePassNode.d.ts +1 -5
  65. three/{src/nodes → examples/jsm/tsl}/display/StereoPassNode.d.ts +2 -5
  66. three/examples/jsm/tsl/display/TRAAPassNode.d.ts +15 -0
  67. three/{src/nodes → examples/jsm/tsl}/display/TransitionNode.d.ts +2 -5
  68. three/examples/jsm/tsl/display/hashBlur.d.ts +8 -0
  69. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +23 -0
  70. three/package.json +5 -4
  71. three/src/Three.Core.d.ts +158 -0
  72. three/src/Three.TSL.d.ts +528 -0
  73. three/src/Three.WebGPU.Nodes.d.ts +15 -192
  74. three/src/Three.WebGPU.d.ts +14 -192
  75. three/src/Three.d.ts +3 -164
  76. three/src/animation/AnimationClip.d.ts +3 -1
  77. three/src/constants.d.ts +1 -9
  78. three/src/core/BufferGeometry.d.ts +13 -2
  79. three/src/core/Clock.d.ts +4 -6
  80. three/src/core/InterleavedBuffer.d.ts +12 -0
  81. three/src/core/RenderTarget.d.ts +1 -2
  82. three/src/loaders/FileLoader.d.ts +3 -3
  83. three/src/materials/LineBasicMaterial.d.ts +0 -5
  84. three/src/materials/LineDashedMaterial.d.ts +0 -5
  85. three/src/materials/Material.d.ts +6 -6
  86. three/src/materials/MeshBasicMaterial.d.ts +0 -5
  87. three/src/materials/MeshDepthMaterial.d.ts +0 -5
  88. three/src/materials/MeshDistanceMaterial.d.ts +0 -5
  89. three/src/materials/MeshLambertMaterial.d.ts +0 -5
  90. three/src/materials/MeshMatcapMaterial.d.ts +0 -5
  91. three/src/materials/MeshNormalMaterial.d.ts +0 -5
  92. three/src/materials/MeshPhongMaterial.d.ts +0 -5
  93. three/src/materials/MeshPhysicalMaterial.d.ts +0 -5
  94. three/src/materials/MeshStandardMaterial.d.ts +0 -5
  95. three/src/materials/MeshToonMaterial.d.ts +0 -5
  96. three/src/materials/PointsMaterial.d.ts +0 -5
  97. three/src/materials/RawShaderMaterial.d.ts +0 -2
  98. three/src/materials/ShaderMaterial.d.ts +0 -5
  99. three/src/materials/ShadowMaterial.d.ts +0 -5
  100. three/src/materials/SpriteMaterial.d.ts +0 -5
  101. three/src/materials/nodes/LineDashedNodeMaterial.d.ts +3 -0
  102. three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +2 -2
  103. three/src/materials/nodes/NodeMaterial.d.ts +6 -1
  104. three/src/materials/nodes/NodeMaterials.d.ts +19 -16
  105. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +15 -0
  106. three/src/math/Color.d.ts +39 -22
  107. three/src/math/ColorManagement.d.ts +24 -24
  108. three/src/math/Vector4.d.ts +2 -0
  109. three/src/nodes/Nodes.d.ts +2 -22
  110. three/src/nodes/TSL.d.ts +14 -26
  111. three/src/nodes/accessors/Arrays.d.ts +6 -0
  112. three/src/nodes/accessors/BuiltinNode.d.ts +14 -0
  113. three/src/nodes/accessors/Camera.d.ts +0 -1
  114. three/src/nodes/accessors/ClippingNode.d.ts +6 -0
  115. three/src/nodes/accessors/InstanceNode.d.ts +15 -3
  116. three/src/nodes/accessors/InstancedMeshNode.d.ts +11 -0
  117. three/src/nodes/accessors/Lights.d.ts +15 -0
  118. three/src/nodes/accessors/SceneNode.d.ts +2 -0
  119. three/src/nodes/accessors/StorageBufferNode.d.ts +20 -11
  120. three/src/nodes/accessors/StorageTextureNode.d.ts +5 -3
  121. three/src/nodes/accessors/UniformArrayNode.d.ts +2 -2
  122. three/src/nodes/accessors/VelocityNode.d.ts +4 -0
  123. three/src/nodes/code/ScriptableNode.d.ts +1 -1
  124. three/src/nodes/core/IndexNode.d.ts +2 -0
  125. three/src/nodes/core/NodeUtils.d.ts +7 -0
  126. three/src/nodes/core/StackNode.d.ts +10 -5
  127. three/src/nodes/core/VarNode.d.ts +12 -1
  128. three/src/nodes/core/constants.d.ts +6 -0
  129. three/src/nodes/display/BlendModes.d.ts +32 -0
  130. three/src/nodes/display/ColorAdjustment.d.ts +29 -0
  131. three/src/nodes/display/ColorSpaceFunctions.d.ts +2 -2
  132. three/src/nodes/display/ColorSpaceNode.d.ts +14 -8
  133. three/src/nodes/display/RenderOutputNode.d.ts +4 -4
  134. three/src/nodes/display/ScreenNode.d.ts +5 -0
  135. three/src/nodes/display/ViewportDepthNode.d.ts +4 -0
  136. three/src/nodes/functions/material/getAlphaHashThreshold.d.ts +6 -0
  137. three/src/nodes/functions/material/getParallaxCorrectNormal.d.ts +10 -0
  138. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +88 -0
  139. three/src/nodes/gpgpu/BarrierNode.d.ts +12 -0
  140. three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +13 -0
  141. three/src/nodes/gpgpu/ComputeNode.d.ts +5 -0
  142. three/src/nodes/gpgpu/WorkgroupInfoNode.d.ts +17 -0
  143. three/src/nodes/lighting/AnalyticLightNode.d.ts +11 -0
  144. three/src/nodes/lighting/LightsNode.d.ts +7 -2
  145. three/src/nodes/lighting/PointLightNode.d.ts +14 -1
  146. three/src/nodes/lighting/PointShadowNode.d.ts +30 -0
  147. three/src/nodes/lighting/ShadowNode.d.ts +35 -0
  148. three/src/nodes/math/OperatorNode.d.ts +3 -0
  149. three/src/nodes/tsl/TSLBase.d.ts +5 -0
  150. three/src/nodes/tsl/TSLCore.d.ts +3 -0
  151. three/src/nodes/utils/Discard.d.ts +1 -1
  152. three/src/nodes/utils/Oscillators.d.ts +7 -0
  153. three/src/nodes/utils/PostProcessingUtils.d.ts +45 -0
  154. three/src/nodes/utils/ReflectorNode.d.ts +17 -4
  155. three/src/nodes/utils/SplitNode.d.ts +1 -1
  156. three/src/nodes/utils/Timer.d.ts +21 -0
  157. three/src/objects/BatchedMesh.d.ts +51 -6
  158. three/src/objects/ClippingGroup.d.ts +41 -0
  159. three/src/renderers/WebGLRenderer.d.ts +24 -11
  160. three/src/renderers/common/Animation.d.ts +11 -4
  161. three/src/renderers/common/ClippingContext.d.ts +16 -14
  162. three/src/renderers/common/Constants.d.ts +2 -1
  163. three/src/renderers/common/Geometries.d.ts +1 -0
  164. three/src/renderers/common/IndirectStorageBufferAttribute.d.ts +10 -0
  165. three/src/renderers/common/Lighting.d.ts +15 -0
  166. three/src/renderers/common/PostProcessingUtils.d.ts +66 -0
  167. three/src/renderers/common/RenderList.d.ts +10 -2
  168. three/src/renderers/common/RenderLists.d.ts +3 -1
  169. three/src/renderers/common/RenderObject.d.ts +9 -4
  170. three/src/renderers/common/RenderObjects.d.ts +3 -0
  171. three/src/renderers/common/Renderer.d.ts +49 -10
  172. three/src/renderers/common/UniformsGroup.d.ts +1 -0
  173. three/src/renderers/common/extras/PMREMGenerator.d.ts +20 -2
  174. three/src/renderers/common/nodes/NodeLibrary.d.ts +2 -11
  175. three/src/renderers/common/nodes/NodeUniform.d.ts +7 -0
  176. three/src/renderers/webgl/WebGLPrograms.d.ts +3 -10
  177. three/src/renderers/webgl/WebGLState.d.ts +14 -11
  178. three/src/renderers/webgl/WebGLUtils.d.ts +2 -2
  179. three/src/textures/CompressedTexture.d.ts +1 -2
  180. three/src/textures/CubeTexture.d.ts +1 -2
  181. three/src/textures/Data3DTexture.d.ts +4 -2
  182. three/src/textures/DataArrayTexture.d.ts +1 -1
  183. three/src/textures/DataTexture.d.ts +7 -3
  184. three/src/textures/Texture.d.ts +3 -4
  185. three/examples/jsm/cameras/CinematicCamera.d.ts +0 -34
  186. three/src/nodes/display/BleachBypass.d.ts +0 -4
  187. three/src/nodes/display/BlendMode.d.ts +0 -10
  188. three/src/nodes/display/Sepia.d.ts +0 -4
  189. three/src/nodes/lighting/LightNode.d.ts +0 -18
  190. three/src/nodes/utils/OscNode.d.ts +0 -25
  191. three/src/nodes/utils/TimerNode.d.ts +0 -25
  192. three/src/textures/types.d.ts +0 -9
  193. /three/examples/jsm/utils/{TextureUtils.d.ts → WebGLTextureUtils.d.ts} +0 -0
  194. /three/examples/jsm/utils/{TextureUtilsGPU.d.ts → WebGPUTextureUtils.d.ts} +0 -0
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, 26 Sep 2024 17:08:07 GMT
11
+ * Last updated: Sun, 15 Dec 2024 01:30:13 GMT
12
12
  * Dependencies: [@tweenjs/tween.js](https://npmjs.com/package/@tweenjs/tween.js), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [@webgpu/types](https://npmjs.com/package/@webgpu/types), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer)
13
13
 
14
14
  # Credits
@@ -0,0 +1 @@
1
+ export * from "../src/Three.Core.js";
@@ -0,0 +1 @@
1
+ export * from "../src/Three.Core.js";
@@ -0,0 +1 @@
1
+ export * from "../src/Three.TSL.js";
@@ -0,0 +1 @@
1
+ export * from "../src/Three.TSL.js";
@@ -3,8 +3,6 @@ export * from "./animation/CCDIKSolver.js";
3
3
  export * from "./animation/MMDAnimationHelper.js";
4
4
  export * from "./animation/MMDPhysics.js";
5
5
 
6
- export * from "./cameras/CinematicCamera.js";
7
-
8
6
  export { default as WebGL } from "./capabilities/WebGL.js";
9
7
 
10
8
  export * from "./controls/ArcballControls.js";
@@ -129,7 +127,9 @@ export * from "./loaders/VRMLLoader.js";
129
127
  export * from "./loaders/VTKLoader.js";
130
128
  export * from "./loaders/XYZLoader.js";
131
129
 
130
+ export * from "./materials/LDrawConditionalLineMaterial.js";
132
131
  export * from "./materials/MeshGouraudMaterial.js";
132
+ export * from "./materials/MeshPostProcessingMaterial.js";
133
133
 
134
134
  export * from "./math/Capsule.js";
135
135
  export * from "./math/ColorConverter.js";
@@ -274,8 +274,8 @@ export * as SceneUtils from "./utils/SceneUtils.js";
274
274
  export * from "./utils/ShadowMapViewer.js";
275
275
  export * as SkeletonUtils from "./utils/SkeletonUtils.js";
276
276
  export * as SortUtils from "./utils/SortUtils.js";
277
- export * from "./utils/TextureUtils.js";
278
277
  export * from "./utils/UVsDebug.js";
278
+ export * from "./utils/WebGLTextureUtils.js";
279
279
  export * from "./utils/WorkerPool.js";
280
280
 
281
281
  export * from "./webxr/ARButton.js";
@@ -35,6 +35,10 @@ export interface MMDAnimationHelperMixer {
35
35
  duration?: number | undefined;
36
36
  }
37
37
 
38
+ /**
39
+ * @deprecated The module has been deprecated and will be removed with r172. Please migrate to
40
+ * https://github.com/takahirox/three-mmd-loader instead.
41
+ */
38
42
  export class MMDAnimationHelper {
39
43
  constructor(params?: MMDAnimationHelperParameter);
40
44
  meshes: SkinnedMesh[];
@@ -6,6 +6,10 @@ export interface MMDPhysicsParameter {
6
6
  gravity?: Vector3 | undefined;
7
7
  }
8
8
 
9
+ /**
10
+ * @deprecated The module has been deprecated and will be removed with r172. Please migrate to
11
+ * https://github.com/takahirox/three-mmd-loader instead.
12
+ */
9
13
  export class MMDPhysics {
10
14
  constructor(
11
15
  mesh: SkinnedMesh,
@@ -44,7 +44,7 @@ declare class ArcballControls extends Controls<ArcballControlsEventMap> {
44
44
  focusAnimationTime: number;
45
45
 
46
46
  /**
47
- * If true, camera's near and far values will be adjusted every time zoom is performed trying to mantain the same
47
+ * If true, camera's near and far values will be adjusted every time zoom is performed trying to maintain the same
48
48
  * visible portion given by initial near and far values ( {@link PerspectiveCamera} only ). Default is false.
49
49
  */
50
50
  adjustNearFar: boolean;
@@ -69,6 +69,11 @@ declare class ArcballControls extends Controls<ArcballControlsEventMap> {
69
69
  */
70
70
  enableAnimations: boolean;
71
71
 
72
+ /**
73
+ * Enable or disable camera focusing on double-tap (or click) operations. Default is true.
74
+ */
75
+ enableFocus: boolean;
76
+
72
77
  /**
73
78
  * When set to true, a grid will appear when panning operation is being performed (desktop interaction only). Default is false.
74
79
  */
@@ -1,6 +1,6 @@
1
1
  import { Camera, Controls, Mesh, Object3D, Quaternion, Raycaster, Vector3 } from "three";
2
2
 
3
- type TransformControlsMode = "translate" | "rotate" | "scale";
3
+ export type TransformControlsMode = "translate" | "rotate" | "scale";
4
4
 
5
5
  export interface TransformControlsEventMap {
6
6
  /**
@@ -38,6 +38,12 @@ export interface TransformControlsEventMap {
38
38
  "showX-changed": { value: unknown };
39
39
  "showY-changed": { value: unknown };
40
40
  "showZ-changed": { value: unknown };
41
+ "minX-changed": { value: unknown };
42
+ "maxX-changed": { value: unknown };
43
+ "minY-changed": { value: unknown };
44
+ "maxY-changed": { value: unknown };
45
+ "minZ-changed": { value: unknown };
46
+ "maxZ-changed": { value: unknown };
41
47
  "worldPosition-changed": { value: unknown };
42
48
  "worldPositionStart-changed": { value: unknown };
43
49
  "worldQuaternion-changed": { value: unknown };
@@ -85,6 +91,12 @@ declare class TransformControls extends Controls<TransformControlsEventMap> {
85
91
  */
86
92
  rotationSnap: number | null;
87
93
 
94
+ /**
95
+ * By default, 3D objects are continuously scaled. If you set this property to a numeric value, you can define in
96
+ * which steps the 3D object should be scaled. Default is `null`.
97
+ */
98
+ scaleSnap: number | null;
99
+
88
100
  /**
89
101
  * Defines in which coordinate space transformations should be performed. Possible values are "world" and "local".
90
102
  * Default is `world`.
@@ -116,6 +128,36 @@ declare class TransformControls extends Controls<TransformControlsEventMap> {
116
128
  */
117
129
  showZ: boolean;
118
130
 
131
+ /**
132
+ * The minimum allowed X position during translation. Default is `-Infinity`.
133
+ */
134
+ minx: number;
135
+
136
+ /**
137
+ * The maximum allowed X position during translation. Default is `Infinity`.
138
+ */
139
+ maxX: number;
140
+
141
+ /**
142
+ * The minimum allowed Y position during translation. Default is `-Infinity`.
143
+ */
144
+ minY: number;
145
+
146
+ /**
147
+ * The maximum allowed Y position during translation. Default is `Infinity`.
148
+ */
149
+ maxY: number;
150
+
151
+ /**
152
+ * The minimum allowed Z position during translation. Default is `-Infinity`.
153
+ */
154
+ minZ: number;
155
+
156
+ /**
157
+ * The maximum allowed Z position during translation. Default is `Infinity`.
158
+ */
159
+ maxZ: number;
160
+
119
161
  /**
120
162
  * Creates a new instance of TransformControls.
121
163
  * @param camera The camera of the rendered scene.
@@ -206,6 +248,8 @@ declare class TransformControlsRoot extends Object3D {
206
248
  controls: TransformControls;
207
249
 
208
250
  constructor(controls: TransformControls);
251
+
252
+ dispose(): void;
209
253
  }
210
254
 
211
255
  declare class TransformControlsGizmo extends Object3D {
@@ -6,14 +6,20 @@ export interface CSMFrustumVerticies {
6
6
  }
7
7
 
8
8
  export interface CSMFrustumParameters {
9
+ webGL?: boolean;
9
10
  projectionMatrix?: Matrix4;
10
11
  maxFar?: number;
11
12
  }
12
13
 
13
- export class CSMFrustum {
14
- constructor(data?: CSMFrustumParameters);
14
+ declare class CSMFrustum {
15
+ zNear: number;
15
16
  vertices: CSMFrustumVerticies;
17
+
18
+ constructor(data?: CSMFrustumParameters);
19
+
16
20
  setFromProjectionMatrix(projectionMatrix: Matrix4, maxFar: number): CSMFrustumVerticies;
17
21
  split(breaks: number[], target: CSMFrustum[]): void;
18
22
  toSpace(cameraMatrix: Matrix4, target: CSMFrustum): void;
19
23
  }
24
+
25
+ export { CSMFrustum };
@@ -10,8 +10,9 @@ import {
10
10
  } from "three";
11
11
 
12
12
  import { CSM } from "./CSM.js";
13
+ import { CSMShadowNode } from "./CSMShadowNode.js";
13
14
 
14
- export class CSMHelper<TCSM extends CSM = CSM> extends Group {
15
+ export class CSMHelper<TCSM extends CSM | CSMShadowNode = CSM | CSMShadowNode> extends Group {
15
16
  constructor(csm: TCSM);
16
17
  csm: TCSM;
17
18
  displayFrustum: boolean;
@@ -0,0 +1,45 @@
1
+ import { Camera, DirectionalLightShadow, Light, Node, Object3D } from "three/webgpu";
2
+ import { CSMFrustum } from "./CSMFrustum.js";
3
+
4
+ export type CSMShadowNodeMode = "uniform" | "logarithmic" | "practical" | "custom";
5
+
6
+ export interface CSMShadowNodeData {
7
+ cascades?: number | undefined;
8
+ maxFar?: number | undefined;
9
+ mode?: CSMShadowNodeMode | undefined;
10
+ lightMargin?: number | undefined;
11
+ customSplitsCallback?:
12
+ | ((cascades: number, cameraNear: number, cameraFar: number, breaks: number[]) => void)
13
+ | undefined;
14
+ }
15
+
16
+ declare class LwLight extends Object3D {
17
+ target: Object3D;
18
+ shadow?: DirectionalLightShadow;
19
+
20
+ constructor();
21
+ }
22
+
23
+ declare class CSMShadowNode extends Node {
24
+ light: Light;
25
+ camera: Camera | null;
26
+ cascades: number;
27
+ maxFar: number;
28
+ mode: CSMShadowNodeMode;
29
+ lightMargin: number;
30
+ customSplitsCallback: (cascades: number, cameraNear: number, cameraFar: number, breaks: number[]) => void;
31
+
32
+ fade: boolean;
33
+
34
+ breaks: number[];
35
+ mainFrustum: CSMFrustum | null;
36
+ frustums: CSMFrustum[];
37
+
38
+ lights: LwLight[];
39
+
40
+ constructor(light: Light, data?: CSMShadowNodeData);
41
+
42
+ updateFrustums(): void;
43
+ }
44
+
45
+ export { CSMShadowNode };
@@ -1,4 +1,12 @@
1
- import { Curve, Vector2, Vector3, Vector4 } from "three";
1
+ import { Curve, CurveJSON, Vector2, Vector3, Vector4 } from "three";
2
+
3
+ export interface NURBSCurveJSON extends CurveJSON {
4
+ degree: number;
5
+ knots: number[];
6
+ controlPoints: number[][];
7
+ startKnot: number;
8
+ endKnot: number;
9
+ }
2
10
 
3
11
  export class NURBSCurve extends Curve<Vector3> {
4
12
  degree: number;
@@ -14,4 +22,7 @@ export class NURBSCurve extends Curve<Vector3> {
14
22
  startKnot?: number,
15
23
  endKnot?: number,
16
24
  );
25
+
26
+ toJSON(): NURBSCurveJSON;
27
+ fromJSON(json: NURBSCurveJSON): this;
17
28
  }
@@ -47,12 +47,22 @@ export interface GLTFExporterOptions {
47
47
  includeCustomExtensions?: boolean;
48
48
  }
49
49
 
50
- export class GLTFExporter {
50
+ type TextureUtils = {
51
+ decompress:
52
+ | ((texture: Texture, maxTextureSize?: number) => Promise<void>)
53
+ | ((texture: Texture, maxTextureSize?: number) => void);
54
+ };
55
+
56
+ declare class GLTFExporter {
57
+ textureUtils: TextureUtils | null;
58
+
51
59
  constructor();
52
60
 
53
61
  register(callback: (writer: GLTFWriter) => GLTFExporterPlugin): this;
54
62
  unregister(callback: (writer: GLTFWriter) => GLTFExporterPlugin): this;
55
63
 
64
+ setTextureUtils(utils: TextureUtils | null): this;
65
+
56
66
  /**
57
67
  * Generates a .gltf (JSON) or .glb (binary) output from the input (Scenes or Objects)
58
68
  *
@@ -77,7 +87,7 @@ export class GLTFExporter {
77
87
  */
78
88
  parse(
79
89
  input: Object3D | Object3D[],
80
- onDone: (gltf: ArrayBuffer | { [key: string]: any }) => void,
90
+ onDone: (gltf: ArrayBuffer | { [key: string]: unknown }) => void,
81
91
  onError: (error: ErrorEvent) => void,
82
92
  options?: GLTFExporterOptions,
83
93
  ): void;
@@ -91,14 +101,34 @@ export class GLTFExporter {
91
101
  parseAsync(
92
102
  input: Object3D | Object3D[],
93
103
  options?: GLTFExporterOptions,
94
- ): Promise<ArrayBuffer | { [key: string]: any }>;
104
+ ): Promise<ArrayBuffer | { [key: string]: unknown }>;
95
105
  }
96
106
 
97
- export class GLTFWriter {
107
+ declare class GLTFWriter {
108
+ textureUtils: TextureUtils | null;
109
+
110
+ extensionsUsed: { [name: string]: boolean };
111
+ extensionsRequired: { [name: string]: boolean };
112
+
98
113
  constructor();
99
114
 
100
115
  setPlugins(plugins: GLTFExporterPlugin[]): void;
101
116
 
117
+ setTextureUtils(utils: TextureUtils | null): this;
118
+
119
+ /**
120
+ * Process texture
121
+ * @param map Map to process
122
+ * @return Index of the processed texture in the "textures" array
123
+ */
124
+ processTextureAsync(map: Texture): Promise<number>;
125
+
126
+ /**
127
+ * Applies a texture transform, if present, to the map definition. Requires
128
+ * the KHR_texture_transform extension.
129
+ */
130
+ applyTextureTransform(mapDef: { [key: string]: unknown }, texture: Texture): void;
131
+
102
132
  /**
103
133
  * Parse scenes and generate GLTF output
104
134
  *
@@ -106,18 +136,21 @@ export class GLTFWriter {
106
136
  * @param onDone Callback on completed
107
137
  * @param options options
108
138
  */
109
- write(
139
+ writeAsync(
110
140
  input: Object3D | Object3D[],
111
- onDone: (gltf: ArrayBuffer | { [key: string]: any }) => void,
141
+ onDone: (gltf: ArrayBuffer | { [key: string]: unknown }) => void,
112
142
  options?: GLTFExporterOptions,
113
143
  ): Promise<void>;
114
144
  }
115
145
 
116
146
  export interface GLTFExporterPlugin {
117
- writeTexture?: (map: Texture, textureDef: { [key: string]: any }) => void;
118
- writeMaterial?: (material: Material, materialDef: { [key: string]: any }) => void;
119
- writeMesh?: (mesh: Mesh, meshDef: { [key: string]: any }) => void;
120
- writeNode?: (object: Object3D, nodeDef: { [key: string]: any }) => void;
147
+ writeTexture?: (map: Texture, textureDef: { [key: string]: unknown }) => void;
148
+ writeMaterialAsync?: (material: Material, materialDef: { [key: string]: unknown }) => Promise<void>;
149
+ writeMesh?: (mesh: Mesh, meshDef: { [key: string]: unknown }) => void;
150
+ writeNode?: (object: Object3D, nodeDef: { [key: string]: unknown }) => void;
121
151
  beforeParse?: (input: Object3D | Object3D[]) => void;
122
152
  afterParse?: (input: Object3D | Object3D[]) => void;
123
153
  }
154
+
155
+ export { GLTFExporter };
156
+ export type { GLTFWriter };
@@ -1,5 +1,9 @@
1
1
  import { Object3D } from "three";
2
2
 
3
+ /**
4
+ * @deprecated The module has been deprecated and will be removed with r172. Please migrate to
5
+ * https://github.com/takahirox/three-mmd-loader instead.
6
+ */
3
7
  export class MMDExporter {
4
8
  constructor();
5
9
 
@@ -1,4 +1,6 @@
1
1
  import { Object3D } from "three";
2
+ import * as WebGLTextureUtils from "../utils/WebGLTextureUtils.js";
3
+ import * as WebGPUTextureUtils from "../utils/WebGPUTextureUtils.js";
2
4
 
3
5
  export interface USDZExporterOptions {
4
6
  ar?: { anchoring: { type: "plane" }; planeAnchoring: { alignment: "horizontal" | "vertical" | "any" } } | undefined;
@@ -8,6 +10,8 @@ export interface USDZExporterOptions {
8
10
  }
9
11
 
10
12
  export class USDZExporter {
13
+ textureUtils: typeof WebGLTextureUtils | typeof WebGPUTextureUtils | null;
14
+
11
15
  constructor();
12
16
 
13
17
  parse(
@@ -1,10 +1,16 @@
1
1
  import { BufferGeometry, Euler, Mesh, Vector3 } from "three";
2
2
 
3
- export class DecalGeometry extends BufferGeometry {
4
- constructor(mesh: Mesh, position: Vector3, orientation: Euler, size: Vector3);
3
+ declare class DecalGeometry extends BufferGeometry {
4
+ constructor(mesh?: Mesh, position?: Vector3, orientation?: Euler, size?: Vector3);
5
5
  }
6
6
 
7
- export class DecalVertex {
8
- constructor(position: Vector3, normal: Vector3);
7
+ declare class DecalVertex {
8
+ position: Vector3;
9
+ normal: Vector3 | null;
10
+
11
+ constructor(position: Vector3, normal?: Vector3 | null);
12
+
9
13
  clone(): this;
10
14
  }
15
+
16
+ export { DecalGeometry, DecalVertex };
@@ -1,9 +1,9 @@
1
1
  import { BufferGeometry } from "three";
2
2
 
3
3
  /**
4
- * {@link TeapotGeometry} tesselates the famous Utah teapot database by Martin Newell.
4
+ * TeapotGeometry tessellates the famous Utah teapot database by Martin Newell.
5
5
  *
6
- * {@link TeapotGeometry} is an add-on, and must be imported explicitly. See
6
+ * TeapotGeometry is an add-on, and must be imported explicitly. See
7
7
  * [Installation / Addons]{@link https://threejs.org/docs/#manual/en/introduction/Installation}.
8
8
  *
9
9
  * @example
@@ -0,0 +1,10 @@
1
+ import { Mesh, Texture } from "three";
2
+
3
+ export class TextureHelper extends Mesh {
4
+ texture: Texture;
5
+ type: "TextureHelper";
6
+
7
+ constructor(texture: Texture, width?: number, height?: number, depth?: number);
8
+
9
+ dispose(): void;
10
+ }
@@ -0,0 +1,10 @@
1
+ import { ShaderNodeObject } from "three/tsl";
2
+ import { Lighting } from "three/webgpu";
3
+ import { Light } from "../../../src/lights/Light.js";
4
+ import TiledLightsNode from "../tsl/lighting/TiledLightsNode.js";
5
+
6
+ export class TiledLighting extends Lighting {
7
+ constructor();
8
+
9
+ createNode(lights?: Light[]): ShaderNodeObject<TiledLightsNode>;
10
+ }
@@ -3,9 +3,12 @@ import { Mesh } from "three";
3
3
  import { LineMaterial } from "./LineMaterial.js";
4
4
  import { LineSegmentsGeometry } from "./LineSegmentsGeometry.js";
5
5
 
6
- export class Wireframe extends Mesh {
7
- constructor(geometry?: LineSegmentsGeometry, material?: LineMaterial);
6
+ declare class Wireframe extends Mesh {
8
7
  readonly isWireframe: true;
9
8
 
9
+ constructor(geometry?: LineSegmentsGeometry, material?: LineMaterial);
10
+
10
11
  computeLineDistances(): this;
11
12
  }
13
+
14
+ export { Wireframe };
@@ -4,5 +4,5 @@ import { LineSegmentsGeometry } from "./LineSegmentsGeometry.js";
4
4
 
5
5
  export class WireframeGeometry2 extends LineSegmentsGeometry {
6
6
  constructor(geometry: BufferGeometry);
7
- readonly sWireframeGeometry2: boolean;
7
+ readonly isWireframeGeometry2: boolean;
8
8
  }
@@ -0,0 +1,13 @@
1
+ import { Line2NodeMaterial, Mesh } from "three/webgpu";
2
+
3
+ import { WireframeGeometry2 } from "../WireframeGeometry2.js";
4
+
5
+ declare class Wireframe extends Mesh {
6
+ readonly isWireframe: true;
7
+
8
+ constructor(geometry?: WireframeGeometry2, material?: Line2NodeMaterial);
9
+
10
+ computeLineDistances(): this;
11
+ }
12
+
13
+ export { Wireframe };
@@ -1,4 +1,4 @@
1
- import { ColorSpace, DataTextureLoader, LoadingManager, PixelFormat, TextureDataType } from "three";
1
+ import { DataTextureLoader, LoadingManager, PixelFormat, TextureDataType } from "three";
2
2
 
3
3
  export interface EXR {
4
4
  header: object;
@@ -6,7 +6,7 @@ export interface EXR {
6
6
  height: number;
7
7
  data: Float32Array | Uint16Array;
8
8
  format: PixelFormat;
9
- colorSpace: ColorSpace;
9
+ colorSpace: string;
10
10
  type: TextureDataType;
11
11
  }
12
12
 
@@ -3,7 +3,6 @@ import {
3
3
  BufferAttribute,
4
4
  BufferGeometry,
5
5
  Camera,
6
- ColorSpace,
7
6
  FileLoader,
8
7
  Group,
9
8
  ImageBitmapLoader,
@@ -113,7 +112,7 @@ export class GLTFParser {
113
112
  texCoord?: number | undefined;
114
113
  extensions?: any;
115
114
  },
116
- colorSpace?: ColorSpace | undefined,
115
+ colorSpace?: string | undefined,
117
116
  ) => Promise<Texture | null>;
118
117
  assignFinalMaterial: (object: Mesh) => void;
119
118
  getMaterialType: () => typeof MeshStandardMaterial;
@@ -4,6 +4,7 @@ import { WorkerPool } from "../utils/WorkerPool.js";
4
4
 
5
5
  export interface KTX2LoaderWorkerConfig {
6
6
  astcSupported: boolean;
7
+ astcHDRSupported: boolean;
7
8
  etc1Supported: boolean;
8
9
  etc2Supported: boolean;
9
10
  dxtSupported: boolean;
@@ -1,13 +1,23 @@
1
1
  import { Group, Loader, LoadingManager, Material } from "three";
2
+ import { LDrawConditionalLineMaterial } from "../materials/LDrawConditionalLineMaterial.js";
3
+ import { LDrawConditionalLineMaterial as LDrawConditionalLineNodeMaterial } from "../materials/LDrawConditionalLineNodeMaterial.js";
2
4
 
3
5
  export class LDrawLoader extends Loader<Group> {
4
6
  materials: Material[];
5
7
  materialsLibrary: Record<string, Material>;
8
+
6
9
  fileMap: Record<string, string>;
10
+
7
11
  smoothNormals: boolean;
8
12
 
13
+ ConditionalLineMaterial: typeof LDrawConditionalLineMaterial | typeof LDrawConditionalLineNodeMaterial | null;
14
+
9
15
  constructor(manager?: LoadingManager);
10
16
 
17
+ setConditionalLineMaterial(
18
+ type: typeof LDrawConditionalLineMaterial | typeof LDrawConditionalLineNodeMaterial,
19
+ ): this;
20
+
11
21
  preloadMaterials(url: string): Promise<void>;
12
22
  setFileMap(fileMap: Record<string, string>): void;
13
23
  setMaterials(materials: Material[]): void;
@@ -5,6 +5,10 @@ export interface MMDLoaderAnimationObject {
5
5
  mesh: SkinnedMesh;
6
6
  }
7
7
 
8
+ /**
9
+ * @deprecated The module has been deprecated and will be removed with r172. Please migrate to
10
+ * https://github.com/takahirox/three-mmd-loader instead.
11
+ */
8
12
  export class MMDLoader extends Loader<SkinnedMesh> {
9
13
  constructor(manager?: LoadingManager);
10
14
  animationBuilder: object;
@@ -0,0 +1,9 @@
1
+ import { ShaderMaterial, ShaderMaterialParameters } from "three";
2
+
3
+ declare class LDrawConditionalLineMaterial extends ShaderMaterial {
4
+ readonly isLDrawConditionalLineMaterial: true;
5
+
6
+ constructor(parameters?: ShaderMaterialParameters);
7
+ }
8
+
9
+ export { LDrawConditionalLineMaterial };
@@ -0,0 +1,9 @@
1
+ import { NodeMaterial, NodeMaterialParameters } from "three/webgpu";
2
+
3
+ declare class LDrawConditionalLineMaterial extends NodeMaterial {
4
+ readonly isLDrawConditionalLineMaterial: true;
5
+
6
+ constructor(parameters?: NodeMaterialParameters);
7
+ }
8
+
9
+ export { LDrawConditionalLineMaterial };
@@ -8,7 +8,6 @@ import { ShaderMaterial, ShaderMaterialParameters } from "three";
8
8
 
9
9
  export class MeshGouraudMaterial extends ShaderMaterial {
10
10
  isMeshGouraudMaterial: true;
11
- type: "MeshGouraudMaterial";
12
11
 
13
12
  constructor(parameters?: ShaderMaterialParameters);
14
13
 
@@ -0,0 +1,11 @@
1
+ import { ColorSpaceDefinition } from "three";
2
+
3
+ export const DisplayP3ColorSpace: "display-p3";
4
+ export const LinearDisplayP3ColorSpace: "display-p3-linear";
5
+
6
+ export const DisplayP3ColorSpaceImpl: ColorSpaceDefinition;
7
+ export const LinearDisplayP3ColorSpaceImpl: ColorSpaceDefinition;
8
+
9
+ export const LinearRec2020ColorSpace: "rec2020-linear";
10
+
11
+ export const LinearRec2020ColorSpaceImpl: ColorSpaceDefinition;