@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
|
@@ -186,6 +186,7 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
|
|
|
186
186
|
|
|
187
187
|
/**
|
|
188
188
|
* Sets the given local transformation matrix to the defined instance.
|
|
189
|
+
* Negatively scaled matrices are not supported.
|
|
189
190
|
* @param instanceId The id of an instance to set the matrix of.
|
|
190
191
|
* @param matrix A 4x4 matrix representing the local transformation of a single instance.
|
|
191
192
|
*/
|
|
@@ -145,9 +145,10 @@ export class InstancedMesh<
|
|
|
145
145
|
getMorphAt(index: number, mesh: Mesh): void;
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
|
-
* Sets the given local transformation matrix to the defined instance.
|
|
149
|
-
* @
|
|
150
|
-
*
|
|
148
|
+
* Sets the given local transformation matrix to the defined instance. Make sure you set
|
|
149
|
+
* {@link InstancedBufferAttribute.needsUpdate | .instanceMatrix.needsUpdate()} flag to `true` after updating all
|
|
150
|
+
* the matrices.
|
|
151
|
+
* Negatively scaled matrices are not supported.
|
|
151
152
|
* @param index The index of an instance. Values have to be in the range `[0, count]`. Expects a `Integer`
|
|
152
153
|
* @param matrix A 4x4 matrix representing the local transformation of a single instance.
|
|
153
154
|
*/
|
three/src/objects/LOD.d.ts
CHANGED
|
@@ -20,8 +20,9 @@ export interface LODJSON extends Object3DJSON {
|
|
|
20
20
|
* @remarks
|
|
21
21
|
* Typically you would create, say, three meshes, one for far away (low detail), one for mid range (medium detail) and one for close up (high detail).
|
|
22
22
|
* @example
|
|
23
|
-
*
|
|
24
|
-
* const
|
|
23
|
+
* const lod = new THREE.LOD();
|
|
24
|
+
* const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
|
|
25
|
+
*
|
|
25
26
|
* //Create spheres with 3 levels of detail and create new {@link LOD} levels for them
|
|
26
27
|
* for (let i = 0; i & lt; 3; i++) {
|
|
27
28
|
* const geometry = new THREE.IcosahedronGeometry(10, 3 - i)
|
|
@@ -29,7 +30,7 @@ export interface LODJSON extends Object3DJSON {
|
|
|
29
30
|
* lod.addLevel(mesh, i * 75);
|
|
30
31
|
* }
|
|
31
32
|
* scene.add(lod);
|
|
32
|
-
*
|
|
33
|
+
*
|
|
33
34
|
* @see Example: {@link https://threejs.org/examples/#webgl_lod | webgl / {@link LOD} }
|
|
34
35
|
* @see {@link https://threejs.org/docs/index.html#api/en/objects/LOD | Official Documentation}
|
|
35
36
|
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/LOD.js | Source}
|
|
@@ -278,12 +278,12 @@ export class WebGLRenderer {
|
|
|
278
278
|
/**
|
|
279
279
|
* Sets the custom opaque sort function for the WebGLRenderLists. Pass null to use the default painterSortStable function.
|
|
280
280
|
*/
|
|
281
|
-
setOpaqueSort(method: (a: any, b: any) => number): void;
|
|
281
|
+
setOpaqueSort(method: ((a: any, b: any) => number) | null): void;
|
|
282
282
|
|
|
283
283
|
/**
|
|
284
284
|
* Sets the custom transparent sort function for the WebGLRenderLists. Pass null to use the default reversePainterSortStable function.
|
|
285
285
|
*/
|
|
286
|
-
setTransparentSort(method: (a: any, b: any) => number): void;
|
|
286
|
+
setTransparentSort(method: ((a: any, b: any) => number) | null): void;
|
|
287
287
|
|
|
288
288
|
/**
|
|
289
289
|
* Returns a THREE.Color instance with the current clear color.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Info from "./Info.js";
|
|
2
2
|
import Nodes from "./nodes/Nodes.js";
|
|
3
|
-
interface AnimationContext {
|
|
4
|
-
requestAnimationFrame(callback: FrameRequestCallback,
|
|
3
|
+
export interface AnimationContext {
|
|
4
|
+
requestAnimationFrame(callback: FrameRequestCallback, xrFrame?: XRFrame): number;
|
|
5
5
|
cancelAnimationFrame(handle: number): void;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
@@ -13,7 +13,7 @@ declare class Animation {
|
|
|
13
13
|
nodes: Nodes;
|
|
14
14
|
info: Info;
|
|
15
15
|
_context: AnimationContext;
|
|
16
|
-
_animationLoop: ((time: DOMHighResTimeStamp,
|
|
16
|
+
_animationLoop: ((time: DOMHighResTimeStamp, xrFrame?: XRFrame) => void) | null;
|
|
17
17
|
_requestId: number | null;
|
|
18
18
|
/**
|
|
19
19
|
* Constructs a new animation loop management component.
|
|
@@ -30,12 +30,24 @@ declare class Animation {
|
|
|
30
30
|
* Stops the internal animation loop.
|
|
31
31
|
*/
|
|
32
32
|
stop(): void;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the user-level animation loop.
|
|
35
|
+
*
|
|
36
|
+
* @return {Function} The animation loop.
|
|
37
|
+
*/
|
|
38
|
+
getAnimationLoop(): ((time: DOMHighResTimeStamp, xrFrame?: XRFrame) => void) | null;
|
|
33
39
|
/**
|
|
34
40
|
* Defines the user-level animation loop.
|
|
35
41
|
*
|
|
36
42
|
* @param {Function} callback - The animation loop.
|
|
37
43
|
*/
|
|
38
|
-
setAnimationLoop(callback: ((time: DOMHighResTimeStamp,
|
|
44
|
+
setAnimationLoop(callback: ((time: DOMHighResTimeStamp, xrFrame?: XRFrame) => void) | null): void;
|
|
45
|
+
/**
|
|
46
|
+
* Returns the animation context.
|
|
47
|
+
*
|
|
48
|
+
* @return {Window|XRSession} The animation context.
|
|
49
|
+
*/
|
|
50
|
+
getContext(): AnimationContext;
|
|
39
51
|
/**
|
|
40
52
|
* Defines the context in which `requestAnimationFrame()` is executed.
|
|
41
53
|
*
|
|
@@ -38,7 +38,7 @@ declare class Attributes extends DataMap<{
|
|
|
38
38
|
* for new attributes and updates data for existing ones.
|
|
39
39
|
*
|
|
40
40
|
* @param {BufferAttribute} attribute - The attribute to update.
|
|
41
|
-
* @param {
|
|
41
|
+
* @param {number} type - The attribute type.
|
|
42
42
|
*/
|
|
43
43
|
update(attribute: BufferAttribute | InterleavedBufferAttribute, type: AttributeType): void;
|
|
44
44
|
/**
|
|
@@ -16,9 +16,9 @@ declare class BindGroup {
|
|
|
16
16
|
/**
|
|
17
17
|
* Constructs a new bind group.
|
|
18
18
|
*
|
|
19
|
-
* @param {
|
|
19
|
+
* @param {string} name - The bind group's name.
|
|
20
20
|
* @param {Array<Binding>} bindings - An array of bindings.
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {number} index - The group index.
|
|
22
22
|
* @param {Array<Binding>} bindingsReference - An array of reference bindings.
|
|
23
23
|
*/
|
|
24
24
|
constructor(
|
|
@@ -13,13 +13,13 @@ declare class Binding {
|
|
|
13
13
|
/**
|
|
14
14
|
* Constructs a new binding.
|
|
15
15
|
*
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {string} [name=''] - The binding's name.
|
|
17
17
|
*/
|
|
18
18
|
constructor(name?: string);
|
|
19
19
|
/**
|
|
20
20
|
* Makes sure binding's resource is visible for the given shader stage.
|
|
21
21
|
*
|
|
22
|
-
* @param {
|
|
22
|
+
* @param {number} visibility - The shader stage.
|
|
23
23
|
*/
|
|
24
24
|
setVisibility(visibility: number): void;
|
|
25
25
|
/**
|
|
@@ -13,14 +13,14 @@ declare class Buffer extends Binding {
|
|
|
13
13
|
/**
|
|
14
14
|
* Constructs a new buffer.
|
|
15
15
|
*
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {string} name - The buffer's name.
|
|
17
17
|
* @param {TypedArray} [buffer=null] - The buffer.
|
|
18
18
|
*/
|
|
19
19
|
constructor(name?: string, buffer?: Float32Array | null);
|
|
20
20
|
/**
|
|
21
21
|
* The buffer's byte length.
|
|
22
22
|
*
|
|
23
|
-
* @type {
|
|
23
|
+
* @type {number}
|
|
24
24
|
* @readonly
|
|
25
25
|
*/
|
|
26
26
|
get byteLength(): number;
|
|
@@ -34,7 +34,7 @@ declare class Buffer extends Binding {
|
|
|
34
34
|
/**
|
|
35
35
|
* Updates the binding.
|
|
36
36
|
*
|
|
37
|
-
* @return {
|
|
37
|
+
* @return {boolean} Whether the buffer has been updated and must be
|
|
38
38
|
* uploaded to the GPU.
|
|
39
39
|
*/
|
|
40
40
|
update(): boolean;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/** @module BufferUtils **/
|
|
2
1
|
/**
|
|
3
2
|
* This function is usually called with the length in bytes of an array buffer.
|
|
4
|
-
* It returns an padded value
|
|
3
|
+
* It returns an padded value which ensure chunk size alignment according to STD140 layout.
|
|
5
4
|
*
|
|
6
5
|
* @function
|
|
7
|
-
* @param {
|
|
8
|
-
* @return {
|
|
6
|
+
* @param {number} floatLength - The buffer length.
|
|
7
|
+
* @return {number} The padded length.
|
|
9
8
|
*/
|
|
10
9
|
declare function getFloatLength(floatLength: number): number;
|
|
11
10
|
/**
|
|
@@ -13,9 +12,9 @@ declare function getFloatLength(floatLength: number): number;
|
|
|
13
12
|
* a total length in bytes with buffer alignment according to STD140 layout.
|
|
14
13
|
*
|
|
15
14
|
* @function
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {
|
|
18
|
-
* @return {
|
|
15
|
+
* @param {number} count - The number of vectors.
|
|
16
|
+
* @param {number} [vectorLength=4] - The vector length.
|
|
17
|
+
* @return {number} The padded length.
|
|
19
18
|
*/
|
|
20
19
|
declare function getVectorLength(count: number, vectorLength?: number): number;
|
|
21
20
|
/**
|
|
@@ -23,8 +22,8 @@ declare function getVectorLength(count: number, vectorLength?: number): number;
|
|
|
23
22
|
* matches a predefined stride (in this case `4`).
|
|
24
23
|
*
|
|
25
24
|
* @function
|
|
26
|
-
* @param {
|
|
27
|
-
* @return {
|
|
25
|
+
* @param {number} vectorLength - The vector length.
|
|
26
|
+
* @return {number} The padded length.
|
|
28
27
|
*/
|
|
29
28
|
declare function getStrideLength(vectorLength: number): number;
|
|
30
29
|
export { getFloatLength, getStrideLength, getVectorLength };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Group } from "../../objects/Group.js";
|
|
2
2
|
/**
|
|
3
|
-
* A specialized group which
|
|
3
|
+
* A specialized group which enables applications access to the
|
|
4
4
|
* Render Bundle API of WebGPU. The group with all its descendant nodes
|
|
5
5
|
* are considered as one render bundle and processed as such by
|
|
6
6
|
* the renderer.
|
|
@@ -23,9 +23,9 @@ declare class BundleGroup extends Group {
|
|
|
23
23
|
/**
|
|
24
24
|
* Set this property to `true` when the bundle group has changed.
|
|
25
25
|
*
|
|
26
|
-
* @type {
|
|
26
|
+
* @type {boolean}
|
|
27
27
|
* @default false
|
|
28
|
-
* @param {
|
|
28
|
+
* @param {boolean} value
|
|
29
29
|
*/
|
|
30
30
|
set needsUpdate(value: boolean);
|
|
31
31
|
}
|
|
@@ -3,37 +3,37 @@ type RecursiveWeakMap<K extends readonly object[], V> = WeakMap<K[number], V | R
|
|
|
3
3
|
* Data structure for the renderer. It allows defining values
|
|
4
4
|
* with chained, hierarchical keys. Keys are meant to be
|
|
5
5
|
* objects since the module internally works with Weak Maps
|
|
6
|
-
* for
|
|
6
|
+
* for performance reasons.
|
|
7
7
|
*
|
|
8
8
|
* @private
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
declare class ChainMap<K extends readonly object[], V> {
|
|
11
11
|
weakMap: RecursiveWeakMap<K, V>;
|
|
12
12
|
/**
|
|
13
|
-
* Constructs a new
|
|
13
|
+
* Constructs a new Chain Map.
|
|
14
14
|
*/
|
|
15
15
|
constructor();
|
|
16
16
|
/**
|
|
17
17
|
* Returns the value for the given array of keys.
|
|
18
18
|
*
|
|
19
19
|
* @param {Array<Object>} keys - List of keys.
|
|
20
|
-
* @return {
|
|
20
|
+
* @return {any} The value. Returns `undefined` if no value was found.
|
|
21
21
|
*/
|
|
22
22
|
get(keys: K): V | undefined;
|
|
23
23
|
/**
|
|
24
24
|
* Sets the value for the given keys.
|
|
25
25
|
*
|
|
26
26
|
* @param {Array<Object>} keys - List of keys.
|
|
27
|
-
* @param {
|
|
28
|
-
* @return {ChainMap} A reference to this
|
|
27
|
+
* @param {any} value - The value to set.
|
|
28
|
+
* @return {ChainMap} A reference to this Chain Map.
|
|
29
29
|
*/
|
|
30
30
|
set(keys: K, value: V): this;
|
|
31
31
|
/**
|
|
32
32
|
* Deletes a value for the given keys.
|
|
33
33
|
*
|
|
34
34
|
* @param {Array<Object>} keys - The keys.
|
|
35
|
-
* @return {
|
|
35
|
+
* @return {boolean} Returns `true` if the value has been removed successfully and `false` if the value has not be found.
|
|
36
36
|
*/
|
|
37
37
|
delete(keys: K): boolean;
|
|
38
38
|
}
|
|
39
|
-
export
|
|
39
|
+
export default ChainMap;
|
|
@@ -27,7 +27,7 @@ declare class ClippingContext {
|
|
|
27
27
|
/**
|
|
28
28
|
* Constructs a new clipping context.
|
|
29
29
|
*
|
|
30
|
-
* @param {ClippingContext
|
|
30
|
+
* @param {?ClippingContext} [parentContext=null] - A reference to the parent clipping context.
|
|
31
31
|
*/
|
|
32
32
|
constructor(parentContext?: ClippingContext | null);
|
|
33
33
|
/**
|
|
@@ -36,7 +36,7 @@ declare class ClippingContext {
|
|
|
36
36
|
*
|
|
37
37
|
* @param {Array<Plane>} source - The source clipping planes.
|
|
38
38
|
* @param {Array<Vector4>} destination - The destination.
|
|
39
|
-
* @param {
|
|
39
|
+
* @param {number} offset - The offset.
|
|
40
40
|
*/
|
|
41
41
|
projectPlanes(source: readonly Plane[], destination: readonly Vector4[], offset: number): void;
|
|
42
42
|
/**
|
|
@@ -63,7 +63,7 @@ declare class ClippingContext {
|
|
|
63
63
|
/**
|
|
64
64
|
* The count of union clipping planes.
|
|
65
65
|
*
|
|
66
|
-
* @type {
|
|
66
|
+
* @type {number}
|
|
67
67
|
* @readonly
|
|
68
68
|
*/
|
|
69
69
|
get unionClippingCount(): number;
|
|
@@ -11,21 +11,25 @@ declare class Color4 extends Color {
|
|
|
11
11
|
a: number;
|
|
12
12
|
/**
|
|
13
13
|
* Constructs a new four-component color.
|
|
14
|
+
* You can also pass a single THREE.Color, hex or
|
|
15
|
+
* string argument to this constructor.
|
|
14
16
|
*
|
|
15
|
-
* @param {
|
|
16
|
-
* @param {
|
|
17
|
-
* @param {
|
|
18
|
-
* @param {
|
|
17
|
+
* @param {number|string} [r=1] - The red value.
|
|
18
|
+
* @param {number} [g=1] - The green value.
|
|
19
|
+
* @param {number} [b=1] - The blue value.
|
|
20
|
+
* @param {number} [a=1] - The alpha value.
|
|
19
21
|
*/
|
|
20
22
|
constructor(color?: ColorRepresentation);
|
|
21
23
|
constructor(r: number, g: number, b: number, a?: number);
|
|
22
24
|
/**
|
|
23
25
|
* Overwrites the default to honor alpha.
|
|
26
|
+
* You can also pass a single THREE.Color, hex or
|
|
27
|
+
* string argument to this method.
|
|
24
28
|
*
|
|
25
|
-
* @param {
|
|
26
|
-
* @param {
|
|
27
|
-
* @param {
|
|
28
|
-
* @param {
|
|
29
|
+
* @param {number|string} r - The red value.
|
|
30
|
+
* @param {number} g - The green value.
|
|
31
|
+
* @param {number} b - The blue value.
|
|
32
|
+
* @param {number} [a=1] - The alpha value.
|
|
29
33
|
* @return {Color4} A reference to this object.
|
|
30
34
|
*/
|
|
31
35
|
set(...args: [color: ColorRepresentation] | [r: number, g: number, b: number, a?: number]): this;
|
|
@@ -12,7 +12,7 @@ declare class ComputePipeline 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} computeProgram - The pipeline's compute shader.
|
|
17
17
|
*/
|
|
18
18
|
constructor(cacheKey: string, computeProgram: ProgrammableStage);
|
|
@@ -30,7 +30,7 @@ declare class DataMap<
|
|
|
30
30
|
* Deletes the dictionary for the given object.
|
|
31
31
|
*
|
|
32
32
|
* @param {Object} object - The object.
|
|
33
|
-
* @return {Object
|
|
33
|
+
* @return {?Object} The deleted dictionary.
|
|
34
34
|
*/
|
|
35
35
|
delete<K extends M[keyof M]["key"]>(object: K): Extract<M[keyof M], {
|
|
36
36
|
key: K;
|
|
@@ -39,7 +39,7 @@ declare class DataMap<
|
|
|
39
39
|
* Returns `true` if the given object has a dictionary defined.
|
|
40
40
|
*
|
|
41
41
|
* @param {Object} object - The object to test.
|
|
42
|
-
* @return {
|
|
42
|
+
* @return {boolean} Whether a dictionary is defined or not.
|
|
43
43
|
*/
|
|
44
44
|
has(object: M[keyof M]["key"]): boolean;
|
|
45
45
|
/**
|
|
@@ -37,7 +37,7 @@ declare class Geometries extends DataMap<{
|
|
|
37
37
|
* Returns `true` if the given render object has an initialized geometry.
|
|
38
38
|
*
|
|
39
39
|
* @param {RenderObject} renderObject - The render object.
|
|
40
|
-
* @return {
|
|
40
|
+
* @return {boolean} Whether if the given render object has an initialized geometry or not.
|
|
41
41
|
*/
|
|
42
42
|
has(renderObject: RenderObject | BufferGeometry): boolean;
|
|
43
43
|
/**
|
|
@@ -62,14 +62,14 @@ declare class Geometries extends DataMap<{
|
|
|
62
62
|
* Updates the given attribute.
|
|
63
63
|
*
|
|
64
64
|
* @param {BufferAttribute} attribute - The attribute to update.
|
|
65
|
-
* @param {
|
|
65
|
+
* @param {number} type - The attribute type.
|
|
66
66
|
*/
|
|
67
67
|
updateAttribute(attribute: BufferAttribute | InterleavedBufferAttribute, type: AttributeType): void;
|
|
68
68
|
/**
|
|
69
69
|
* Returns the indirect buffer attribute of the given render object.
|
|
70
70
|
*
|
|
71
71
|
* @param {RenderObject} renderObject - The render object.
|
|
72
|
-
* @return {BufferAttribute
|
|
72
|
+
* @return {?BufferAttribute} The indirect attribute. `null` if no indirect drawing is used.
|
|
73
73
|
*/
|
|
74
74
|
getIndirect(renderObject: RenderObject): import("./IndirectStorageBufferAttribute.js").default | null;
|
|
75
75
|
/**
|
|
@@ -77,7 +77,7 @@ declare class Geometries extends DataMap<{
|
|
|
77
77
|
* in a method to return a wireframe index if necessary.
|
|
78
78
|
*
|
|
79
79
|
* @param {RenderObject} renderObject - The render object.
|
|
80
|
-
* @return {BufferAttribute
|
|
80
|
+
* @return {?BufferAttribute} The index. Returns `null` for non-indexed geometries.
|
|
81
81
|
*/
|
|
82
82
|
getIndex(renderObject: RenderObject): BufferAttribute | null;
|
|
83
83
|
}
|
|
@@ -16,15 +16,11 @@ declare class Info {
|
|
|
16
16
|
points: number;
|
|
17
17
|
lines: number;
|
|
18
18
|
timestamp: number;
|
|
19
|
-
previousFrameCalls: number;
|
|
20
|
-
timestampCalls: number;
|
|
21
19
|
};
|
|
22
20
|
compute: {
|
|
23
21
|
calls: number;
|
|
24
22
|
frameCalls: number;
|
|
25
23
|
timestamp: number;
|
|
26
|
-
previousFrameCalls: number;
|
|
27
|
-
timestampCalls: number;
|
|
28
24
|
};
|
|
29
25
|
memory: {
|
|
30
26
|
geometries: number;
|
|
@@ -38,17 +34,10 @@ declare class Info {
|
|
|
38
34
|
* This method should be executed per draw call and updates the corresponding metrics.
|
|
39
35
|
*
|
|
40
36
|
* @param {Object3D} object - The 3D object that is going to be rendered.
|
|
41
|
-
* @param {
|
|
42
|
-
* @param {
|
|
37
|
+
* @param {number} count - The vertex or index count.
|
|
38
|
+
* @param {number} instanceCount - The instance count.
|
|
43
39
|
*/
|
|
44
40
|
update(object: Object3D, count: number, instanceCount: number): void;
|
|
45
|
-
/**
|
|
46
|
-
* Used by async render methods to updated timestamp metrics.
|
|
47
|
-
*
|
|
48
|
-
* @param {('render'|'compute')} type - The type of render call.
|
|
49
|
-
* @param {Number} time - The duration of the compute/render call in milliseconds.
|
|
50
|
-
*/
|
|
51
|
-
updateTimestamp(type: "render" | "compute", time: number): void;
|
|
52
41
|
/**
|
|
53
42
|
* Resets frame related metrics.
|
|
54
43
|
*/
|
|
@@ -60,7 +60,7 @@ declare class Pipelines extends DataMap<{
|
|
|
60
60
|
* Returns a render pipeline for the given render object.
|
|
61
61
|
*
|
|
62
62
|
* @param {RenderObject} renderObject - The render object.
|
|
63
|
-
* @param {Array<Promise
|
|
63
|
+
* @param {?Array<Promise>} [promises=null] - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`.
|
|
64
64
|
* @return {RenderPipeline} The render pipeline.
|
|
65
65
|
*/
|
|
66
66
|
getForRender(renderObject: RenderObject, promises?: Promise<void>[] | null): RenderPipeline;
|
|
@@ -68,7 +68,7 @@ declare class Pipelines extends DataMap<{
|
|
|
68
68
|
* Deletes the pipeline for the given render object.
|
|
69
69
|
*
|
|
70
70
|
* @param {RenderObject} object - The render object.
|
|
71
|
-
* @return {Object
|
|
71
|
+
* @return {?Object} The deleted dictionary.
|
|
72
72
|
*/
|
|
73
73
|
delete(object: ComputeNode | RenderObject): never;
|
|
74
74
|
/**
|
|
@@ -87,7 +87,7 @@ declare class Pipelines extends DataMap<{
|
|
|
87
87
|
* @private
|
|
88
88
|
* @param {Node} computeNode - The compute node.
|
|
89
89
|
* @param {ProgrammableStage} stageCompute - The programmable stage representing the compute shader.
|
|
90
|
-
* @param {
|
|
90
|
+
* @param {string} cacheKey - The cache key.
|
|
91
91
|
* @param {Array<BindGroup>} bindings - The bindings.
|
|
92
92
|
* @return {ComputePipeline} The compute pipeline.
|
|
93
93
|
*/
|
|
@@ -104,8 +104,8 @@ declare class Pipelines extends DataMap<{
|
|
|
104
104
|
* @param {RenderObject} renderObject - The render object.
|
|
105
105
|
* @param {ProgrammableStage} stageVertex - The programmable stage representing the vertex shader.
|
|
106
106
|
* @param {ProgrammableStage} stageFragment - The programmable stage representing the fragment shader.
|
|
107
|
-
* @param {
|
|
108
|
-
* @param {Array} promises - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`.
|
|
107
|
+
* @param {string} cacheKey - The cache key.
|
|
108
|
+
* @param {?Array<Promise>} promises - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`.
|
|
109
109
|
* @return {ComputePipeline} The compute pipeline.
|
|
110
110
|
*/
|
|
111
111
|
_getRenderPipeline(
|
|
@@ -121,7 +121,7 @@ declare class Pipelines extends DataMap<{
|
|
|
121
121
|
* @private
|
|
122
122
|
* @param {Node} computeNode - The compute node.
|
|
123
123
|
* @param {ProgrammableStage} stageCompute - The programmable stage representing the compute shader.
|
|
124
|
-
* @return {
|
|
124
|
+
* @return {string} The cache key.
|
|
125
125
|
*/
|
|
126
126
|
_getComputeCacheKey(computeNode: ComputeNode, stageCompute: ProgrammableStage): string;
|
|
127
127
|
/**
|
|
@@ -131,7 +131,7 @@ declare class Pipelines extends DataMap<{
|
|
|
131
131
|
* @param {RenderObject} renderObject - The render object.
|
|
132
132
|
* @param {ProgrammableStage} stageVertex - The programmable stage representing the vertex shader.
|
|
133
133
|
* @param {ProgrammableStage} stageFragment - The programmable stage representing the fragment shader.
|
|
134
|
-
* @return {
|
|
134
|
+
* @return {string} The cache key.
|
|
135
135
|
*/
|
|
136
136
|
_getRenderCacheKey(
|
|
137
137
|
renderObject: RenderObject,
|
|
@@ -149,7 +149,7 @@ declare class Pipelines extends DataMap<{
|
|
|
149
149
|
* Releases the shader program.
|
|
150
150
|
*
|
|
151
151
|
* @private
|
|
152
|
-
* @param {Object} program - The
|
|
152
|
+
* @param {Object} program - The shader program to release.
|
|
153
153
|
*/
|
|
154
154
|
_releaseProgram(program: ProgrammableStage): void;
|
|
155
155
|
/**
|
|
@@ -157,7 +157,7 @@ declare class Pipelines extends DataMap<{
|
|
|
157
157
|
*
|
|
158
158
|
* @private
|
|
159
159
|
* @param {Node} computeNode - The compute node.
|
|
160
|
-
* @return {
|
|
160
|
+
* @return {boolean} Whether the compute pipeline for the given compute node requires an update or not.
|
|
161
161
|
*/
|
|
162
162
|
_needsComputeUpdate(computeNode: ComputeNode): boolean;
|
|
163
163
|
/**
|
|
@@ -165,7 +165,7 @@ declare class Pipelines extends DataMap<{
|
|
|
165
165
|
*
|
|
166
166
|
* @private
|
|
167
167
|
* @param {RenderObject} renderObject - The render object.
|
|
168
|
-
* @return {
|
|
168
|
+
* @return {boolean} Whether the render object for the given render object requires an update or not.
|
|
169
169
|
*/
|
|
170
170
|
_needsRenderUpdate(renderObject: RenderObject): true | void;
|
|
171
171
|
}
|
|
@@ -16,11 +16,11 @@ declare class ProgrammableStage {
|
|
|
16
16
|
/**
|
|
17
17
|
* Constructs a new programmable stage.
|
|
18
18
|
*
|
|
19
|
-
* @param {
|
|
19
|
+
* @param {string} code - The shader code.
|
|
20
20
|
* @param {('vertex'|'fragment'|'compute')} stage - The type of stage.
|
|
21
|
-
* @param {
|
|
22
|
-
* @param {Array<Object
|
|
23
|
-
* @param {Array<Object
|
|
21
|
+
* @param {string} name - The name of the shader.
|
|
22
|
+
* @param {?Array<Object>} [transforms=null] - The transforms (only relevant for compute stages with WebGL 2 which uses Transform Feedback).
|
|
23
|
+
* @param {?Array<Object>} [attributes=null] - The attributes (only relevant for compute stages with WebGL 2 which uses Transform Feedback).
|
|
24
24
|
*/
|
|
25
25
|
constructor(
|
|
26
26
|
code: string,
|
|
@@ -31,19 +31,19 @@ declare class RenderContext {
|
|
|
31
31
|
viewportValue: Vector4;
|
|
32
32
|
scissor: boolean;
|
|
33
33
|
scissorValue: Vector4;
|
|
34
|
+
renderTarget: RenderTarget | null;
|
|
34
35
|
textures: Texture[] | null;
|
|
35
36
|
depthTexture: DepthTexture | null;
|
|
36
37
|
activeCubeFace: number;
|
|
37
38
|
sampleCount: number;
|
|
38
39
|
width: number;
|
|
39
40
|
height: number;
|
|
41
|
+
occlusionQueryCount: number;
|
|
42
|
+
clippingContext: ClippingContext | null;
|
|
40
43
|
readonly isRenderContext: true;
|
|
41
|
-
clippingContext?: ClippingContext | undefined;
|
|
42
44
|
depthClearValue?: number | undefined;
|
|
43
45
|
stencilClearValue?: number | undefined;
|
|
44
|
-
renderTarget?: RenderTarget | undefined;
|
|
45
46
|
activeMipmapLevel?: number | undefined;
|
|
46
|
-
occlusionQueryCount?: number | undefined;
|
|
47
47
|
/**
|
|
48
48
|
* Constructs a new render context.
|
|
49
49
|
*/
|
|
@@ -51,15 +51,17 @@ declare class RenderContext {
|
|
|
51
51
|
/**
|
|
52
52
|
* Returns the cache key of this render context.
|
|
53
53
|
*
|
|
54
|
-
* @return {
|
|
54
|
+
* @return {number} The cache key.
|
|
55
55
|
*/
|
|
56
56
|
getCacheKey(): number;
|
|
57
57
|
}
|
|
58
58
|
/**
|
|
59
|
-
* Computes a cache key for the given render context.
|
|
59
|
+
* Computes a cache key for the given render context. This key
|
|
60
|
+
* should identify the render target state so it is possible to
|
|
61
|
+
* configure the correct attachments in the respective backend.
|
|
60
62
|
*
|
|
61
63
|
* @param {RenderContext} renderContext - The render context.
|
|
62
|
-
* @return {
|
|
64
|
+
* @return {number} The cache key.
|
|
63
65
|
*/
|
|
64
66
|
export declare function getCacheKey(renderContext: RenderContext): number;
|
|
65
67
|
export default RenderContext;
|