@types/three 0.173.0 → 0.175.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 (136) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +1 -1
  3. three/examples/jsm/animation/CCDIKSolver.d.ts +3 -2
  4. three/examples/jsm/controls/PointerLockControls.d.ts +4 -1
  5. three/examples/jsm/geometries/ParametricFunctions.d.ts +8 -0
  6. three/examples/jsm/interactive/HTMLMesh.d.ts +9 -2
  7. three/examples/jsm/loaders/LUTImageLoader.d.ts +2 -2
  8. three/examples/jsm/loaders/MTLLoader.d.ts +2 -1
  9. three/examples/jsm/misc/Timer.d.ts +13 -2
  10. three/examples/jsm/objects/Reflector.d.ts +1 -0
  11. three/examples/jsm/postprocessing/HalftonePass.d.ts +1 -1
  12. three/examples/jsm/postprocessing/LUTPass.d.ts +1 -1
  13. three/examples/jsm/postprocessing/SMAAPass.d.ts +1 -1
  14. three/examples/jsm/transpiler/AST.d.ts +218 -1
  15. three/examples/jsm/transpiler/TSLEncoder.d.ts +35 -1
  16. three/examples/jsm/tsl/math/Bayer.d.ts +4 -0
  17. three/examples/jsm/tsl/utils/Raymarching.d.ts +9 -0
  18. three/examples/jsm/webxr/VRButton.d.ts +4 -2
  19. three/package.json +2 -2
  20. three/src/Three.TSL.d.ts +7 -1
  21. three/src/Three.d.ts +6 -1
  22. three/src/animation/AnimationAction.d.ts +219 -19
  23. three/src/animation/AnimationClip.d.ts +140 -28
  24. three/src/animation/AnimationMixer.d.ts +100 -8
  25. three/src/animation/AnimationObjectGroup.d.ts +55 -14
  26. three/src/animation/AnimationUtils.d.ts +154 -43
  27. three/src/animation/KeyframeTrack.d.ts +134 -25
  28. three/src/animation/PropertyBinding.d.ts +89 -31
  29. three/src/animation/PropertyMixer.d.ts +62 -5
  30. three/src/animation/tracks/BooleanKeyframeTrack.d.ts +12 -4
  31. three/src/animation/tracks/ColorKeyframeTrack.d.ts +10 -4
  32. three/src/animation/tracks/NumberKeyframeTrack.d.ts +10 -4
  33. three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +10 -4
  34. three/src/animation/tracks/StringKeyframeTrack.d.ts +12 -4
  35. three/src/animation/tracks/VectorKeyframeTrack.d.ts +10 -4
  36. three/src/constants.d.ts +2 -2
  37. three/src/core/BufferAttribute.d.ts +11 -0
  38. three/src/core/BufferGeometry.d.ts +1 -3
  39. three/src/core/Raycaster.d.ts +4 -0
  40. three/src/extras/Controls.d.ts +1 -1
  41. three/src/extras/Earcut.d.ts +5 -3
  42. three/src/extras/ImageUtils.d.ts +1 -0
  43. three/src/extras/PMREMGenerator.d.ts +15 -2
  44. three/src/geometries/TorusGeometry.d.ts +5 -6
  45. three/src/lights/PointLight.d.ts +1 -1
  46. three/src/loaders/FileLoader.d.ts +2 -2
  47. three/src/loaders/LoaderUtils.d.ts +0 -5
  48. three/src/materials/Material.d.ts +3 -0
  49. three/src/materials/nodes/NodeMaterial.d.ts +2 -1
  50. three/src/materials/nodes/VolumeNodeMaterial.d.ts +14 -2
  51. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +4 -4
  52. three/src/nodes/Nodes.d.ts +2 -2
  53. three/src/nodes/TSL.d.ts +1 -0
  54. three/src/nodes/accessors/BufferAttributeNode.d.ts +36 -26
  55. three/src/nodes/accessors/Lights.d.ts +1 -1
  56. three/src/nodes/accessors/MaterialProperties.d.ts +5 -0
  57. three/src/nodes/accessors/ModelNode.d.ts +1 -0
  58. three/src/nodes/accessors/Object3DNode.d.ts +7 -5
  59. three/src/nodes/accessors/SkinningNode.d.ts +4 -3
  60. three/src/nodes/accessors/StorageTextureNode.d.ts +2 -2
  61. three/src/nodes/accessors/Texture3DNode.d.ts +2 -2
  62. three/src/nodes/accessors/TextureNode.d.ts +3 -1
  63. three/src/nodes/code/ExpressionNode.d.ts +3 -2
  64. three/src/nodes/code/ScriptableNode.d.ts +1 -1
  65. three/src/nodes/code/ScriptableValueNode.d.ts +1 -1
  66. three/src/nodes/core/LightingModel.d.ts +13 -28
  67. three/src/nodes/core/Node.d.ts +24 -24
  68. three/src/nodes/core/NodeAttribute.d.ts +3 -3
  69. three/src/nodes/core/NodeCache.d.ts +2 -2
  70. three/src/nodes/core/NodeParser.d.ts +1 -1
  71. three/src/nodes/core/NodeUniform.d.ts +4 -4
  72. three/src/nodes/core/NodeVar.d.ts +4 -4
  73. three/src/nodes/core/NodeVarying.d.ts +2 -2
  74. three/src/nodes/core/StructTypeNode.d.ts +3 -3
  75. three/src/nodes/core/UniformNode.d.ts +7 -7
  76. three/src/nodes/core/constants.d.ts +0 -1
  77. three/src/nodes/display/PassNode.d.ts +10 -1
  78. three/src/nodes/functions/BSDF/LTC.d.ts +5 -1
  79. three/src/nodes/functions/VolumetricLightingModel.d.ts +6 -0
  80. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +1 -12
  81. three/src/nodes/lighting/AnalyticLightNode.d.ts +13 -1
  82. three/src/nodes/lighting/LightingContextNode.d.ts +18 -4
  83. three/src/nodes/lighting/LightsNode.d.ts +24 -0
  84. three/src/nodes/lighting/PointLightNode.d.ts +8 -7
  85. three/src/nodes/lighting/ShadowBaseNode.d.ts +3 -0
  86. three/src/nodes/math/ConditionalNode.d.ts +4 -4
  87. three/src/nodes/math/MathNode.d.ts +20 -12
  88. three/src/nodes/math/OperatorNode.d.ts +57 -26
  89. three/src/nodes/tsl/TSLBase.d.ts +1 -0
  90. three/src/nodes/tsl/TSLCore.d.ts +3 -0
  91. three/src/nodes/utils/DebugNode.d.ts +20 -0
  92. three/src/nodes/utils/ReflectorNode.d.ts +1 -0
  93. three/src/nodes/utils/SpriteSheetUVNode.d.ts +2 -2
  94. three/src/objects/LOD.d.ts +4 -3
  95. three/src/renderers/common/Animation.d.ts +6 -6
  96. three/src/renderers/common/Attributes.d.ts +2 -2
  97. three/src/renderers/common/BindGroup.d.ts +2 -2
  98. three/src/renderers/common/Binding.d.ts +2 -2
  99. three/src/renderers/common/Buffer.d.ts +3 -3
  100. three/src/renderers/common/BufferUtils.d.ts +7 -8
  101. three/src/renderers/common/BundleGroup.d.ts +2 -2
  102. three/src/renderers/common/ChainMap.d.ts +3 -3
  103. three/src/renderers/common/ClippingContext.d.ts +3 -3
  104. three/src/renderers/common/Color4.d.ts +8 -8
  105. three/src/renderers/common/ComputePipeline.d.ts +1 -1
  106. three/src/renderers/common/CubeRenderTarget.d.ts +6 -0
  107. three/src/renderers/common/DataMap.d.ts +2 -2
  108. three/src/renderers/common/Geometries.d.ts +4 -4
  109. three/src/renderers/common/Info.d.ts +2 -2
  110. three/src/renderers/common/Pipeline.d.ts +1 -1
  111. three/src/renderers/common/Pipelines.d.ts +9 -9
  112. three/src/renderers/common/ProgrammableStage.d.ts +4 -4
  113. three/src/renderers/common/RenderContext.d.ts +2 -2
  114. three/src/renderers/common/RenderContexts.d.ts +3 -3
  115. three/src/renderers/common/RenderList.d.ts +11 -11
  116. three/src/renderers/common/RenderObject.d.ts +13 -13
  117. three/src/renderers/common/RenderObjects.d.ts +3 -3
  118. three/src/renderers/common/RenderPipeline.d.ts +1 -1
  119. three/src/renderers/common/Renderer.d.ts +143 -108
  120. three/src/renderers/common/Textures.d.ts +6 -6
  121. three/src/renderers/common/TimestampQueryPool.d.ts +13 -1
  122. three/src/renderers/common/Uniform.d.ts +13 -13
  123. three/src/renderers/common/UniformBuffer.d.ts +1 -1
  124. three/src/renderers/common/UniformsGroup.d.ts +13 -13
  125. three/src/renderers/common/XRManager.d.ts +79 -15
  126. three/src/renderers/common/XRRenderTarget.d.ts +4 -4
  127. three/src/renderers/common/extras/PMREMGenerator.d.ts +9 -2
  128. three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -3
  129. three/src/renderers/common/nodes/NodeLibrary.d.ts +11 -11
  130. three/src/renderers/common/nodes/NodeUniform.d.ts +9 -9
  131. three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +1 -1
  132. three/src/renderers/common/nodes/Nodes.d.ts +11 -11
  133. three/src/renderers/webgl/WebGLState.d.ts +7 -6
  134. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +1 -1
  135. three/src/textures/CanvasTexture.d.ts +1 -1
  136. three/examples/jsm/geometries/ParametricGeometries.d.ts +0 -32
