@types/three 0.171.0 → 0.173.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/TextGeometry.d.ts +0 -8
- three/examples/jsm/helpers/VertexNormalsHelper.d.ts +2 -0
- three/examples/jsm/interactive/InteractiveGroup.d.ts +9 -1
- three/examples/jsm/lines/LineSegments2.d.ts +3 -1
- three/examples/jsm/materials/MeshGouraudMaterial.d.ts +3 -0
- three/examples/jsm/modifiers/CurveModifier.d.ts +1 -1
- three/examples/jsm/modifiers/CurveModifierGPU.d.ts +1 -1
- 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/examples/jsm/webxr/XRButton.d.ts +4 -2
- three/package.json +2 -2
- three/src/Three.Core.d.ts +4 -1
- three/src/Three.TSL.d.ts +18 -5
- three/src/Three.WebGPU.Nodes.d.ts +2 -2
- three/src/Three.WebGPU.d.ts +2 -2
- 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/cameras/CubeCamera.d.ts +19 -2
- three/src/constants.d.ts +6 -0
- three/src/core/BufferAttribute.d.ts +5 -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 +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/NodeMaterials.d.ts +0 -4
- three/src/materials/nodes/PointsNodeMaterial.d.ts +7 -14
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +57 -0
- three/src/math/Matrix4.d.ts +2 -1
- three/src/nodes/Nodes.d.ts +6 -7
- three/src/nodes/TSL.d.ts +6 -3
- three/src/nodes/accessors/Arrays.d.ts +10 -2
- three/src/nodes/accessors/BufferAttributeNode.d.ts +117 -0
- three/src/nodes/accessors/BufferNode.d.ts +4 -4
- three/src/nodes/accessors/Camera.d.ts +1 -0
- three/src/nodes/accessors/MaterialNode.d.ts +6 -6
- 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 +12 -4
- three/src/nodes/accessors/TextureNode.d.ts +5 -0
- three/src/nodes/accessors/UniformArrayNode.d.ts +3 -2
- three/src/nodes/core/ArrayNode.d.ts +26 -0
- three/src/nodes/core/Node.d.ts +245 -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 +23 -1
- 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 +18 -2
- three/src/nodes/core/NodeVarying.d.ts +14 -0
- 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 +41 -4
- three/src/nodes/core/UniformNode.d.ts +44 -0
- three/src/nodes/core/VarNode.d.ts +8 -1
- three/src/nodes/core/VaryingNode.d.ts +12 -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/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/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 +15 -4
- 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 +62 -17
- three/src/nodes/utils/EquirectUVNode.d.ts +2 -2
- three/src/nodes/utils/LoopNode.d.ts +23 -2
- three/src/nodes/utils/MemberNode.d.ts +11 -0
- three/src/objects/BatchedMesh.d.ts +1 -0
- three/src/objects/ClippingGroup.d.ts +1 -1
- three/src/objects/InstancedMesh.d.ts +4 -3
- three/src/renderers/WebGLRenderer.d.ts +10 -10
- three/src/renderers/common/Animation.d.ts +43 -1
- 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 +33 -3
- three/src/renderers/common/ClippingContext.d.ts +45 -0
- three/src/renderers/common/Color4.d.ts +40 -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 +21 -5
- three/src/renderers/common/Pipeline.d.ts +11 -0
- three/src/renderers/common/Pipelines.d.ts +104 -0
- three/src/renderers/common/PostProcessing.d.ts +1 -1
- 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 +27 -3
- three/src/renderers/common/RenderContexts.d.ts +37 -6
- 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 +163 -4
- 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 +604 -10
- 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/TimestampQueryPool.d.ts +31 -0
- three/src/renderers/common/Uniform.d.ts +133 -1
- three/src/renderers/common/UniformBuffer.d.ts +12 -0
- three/src/renderers/common/UniformsGroup.d.ts +103 -0
- three/src/renderers/common/XRManager.d.ts +196 -0
- three/src/renderers/common/XRRenderTarget.d.ts +23 -0
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +32 -2
- three/src/renderers/common/nodes/NodeLibrary.d.ts +71 -0
- three/src/renderers/common/nodes/NodeUniform.d.ts +185 -0
- three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +14 -2
- three/src/renderers/common/nodes/Nodes.d.ts +192 -17
- three/src/renderers/webgpu/WebGPUBackend.d.ts +2 -1
- 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 +5 -5
- three/src/textures/VideoFrameTexture.d.ts +27 -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/materials/nodes/InstancedPointsNodeMaterial.d.ts +0 -33
- 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
|
@@ -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;
|
|
@@ -11,24 +16,35 @@ declare class Info {
|
|
|
11
16
|
points: number;
|
|
12
17
|
lines: number;
|
|
13
18
|
timestamp: number;
|
|
14
|
-
previousFrameCalls: number;
|
|
15
|
-
timestampCalls: number;
|
|
16
19
|
};
|
|
17
20
|
compute: {
|
|
18
21
|
calls: number;
|
|
19
22
|
frameCalls: number;
|
|
20
23
|
timestamp: number;
|
|
21
|
-
previousFrameCalls: number;
|
|
22
|
-
timestampCalls: number;
|
|
23
24
|
};
|
|
24
25
|
memory: {
|
|
25
26
|
geometries: number;
|
|
26
27
|
textures: number;
|
|
27
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* Constructs a new info component.
|
|
31
|
+
*/
|
|
28
32
|
constructor();
|
|
33
|
+
/**
|
|
34
|
+
* This method should be executed per draw call and updates the corresponding metrics.
|
|
35
|
+
*
|
|
36
|
+
* @param {Object3D} object - The 3D object that is going to be rendered.
|
|
37
|
+
* @param {Number} count - The vertex or index count.
|
|
38
|
+
* @param {Number} instanceCount - The instance count.
|
|
39
|
+
*/
|
|
29
40
|
update(object: Object3D, count: number, instanceCount: number): void;
|
|
30
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Resets frame related metrics.
|
|
43
|
+
*/
|
|
31
44
|
reset(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Performs a complete reset of the object.
|
|
47
|
+
*/
|
|
32
48
|
dispose(): void;
|
|
33
49
|
}
|
|
34
50
|
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<Promise>?} 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 shader 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;
|
|
@@ -1,13 +1,31 @@
|
|
|
1
1
|
import NodeAttribute from "../../nodes/core/NodeAttribute.js";
|
|
2
|
+
/**
|
|
3
|
+
* Class for representing programmable stages which are vertex,
|
|
4
|
+
* fragment or compute shaders. Unlike fixed-function states (like blending),
|
|
5
|
+
* they represent the programmable part of a pipeline.
|
|
6
|
+
*
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
2
9
|
declare class ProgrammableStage {
|
|
3
10
|
id: number;
|
|
4
11
|
code: string;
|
|
5
12
|
stage: "compute" | "vertex" | "fragment";
|
|
13
|
+
name: string;
|
|
6
14
|
attributes: NodeAttribute[] | null;
|
|
7
15
|
usedTimes: number;
|
|
16
|
+
/**
|
|
17
|
+
* Constructs a new programmable stage.
|
|
18
|
+
*
|
|
19
|
+
* @param {String} code - The shader code.
|
|
20
|
+
* @param {('vertex'|'fragment'|'compute')} stage - The type of stage.
|
|
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
|
+
*/
|
|
8
25
|
constructor(
|
|
9
26
|
code: string,
|
|
10
|
-
|
|
27
|
+
stage: "compute" | "vertex" | "fragment",
|
|
28
|
+
name: string,
|
|
11
29
|
transforms?: null,
|
|
12
30
|
attributes?: NodeAttribute[] | null,
|
|
13
31
|
);
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { Camera } from "../../cameras/Camera.js";
|
|
2
|
-
import
|
|
2
|
+
import BundleGroup from "./BundleGroup.js";
|
|
3
|
+
/**
|
|
4
|
+
* This module is used to represent render bundles inside the renderer
|
|
5
|
+
* for further processing.
|
|
6
|
+
*
|
|
7
|
+
* @private
|
|
8
|
+
*/
|
|
3
9
|
declare class RenderBundle {
|
|
4
|
-
|
|
10
|
+
bundleGroup: BundleGroup;
|
|
5
11
|
camera: Camera;
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
/**
|
|
13
|
+
* Constructs a new bundle group.
|
|
14
|
+
*
|
|
15
|
+
* @param {BundleGroup} bundleGroup - The bundle group.
|
|
16
|
+
* @param {Camera} camera - The camera the bundle group is rendered with.
|
|
17
|
+
*/
|
|
18
|
+
constructor(bundleGroup: BundleGroup, camera: Camera);
|
|
8
19
|
}
|
|
9
20
|
export default RenderBundle;
|
|
@@ -2,10 +2,28 @@ import { Camera } from "../../cameras/Camera.js";
|
|
|
2
2
|
import BundleGroup from "./BundleGroup.js";
|
|
3
3
|
import ChainMap from "./ChainMap.js";
|
|
4
4
|
import RenderBundle from "./RenderBundle.js";
|
|
5
|
+
/**
|
|
6
|
+
* This renderer module manages render bundles.
|
|
7
|
+
*
|
|
8
|
+
* @private
|
|
9
|
+
*/
|
|
5
10
|
declare class RenderBundles {
|
|
6
|
-
|
|
11
|
+
bundles: ChainMap<readonly [BundleGroup, Camera], RenderBundle>;
|
|
12
|
+
/**
|
|
13
|
+
* Constructs a new render bundle management component.
|
|
14
|
+
*/
|
|
7
15
|
constructor();
|
|
8
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Returns a render bundle for the given bundle group and camera.
|
|
18
|
+
*
|
|
19
|
+
* @param {BundleGroup} bundleGroup - The bundle group.
|
|
20
|
+
* @param {Camera} camera - The camera the bundle group is rendered with.
|
|
21
|
+
* @return {RenderBundle} The render bundle.
|
|
22
|
+
*/
|
|
23
|
+
get(bundleGroup: BundleGroup, camera: Camera): RenderBundle;
|
|
24
|
+
/**
|
|
25
|
+
* Frees all internal resources.
|
|
26
|
+
*/
|
|
9
27
|
dispose(): void;
|
|
10
28
|
}
|
|
11
29
|
export default RenderBundles;
|
|
@@ -3,6 +3,14 @@ import { Vector4 } from "../../math/Vector4.js";
|
|
|
3
3
|
import { DepthTexture } from "../../textures/DepthTexture.js";
|
|
4
4
|
import { Texture } from "../../textures/Texture.js";
|
|
5
5
|
import ClippingContext from "./ClippingContext.js";
|
|
6
|
+
/**
|
|
7
|
+
* Any render or compute command is executed in a specific context that defines
|
|
8
|
+
* the state of the renderer and its backend. Typical examples for such context
|
|
9
|
+
* data are the current clear values or data from the active framebuffer. This
|
|
10
|
+
* module is used to represent these contexts as objects.
|
|
11
|
+
*
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
6
14
|
declare class RenderContext {
|
|
7
15
|
id: number;
|
|
8
16
|
color: boolean;
|
|
@@ -23,21 +31,37 @@ declare class RenderContext {
|
|
|
23
31
|
viewportValue: Vector4;
|
|
24
32
|
scissor: boolean;
|
|
25
33
|
scissorValue: Vector4;
|
|
34
|
+
renderTarget: RenderTarget | null;
|
|
26
35
|
textures: Texture[] | null;
|
|
27
36
|
depthTexture: DepthTexture | null;
|
|
28
37
|
activeCubeFace: number;
|
|
29
38
|
sampleCount: number;
|
|
30
39
|
width: number;
|
|
31
40
|
height: number;
|
|
41
|
+
occlusionQueryCount: number;
|
|
42
|
+
clippingContext: ClippingContext | null;
|
|
32
43
|
readonly isRenderContext: true;
|
|
33
|
-
clippingContext?: ClippingContext | undefined;
|
|
34
44
|
depthClearValue?: number | undefined;
|
|
35
45
|
stencilClearValue?: number | undefined;
|
|
36
|
-
renderTarget?: RenderTarget | undefined;
|
|
37
46
|
activeMipmapLevel?: number | undefined;
|
|
38
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Constructs a new render context.
|
|
49
|
+
*/
|
|
39
50
|
constructor();
|
|
51
|
+
/**
|
|
52
|
+
* Returns the cache key of this render context.
|
|
53
|
+
*
|
|
54
|
+
* @return {Number} The cache key.
|
|
55
|
+
*/
|
|
40
56
|
getCacheKey(): number;
|
|
41
57
|
}
|
|
58
|
+
/**
|
|
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.
|
|
62
|
+
*
|
|
63
|
+
* @param {RenderContext} renderContext - The render context.
|
|
64
|
+
* @return {Number} The cache key.
|
|
65
|
+
*/
|
|
42
66
|
export declare function getCacheKey(renderContext: RenderContext): number;
|
|
43
67
|
export default RenderContext;
|
|
@@ -1,17 +1,48 @@
|
|
|
1
1
|
import { Camera } from "../../cameras/Camera.js";
|
|
2
|
-
import { Object3D } from "../../core/Object3D.js";
|
|
3
2
|
import { RenderTarget } from "../../core/RenderTarget.js";
|
|
3
|
+
import { Scene } from "../../scenes/Scene.js";
|
|
4
4
|
import ChainMap from "./ChainMap.js";
|
|
5
5
|
import RenderContext from "./RenderContext.js";
|
|
6
|
+
/**
|
|
7
|
+
* This module manages the render contexts of the renderer.
|
|
8
|
+
*
|
|
9
|
+
* @private
|
|
10
|
+
*/
|
|
6
11
|
declare class RenderContexts {
|
|
7
12
|
chainMaps: {
|
|
8
|
-
[attachmentState: string]: ChainMap<readonly [
|
|
13
|
+
[attachmentState: string]: ChainMap<readonly [Scene, Camera], RenderContext> | undefined;
|
|
9
14
|
};
|
|
15
|
+
/**
|
|
16
|
+
* Constructs a new render context management component.
|
|
17
|
+
*/
|
|
10
18
|
constructor();
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Returns a render context for the given scene, camera and render target.
|
|
21
|
+
*
|
|
22
|
+
* @param {Scene} scene - The scene.
|
|
23
|
+
* @param {Camera} camera - The camera that is used to render the scene.
|
|
24
|
+
* @param {RenderTarget?} [renderTarget=null] - The active render target.
|
|
25
|
+
* @return {RenderContext} The render context.
|
|
26
|
+
*/
|
|
27
|
+
get(scene: Scene, camera: Camera, renderTarget?: RenderTarget | null): RenderContext;
|
|
28
|
+
/**
|
|
29
|
+
* Returns a render context intended for clear operations.
|
|
30
|
+
*
|
|
31
|
+
* @param {RenderTarget?} [renderTarget=null] - The active render target.
|
|
32
|
+
* @return {RenderContext} The render context.
|
|
33
|
+
*/
|
|
34
|
+
getForClear(renderTarget?: RenderTarget | null): RenderContext;
|
|
35
|
+
/**
|
|
36
|
+
* Returns a chain map for the given attachment state.
|
|
37
|
+
*
|
|
38
|
+
* @private
|
|
39
|
+
* @param {String} attachmentState - The attachment state.
|
|
40
|
+
* @return {ChainMap} The chain map.
|
|
41
|
+
*/
|
|
42
|
+
_getChainMap(attachmentState: string): ChainMap<readonly [Scene, Camera], RenderContext>;
|
|
43
|
+
/**
|
|
44
|
+
* Frees internal resources.
|
|
45
|
+
*/
|
|
15
46
|
dispose(): void;
|
|
16
47
|
}
|
|
17
48
|
export default RenderContexts;
|
|
@@ -23,6 +23,17 @@ export interface RenderItem {
|
|
|
23
23
|
group: GeometryGroup | null;
|
|
24
24
|
clippingContext: ClippingContext | null;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* When the renderer analyzes the scene at the beginning of a render call,
|
|
28
|
+
* it stores 3D object for further processing in render lists. Depending on the
|
|
29
|
+
* properties of a 3D objects (like their transformation or material state), the
|
|
30
|
+
* objects are maintained in ordered lists for the actual rendering.
|
|
31
|
+
*
|
|
32
|
+
* Render lists are unique per scene and camera combination.
|
|
33
|
+
*
|
|
34
|
+
* @private
|
|
35
|
+
* @augments Pipeline
|
|
36
|
+
*/
|
|
26
37
|
declare class RenderList {
|
|
27
38
|
renderItems: RenderItem[];
|
|
28
39
|
renderItemsIndex: number;
|
|
@@ -35,8 +46,38 @@ declare class RenderList {
|
|
|
35
46
|
scene: Object3D;
|
|
36
47
|
camera: Camera;
|
|
37
48
|
occlusionQueryCount: number;
|
|
49
|
+
/**
|
|
50
|
+
* Constructs a render list.
|
|
51
|
+
*
|
|
52
|
+
* @param {Lighting} lighting - The lighting management component.
|
|
53
|
+
* @param {Scene} scene - The scene.
|
|
54
|
+
* @param {Camera} camera - The camera the scene is rendered with.
|
|
55
|
+
*/
|
|
38
56
|
constructor(lighting: Lighting, scene: Object3D, camera: Camera);
|
|
57
|
+
/**
|
|
58
|
+
* This method is called right at the beginning of a render call
|
|
59
|
+
* before the scene is analyzed. It prepares the internal data
|
|
60
|
+
* structures for the upcoming render lists generation.
|
|
61
|
+
*
|
|
62
|
+
* @return {RenderList} A reference to this render list.
|
|
63
|
+
*/
|
|
39
64
|
begin(): this;
|
|
65
|
+
/**
|
|
66
|
+
* Returns a render item for the giving render item state. The state is defined
|
|
67
|
+
* by a series of object-related parameters.
|
|
68
|
+
*
|
|
69
|
+
* The method avoids object creation by holding render items and reusing them in
|
|
70
|
+
* subsequent render calls (just with different property values).
|
|
71
|
+
*
|
|
72
|
+
* @param {Object3D} object - The 3D object.
|
|
73
|
+
* @param {BufferGeometry} geometry - The 3D object's geometry.
|
|
74
|
+
* @param {Material} material - The 3D object's material.
|
|
75
|
+
* @param {Number} groupOrder - The current group order.
|
|
76
|
+
* @param {Number} z - Th 3D object's depth value (z value in clip space).
|
|
77
|
+
* @param {Number?} group - {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
78
|
+
* @param {ClippingContext} clippingContext - The current clipping context.
|
|
79
|
+
* @return {Object} The render item.
|
|
80
|
+
*/
|
|
40
81
|
getNextRenderItem(
|
|
41
82
|
object: Object3D,
|
|
42
83
|
geometry: BufferGeometry,
|
|
@@ -46,6 +87,18 @@ declare class RenderList {
|
|
|
46
87
|
group: GeometryGroup | null,
|
|
47
88
|
clippingContext: ClippingContext | null,
|
|
48
89
|
): RenderItem;
|
|
90
|
+
/**
|
|
91
|
+
* Pushes the given object as a render item to the internal render lists.
|
|
92
|
+
* The selected lists depend on the object properties.
|
|
93
|
+
*
|
|
94
|
+
* @param {Object3D} object - The 3D object.
|
|
95
|
+
* @param {BufferGeometry} geometry - The 3D object's geometry.
|
|
96
|
+
* @param {Material} material - The 3D object's material.
|
|
97
|
+
* @param {Number} groupOrder - The current group order.
|
|
98
|
+
* @param {Number} z - Th 3D object's depth value (z value in clip space).
|
|
99
|
+
* @param {Number?} group - {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
100
|
+
* @param {ClippingContext} clippingContext - The current clipping context.
|
|
101
|
+
*/
|
|
49
102
|
push(
|
|
50
103
|
object: Object3D,
|
|
51
104
|
geometry: BufferGeometry,
|
|
@@ -55,6 +108,18 @@ declare class RenderList {
|
|
|
55
108
|
group: GeometryGroup | null,
|
|
56
109
|
clippingContext: ClippingContext | null,
|
|
57
110
|
): void;
|
|
111
|
+
/**
|
|
112
|
+
* Inserts the given object as a render item at the start of the internal render lists.
|
|
113
|
+
* The selected lists depend on the object properties.
|
|
114
|
+
*
|
|
115
|
+
* @param {Object3D} object - The 3D object.
|
|
116
|
+
* @param {BufferGeometry} geometry - The 3D object's geometry.
|
|
117
|
+
* @param {Material} material - The 3D object's material.
|
|
118
|
+
* @param {Number} groupOrder - The current group order.
|
|
119
|
+
* @param {Number} z - Th 3D object's depth value (z value in clip space).
|
|
120
|
+
* @param {Number?} group - {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
121
|
+
* @param {ClippingContext} clippingContext - The current clipping context.
|
|
122
|
+
*/
|
|
58
123
|
unshift(
|
|
59
124
|
object: Object3D,
|
|
60
125
|
geometry: BufferGeometry,
|
|
@@ -64,12 +129,32 @@ declare class RenderList {
|
|
|
64
129
|
group: GeometryGroup | null,
|
|
65
130
|
clippingContext: ClippingContext | null,
|
|
66
131
|
): void;
|
|
132
|
+
/**
|
|
133
|
+
* Pushes render bundle group data into the render list.
|
|
134
|
+
*
|
|
135
|
+
* @param {Object} group - Bundle group data.
|
|
136
|
+
*/
|
|
67
137
|
pushBundle(group: Bundle): void;
|
|
138
|
+
/**
|
|
139
|
+
* Pushes a light into the render list.
|
|
140
|
+
*
|
|
141
|
+
* @param {Light} light - The light.
|
|
142
|
+
*/
|
|
68
143
|
pushLight(light: Light): void;
|
|
144
|
+
/**
|
|
145
|
+
* Sorts the internal render lists.
|
|
146
|
+
*
|
|
147
|
+
* @param {function(Any, Any): Number} customOpaqueSort - A custom sort function for opaque objects.
|
|
148
|
+
* @param {function(Any, Any): Number} customTransparentSort - A custom sort function for transparent objects.
|
|
149
|
+
*/
|
|
69
150
|
sort(
|
|
70
151
|
customOpaqueSort: ((a: RenderItem, b: RenderItem) => number) | null,
|
|
71
152
|
customTransparentSort: ((a: RenderItem, b: RenderItem) => number) | null,
|
|
72
153
|
): void;
|
|
154
|
+
/**
|
|
155
|
+
* This method performs finalizing tasks right after the render lists
|
|
156
|
+
* have been generated.
|
|
157
|
+
*/
|
|
73
158
|
finish(): void;
|
|
74
159
|
}
|
|
75
160
|
export default RenderList;
|
|
@@ -3,11 +3,32 @@ import { Object3D } from "../../core/Object3D.js";
|
|
|
3
3
|
import ChainMap from "./ChainMap.js";
|
|
4
4
|
import Lighting from "./Lighting.js";
|
|
5
5
|
import RenderList from "./RenderList.js";
|
|
6
|
+
/**
|
|
7
|
+
* This renderer module manages the render lists which are unique
|
|
8
|
+
* per scene and camera combination.
|
|
9
|
+
*
|
|
10
|
+
* @private
|
|
11
|
+
*/
|
|
6
12
|
declare class RenderLists {
|
|
7
13
|
lighting: Lighting;
|
|
8
14
|
lists: ChainMap<readonly [Object3D, Camera], RenderList>;
|
|
15
|
+
/**
|
|
16
|
+
* Constructs a render lists management component.
|
|
17
|
+
*
|
|
18
|
+
* @param {Lighting} lighting - The lighting management component.
|
|
19
|
+
*/
|
|
9
20
|
constructor(lighting: Lighting);
|
|
21
|
+
/**
|
|
22
|
+
* Returns a render list for the given scene and camera.
|
|
23
|
+
*
|
|
24
|
+
* @param {Scene} scene - The scene.
|
|
25
|
+
* @param {Camera} camera - The camera.
|
|
26
|
+
* @return {RenderList} The render list.
|
|
27
|
+
*/
|
|
10
28
|
get(scene: Object3D, camera: Camera): RenderList;
|
|
29
|
+
/**
|
|
30
|
+
* Frees all internal resources.
|
|
31
|
+
*/
|
|
11
32
|
dispose(): void;
|
|
12
33
|
}
|
|
13
34
|
export default RenderLists;
|