@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.
- three/README.md +1 -1
- three/examples/jsm/animation/CCDIKSolver.d.ts +3 -2
- three/examples/jsm/geometries/TextGeometry.d.ts +0 -8
- three/examples/jsm/interactive/InteractiveGroup.d.ts +9 -1
- three/examples/jsm/loaders/MTLLoader.d.ts +2 -1
- three/examples/jsm/materials/MeshGouraudMaterial.d.ts +3 -0
- three/examples/jsm/misc/Timer.d.ts +13 -2
- three/examples/jsm/objects/Reflector.d.ts +1 -0
- three/examples/jsm/tsl/math/Bayer.d.ts +4 -0
- three/examples/jsm/tsl/utils/Raymarching.d.ts +9 -0
- three/examples/jsm/webxr/XRButton.d.ts +4 -2
- three/package.json +2 -2
- three/src/Three.Core.d.ts +2 -0
- three/src/Three.TSL.d.ts +13 -1
- three/src/Three.d.ts +6 -1
- three/src/animation/AnimationClip.d.ts +1 -1
- three/src/cameras/ArrayCamera.d.ts +7 -6
- three/src/cameras/Camera.d.ts +7 -7
- three/src/constants.d.ts +6 -0
- three/src/core/BufferAttribute.d.ts +5 -0
- three/src/core/Raycaster.d.ts +4 -0
- three/src/extras/PMREMGenerator.d.ts +15 -2
- three/src/geometries/TorusGeometry.d.ts +5 -6
- three/src/materials/nodes/NodeMaterial.d.ts +2 -1
- three/src/materials/nodes/NodeMaterials.d.ts +0 -4
- three/src/materials/nodes/PointsNodeMaterial.d.ts +7 -14
- three/src/materials/nodes/VolumeNodeMaterial.d.ts +14 -2
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +5 -4
- three/src/math/Matrix4.d.ts +2 -1
- three/src/nodes/Nodes.d.ts +6 -3
- three/src/nodes/TSL.d.ts +5 -0
- three/src/nodes/accessors/Arrays.d.ts +9 -2
- three/src/nodes/accessors/BufferAttributeNode.d.ts +25 -22
- three/src/nodes/accessors/Camera.d.ts +1 -0
- three/src/nodes/accessors/Lights.d.ts +1 -1
- three/src/nodes/accessors/MaterialNode.d.ts +3 -3
- three/src/nodes/accessors/MaterialProperties.d.ts +5 -0
- three/src/nodes/accessors/ModelNode.d.ts +1 -0
- three/src/nodes/accessors/Object3DNode.d.ts +7 -5
- three/src/nodes/accessors/StorageBufferNode.d.ts +7 -3
- three/src/nodes/accessors/Texture3DNode.d.ts +2 -2
- three/src/nodes/core/ArrayNode.d.ts +26 -0
- three/src/nodes/core/LightingModel.d.ts +13 -28
- three/src/nodes/core/Node.d.ts +31 -23
- three/src/nodes/core/NodeAttribute.d.ts +3 -3
- three/src/nodes/core/NodeCache.d.ts +4 -3
- three/src/nodes/core/NodeParser.d.ts +1 -1
- three/src/nodes/core/NodeUniform.d.ts +4 -4
- three/src/nodes/core/NodeVar.d.ts +8 -4
- three/src/nodes/core/NodeVarying.d.ts +2 -2
- three/src/nodes/core/StructNode.d.ts +21 -0
- three/src/nodes/core/StructType.d.ts +8 -0
- three/src/nodes/core/StructTypeNode.d.ts +33 -14
- three/src/nodes/core/UniformNode.d.ts +7 -7
- three/src/nodes/core/VarNode.d.ts +8 -1
- three/src/nodes/core/VaryingNode.d.ts +9 -0
- three/src/nodes/core/constants.d.ts +0 -1
- three/src/nodes/display/PassNode.d.ts +10 -1
- three/src/nodes/functions/BSDF/LTC.d.ts +5 -1
- three/src/nodes/functions/VolumetricLightingModel.d.ts +6 -0
- three/src/nodes/geometry/RangeNode.d.ts +6 -11
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +5 -0
- three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +1 -0
- three/src/nodes/lighting/AnalyticLightNode.d.ts +13 -1
- three/src/nodes/lighting/LightingContextNode.d.ts +18 -4
- three/src/nodes/lighting/LightsNode.d.ts +24 -0
- three/src/nodes/lighting/PointLightNode.d.ts +8 -7
- three/src/nodes/lighting/ShadowBaseNode.d.ts +3 -0
- three/src/nodes/math/MathNode.d.ts +2 -0
- three/src/nodes/math/OperatorNode.d.ts +2 -0
- three/src/nodes/shapes/Shapes.d.ts +4 -0
- three/src/nodes/tsl/TSLBase.d.ts +1 -0
- three/src/nodes/tsl/TSLCore.d.ts +19 -3
- three/src/nodes/utils/MemberNode.d.ts +11 -0
- three/src/nodes/utils/ReflectorNode.d.ts +1 -0
- three/src/objects/BatchedMesh.d.ts +1 -0
- three/src/objects/InstancedMesh.d.ts +4 -3
- three/src/objects/LOD.d.ts +4 -3
- three/src/renderers/WebGLRenderer.d.ts +2 -2
- three/src/renderers/common/Animation.d.ts +16 -4
- three/src/renderers/common/Attributes.d.ts +1 -1
- three/src/renderers/common/BindGroup.d.ts +2 -2
- three/src/renderers/common/Binding.d.ts +2 -2
- three/src/renderers/common/Buffer.d.ts +3 -3
- three/src/renderers/common/BufferUtils.d.ts +8 -9
- three/src/renderers/common/BundleGroup.d.ts +3 -3
- three/src/renderers/common/ChainMap.d.ts +8 -8
- three/src/renderers/common/ClippingContext.d.ts +3 -3
- three/src/renderers/common/Color4.d.ts +12 -8
- three/src/renderers/common/ComputePipeline.d.ts +1 -1
- three/src/renderers/common/DataMap.d.ts +2 -2
- three/src/renderers/common/Geometries.d.ts +4 -4
- three/src/renderers/common/Info.d.ts +2 -13
- three/src/renderers/common/Pipeline.d.ts +1 -1
- three/src/renderers/common/Pipelines.d.ts +10 -10
- three/src/renderers/common/PostProcessing.d.ts +1 -1
- three/src/renderers/common/ProgrammableStage.d.ts +4 -4
- three/src/renderers/common/RenderContext.d.ts +8 -6
- three/src/renderers/common/RenderContexts.d.ts +16 -24
- three/src/renderers/common/RenderList.d.ts +11 -11
- three/src/renderers/common/RenderObject.d.ts +24 -16
- three/src/renderers/common/RenderObjects.d.ts +3 -3
- three/src/renderers/common/RenderPipeline.d.ts +1 -1
- three/src/renderers/common/Renderer.d.ts +139 -96
- three/src/renderers/common/Textures.d.ts +6 -6
- three/src/renderers/common/TimestampQueryPool.d.ts +43 -0
- three/src/renderers/common/Uniform.d.ts +39 -13
- three/src/renderers/common/UniformBuffer.d.ts +1 -1
- three/src/renderers/common/UniformsGroup.d.ts +13 -13
- three/src/renderers/common/XRManager.d.ts +194 -0
- three/src/renderers/common/XRRenderTarget.d.ts +23 -0
- three/src/renderers/common/extras/PMREMGenerator.d.ts +9 -2
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +6 -6
- three/src/renderers/common/nodes/NodeLibrary.d.ts +11 -11
- three/src/renderers/common/nodes/NodeUniform.d.ts +39 -8
- three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +1 -1
- three/src/renderers/common/nodes/Nodes.d.ts +19 -18
- three/src/renderers/webgl/WebGLState.d.ts +7 -6
- three/src/renderers/webgpu/WebGPUBackend.d.ts +2 -1
- three/src/textures/Texture.d.ts +2 -5
- three/src/textures/VideoFrameTexture.d.ts +27 -0
- three/examples/jsm/geometries/InstancedPointsGeometry.d.ts +0 -13
- three/examples/jsm/objects/InstancedPoints.d.ts +0 -10
- 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
|
|
31
|
-
* @param {Camera
|
|
32
|
-
* @param {RenderTarget
|
|
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
|
|
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
|
-
* @
|
|
38
|
+
* @private
|
|
39
|
+
* @param {string} attachmentState - The attachment state.
|
|
40
40
|
* @return {ChainMap} The chain map.
|
|
41
41
|
*/
|
|
42
|
-
|
|
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 {
|
|
76
|
-
* @param {
|
|
77
|
-
* @param {
|
|
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 {
|
|
98
|
-
* @param {
|
|
99
|
-
* @param {
|
|
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 {
|
|
119
|
-
* @param {
|
|
120
|
-
* @param {
|
|
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 {
|
|
148
|
-
* @param {
|
|
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
|
-
|
|
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 {
|
|
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 {
|
|
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
|
|
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
|
|
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
|
|
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:
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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
|
|
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 {
|
|
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 {
|
|
244
|
+
* @return {number} The cache key.
|
|
238
245
|
*/
|
|
239
|
-
getDynamicCacheKey():
|
|
246
|
+
getDynamicCacheKey(): number;
|
|
240
247
|
/**
|
|
241
248
|
* Returns the render object's cache key.
|
|
242
249
|
*
|
|
243
|
-
* @return {
|
|
250
|
+
* @return {number} The cache key.
|
|
244
251
|
*/
|
|
245
|
-
getCacheKey():
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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 {
|
|
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
|
*/
|