@@ -6,8 +6,10 @@ import { Object3D } from "../../core/Object3D.js";
6
6
  import { RenderTarget } from "../../core/RenderTarget.js";
7
7
  import { Material } from "../../materials/Material.js";
8
8
  import { Box2 } from "../../math/Box2.js";
9
+ import { Box3 } from "../../math/Box3.js";
9
10
  import { ColorRepresentation } from "../../math/Color.js";
10
11
  import { Vector2 } from "../../math/Vector2.js";
12
+ import { Vector3 } from "../../math/Vector3.js";
11
13
  import { Vector4 } from "../../math/Vector4.js";
12
14
  import MRTNode from "../../nodes/core/MRTNode.js";
13
15
  import ComputeNode from "../../nodes/gpgpu/ComputeNode.js";
@@ -114,6 +116,7 @@ declare class Renderer {
114
116
  _renderTarget: RenderTarget | null;
115
117
  _activeCubeFace: number;
116
118
  _activeMipmapLevel: number;
119
+ _outputRenderTarget: RenderTarget | null;
117
120
  _mrt: MRTNode | null;
118
121
  _renderObjectFunction:
119
122
  | ((
@@ -156,7 +159,7 @@ declare class Renderer {
156
159
  onDeviceLost: (info: DeviceLostInfo) => void;
157
160
  _colorBufferType: TextureDataType;
158
161
  _initialized: boolean;
159
- _initPromise: Promise<void> | null;
162
+ _initPromise: Promise<this> | null;
160
163
  _compilationPromises: Promise<void>[] | null;
161
164
  transparent: boolean;
162
165
  opaque: boolean;
@@ -182,36 +185,41 @@ declare class Renderer {
182
185
  };
183
186
  localClippingEnabled?: boolean | undefined;
184
187
  /**
185
- * Constructs a new renderer.
188
+ * Renderer options.
186
189
  *
187
- * @param {Backend} backend - The backend the renderer is targeting (e.g. WebGPU or WebGL 2).
188
- * @param {Object} parameters - The configuration parameter.
189
- * @param {Boolean} [parameters.logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not.
190
- * @param {Boolean} [parameters.alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque.
191
- * @param {Boolean} [parameters.depth=true] - Whether the default framebuffer should have a depth buffer or not.
192
- * @param {Boolean} [parameters.stencil=false] - Whether the default framebuffer should have a stencil buffer or not.
193
- * @param {Boolean} [parameters.antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not.
194
- * @param {Number} [parameters.samples=0] - When `antialias` is `true`, `4` samples are used by default. This parameter can set to any other integer value than 0
190
+ * @typedef {Object} Renderer~Options
191
+ * @property {boolean} [logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not.
192
+ * @property {boolean} [alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque.
193
+ * @property {boolean} [depth=true] - Whether the default framebuffer should have a depth buffer or not.
194
+ * @property {boolean} [stencil=false] - Whether the default framebuffer should have a stencil buffer or not.
195
+ * @property {boolean} [antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not.
196
+ * @property {number} [samples=0] - When `antialias` is `true`, `4` samples are used by default. This parameter can set to any other integer value than 0
195
197
  * to overwrite the default.
196
- * @param {Function?} [parameters.getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted.
197
- * @param {Number} [parameters.colorBufferType=HalfFloatType] - Defines the type of color buffers. The default `HalfFloatType` is recommend for best
198
+ * @property {?Function} [getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted.
199
+ * @property {number} [colorBufferType=HalfFloatType] - Defines the type of color buffers. The default `HalfFloatType` is recommend for best
198
200
  * quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though.
199
201
  */
202
+ /**
203
+ * Constructs a new renderer.
204
+ *
205
+ * @param {Backend} backend - The backend the renderer is targeting (e.g. WebGPU or WebGL 2).
206
+ * @param {Renderer~Options} [parameters] - The configuration parameter.
207
+ */
200
208
  constructor(backend: Backend, parameters?: RendererParameters);
201
209
  /**
202
210
  * Initializes the renderer so it is ready for usage.
203
211
  *
204
212
  * @async
205
- * @return {Promise} A Promise that resolves when the renderer has been initialized.
213
+ * @return {Promise<this>} A Promise that resolves when the renderer has been initialized.
206
214
  */
207
- init(): Promise<void>;
215
+ init(): Promise<this>;
208
216
  /**
209
217
  * The coordinate system of the renderer. The value of this property
210
218
  * depends on the selected backend. Either `THREE.WebGLCoordinateSystem` or
211
219
  * `THREE.WebGPUCoordinateSystem`.
212
220
  *
213
221
  * @readonly
214
- * @type {Number}
222
+ * @type {number}
215
223
  */
216
224
  get coordinateSystem(): import("../../constants.js").CoordinateSystem;
217
225
  /**
@@ -226,8 +234,8 @@ declare class Renderer {
226
234
  * @async
227
235
  * @param {Object3D} scene - The scene or 3D object to precompile.
228
236
  * @param {Camera} camera - The camera that is used to render the scene.
229
- * @param {Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added.
230
- * @return {Promise<Array>} A Promise that resolves when the compile has been finished.
237
+ * @param {?Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added.
238
+ * @return {Promise<Array|undefined>} A Promise that resolves when the compile has been finished.
231
239
  */
232
240
  compileAsync(scene: Object3D, camera: Camera, targetScene?: Object3D | null): Promise<void>;
233
241
  /**
@@ -263,7 +271,7 @@ declare class Renderer {
263
271
  /**
264
272
  * Returns the color buffer type.
265
273
  *
266
- * @return {Number} The color buffer type.
274
+ * @return {number} The color buffer type.
267
275
  */
268
276
  getColorBufferType(): TextureDataType;
269
277
  /**
@@ -279,7 +287,7 @@ declare class Renderer {
279
287
  * @private
280
288
  * @param {Object} bundle - Render bundle data.
281
289
  * @param {Scene} sceneRef - The scene the render bundle belongs to.
282
- * @param {LightsNode} lightsNode - The current lights node.
290
+ * @param {LightsNode} lightsNode - The lights node.
283
291
  */
284
292
  _renderBundle(bundle: Bundle, sceneRef: Scene, lightsNode: LightsNode): void;
285
293
  /**
@@ -291,7 +299,7 @@ declare class Renderer {
291
299
  *
292
300
  * @param {Object3D} scene - The scene or 3D object to render.
293
301
  * @param {Camera} camera - The camera to render the scene with.
294
- * @return {Promise?} A Promise that resolve when the scene has been rendered.
302
+ * @return {?Promise} A Promise that resolve when the scene has been rendered.
295
303
  * Only returned when the renderer has not been initialized.
296
304
  */
297
305
  render(scene: Scene, camera: Camera): Promise<void> | undefined;
@@ -301,7 +309,7 @@ declare class Renderer {
301
309
  * pass and not inline to achieve more correct results.
302
310
  *
303
311
  * @private
304
- * @return {RenderTarget?} The render target. The method returns `null` if no output conversion should be applied.
312
+ * @return {?RenderTarget} The render target. The method returns `null` if no output conversion should be applied.
305
313
  */
306
314
  _getFrameBufferTarget(): RenderTarget<Texture> | null;
307
315
  /**
@@ -310,26 +318,33 @@ declare class Renderer {
310
318
  * @private
311
319
  * @param {Object3D} scene - The scene or 3D object to render.
312
320
  * @param {Camera} camera - The camera to render the scene with.
313
- * @param {Boolean} [useFrameBufferTarget=true] - Whether to use a framebuffer target or not.
321
+ * @param {boolean} [useFrameBufferTarget=true] - Whether to use a framebuffer target or not.
314
322
  * @return {RenderContext} The current render context.
315
323
  */
316
324
  _renderScene(scene: Scene, camera: Camera, useFrameBufferTarget?: boolean): RenderContext | undefined;
325
+ /**
326
+ * The output pass performs tone mapping and color space conversion.
327
+ *
328
+ * @private
329
+ * @param {RenderTarget} renderTarget - The current render target.
330
+ */
331
+ _renderOutput(renderTarget: RenderTarget): void;
317
332
  /**
318
333
  * Returns the maximum available anisotropy for texture filtering.
319
334
  *
320
- * @return {Number} The maximum available anisotropy.
335
+ * @return {number} The maximum available anisotropy.
321
336
  */
322
337
  getMaxAnisotropy(): number;
323
338
  /**
324
339
  * Returns the active cube face.
325
340
  *
326
- * @return {Number} The active cube face.
341
+ * @return {number} The active cube face.
327
342
  */
328
343
  getActiveCubeFace(): number;
329
344
  /**
330
345
  * Returns the active mipmap level.
331
346
  *
332
- * @return {Number} The active mipmap level.
347
+ * @return {number} The active mipmap level.
333
348
  */
334
349
  getActiveMipmapLevel(): number;
335
350
  /**
@@ -338,7 +353,7 @@ declare class Renderer {
338
353
  * for best compatibility.
339
354
  *
340
355
  * @async
341
- * @param {Function} callback - The application's animation loop.
356
+ * @param {?Function} callback - The application's animation loop.
342
357
  * @return {Promise} A Promise that resolves when the set has been executed.
343
358
  */
344
359
  setAnimationLoop(callback: ((time: DOMHighResTimeStamp, frame?: XRFrame) => void) | null): Promise<void>;
@@ -360,7 +375,7 @@ declare class Renderer {
360
375
  /**
361
376
  * Returns the pixel ratio.
362
377
  *
363
- * @return {Number} The pixel ratio.
378
+ * @return {number} The pixel ratio.
364
379
  */
365
380
  getPixelRatio(): number;
366
381
  /**
@@ -374,35 +389,35 @@ declare class Renderer {
374
389
  * Returns the renderer's size in logical pixels. This method does not honor the pixel ratio.
375
390
  *
376
391
  * @param {Vector2} target - The method writes the result in this target object.
377
- * @return {Vector2} The drawing buffer size.
392
+ * @return {Vector2} The renderer's size in logical pixels.
378
393
  */
379
394
  getSize(target: Vector2): Vector2;
380
395
  /**
381
- * Sets the given pixel ration and resizes the canvas if necessary.
396
+ * Sets the given pixel ratio and resizes the canvas if necessary.
382
397
  *
383
- * @param {Number} [value=1] - The pixel ratio.
398
+ * @param {number} [value=1] - The pixel ratio.
384
399
  */
385
400
  setPixelRatio(value?: number): void;
386
401
  /**
387
402
  * This method allows to define the drawing buffer size by specifying
388
403
  * width, height and pixel ratio all at once. The size of the drawing
389
404
  * buffer is computed with this formula:
390
- * ````
405
+ * ```js
391
406
  * size.x = width * pixelRatio;
392
407
  * size.y = height * pixelRatio;
393
408
  * ```
394
409
  *
395
- * @param {Number} width - The width in logical pixels.
396
- * @param {Number} height - The height in logical pixels.
397
- * @param {Number} pixelRatio - The pixel ratio.
410
+ * @param {number} width - The width in logical pixels.
411
+ * @param {number} height - The height in logical pixels.
412
+ * @param {number} pixelRatio - The pixel ratio.
398
413
  */
399
414
  setDrawingBufferSize(width: number, height: number, pixelRatio: number): void;
400
415
  /**
401
416
  * Sets the size of the renderer.
402
417
  *
403
- * @param {Number} width - The width in logical pixels.
404
- * @param {Number} height - The height in logical pixels.
405
- * @param {Boolean} [updateStyle=true] - Whether to update the `style` attribute of the canvas or not.
418
+ * @param {number} width - The width in logical pixels.
419
+ * @param {number} height - The height in logical pixels.
420
+ * @param {boolean} [updateStyle=true] - Whether to update the `style` attribute of the canvas or not.
406
421
  */
407
422
  setSize(width: number, height: number, updateStyle?: boolean): void;
408
423
  /**
@@ -429,24 +444,24 @@ declare class Renderer {
429
444
  /**
430
445
  * Defines the scissor rectangle.
431
446
  *
432
- * @param {Number | Vector4} x - The horizontal coordinate for the lower left corner of the box in logical pixel unit.
447
+ * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the box in logical pixel unit.
433
448
  * Instead of passing four arguments, the method also works with a single four-dimensional vector.
434
- * @param {Number} y - The vertical coordinate for the lower left corner of the box in logical pixel unit.
435
- * @param {Number} width - The width of the scissor box in logical pixel unit.
436
- * @param {Number} height - The height of the scissor box in logical pixel unit.
449
+ * @param {number} y - The vertical coordinate for the lower left corner of the box in logical pixel unit.
450
+ * @param {number} width - The width of the scissor box in logical pixel unit.
451
+ * @param {number} height - The height of the scissor box in logical pixel unit.
437
452
  */
438
453
  setScissor(x: Vector4): void;
439
454
  setScissor(x: number, y: number, width: number, height: number): void;
440
455
  /**
441
456
  * Returns the scissor test value.
442
457
  *
443
- * @return {Boolean} Whether the scissor test should be enabled or not.
458
+ * @return {boolean} Whether the scissor test should be enabled or not.
444
459
  */
445
460
  getScissorTest(): boolean;
446
461
  /**
447
462
  * Defines the scissor test.
448
463
  *
449
- * @param {Boolean} boolean - Whether the scissor test should be enabled or not.
464
+ * @param {boolean} boolean - Whether the scissor test should be enabled or not.
450
465
  */
451
466
  setScissorTest(boolean: boolean): void;
452
467
  /**
@@ -459,12 +474,12 @@ declare class Renderer {
459
474
  /**
460
475
  * Defines the viewport.
461
476
  *
462
- * @param {Number | Vector4} x - The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit.
463
- * @param {Number} y - The vertical coordinate for the lower left corner of the viewport origin in logical pixel unit.
464
- * @param {Number} width - The width of the viewport in logical pixel unit.
465
- * @param {Number} height - The height of the viewport in logical pixel unit.
466
- * @param {Number} minDepth - The minimum depth value of the viewport. WebGPU only.
467
- * @param {Number} maxDepth - The maximum depth value of the viewport. WebGPU only.
477
+ * @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit.
478
+ * @param {number} y - The vertical coordinate for the lower left corner of the viewport origin in logical pixel unit.
479
+ * @param {number} width - The width of the viewport in logical pixel unit.
480
+ * @param {number} height - The height of the viewport in logical pixel unit.
481
+ * @param {number} minDepth - The minimum depth value of the viewport. WebGPU only.
482
+ * @param {number} maxDepth - The maximum depth value of the viewport. WebGPU only.
468
483
  */
469
484
  setViewport(x: Vector4): void;
470
485
  setViewport(x: number, y: number, width: number, height: number, minDepth?: number, maxDepth?: number): void;
@@ -479,43 +494,43 @@ declare class Renderer {
479
494
  * Defines the clear color and optionally the clear alpha.
480
495
  *
481
496
  * @param {Color} color - The clear color.
482
- * @param {Number} [alpha=1] - The clear alpha.
497
+ * @param {number} [alpha=1] - The clear alpha.
483
498
  */
484
499
  setClearColor(color: ColorRepresentation, alpha?: number): void;
485
500
  /**
486
501
  * Returns the clear alpha.
487
502
  *
488
- * @return {Number} The clear alpha.
503
+ * @return {number} The clear alpha.
489
504
  */
490
505
  getClearAlpha(): number;
491
506
  /**
492
507
  * Defines the clear alpha.
493
508
  *
494
- * @param {Number} alpha - The clear alpha.
509
+ * @param {number} alpha - The clear alpha.
495
510
  */
496
511
  setClearAlpha(alpha: number): void;
497
512
  /**
498
513
  * Returns the clear depth.
499
514
  *
500
- * @return {Number} The clear depth.
515
+ * @return {number} The clear depth.
501
516
  */
502
517
  getClearDepth(): number;
503
518
  /**
504
519
  * Defines the clear depth.
505
520
  *
506
- * @param {Number} depth - The clear depth.
521
+ * @param {number} depth - The clear depth.
507
522
  */
508
523
  setClearDepth(depth: number): void;
509
524
  /**
510
525
  * Returns the clear stencil.
511
526
  *
512
- * @return {Number} The clear stencil.
527
+ * @return {number} The clear stencil.
513
528
  */
514
529
  getClearStencil(): number;
515
530
  /**
516
531
  * Defines the clear stencil.
517
532
  *
518
- * @param {Number} stencil - The clear stencil.
533
+ * @param {number} stencil - The clear stencil.
519
534
  */
520
535
  setClearStencil(stencil: number): void;
521
536
  /**
@@ -524,15 +539,15 @@ declare class Renderer {
524
539
  * 3D objects in the scene.
525
540
  *
526
541
  * @param {Object3D} object - The 3D object to test.
527
- * @return {Boolean} Whether the 3D object is fully occluded or not.
542
+ * @return {boolean} Whether the 3D object is fully occluded or not.
528
543
  */
529
544
  isOccluded(object: Object3D): boolean | null;
530
545
  /**
531
546
  * Performs a manual clear operation. This method ignores `autoClear` properties.
532
547
  *
533
- * @param {Boolean} [color=true] - Whether the color buffer should be cleared or not.
534
- * @param {Boolean} [depth=true] - Whether the depth buffer should be cleared or not.
535
- * @param {Boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.
548
+ * @param {boolean} [color=true] - Whether the color buffer should be cleared or not.
549
+ * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not.
550
+ * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.
536
551
  * @return {Promise} A Promise that resolves when the clear operation has been executed.
537
552
  * Only returned when the renderer has not been initialized.
538
553
  */
@@ -559,31 +574,31 @@ declare class Renderer {
559
574
  */
560
575
  clearStencil(): Promise<void> | undefined;
561
576
  /**
562
- * Async version of {@link module:Renderer~Renderer#clear}.
577
+ * Async version of {@link Renderer#clear}.
563
578
  *
564
579
  * @async
565
- * @param {Boolean} [color=true] - Whether the color buffer should be cleared or not.
566
- * @param {Boolean} [depth=true] - Whether the depth buffer should be cleared or not.
567
- * @param {Boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.
580
+ * @param {boolean} [color=true] - Whether the color buffer should be cleared or not.
581
+ * @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not.
582
+ * @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.
568
583
  * @return {Promise} A Promise that resolves when the clear operation has been executed.
569
584
  */
570
585
  clearAsync(color?: boolean, depth?: boolean, stencil?: boolean): Promise<void>;
571
586
  /**
572
- * Async version of {@link module:Renderer~Renderer#clearColor}.
587
+ * Async version of {@link Renderer#clearColor}.
573
588
  *
574
589
  * @async
575
590
  * @return {Promise} A Promise that resolves when the clear operation has been executed.
576
591
  */
577
592
  clearColorAsync(): Promise<void>;
578
593
  /**
579
- * Async version of {@link module:Renderer~Renderer#clearDepth}.
594
+ * Async version of {@link Renderer#clearDepth}.
580
595
  *
581
596
  * @async
582
597
  * @return {Promise} A Promise that resolves when the clear operation has been executed.
583
598
  */
584
599
  clearDepthAsync(): Promise<void>;
585
600
  /**
586
- * Async version of {@link module:Renderer~Renderer#clearStencil}.
601
+ * Async version of {@link Renderer#clearStencil}.
587
602
  *
588
603
  * @async
589
604
  * @return {Promise} A Promise that resolves when the clear operation has been executed.
@@ -593,16 +608,22 @@ declare class Renderer {
593
608
  * The current output tone mapping of the renderer. When a render target is set,
594
609
  * the output tone mapping is always `NoToneMapping`.
595
610
  *
596
- * @type {Number}
611
+ * @type {number}
597
612
  */
598
613
  get currentToneMapping(): ToneMapping;
599
614
  /**
600
615
  * The current output color space of the renderer. When a render target is set,
601
616
  * the output color space is always `LinearSRGBColorSpace`.
602
617
  *
603
- * @type {String}
618
+ * @type {string}
604
619
  */
605
620
  get currentColorSpace(): string;
621
+ /**
622
+ * Returns `true` if the rendering settings are set to screen output.
623
+ *
624
+ * @returns {boolean} True if the current render target is the same of output render target or `null`, otherwise false.
625
+ */
626
+ get isOutputTarget(): boolean;
606
627
  /**
607
628
  * Frees all internal resources of the renderer. Call this method if the renderer
608
629
  * is no longer in use by your app.
@@ -613,19 +634,31 @@ declare class Renderer {
613
634
  * target the default framebuffer (meaning the canvas) anymore but a custom framebuffer.
614
635
  * Use `null` as the first argument to reset the state.
615
636
  *
616
- * @param {RenderTarget?} renderTarget - The render target to set.
617
- * @param {Number} [activeCubeFace=0] - The active cube face.
618
- * @param {Number} [activeMipmapLevel=0] - The active mipmap level.
637
+ * @param {?RenderTarget} renderTarget - The render target to set.
638
+ * @param {number} [activeCubeFace=0] - The active cube face.
639
+ * @param {number} [activeMipmapLevel=0] - The active mipmap level.
619
640
  */
620
641
  setRenderTarget(renderTarget: RenderTarget | null, activeCubeFace?: number, activeMipmapLevel?: number): void;
621
642
  /**
622
643
  * Returns the current render target.
623
644
  *
624
- * @return {RenderTarget?} The render target. Returns `null` if no render target is set.
645
+ * @return {?RenderTarget} The render target. Returns `null` if no render target is set.
625
646
  */
626
647
  getRenderTarget(): RenderTarget<Texture> | null;
627
648
  /**
628
- * Callback for {@link module:Renderer~Renderer#setRenderObjectFunction}.
649
+ * Sets the output render target for the renderer.
650
+ *
651
+ * @param {Object} renderTarget - The render target to set as the output target.
652
+ */
653
+ setOutputRenderTarget(renderTarget: RenderTarget | null): void;
654
+ /**
655
+ * Returns the current output target.
656
+ *
657
+ * @return {?RenderTarget} The current output render target. Returns `null` if no output target is set.
658
+ */
659
+ getOutputRenderTarget(): RenderTarget<Texture> | null;
660
+ /**
661
+ * Callback for {@link Renderer#setRenderObjectFunction}.
629
662
  *
630
663
  * @callback renderObjectFunction
631
664
  * @param {Object3D} object - The 3D object.
@@ -633,21 +666,21 @@ declare class Renderer {
633
666
  * @param {Camera} camera - The camera the object should be rendered with.
634
667
  * @param {BufferGeometry} geometry - The object's geometry.
635
668
  * @param {Material} material - The object's material.
636
- * @param {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
669
+ * @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
637
670
  * @param {LightsNode} lightsNode - The current lights node.
638
671
  * @param {ClippingContext} clippingContext - The clipping context.
639
- * @param {String?} [passId=null] - An optional ID for identifying the pass.
672
+ * @param {?string} [passId=null] - An optional ID for identifying the pass.
640
673
  */
641
674
  /**
642
675
  * Sets the given render object function. Calling this method overwrites the default implementation
643
- * which is {@link module:Renderer~Renderer#renderObject}. Defining a custom function can be useful
676
+ * which is {@link Renderer#renderObject}. Defining a custom function can be useful
644
677
  * if you want to modify the way objects are rendered. For example you can define things like "every
645
678
  * object that has material of a certain type should perform a pre-pass with a special overwrite material".
646
679
  * The custom function must always call `renderObject()` in its implementation.
647
680
  *
648
681
  * Use `null` as the first argument to reset the state.
649
682
  *
650
- * @param {module:Renderer~renderObjectFunction?} renderObjectFunction - The render object function.
683
+ * @param {?renderObjectFunction} renderObjectFunction - The render object function.
651
684
  */
652
685
  setRenderObjectFunction(
653
686
  renderObjectFunction:
@@ -665,7 +698,7 @@ declare class Renderer {
665
698
  /**
666
699
  * Returns the current render object function.
667
700
  *
668
- * @return {Function?} The current render object function. Returns `null` if no function is set.
701
+ * @return {?Function} The current render object function. Returns `null` if no function is set.
669
702
  */
670
703
  getRenderObjectFunction():
671
704
  | ((
@@ -685,7 +718,7 @@ declare class Renderer {
685
718
  * if the renderer has been initialized.
686
719
  *
687
720
  * @param {Node|Array<Node>} computeNodes - The compute node(s).
688
- * @return {Promise?} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized.
721
+ * @return {Promise|undefined} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized.
689
722
  */
690
723
  compute(computeNodes: ComputeNode | ComputeNode[]): Promise<void> | undefined;
691
724
  /**
@@ -700,8 +733,8 @@ declare class Renderer {
700
733
  * Checks if the given feature is supported by the selected backend.
701
734
  *
702
735
  * @async
703
- * @param {String} name - The feature's name.
704
- * @return {Promise<Boolean>} A Promise that resolves with a bool that indicates whether the feature is supported or not.
736
+ * @param {string} name - The feature's name.
737
+ * @return {Promise<boolean>} A Promise that resolves with a bool that indicates whether the feature is supported or not.
705
738
  */
706
739
  hasFeatureAsync(name: string): Promise<void>;
707
740
  resolveTimestampsAsync(type?: TimestampQuery): Promise<number | undefined>;
@@ -709,14 +742,14 @@ declare class Renderer {
709
742
  * Checks if the given feature is supported by the selected backend. If the
710
743
  * renderer has not been initialized, this method always returns `false`.
711
744
  *
712
- * @param {String} name - The feature's name.
713
- * @return {Boolean} Whether the feature is supported or not.
745
+ * @param {string} name - The feature's name.
746
+ * @return {boolean} Whether the feature is supported or not.
714
747
  */
715
748
  hasFeature(name: string): false | void;
716
749
  /**
717
750
  * Returns `true` when the renderer has been initialized.
718
751
  *
719
- * @return {Boolean} Whether the renderer has been initialized or not.
752
+ * @return {boolean} Whether the renderer has been initialized or not.
720
753
  */
721
754
  hasInitialized(): boolean;
722
755
  /**
@@ -729,7 +762,7 @@ declare class Renderer {
729
762
  */
730
763
  initTextureAsync(texture: Texture): Promise<void>;
731
764
  /**
732
- * Initializes the given textures. Useful for preloading a texture rather than waiting until first render
765
+ * Initializes the given texture. Useful for preloading a texture rather than waiting until first render
733
766
  * (which can cause noticeable lags due to decode and GPU upload overhead).
734
767
  *
735
768
  * This method can only be used if the renderer has been initialized.
@@ -741,36 +774,38 @@ declare class Renderer {
741
774
  * Copies the current bound framebuffer into the given texture.
742
775
  *
743
776
  * @param {FramebufferTexture} framebufferTexture - The texture.
744
- * @param {Vector2|Vector4} rectangle - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied.
777
+ * @param {?Vector2|Vector4} [rectangle=null] - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied.
745
778
  */
746
779
  copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?: Rectangle | null): void;
747
780
  /**
748
- * Copies data of source texture into a destination texture.
781
+ * Copies data of the given source texture into a destination texture.
749
782
  *
750
783
  * @param {Texture} srcTexture - The source texture.
751
784
  * @param {Texture} dstTexture - The destination texture.
752
785
  * @param {Box2|Box3} [srcRegion=null] - A bounding box which describes the source region. Can be two or three-dimensional.
753
786
  * @param {Vector2|Vector3} [dstPosition=null] - A vector that represents the origin of the destination region. Can be two or three-dimensional.
754
- * @param {Number} level - The mipmap level to copy.
787
+ * @param {number} [srcLevel=0] - The source mip level to copy from.
788
+ * @param {number} [dstLevel=0] - The destination mip level to copy to.
755
789
  */
756
790
  copyTextureToTexture(
757
791
  srcTexture: Texture,
758
792
  dstTexture: Texture,
759
- srcRegion?: Box2 | null,
760
- dstPosition?: Vector2 | null,
761
- level?: number,
793
+ srcRegion?: Box2 | Box3 | null,
794
+ dstPosition?: Vector2 | Vector3 | null,
795
+ srcLevel?: number,
796
+ dstLevel?: number,
762
797
  ): void;
763
798
  /**
764
799
  * Reads pixel data from the given render target.
765
800
  *
766
801
  * @async
767
802
  * @param {RenderTarget} renderTarget - The render target to read from.
768
- * @param {Number} x - The `x` coordinate of the copy region's origin.
769
- * @param {Number} y - The `y` coordinate of the copy region's origin.
770
- * @param {Number} width - The width of the copy region.
771
- * @param {Number} height - The height of the copy region.
772
- * @param {Number} [textureIndex=0] - The texture index of a MRT render target.
773
- * @param {Number} [faceIndex=0] - The active cube face index.
803
+ * @param {number} x - The `x` coordinate of the copy region's origin.
804
+ * @param {number} y - The `y` coordinate of the copy region's origin.
805
+ * @param {number} width - The width of the copy region.
806
+ * @param {number} height - The height of the copy region.
807
+ * @param {number} [textureIndex=0] - The texture index of a MRT render target.
808
+ * @param {number} [faceIndex=0] - The active cube face index.
774
809
  * @return {Promise<TypedArray>} A Promise that resolves when the read has been finished. The resolve provides the read data as a typed array.
775
810
  */
776
811
  readRenderTargetPixelsAsync(
@@ -788,7 +823,7 @@ declare class Renderer {
788
823
  *
789
824
  * @param {Object3D} object - The 3D object to process (usually a scene).
790
825
  * @param {Camera} camera - The camera the object is rendered with.
791
- * @param {Number} groupOrder - The group order is derived from the `renderOrder` of groups and is used to group 3D objects within groups.
826
+ * @param {number} groupOrder - The group order is derived from the `renderOrder` of groups and is used to group 3D objects within groups.
792
827
  * @param {RenderList} renderList - The current render list.
793
828
  * @param {ClippingContext} clippingContext - The current clipping context.
794
829
  */
@@ -833,7 +868,7 @@ declare class Renderer {
833
868
  * @param {Camera} camera - The camera the render list should be rendered with.
834
869
  * @param {Scene} scene - The scene the render list belongs to.
835
870
  * @param {LightsNode} lightsNode - The current lights node.
836
- * @param {String?} [passId=null] - An optional ID for identifying the pass.
871
+ * @param {?string} [passId=null] - An optional ID for identifying the pass.
837
872
  */
838
873
  _renderObjects(
839
874
  renderList: RenderItem[],
@@ -851,10 +886,10 @@ declare class Renderer {
851
886
  * @param {Camera} camera - The camera the object should be rendered with.
852
887
  * @param {BufferGeometry} geometry - The object's geometry.
853
888
  * @param {Material} material - The object's material.
854
- * @param {Object?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
889
+ * @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
855
890
  * @param {LightsNode} lightsNode - The current lights node.
856
- * @param {ClippingContext} clippingContext - The clipping context.
857
- * @param {String?} [passId=null] - An optional ID for identifying the pass.
891
+ * @param {?ClippingContext} clippingContext - The clipping context.
892
+ * @param {?string} [passId=null] - An optional ID for identifying the pass.
858
893
  */
859
894
  renderObject(
860
895
  object: Object3D,
@@ -877,9 +912,9 @@ declare class Renderer {
877
912
  * @param {Scene} scene - The scene the 3D object belongs to.
878
913
  * @param {Camera} camera - The camera the object should be rendered with.
879
914
  * @param {LightsNode} lightsNode - The current lights node.
880
- * @param {{start: Number, count: Number}?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
915
+ * @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
881
916
  * @param {ClippingContext} clippingContext - The clipping context.
882
- * @param {String?} [passId=null] - An optional ID for identifying the pass.
917
+ * @param {?string} [passId=null] - An optional ID for identifying the pass.
883
918
  */
884
919
  _renderObjectDirect(
885
920
  object: Object3D,
@@ -901,9 +936,9 @@ declare class Renderer {
901
936
  * @param {Scene} scene - The scene the 3D object belongs to.
902
937
  * @param {Camera} camera - The camera the object should be rendered with.
903
938
  * @param {LightsNode} lightsNode - The current lights node.
904
- * @param {{start: Number, count: Number}?} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
939
+ * @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
905
940
  * @param {ClippingContext} clippingContext - The clipping context.
906
- * @param {String?} [passId=null] - An optional ID for identifying the pass.
941
+ * @param {?string} [passId=null] - An optional ID for identifying the pass.
907
942
  */
908
943
  _createObjectPipeline(
909
944
  object: Object3D,
@@ -922,7 +957,7 @@ declare class Renderer {
922
957
  * @param {Object3D} scene - The scene or 3D object to precompile.
923
958
  * @param {Camera} camera - The camera that is used to render the scene.
924
959
  * @param {Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added.
925
- * @return {Promise} A Promise that resolves when the compile has been finished.
960
+ * @return {function(Object3D, Camera, ?Scene): Promise|undefined} A Promise that resolves when the compile has been finished.
926
961
  */
927
962
  get compile(): (scene: Object3D, camera: Camera, targetScene?: Object3D | null) => Promise<void>;
928
963
  }