@types/three 0.172.0 → 0.174.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 (124) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/animation/CCDIKSolver.d.ts +3 -2
  3. three/examples/jsm/geometries/TextGeometry.d.ts +0 -8
  4. three/examples/jsm/interactive/InteractiveGroup.d.ts +9 -1
  5. three/examples/jsm/loaders/MTLLoader.d.ts +2 -1
  6. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +3 -0
  7. three/examples/jsm/misc/Timer.d.ts +13 -2
  8. three/examples/jsm/objects/Reflector.d.ts +1 -0
  9. three/examples/jsm/tsl/math/Bayer.d.ts +4 -0
  10. three/examples/jsm/tsl/utils/Raymarching.d.ts +9 -0
  11. three/examples/jsm/webxr/XRButton.d.ts +4 -2
  12. three/package.json +2 -2
  13. three/src/Three.Core.d.ts +2 -0
  14. three/src/Three.TSL.d.ts +13 -1
  15. three/src/Three.d.ts +6 -1
  16. three/src/animation/AnimationClip.d.ts +1 -1
  17. three/src/cameras/ArrayCamera.d.ts +7 -6
  18. three/src/cameras/Camera.d.ts +7 -7
  19. three/src/constants.d.ts +6 -0
  20. three/src/core/BufferAttribute.d.ts +5 -0
  21. three/src/core/Raycaster.d.ts +4 -0
  22. three/src/extras/PMREMGenerator.d.ts +15 -2
  23. three/src/geometries/TorusGeometry.d.ts +5 -6
  24. three/src/materials/nodes/NodeMaterial.d.ts +2 -1
  25. three/src/materials/nodes/NodeMaterials.d.ts +0 -4
  26. three/src/materials/nodes/PointsNodeMaterial.d.ts +7 -14
  27. three/src/materials/nodes/VolumeNodeMaterial.d.ts +14 -2
  28. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +5 -4
  29. three/src/math/Matrix4.d.ts +2 -1
  30. three/src/nodes/Nodes.d.ts +6 -3
  31. three/src/nodes/TSL.d.ts +5 -0
  32. three/src/nodes/accessors/Arrays.d.ts +9 -2
  33. three/src/nodes/accessors/BufferAttributeNode.d.ts +25 -22
  34. three/src/nodes/accessors/Camera.d.ts +1 -0
  35. three/src/nodes/accessors/Lights.d.ts +1 -1
  36. three/src/nodes/accessors/MaterialNode.d.ts +3 -3
  37. three/src/nodes/accessors/MaterialProperties.d.ts +5 -0
  38. three/src/nodes/accessors/ModelNode.d.ts +1 -0
  39. three/src/nodes/accessors/Object3DNode.d.ts +7 -5
  40. three/src/nodes/accessors/StorageBufferNode.d.ts +7 -3
  41. three/src/nodes/accessors/Texture3DNode.d.ts +2 -2
  42. three/src/nodes/core/ArrayNode.d.ts +26 -0
  43. three/src/nodes/core/LightingModel.d.ts +13 -28
  44. three/src/nodes/core/Node.d.ts +31 -23
  45. three/src/nodes/core/NodeAttribute.d.ts +3 -3
  46. three/src/nodes/core/NodeCache.d.ts +4 -3
  47. three/src/nodes/core/NodeParser.d.ts +1 -1
  48. three/src/nodes/core/NodeUniform.d.ts +4 -4
  49. three/src/nodes/core/NodeVar.d.ts +8 -4
  50. three/src/nodes/core/NodeVarying.d.ts +2 -2
  51. three/src/nodes/core/StructNode.d.ts +21 -0
  52. three/src/nodes/core/StructType.d.ts +8 -0
  53. three/src/nodes/core/StructTypeNode.d.ts +33 -14
  54. three/src/nodes/core/UniformNode.d.ts +7 -7
  55. three/src/nodes/core/VarNode.d.ts +8 -1
  56. three/src/nodes/core/VaryingNode.d.ts +9 -0
  57. three/src/nodes/core/constants.d.ts +0 -1
  58. three/src/nodes/display/PassNode.d.ts +10 -1
  59. three/src/nodes/functions/BSDF/LTC.d.ts +5 -1
  60. three/src/nodes/functions/VolumetricLightingModel.d.ts +6 -0
  61. three/src/nodes/geometry/RangeNode.d.ts +6 -11
  62. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +5 -0
  63. three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +1 -0
  64. three/src/nodes/lighting/AnalyticLightNode.d.ts +13 -1
  65. three/src/nodes/lighting/LightingContextNode.d.ts +18 -4
  66. three/src/nodes/lighting/LightsNode.d.ts +24 -0
  67. three/src/nodes/lighting/PointLightNode.d.ts +8 -7
  68. three/src/nodes/lighting/ShadowBaseNode.d.ts +3 -0
  69. three/src/nodes/math/MathNode.d.ts +2 -0
  70. three/src/nodes/math/OperatorNode.d.ts +2 -0
  71. three/src/nodes/shapes/Shapes.d.ts +4 -0
  72. three/src/nodes/tsl/TSLBase.d.ts +1 -0
  73. three/src/nodes/tsl/TSLCore.d.ts +19 -3
  74. three/src/nodes/utils/MemberNode.d.ts +11 -0
  75. three/src/nodes/utils/ReflectorNode.d.ts +1 -0
  76. three/src/objects/BatchedMesh.d.ts +1 -0
  77. three/src/objects/InstancedMesh.d.ts +4 -3
  78. three/src/objects/LOD.d.ts +4 -3
  79. three/src/renderers/WebGLRenderer.d.ts +2 -2
  80. three/src/renderers/common/Animation.d.ts +16 -4
  81. three/src/renderers/common/Attributes.d.ts +1 -1
  82. three/src/renderers/common/BindGroup.d.ts +2 -2
  83. three/src/renderers/common/Binding.d.ts +2 -2
  84. three/src/renderers/common/Buffer.d.ts +3 -3
  85. three/src/renderers/common/BufferUtils.d.ts +8 -9
  86. three/src/renderers/common/BundleGroup.d.ts +3 -3
  87. three/src/renderers/common/ChainMap.d.ts +8 -8
  88. three/src/renderers/common/ClippingContext.d.ts +3 -3
  89. three/src/renderers/common/Color4.d.ts +12 -8
  90. three/src/renderers/common/ComputePipeline.d.ts +1 -1
  91. three/src/renderers/common/DataMap.d.ts +2 -2
  92. three/src/renderers/common/Geometries.d.ts +4 -4
  93. three/src/renderers/common/Info.d.ts +2 -13
  94. three/src/renderers/common/Pipeline.d.ts +1 -1
  95. three/src/renderers/common/Pipelines.d.ts +10 -10
  96. three/src/renderers/common/PostProcessing.d.ts +1 -1
  97. three/src/renderers/common/ProgrammableStage.d.ts +4 -4
  98. three/src/renderers/common/RenderContext.d.ts +8 -6
  99. three/src/renderers/common/RenderContexts.d.ts +16 -24
  100. three/src/renderers/common/RenderList.d.ts +11 -11
  101. three/src/renderers/common/RenderObject.d.ts +24 -16
  102. three/src/renderers/common/RenderObjects.d.ts +3 -3
  103. three/src/renderers/common/RenderPipeline.d.ts +1 -1
  104. three/src/renderers/common/Renderer.d.ts +139 -96
  105. three/src/renderers/common/Textures.d.ts +6 -6
  106. three/src/renderers/common/TimestampQueryPool.d.ts +43 -0
  107. three/src/renderers/common/Uniform.d.ts +39 -13
  108. three/src/renderers/common/UniformBuffer.d.ts +1 -1
  109. three/src/renderers/common/UniformsGroup.d.ts +13 -13
  110. three/src/renderers/common/XRManager.d.ts +194 -0
  111. three/src/renderers/common/XRRenderTarget.d.ts +23 -0
  112. three/src/renderers/common/extras/PMREMGenerator.d.ts +9 -2
  113. three/src/renderers/common/nodes/NodeBuilderState.d.ts +6 -6
  114. three/src/renderers/common/nodes/NodeLibrary.d.ts +11 -11
  115. three/src/renderers/common/nodes/NodeUniform.d.ts +39 -8
  116. three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +1 -1
  117. three/src/renderers/common/nodes/Nodes.d.ts +19 -18
  118. three/src/renderers/webgl/WebGLState.d.ts +7 -6
  119. three/src/renderers/webgpu/WebGPUBackend.d.ts +2 -1
  120. three/src/textures/Texture.d.ts +2 -5
  121. three/src/textures/VideoFrameTexture.d.ts +27 -0
  122. three/examples/jsm/geometries/InstancedPointsGeometry.d.ts +0 -13
  123. three/examples/jsm/objects/InstancedPoints.d.ts +0 -10
  124. three/src/materials/nodes/InstancedPointsNodeMaterial.d.ts +0 -33
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: Mon, 06 Jan 2025 09:02:31 GMT
11
+ * Last updated: Thu, 27 Feb 2025 18:02:49 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
@@ -14,6 +14,7 @@ export interface IK {
14
14
  minAngle?: number | undefined;
15
15
  maxAngle?: number | undefined;
16
16
  target: number;
17
+ blendFactor?: number | undefined;
17
18
  }
