@types/three 0.170.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/build/three.core.d.ts +1 -0
- three/build/three.core.min.d.ts +1 -0
- three/build/three.tsl.d.ts +1 -0
- three/build/three.tsl.min.d.ts +1 -0
- three/examples/jsm/Addons.d.ts +0 -5
- three/examples/jsm/controls/ArcballControls.d.ts +6 -1
- three/examples/jsm/controls/OrbitControls.d.ts +5 -0
- three/examples/jsm/controls/TransformControls.d.ts +1 -1
- three/examples/jsm/csm/CSMShadowNode.d.ts +2 -4
- three/examples/jsm/exporters/GLTFExporter.d.ts +23 -7
- three/examples/jsm/geometries/DecalGeometry.d.ts +1 -1
- 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/materials/LDrawConditionalLineNodeMaterial.d.ts +1 -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/objects/SkyMesh.d.ts +2 -2
- three/examples/jsm/objects/Water2Mesh.d.ts +13 -2
- three/examples/jsm/objects/WaterMesh.d.ts +11 -2
- three/examples/jsm/postprocessing/OutlinePass.d.ts +1 -1
- three/examples/jsm/postprocessing/UnrealBloomPass.d.ts +1 -1
- three/examples/jsm/tsl/display/AfterImageNode.d.ts +2 -1
- three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts +1 -1
- three/examples/jsm/tsl/display/AnamorphicNode.d.ts +2 -2
- three/examples/jsm/tsl/display/BleachBypass.d.ts +2 -1
- three/examples/jsm/tsl/display/BloomNode.d.ts +2 -1
- three/examples/jsm/tsl/display/DenoiseNode.d.ts +3 -4
- three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +2 -1
- three/examples/jsm/tsl/display/DotScreenNode.d.ts +2 -2
- three/examples/jsm/tsl/display/FXAANode.d.ts +2 -1
- three/examples/jsm/tsl/display/FilmNode.d.ts +2 -1
- three/examples/jsm/tsl/display/GTAONode.d.ts +5 -8
- three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +2 -2
- three/examples/jsm/tsl/display/LensflareNode.d.ts +2 -2
- three/examples/jsm/tsl/display/Lut3DNode.d.ts +2 -2
- three/examples/jsm/tsl/display/MotionBlur.d.ts +2 -1
- three/examples/jsm/tsl/display/OutlineNode.d.ts +2 -2
- three/examples/jsm/tsl/display/ParallaxBarrierPassNode.d.ts +1 -1
- three/examples/jsm/tsl/display/PixelationPassNode.d.ts +2 -2
- three/examples/jsm/tsl/display/RGBShiftNode.d.ts +2 -1
- three/examples/jsm/tsl/display/SMAANode.d.ts +2 -1
- three/examples/jsm/tsl/display/SSAAPassNode.d.ts +2 -2
- three/examples/jsm/tsl/display/SSRNode.d.ts +2 -2
- three/examples/jsm/tsl/display/Sepia.d.ts +2 -1
- three/examples/jsm/tsl/display/SobelOperatorNode.d.ts +2 -1
- three/examples/jsm/tsl/display/StereoCompositePassNode.d.ts +1 -2
- three/examples/jsm/tsl/display/StereoPassNode.d.ts +2 -2
- three/examples/jsm/tsl/display/TRAAPassNode.d.ts +2 -2
- three/examples/jsm/tsl/display/TransitionNode.d.ts +2 -1
- three/examples/jsm/tsl/display/hashBlur.d.ts +2 -1
- three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +2 -1
- three/examples/jsm/utils/ShadowMapViewer.d.ts +2 -2
- three/package.json +4 -4
- three/src/Three.Core.d.ts +159 -0
- three/src/Three.TSL.d.ts +533 -0
- three/src/Three.WebGPU.Nodes.d.ts +14 -195
- three/src/Three.WebGPU.d.ts +14 -196
- three/src/Three.d.ts +2 -158
- three/src/animation/AnimationClip.d.ts +3 -1
- three/src/cameras/CubeCamera.d.ts +19 -2
- three/src/core/Clock.d.ts +4 -6
- three/src/core/InterleavedBuffer.d.ts +12 -0
- 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 +9 -5
- 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/LineDashedNodeMaterial.d.ts +3 -0
- three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +6 -6
- three/src/materials/nodes/NodeMaterial.d.ts +7 -1
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +56 -0
- three/src/nodes/Nodes.d.ts +2 -7
- three/src/nodes/TSL.d.ts +10 -5
- three/src/nodes/accessors/Arrays.d.ts +7 -0
- three/src/nodes/accessors/BufferAttributeNode.d.ts +117 -0
- three/src/nodes/accessors/BufferNode.d.ts +4 -4
- three/src/nodes/accessors/BuiltinNode.d.ts +14 -0
- three/src/nodes/accessors/ClippingNode.d.ts +6 -0
- three/src/nodes/accessors/InstanceNode.d.ts +15 -3
- three/src/nodes/accessors/InstancedMeshNode.d.ts +11 -0
- three/src/nodes/accessors/Lights.d.ts +15 -0
- 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 +25 -12
- three/src/nodes/accessors/StorageTextureNode.d.ts +5 -3
- three/src/nodes/accessors/TextureNode.d.ts +5 -0
- three/src/nodes/accessors/UniformArrayNode.d.ts +3 -2
- three/src/nodes/core/IndexNode.d.ts +2 -0
- 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/NodeUtils.d.ts +7 -0
- three/src/nodes/core/NodeVar.d.ts +12 -0
- three/src/nodes/core/NodeVarying.d.ts +14 -0
- three/src/nodes/core/StackNode.d.ts +6 -1
- 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 +41 -0
- three/src/nodes/display/BlendModes.d.ts +32 -0
- three/src/nodes/display/PassNode.d.ts +1 -1
- three/src/nodes/display/ScreenNode.d.ts +5 -0
- three/src/nodes/display/ViewportDepthNode.d.ts +3 -1
- three/src/nodes/fog/Fog.d.ts +26 -0
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +88 -0
- three/src/nodes/gpgpu/BarrierNode.d.ts +12 -0
- three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +13 -0
- three/src/nodes/gpgpu/ComputeNode.d.ts +6 -1
- three/src/nodes/gpgpu/WorkgroupInfoNode.d.ts +19 -0
- three/src/nodes/lighting/AnalyticLightNode.d.ts +11 -0
- three/src/nodes/lighting/LightsNode.d.ts +2 -2
- three/src/nodes/lighting/PointLightNode.d.ts +3 -0
- three/src/nodes/lighting/PointShadowNode.d.ts +30 -0
- three/src/nodes/lighting/ShadowBaseNode.d.ts +15 -0
- three/src/nodes/lighting/ShadowNode.d.ts +28 -4
- three/src/nodes/math/MathNode.d.ts +13 -4
- three/src/nodes/math/OperatorNode.d.ts +3 -0
- three/src/nodes/tsl/TSLBase.d.ts +5 -0
- three/src/nodes/tsl/TSLCore.d.ts +51 -16
- three/src/nodes/utils/EquirectUVNode.d.ts +2 -2
- three/src/nodes/utils/LoopNode.d.ts +23 -2
- three/src/nodes/utils/SplitNode.d.ts +1 -1
- three/src/objects/BatchedMesh.d.ts +4 -4
- three/src/objects/ClippingGroup.d.ts +41 -0
- three/src/renderers/WebGLRenderer.d.ts +10 -8
- three/src/renderers/common/Animation.d.ts +41 -4
- 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 +61 -14
- 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 +90 -0
- three/src/renderers/common/RenderLists.d.ts +21 -0
- three/src/renderers/common/RenderObject.d.ts +160 -5
- three/src/renderers/common/RenderObjects.d.ts +56 -0
- three/src/renderers/common/RenderPipeline.d.ts +13 -0
- three/src/renderers/common/Renderer.d.ts +596 -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 +104 -0
- three/src/renderers/common/extras/PMREMGenerator.d.ts +15 -1
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +30 -0
- three/src/renderers/common/nodes/NodeLibrary.d.ts +73 -4
- three/src/renderers/common/nodes/NodeUniform.d.ts +161 -0
- three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +14 -2
- three/src/renderers/common/nodes/Nodes.d.ts +185 -11
- three/src/renderers/webgl/WebGLState.d.ts +1 -1
- three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +10 -0
- three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +11 -0
- three/src/textures/Data3DTexture.d.ts +4 -2
- three/src/textures/DataArrayTexture.d.ts +1 -1
- three/src/textures/DataTexture.d.ts +7 -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/display/BlendMode.d.ts +0 -10
- 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
- three/src/nodes/lighting/LightNode.d.ts +0 -18
- three/src/textures/types.d.ts +0 -9
|
@@ -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 {};
|
|
@@ -1,24 +1,71 @@
|
|
|
1
1
|
import { Camera } from "../../cameras/Camera.js";
|
|
2
|
-
import { Material } from "../../materials/Material.js";
|
|
3
2
|
import { Matrix3 } from "../../math/Matrix3.js";
|
|
4
3
|
import { Matrix4 } from "../../math/Matrix4.js";
|
|
5
4
|
import { Plane } from "../../math/Plane.js";
|
|
6
5
|
import { Vector4 } from "../../math/Vector4.js";
|
|
7
|
-
import
|
|
6
|
+
import { ClippingGroup } from "../../objects/ClippingGroup.js";
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
planes: Vector4[];
|
|
15
|
-
parentVersion: number;
|
|
18
|
+
clipIntersection: boolean | null;
|
|
19
|
+
cacheKey: string;
|
|
20
|
+
intersectionPlanes?: Plane[];
|
|
21
|
+
unionPlanes?: Plane[];
|
|
16
22
|
viewNormalMatrix: Matrix3;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
clippingGroupContexts: WeakMap<ClippingGroup, ClippingContext>;
|
|
24
|
+
shadowPass: boolean;
|
|
25
|
+
viewMatrix?: Matrix4;
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
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
|
+
*/
|
|
62
|
+
getGroupContext(clippingGroup: ClippingGroup): ClippingContext;
|
|
63
|
+
/**
|
|
64
|
+
* The count of union clipping planes.
|
|
65
|
+
*
|
|
66
|
+
* @type {Number}
|
|
67
|
+
* @readonly
|
|
68
|
+
*/
|
|
69
|
+
get unionClippingCount(): number;
|
|
23
70
|
}
|
|
24
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;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { Object3D } from "../../core/Object3D.js";
|
|
2
|
+
/**
|
|
3
|
+
* This renderer module provides a series of statistical information
|
|
4
|
+
* about the GPU memory and the rendering process. Useful for debugging
|
|
5
|
+
* and monitoring.
|
|
6
|
+
*/
|
|
2
7
|
declare class Info {
|
|
3
8
|
autoReset: boolean;
|
|
4
9
|
frame: number;
|
|
@@ -25,10 +30,32 @@ declare class Info {
|
|
|
25
30
|
geometries: number;
|
|
26
31
|
textures: number;
|
|
27
32
|
};
|
|
33
|
+
/**
|
|
34
|
+
* Constructs a new info component.
|
|
35
|
+
*/
|
|
28
36
|
constructor();
|
|
37
|
+
/**
|
|
38
|
+
* This method should be executed per draw call and updates the corresponding metrics.
|
|
39
|
+
*
|
|
40
|
+
* @param {Object3D} object - The 3D object that is going to be rendered.
|
|
41
|
+
* @param {Number} count - The vertex or index count.
|
|
42
|
+
* @param {Number} instanceCount - The instance count.
|
|
43
|
+
*/
|
|
29
44
|
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
|
+
*/
|
|
30
51
|
updateTimestamp(type: "render" | "compute", time: number): void;
|
|
52
|
+
/**
|
|
53
|
+
* Resets frame related metrics.
|
|
54
|
+
*/
|
|
31
55
|
reset(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Performs a complete reset of the object.
|
|
58
|
+
*/
|
|
32
59
|
dispose(): void;
|
|
33
60
|
}
|
|
34
61
|
export default Info;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Abstract class for representing pipelines.
|
|
3
|
+
*
|
|
4
|
+
* @private
|
|
5
|
+
* @abstract
|
|
6
|
+
*/
|
|
1
7
|
declare class Pipeline {
|
|
2
8
|
cacheKey: string;
|
|
3
9
|
usedTimes: number;
|
|
10
|
+
/**
|
|
11
|
+
* Constructs a new pipeline.
|
|
12
|
+
*
|
|
13
|
+
* @param {String} cacheKey - The pipeline's cache key.
|
|
14
|
+
*/
|
|
4
15
|
constructor(cacheKey: string);
|
|
5
16
|
}
|
|
6
17
|
export default Pipeline;
|
|
@@ -16,6 +16,12 @@ interface ComputeNodeData {
|
|
|
16
16
|
interface RenderObjectData {
|
|
17
17
|
pipeline: RenderPipeline;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* This renderer module manages the pipelines of the renderer.
|
|
21
|
+
*
|
|
22
|
+
* @private
|
|
23
|
+
* @augments DataMap
|
|
24
|
+
*/
|
|
19
25
|
declare class Pipelines extends DataMap<{
|
|
20
26
|
computeNode: {
|
|
21
27
|
key: ComputeNode;
|
|
@@ -35,18 +41,73 @@ declare class Pipelines extends DataMap<{
|
|
|
35
41
|
fragment: Map<string, ProgrammableStage>;
|
|
36
42
|
compute: Map<string, ProgrammableStage>;
|
|
37
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* Constructs a new pipeline management component.
|
|
46
|
+
*
|
|
47
|
+
* @param {Backend} backend - The renderer's backend.
|
|
48
|
+
* @param {Nodes} nodes - Renderer component for managing nodes related logic.
|
|
49
|
+
*/
|
|
38
50
|
constructor(backend: Backend, nodes: Nodes);
|
|
51
|
+
/**
|
|
52
|
+
* Returns a compute pipeline for the given compute node.
|
|
53
|
+
*
|
|
54
|
+
* @param {Node} computeNode - The compute node.
|
|
55
|
+
* @param {Array<BindGroup>} bindings - The bindings.
|
|
56
|
+
* @return {ComputePipeline} The compute pipeline.
|
|
57
|
+
*/
|
|
39
58
|
getForCompute(computeNode: ComputeNode, bindings: Binding[]): ComputePipeline;
|
|
59
|
+
/**
|
|
60
|
+
* Returns a render pipeline for the given render object.
|
|
61
|
+
*
|
|
62
|
+
* @param {RenderObject} renderObject - The render object.
|
|
63
|
+
* @param {Array<Promise>?} [promises=null] - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`.
|
|
64
|
+
* @return {RenderPipeline} The render pipeline.
|
|
65
|
+
*/
|
|
40
66
|
getForRender(renderObject: RenderObject, promises?: Promise<void>[] | null): RenderPipeline;
|
|
67
|
+
/**
|
|
68
|
+
* Deletes the pipeline for the given render object.
|
|
69
|
+
*
|
|
70
|
+
* @param {RenderObject} object - The render object.
|
|
71
|
+
* @return {Object?} The deleted dictionary.
|
|
72
|
+
*/
|
|
41
73
|
delete(object: ComputeNode | RenderObject): never;
|
|
74
|
+
/**
|
|
75
|
+
* Frees internal resources.
|
|
76
|
+
*/
|
|
42
77
|
dispose(): void;
|
|
78
|
+
/**
|
|
79
|
+
* Updates the pipeline for the given render object.
|
|
80
|
+
*
|
|
81
|
+
* @param {RenderObject} renderObject - The render object.
|
|
82
|
+
*/
|
|
43
83
|
updateForRender(renderObject: RenderObject): void;
|
|
84
|
+
/**
|
|
85
|
+
* Returns a compute pipeline for the given parameters.
|
|
86
|
+
*
|
|
87
|
+
* @private
|
|
88
|
+
* @param {Node} computeNode - The compute node.
|
|
89
|
+
* @param {ProgrammableStage} stageCompute - The programmable stage representing the compute shader.
|
|
90
|
+
* @param {String} cacheKey - The cache key.
|
|
91
|
+
* @param {Array<BindGroup>} bindings - The bindings.
|
|
92
|
+
* @return {ComputePipeline} The compute pipeline.
|
|
93
|
+
*/
|
|
44
94
|
_getComputePipeline(
|
|
45
95
|
computeNode: ComputeNode,
|
|
46
96
|
stageCompute: ProgrammableStage,
|
|
47
97
|
cacheKey: string,
|
|
48
98
|
bindings: Binding[],
|
|
49
99
|
): ComputePipeline;
|
|
100
|
+
/**
|
|
101
|
+
* Returns a render pipeline for the given parameters.
|
|
102
|
+
*
|
|
103
|
+
* @private
|
|
104
|
+
* @param {RenderObject} renderObject - The render object.
|
|
105
|
+
* @param {ProgrammableStage} stageVertex - The programmable stage representing the vertex shader.
|
|
106
|
+
* @param {ProgrammableStage} stageFragment - The programmable stage representing the fragment shader.
|
|
107
|
+
* @param {String} cacheKey - The cache key.
|
|
108
|
+
* @param {Array} promises - An array of compilation promises which is only relevant in context of `Renderer.compileAsync()`.
|
|
109
|
+
* @return {ComputePipeline} The compute pipeline.
|
|
110
|
+
*/
|
|
50
111
|
_getRenderPipeline(
|
|
51
112
|
renderObject: RenderObject,
|
|
52
113
|
stageVertex: ProgrammableStage,
|
|
@@ -54,15 +115,58 @@ declare class Pipelines extends DataMap<{
|
|
|
54
115
|
cacheKey: string,
|
|
55
116
|
promises: Promise<void>[] | null,
|
|
56
117
|
): RenderPipeline;
|
|
118
|
+
/**
|
|
119
|
+
* Computes a cache key representing a compute pipeline.
|
|
120
|
+
*
|
|
121
|
+
* @private
|
|
122
|
+
* @param {Node} computeNode - The compute node.
|
|
123
|
+
* @param {ProgrammableStage} stageCompute - The programmable stage representing the compute shader.
|
|
124
|
+
* @return {String} The cache key.
|
|
125
|
+
*/
|
|
57
126
|
_getComputeCacheKey(computeNode: ComputeNode, stageCompute: ProgrammableStage): string;
|
|
127
|
+
/**
|
|
128
|
+
* Computes a cache key representing a render pipeline.
|
|
129
|
+
*
|
|
130
|
+
* @private
|
|
131
|
+
* @param {RenderObject} renderObject - The render object.
|
|
132
|
+
* @param {ProgrammableStage} stageVertex - The programmable stage representing the vertex shader.
|
|
133
|
+
* @param {ProgrammableStage} stageFragment - The programmable stage representing the fragment shader.
|
|
134
|
+
* @return {String} The cache key.
|
|
135
|
+
*/
|
|
58
136
|
_getRenderCacheKey(
|
|
59
137
|
renderObject: RenderObject,
|
|
60
138
|
stageVertex: ProgrammableStage,
|
|
61
139
|
stageFragment: ProgrammableStage,
|
|
62
140
|
): string;
|
|
141
|
+
/**
|
|
142
|
+
* Releases the given pipeline.
|
|
143
|
+
*
|
|
144
|
+
* @private
|
|
145
|
+
* @param {Pipeline} pipeline - The pipeline to release.
|
|
146
|
+
*/
|
|
63
147
|
_releasePipeline(pipeline: Pipeline): void;
|
|
148
|
+
/**
|
|
149
|
+
* Releases the shader program.
|
|
150
|
+
*
|
|
151
|
+
* @private
|
|
152
|
+
* @param {Object} program - The shdaer program to release.
|
|
153
|
+
*/
|
|
64
154
|
_releaseProgram(program: ProgrammableStage): void;
|
|
155
|
+
/**
|
|
156
|
+
* Returns `true` if the compute pipeline for the given compute node requires an update.
|
|
157
|
+
*
|
|
158
|
+
* @private
|
|
159
|
+
* @param {Node} computeNode - The compute node.
|
|
160
|
+
* @return {Boolean} Whether the compute pipeline for the given compute node requires an update or not.
|
|
161
|
+
*/
|
|
65
162
|
_needsComputeUpdate(computeNode: ComputeNode): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Returns `true` if the render pipeline for the given render object requires an update.
|
|
165
|
+
*
|
|
166
|
+
* @private
|
|
167
|
+
* @param {RenderObject} renderObject - The render object.
|
|
168
|
+
* @return {Boolean} Whether the render object for the given render object requires an update or not.
|
|
169
|
+
*/
|
|
66
170
|
_needsRenderUpdate(renderObject: RenderObject): true | void;
|
|
67
171
|
}
|
|
68
172
|
export default Pipelines;
|