@types/three 0.173.0 → 0.174.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- three/README.md +1 -1
- three/examples/jsm/animation/CCDIKSolver.d.ts +3 -2
- three/examples/jsm/loaders/MTLLoader.d.ts +2 -1
- three/examples/jsm/misc/Timer.d.ts +13 -2
- three/examples/jsm/objects/Reflector.d.ts +1 -0
- three/examples/jsm/tsl/math/Bayer.d.ts +4 -0
- three/examples/jsm/tsl/utils/Raymarching.d.ts +9 -0
- three/package.json +2 -2
- three/src/Three.TSL.d.ts +4 -0
- three/src/Three.d.ts +6 -1
- three/src/core/Raycaster.d.ts +4 -0
- three/src/extras/PMREMGenerator.d.ts +15 -2
- three/src/geometries/TorusGeometry.d.ts +5 -6
- three/src/materials/nodes/NodeMaterial.d.ts +2 -1
- three/src/materials/nodes/VolumeNodeMaterial.d.ts +14 -2
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +4 -4
- three/src/nodes/Nodes.d.ts +1 -2
- three/src/nodes/TSL.d.ts +1 -0
- three/src/nodes/accessors/BufferAttributeNode.d.ts +25 -22
- three/src/nodes/accessors/Lights.d.ts +1 -1
- three/src/nodes/accessors/MaterialProperties.d.ts +5 -0
- three/src/nodes/accessors/ModelNode.d.ts +1 -0
- three/src/nodes/accessors/Object3DNode.d.ts +7 -5
- three/src/nodes/accessors/Texture3DNode.d.ts +2 -2
- three/src/nodes/core/LightingModel.d.ts +13 -28
- three/src/nodes/core/Node.d.ts +24 -24
- three/src/nodes/core/NodeAttribute.d.ts +3 -3
- three/src/nodes/core/NodeCache.d.ts +2 -2
- three/src/nodes/core/NodeParser.d.ts +1 -1
- three/src/nodes/core/NodeUniform.d.ts +4 -4
- three/src/nodes/core/NodeVar.d.ts +4 -4
- three/src/nodes/core/NodeVarying.d.ts +2 -2
- three/src/nodes/core/StructTypeNode.d.ts +2 -2
- three/src/nodes/core/UniformNode.d.ts +7 -7
- three/src/nodes/core/constants.d.ts +0 -1
- three/src/nodes/display/PassNode.d.ts +10 -1
- three/src/nodes/functions/BSDF/LTC.d.ts +5 -1
- three/src/nodes/functions/VolumetricLightingModel.d.ts +6 -0
- three/src/nodes/lighting/AnalyticLightNode.d.ts +13 -1
- three/src/nodes/lighting/LightingContextNode.d.ts +18 -4
- three/src/nodes/lighting/LightsNode.d.ts +24 -0
- three/src/nodes/lighting/PointLightNode.d.ts +8 -7
- three/src/nodes/lighting/ShadowBaseNode.d.ts +3 -0
- three/src/nodes/tsl/TSLCore.d.ts +3 -0
- three/src/nodes/utils/ReflectorNode.d.ts +1 -0
- three/src/objects/LOD.d.ts +4 -3
- three/src/renderers/common/Animation.d.ts +4 -4
- three/src/renderers/common/Attributes.d.ts +1 -1
- three/src/renderers/common/BindGroup.d.ts +2 -2
- three/src/renderers/common/Binding.d.ts +2 -2
- three/src/renderers/common/Buffer.d.ts +3 -3
- three/src/renderers/common/BufferUtils.d.ts +7 -8
- three/src/renderers/common/BundleGroup.d.ts +2 -2
- three/src/renderers/common/ChainMap.d.ts +3 -3
- three/src/renderers/common/ClippingContext.d.ts +3 -3
- three/src/renderers/common/Color4.d.ts +8 -8
- three/src/renderers/common/ComputePipeline.d.ts +1 -1
- three/src/renderers/common/DataMap.d.ts +2 -2
- three/src/renderers/common/Geometries.d.ts +4 -4
- three/src/renderers/common/Info.d.ts +2 -2
- three/src/renderers/common/Pipeline.d.ts +1 -1
- three/src/renderers/common/Pipelines.d.ts +9 -9
- three/src/renderers/common/ProgrammableStage.d.ts +4 -4
- three/src/renderers/common/RenderContext.d.ts +2 -2
- three/src/renderers/common/RenderContexts.d.ts +3 -3
- three/src/renderers/common/RenderList.d.ts +11 -11
- three/src/renderers/common/RenderObject.d.ts +13 -13
- three/src/renderers/common/RenderObjects.d.ts +3 -3
- three/src/renderers/common/RenderPipeline.d.ts +1 -1
- three/src/renderers/common/Renderer.d.ts +117 -91
- three/src/renderers/common/Textures.d.ts +6 -6
- three/src/renderers/common/TimestampQueryPool.d.ts +13 -1
- three/src/renderers/common/Uniform.d.ts +13 -13
- three/src/renderers/common/UniformBuffer.d.ts +1 -1
- three/src/renderers/common/UniformsGroup.d.ts +13 -13
- three/src/renderers/common/XRManager.d.ts +13 -15
- three/src/renderers/common/XRRenderTarget.d.ts +4 -4
- three/src/renderers/common/extras/PMREMGenerator.d.ts +9 -2
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -3
- three/src/renderers/common/nodes/NodeLibrary.d.ts +11 -11
- three/src/renderers/common/nodes/NodeUniform.d.ts +9 -9
- three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +1 -1
- three/src/renderers/common/nodes/Nodes.d.ts +11 -11
- three/src/renderers/webgl/WebGLState.d.ts +7 -6
|
@@ -114,6 +114,7 @@ declare class Renderer {
|
|
|
114
114
|
_renderTarget: RenderTarget | null;
|
|
115
115
|
_activeCubeFace: number;
|
|
116
116
|
_activeMipmapLevel: number;
|
|
117
|
+
_outputRenderTarget: RenderTarget | null;
|
|
117
118
|
_mrt: MRTNode | null;
|
|
118
119
|
_renderObjectFunction:
|
|
119
120
|
| ((
|
|
@@ -156,7 +157,7 @@ declare class Renderer {
|
|
|
156
157
|
onDeviceLost: (info: DeviceLostInfo) => void;
|
|
157
158
|
_colorBufferType: TextureDataType;
|
|
158
159
|
_initialized: boolean;
|
|
159
|
-
_initPromise: Promise<
|
|
160
|
+
_initPromise: Promise<this> | null;
|
|
160
161
|
_compilationPromises: Promise<void>[] | null;
|
|
161
162
|
transparent: boolean;
|
|
162
163
|
opaque: boolean;
|
|
@@ -186,15 +187,15 @@ declare class Renderer {
|
|
|
186
187
|
*
|
|
187
188
|
* @param {Backend} backend - The backend the renderer is targeting (e.g. WebGPU or WebGL 2).
|
|
188
189
|
* @param {Object} parameters - The configuration parameter.
|
|
189
|
-
* @param {
|
|
190
|
-
* @param {
|
|
191
|
-
* @param {
|
|
192
|
-
* @param {
|
|
193
|
-
* @param {
|
|
194
|
-
* @param {
|
|
190
|
+
* @param {boolean} [parameters.logarithmicDepthBuffer=false] - Whether logarithmic depth buffer is enabled or not.
|
|
191
|
+
* @param {boolean} [parameters.alpha=true] - Whether the default framebuffer (which represents the final contents of the canvas) should be transparent or opaque.
|
|
192
|
+
* @param {boolean} [parameters.depth=true] - Whether the default framebuffer should have a depth buffer or not.
|
|
193
|
+
* @param {boolean} [parameters.stencil=false] - Whether the default framebuffer should have a stencil buffer or not.
|
|
194
|
+
* @param {boolean} [parameters.antialias=false] - Whether MSAA as the default anti-aliasing should be enabled or not.
|
|
195
|
+
* @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
|
|
195
196
|
* to overwrite the default.
|
|
196
|
-
* @param {Function
|
|
197
|
-
* @param {
|
|
197
|
+
* @param {?Function} [parameters.getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted.
|
|
198
|
+
* @param {number} [parameters.colorBufferType=HalfFloatType] - Defines the type of color buffers. The default `HalfFloatType` is recommend for best
|
|
198
199
|
* quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though.
|
|
199
200
|
*/
|
|
200
201
|
constructor(backend: Backend, parameters?: RendererParameters);
|
|
@@ -202,16 +203,16 @@ declare class Renderer {
|
|
|
202
203
|
* Initializes the renderer so it is ready for usage.
|
|
203
204
|
*
|
|
204
205
|
* @async
|
|
205
|
-
* @return {Promise} A Promise that resolves when the renderer has been initialized.
|
|
206
|
+
* @return {Promise<this>} A Promise that resolves when the renderer has been initialized.
|
|
206
207
|
*/
|
|
207
|
-
init(): Promise<
|
|
208
|
+
init(): Promise<this>;
|
|
208
209
|
/**
|
|
209
210
|
* The coordinate system of the renderer. The value of this property
|
|
210
211
|
* depends on the selected backend. Either `THREE.WebGLCoordinateSystem` or
|
|
211
212
|
* `THREE.WebGPUCoordinateSystem`.
|
|
212
213
|
*
|
|
213
214
|
* @readonly
|
|
214
|
-
* @type {
|
|
215
|
+
* @type {number}
|
|
215
216
|
*/
|
|
216
217
|
get coordinateSystem(): import("../../constants.js").CoordinateSystem;
|
|
217
218
|
/**
|
|
@@ -263,7 +264,7 @@ declare class Renderer {
|
|
|
263
264
|
/**
|
|
264
265
|
* Returns the color buffer type.
|
|
265
266
|
*
|
|
266
|
-
* @return {
|
|
267
|
+
* @return {number} The color buffer type.
|
|
267
268
|
*/
|
|
268
269
|
getColorBufferType(): TextureDataType;
|
|
269
270
|
/**
|
|
@@ -291,7 +292,7 @@ declare class Renderer {
|
|
|
291
292
|
*
|
|
292
293
|
* @param {Object3D} scene - The scene or 3D object to render.
|
|
293
294
|
* @param {Camera} camera - The camera to render the scene with.
|
|
294
|
-
* @return {Promise
|
|
295
|
+
* @return {?Promise} A Promise that resolve when the scene has been rendered.
|
|
295
296
|
* Only returned when the renderer has not been initialized.
|
|
296
297
|
*/
|
|
297
298
|
render(scene: Scene, camera: Camera): Promise<void> | undefined;
|
|
@@ -301,7 +302,7 @@ declare class Renderer {
|
|
|
301
302
|
* pass and not inline to achieve more correct results.
|
|
302
303
|
*
|
|
303
304
|
* @private
|
|
304
|
-
* @return {RenderTarget
|
|
305
|
+
* @return {?RenderTarget} The render target. The method returns `null` if no output conversion should be applied.
|
|
305
306
|
*/
|
|
306
307
|
_getFrameBufferTarget(): RenderTarget<Texture> | null;
|
|
307
308
|
/**
|
|
@@ -310,26 +311,33 @@ declare class Renderer {
|
|
|
310
311
|
* @private
|
|
311
312
|
* @param {Object3D} scene - The scene or 3D object to render.
|
|
312
313
|
* @param {Camera} camera - The camera to render the scene with.
|
|
313
|
-
* @param {
|
|
314
|
+
* @param {boolean} [useFrameBufferTarget=true] - Whether to use a framebuffer target or not.
|
|
314
315
|
* @return {RenderContext} The current render context.
|
|
315
316
|
*/
|
|
316
317
|
_renderScene(scene: Scene, camera: Camera, useFrameBufferTarget?: boolean): RenderContext | undefined;
|
|
318
|
+
/**
|
|
319
|
+
* The output pass performs tone mapping and color space conversion.
|
|
320
|
+
*
|
|
321
|
+
* @private
|
|
322
|
+
* @param {RenderTarget} renderTarget - The current render target.
|
|
323
|
+
*/
|
|
324
|
+
_renderOutput(renderTarget: RenderTarget): void;
|
|
317
325
|
/**
|
|
318
326
|
* Returns the maximum available anisotropy for texture filtering.
|
|
319
327
|
*
|
|
320
|
-
* @return {
|
|
328
|
+
* @return {number} The maximum available anisotropy.
|
|
321
329
|
*/
|
|
322
330
|
getMaxAnisotropy(): number;
|
|
323
331
|
/**
|
|
324
332
|
* Returns the active cube face.
|
|
325
333
|
*
|
|
326
|
-
* @return {
|
|
334
|
+
* @return {number} The active cube face.
|
|
327
335
|
*/
|
|
328
336
|
getActiveCubeFace(): number;
|
|
329
337
|
/**
|
|
330
338
|
* Returns the active mipmap level.
|
|
331
339
|
*
|
|
332
|
-
* @return {
|
|
340
|
+
* @return {number} The active mipmap level.
|
|
333
341
|
*/
|
|
334
342
|
getActiveMipmapLevel(): number;
|
|
335
343
|
/**
|
|
@@ -360,7 +368,7 @@ declare class Renderer {
|
|
|
360
368
|
/**
|
|
361
369
|
* Returns the pixel ratio.
|
|
362
370
|
*
|
|
363
|
-
* @return {
|
|
371
|
+
* @return {number} The pixel ratio.
|
|
364
372
|
*/
|
|
365
373
|
getPixelRatio(): number;
|
|
366
374
|
/**
|
|
@@ -378,9 +386,9 @@ declare class Renderer {
|
|
|
378
386
|
*/
|
|
379
387
|
getSize(target: Vector2): Vector2;
|
|
380
388
|
/**
|
|
381
|
-
* Sets the given pixel
|
|
389
|
+
* Sets the given pixel ratio and resizes the canvas if necessary.
|
|
382
390
|
*
|
|
383
|
-
* @param {
|
|
391
|
+
* @param {number} [value=1] - The pixel ratio.
|
|
384
392
|
*/
|
|
385
393
|
setPixelRatio(value?: number): void;
|
|
386
394
|
/**
|
|
@@ -392,17 +400,17 @@ declare class Renderer {
|
|
|
392
400
|
* size.y = height * pixelRatio;
|
|
393
401
|
* ```
|
|
394
402
|
*
|
|
395
|
-
* @param {
|
|
396
|
-
* @param {
|
|
397
|
-
* @param {
|
|
403
|
+
* @param {number} width - The width in logical pixels.
|
|
404
|
+
* @param {number} height - The height in logical pixels.
|
|
405
|
+
* @param {number} pixelRatio - The pixel ratio.
|
|
398
406
|
*/
|
|
399
407
|
setDrawingBufferSize(width: number, height: number, pixelRatio: number): void;
|
|
400
408
|
/**
|
|
401
409
|
* Sets the size of the renderer.
|
|
402
410
|
*
|
|
403
|
-
* @param {
|
|
404
|
-
* @param {
|
|
405
|
-
* @param {
|
|
411
|
+
* @param {number} width - The width in logical pixels.
|
|
412
|
+
* @param {number} height - The height in logical pixels.
|
|
413
|
+
* @param {boolean} [updateStyle=true] - Whether to update the `style` attribute of the canvas or not.
|
|
406
414
|
*/
|
|
407
415
|
setSize(width: number, height: number, updateStyle?: boolean): void;
|
|
408
416
|
/**
|
|
@@ -429,24 +437,24 @@ declare class Renderer {
|
|
|
429
437
|
/**
|
|
430
438
|
* Defines the scissor rectangle.
|
|
431
439
|
*
|
|
432
|
-
* @param {
|
|
440
|
+
* @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the box in logical pixel unit.
|
|
433
441
|
* Instead of passing four arguments, the method also works with a single four-dimensional vector.
|
|
434
|
-
* @param {
|
|
435
|
-
* @param {
|
|
436
|
-
* @param {
|
|
442
|
+
* @param {number} y - The vertical coordinate for the lower left corner of the box in logical pixel unit.
|
|
443
|
+
* @param {number} width - The width of the scissor box in logical pixel unit.
|
|
444
|
+
* @param {number} height - The height of the scissor box in logical pixel unit.
|
|
437
445
|
*/
|
|
438
446
|
setScissor(x: Vector4): void;
|
|
439
447
|
setScissor(x: number, y: number, width: number, height: number): void;
|
|
440
448
|
/**
|
|
441
449
|
* Returns the scissor test value.
|
|
442
450
|
*
|
|
443
|
-
* @return {
|
|
451
|
+
* @return {boolean} Whether the scissor test should be enabled or not.
|
|
444
452
|
*/
|
|
445
453
|
getScissorTest(): boolean;
|
|
446
454
|
/**
|
|
447
455
|
* Defines the scissor test.
|
|
448
456
|
*
|
|
449
|
-
* @param {
|
|
457
|
+
* @param {boolean} boolean - Whether the scissor test should be enabled or not.
|
|
450
458
|
*/
|
|
451
459
|
setScissorTest(boolean: boolean): void;
|
|
452
460
|
/**
|
|
@@ -459,12 +467,12 @@ declare class Renderer {
|
|
|
459
467
|
/**
|
|
460
468
|
* Defines the viewport.
|
|
461
469
|
*
|
|
462
|
-
* @param {
|
|
463
|
-
* @param {
|
|
464
|
-
* @param {
|
|
465
|
-
* @param {
|
|
466
|
-
* @param {
|
|
467
|
-
* @param {
|
|
470
|
+
* @param {number | Vector4} x - The horizontal coordinate for the lower left corner of the viewport origin in logical pixel unit.
|
|
471
|
+
* @param {number} y - The vertical coordinate for the lower left corner of the viewport origin in logical pixel unit.
|
|
472
|
+
* @param {number} width - The width of the viewport in logical pixel unit.
|
|
473
|
+
* @param {number} height - The height of the viewport in logical pixel unit.
|
|
474
|
+
* @param {number} minDepth - The minimum depth value of the viewport. WebGPU only.
|
|
475
|
+
* @param {number} maxDepth - The maximum depth value of the viewport. WebGPU only.
|
|
468
476
|
*/
|
|
469
477
|
setViewport(x: Vector4): void;
|
|
470
478
|
setViewport(x: number, y: number, width: number, height: number, minDepth?: number, maxDepth?: number): void;
|
|
@@ -479,43 +487,43 @@ declare class Renderer {
|
|
|
479
487
|
* Defines the clear color and optionally the clear alpha.
|
|
480
488
|
*
|
|
481
489
|
* @param {Color} color - The clear color.
|
|
482
|
-
* @param {
|
|
490
|
+
* @param {number} [alpha=1] - The clear alpha.
|
|
483
491
|
*/
|
|
484
492
|
setClearColor(color: ColorRepresentation, alpha?: number): void;
|
|
485
493
|
/**
|
|
486
494
|
* Returns the clear alpha.
|
|
487
495
|
*
|
|
488
|
-
* @return {
|
|
496
|
+
* @return {number} The clear alpha.
|
|
489
497
|
*/
|
|
490
498
|
getClearAlpha(): number;
|
|
491
499
|
/**
|
|
492
500
|
* Defines the clear alpha.
|
|
493
501
|
*
|
|
494
|
-
* @param {
|
|
502
|
+
* @param {number} alpha - The clear alpha.
|
|
495
503
|
*/
|
|
496
504
|
setClearAlpha(alpha: number): void;
|
|
497
505
|
/**
|
|
498
506
|
* Returns the clear depth.
|
|
499
507
|
*
|
|
500
|
-
* @return {
|
|
508
|
+
* @return {number} The clear depth.
|
|
501
509
|
*/
|
|
502
510
|
getClearDepth(): number;
|
|
503
511
|
/**
|
|
504
512
|
* Defines the clear depth.
|
|
505
513
|
*
|
|
506
|
-
* @param {
|
|
514
|
+
* @param {number} depth - The clear depth.
|
|
507
515
|
*/
|
|
508
516
|
setClearDepth(depth: number): void;
|
|
509
517
|
/**
|
|
510
518
|
* Returns the clear stencil.
|
|
511
519
|
*
|
|
512
|
-
* @return {
|
|
520
|
+
* @return {number} The clear stencil.
|
|
513
521
|
*/
|
|
514
522
|
getClearStencil(): number;
|
|
515
523
|
/**
|
|
516
524
|
* Defines the clear stencil.
|
|
517
525
|
*
|
|
518
|
-
* @param {
|
|
526
|
+
* @param {number} stencil - The clear stencil.
|
|
519
527
|
*/
|
|
520
528
|
setClearStencil(stencil: number): void;
|
|
521
529
|
/**
|
|
@@ -524,15 +532,15 @@ declare class Renderer {
|
|
|
524
532
|
* 3D objects in the scene.
|
|
525
533
|
*
|
|
526
534
|
* @param {Object3D} object - The 3D object to test.
|
|
527
|
-
* @return {
|
|
535
|
+
* @return {boolean} Whether the 3D object is fully occluded or not.
|
|
528
536
|
*/
|
|
529
537
|
isOccluded(object: Object3D): boolean | null;
|
|
530
538
|
/**
|
|
531
539
|
* Performs a manual clear operation. This method ignores `autoClear` properties.
|
|
532
540
|
*
|
|
533
|
-
* @param {
|
|
534
|
-
* @param {
|
|
535
|
-
* @param {
|
|
541
|
+
* @param {boolean} [color=true] - Whether the color buffer should be cleared or not.
|
|
542
|
+
* @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not.
|
|
543
|
+
* @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.
|
|
536
544
|
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
537
545
|
* Only returned when the renderer has not been initialized.
|
|
538
546
|
*/
|
|
@@ -559,31 +567,31 @@ declare class Renderer {
|
|
|
559
567
|
*/
|
|
560
568
|
clearStencil(): Promise<void> | undefined;
|
|
561
569
|
/**
|
|
562
|
-
* Async version of {@link
|
|
570
|
+
* Async version of {@link Renderer#clear}.
|
|
563
571
|
*
|
|
564
572
|
* @async
|
|
565
|
-
* @param {
|
|
566
|
-
* @param {
|
|
567
|
-
* @param {
|
|
573
|
+
* @param {boolean} [color=true] - Whether the color buffer should be cleared or not.
|
|
574
|
+
* @param {boolean} [depth=true] - Whether the depth buffer should be cleared or not.
|
|
575
|
+
* @param {boolean} [stencil=true] - Whether the stencil buffer should be cleared or not.
|
|
568
576
|
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
569
577
|
*/
|
|
570
578
|
clearAsync(color?: boolean, depth?: boolean, stencil?: boolean): Promise<void>;
|
|
571
579
|
/**
|
|
572
|
-
* Async version of {@link
|
|
580
|
+
* Async version of {@link Renderer#clearColor}.
|
|
573
581
|
*
|
|
574
582
|
* @async
|
|
575
583
|
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
576
584
|
*/
|
|
577
585
|
clearColorAsync(): Promise<void>;
|
|
578
586
|
/**
|
|
579
|
-
* Async version of {@link
|
|
587
|
+
* Async version of {@link Renderer#clearDepth}.
|
|
580
588
|
*
|
|
581
589
|
* @async
|
|
582
590
|
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
583
591
|
*/
|
|
584
592
|
clearDepthAsync(): Promise<void>;
|
|
585
593
|
/**
|
|
586
|
-
* Async version of {@link
|
|
594
|
+
* Async version of {@link Renderer#clearStencil}.
|
|
587
595
|
*
|
|
588
596
|
* @async
|
|
589
597
|
* @return {Promise} A Promise that resolves when the clear operation has been executed.
|
|
@@ -593,16 +601,22 @@ declare class Renderer {
|
|
|
593
601
|
* The current output tone mapping of the renderer. When a render target is set,
|
|
594
602
|
* the output tone mapping is always `NoToneMapping`.
|
|
595
603
|
*
|
|
596
|
-
* @type {
|
|
604
|
+
* @type {number}
|
|
597
605
|
*/
|
|
598
606
|
get currentToneMapping(): ToneMapping;
|
|
599
607
|
/**
|
|
600
608
|
* The current output color space of the renderer. When a render target is set,
|
|
601
609
|
* the output color space is always `LinearSRGBColorSpace`.
|
|
602
610
|
*
|
|
603
|
-
* @type {
|
|
611
|
+
* @type {string}
|
|
604
612
|
*/
|
|
605
613
|
get currentColorSpace(): string;
|
|
614
|
+
/**
|
|
615
|
+
* Returns `true` if the rendering settings are set to screen output.
|
|
616
|
+
*
|
|
617
|
+
* @returns {boolean} True if the current render target is the same of output render target or `null`, otherwise false.
|
|
618
|
+
*/
|
|
619
|
+
get isOutputTarget(): boolean;
|
|
606
620
|
/**
|
|
607
621
|
* Frees all internal resources of the renderer. Call this method if the renderer
|
|
608
622
|
* is no longer in use by your app.
|
|
@@ -613,19 +627,31 @@ declare class Renderer {
|
|
|
613
627
|
* target the default framebuffer (meaning the canvas) anymore but a custom framebuffer.
|
|
614
628
|
* Use `null` as the first argument to reset the state.
|
|
615
629
|
*
|
|
616
|
-
* @param {RenderTarget
|
|
617
|
-
* @param {
|
|
618
|
-
* @param {
|
|
630
|
+
* @param {?RenderTarget} renderTarget - The render target to set.
|
|
631
|
+
* @param {number} [activeCubeFace=0] - The active cube face.
|
|
632
|
+
* @param {number} [activeMipmapLevel=0] - The active mipmap level.
|
|
619
633
|
*/
|
|
620
634
|
setRenderTarget(renderTarget: RenderTarget | null, activeCubeFace?: number, activeMipmapLevel?: number): void;
|
|
621
635
|
/**
|
|
622
636
|
* Returns the current render target.
|
|
623
637
|
*
|
|
624
|
-
* @return {RenderTarget
|
|
638
|
+
* @return {?RenderTarget} The render target. Returns `null` if no render target is set.
|
|
625
639
|
*/
|
|
626
640
|
getRenderTarget(): RenderTarget<Texture> | null;
|
|
627
641
|
/**
|
|
628
|
-
*
|
|
642
|
+
* Sets the output render target for the renderer.
|
|
643
|
+
*
|
|
644
|
+
* @param {Object} renderTarget - The render target to set as the output target.
|
|
645
|
+
*/
|
|
646
|
+
setOutputRenderTarget(renderTarget: RenderTarget | null): void;
|
|
647
|
+
/**
|
|
648
|
+
* Returns the current output target.
|
|
649
|
+
*
|
|
650
|
+
* @return {?RenderTarget} The current output render target. Returns `null` if no output target is set.
|
|
651
|
+
*/
|
|
652
|
+
getOutputRenderTarget(): RenderTarget<Texture> | null;
|
|
653
|
+
/**
|
|
654
|
+
* Callback for {@link Renderer#setRenderObjectFunction}.
|
|
629
655
|
*
|
|
630
656
|
* @callback renderObjectFunction
|
|
631
657
|
* @param {Object3D} object - The 3D object.
|
|
@@ -633,21 +659,21 @@ declare class Renderer {
|
|
|
633
659
|
* @param {Camera} camera - The camera the object should be rendered with.
|
|
634
660
|
* @param {BufferGeometry} geometry - The object's geometry.
|
|
635
661
|
* @param {Material} material - The object's material.
|
|
636
|
-
* @param {Object
|
|
662
|
+
* @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
637
663
|
* @param {LightsNode} lightsNode - The current lights node.
|
|
638
664
|
* @param {ClippingContext} clippingContext - The clipping context.
|
|
639
|
-
* @param {
|
|
665
|
+
* @param {?string} [passId=null] - An optional ID for identifying the pass.
|
|
640
666
|
*/
|
|
641
667
|
/**
|
|
642
668
|
* Sets the given render object function. Calling this method overwrites the default implementation
|
|
643
|
-
* which is {@link
|
|
669
|
+
* which is {@link Renderer#renderObject}. Defining a custom function can be useful
|
|
644
670
|
* if you want to modify the way objects are rendered. For example you can define things like "every
|
|
645
671
|
* object that has material of a certain type should perform a pre-pass with a special overwrite material".
|
|
646
672
|
* The custom function must always call `renderObject()` in its implementation.
|
|
647
673
|
*
|
|
648
674
|
* Use `null` as the first argument to reset the state.
|
|
649
675
|
*
|
|
650
|
-
* @param {
|
|
676
|
+
* @param {?renderObjectFunction} renderObjectFunction - The render object function.
|
|
651
677
|
*/
|
|
652
678
|
setRenderObjectFunction(
|
|
653
679
|
renderObjectFunction:
|
|
@@ -665,7 +691,7 @@ declare class Renderer {
|
|
|
665
691
|
/**
|
|
666
692
|
* Returns the current render object function.
|
|
667
693
|
*
|
|
668
|
-
* @return {Function
|
|
694
|
+
* @return {?Function} The current render object function. Returns `null` if no function is set.
|
|
669
695
|
*/
|
|
670
696
|
getRenderObjectFunction():
|
|
671
697
|
| ((
|
|
@@ -685,7 +711,7 @@ declare class Renderer {
|
|
|
685
711
|
* if the renderer has been initialized.
|
|
686
712
|
*
|
|
687
713
|
* @param {Node|Array<Node>} computeNodes - The compute node(s).
|
|
688
|
-
* @return {Promise
|
|
714
|
+
* @return {?Promise} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized.
|
|
689
715
|
*/
|
|
690
716
|
compute(computeNodes: ComputeNode | ComputeNode[]): Promise<void> | undefined;
|
|
691
717
|
/**
|
|
@@ -700,8 +726,8 @@ declare class Renderer {
|
|
|
700
726
|
* Checks if the given feature is supported by the selected backend.
|
|
701
727
|
*
|
|
702
728
|
* @async
|
|
703
|
-
* @param {
|
|
704
|
-
* @return {Promise<
|
|
729
|
+
* @param {string} name - The feature's name.
|
|
730
|
+
* @return {Promise<boolean>} A Promise that resolves with a bool that indicates whether the feature is supported or not.
|
|
705
731
|
*/
|
|
706
732
|
hasFeatureAsync(name: string): Promise<void>;
|
|
707
733
|
resolveTimestampsAsync(type?: TimestampQuery): Promise<number | undefined>;
|
|
@@ -709,14 +735,14 @@ declare class Renderer {
|
|
|
709
735
|
* Checks if the given feature is supported by the selected backend. If the
|
|
710
736
|
* renderer has not been initialized, this method always returns `false`.
|
|
711
737
|
*
|
|
712
|
-
* @param {
|
|
713
|
-
* @return {
|
|
738
|
+
* @param {string} name - The feature's name.
|
|
739
|
+
* @return {boolean} Whether the feature is supported or not.
|
|
714
740
|
*/
|
|
715
741
|
hasFeature(name: string): false | void;
|
|
716
742
|
/**
|
|
717
743
|
* Returns `true` when the renderer has been initialized.
|
|
718
744
|
*
|
|
719
|
-
* @return {
|
|
745
|
+
* @return {boolean} Whether the renderer has been initialized or not.
|
|
720
746
|
*/
|
|
721
747
|
hasInitialized(): boolean;
|
|
722
748
|
/**
|
|
@@ -751,7 +777,7 @@ declare class Renderer {
|
|
|
751
777
|
* @param {Texture} dstTexture - The destination texture.
|
|
752
778
|
* @param {Box2|Box3} [srcRegion=null] - A bounding box which describes the source region. Can be two or three-dimensional.
|
|
753
779
|
* @param {Vector2|Vector3} [dstPosition=null] - A vector that represents the origin of the destination region. Can be two or three-dimensional.
|
|
754
|
-
* @param {
|
|
780
|
+
* @param {number} level - The mipmap level to copy.
|
|
755
781
|
*/
|
|
756
782
|
copyTextureToTexture(
|
|
757
783
|
srcTexture: Texture,
|
|
@@ -765,12 +791,12 @@ declare class Renderer {
|
|
|
765
791
|
*
|
|
766
792
|
* @async
|
|
767
793
|
* @param {RenderTarget} renderTarget - The render target to read from.
|
|
768
|
-
* @param {
|
|
769
|
-
* @param {
|
|
770
|
-
* @param {
|
|
771
|
-
* @param {
|
|
772
|
-
* @param {
|
|
773
|
-
* @param {
|
|
794
|
+
* @param {number} x - The `x` coordinate of the copy region's origin.
|
|
795
|
+
* @param {number} y - The `y` coordinate of the copy region's origin.
|
|
796
|
+
* @param {number} width - The width of the copy region.
|
|
797
|
+
* @param {number} height - The height of the copy region.
|
|
798
|
+
* @param {number} [textureIndex=0] - The texture index of a MRT render target.
|
|
799
|
+
* @param {number} [faceIndex=0] - The active cube face index.
|
|
774
800
|
* @return {Promise<TypedArray>} A Promise that resolves when the read has been finished. The resolve provides the read data as a typed array.
|
|
775
801
|
*/
|
|
776
802
|
readRenderTargetPixelsAsync(
|
|
@@ -788,7 +814,7 @@ declare class Renderer {
|
|
|
788
814
|
*
|
|
789
815
|
* @param {Object3D} object - The 3D object to process (usually a scene).
|
|
790
816
|
* @param {Camera} camera - The camera the object is rendered with.
|
|
791
|
-
* @param {
|
|
817
|
+
* @param {number} groupOrder - The group order is derived from the `renderOrder` of groups and is used to group 3D objects within groups.
|
|
792
818
|
* @param {RenderList} renderList - The current render list.
|
|
793
819
|
* @param {ClippingContext} clippingContext - The current clipping context.
|
|
794
820
|
*/
|
|
@@ -833,7 +859,7 @@ declare class Renderer {
|
|
|
833
859
|
* @param {Camera} camera - The camera the render list should be rendered with.
|
|
834
860
|
* @param {Scene} scene - The scene the render list belongs to.
|
|
835
861
|
* @param {LightsNode} lightsNode - The current lights node.
|
|
836
|
-
* @param {
|
|
862
|
+
* @param {?string} [passId=null] - An optional ID for identifying the pass.
|
|
837
863
|
*/
|
|
838
864
|
_renderObjects(
|
|
839
865
|
renderList: RenderItem[],
|
|
@@ -851,10 +877,10 @@ declare class Renderer {
|
|
|
851
877
|
* @param {Camera} camera - The camera the object should be rendered with.
|
|
852
878
|
* @param {BufferGeometry} geometry - The object's geometry.
|
|
853
879
|
* @param {Material} material - The object's material.
|
|
854
|
-
* @param {Object
|
|
880
|
+
* @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
855
881
|
* @param {LightsNode} lightsNode - The current lights node.
|
|
856
882
|
* @param {ClippingContext} clippingContext - The clipping context.
|
|
857
|
-
* @param {
|
|
883
|
+
* @param {?string} [passId=null] - An optional ID for identifying the pass.
|
|
858
884
|
*/
|
|
859
885
|
renderObject(
|
|
860
886
|
object: Object3D,
|
|
@@ -877,9 +903,9 @@ declare class Renderer {
|
|
|
877
903
|
* @param {Scene} scene - The scene the 3D object belongs to.
|
|
878
904
|
* @param {Camera} camera - The camera the object should be rendered with.
|
|
879
905
|
* @param {LightsNode} lightsNode - The current lights node.
|
|
880
|
-
* @param {{start:
|
|
906
|
+
* @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
881
907
|
* @param {ClippingContext} clippingContext - The clipping context.
|
|
882
|
-
* @param {
|
|
908
|
+
* @param {?string} [passId=null] - An optional ID for identifying the pass.
|
|
883
909
|
*/
|
|
884
910
|
_renderObjectDirect(
|
|
885
911
|
object: Object3D,
|
|
@@ -901,9 +927,9 @@ declare class Renderer {
|
|
|
901
927
|
* @param {Scene} scene - The scene the 3D object belongs to.
|
|
902
928
|
* @param {Camera} camera - The camera the object should be rendered with.
|
|
903
929
|
* @param {LightsNode} lightsNode - The current lights node.
|
|
904
|
-
* @param {{start:
|
|
930
|
+
* @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
|
|
905
931
|
* @param {ClippingContext} clippingContext - The clipping context.
|
|
906
|
-
* @param {
|
|
932
|
+
* @param {?string} [passId=null] - An optional ID for identifying the pass.
|
|
907
933
|
*/
|
|
908
934
|
_createObjectPipeline(
|
|
909
935
|
object: Object3D,
|
|
@@ -75,7 +75,7 @@ declare class Textures extends DataMap<{
|
|
|
75
75
|
* it updates the texture states representing the attachments of the framebuffer.
|
|
76
76
|
*
|
|
77
77
|
* @param {RenderTarget} renderTarget - The render target to update.
|
|
78
|
-
* @param {
|
|
78
|
+
* @param {number} [activeMipmapLevel=0] - The active mipmap level.
|
|
79
79
|
*/
|
|
80
80
|
updateRenderTarget(renderTarget: RenderTarget, activeMipmapLevel?: number): void;
|
|
81
81
|
/**
|
|
@@ -104,23 +104,23 @@ declare class Textures extends DataMap<{
|
|
|
104
104
|
* Computes the number of mipmap levels for the given texture.
|
|
105
105
|
*
|
|
106
106
|
* @param {Texture} texture - The texture.
|
|
107
|
-
* @param {
|
|
108
|
-
* @param {
|
|
109
|
-
* @return {
|
|
107
|
+
* @param {number} width - The texture's width.
|
|
108
|
+
* @param {number} height - The texture's height.
|
|
109
|
+
* @return {number} The number of mipmap levels.
|
|
110
110
|
*/
|
|
111
111
|
getMipLevels(texture: Texture, width: number, height: number): number;
|
|
112
112
|
/**
|
|
113
113
|
* Returns `true` if the given texture requires mipmaps.
|
|
114
114
|
*
|
|
115
115
|
* @param {Texture} texture - The texture.
|
|
116
|
-
* @return {
|
|
116
|
+
* @return {boolean} Whether mipmaps are required or not.
|
|
117
117
|
*/
|
|
118
118
|
needsMipmaps(texture: Texture): boolean;
|
|
119
119
|
/**
|
|
120
120
|
* Returns `true` if the given texture is an environment map.
|
|
121
121
|
*
|
|
122
122
|
* @param {Texture} texture - The texture.
|
|
123
|
-
* @return {
|
|
123
|
+
* @return {boolean} Whether the given texture is an environment map or not.
|
|
124
124
|
*/
|
|
125
125
|
isEnvironmentTexture(texture: Texture): boolean;
|
|
126
126
|
/**
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import RenderContext from "./RenderContext.js";
|
|
2
|
+
/**
|
|
3
|
+
* Abstract base class of a timestamp query pool.
|
|
4
|
+
*
|
|
5
|
+
* @abstract
|
|
6
|
+
*/
|
|
2
7
|
declare abstract class TimestampQueryPool {
|
|
3
8
|
trackTimestamp: boolean;
|
|
4
9
|
maxQueries: number;
|
|
@@ -7,18 +12,25 @@ declare abstract class TimestampQueryPool {
|
|
|
7
12
|
isDisposed: boolean;
|
|
8
13
|
lastValue: number;
|
|
9
14
|
pendingResolve: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a new timestamp query pool.
|
|
17
|
+
*
|
|
18
|
+
* @param {number} [maxQueries=256] - Maximum number of queries this pool can hold.
|
|
19
|
+
*/
|
|
10
20
|
constructor(maxQueries?: number);
|
|
11
21
|
/**
|
|
12
22
|
* Allocate queries for a specific renderContext.
|
|
13
23
|
*
|
|
14
24
|
* @abstract
|
|
25
|
+
* @param {Object} renderContext - The render context to allocate queries for.
|
|
15
26
|
*/
|
|
16
27
|
abstract allocateQueriesForContext(renderContext: RenderContext): number | null;
|
|
17
28
|
/**
|
|
18
29
|
* Resolve all timestamps and return data (or process them).
|
|
19
30
|
*
|
|
20
31
|
* @abstract
|
|
21
|
-
* @
|
|
32
|
+
* @async
|
|
33
|
+
* @returns {Promise<number>|number} The resolved timestamp value.
|
|
22
34
|
*/
|
|
23
35
|
abstract resolveQueriesAsync(): Promise<number>;
|
|
24
36
|
/**
|