@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
@@ -1,6 +1,6 @@
1
1
  import { Camera } from "../../cameras/Camera.js";
2
- import { Object3D } from "../../core/Object3D.js";
3
2
  import { RenderTarget } from "../../core/RenderTarget.js";
3
+ import { Scene } from "../../scenes/Scene.js";
4
4
  import ChainMap from "./ChainMap.js";
5
5
  import RenderContext from "./RenderContext.js";
6
6
  /**
@@ -10,15 +10,7 @@ import RenderContext from "./RenderContext.js";
10
10
  */
11
11
  declare class RenderContexts {
12
12
  chainMaps: {
13
- [attachmentState: string]:
14
- | ChainMap<
15
- | readonly [Object3D, Camera]
16
- | readonly [Object3D, Camera, {
17
- id: "default";
18
- }],
19
- RenderContext
20
- >
21
- | undefined;
13
+ [attachmentState: string]: ChainMap<readonly [Scene, Camera], RenderContext> | undefined;
22
14
  };
23
15
  /**
24
16
  * Constructs a new render context management component.
@@ -27,27 +19,27 @@ declare class RenderContexts {
27
19
  /**
28
20
  * Returns a render context for the given scene, camera and render target.
29
21
  *
30
- * @param {Scene?} [scene=null] - The scene. The parameter can become `null` e.g. when the renderer clears a render target.
31
- * @param {Camera?} [camera=null] - The camera that is used to render the scene. The parameter can become `null` e.g. when the renderer clears a render target.
32
- * @param {RenderTarget?} [renderTarget=null] - The active render target.
22
+ * @param {Scene} scene - The scene.
23
+ * @param {Camera} camera - The camera that is used to render the scene.
24
+ * @param {?RenderTarget} [renderTarget=null] - The active render target.
33
25
  * @return {RenderContext} The render context.
34
26
  */
35
- get(scene?: Object3D | null, camera?: Camera | null, renderTarget?: RenderTarget | null): RenderContext;
27
+ get(scene: Scene, camera: Camera, renderTarget?: RenderTarget | null): RenderContext;
28
+ /**
29
+ * Returns a render context intended for clear operations.
30
+ *
31
+ * @param {?RenderTarget} [renderTarget=null] - The active render target.
32
+ * @return {RenderContext} The render context.
33
+ */
34
+ getForClear(renderTarget?: RenderTarget | null): RenderContext;
36
35
  /**
37
36
  * Returns a chain map for the given attachment state.
38
37
  *
39
- * @param {String} attachmentState - The attachment state.
38
+ * @private
39
+ * @param {string} attachmentState - The attachment state.
40
40
  * @return {ChainMap} The chain map.
41
41
  */
42
- getChainMap(
43
- attachmentState: string,
44
- ): ChainMap<
45
- | readonly [Object3D<import("../../core/Object3D.js").Object3DEventMap>, Camera]
46
- | readonly [Object3D<import("../../core/Object3D.js").Object3DEventMap>, Camera, {
47
- id: "default";
48
- }],
49
- RenderContext
50
- >;
42
+ _getChainMap(attachmentState: string): ChainMap<readonly [Scene, Camera], RenderContext>;
51
43
  /**
52
44
  * Frees internal resources.
53
45
  */
@@ -72,9 +72,9 @@ declare class RenderList {
72
72
  * @param {Object3D} object - The 3D object.
73
73
  * @param {BufferGeometry} geometry - The 3D object's geometry.
74
74
  * @param {Material} material - The 3D object's material.
75
- * @param {Number} groupOrder - The current group order.
76
- * @param {Number} z - Th 3D object's depth value (z value in clip space).
77
- * @param {Number?} group - {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
75
+ * @param {number} groupOrder - The current group order.
76
+ * @param {number} z - Th 3D object's depth value (z value in clip space).
77
+ * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
78
78
  * @param {ClippingContext} clippingContext - The current clipping context.
79
79
  * @return {Object} The render item.
80
80
  */
@@ -94,9 +94,9 @@ declare class RenderList {
94
94
  * @param {Object3D} object - The 3D object.
95
95
  * @param {BufferGeometry} geometry - The 3D object's geometry.
96
96
  * @param {Material} material - The 3D object's material.
97
- * @param {Number} groupOrder - The current group order.
98
- * @param {Number} z - Th 3D object's depth value (z value in clip space).
99
- * @param {Number?} group - {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
97
+ * @param {number} groupOrder - The current group order.
98
+ * @param {number} z - Th 3D object's depth value (z value in clip space).
99
+ * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
100
100
  * @param {ClippingContext} clippingContext - The current clipping context.
101
101
  */
102
102
  push(
@@ -115,9 +115,9 @@ declare class RenderList {
115
115
  * @param {Object3D} object - The 3D object.
116
116
  * @param {BufferGeometry} geometry - The 3D object's geometry.
117
117
  * @param {Material} material - The 3D object's material.
118
- * @param {Number} groupOrder - The current group order.
119
- * @param {Number} z - Th 3D object's depth value (z value in clip space).
120
- * @param {Number?} group - {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
118
+ * @param {number} groupOrder - The current group order.
119
+ * @param {number} z - Th 3D object's depth value (z value in clip space).
120
+ * @param {?number} group - {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
121
121
  * @param {ClippingContext} clippingContext - The current clipping context.
122
122
  */
123
123
  unshift(
@@ -144,8 +144,8 @@ declare class RenderList {
144
144
  /**
145
145
  * Sorts the internal render lists.
146
146
  *
147
- * @param {Function} customOpaqueSort - A custom sort function for opaque objects.
148
- * @param {Function} customTransparentSort - A custom sort function for transparent objects.
147
+ * @param {function(any, any): number} customOpaqueSort - A custom sort function for opaque objects.
148
+ * @param {function(any, any): number} customTransparentSort - A custom sort function for transparent objects.
149
149
  */
150
150
  sort(
151
151
  customOpaqueSort: ((a: RenderItem, b: RenderItem) => number) | null,
@@ -35,7 +35,7 @@ import RenderPipeline from "./RenderPipeline.js";
35
35
  *
36
36
  * @private
37
37
  */
38
- export default class RenderObject {
38
+ declare class RenderObject {
39
39
  _nodes: Nodes;
40
40
  _geometries: Geometries;
41
41
  id: number;
@@ -107,21 +107,21 @@ export default class RenderObject {
107
107
  /**
108
108
  * Whether the clipping requires an update or not.
109
109
  *
110
- * @type {Boolean}
110
+ * @type {boolean}
111
111
  * @readonly
112
112
  */
113
113
  get clippingNeedsUpdate(): boolean;
114
114
  /**
115
115
  * The number of clipping planes defined in context of hardware clipping.
116
116
  *
117
- * @type {Number}
117
+ * @type {number}
118
118
  * @readonly
119
119
  */
120
120
  get hardwareClippingPlanes(): number;
121
121
  /**
122
122
  * Returns the node builder state of this render object.
123
123
  *
124
- * @return {NodeBuilderState} The node buider state.
124
+ * @return {NodeBuilderState} The node builder state.
125
125
  */
126
126
  getNodeBuilderState(): NodeBuilderState;
127
127
  /**
@@ -136,16 +136,23 @@ export default class RenderObject {
136
136
  * @return {Array<BindGroup>} The bindings.
137
137
  */
138
138
  getBindings(): BindGroup[];
139
+ /**
140
+ * Returns a binding group by group name of this render object.
141
+ *
142
+ * @param {string} name - The name of the binding group.
143
+ * @return {?BindGroup} The bindings.
144
+ */
145
+ getBindingGroup(name: string): BindGroup | undefined;
139
146
  /**
140
147
  * Returns the index of the render object's geometry.
141
148
  *
142
- * @return {BufferAttribute?} The index. Returns `null` for non-indexed geometries.
149
+ * @return {?BufferAttribute} The index. Returns `null` for non-indexed geometries.
143
150
  */
144
151
  getIndex(): BufferAttribute | null;
145
152
  /**
146
153
  * Returns the indirect buffer attribute.
147
154
  *
148
- * @return {BufferAttribute?} The indirect attribute. `null` if no indirect drawing is used.
155
+ * @return {?BufferAttribute} The indirect attribute. `null` if no indirect drawing is used.
149
156
  */
150
157
  getIndirect(): import("./IndirectStorageBufferAttribute.js").default | null;
151
158
  /**
@@ -182,7 +189,7 @@ export default class RenderObject {
182
189
  /**
183
190
  * Returns the draw parameters for the render object.
184
191
  *
185
- * @return {{vertexCount: Number, firstVertex: Number, instanceCount: Number, firstInstance: Number}} The draw parameters.
192
+ * @return {{vertexCount: number, firstVertex: number, instanceCount: number, firstInstance: number}} The draw parameters.
186
193
  */
187
194
  getDrawParameters(): {
188
195
  vertexCount: number;
@@ -195,7 +202,7 @@ export default class RenderObject {
195
202
  *
196
203
  * The geometry cache key is part of the material cache key.
197
204
  *
198
- * @return {String} The geometry cache key.
205
+ * @return {string} The geometry cache key.
199
206
  */
200
207
  getGeometryCacheKey(): string;
201
208
  /**
@@ -203,13 +210,13 @@ export default class RenderObject {
203
210
  *
204
211
  * The material cache key is part of the render object cache key.
205
212
  *
206
- * @return {String} The material cache key.
213
+ * @return {number} The material cache key.
207
214
  */
208
215
  getMaterialCacheKey(): number;
209
216
  /**
210
217
  * Whether the geometry requires an update or not.
211
218
  *
212
- * @type {Boolean}
219
+ * @type {boolean}
213
220
  * @readonly
214
221
  */
215
222
  get needsGeometryUpdate(): boolean;
@@ -224,27 +231,28 @@ export default class RenderObject {
224
231
  * `RenderObjects.get()`. The render object's NodeMaterialObserver is then used to detect
225
232
  * a need for a refresh due to material, geometry or object related value changes.
226
233
  *
227
- * TODO: Investigate if it's possible to merge boths steps so there is only a single place
234
+ * TODO: Investigate if it's possible to merge both steps so there is only a single place
228
235
  * that performs the 'needsUpdate' check.
229
236
  *
230
- * @type {Boolean}
237
+ * @type {boolean}
231
238
  * @readonly
232
239
  */
233
240
  get needsUpdate(): boolean;
234
241
  /**
235
242
  * Returns the dynamic cache key which represents a key that is computed per draw command.
236
243
  *
237
- * @return {String} The cache key.
244
+ * @return {number} The cache key.
238
245
  */
239
- getDynamicCacheKey(): string;
246
+ getDynamicCacheKey(): number;
240
247
  /**
241
248
  * Returns the render object's cache key.
242
249
  *
243
- * @return {String} The cache key.
250
+ * @return {number} The cache key.
244
251
  */
245
- getCacheKey(): string;
252
+ getCacheKey(): number;
246
253
  /**
247
254
  * Frees internal resources.
248
255
  */
249
256
  dispose(): void;
250
257
  }
258
+ export default RenderObject;
@@ -56,7 +56,7 @@ declare class RenderObjects {
56
56
  * @param {LightsNode} lightsNode - The lights node.
57
57
  * @param {RenderContext} renderContext - The render context.
58
58
  * @param {ClippingContext} clippingContext - The clipping context.
59
- * @param {String?} passId - An optional ID for identifying the pass.
59
+ * @param {?string} passId - An optional ID for identifying the pass.
60
60
  * @return {RenderObject} The render object.
61
61
  */
62
62
  get(
@@ -72,7 +72,7 @@ declare class RenderObjects {
72
72
  /**
73
73
  * Returns a chain map for the given pass ID.
74
74
  *
75
- * @param {String} [passId='default'] - The pass ID.
75
+ * @param {string} [passId='default'] - The pass ID.
76
76
  * @return {ChainMap} The chain map.
77
77
  */
78
78
  getChainMap(
@@ -98,7 +98,7 @@ declare class RenderObjects {
98
98
  * @param {LightsNode} lightsNode - The lights node.
99
99
  * @param {RenderContext} renderContext - The render context.
100
100
  * @param {ClippingContext} clippingContext - The clipping context.
101
- * @param {String?} passId - An optional ID for identifying the pass.
101
+ * @param {?string} passId - An optional ID for identifying the pass.
102
102
  * @return {RenderObject} The render object.
103
103
  */
104
104
  createRenderObject(
@@ -12,7 +12,7 @@ declare class RenderPipeline extends Pipeline {
12
12
  /**
13
13
  * Constructs a new render pipeline.
14
14
  *
15
- * @param {String} cacheKey - The pipeline's cache key.
15
+ * @param {string} cacheKey - The pipeline's cache key.
16
16
  * @param {ProgrammableStage} vertexProgram - The pipeline's vertex shader.
17
17
  * @param {ProgrammableStage} fragmentProgram - The pipeline's fragment shader.
18
18
  */