@types/three 0.171.0 → 0.172.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/Addons.d.ts +0 -5
- three/examples/jsm/controls/ArcballControls.d.ts +1 -1
- three/examples/jsm/controls/OrbitControls.d.ts +5 -0
- three/examples/jsm/csm/CSMShadowNode.d.ts +2 -3
- three/examples/jsm/geometries/InstancedPointsGeometry.d.ts +13 -0
- three/examples/jsm/helpers/VertexNormalsHelper.d.ts +2 -0
- three/examples/jsm/lines/LineSegments2.d.ts +3 -1
- three/examples/jsm/modifiers/CurveModifier.d.ts +1 -1
- three/examples/jsm/modifiers/CurveModifierGPU.d.ts +1 -1
- three/examples/jsm/objects/InstancedPoints.d.ts +10 -0
- three/examples/jsm/postprocessing/OutlinePass.d.ts +1 -1
- three/examples/jsm/postprocessing/UnrealBloomPass.d.ts +1 -1
- three/examples/jsm/utils/ShadowMapViewer.d.ts +2 -2
- three/package.json +2 -2
- three/src/Three.Core.d.ts +2 -1
- three/src/Three.TSL.d.ts +9 -4
- three/src/Three.WebGPU.Nodes.d.ts +2 -2
- three/src/Three.WebGPU.d.ts +2 -2
- three/src/cameras/CubeCamera.d.ts +19 -2
- three/src/core/RenderTarget.d.ts +3 -5
- three/src/core/RenderTarget3D.d.ts +9 -0
- three/src/core/RenderTargetArray.d.ts +9 -0
- three/src/materials/Material.d.ts +3 -1
- three/src/materials/MeshDepthMaterial.d.ts +0 -5
- three/src/materials/MeshDistanceMaterial.d.ts +0 -5
- three/src/materials/nodes/Line2NodeMaterial.d.ts +1 -0
- three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +6 -6
- three/src/materials/nodes/NodeMaterial.d.ts +3 -0
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +56 -0
- three/src/nodes/Nodes.d.ts +1 -6
- three/src/nodes/TSL.d.ts +2 -3
- three/src/nodes/accessors/Arrays.d.ts +3 -2
- three/src/nodes/accessors/BufferAttributeNode.d.ts +117 -0
- three/src/nodes/accessors/BufferNode.d.ts +4 -4
- three/src/nodes/accessors/MaterialNode.d.ts +3 -3
- three/src/nodes/accessors/ModelNode.d.ts +10 -2
- three/src/nodes/accessors/ModelViewProjectionNode.d.ts +2 -6
- three/src/nodes/accessors/StorageBufferNode.d.ts +5 -1
- three/src/nodes/accessors/TextureNode.d.ts +5 -0
- three/src/nodes/accessors/UniformArrayNode.d.ts +3 -2
- three/src/nodes/core/Node.d.ts +237 -0
- three/src/nodes/core/NodeAttribute.d.ts +13 -0
- three/src/nodes/core/NodeBuilder.d.ts +1 -2
- three/src/nodes/core/NodeCache.d.ts +21 -0
- three/src/nodes/core/NodeParser.d.ts +11 -0
- three/src/nodes/core/NodeUniform.d.ts +28 -0
- three/src/nodes/core/NodeVar.d.ts +12 -0
- three/src/nodes/core/NodeVarying.d.ts +14 -0
- three/src/nodes/core/StructTypeNode.d.ts +19 -1
- three/src/nodes/core/UniformNode.d.ts +44 -0
- three/src/nodes/core/VaryingNode.d.ts +3 -0
- three/src/nodes/core/constants.d.ts +35 -0
- three/src/nodes/display/PassNode.d.ts +1 -1
- three/src/nodes/fog/Fog.d.ts +26 -0
- three/src/nodes/gpgpu/ComputeNode.d.ts +6 -1
- three/src/nodes/gpgpu/WorkgroupInfoNode.d.ts +2 -0
- three/src/nodes/lighting/ShadowBaseNode.d.ts +15 -0
- three/src/nodes/lighting/ShadowNode.d.ts +2 -1
- three/src/nodes/math/MathNode.d.ts +13 -4
- three/src/nodes/tsl/TSLCore.d.ts +48 -16
- three/src/nodes/utils/EquirectUVNode.d.ts +2 -2
- three/src/nodes/utils/LoopNode.d.ts +23 -2
- three/src/objects/ClippingGroup.d.ts +1 -1
- three/src/renderers/WebGLRenderer.d.ts +8 -8
- three/src/renderers/common/Animation.d.ts +30 -0
- three/src/renderers/common/Attributes.d.ts +31 -0
- three/src/renderers/common/Backend.d.ts +11 -0
- three/src/renderers/common/Background.d.ts +22 -0
- three/src/renderers/common/BindGroup.d.ts +15 -0
- three/src/renderers/common/Binding.d.ts +24 -0
- three/src/renderers/common/Bindings.d.ts +54 -0
- three/src/renderers/common/Buffer.d.ts +31 -0
- three/src/renderers/common/BufferUtils.d.ts +26 -0
- three/src/renderers/common/BundleGroup.d.ts +22 -0
- three/src/renderers/common/ChainMap.d.ts +31 -1
- three/src/renderers/common/ClippingContext.d.ts +45 -0
- three/src/renderers/common/Color4.d.ts +36 -0
- three/src/renderers/common/ComputePipeline.d.ts +12 -0
- three/src/renderers/common/CubeRenderTarget.d.ts +13 -0
- three/src/renderers/common/DataMap.d.ts +30 -0
- three/src/renderers/common/Geometries.d.ts +52 -0
- three/src/renderers/common/Info.d.ts +27 -0
- three/src/renderers/common/Pipeline.d.ts +11 -0
- three/src/renderers/common/Pipelines.d.ts +104 -0
- three/src/renderers/common/ProgrammableStage.d.ts +19 -1
- three/src/renderers/common/RenderBundle.d.ts +15 -4
- three/src/renderers/common/RenderBundles.d.ts +20 -2
- three/src/renderers/common/RenderContext.d.ts +22 -0
- three/src/renderers/common/RenderContexts.d.ts +42 -3
- three/src/renderers/common/RenderList.d.ts +85 -0
- three/src/renderers/common/RenderLists.d.ts +21 -0
- three/src/renderers/common/RenderObject.d.ts +152 -1
- three/src/renderers/common/RenderObjects.d.ts +53 -0
- three/src/renderers/common/RenderPipeline.d.ts +13 -0
- three/src/renderers/common/Renderer.d.ts +583 -6
- three/src/renderers/common/{PostProcessingUtils.d.ts → RendererUtils.d.ts} +16 -4
- three/src/renderers/common/StorageBufferAttribute.d.ts +1 -1
- three/src/renderers/common/Textures.d.ts +66 -0
- three/src/renderers/common/Uniform.d.ts +106 -0
- three/src/renderers/common/UniformBuffer.d.ts +12 -0
- three/src/renderers/common/UniformsGroup.d.ts +103 -0
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +30 -0
- three/src/renderers/common/nodes/NodeLibrary.d.ts +71 -0
- three/src/renderers/common/nodes/NodeUniform.d.ts +154 -0
- three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +14 -2
- three/src/renderers/common/nodes/Nodes.d.ts +185 -11
- three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +10 -0
- three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +11 -0
- three/src/textures/DataTexture.d.ts +2 -2
- three/src/textures/Texture.d.ts +3 -0
- three/examples/jsm/animation/MMDAnimationHelper.d.ts +0 -99
- three/examples/jsm/animation/MMDPhysics.d.ts +0 -128
- three/examples/jsm/exporters/MMDExporter.d.ts +0 -11
- three/examples/jsm/loaders/MMDLoader.d.ts +0 -60
- three/examples/jsm/shaders/MMDToonShader.d.ts +0 -15
- three/src/Three.Legacy.d.ts +0 -20
- three/src/nodes/core/UniformGroup.d.ts +0 -7
- three/src/nodes/fog/FogExp2Node.d.ts +0 -14
- three/src/nodes/fog/FogNode.d.ts +0 -20
- three/src/nodes/fog/FogRangeNode.d.ts +0 -19
|
@@ -7,6 +7,12 @@ import DataMap from "./DataMap.js";
|
|
|
7
7
|
interface Data {
|
|
8
8
|
version?: number | undefined;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* This renderer module manages geometry attributes.
|
|
12
|
+
*
|
|
13
|
+
* @private
|
|
14
|
+
* @augments DataMap
|
|
15
|
+
*/
|
|
10
16
|
declare class Attributes extends DataMap<{
|
|
11
17
|
attribute: {
|
|
12
18
|
key: BufferAttribute | InterleavedBufferAttribute;
|
|
@@ -14,9 +20,34 @@ declare class Attributes extends DataMap<{
|
|
|
14
20
|
};
|
|
15
21
|
}> {
|
|
16
22
|
backend: Backend;
|
|
23
|
+
/**
|
|
24
|
+
* Constructs a new attribute management component.
|
|
25
|
+
*
|
|
26
|
+
* @param {Backend} backend - The renderer's backend.
|
|
27
|
+
*/
|
|
17
28
|
constructor(backend: Backend);
|
|
29
|
+
/**
|
|
30
|
+
* Deletes the data for the given attribute.
|
|
31
|
+
*
|
|
32
|
+
* @param {BufferAttribute} attribute - The attribute.
|
|
33
|
+
* @return {Object} The deleted attribute data.
|
|
34
|
+
*/
|
|
18
35
|
delete(attribute: BufferAttribute | InterleavedBufferAttribute): Data;
|
|
36
|
+
/**
|
|
37
|
+
* Updates the given attribute. This method creates attribute buffers
|
|
38
|
+
* for new attributes and updates data for existing ones.
|
|
39
|
+
*
|
|
40
|
+
* @param {BufferAttribute} attribute - The attribute to update.
|
|
41
|
+
* @param {Number} type - The attribute type.
|
|
42
|
+
*/
|
|
19
43
|
update(attribute: BufferAttribute | InterleavedBufferAttribute, type: AttributeType): void;
|
|
44
|
+
/**
|
|
45
|
+
* Utility method for handling interleaved buffer attributes correctly.
|
|
46
|
+
* To process them, their `InterleavedBuffer` is returned.
|
|
47
|
+
*
|
|
48
|
+
* @param {BufferAttribute} attribute - The attribute.
|
|
49
|
+
* @return {BufferAttribute|InterleavedBuffer}
|
|
50
|
+
*/
|
|
20
51
|
_getBufferAttribute(attribute: BufferAttribute | InterleavedBufferAttribute): BufferAttribute | InterleavedBuffer;
|
|
21
52
|
}
|
|
22
53
|
export default Attributes;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { CoordinateSystem } from "../../constants.js";
|
|
2
2
|
import Renderer from "./Renderer.js";
|
|
3
3
|
|
|
4
|
+
declare module "../../core/Object3D.js" {
|
|
5
|
+
interface Object3D {
|
|
6
|
+
// See https://github.com/mrdoob/three.js/pull/28683
|
|
7
|
+
count?: number | undefined;
|
|
8
|
+
// See https://github.com/mrdoob/three.js/pull/26335
|
|
9
|
+
occlusionTest?: boolean | undefined;
|
|
10
|
+
// https://github.com/mrdoob/three.js/pull/29386
|
|
11
|
+
static?: boolean | undefined;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
4
15
|
export interface BackendParameters {
|
|
5
16
|
canvas?: HTMLCanvasElement | undefined;
|
|
6
17
|
}
|
|
@@ -9,6 +9,12 @@ interface SceneData {
|
|
|
9
9
|
backgroundMesh?: Mesh;
|
|
10
10
|
backgroundCacheKey: string;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* This renderer module manages the background.
|
|
14
|
+
*
|
|
15
|
+
* @private
|
|
16
|
+
* @augments DataMap
|
|
17
|
+
*/
|
|
12
18
|
declare class Background extends DataMap<{
|
|
13
19
|
scene: {
|
|
14
20
|
key: Scene;
|
|
@@ -17,7 +23,23 @@ declare class Background extends DataMap<{
|
|
|
17
23
|
}> {
|
|
18
24
|
renderer: Renderer;
|
|
19
25
|
nodes: Nodes;
|
|
26
|
+
/**
|
|
27
|
+
* Constructs a new background management component.
|
|
28
|
+
*
|
|
29
|
+
* @param {Renderer} renderer - The renderer.
|
|
30
|
+
* @param {Nodes} nodes - Renderer component for managing nodes related logic.
|
|
31
|
+
*/
|
|
20
32
|
constructor(renderer: Renderer, nodes: Nodes);
|
|
33
|
+
/**
|
|
34
|
+
* Updates the background for the given scene. Depending on how `Scene.background`
|
|
35
|
+
* or `Scene.backgroundNode` are configured, this method might configure a simple clear
|
|
36
|
+
* or add a mesh to the render list for rendering the background as a textured plane
|
|
37
|
+
* or skybox.
|
|
38
|
+
*
|
|
39
|
+
* @param {Scene} scene - The scene.
|
|
40
|
+
* @param {RenderList} renderList - The current render list.
|
|
41
|
+
* @param {RenderContext} renderContext - The current render context.
|
|
42
|
+
*/
|
|
21
43
|
update(scene: Scene, renderList: RenderList, renderContext: RenderContext): void;
|
|
22
44
|
}
|
|
23
45
|
export default Background;
|
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import Binding from "./Binding.js";
|
|
2
2
|
import NodeUniformsGroup from "./nodes/NodeUniformsGroup.js";
|
|
3
|
+
/**
|
|
4
|
+
* A bind group represents a collection of bindings and thus a collection
|
|
5
|
+
* or resources. Bind groups are assigned to pipelines to provide them
|
|
6
|
+
* with the required resources (like uniform buffers or textures).
|
|
7
|
+
*
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
3
10
|
declare class BindGroup {
|
|
4
11
|
name: string;
|
|
5
12
|
bindings: NodeUniformsGroup[] | Binding[];
|
|
6
13
|
index: number;
|
|
7
14
|
bindingsReference: NodeUniformsGroup[] | BindGroup;
|
|
8
15
|
id: number;
|
|
16
|
+
/**
|
|
17
|
+
* Constructs a new bind group.
|
|
18
|
+
*
|
|
19
|
+
* @param {String} name - The bind group's name.
|
|
20
|
+
* @param {Array<Binding>} bindings - An array of bindings.
|
|
21
|
+
* @param {Number} index - The group index.
|
|
22
|
+
* @param {Array<Binding>} bindingsReference - An array of reference bindings.
|
|
23
|
+
*/
|
|
9
24
|
constructor(
|
|
10
25
|
name?: string,
|
|
11
26
|
bindings?: NodeUniformsGroup[],
|
|
@@ -1,8 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A binding represents the connection between a resource (like a texture, sampler
|
|
3
|
+
* or uniform buffer) and the resource definition in a shader stage.
|
|
4
|
+
*
|
|
5
|
+
* This module is an abstract base class for all concrete bindings types.
|
|
6
|
+
*
|
|
7
|
+
* @abstract
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
1
10
|
declare class Binding {
|
|
2
11
|
name: string;
|
|
3
12
|
visibility: number;
|
|
13
|
+
/**
|
|
14
|
+
* Constructs a new binding.
|
|
15
|
+
*
|
|
16
|
+
* @param {String} [name=''] - The binding's name.
|
|
17
|
+
*/
|
|
4
18
|
constructor(name?: string);
|
|
19
|
+
/**
|
|
20
|
+
* Makes sure binding's resource is visible for the given shader stage.
|
|
21
|
+
*
|
|
22
|
+
* @param {Number} visibility - The shader stage.
|
|
23
|
+
*/
|
|
5
24
|
setVisibility(visibility: number): void;
|
|
25
|
+
/**
|
|
26
|
+
* Clones the binding.
|
|
27
|
+
*
|
|
28
|
+
* @return {Binding} The cloned binding.
|
|
29
|
+
*/
|
|
6
30
|
clone(): Binding & this;
|
|
7
31
|
}
|
|
8
32
|
export default Binding;
|
|
@@ -11,7 +11,23 @@ import Textures from "./Textures.js";
|
|
|
11
11
|
interface BindGroupData {
|
|
12
12
|
bindGroup?: BindGroup | undefined;
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* This renderer module manages the bindings of the renderer.
|
|
16
|
+
*
|
|
17
|
+
* @private
|
|
18
|
+
* @augments DataMap
|
|
19
|
+
*/
|
|
14
20
|
declare class Bindings extends DataMap<{
|
|
21
|
+
/**
|
|
22
|
+
* Constructs a new bindings management component.
|
|
23
|
+
*
|
|
24
|
+
* @param {Backend} backend - The renderer's backend.
|
|
25
|
+
* @param {Nodes} nodes - Renderer component for managing nodes related logic.
|
|
26
|
+
* @param {Textures} textures - Renderer component for managing textures.
|
|
27
|
+
* @param {Attributes} attributes - Renderer component for managing attributes.
|
|
28
|
+
* @param {Pipelines} pipelines - Renderer component for managing pipelines.
|
|
29
|
+
* @param {Info} info - Renderer component for managing metrics and monitoring data.
|
|
30
|
+
*/
|
|
15
31
|
bindGroup: {
|
|
16
32
|
key: BindGroup;
|
|
17
33
|
value: BindGroupData;
|
|
@@ -31,12 +47,50 @@ declare class Bindings extends DataMap<{
|
|
|
31
47
|
pipelines: Pipelines,
|
|
32
48
|
info: Info,
|
|
33
49
|
);
|
|
50
|
+
/**
|
|
51
|
+
* Returns the bind groups for the given render object.
|
|
52
|
+
*
|
|
53
|
+
* @param {RenderObject} renderObject - The render object.
|
|
54
|
+
* @return {Array<BindGroup>} The bind groups.
|
|
55
|
+
*/
|
|
34
56
|
getForRender(renderObject: RenderObject): BindGroup[];
|
|
57
|
+
/**
|
|
58
|
+
* Returns the bind groups for the given compute node.
|
|
59
|
+
*
|
|
60
|
+
* @param {Node} computeNode - The compute node.
|
|
61
|
+
* @return {Array<BindGroup>} The bind groups.
|
|
62
|
+
*/
|
|
35
63
|
getForCompute(computeNode: ComputeNode): BindGroup[];
|
|
64
|
+
/**
|
|
65
|
+
* Updates the bindings for the given compute node.
|
|
66
|
+
*
|
|
67
|
+
* @param {Node} computeNode - The compute node.
|
|
68
|
+
*/
|
|
36
69
|
updateForCompute(computeNode: ComputeNode): void;
|
|
70
|
+
/**
|
|
71
|
+
* Updates the bindings for the given render object.
|
|
72
|
+
*
|
|
73
|
+
* @param {RenderObject} renderObject - The render object.
|
|
74
|
+
*/
|
|
37
75
|
updateForRender(renderObject: RenderObject): void;
|
|
76
|
+
/**
|
|
77
|
+
* Updates the given array of bindings.
|
|
78
|
+
*
|
|
79
|
+
* @param {Array<BindGroup>} bindings - The bind groups.
|
|
80
|
+
*/
|
|
38
81
|
_updateBindings(bindings: BindGroup[]): void;
|
|
82
|
+
/**
|
|
83
|
+
* Initializes the given bind group.
|
|
84
|
+
*
|
|
85
|
+
* @param {BindGroup} bindGroup - The bind group to initialize.
|
|
86
|
+
*/
|
|
39
87
|
_init(bindGroup: BindGroup): void;
|
|
88
|
+
/**
|
|
89
|
+
* Updates the given bind group.
|
|
90
|
+
*
|
|
91
|
+
* @param {BindGroup} bindGroup - The bind group to update.
|
|
92
|
+
* @param {Array<BindGroup>} bindings - The bind groups.
|
|
93
|
+
*/
|
|
40
94
|
_update(bindGroup: BindGroup, bindings: BindGroup[]): void;
|
|
41
95
|
}
|
|
42
96
|
export default Bindings;
|
|
@@ -1,11 +1,42 @@
|
|
|
1
1
|
import Binding from "./Binding.js";
|
|
2
|
+
/**
|
|
3
|
+
* Represents a buffer binding type.
|
|
4
|
+
*
|
|
5
|
+
* @private
|
|
6
|
+
* @abstract
|
|
7
|
+
* @augments Binding
|
|
8
|
+
*/
|
|
2
9
|
declare class Buffer extends Binding {
|
|
3
10
|
readonly isBuffer: true;
|
|
4
11
|
bytesPerElement: number;
|
|
5
12
|
_buffer: Float32Array | null;
|
|
13
|
+
/**
|
|
14
|
+
* Constructs a new buffer.
|
|
15
|
+
*
|
|
16
|
+
* @param {String} name - The buffer's name.
|
|
17
|
+
* @param {TypedArray} [buffer=null] - The buffer.
|
|
18
|
+
*/
|
|
6
19
|
constructor(name?: string, buffer?: Float32Array | null);
|
|
20
|
+
/**
|
|
21
|
+
* The buffer's byte length.
|
|
22
|
+
*
|
|
23
|
+
* @type {Number}
|
|
24
|
+
* @readonly
|
|
25
|
+
*/
|
|
7
26
|
get byteLength(): number;
|
|
27
|
+
/**
|
|
28
|
+
* A reference to the internal buffer.
|
|
29
|
+
*
|
|
30
|
+
* @type {Float32Array}
|
|
31
|
+
* @readonly
|
|
32
|
+
*/
|
|
8
33
|
get buffer(): Float32Array | null;
|
|
34
|
+
/**
|
|
35
|
+
* Updates the binding.
|
|
36
|
+
*
|
|
37
|
+
* @return {Boolean} Whether the buffer has been updated and must be
|
|
38
|
+
* uploaded to the GPU.
|
|
39
|
+
*/
|
|
9
40
|
update(): boolean;
|
|
10
41
|
}
|
|
11
42
|
export default Buffer;
|
|
@@ -1,4 +1,30 @@
|
|
|
1
|
+
/** @module BufferUtils **/
|
|
2
|
+
/**
|
|
3
|
+
* This function is usually called with the length in bytes of an array buffer.
|
|
4
|
+
* It returns an padded value whic ensure chunk size alignment according to STD140 layout.
|
|
5
|
+
*
|
|
6
|
+
* @function
|
|
7
|
+
* @param {Number} floatLength - The buffer length.
|
|
8
|
+
* @return {Number} The padded length.
|
|
9
|
+
*/
|
|
1
10
|
declare function getFloatLength(floatLength: number): number;
|
|
11
|
+
/**
|
|
12
|
+
* Given the count of vectors and their vector length, this function computes
|
|
13
|
+
* a total length in bytes with buffer alignment according to STD140 layout.
|
|
14
|
+
*
|
|
15
|
+
* @function
|
|
16
|
+
* @param {Number} count - The number of vectors.
|
|
17
|
+
* @param {Number} [vectorLength=4] - The vector length.
|
|
18
|
+
* @return {Number} The padded length.
|
|
19
|
+
*/
|
|
2
20
|
declare function getVectorLength(count: number, vectorLength?: number): number;
|
|
21
|
+
/**
|
|
22
|
+
* This function is called with a vector length and ensure the computed length
|
|
23
|
+
* matches a predefined stride (in this case `4`).
|
|
24
|
+
*
|
|
25
|
+
* @function
|
|
26
|
+
* @param {Number} vectorLength - The vector length.
|
|
27
|
+
* @return {Number} The padded length.
|
|
28
|
+
*/
|
|
3
29
|
declare function getStrideLength(vectorLength: number): number;
|
|
4
30
|
export { getFloatLength, getStrideLength, getVectorLength };
|
|
@@ -1,10 +1,32 @@
|
|
|
1
1
|
import { Group } from "../../objects/Group.js";
|
|
2
|
+
/**
|
|
3
|
+
* A specialized group which eanbles applications access to the
|
|
4
|
+
* Render Bundle API of WebGPU. The group with all its descendant nodes
|
|
5
|
+
* are considered as one render bundle and processed as such by
|
|
6
|
+
* the renderer.
|
|
7
|
+
*
|
|
8
|
+
* This module is only fully supported by `WebGPURenderer` with a WebGPU backend.
|
|
9
|
+
* With a WebGL backend, the group can technically be rendered but without
|
|
10
|
+
* any performance improvements.
|
|
11
|
+
*
|
|
12
|
+
* @augments Group
|
|
13
|
+
*/
|
|
2
14
|
declare class BundleGroup extends Group {
|
|
3
15
|
readonly isBundleGroup: true;
|
|
4
16
|
readonly type: string;
|
|
5
17
|
static: boolean;
|
|
6
18
|
version: number;
|
|
19
|
+
/**
|
|
20
|
+
* Constructs a new bundle group.
|
|
21
|
+
*/
|
|
7
22
|
constructor();
|
|
23
|
+
/**
|
|
24
|
+
* Set this property to `true` when the bundle group has changed.
|
|
25
|
+
*
|
|
26
|
+
* @type {Boolean}
|
|
27
|
+
* @default false
|
|
28
|
+
* @param {Boolean} value
|
|
29
|
+
*/
|
|
8
30
|
set needsUpdate(value: boolean);
|
|
9
31
|
}
|
|
10
32
|
export default BundleGroup;
|
|
@@ -1,9 +1,39 @@
|
|
|
1
1
|
type RecursiveWeakMap<K extends readonly object[], V> = WeakMap<K[number], V | RecursiveWeakMap<K, V>>;
|
|
2
|
+
/**
|
|
3
|
+
* Data structure for the renderer. It allows defining values
|
|
4
|
+
* with chained, hierarchical keys. Keys are meant to be
|
|
5
|
+
* objects since the module internally works with Weak Maps
|
|
6
|
+
* for perforamnce reasons.
|
|
7
|
+
*
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
2
10
|
export default class ChainMap<K extends readonly object[], V> {
|
|
3
11
|
weakMap: RecursiveWeakMap<K, V>;
|
|
12
|
+
/**
|
|
13
|
+
* Constructs a new chained map.
|
|
14
|
+
*/
|
|
4
15
|
constructor();
|
|
16
|
+
/**
|
|
17
|
+
* Returns the value for the given array of keys.
|
|
18
|
+
*
|
|
19
|
+
* @param {Array<Object>} keys - List of keys.
|
|
20
|
+
* @return {Any} The value. Returns `undefined` if no value was found.
|
|
21
|
+
*/
|
|
5
22
|
get(keys: K): V | undefined;
|
|
6
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Sets the value for the given keys.
|
|
25
|
+
*
|
|
26
|
+
* @param {Array<Object>} keys - List of keys.
|
|
27
|
+
* @param {Any} value - The value to set.
|
|
28
|
+
* @return {ChainMap} A reference to this chain map.
|
|
29
|
+
*/
|
|
30
|
+
set(keys: K, value: V): this;
|
|
31
|
+
/**
|
|
32
|
+
* Deletes a value for the given keys.
|
|
33
|
+
*
|
|
34
|
+
* @param {Array<Object>} keys - The keys.
|
|
35
|
+
* @return {Boolean} Returns `true` if the value has been removed successfully and `false` if the value has not be found.
|
|
36
|
+
*/
|
|
7
37
|
delete(keys: K): boolean;
|
|
8
38
|
}
|
|
9
39
|
export {};
|
|
@@ -5,6 +5,14 @@ import { Plane } from "../../math/Plane.js";
|
|
|
5
5
|
import { Vector4 } from "../../math/Vector4.js";
|
|
6
6
|
import { ClippingGroup } from "../../objects/ClippingGroup.js";
|
|
7
7
|
import { Scene } from "../../scenes/Scene.js";
|
|
8
|
+
/**
|
|
9
|
+
* Represents the state that is used to perform clipping via clipping planes.
|
|
10
|
+
* There is a default clipping context for each render context. When the
|
|
11
|
+
* scene holds instances of `ClippingGroup`, there will be a context for each
|
|
12
|
+
* group.
|
|
13
|
+
*
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
8
16
|
declare class ClippingContext {
|
|
9
17
|
version: number;
|
|
10
18
|
clipIntersection: boolean | null;
|
|
@@ -16,11 +24,48 @@ declare class ClippingContext {
|
|
|
16
24
|
shadowPass: boolean;
|
|
17
25
|
viewMatrix?: Matrix4;
|
|
18
26
|
parentVersion: number | null;
|
|
27
|
+
/**
|
|
28
|
+
* Constructs a new clipping context.
|
|
29
|
+
*
|
|
30
|
+
* @param {ClippingContext?} [parentContext=null] - A reference to the parent clipping context.
|
|
31
|
+
*/
|
|
19
32
|
constructor(parentContext?: ClippingContext | null);
|
|
33
|
+
/**
|
|
34
|
+
* Projects the given source clipping planes and writes the result into the
|
|
35
|
+
* destination array.
|
|
36
|
+
*
|
|
37
|
+
* @param {Array<Plane>} source - The source clipping planes.
|
|
38
|
+
* @param {Array<Vector4>} destination - The destination.
|
|
39
|
+
* @param {Number} offset - The offset.
|
|
40
|
+
*/
|
|
20
41
|
projectPlanes(source: readonly Plane[], destination: readonly Vector4[], offset: number): void;
|
|
42
|
+
/**
|
|
43
|
+
* Updates the root clipping context of a scene.
|
|
44
|
+
*
|
|
45
|
+
* @param {Scene} scene - The scene.
|
|
46
|
+
* @param {Camera} camera - The camera that is used to render the scene.
|
|
47
|
+
*/
|
|
21
48
|
updateGlobal(scene: Scene, camera: Camera): void;
|
|
49
|
+
/**
|
|
50
|
+
* Updates the clipping context.
|
|
51
|
+
*
|
|
52
|
+
* @param {ClippingContext} parentContext - The parent context.
|
|
53
|
+
* @param {ClippingGroup} clippingGroup - The clipping group this context belongs to.
|
|
54
|
+
*/
|
|
22
55
|
update(parentContext: ClippingContext, clippingGroup: ClippingGroup): void;
|
|
56
|
+
/**
|
|
57
|
+
* Returns a clipping context for the given clipping group.
|
|
58
|
+
*
|
|
59
|
+
* @param {ClippingGroup} clippingGroup - The clipping group.
|
|
60
|
+
* @return {ClippingContext} The clipping context.
|
|
61
|
+
*/
|
|
23
62
|
getGroupContext(clippingGroup: ClippingGroup): ClippingContext;
|
|
63
|
+
/**
|
|
64
|
+
* The count of union clipping planes.
|
|
65
|
+
*
|
|
66
|
+
* @type {Number}
|
|
67
|
+
* @readonly
|
|
68
|
+
*/
|
|
24
69
|
get unionClippingCount(): number;
|
|
25
70
|
}
|
|
26
71
|
export default ClippingContext;
|
|
@@ -1,10 +1,46 @@
|
|
|
1
1
|
import { Color, ColorRepresentation } from "../../math/Color.js";
|
|
2
|
+
/**
|
|
3
|
+
* A four-component version of {@link Color} which is internally
|
|
4
|
+
* used by the renderer to represents clear color with alpha as
|
|
5
|
+
* one object.
|
|
6
|
+
*
|
|
7
|
+
* @private
|
|
8
|
+
* @augments Color
|
|
9
|
+
*/
|
|
2
10
|
declare class Color4 extends Color {
|
|
3
11
|
a: number;
|
|
12
|
+
/**
|
|
13
|
+
* Constructs a new four-component color.
|
|
14
|
+
*
|
|
15
|
+
* @param {Number|String} r - The red value.
|
|
16
|
+
* @param {Number} g - The green value.
|
|
17
|
+
* @param {Number} b - The blue value.
|
|
18
|
+
* @param {Number} [a=1] - The alpha value.
|
|
19
|
+
*/
|
|
4
20
|
constructor(color?: ColorRepresentation);
|
|
5
21
|
constructor(r: number, g: number, b: number, a?: number);
|
|
22
|
+
/**
|
|
23
|
+
* Overwrites the default to honor alpha.
|
|
24
|
+
*
|
|
25
|
+
* @param {Number|String} r - The red value.
|
|
26
|
+
* @param {Number} g - The green value.
|
|
27
|
+
* @param {Number} b - The blue value.
|
|
28
|
+
* @param {Number} [a=1] - The alpha value.
|
|
29
|
+
* @return {Color4} A reference to this object.
|
|
30
|
+
*/
|
|
6
31
|
set(...args: [color: ColorRepresentation] | [r: number, g: number, b: number, a?: number]): this;
|
|
32
|
+
/**
|
|
33
|
+
* Overwrites the default to honor alpha.
|
|
34
|
+
*
|
|
35
|
+
* @param {Color4} color - The color to copy.
|
|
36
|
+
* @return {Color4} A reference to this object.
|
|
37
|
+
*/
|
|
7
38
|
copy(color: Color): this;
|
|
39
|
+
/**
|
|
40
|
+
* Overwrites the default to honor alpha.
|
|
41
|
+
*
|
|
42
|
+
* @return {Color4} The cloned color.
|
|
43
|
+
*/
|
|
8
44
|
clone(): this;
|
|
9
45
|
}
|
|
10
46
|
export default Color4;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import Pipeline from "./Pipeline.js";
|
|
2
2
|
import ProgrammableStage from "./ProgrammableStage.js";
|
|
3
|
+
/**
|
|
4
|
+
* Class for representing compute pipelines.
|
|
5
|
+
*
|
|
6
|
+
* @private
|
|
7
|
+
* @augments Pipeline
|
|
8
|
+
*/
|
|
3
9
|
declare class ComputePipeline extends Pipeline {
|
|
4
10
|
computeProgram: ProgrammableStage;
|
|
5
11
|
readonly isComputePipeline: true;
|
|
12
|
+
/**
|
|
13
|
+
* Constructs a new render pipeline.
|
|
14
|
+
*
|
|
15
|
+
* @param {String} cacheKey - The pipeline's cache key.
|
|
16
|
+
* @param {ProgrammableStage} computeProgram - The pipeline's compute shader.
|
|
17
|
+
*/
|
|
6
18
|
constructor(cacheKey: string, computeProgram: ProgrammableStage);
|
|
7
19
|
}
|
|
8
20
|
export default ComputePipeline;
|
|
@@ -2,9 +2,22 @@ import { RenderTargetOptions } from "../../core/RenderTarget.js";
|
|
|
2
2
|
import { WebGLCubeRenderTarget } from "../../renderers/WebGLCubeRenderTarget.js";
|
|
3
3
|
import { Texture } from "../../textures/Texture.js";
|
|
4
4
|
import { WebGLRenderer } from "../WebGLRenderer.js";
|
|
5
|
+
/**
|
|
6
|
+
* This class represents a cube render target. It is a special version
|
|
7
|
+
* of `WebGLCubeRenderTarget` which is compatible with `WebGPURenderer`.
|
|
8
|
+
*
|
|
9
|
+
* @augments WebGLCubeRenderTarget
|
|
10
|
+
*/
|
|
5
11
|
declare class CubeRenderTarget extends WebGLCubeRenderTarget {
|
|
6
12
|
readonly isCubeRenderTarget: true;
|
|
7
13
|
constructor(size?: number, options?: RenderTargetOptions);
|
|
14
|
+
/**
|
|
15
|
+
* Converts the given equirectangular texture to a cube map.
|
|
16
|
+
*
|
|
17
|
+
* @param {Renderer} renderer - The renderer.
|
|
18
|
+
* @param {Texture} texture - The equirectangular texture.
|
|
19
|
+
* @return {CubeRenderTarget} A reference to this cube render target.
|
|
20
|
+
*/
|
|
8
21
|
fromEquirectangularTexture(renderer: WebGLRenderer, texture: Texture): this;
|
|
9
22
|
}
|
|
10
23
|
export default CubeRenderTarget;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data structure for the renderer. It is intended to manage
|
|
3
|
+
* data of objects in dictionaries.
|
|
4
|
+
*
|
|
5
|
+
* @private
|
|
6
|
+
*/
|
|
1
7
|
declare class DataMap<
|
|
2
8
|
M extends {
|
|
3
9
|
[key: string]: {
|
|
@@ -7,14 +13,38 @@ declare class DataMap<
|
|
|
7
13
|
},
|
|
8
14
|
> {
|
|
9
15
|
data: WeakMap<M[keyof M]["key"], M[keyof M]["value"]>;
|
|
16
|
+
/**
|
|
17
|
+
* Constructs a new data map.
|
|
18
|
+
*/
|
|
10
19
|
constructor();
|
|
20
|
+
/**
|
|
21
|
+
* Returns the dictionary for the given object.
|
|
22
|
+
*
|
|
23
|
+
* @param {Object} object - The object.
|
|
24
|
+
* @return {Object} The dictionary.
|
|
25
|
+
*/
|
|
11
26
|
get<K extends M[keyof M]["key"]>(object: K): Extract<M[keyof M], {
|
|
12
27
|
key: K;
|
|
13
28
|
}>["value"];
|
|
29
|
+
/**
|
|
30
|
+
* Deletes the dictionary for the given object.
|
|
31
|
+
*
|
|
32
|
+
* @param {Object} object - The object.
|
|
33
|
+
* @return {Object?} The deleted dictionary.
|
|
34
|
+
*/
|
|
14
35
|
delete<K extends M[keyof M]["key"]>(object: K): Extract<M[keyof M], {
|
|
15
36
|
key: K;
|
|
16
37
|
}>["value"];
|
|
38
|
+
/**
|
|
39
|
+
* Returns `true` if the given object has a dictionary defined.
|
|
40
|
+
*
|
|
41
|
+
* @param {Object} object - The object to test.
|
|
42
|
+
* @return {Boolean} Whether a dictionary is defined or not.
|
|
43
|
+
*/
|
|
17
44
|
has(object: M[keyof M]["key"]): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Frees internal resources.
|
|
47
|
+
*/
|
|
18
48
|
dispose(): void;
|
|
19
49
|
}
|
|
20
50
|
export default DataMap;
|
|
@@ -10,6 +10,12 @@ import RenderObject from "./RenderObject.js";
|
|
|
10
10
|
interface GeometryData {
|
|
11
11
|
initialized?: boolean | undefined;
|
|
12
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* This renderer module manages geometries.
|
|
15
|
+
*
|
|
16
|
+
* @private
|
|
17
|
+
* @augments DataMap
|
|
18
|
+
*/
|
|
13
19
|
declare class Geometries extends DataMap<{
|
|
14
20
|
geometry: {
|
|
15
21
|
key: BufferGeometry;
|
|
@@ -20,13 +26,59 @@ declare class Geometries extends DataMap<{
|
|
|
20
26
|
info: Info;
|
|
21
27
|
wireframes: WeakMap<BufferGeometry, BufferAttribute>;
|
|
22
28
|
attributeCall: WeakMap<BufferAttribute | InterleavedBufferAttribute | InterleavedBuffer, number>;
|
|
29
|
+
/**
|
|
30
|
+
* Constructs a new geometry management component.
|
|
31
|
+
*
|
|
32
|
+
* @param {Attributes} attributes - Renderer component for managing attributes.
|
|
33
|
+
* @param {Info} info - Renderer component for managing metrics and monitoring data.
|
|
34
|
+
*/
|
|
23
35
|
constructor(attributes: Attributes, info: Info);
|
|
36
|
+
/**
|
|
37
|
+
* Returns `true` if the given render object has an initialized geometry.
|
|
38
|
+
*
|
|
39
|
+
* @param {RenderObject} renderObject - The render object.
|
|
40
|
+
* @return {Boolean} Whether if the given render object has an initialized geometry or not.
|
|
41
|
+
*/
|
|
24
42
|
has(renderObject: RenderObject | BufferGeometry): boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Prepares the geometry of the given render object for rendering.
|
|
45
|
+
*
|
|
46
|
+
* @param {RenderObject} renderObject - The render object.
|
|
47
|
+
*/
|
|
25
48
|
updateForRender(renderObject: RenderObject): void;
|
|
49
|
+
/**
|
|
50
|
+
* Initializes the geometry of the given render object.
|
|
51
|
+
*
|
|
52
|
+
* @param {RenderObject} renderObject - The render object.
|
|
53
|
+
*/
|
|
26
54
|
initGeometry(renderObject: RenderObject): void;
|
|
55
|
+
/**
|
|
56
|
+
* Updates the geometry attributes of the given render object.
|
|
57
|
+
*
|
|
58
|
+
* @param {RenderObject} renderObject - The render object.
|
|
59
|
+
*/
|
|
27
60
|
updateAttributes(renderObject: RenderObject): void;
|
|
61
|
+
/**
|
|
62
|
+
* Updates the given attribute.
|
|
63
|
+
*
|
|
64
|
+
* @param {BufferAttribute} attribute - The attribute to update.
|
|
65
|
+
* @param {Number} type - The attribute type.
|
|
66
|
+
*/
|
|
28
67
|
updateAttribute(attribute: BufferAttribute | InterleavedBufferAttribute, type: AttributeType): void;
|
|
68
|
+
/**
|
|
69
|
+
* Returns the indirect buffer attribute of the given render object.
|
|
70
|
+
*
|
|
71
|
+
* @param {RenderObject} renderObject - The render object.
|
|
72
|
+
* @return {BufferAttribute?} The indirect attribute. `null` if no indirect drawing is used.
|
|
73
|
+
*/
|
|
29
74
|
getIndirect(renderObject: RenderObject): import("./IndirectStorageBufferAttribute.js").default | null;
|
|
75
|
+
/**
|
|
76
|
+
* Returns the index of the given render object's geometry. This is implemented
|
|
77
|
+
* in a method to return a wireframe index if necessary.
|
|
78
|
+
*
|
|
79
|
+
* @param {RenderObject} renderObject - The render object.
|
|
80
|
+
* @return {BufferAttribute?} The index. Returns `null` for non-indexed geometries.
|
|
81
|
+
*/
|
|
30
82
|
getIndex(renderObject: RenderObject): BufferAttribute | null;
|
|
31
83
|
}
|
|
32
84
|
export default Geometries;
|