@types/three 0.171.0 → 0.172.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +0 -5
  3. three/examples/jsm/controls/ArcballControls.d.ts +1 -1
  4. three/examples/jsm/controls/OrbitControls.d.ts +5 -0
  5. three/examples/jsm/csm/CSMShadowNode.d.ts +2 -3
  6. three/examples/jsm/geometries/InstancedPointsGeometry.d.ts +13 -0
  7. three/examples/jsm/helpers/VertexNormalsHelper.d.ts +2 -0
  8. three/examples/jsm/lines/LineSegments2.d.ts +3 -1
  9. three/examples/jsm/modifiers/CurveModifier.d.ts +1 -1
  10. three/examples/jsm/modifiers/CurveModifierGPU.d.ts +1 -1
  11. three/examples/jsm/objects/InstancedPoints.d.ts +10 -0
  12. three/examples/jsm/postprocessing/OutlinePass.d.ts +1 -1
  13. three/examples/jsm/postprocessing/UnrealBloomPass.d.ts +1 -1
  14. three/examples/jsm/utils/ShadowMapViewer.d.ts +2 -2
  15. three/package.json +2 -2
  16. three/src/Three.Core.d.ts +2 -1
  17. three/src/Three.TSL.d.ts +9 -4
  18. three/src/Three.WebGPU.Nodes.d.ts +2 -2
  19. three/src/Three.WebGPU.d.ts +2 -2
  20. three/src/cameras/CubeCamera.d.ts +19 -2
  21. three/src/core/RenderTarget.d.ts +3 -5
  22. three/src/core/RenderTarget3D.d.ts +9 -0
  23. three/src/core/RenderTargetArray.d.ts +9 -0
  24. three/src/materials/Material.d.ts +3 -1
  25. three/src/materials/MeshDepthMaterial.d.ts +0 -5
  26. three/src/materials/MeshDistanceMaterial.d.ts +0 -5
  27. three/src/materials/nodes/Line2NodeMaterial.d.ts +1 -0
  28. three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +6 -6
  29. three/src/materials/nodes/NodeMaterial.d.ts +3 -0
  30. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +56 -0
  31. three/src/nodes/Nodes.d.ts +1 -6
  32. three/src/nodes/TSL.d.ts +2 -3
  33. three/src/nodes/accessors/Arrays.d.ts +3 -2
  34. three/src/nodes/accessors/BufferAttributeNode.d.ts +117 -0
  35. three/src/nodes/accessors/BufferNode.d.ts +4 -4
  36. three/src/nodes/accessors/MaterialNode.d.ts +3 -3
  37. three/src/nodes/accessors/ModelNode.d.ts +10 -2
  38. three/src/nodes/accessors/ModelViewProjectionNode.d.ts +2 -6
  39. three/src/nodes/accessors/StorageBufferNode.d.ts +5 -1
  40. three/src/nodes/accessors/TextureNode.d.ts +5 -0
  41. three/src/nodes/accessors/UniformArrayNode.d.ts +3 -2
  42. three/src/nodes/core/Node.d.ts +237 -0
  43. three/src/nodes/core/NodeAttribute.d.ts +13 -0
  44. three/src/nodes/core/NodeBuilder.d.ts +1 -2
  45. three/src/nodes/core/NodeCache.d.ts +21 -0
  46. three/src/nodes/core/NodeParser.d.ts +11 -0
  47. three/src/nodes/core/NodeUniform.d.ts +28 -0
  48. three/src/nodes/core/NodeVar.d.ts +12 -0
  49. three/src/nodes/core/NodeVarying.d.ts +14 -0
  50. three/src/nodes/core/StructTypeNode.d.ts +19 -1
  51. three/src/nodes/core/UniformNode.d.ts +44 -0
  52. three/src/nodes/core/VaryingNode.d.ts +3 -0
  53. three/src/nodes/core/constants.d.ts +35 -0
  54. three/src/nodes/display/PassNode.d.ts +1 -1
  55. three/src/nodes/fog/Fog.d.ts +26 -0
  56. three/src/nodes/gpgpu/ComputeNode.d.ts +6 -1
  57. three/src/nodes/gpgpu/WorkgroupInfoNode.d.ts +2 -0
  58. three/src/nodes/lighting/ShadowBaseNode.d.ts +15 -0
  59. three/src/nodes/lighting/ShadowNode.d.ts +2 -1
  60. three/src/nodes/math/MathNode.d.ts +13 -4
  61. three/src/nodes/tsl/TSLCore.d.ts +48 -16
  62. three/src/nodes/utils/EquirectUVNode.d.ts +2 -2
  63. three/src/nodes/utils/LoopNode.d.ts +23 -2
  64. three/src/objects/ClippingGroup.d.ts +1 -1
  65. three/src/renderers/WebGLRenderer.d.ts +8 -8
  66. three/src/renderers/common/Animation.d.ts +30 -0
  67. three/src/renderers/common/Attributes.d.ts +31 -0
  68. three/src/renderers/common/Backend.d.ts +11 -0
  69. three/src/renderers/common/Background.d.ts +22 -0
  70. three/src/renderers/common/BindGroup.d.ts +15 -0
  71. three/src/renderers/common/Binding.d.ts +24 -0
  72. three/src/renderers/common/Bindings.d.ts +54 -0
  73. three/src/renderers/common/Buffer.d.ts +31 -0
  74. three/src/renderers/common/BufferUtils.d.ts +26 -0
  75. three/src/renderers/common/BundleGroup.d.ts +22 -0
  76. three/src/renderers/common/ChainMap.d.ts +31 -1
  77. three/src/renderers/common/ClippingContext.d.ts +45 -0
  78. three/src/renderers/common/Color4.d.ts +36 -0
  79. three/src/renderers/common/ComputePipeline.d.ts +12 -0
  80. three/src/renderers/common/CubeRenderTarget.d.ts +13 -0
  81. three/src/renderers/common/DataMap.d.ts +30 -0
  82. three/src/renderers/common/Geometries.d.ts +52 -0
  83. three/src/renderers/common/Info.d.ts +27 -0
  84. three/src/renderers/common/Pipeline.d.ts +11 -0
  85. three/src/renderers/common/Pipelines.d.ts +104 -0
  86. three/src/renderers/common/ProgrammableStage.d.ts +19 -1
  87. three/src/renderers/common/RenderBundle.d.ts +15 -4
  88. three/src/renderers/common/RenderBundles.d.ts +20 -2
  89. three/src/renderers/common/RenderContext.d.ts +22 -0
  90. three/src/renderers/common/RenderContexts.d.ts +42 -3
  91. three/src/renderers/common/RenderList.d.ts +85 -0
  92. three/src/renderers/common/RenderLists.d.ts +21 -0
  93. three/src/renderers/common/RenderObject.d.ts +152 -1
  94. three/src/renderers/common/RenderObjects.d.ts +53 -0
  95. three/src/renderers/common/RenderPipeline.d.ts +13 -0
  96. three/src/renderers/common/Renderer.d.ts +583 -6
  97. three/src/renderers/common/{PostProcessingUtils.d.ts → RendererUtils.d.ts} +16 -4
  98. three/src/renderers/common/StorageBufferAttribute.d.ts +1 -1
  99. three/src/renderers/common/Textures.d.ts +66 -0
  100. three/src/renderers/common/Uniform.d.ts +106 -0
  101. three/src/renderers/common/UniformBuffer.d.ts +12 -0
  102. three/src/renderers/common/UniformsGroup.d.ts +103 -0
  103. three/src/renderers/common/nodes/NodeBuilderState.d.ts +30 -0
  104. three/src/renderers/common/nodes/NodeLibrary.d.ts +71 -0
  105. three/src/renderers/common/nodes/NodeUniform.d.ts +154 -0
  106. three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +14 -2
  107. three/src/renderers/common/nodes/Nodes.d.ts +185 -11
  108. three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +10 -0
  109. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +11 -0
  110. three/src/textures/DataTexture.d.ts +2 -2
  111. three/src/textures/Texture.d.ts +3 -0
  112. three/examples/jsm/animation/MMDAnimationHelper.d.ts +0 -99
  113. three/examples/jsm/animation/MMDPhysics.d.ts +0 -128
  114. three/examples/jsm/exporters/MMDExporter.d.ts +0 -11
  115. three/examples/jsm/loaders/MMDLoader.d.ts +0 -60
  116. three/examples/jsm/shaders/MMDToonShader.d.ts +0 -15
  117. three/src/Three.Legacy.d.ts +0 -20
  118. three/src/nodes/core/UniformGroup.d.ts +0 -7
  119. three/src/nodes/fog/FogExp2Node.d.ts +0 -14
  120. three/src/nodes/fog/FogNode.d.ts +0 -20
  121. 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;
