@types/three 0.183.0 → 0.184.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 +2 -2
- three/examples/jsm/Addons.d.ts +11 -0
- three/examples/jsm/controls/FirstPersonControls.d.ts +5 -10
- three/examples/jsm/controls/TransformControls.d.ts +24 -0
- three/examples/jsm/geometries/TextGeometry.d.ts +43 -71
- three/examples/jsm/helpers/LightProbeGridHelper.d.ts +12 -0
- three/examples/jsm/inspector/Extension.d.ts +9 -0
- three/examples/jsm/inspector/Inspector.d.ts +21 -2
- three/examples/jsm/inspector/RendererInspector.d.ts +7 -2
- three/examples/jsm/inspector/extensions/tsl-graph/TSLGraphEditor.d.ts +20 -0
- three/examples/jsm/inspector/extensions/tsl-graph/TSLGraphLoader.d.ts +11 -0
- three/examples/jsm/inspector/tabs/Parameters.d.ts +22 -1
- three/examples/jsm/inspector/ui/Tab.d.ts +5 -1
- three/examples/jsm/inspector/ui/Values.d.ts +23 -3
- three/examples/jsm/interaction/InteractionManager.d.ts +18 -0
- three/examples/jsm/lighting/DynamicLighting.d.ts +16 -0
- three/examples/jsm/lighting/LightProbeGrid.d.ts +34 -0
- three/examples/jsm/loaders/ColladaLoader.d.ts +1 -0
- three/examples/jsm/loaders/EXRLoader.d.ts +2 -0
- three/examples/jsm/loaders/LDrawLoader.d.ts +1 -1
- three/examples/jsm/loaders/VTKLoader.d.ts +6 -0
- three/examples/jsm/objects/Reflector.d.ts +1 -2
- three/examples/jsm/objects/SkyMesh.d.ts +1 -0
- three/examples/jsm/tsl/WebGLNodesHandler.d.ts +14 -0
- three/examples/jsm/tsl/display/FSR1Node.d.ts +17 -0
- three/examples/jsm/tsl/display/SharpenNode.d.ts +22 -0
- three/examples/jsm/tsl/display/TAAUNode.d.ts +31 -0
- three/examples/jsm/tsl/lighting/DynamicLightsNode.d.ts +21 -0
- three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +1 -1
- three/examples/jsm/tsl/lighting/data/AmbientLightDataNode.d.ts +9 -0
- three/examples/jsm/tsl/lighting/data/DirectionalLightDataNode.d.ts +9 -0
- three/examples/jsm/tsl/lighting/data/HemisphereLightDataNode.d.ts +9 -0
- three/examples/jsm/tsl/lighting/data/PointLightDataNode.d.ts +9 -0
- three/examples/jsm/tsl/lighting/data/SpotLightDataNode.d.ts +9 -0
- three/examples/jsm/utils/ColorUtils.d.ts +5 -0
- three/examples/jsm/utils/SceneOptimizer.d.ts +18 -0
- three/examples/jsm/webxr/XRHandMeshModel.d.ts +1 -0
- three/package.json +4 -5
- three/src/Three.Core.d.ts +13 -1
- three/src/Three.TSL.d.ts +7 -1
- three/src/Three.WebGPU.Nodes.d.ts +8 -4
- three/src/Three.WebGPU.d.ts +11 -4
- three/src/Three.d.ts +0 -11
- three/src/animation/AnimationMixer.d.ts +3 -1
- three/src/audio/AudioContext.d.ts +2 -2
- three/src/core/BufferAttribute.d.ts +13 -1
- three/src/core/RenderTarget.d.ts +8 -1
- three/src/core/UniformsGroup.d.ts +7 -1
- three/src/extras/Controls.d.ts +5 -1
- three/src/geometries/ExtrudeGeometry.d.ts +39 -53
- three/src/loaders/FileLoader.d.ts +2 -2
- three/src/materials/Material.d.ts +5 -1
- three/src/materials/MeshToonMaterial.d.ts +1 -1
- three/src/materials/nodes/Line2NodeMaterial.d.ts +7 -0
- three/src/materials/nodes/VolumeNodeMaterial.d.ts +1 -1
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +11 -1
- three/src/math/ColorManagement.d.ts +1 -1
- three/src/math/Matrix2.d.ts +1 -1
- three/src/math/Matrix3.d.ts +1 -1
- three/src/math/Matrix4.d.ts +1 -1
- three/src/math/Plane.d.ts +1 -1
- three/src/math/Vector2.d.ts +2 -1
- three/src/math/Vector3.d.ts +2 -1
- three/src/math/Vector4.d.ts +2 -1
- three/src/nodes/Nodes.d.ts +0 -1
- three/src/nodes/TSL.d.ts +1 -1
- three/src/nodes/accessors/BufferAttributeNode.d.ts +1 -1
- three/src/nodes/core/Node.d.ts +37 -9
- three/src/nodes/core/StackNode.d.ts +1 -1
- three/src/nodes/core/StructTypeNode.d.ts +0 -4
- three/src/nodes/core/UniformGroupNode.d.ts +4 -3
- three/src/nodes/core/UniformNode.d.ts +3 -0
- three/src/nodes/core/VarNode.d.ts +16 -10
- three/src/nodes/display/ViewportDepthTextureNode.d.ts +1 -3
- three/src/nodes/display/ViewportTextureNode.d.ts +5 -5
- three/src/nodes/functions/ShadowMaskModel.d.ts +2 -2
- three/src/nodes/gpgpu/BarrierNode.d.ts +2 -0
- three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +16 -7
- three/src/nodes/gpgpu/ComputeNode.d.ts +6 -2
- three/src/nodes/materialx/lib/mx_noise.d.ts +4 -5
- three/src/nodes/math/MathNode.d.ts +64 -6
- three/src/nodes/tsl/TSLBase.d.ts +1 -1
- three/src/nodes/tsl/TSLCore.d.ts +568 -160
- three/src/nodes/utils/ConvertNode.d.ts +9 -2
- three/src/nodes/utils/EventNode.d.ts +6 -0
- three/src/nodes/utils/JoinNode.d.ts +9 -5
- three/src/nodes/utils/LoopNode.d.ts +1 -2
- three/src/nodes/utils/{RemapNode.d.ts → Remap.d.ts} +6 -22
- three/src/objects/BatchedMesh.d.ts +2 -0
- three/src/objects/InstancedMesh.d.ts +6 -6
- three/src/objects/SkinnedMesh.d.ts +3 -0
- three/src/renderers/WebGLRenderer.d.ts +10 -1
- three/src/renderers/common/Animation.d.ts +2 -2
- three/src/renderers/common/Attributes.d.ts +9 -1
- three/src/renderers/common/Backend.d.ts +4 -0
- three/src/renderers/common/Background.d.ts +2 -2
- three/src/renderers/common/BindGroup.d.ts +0 -6
- three/src/renderers/common/Bindings.d.ts +2 -2
- three/src/renderers/common/CanvasTarget.d.ts +3 -1
- three/src/renderers/common/ComputePipeline.d.ts +1 -1
- three/src/renderers/common/Info.d.ts +132 -1
- three/src/renderers/common/InspectorBase.d.ts +7 -1
- three/src/renderers/common/Pipelines.d.ts +19 -3
- three/src/renderers/common/ReadbackBuffer.d.ts +63 -0
- three/src/renderers/common/RenderBundle.d.ts +4 -1
- three/src/renderers/common/RenderBundles.d.ts +3 -1
- three/src/renderers/common/RenderObject.d.ts +2 -2
- three/src/renderers/common/RenderObjects.d.ts +3 -3
- three/src/renderers/common/RenderPipeline.d.ts +24 -0
- three/src/renderers/common/Renderer.d.ts +29 -16
- three/src/renderers/common/XRManager.d.ts +1 -7
- three/src/renderers/common/nodes/NodeManager.d.ts +51 -11
- three/src/renderers/shaders/ShaderChunk.d.ts +1 -0
- three/src/renderers/shaders/UniformsLib.d.ts +5 -1
- three/src/renderers/webgl/WebGLBufferRenderer.d.ts +0 -6
- three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +0 -6
- three/src/renderers/webgl/WebGLPrograms.d.ts +5 -0
- three/src/renderers/webgl-fallback/WebGLBackend.d.ts +2 -0
- three/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts +19 -0
- three/src/renderers/webgl-fallback/utils/WebGLCapabilities.d.ts +51 -0
- three/src/renderers/webgpu/WebGPUBackend.d.ts +9 -4
- three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +6 -0
- three/src/renderers/webxr/WebXRController.d.ts +5 -1
- three/src/renderers/webxr/WebXRManager.d.ts +3 -1
- three/src/scenes/Scene.d.ts +2 -2
- three/src/textures/ExternalTexture.d.ts +3 -2
- three/src/textures/HTMLTexture.d.ts +27 -0
- three/src/textures/Texture.d.ts +16 -1
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import Node from "../core/Node.js";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface ConvertNodeInterface {
|
|
4
4
|
node: Node;
|
|
5
5
|
convertTo: string;
|
|
6
|
-
constructor(node: Node, convertTo: string);
|
|
7
6
|
}
|
|
7
|
+
|
|
8
|
+
declare const ConvertNode: {
|
|
9
|
+
new<TNodeType>(node: Node, convertTo: string): ConvertNode<TNodeType>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type ConvertNode<TNodeType> = Node<TNodeType> & ConvertNodeInterface;
|
|
13
|
+
|
|
14
|
+
export default ConvertNode;
|
|
@@ -11,8 +11,10 @@ declare class EventNode extends Node {
|
|
|
11
11
|
|
|
12
12
|
static OBJECT: "object";
|
|
13
13
|
static MATERIAL: "material";
|
|
14
|
+
static FRAME: "frame";
|
|
14
15
|
static BEFORE_OBJECT: "beforeObject";
|
|
15
16
|
static BEFORE_MATERIAL: "beforeMaterial";
|
|
17
|
+
static BEFORE_FRAME: "beforeFrame";
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export default EventNode;
|
|
@@ -21,6 +23,10 @@ export const OnObjectUpdate: (callback: (frame: NodeFrame) => void) => Node;
|
|
|
21
23
|
|
|
22
24
|
export const OnMaterialUpdate: (callback: (frame: NodeFrame) => void) => Node;
|
|
23
25
|
|
|
26
|
+
export const OnFrameUpdate: (callback: (frame: NodeFrame) => void) => Node;
|
|
27
|
+
|
|
24
28
|
export const OnBeforeObjectUpdate: (callback: (frame: NodeFrame) => void) => Node;
|
|
25
29
|
|
|
26
30
|
export const OnBeforeMaterialUpdate: (callback: (frame: NodeFrame) => void) => Node;
|
|
31
|
+
|
|
32
|
+
export const OnBeforeFrameUpdate: (callback: (frame: NodeFrame) => void) => Node;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import Node from "../core/Node.js";
|
|
2
2
|
import { TempNode } from "../Nodes.js";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
* This node constructs given type from elements, like vec3(a,b,c)
|
|
6
|
-
*/
|
|
7
|
-
export default class JoinNode extends TempNode {
|
|
4
|
+
interface JoinNodeInterface {
|
|
8
5
|
nodes: Node[];
|
|
9
|
-
constructor(nodes: Node[]);
|
|
10
6
|
}
|
|
7
|
+
|
|
8
|
+
declare const JoinNode: {
|
|
9
|
+
new<TNodeType>(nodes: Node[]): JoinNode<TNodeType>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type JoinNode<TNodeType> = TempNode<TNodeType> & JoinNodeInterface;
|
|
13
|
+
|
|
14
|
+
export default JoinNode;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import Node from "../core/Node.js";
|
|
2
2
|
import NodeBuilder from "../core/NodeBuilder.js";
|
|
3
|
-
import { VarNode } from "../Nodes.js";
|
|
4
3
|
|
|
5
4
|
type LoopNodeType = "int" | "uint" | "float";
|
|
6
5
|
|
|
@@ -12,7 +11,7 @@ interface LoopNodeObjectParameter<TNodeType extends LoopNodeType> {
|
|
|
12
11
|
start: Node<TNodeType> | number;
|
|
13
12
|
end: Node<TNodeType> | number;
|
|
14
13
|
condition?: string;
|
|
15
|
-
update?:
|
|
14
|
+
update?: Node | number | string;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
declare class LoopNode extends Node<"void"> {
|
|
@@ -1,37 +1,20 @@
|
|
|
1
1
|
import Node from "../core/Node.js";
|
|
2
2
|
|
|
3
|
-
export default class RemapNode extends Node<"float"> {
|
|
4
|
-
node: Node<"float">;
|
|
5
|
-
inLowNode: Node<"float">;
|
|
6
|
-
inHighNode: Node<"float">;
|
|
7
|
-
outLowNode: Node<"float">;
|
|
8
|
-
outHighNode: Node<"float">;
|
|
9
|
-
|
|
10
|
-
doClamp: boolean;
|
|
11
|
-
|
|
12
|
-
constructor(
|
|
13
|
-
node: Node<"float">,
|
|
14
|
-
inLowNode: Node<"float">,
|
|
15
|
-
inHighNode: Node<"float">,
|
|
16
|
-
outLowNode?: Node<"float">,
|
|
17
|
-
outHighNode?: Node<"float">,
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
3
|
export const remap: (
|
|
22
4
|
node: Node<"float">,
|
|
23
5
|
inLowNode: Node<"float"> | number,
|
|
24
6
|
inHighNode: Node<"float"> | number,
|
|
25
7
|
outLowNode?: Node<"float"> | number,
|
|
26
8
|
outHighNode?: Node<"float"> | number,
|
|
27
|
-
|
|
9
|
+
doClamp?: Node<"bool"> | boolean,
|
|
10
|
+
) => Node<"float">;
|
|
28
11
|
export const remapClamp: (
|
|
29
12
|
node: Node<"float">,
|
|
30
13
|
inLowNode: Node<"float"> | number,
|
|
31
14
|
inHighNode: Node<"float"> | number,
|
|
32
15
|
outLowNode?: Node<"float"> | number,
|
|
33
16
|
outHighNode?: Node<"float"> | number,
|
|
34
|
-
) =>
|
|
17
|
+
) => Node<"float">;
|
|
35
18
|
|
|
36
19
|
declare module "../core/Node.js" {
|
|
37
20
|
interface FloatExtensions {
|
|
@@ -40,13 +23,14 @@ declare module "../core/Node.js" {
|
|
|
40
23
|
inHighNode: Node<"float"> | number,
|
|
41
24
|
outLowNode?: Node<"float"> | number,
|
|
42
25
|
outHighNode?: Node<"float"> | number,
|
|
43
|
-
|
|
26
|
+
doClamp?: Node<"bool"> | boolean,
|
|
27
|
+
) => Node<"float">;
|
|
44
28
|
|
|
45
29
|
remapClamp: (
|
|
46
30
|
inLowNode: Node<"float"> | number,
|
|
47
31
|
inHighNode: Node<"float"> | number,
|
|
48
32
|
outLowNode?: Node<"float"> | number,
|
|
49
33
|
outHighNode?: Node<"float"> | number,
|
|
50
|
-
) =>
|
|
34
|
+
) => Node<"float">;
|
|
51
35
|
}
|
|
52
36
|
}
|
|
@@ -145,6 +145,8 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
|
|
|
145
145
|
* @param color - The target object that is used to store the method's result.
|
|
146
146
|
* @return The instance's color. Use a `Vector4` to also retrieve alpha.
|
|
147
147
|
*/
|
|
148
|
+
getColorAt(instanceId: number, color: Color): Color;
|
|
149
|
+
getColorAt(instanceId: number, color: Vector4): Vector4;
|
|
148
150
|
getColorAt(instanceId: number, color: Color | Vector4): Color | Vector4;
|
|
149
151
|
|
|
150
152
|
/**
|
|
@@ -126,7 +126,7 @@ export class InstancedMesh<
|
|
|
126
126
|
* @param index The index of an instance. Values have to be in the range `[0, count]`. Expects a `Integer`
|
|
127
127
|
* @param color This color object will be set to the color of the defined instance.
|
|
128
128
|
*/
|
|
129
|
-
getColorAt(index: number, color: Color):
|
|
129
|
+
getColorAt(index: number, color: Color): Color;
|
|
130
130
|
|
|
131
131
|
/**
|
|
132
132
|
* Sets the given color to the defined instance
|
|
@@ -135,14 +135,14 @@ export class InstancedMesh<
|
|
|
135
135
|
* @param index The index of an instance. Values have to be in the range `[0, count]`. Expects a `Integer`
|
|
136
136
|
* @param color The color of a single instance.
|
|
137
137
|
*/
|
|
138
|
-
setColorAt(index: number, color: Color):
|
|
138
|
+
setColorAt(index: number, color: Color): this;
|
|
139
139
|
|
|
140
140
|
/**
|
|
141
141
|
* Get the local transformation matrix of the defined instance.
|
|
142
142
|
* @param index The index of an instance Values have to be in the range `[0, count]`. Expects a `Integer`
|
|
143
143
|
* @param matrix This 4x4 matrix will be set to the local transformation matrix of the defined instance.
|
|
144
144
|
*/
|
|
145
|
-
getMatrixAt(index: number, matrix: Matrix4):
|
|
145
|
+
getMatrixAt(index: number, matrix: Matrix4): Matrix4;
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
148
|
* Get the morph target weights of the defined instance.
|
|
@@ -159,7 +159,7 @@ export class InstancedMesh<
|
|
|
159
159
|
* @param index The index of an instance. Values have to be in the range `[0, count]`. Expects a `Integer`
|
|
160
160
|
* @param matrix A 4x4 matrix representing the local transformation of a single instance.
|
|
161
161
|
*/
|
|
162
|
-
setMatrixAt(index: number, matrix: Matrix4):
|
|
162
|
+
setMatrixAt(index: number, matrix: Matrix4): this;
|
|
163
163
|
|
|
164
164
|
/**
|
|
165
165
|
* Sets the morph target weights to the defined instance. Make sure you set {@link .morphTexture}{@link .needsUpdate}
|
|
@@ -167,7 +167,7 @@ export class InstancedMesh<
|
|
|
167
167
|
* @param index The index of an instance. Values have to be in the range [0, count].
|
|
168
168
|
* @param mesh A mesh with {@link .morphTargetInfluences} property containing the morph target weights of a single instance.
|
|
169
169
|
*/
|
|
170
|
-
setMorphAt(index: number, mesh: Mesh):
|
|
170
|
+
setMorphAt(index: number, mesh: Mesh): this;
|
|
171
171
|
|
|
172
172
|
/**
|
|
173
173
|
* No effect in {@link InstancedMesh}.
|
|
@@ -181,7 +181,7 @@ export class InstancedMesh<
|
|
|
181
181
|
* @remarks
|
|
182
182
|
* Call this method whenever this instance is no longer used in your app.
|
|
183
183
|
*/
|
|
184
|
-
dispose():
|
|
184
|
+
dispose(): void;
|
|
185
185
|
|
|
186
186
|
toJSON(meta?: JSONMeta): InstancedMeshJSON;
|
|
187
187
|
}
|
|
@@ -6,6 +6,7 @@ import { Box3 } from "../math/Box3.js";
|
|
|
6
6
|
import { Matrix4, Matrix4Tuple } from "../math/Matrix4.js";
|
|
7
7
|
import { Sphere } from "../math/Sphere.js";
|
|
8
8
|
import { Vector3 } from "../math/Vector3.js";
|
|
9
|
+
import { Vector4 } from "../math/Vector4.js";
|
|
9
10
|
import { Mesh, MeshJSON, MeshJSONObject } from "./Mesh.js";
|
|
10
11
|
import { Skeleton } from "./Skeleton.js";
|
|
11
12
|
|
|
@@ -155,6 +156,8 @@ export class SkinnedMesh<
|
|
|
155
156
|
* @param vector
|
|
156
157
|
*/
|
|
157
158
|
applyBoneTransform(index: number, vector: Vector3): Vector3;
|
|
159
|
+
applyBoneTransform(index: number, vector: Vector4): Vector4;
|
|
160
|
+
applyBoneTransform(index: number, vector: Vector3 | Vector4): Vector3 | Vector4;
|
|
158
161
|
|
|
159
162
|
toJSON(meta?: JSONMeta): SkinnedMeshJSON;
|
|
160
163
|
}
|
|
@@ -17,6 +17,7 @@ import { WebGLCapabilities, WebGLCapabilitiesParameters } from "./webgl/WebGLCap
|
|
|
17
17
|
import { WebGLExtensions } from "./webgl/WebGLExtensions.js";
|
|
18
18
|
import { WebGLInfo } from "./webgl/WebGLInfo.js";
|
|
19
19
|
import { WebGLProgram } from "./webgl/WebGLProgram.js";
|
|
20
|
+
import { WebGLProgramParametersWithUniforms } from "./webgl/WebGLPrograms.js";
|
|
20
21
|
import { WebGLProperties } from "./webgl/WebGLProperties.js";
|
|
21
22
|
import { WebGLRenderLists } from "./webgl/WebGLRenderLists.js";
|
|
22
23
|
import { WebGLShadowMap } from "./webgl/WebGLShadowMap.js";
|
|
@@ -116,6 +117,13 @@ export interface Effect {
|
|
|
116
117
|
): void;
|
|
117
118
|
}
|
|
118
119
|
|
|
120
|
+
export interface NodesHandler {
|
|
121
|
+
setRenderer(renderer: WebGLRenderer): void;
|
|
122
|
+
renderStart(scene: Object3D, camera: Camera): void;
|
|
123
|
+
renderEnd(): void;
|
|
124
|
+
build(material: Material, object: Object3D, parameters: WebGLProgramParametersWithUniforms): void;
|
|
125
|
+
}
|
|
126
|
+
|
|
119
127
|
/**
|
|
120
128
|
* The WebGL renderer displays your beautifully crafted scenes using WebGL, if your device supports it.
|
|
121
129
|
* This renderer has way better performance than CanvasRenderer.
|
|
@@ -315,7 +323,8 @@ export class WebGLRenderer {
|
|
|
315
323
|
clearColor(): void;
|
|
316
324
|
clearDepth(): void;
|
|
317
325
|
clearStencil(): void;
|
|
318
|
-
|
|
326
|
+
|
|
327
|
+
setNodesHandler(nodesHandler: NodesHandler): void;
|
|
319
328
|
|
|
320
329
|
dispose(): void;
|
|
321
330
|
|
|
@@ -17,7 +17,7 @@ declare class Animation {
|
|
|
17
17
|
* Constructs a new animation loop management component.
|
|
18
18
|
*
|
|
19
19
|
* @param {Renderer} renderer - A reference to the main renderer.
|
|
20
|
-
* @param {
|
|
20
|
+
* @param {NodeManager} nodes - Renderer component for managing nodes related logic.
|
|
21
21
|
* @param {Info} info - Renderer component for managing metrics and monitoring data.
|
|
22
22
|
*/
|
|
23
23
|
constructor(renderer: Renderer, nodes: NodeManager, info: Info);
|
|
@@ -30,7 +30,7 @@ declare class Animation {
|
|
|
30
30
|
/**
|
|
31
31
|
* Renderer component for managing nodes related logic.
|
|
32
32
|
*
|
|
33
|
-
* @type {
|
|
33
|
+
* @type {NodeManager}
|
|
34
34
|
*/
|
|
35
35
|
nodes: NodeManager;
|
|
36
36
|
/**
|
|
@@ -3,6 +3,7 @@ import { InterleavedBuffer } from "../../core/InterleavedBuffer.js";
|
|
|
3
3
|
import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute.js";
|
|
4
4
|
import Backend from "./Backend.js";
|
|
5
5
|
import DataMap from "./DataMap.js";
|
|
6
|
+
import Info from "./Info.js";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* This renderer module manages geometry attributes.
|
|
@@ -15,14 +16,21 @@ declare class Attributes extends DataMap {
|
|
|
15
16
|
* Constructs a new attribute management component.
|
|
16
17
|
*
|
|
17
18
|
* @param {Backend} backend - The renderer's backend.
|
|
19
|
+
* @param {Info} info - Renderer component for managing metrics and monitoring data.
|
|
18
20
|
*/
|
|
19
|
-
constructor(backend: Backend);
|
|
21
|
+
constructor(backend: Backend, info: Info);
|
|
20
22
|
/**
|
|
21
23
|
* The renderer's backend.
|
|
22
24
|
*
|
|
23
25
|
* @type {Backend}
|
|
24
26
|
*/
|
|
25
27
|
backend: Backend;
|
|
28
|
+
/**
|
|
29
|
+
* Renderer component for managing metrics and monitoring data.
|
|
30
|
+
*
|
|
31
|
+
* @type {Info}
|
|
32
|
+
*/
|
|
33
|
+
info: Info;
|
|
26
34
|
/**
|
|
27
35
|
* Deletes the data for the given attribute.
|
|
28
36
|
*
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { CoordinateSystem } from "../../constants.js";
|
|
2
|
+
import NodeBuilder from "../../nodes/core/NodeBuilder.js";
|
|
2
3
|
import Renderer from "./Renderer.js";
|
|
4
|
+
import RenderObject from "./RenderObject.js";
|
|
3
5
|
|
|
4
6
|
declare module "../../core/Object3D.js" {
|
|
5
7
|
interface Object3D {
|
|
@@ -25,4 +27,6 @@ export default abstract class Backend {
|
|
|
25
27
|
abstract get coordinateSystem(): CoordinateSystem;
|
|
26
28
|
|
|
27
29
|
getDomElement(): HTMLCanvasElement | OffscreenCanvas;
|
|
30
|
+
|
|
31
|
+
createNodeBuilder(renderObject: RenderObject, renderer: Renderer): NodeBuilder;
|
|
28
32
|
}
|
|
@@ -16,7 +16,7 @@ declare class Background extends DataMap {
|
|
|
16
16
|
* Constructs a new background management component.
|
|
17
17
|
*
|
|
18
18
|
* @param {Renderer} renderer - The renderer.
|
|
19
|
-
* @param {
|
|
19
|
+
* @param {NodeManager} nodes - Renderer component for managing nodes related logic.
|
|
20
20
|
*/
|
|
21
21
|
constructor(renderer: Renderer, nodes: NodeManager);
|
|
22
22
|
/**
|
|
@@ -28,7 +28,7 @@ declare class Background extends DataMap {
|
|
|
28
28
|
/**
|
|
29
29
|
* Renderer component for managing nodes related logic.
|
|
30
30
|
*
|
|
31
|
-
* @type {
|
|
31
|
+
* @type {NodeManager}
|
|
32
32
|
*/
|
|
33
33
|
nodes: NodeManager;
|
|
34
34
|
/**
|
|
@@ -20,7 +20,7 @@ declare class Bindings extends DataMap {
|
|
|
20
20
|
* Constructs a new bindings management component.
|
|
21
21
|
*
|
|
22
22
|
* @param {Backend} backend - The renderer's backend.
|
|
23
|
-
* @param {
|
|
23
|
+
* @param {NodeManager} nodes - Renderer component for managing nodes related logic.
|
|
24
24
|
* @param {Textures} textures - Renderer component for managing textures.
|
|
25
25
|
* @param {Attributes} attributes - Renderer component for managing attributes.
|
|
26
26
|
* @param {Pipelines} pipelines - Renderer component for managing pipelines.
|
|
@@ -61,7 +61,7 @@ declare class Bindings extends DataMap {
|
|
|
61
61
|
/**
|
|
62
62
|
* Renderer component for managing nodes related logic.
|
|
63
63
|
*
|
|
64
|
-
* @type {
|
|
64
|
+
* @type {NodeManager}
|
|
65
65
|
*/
|
|
66
66
|
nodes: NodeManager;
|
|
67
67
|
/**
|
|
@@ -14,7 +14,9 @@ export interface CanvasTargetEventMap {
|
|
|
14
14
|
*
|
|
15
15
|
* @augments EventDispatcher
|
|
16
16
|
*/
|
|
17
|
-
declare class CanvasTarget extends
|
|
17
|
+
declare class CanvasTarget<TEventMap extends CanvasTargetEventMap = CanvasTargetEventMap>
|
|
18
|
+
extends EventDispatcher<TEventMap>
|
|
19
|
+
{
|
|
18
20
|
/**
|
|
19
21
|
* Constructs a new CanvasTarget.
|
|
20
22
|
*
|
|
@@ -9,7 +9,7 @@ import ProgrammableStage from "./ProgrammableStage.js";
|
|
|
9
9
|
*/
|
|
10
10
|
declare class ComputePipeline extends Pipeline {
|
|
11
11
|
/**
|
|
12
|
-
* Constructs a new
|
|
12
|
+
* Constructs a new compute pipeline.
|
|
13
13
|
*
|
|
14
14
|
* @param {string} cacheKey - The pipeline's cache key.
|
|
15
15
|
* @param {ProgrammableStage} computeProgram - The pipeline's compute shader.
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { BufferAttribute } from "../../core/BufferAttribute.js";
|
|
1
2
|
import { Object3D } from "../../core/Object3D.js";
|
|
3
|
+
import { Texture } from "../../textures/Texture.js";
|
|
4
|
+
import ProgrammableStage from "./ProgrammableStage.js";
|
|
5
|
+
import ReadbackBuffer from "./ReadbackBuffer.js";
|
|
2
6
|
|
|
3
7
|
/**
|
|
4
8
|
* This renderer module provides a series of statistical information
|
|
@@ -76,12 +80,49 @@ declare class Info {
|
|
|
76
80
|
* @type {Object}
|
|
77
81
|
* @readonly
|
|
78
82
|
* @property {number} geometries - The number of active geometries.
|
|
79
|
-
* @property {number}
|
|
83
|
+
* @property {number} textures - The number of active textures.
|
|
84
|
+
* @property {number} attributes - The number of active attributes.
|
|
85
|
+
* @property {number} indexAttributes - The number of active index attributes.
|
|
86
|
+
* @property {number} storageAttributes - The number of active storage attributes.
|
|
87
|
+
* @property {number} indirectStorageAttributes - The number of active indirect storage attributes.
|
|
88
|
+
* @property {number} readbackBuffers - The number of active readback buffers.
|
|
89
|
+
* @property {number} programs - The number of active programs.
|
|
90
|
+
* @property {number} renderTargets - The number of active renderTargets.
|
|
91
|
+
* @property {number} total - The total memory size in bytes.
|
|
92
|
+
* @property {number} texturesSize - The memory size of active textures in bytes.
|
|
93
|
+
* @property {number} attributesSize - The memory size of active attributes in bytes.
|
|
94
|
+
* @property {number} indexAttributesSize - The memory size of active index attributes in bytes.
|
|
95
|
+
* @property {number} storageAttributesSize - The memory size of active storage attributes in bytes.
|
|
96
|
+
* @property {number} indirectStorageAttributesSize - The memory size of active indirect storage attributes in bytes.
|
|
97
|
+
* @property {number} readbackBuffersSize - The memory size of active readback buffers in bytes.
|
|
98
|
+
* @property {number} programsSize - The memory size of active programs in bytes.
|
|
80
99
|
*/
|
|
81
100
|
readonly memory: {
|
|
82
101
|
geometries: number;
|
|
83
102
|
textures: number;
|
|
103
|
+
attributes: number;
|
|
104
|
+
indexAttributes: number;
|
|
105
|
+
storageAttributes: number;
|
|
106
|
+
indirectStorageAttributes: number;
|
|
107
|
+
readbackBuffers: number;
|
|
108
|
+
programs: number;
|
|
109
|
+
renderTargets: number;
|
|
110
|
+
total: number;
|
|
111
|
+
texturesSize: number;
|
|
112
|
+
attributesSize: number;
|
|
113
|
+
indexAttributesSize: number;
|
|
114
|
+
storageAttributesSize: number;
|
|
115
|
+
indirectStorageAttributesSize: number;
|
|
116
|
+
readbackBuffersSize: number;
|
|
117
|
+
programsSize: number;
|
|
84
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* Map for storing calculated byte sizes of tracked objects.
|
|
121
|
+
*
|
|
122
|
+
* @type {Map<Object, number>}
|
|
123
|
+
* @private
|
|
124
|
+
*/
|
|
125
|
+
private memoryMap;
|
|
85
126
|
/**
|
|
86
127
|
* This method should be executed per draw call and updates the corresponding metrics.
|
|
87
128
|
*
|
|
@@ -98,6 +139,96 @@ declare class Info {
|
|
|
98
139
|
* Performs a complete reset of the object.
|
|
99
140
|
*/
|
|
100
141
|
dispose(): void;
|
|
142
|
+
/**
|
|
143
|
+
* Tracks texture memory explicitly, updating counts and byte tracking.
|
|
144
|
+
*
|
|
145
|
+
* @param {Texture} texture
|
|
146
|
+
*/
|
|
147
|
+
createTexture(texture: Texture): void;
|
|
148
|
+
/**
|
|
149
|
+
* Tracks texture memory explicitly, updating counts and byte tracking.
|
|
150
|
+
*
|
|
151
|
+
* @param {Texture} texture
|
|
152
|
+
*/
|
|
153
|
+
destroyTexture(texture: Texture): void;
|
|
154
|
+
/**
|
|
155
|
+
* Tracks attribute memory explicitly, updating counts and byte tracking.
|
|
156
|
+
*
|
|
157
|
+
* @param {BufferAttribute} attribute
|
|
158
|
+
* @param {string} type - type of attribute
|
|
159
|
+
* @private
|
|
160
|
+
*/
|
|
161
|
+
private _createAttribute;
|
|
162
|
+
/**
|
|
163
|
+
* Tracks a regular attribute memory explicitly.
|
|
164
|
+
*
|
|
165
|
+
* @param {BufferAttribute} attribute - The attribute to track.
|
|
166
|
+
*/
|
|
167
|
+
createAttribute(attribute: BufferAttribute): void;
|
|
168
|
+
/**
|
|
169
|
+
* Tracks an index attribute memory explicitly.
|
|
170
|
+
*
|
|
171
|
+
* @param {BufferAttribute} attribute - The index attribute to track.
|
|
172
|
+
*/
|
|
173
|
+
createIndexAttribute(attribute: BufferAttribute): void;
|
|
174
|
+
/**
|
|
175
|
+
* Tracks a storage attribute memory explicitly.
|
|
176
|
+
*
|
|
177
|
+
* @param {BufferAttribute} attribute - The storage attribute to track.
|
|
178
|
+
*/
|
|
179
|
+
createStorageAttribute(attribute: BufferAttribute): void;
|
|
180
|
+
/**
|
|
181
|
+
* Tracks an indirect storage attribute memory explicitly.
|
|
182
|
+
*
|
|
183
|
+
* @param {BufferAttribute} attribute - The indirect storage attribute to track.
|
|
184
|
+
*/
|
|
185
|
+
createIndirectStorageAttribute(attribute: BufferAttribute): void;
|
|
186
|
+
/**
|
|
187
|
+
* Tracks attribute memory explicitly, updating counts and byte tracking.
|
|
188
|
+
*
|
|
189
|
+
* @param {BufferAttribute} attribute
|
|
190
|
+
*/
|
|
191
|
+
destroyAttribute(attribute: BufferAttribute): void;
|
|
192
|
+
/**
|
|
193
|
+
* Tracks a readback buffer memory explicitly.
|
|
194
|
+
*
|
|
195
|
+
* @param {ReadbackBuffer} readbackBuffer - The readback buffer to track.
|
|
196
|
+
*/
|
|
197
|
+
createReadbackBuffer(readbackBuffer: ReadbackBuffer): void;
|
|
198
|
+
/**
|
|
199
|
+
* Tracks a readback buffer memory explicitly.
|
|
200
|
+
*
|
|
201
|
+
* @param {ReadbackBuffer} readbackBuffer - The readback buffer to track.
|
|
202
|
+
*/
|
|
203
|
+
destroyReadbackBuffer(readbackBuffer: ReadbackBuffer): void;
|
|
204
|
+
/**
|
|
205
|
+
* Tracks program memory explicitly, updating counts and byte tracking.
|
|
206
|
+
*
|
|
207
|
+
* @param {ProgrammableStage} program - The program to track.
|
|
208
|
+
*/
|
|
209
|
+
createProgram(program: ProgrammableStage): void;
|
|
210
|
+
/**
|
|
211
|
+
* Tracks program memory explicitly, updating counts and byte tracking.
|
|
212
|
+
*
|
|
213
|
+
* @param {Object} program - The program to track.
|
|
214
|
+
*/
|
|
215
|
+
destroyProgram(program: ProgrammableStage): void;
|
|
216
|
+
/**
|
|
217
|
+
* Calculates the memory size of a texture in bytes.
|
|
218
|
+
*
|
|
219
|
+
* @param {Texture} texture - The texture to calculate the size for.
|
|
220
|
+
* @return {number} The calculated size in bytes.
|
|
221
|
+
* @private
|
|
222
|
+
*/
|
|
223
|
+
private _getTextureMemorySize;
|
|
224
|
+
/**
|
|
225
|
+
* Calculates the memory size of an attribute in bytes.
|
|
226
|
+
*
|
|
227
|
+
* @param {BufferAttribute} attribute - The attribute to calculate the size for.
|
|
228
|
+
* @return {number} The calculated size in bytes.
|
|
229
|
+
* @private
|
|
230
|
+
*/
|
|
231
|
+
private _getAttributeMemorySize;
|
|
101
232
|
}
|
|
102
233
|
|
|
103
234
|
export default Info;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Camera } from "../../cameras/Camera.js";
|
|
2
|
+
import { EventDispatcher } from "../../core/EventDispatcher.js";
|
|
2
3
|
import { RenderTarget } from "../../core/RenderTarget.js";
|
|
3
4
|
import Node from "../../nodes/core/Node.js";
|
|
4
5
|
import NodeFrame from "../../nodes/core/NodeFrame.js";
|
|
@@ -7,12 +8,17 @@ import { Scene } from "../../scenes/Scene.js";
|
|
|
7
8
|
import { Texture } from "../../textures/Texture.js";
|
|
8
9
|
import Renderer from "./Renderer.js";
|
|
9
10
|
|
|
11
|
+
export interface InspectorBaseEventMap {
|
|
12
|
+
}
|
|
13
|
+
|
|
10
14
|
/**
|
|
11
15
|
* InspectorBase is the base class for all inspectors.
|
|
12
16
|
*
|
|
13
17
|
* @class InspectorBase
|
|
14
18
|
*/
|
|
15
|
-
declare class InspectorBase
|
|
19
|
+
declare class InspectorBase<TEventMap extends InspectorBaseEventMap = InspectorBaseEventMap>
|
|
20
|
+
extends EventDispatcher<TEventMap>
|
|
21
|
+
{
|
|
16
22
|
/**
|
|
17
23
|
* The renderer associated with this inspector.
|
|
18
24
|
*
|
|
@@ -4,6 +4,7 @@ import BindGroup from "./BindGroup.js";
|
|
|
4
4
|
import Bindings from "./Bindings.js";
|
|
5
5
|
import ComputePipeline from "./ComputePipeline.js";
|
|
6
6
|
import DataMap from "./DataMap.js";
|
|
7
|
+
import Info from "./Info.js";
|
|
7
8
|
import NodeManager from "./nodes/NodeManager.js";
|
|
8
9
|
import Pipeline from "./Pipeline.js";
|
|
9
10
|
import ProgrammableStage from "./ProgrammableStage.js";
|
|
@@ -21,9 +22,10 @@ declare class Pipelines extends DataMap {
|
|
|
21
22
|
* Constructs a new pipeline management component.
|
|
22
23
|
*
|
|
23
24
|
* @param {Backend} backend - The renderer's backend.
|
|
24
|
-
* @param {
|
|
25
|
+
* @param {NodeManager} nodes - Renderer component for managing nodes related logic.
|
|
26
|
+
* @param {Info} info - Renderer component for managing metrics and monitoring data.
|
|
25
27
|
*/
|
|
26
|
-
constructor(backend: Backend, nodes: NodeManager);
|
|
28
|
+
constructor(backend: Backend, nodes: NodeManager, info: Info);
|
|
27
29
|
/**
|
|
28
30
|
* The renderer's backend.
|
|
29
31
|
*
|
|
@@ -33,9 +35,15 @@ declare class Pipelines extends DataMap {
|
|
|
33
35
|
/**
|
|
34
36
|
* Renderer component for managing nodes related logic.
|
|
35
37
|
*
|
|
36
|
-
* @type {
|
|
38
|
+
* @type {NodeManager}
|
|
37
39
|
*/
|
|
38
40
|
nodes: NodeManager;
|
|
41
|
+
/**
|
|
42
|
+
* Renderer component for managing metrics and monitoring data.
|
|
43
|
+
*
|
|
44
|
+
* @type {Info}
|
|
45
|
+
*/
|
|
46
|
+
info: Info;
|
|
39
47
|
/**
|
|
40
48
|
* A references to the bindings management component.
|
|
41
49
|
* This reference will be set inside the `Bindings`
|
|
@@ -80,6 +88,14 @@ declare class Pipelines extends DataMap {
|
|
|
80
88
|
* @return {RenderObjectPipeline} The render pipeline.
|
|
81
89
|
*/
|
|
82
90
|
getForRender(renderObject: RenderObject, promises?: Promise<void>[] | null): RenderObjectPipeline;
|
|
91
|
+
/**
|
|
92
|
+
* Checks if the render pipeline for the given render object is ready for drawing.
|
|
93
|
+
* Returns false if the GPU pipeline is still being compiled asynchronously.
|
|
94
|
+
*
|
|
95
|
+
* @param {RenderObject} renderObject - The render object.
|
|
96
|
+
* @return {boolean} True if the pipeline is ready for drawing.
|
|
97
|
+
*/
|
|
98
|
+
isReady(renderObject: RenderObject): boolean;
|
|
83
99
|
/**
|
|
84
100
|
* Deletes the pipeline for the given render object.
|
|
85
101
|
*
|