18
19
 
19
20
  export class CCDIKSolver {
@@ -22,8 +23,8 @@ export class CCDIKSolver {
22
23
 
23
24
  constructor(mesh: SkinnedMesh, iks?: IK[]);
24
25
 
25
- update(): this;
26
- updateOne(ik: IK): this;
26
+ update(globalBlendFactor?: number): this;
27
+ updateOne(ik: IK, overrideBlend?: number): this;
27
28
  createHelper(sphereSize?: number): CCDIKHelper;
28
29
  }
29
30
 
@@ -12,14 +12,6 @@ export interface TextGeometryParameters extends ExtrudeGeometryOptions {
12
12
  */
13
13
  size?: number | undefined;
14
14
 
15
- /**
16
- * Thickness to extrude text.
17
- * Expects a `Float`.
18
- * @defaultValue `50`
19
- * @deprecated THREE.TextGeometry: .height is now deprecated. Please use .depth instead
20
- */
21
- height?: number | undefined;
22
-
23
15
  /**
24
16
  * Thickness to extrude text.
25
17
  * Expects a `Float`.
@@ -1,4 +1,4 @@
1
- import { Camera, Group, Object3D, Object3DEventMap, Vector2, WebGLRenderer, XRTargetRaySpace } from "three";
1
+ import { Camera, Group, Object3D, Object3DEventMap, Raycaster, Vector2, WebGLRenderer, XRTargetRaySpace } from "three";
2
2
 
3
3
  export interface InteractiveObject3DEventMap extends Object3DEventMap {
4
4
  hoveron: { data: Vector2 };
@@ -14,7 +14,15 @@ export interface InteractiveObject3DEventMap extends Object3DEventMap {
14
14
  export class InteractiveObject3D extends Object3D<InteractiveObject3DEventMap> {}
15
15
 
16
16
  export class InteractiveGroup extends Group {
17
+ raycaster: Raycaster;
18
+
17
19
  listenToPointerEvents(renderer: WebGLRenderer, camera: Camera): void;
18
20
 
21
+ disconnectionPointerEvents(): void;
22
+
19
23
  listenToXRControllerEvents(controller: XRTargetRaySpace): void;
24
+
25
+ disconnectXrControllerEvents(): void;
26
+
27
+ disconnect(): void;
20
28
  }
@@ -38,8 +38,8 @@ export class MTLLoader extends Loader<MTLLoader.MaterialCreator> {
38
38
  }
39
39
 
40
40
  export interface MaterialInfo {
41
- ks?: number[] | undefined;
42
41
  kd?: number[] | undefined;
42
+ ks?: number[] | undefined;
43
43
  ke?: number[] | undefined;
44
44
  map_kd?: string | undefined;
45
45
  map_ks?: string | undefined;
@@ -47,6 +47,7 @@ export interface MaterialInfo {
47
47
  norm?: string | undefined;
48
48
  map_bump?: string | undefined;
49
49
  bump?: string | undefined;
50
+ disp?: string | undefined;
50
51
  map_d?: string | undefined;
51
52
  ns?: number | undefined;
52
53
  d?: number | undefined;
@@ -6,6 +6,9 @@
6
6
 
7
7
  import { ShaderMaterial, ShaderMaterialParameters } from "three";
8
8
 
9
+ /**
10
+ * @deprecated Use THREE.MeshLambertMaterial instead.
11
+ */
9
12
  export class MeshGouraudMaterial extends ShaderMaterial {
10
13
  isMeshGouraudMaterial: true;
11
14
 
@@ -4,8 +4,8 @@
4
4
  *
5
5
  * - {@link Timer} has an {@link .update()} method that updates its internal state. That makes it possible to call
6
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).
7
+ * - The class can make use of the Page Visibility API to avoid large time delta values when the app is inactive (e.g.
8
+ * tab switched or browser hidden).
9
9
  *
10
10
  * @example
11
11
  * const timer = new Timer();
@@ -24,6 +24,17 @@
24
24
  export class Timer {
25
25
  constructor();
26
26
 
27
+ /**
28
+ * Connects the timer to the given document. Calling this method is not mandatory to use the timer but enables the
29
+ * usage of the Page Visibility API to avoid large time delta values.
30
+ */
31
+ connect(document: Document): void;
32
+
33
+ /**
34
+ * Disconnects the timer from the DOM and also disables the usage of the Page Visibility API.
35
+ */
36
+ disconnect(): void;
37
+
27
38
  /**
28
39
  * Returns the time delta in seconds.
29
40
  */
@@ -11,6 +11,7 @@ export interface ReflectorOptions {
11
11
 
12
12
  export class Reflector extends Mesh {
13
13
  type: "Reflector";
14
+ forceUpdate: boolean;
14
15
  camera: PerspectiveCamera;
15
16
 
16
17
  constructor(geometry?: BufferGeometry, options?: ReflectorOptions);
@@ -0,0 +1,4 @@
1
+ import { ShaderNodeObject } from "three/tsl";
2
+ import { Node } from "three/webgpu";
3
+
4
+ export const bayer16: (uv: Node) => ShaderNodeObject<Node>;
@@ -0,0 +1,9 @@
1
+ import { ShaderNodeObject } from "three/tsl";
2
+ import { FunctionNode, Node } from "three/webgpu";
3
+
4
+ export const RaymarchingBox: (
5
+ steps: number | Node,
6
+ callback:
7
+ | ((params: { positionRay: ShaderNodeObject<Node> }) => void)
8
+ | FunctionNode<{ positionRay: ShaderNodeObject<Node> }>,
9
+ ) => void;
@@ -1,5 +1,7 @@
1
- import { WebGLRenderer } from "three";
1
+ export interface XRButtonRenderer {
2
+ xr: { setSession(session: XRSession): Promise<void> };
3
+ }
2
4
 
3
5
  export class XRButton {
4
- static createButton(renderer: WebGLRenderer, sessionInit?: XRSessionInit): HTMLElement;
6
+ static createButton(renderer: XRButtonRenderer, sessionInit?: XRSessionInit): HTMLElement;
5
7
  }
three/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/three",
3
- "version": "0.172.0",
3
+ "version": "0.174.0",
4
4
  "description": "TypeScript definitions for three",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
6
6
  "license": "MIT",
@@ -48,6 +48,6 @@
48
48
  "meshoptimizer": "~0.18.1"
49
49
  },
50
50
  "peerDependencies": {},
51
- "typesPublisherContentHash": "5a0a6eed488cac2cce6e55921ed12957eedbfbfc3847d24e7762d3d686ecaeac",
51
+ "typesPublisherContentHash": "42b773a4ca2b467bb5f631194fbba7e91c3510c11d419d1c442487b3e4c90b2e",
52
52
  "typeScriptVersion": "5.0"
53
53
  }
three/src/Three.Core.d.ts CHANGED
@@ -140,6 +140,7 @@ export * from "./renderers/WebGL3DRenderTarget.js";
140
140
  export * from "./renderers/WebGLArrayRenderTarget.js";
141
141
  export * from "./renderers/WebGLCubeRenderTarget.js";
142
142
  export * from "./renderers/WebGLRenderTarget.js";
143
+ export * from "./renderers/webxr/WebXRController.js";
143
144
  export * from "./scenes/Fog.js";
144
145
  export * from "./scenes/FogExp2.js";
145
146
  export * from "./scenes/Scene.js";
@@ -155,5 +156,6 @@ export * from "./textures/DepthTexture.js";
155
156
  export * from "./textures/FramebufferTexture.js";
156
157
  export * from "./textures/Source.js";
157
158
  export * from "./textures/Texture.js";
159
+ export * from "./textures/VideoFrameTexture.js";
158
160
  export * from "./textures/VideoTexture.js";
159
161
  export { createCanvasElement } from "./utils.js";
three/src/Three.TSL.d.ts CHANGED
@@ -43,6 +43,7 @@ export const anisotropyB: typeof TSL.anisotropyB;
43
43
  export const anisotropyT: typeof TSL.anisotropyT;
44
44
  export const any: typeof TSL.any;
45
45
  export const append: typeof TSL.append;
46
+ export const array: typeof TSL.array;
46
47
  export const arrayBuffer: typeof TSL.arrayBuffer;
47
48
  export const asin: typeof TSL.asin;
48
49
  export const assign: typeof TSL.assign;
@@ -57,6 +58,7 @@ export const atomicOr: typeof TSL.atomicOr;
57
58
  export const atomicStore: typeof TSL.atomicStore;
58
59
  export const atomicSub: typeof TSL.atomicSub;
59
60
  export const atomicXor: typeof TSL.atomicXor;
61
+ export const atomicLoad: typeof TSL.atomicLoad;
60
62
  export const attenuationColor: typeof TSL.attenuationColor;
61
63
  export const attenuationDistance: typeof TSL.attenuationDistance;
62
64
  export const attribute: typeof TSL.attribute;
@@ -93,6 +95,7 @@ export const bypass: typeof TSL.bypass;
93
95
  export const cache: typeof TSL.cache;
94
96
  export const call: typeof TSL.call;
95
97
  export const cameraFar: typeof TSL.cameraFar;
98
+ export const cameraIndex: typeof TSL.cameraIndex;
96
99
  export const cameraNear: typeof TSL.cameraNear;
97
100
  export const cameraNormalMatrix: typeof TSL.cameraNormalMatrix;
98
101
  export const cameraPosition: typeof TSL.cameraPosition;
@@ -114,6 +117,7 @@ export const colorSpaceToWorking: typeof TSL.colorSpaceToWorking;
114
117
  export const colorToDirection: typeof TSL.colorToDirection;
115
118
  export const compute: typeof TSL.compute;
116
119
  export const cond: typeof TSL.cond;
120
+ export const Const: typeof TSL.Const;
117
121
  export const context: typeof TSL.context;
118
122
  export const convert: typeof TSL.convert;
119
123
  export const convertColorSpace: typeof TSL.convertColorSpace;
@@ -219,6 +223,7 @@ export const lights: typeof TSL.lights;
219
223
  export const linearDepth: typeof TSL.linearDepth;
220
224
  export const linearToneMapping: typeof TSL.linearToneMapping;
221
225
  export const localId: typeof TSL.localId;
226
+ export const globalId: typeof TSL.globalId;
222
227
  export const log: typeof TSL.log;
223
228
  export const log2: typeof TSL.log2;
224
229
  export const logarithmicDepthToViewZ: typeof TSL.logarithmicDepthToViewZ;
@@ -254,7 +259,7 @@ export const materialLineWidth: typeof TSL.materialLineWidth;
254
259
  export const materialMetalness: typeof TSL.materialMetalness;
255
260
  export const materialNormal: typeof TSL.materialNormal;
256
261
  export const materialOpacity: typeof TSL.materialOpacity;
257
- export const materialPointWidth: typeof TSL.materialPointWidth;
262
+ export const materialPointSize: typeof TSL.materialPointSize;
258
263
  export const materialReference: typeof TSL.materialReference;
259
264
  export const materialReflectivity: typeof TSL.materialReflectivity;
260
265
  export const materialRefractionRatio: typeof TSL.materialRefractionRatio;
@@ -280,6 +285,7 @@ export const modInt: typeof TSL.modInt;
280
285
  export const modelDirection: typeof TSL.modelDirection;
281
286
  export const modelNormalMatrix: typeof TSL.modelNormalMatrix;
282
287
  export const modelPosition: typeof TSL.modelPosition;
288
+ export const modelRadius: typeof TSL.modelRadius;
283
289
  export const modelScale: typeof TSL.modelScale;
284
290
  export const modelViewMatrix: typeof TSL.modelViewMatrix;
285
291
  export const modelViewPosition: typeof TSL.modelViewPosition;
@@ -331,6 +337,7 @@ export const numWorkgroups: typeof TSL.numWorkgroups;
331
337
  export const objectDirection: typeof TSL.objectDirection;
332
338
  export const objectGroup: typeof TSL.objectGroup;
333
339
  export const objectPosition: typeof TSL.objectPosition;
340
+ export const objectRadius: typeof TSL.objectRadius;
334
341
  export const objectScale: typeof TSL.objectScale;
335
342
  export const objectViewPosition: typeof TSL.objectViewPosition;
336
343
  export const objectWorldMatrix: typeof TSL.objectWorldMatrix;
@@ -375,6 +382,7 @@ export const range: typeof TSL.range;
375
382
  export const rangeFog: typeof TSL.rangeFog;
376
383
  export const rangeFogFactor: typeof TSL.rangeFogFactor;
377
384
  export const reciprocal: typeof TSL.reciprocal;
385
+ export const lightProjectionUV: typeof TSL.lightProjectionUV;
378
386
  export const reference: typeof TSL.reference;
379
387
  export const referenceBuffer: typeof TSL.referenceBuffer;
380
388
  export const reflect: typeof TSL.reflect;
@@ -411,8 +419,10 @@ export const select: typeof TSL.select;
411
419
  export const setCurrentStack: typeof TSL.setCurrentStack;
412
420
  export const shaderStages: typeof TSL.shaderStages;
413
421
  export const shadow: typeof TSL.shadow;
422
+ export const pointShadow: typeof TSL.pointShadow;
414
423
  export const shadowPositionWorld: typeof TSL.shadowPositionWorld;
415
424
  export const sharedUniformGroup: typeof TSL.sharedUniformGroup;
425
+ export const shapeCircle: typeof TSL.shapeCircle;
416
426
  export const sheen: typeof TSL.sheen;
417
427
  export const sheenRoughness: typeof TSL.sheenRoughness;
418
428
  export const shiftLeft: typeof TSL.shiftLeft;
@@ -438,6 +448,7 @@ export const storageBarrier: typeof TSL.storageBarrier;
438
448
  export const storageObject: typeof TSL.storageObject;
439
449
  export const storageTexture: typeof TSL.storageTexture;
440
450
  export const string: typeof TSL.string;
451
+ export const struct: typeof TSL.struct;
441
452
  export const sub: typeof TSL.sub;
442
453
  export const subgroupIndex: typeof TSL.subgroupIndex;
443
454
  export const subgroupSize: typeof TSL.subgroupSize;
@@ -496,6 +507,7 @@ export const uv: typeof TSL.uv;
496
507
  export const uvec2: typeof TSL.uvec2;
497
508
  export const uvec3: typeof TSL.uvec3;
498
509
  export const uvec4: typeof TSL.uvec4;
510
+ export const Var: typeof TSL.Var;
499
511
  export const varying: typeof TSL.varying;
500
512
  export const varyingProperty: typeof TSL.varyingProperty;
501
513
  export const vec2: typeof TSL.vec2;
three/src/Three.d.ts CHANGED
@@ -28,7 +28,12 @@ export type { WebGLProperties } from "./renderers/webgl/WebGLProperties.js";
28
28
  export type { RenderItem, WebGLRenderList, WebGLRenderLists } from "./renderers/webgl/WebGLRenderLists.js";
29
29
  export type { WebGLShader } from "./renderers/webgl/WebGLShader.js";
30
30
  export type { WebGLShadowMap } from "./renderers/webgl/WebGLShadowMap.js";
31
- export type { WebGLState } from "./renderers/webgl/WebGLState.js";
31
+ export type {
32
+ WebGLColorBuffer,
33
+ WebGLDepthBuffer,
34
+ WebGLState,
35
+ WebGLStencilBuffer,
36
+ } from "./renderers/webgl/WebGLState.js";
32
37
  export type { WebGLTextures } from "./renderers/webgl/WebGLTextures.js";
33
38
  export type { WebGLUniforms } from "./renderers/webgl/WebGLUniforms.js";
34
39
  export * from "./renderers/webgl/WebGLUtils.js";
@@ -41,7 +41,7 @@ export class AnimationClip {
41
41
  validate(): boolean;
42
42
  optimize(): AnimationClip;
43
43
  clone(): this;
44
- toJSON(clip: AnimationClip): any;
44
+ toJSON(): AnimationClipJSON;
45
45
 
46
46
  static CreateFromMorphTargetSequence(
47
47
  name: string,
@@ -11,12 +11,6 @@ import { PerspectiveCamera } from "./PerspectiveCamera.js";
11
11
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/cameras/ArrayCamera.js | Source}
12
12
  */
13
13
  export class ArrayCamera extends PerspectiveCamera {
14
- /**
15
- * An array of cameras.
16
- * @param array. Default `[]`.
17
- */
18
- constructor(cameras?: PerspectiveCamera[]);
19
-
20
14
  /**
21
15
  * Read-only flag to check if a given object is of type {@link ArrayCamera}.
22
16
  * @remarks This is a _constant_ value
@@ -29,4 +23,11 @@ export class ArrayCamera extends PerspectiveCamera {
29
23
  * @defaultValue `[]`
30
24
  */
31
25
  cameras: PerspectiveCamera[];
26
+
27
+ index: number;
28
+
29
+ /**
30
+ * An array of cameras.
31
+ */
32
+ constructor(cameras?: PerspectiveCamera[]);
32
33
  }
@@ -16,8 +16,8 @@ export class Camera extends Object3D {
16
16
  /**
17
17
  * @remarks
18
18
  * Note that this class is not intended to be called directly; you probably want a
19
- * {@link THREE.PerspectiveCamera | PerspectiveCamera} or
20
- * {@link THREE.OrthographicCamera | OrthographicCamera} instead.
19
+ * {@link PerspectiveCamera | PerspectiveCamera} or
20
+ * {@link OrthographicCamera | OrthographicCamera} instead.
21
21
  */
22
22
  constructor();
23
23
 
@@ -36,7 +36,7 @@ export class Camera extends Object3D {
36
36
 
37
37
  /**
38
38
  * @override
39
- * The {@link THREE.Layers | layers} that the {@link Camera} is a member of.
39
+ * The {@link Layers | layers} that the {@link Camera} is a member of.
40
40
  * @remarks Objects must share at least one layer with the {@link Camera} to be n when the camera's viewpoint is rendered.
41
41
  * @defaultValue `new THREE.Layers()`
42
42
  */
@@ -45,19 +45,19 @@ export class Camera extends Object3D {
45
45
  /**
46
46
  * This is the inverse of matrixWorld.
47
47
  * @remarks MatrixWorld contains the Matrix which has the world transform of the {@link Camera} .
48
- * @defaultValue {@link THREE.Matrix4 | `new THREE.Matrix4()`}
48
+ * @defaultValue {@link Matrix4 | `new THREE.Matrix4()`}
49
49
  */
50
50
  matrixWorldInverse: Matrix4;
51
51
 
52
52
  /**
53
53
  * This is the matrix which contains the projection.
54
- * @defaultValue {@link THREE.Matrix4 | `new THREE.Matrix4()`}
54
+ * @defaultValue {@link Matrix4 | `new THREE.Matrix4()`}
55
55
  */
56
56
  projectionMatrix: Matrix4;
57
57
 
58
58
  /**
59
59
  * This is the inverse of projectionMatrix.
60
- * @defaultValue {@link THREE.Matrix4 | `new THREE.Matrix4()`}
60
+ * @defaultValue {@link Matrix4 | `new THREE.Matrix4()`}
61
61
  */
62
62
  projectionMatrixInverse: Matrix4;
63
63
 
@@ -66,7 +66,7 @@ export class Camera extends Object3D {
66
66
  viewport?: Vector4;
67
67
 
68
68
  /**
69
- * Returns a {@link THREE.Vector3 | Vector3} representing the world space direction in which the {@link Camera} is looking.
69
+ * Returns a {@link Vector3 | Vector3} representing the world space direction in which the {@link Camera} is looking.
70
70
  * @remarks Note: A {@link Camera} looks down its local, negative z-axis.
71
71
  * @param target The result will be copied into this Vector3.
72
72
  */
three/src/constants.d.ts CHANGED
@@ -791,6 +791,12 @@ export const WebGLCoordinateSystem: 2000;
791
791
  export const WebGPUCoordinateSystem: 2001;
792
792
  export type CoordinateSystem = typeof WebGLCoordinateSystem | typeof WebGPUCoordinateSystem;
793
793
 
794
+ export const TimestampQuery: {
795
+ COMPUTE: "compute";
796
+ RENDER: "render";
797
+ };
798
+ export type TimestampQuery = "compute" | "render";
799
+
794
800
  ///////////////////////////////////////////////////////////////////////////////
795
801
  // Texture - Internal Pixel Formats
796
802
 
@@ -57,6 +57,11 @@ export class BufferAttribute {
57
57
  */
58
58
  constructor(array: TypedArray, itemSize: number, normalized?: boolean);
59
59
 
60
+ /**
61
+ * Unique number for this attribute instance.
62
+ */
63
+ readonly id: number;
64
+
60
65
  /**
61
66
  * Optional name for this attribute instance.
62
67
  * @defaultValue ''
@@ -17,6 +17,10 @@ export interface Face {
17
17
  export interface Intersection<TIntersected extends Object3D = Object3D> {
18
18
  /** Distance between the origin of the ray and the intersection */
19
19
  distance: number;
20
+ /**
21
+ * Some objects (f.e. {@link Points}) provide the distance of the intersection to the nearest point on the ray. For
22
+ * other objects it will be `undefined`
23
+ */
20
24
  distanceToRay?: number | undefined;
21
25
  /** Point of intersection, in world coordinates */
22
26
  point: Vector3;
@@ -1,9 +1,15 @@
1
+ import { Vector3 } from "../math/Vector3.js";
1
2
  import { WebGLRenderer } from "../renderers/WebGLRenderer.js";
2
3
  import { WebGLRenderTarget } from "../renderers/WebGLRenderTarget.js";
3
4
  import { Scene } from "../scenes/Scene.js";
4
5
  import { CubeTexture } from "../textures/CubeTexture.js";
5
6
  import { Texture } from "../textures/Texture.js";
6
7
 
8
+ export interface PMREMGeneratorOptions {
9
+ size?: number | undefined;
10
+ position?: Vector3 | undefined;
11
+ }
12
+
7
13
  /**
8
14
  * This class generates a Prefiltered, Mipmapped Radiance Environment Map (PMREM) from a cubeMap environment texture.
9
15
  * @remarks
@@ -38,13 +44,20 @@ export class PMREMGenerator {
38
44
  /**
39
45
  * Generates a PMREM from a supplied Scene, which can be faster than using an image if networking bandwidth is low
40
46
  * @remarks
41
- * Optional near and far planes ensure the scene is rendered in its entirety (the cubeCamera is placed at the origin).
47
+ * Optional near and far planes ensure the scene is rendered in its entirety.
42
48
  * @param scene The given scene.
43
49
  * @param sigma Specifies a blur radius in radians to be applied to the scene before PMREM generation. Default `0`.
44
50
  * @param near The near plane value. Default `0.1`.
45
51
  * @param far The far plane value. Default `100`.
52
+ * @param {?Object} [options={}]
46
53
  */
47
- fromScene(scene: Scene, sigma?: number, near?: number, far?: number): WebGLRenderTarget;
54
+ fromScene(
55
+ scene: Scene,
56
+ sigma?: number,
57
+ near?: number,
58
+ far?: number,
59
+ options?: PMREMGeneratorOptions,
60
+ ): WebGLRenderTarget;
48
61
 
49
62
  /**
50
63
  * Generates a PMREM from an equirectangular texture, which can be either LDR or HDR. The ideal input image size is
@@ -16,12 +16,11 @@ import { BufferGeometry } from "../core/BufferGeometry.js";
16
16
  */
17
17
  export class TorusGeometry extends BufferGeometry {
18
18
  /**
19
- * Create a new instance of {@link TorusGeometry}
20
- * @param radius Radius of the torus, from the center of the torus to the center of the tube. Expects a `Float`. Default `1`.
21
- * @param tube Radius of the tube. Expects a `Float`. Default `0.4`.
22
- * @param radialSegments Expects a `Integer`.Default is `12`.
23
- * @param tubularSegments Expects a `Integer`. Default `48`.
24
- * @param arc Central angle. Expects a `Float`. Default `Math.PI * 2`
19
+ * @param radius Radius of the torus, from the center of the torus to the center of the tube. Default `1`.
20
+ * @param tube Radius of the tube. Must be smaller than `radius`. Default is `0.4`.
21
+ * @param radialSegments Default is `12`.
22
+ * @param tubularSegments Default is `48`.
23
+ * @param arc Central angle. Default is Math.PI * 2.
25
24
  */
26
25
  constructor(radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, arc?: number);
27
26
 
@@ -60,7 +60,7 @@ declare class NodeMaterial extends Material {
60
60
 
61
61
  depthNode: Node | null;
62
62
  shadowPositionNode: Node | null;
63
- receivedShadowNode: Node | null;
63
+ receivedShadowNode: (() => Node) | null;
64
64
  castShadowNode: Node | null;
65
65
 
66
66
  outputNode: Node | null;
@@ -89,6 +89,7 @@ declare class NodeMaterial extends Material {
89
89
  setupOutgoingLight(): Node;
90
90
  setupLightingModel(builder: NodeBuilder): LightingModel;
91
91
  setupLighting(builder: NodeBuilder): Node;
92
+ setupFog(builder: NodeBuilder, outputNode: Node): Node;
92
93
  setupOutput(builder: NodeBuilder, outputNode: Node): Node;
93
94
 
94
95
  setDefaultValues(material: Material): void;
@@ -1,7 +1,3 @@
1
- export {
2
- default as InstancedPointsNodeMaterial,
3
- InstancedPointsNodeMaterialParameters,
4
- } from "./InstancedPointsNodeMaterial.js";
5
1
  export { default as Line2NodeMaterial, Line2NodeMaterialParameters } from "./Line2NodeMaterial.js";
6
2
  export { default as LineBasicNodeMaterial, LineBasicNodeMaterialParameters } from "./LineBasicNodeMaterial.js";
7
3
  export { default as LineDashedNodeMaterial, LineDashedNodeMaterialParameters } from "./LineDashedNodeMaterial.js";
@@ -1,21 +1,14 @@
1
- import { Color } from "../../math/Color.js";
2
- import { Texture } from "../../textures/Texture.js";
3
- import { PointsMaterialParameters } from "../PointsMaterial.js";
4
- import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
1
+ import Node from "../../nodes/core/Node.js";
2
+ import SpriteNodeMaterial, { SpriteNodeMaterialParameters } from "./SpriteNodeMaterial.js";
5
3
 
6
- export interface PointsNodeMaterialParameters extends NodeMaterialParameters, PointsMaterialParameters {
4
+ export interface PointsNodeMaterialParameters extends SpriteNodeMaterialParameters {
5
+ sizeNode?: Node | null | undefined;
7
6
  }
8
7
 
9
- export default class PointsNodeMaterial extends NodeMaterial {
10
- readonly isPointsNodeMaterial: true;
8
+ export default class PointsNodeMaterial extends SpriteNodeMaterial {
9
+ sizeNode: Node | null;
11
10
 
12
- // Properties from PointsMaterial
13
- readonly isPointsMaterial: true;
14
- color: Color;
15
- map: Texture | null;
16
- alphaMap: Texture | null;
17
- size: number;
18
- sizeAttenuation: boolean;
11
+ readonly isPointsNodeMaterial: true;
19
12
 
20
13
  constructor(parameters?: PointsNodeMaterialParameters);
21
14
  }
@@ -1,10 +1,22 @@
1
+ import FunctionNode from "../../nodes/code/FunctionNode.js";
1
2
  import Node from "../../nodes/core/Node.js";
3
+ import { ShaderNodeObject } from "../../nodes/tsl/TSLCore.js";
2
4
  import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
3
5
 
6
+ export interface VolumeNodeMaterialParameters extends NodeMaterialParameters {
7
+ steps?: number | undefined;
8
+
9
+ scatteringNode?: Node | null | undefined;
10
+ }
11
+
4
12
  export default class VolumeNodeMaterial extends NodeMaterial {
5
- lights: boolean;
6
13
  readonly isVolumeNodeMaterial: true;
7
- testNode: Node | null;
14
+
15
+ steps: number;
16
+
17
+ scatteringNode: (params: { positionRay: ShaderNodeObject<Node> }) => Node | null;
18
+
19
+ offsetNode?: Node | undefined;
8
20
 
9
21
  constructor(parameters?: NodeMaterialParameters);
10
22
  }
@@ -68,6 +68,7 @@ interface AttributesData {
68
68
  interface RenderObjectData {
69
69
  material: MaterialData;
70
70
  geometry: {
71
+ id: number;
71
72
  attributes: AttributesData;
72
73
  indexVersion: number | null;
73
74
  drawRange: {
@@ -99,7 +100,7 @@ declare class NodeMaterialObserver {
99
100
  * Returns `true` if the given render object is verified for the first time of this observer.
100
101
  *
101
102
  * @param {RenderObject} renderObject - The render object.
102
- * @return {Boolean} Whether the given render object is verified for the first time of this observer.
103
+ * @return {boolean} Whether the given render object is verified for the first time of this observer.
103
104
  */
104
105
  firstInitialization(renderObject: RenderObject): boolean;
105
106
  /**
@@ -122,7 +123,7 @@ declare class NodeMaterialObserver {
122
123
  * node properties.
123
124
  *
124
125
  * @param {NodeBuilder} builder - The current node builder.
125
- * @return {Boolean} Whether the node builder's material uses node properties or not.
126
+ * @return {boolean} Whether the node builder's material uses node properties or not.
126
127
  */
127
128
  containsNode(builder: NodeBuilder): boolean;
128
129
  /**
@@ -137,7 +138,7 @@ declare class NodeMaterialObserver {
137
138
  * Returns `true` if the given render object has not changed its state.
138
139
  *
139
140
  * @param {RenderObject} renderObject - The render object.
140
- * @return {Boolean} Whether the given render object has changed its state or not.
141
+ * @return {boolean} Whether the given render object has changed its state or not.
141
142
  */
142
143
  equals(renderObject: RenderObject): boolean;
143
144
  /**
@@ -145,7 +146,7 @@ declare class NodeMaterialObserver {
145
146
  *
146
147
  * @param {RenderObject} renderObject - The render object.
147
148
  * @param {NodeFrame} nodeFrame - The current node frame.
148
- * @return {Boolean} Whether the given render object requires a refresh or not.
149
+ * @return {boolean} Whether the given render object requires a refresh or not.
149
150
  */
150
151
  needsRefresh(renderObject: RenderObject, nodeFrame: NodeFrame): boolean;
151
152
  }
@@ -128,7 +128,8 @@ export class Matrix4 {
128
128
  makeRotationFromQuaternion(q: Quaternion): this;
129
129
 
130
130
  /**
131
- * Constructs a rotation matrix, looking from eye towards center with defined up vector.
131
+ * Sets the rotation component of the transformation matrix, looking from [eye]{@link Vector3} towards
132
+ * [target]{@link Vector3}, and oriented by the up-direction [up]{@link Vector3}.
132
133
  */
133
134
  lookAt(eye: Vector3, target: Vector3, up: Vector3): this;
134
135