@@ -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;
@@ -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
- type: "compute" | "vertex" | "fragment",
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 { Object3D } from "../../core/Object3D.js";
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
- scene: Object3D;
10
+ bundleGroup: BundleGroup;
5
11
  camera: Camera;
6
- constructor(scene: Object3D, camera: Camera);
7
- clone(): RenderBundle & this;
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
- lists: ChainMap<readonly [BundleGroup, Camera], RenderBundle>;
11
+ bundles: ChainMap<readonly [BundleGroup, Camera], RenderBundle>;
12
+ /**
13
+ * Constructs a new render bundle management component.
14
+ */
7
15
  constructor();
8
- get(scene: BundleGroup, camera: Camera): RenderBundle;
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;
@@ -36,8 +44,22 @@ declare class RenderContext {
36
44
  renderTarget?: RenderTarget | undefined;
37
45
  activeMipmapLevel?: number | undefined;
38
46
  occlusionQueryCount?: number | undefined;
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.
60
+ *
61
+ * @param {RenderContext} renderContext - The render context.
62
+ * @return {Number} The cache key.
63
+ */
42
64
  export declare function getCacheKey(renderContext: RenderContext): number;
43
65
  export default RenderContext;
@@ -3,15 +3,54 @@ import { Object3D } from "../../core/Object3D.js";
3
3
  import { RenderTarget } from "../../core/RenderTarget.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 [Object3D, Camera], RenderContext> | undefined;
13
+ [attachmentState: string]:
14
+ | ChainMap<
15
+ | readonly [Object3D, Camera]
16
+ | readonly [Object3D, Camera, {
17
+ id: "default";
18
+ }],
19
+ RenderContext
20
+ >
21
+ | undefined;
9
22
  };
23
+ /**
24
+ * Constructs a new render context management component.
25
+ */
10
26
  constructor();
11
- get(scene: Object3D, camera: Camera, renderTarget?: RenderTarget | null): RenderContext;
27
+ /**
28
+ * Returns a render context for the given scene, camera and render target.
29
+ *
30
+ * @param {Scene?} [scene=null] - The scene. The parameter can become `null` e.g. when the renderer clears a render target.
31
+ * @param {Camera?} [camera=null] - The camera that is used to render the scene. The parameter can become `null` e.g. when the renderer clears a render target.
32
+ * @param {RenderTarget?} [renderTarget=null] - The active render target.
33
+ * @return {RenderContext} The render context.
34
+ */
35
+ get(scene?: Object3D | null, camera?: Camera | null, renderTarget?: RenderTarget | null): RenderContext;
36
+ /**
37
+ * Returns a chain map for the given attachment state.
38
+ *
39
+ * @param {String} attachmentState - The attachment state.
40
+ * @return {ChainMap} The chain map.
41
+ */
12
42
  getChainMap(
13
43
  attachmentState: string,
14
- ): ChainMap<readonly [Object3D<import("../../core/Object3D.js").Object3DEventMap>, Camera], RenderContext>;
44
+ ): ChainMap<
45
+ | readonly [Object3D<import("../../core/Object3D.js").Object3DEventMap>, Camera]
46
+ | readonly [Object3D<import("../../core/Object3D.js").Object3DEventMap>, Camera, {
47
+ id: "default";
48
+ }],
49
+ RenderContext
50
+ >;
51
+ /**
52
+ * Frees internal resources.
53
+ */
15
54
  dispose(): void;
16
55
  }
17
56
  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} customOpaqueSort - A custom sort function for opaque objects.
148
+ * @param {Function} 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;