@types/three 0.178.1 → 0.180.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 (129) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +2 -3
  3. three/examples/jsm/controls/DragControls.d.ts +0 -30
  4. three/examples/jsm/controls/PointerLockControls.d.ts +0 -5
  5. three/examples/jsm/exporters/DRACOExporter.d.ts +1 -1
  6. three/examples/jsm/exporters/EXRExporter.d.ts +2 -2
  7. three/examples/jsm/exporters/KTX2Exporter.d.ts +2 -2
  8. three/examples/jsm/exporters/STLExporter.d.ts +2 -2
  9. three/examples/jsm/exporters/USDZExporter.d.ts +3 -2
  10. three/examples/jsm/loaders/EXRLoader.d.ts +18 -5
  11. three/examples/jsm/loaders/HDRCubeTextureLoader.d.ts +2 -2
  12. three/examples/jsm/loaders/HDRLoader.d.ts +22 -0
  13. three/examples/jsm/loaders/LDrawLoader.d.ts +5 -1
  14. three/examples/jsm/loaders/RGBELoader.d.ts +9 -15
  15. three/examples/jsm/loaders/USDLoader.d.ts +9 -0
  16. three/examples/jsm/loaders/USDZLoader.d.ts +11 -8
  17. three/examples/jsm/materials/WoodNodeMaterial.d.ts +75 -0
  18. three/examples/jsm/math/ColorSpaces.d.ts +4 -0
  19. three/examples/jsm/postprocessing/SSRPass.d.ts +6 -29
  20. three/examples/jsm/tsl/display/AnamorphicNode.d.ts +10 -1
  21. three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +14 -8
  22. three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +26 -6
  23. three/examples/jsm/tsl/display/SSRNode.d.ts +8 -3
  24. three/examples/jsm/tsl/display/TRAANode.d.ts +22 -0
  25. three/examples/jsm/tsl/display/boxBlur.d.ts +11 -0
  26. three/examples/jsm/tsl/display/hashBlur.d.ts +1 -1
  27. three/package.json +4 -4
  28. three/src/Three.Core.d.ts +2 -0
  29. three/src/Three.TSL.d.ts +84 -17
  30. three/src/animation/AnimationClip.d.ts +5 -0
  31. three/src/animation/KeyframeTrack.d.ts +7 -2
  32. three/src/animation/tracks/BooleanKeyframeTrack.d.ts +2 -2
  33. three/src/animation/tracks/StringKeyframeTrack.d.ts +2 -2
  34. three/src/cameras/Camera.d.ts +15 -8
  35. three/src/constants.d.ts +6 -2
  36. three/{examples/jsm/misc → src/core}/Timer.d.ts +3 -17
  37. three/src/helpers/SkeletonHelper.d.ts +7 -12
  38. three/src/loaders/FileLoader.d.ts +2 -2
  39. three/src/loaders/ImageBitmapLoader.d.ts +9 -9
  40. three/src/loaders/Loader.d.ts +1 -0
  41. three/src/loaders/LoadingManager.d.ts +23 -19
  42. three/src/materials/LineBasicMaterial.d.ts +1 -0
  43. three/src/materials/LineDashedMaterial.d.ts +1 -0
  44. three/src/materials/MeshBasicMaterial.d.ts +1 -0
  45. three/src/materials/MeshDepthMaterial.d.ts +1 -0
  46. three/src/materials/MeshDistanceMaterial.d.ts +2 -1
  47. three/src/materials/MeshLambertMaterial.d.ts +1 -0
  48. three/src/materials/MeshMatcapMaterial.d.ts +1 -0
  49. three/src/materials/MeshNormalMaterial.d.ts +1 -0
  50. three/src/materials/MeshPhongMaterial.d.ts +1 -0
  51. three/src/materials/MeshToonMaterial.d.ts +1 -0
  52. three/src/materials/PointsMaterial.d.ts +1 -0
  53. three/src/materials/ShaderMaterial.d.ts +1 -0
  54. three/src/materials/ShadowMaterial.d.ts +1 -0
  55. three/src/materials/SpriteMaterial.d.ts +1 -0
  56. three/src/materials/nodes/Line2NodeMaterial.d.ts +1 -6
  57. three/src/materials/nodes/LineBasicNodeMaterial.d.ts +1 -0
  58. three/src/materials/nodes/LineDashedNodeMaterial.d.ts +1 -0
  59. three/src/materials/nodes/MeshBasicNodeMaterial.d.ts +1 -0
  60. three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +1 -0
  61. three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts +1 -0
  62. three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +1 -0
  63. three/src/materials/nodes/MeshPhongNodeMaterial.d.ts +1 -0
  64. three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts +1 -0
  65. three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +1 -0
  66. three/src/materials/nodes/MeshStandardNodeMaterial.d.ts +1 -0
  67. three/src/materials/nodes/MeshToonNodeMaterial.d.ts +1 -0
  68. three/src/materials/nodes/NodeMaterial.d.ts +1 -0
  69. three/src/materials/nodes/PointsNodeMaterial.d.ts +22 -0
  70. three/src/materials/nodes/ShadowNodeMaterial.d.ts +1 -0
  71. three/src/materials/nodes/SpriteNodeMaterial.d.ts +1 -0
  72. three/src/materials/nodes/VolumeNodeMaterial.d.ts +1 -0
  73. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +22 -1
  74. three/src/math/ColorManagement.d.ts +1 -1
  75. three/src/math/Frustum.d.ts +1 -1
  76. three/src/math/Line3.d.ts +1 -0
  77. three/src/math/Matrix4.d.ts +2 -0
  78. three/src/nodes/Nodes.d.ts +4 -0
  79. three/src/nodes/TSL.d.ts +4 -0
  80. three/src/nodes/accessors/Camera.d.ts +2 -0
  81. three/src/nodes/accessors/TextureNode.d.ts +4 -0
  82. three/src/nodes/core/ContextNode.d.ts +11 -1
  83. three/src/nodes/core/Node.d.ts +13 -13
  84. three/src/nodes/core/UniformNode.d.ts +13 -4
  85. three/src/nodes/core/VarNode.d.ts +11 -15
  86. three/src/nodes/display/PassNode.d.ts +10 -0
  87. three/src/nodes/display/ScreenNode.d.ts +4 -1
  88. three/src/nodes/display/ToneMappingNode.d.ts +2 -2
  89. three/src/nodes/display/ViewportDepthTextureNode.d.ts +3 -0
  90. three/src/nodes/display/ViewportSharedTextureNode.d.ts +3 -0
  91. three/src/nodes/display/ViewportTextureNode.d.ts +4 -0
  92. three/src/nodes/gpgpu/ComputeNode.d.ts +15 -6
  93. three/src/nodes/gpgpu/SubgroupFunctionNode.d.ts +100 -0
  94. three/src/nodes/materialx/MaterialXNodes.d.ts +85 -20
  95. three/src/nodes/materialx/lib/mx_noise.d.ts +28 -0
  96. three/src/nodes/math/BitcastNode.d.ts +25 -0
  97. three/src/nodes/math/MathNode.d.ts +10 -5
  98. three/src/nodes/tsl/TSLCore.d.ts +16 -0
  99. three/src/nodes/utils/EventNode.d.ts +21 -0
  100. three/src/nodes/utils/RTTNode.d.ts +2 -0
  101. three/src/nodes/utils/ReflectorNode.d.ts +16 -1
  102. three/src/nodes/utils/SampleNode.d.ts +3 -2
  103. three/src/nodes/utils/Timer.d.ts +0 -15
  104. three/src/objects/InstancedMesh.d.ts +2 -3
  105. three/src/renderers/WebGLRenderer.d.ts +0 -25
  106. three/src/renderers/common/Attributes.d.ts +1 -1
  107. three/src/renderers/common/Color4.d.ts +2 -2
  108. three/src/renderers/common/Renderer.d.ts +17 -9
  109. three/src/renderers/common/SampledTexture.d.ts +2 -9
  110. three/src/renderers/common/Sampler.d.ts +9 -3
  111. three/src/renderers/common/Storage3DTexture.d.ts +2 -0
  112. three/src/renderers/common/StorageArrayTexture.d.ts +2 -0
  113. three/src/renderers/common/StorageTexture.d.ts +2 -0
  114. three/src/renderers/common/Textures.d.ts +1 -1
  115. three/src/renderers/common/TimestampQueryPool.d.ts +3 -4
  116. three/src/renderers/common/XRManager.d.ts +11 -0
  117. three/src/renderers/common/nodes/NodeLibrary.d.ts +5 -5
  118. three/src/renderers/webgl/WebGLCapabilities.d.ts +2 -2
  119. three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +0 -1
  120. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +1 -1
  121. three/src/renderers/webxr/WebXRDepthSensing.d.ts +4 -5
  122. three/src/renderers/webxr/WebXRManager.d.ts +4 -2
  123. three/src/textures/CompressedTexture.d.ts +4 -4
  124. three/src/textures/Data3DTexture.d.ts +2 -1
  125. three/src/textures/DataTexture.d.ts +3 -2
  126. three/src/textures/ExternalTexture.d.ts +11 -0
  127. three/src/textures/Texture.d.ts +1 -1
  128. three/examples/jsm/loaders/RGBMLoader.d.ts +0 -37
  129. three/examples/jsm/tsl/display/TRAAPassNode.d.ts +0 -15
@@ -210,6 +210,7 @@ export class ShaderNode<T = {}, R extends Node = Node> {
210
210
  }
211
211
 
212
212
  export function nodeObject<T extends NodeObjectOption>(obj: T): NodeObject<T>;
213
+ export function nodeObjectIntent<T extends NodeObjectOption>(obj: T): NodeObject<T>;
213
214
  export function nodeObjects<T>(obj: T): NodeObjects<T>;
214
215
 
215
216
  export function nodeArray<T extends NodeObjectOption[]>(obj: readonly [...T]): NodeArray<T>;
@@ -234,6 +235,21 @@ export function nodeImmutable<T>(
234
235
  ...params: ProxiedTuple<GetConstructors<T>>
235
236
  ): ShaderNodeObject<ConstructedNode<T>>;
236
237
 
238
+ export function nodeProxyIntent<T>(
239
+ nodeClass: T,
240
+ ): (...params: ProxiedTuple<GetConstructors<T>>) => ShaderNodeObject<ConstructedNode<T>>;
241
+
242
+ export function nodeProxyIntent<T, S extends GetPossibleScopes<T>>(
243
+ nodeClass: T,
244
+ scope: S,
245
+ ): (...params: ProxiedTuple<RemoveTail<GetConstructorsByScope<T, S>>>) => ShaderNodeObject<ConstructedNode<T>>;
246
+
247
+ export function nodeProxyIntent<T, S extends GetPossibleScopes<T>>(
248
+ nodeClass: T,
249
+ scope: S,
250
+ factor: NodeObjectOption,
251
+ ): (...params: ProxiedTuple<RemoveHeadAndTail<GetConstructorsByScope<T, S>>>) => ShaderNodeObject<ConstructedNode<T>>;
252
+
237
253
  interface Layout {
238
254
  name: string;
239
255
  type: string;
@@ -0,0 +1,21 @@
1
+ import Node from "../core/Node.js";
2
+ import NodeFrame from "../core/NodeFrame.js";
3
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
4
+
5
+ export type EventNodeType = typeof EventNode.OBJECT | typeof EventNode.MATERIAL;
6
+
7
+ declare class EventNode extends Node {
8
+ eventType: EventNodeType;
9
+ callback: (frame: NodeFrame) => void;
10
+
11
+ constructor(eventType: EventNodeType, callback: (frame: NodeFrame) => void);
12
+
13
+ static OBJECT: "object";
14
+ static MATERIAL: "material";
15
+ }
16
+
17
+ export default EventNode;
18
+
19
+ export const OnObjectUpdate: (callback: (frame: NodeFrame) => void) => ShaderNodeObject<Node>;
20
+
21
+ export const OnMaterialUpdate: (callback: (frame: NodeFrame) => void) => ShaderNodeObject<Node>;
@@ -9,6 +9,8 @@ export interface RTTNodeOptions {
9
9
  }
10
10
 
11
11
  declare class RTTNode extends TextureNode {
12
+ readonly isRTTNode: true;
13
+
12
14
  node: Node;
13
15
  width: number | null;
14
16
  height: number | null;
@@ -7,9 +7,15 @@ import { ShaderNodeObject } from "../tsl/TSLCore.js";
7
7
 
8
8
  export interface ReflectorNodeParameters {
9
9
  target?: Object3D | undefined;
10
+ /**
11
+ * @deprecated The "resolution" parameter has been renamed to "resolutionScale".
12
+ */
10
13
  resolution?: number | undefined;
14
+ resolutionScale?: number | undefined;
11
15
  generateMipmaps?: boolean | undefined;
12
16
  bounces?: boolean | undefined;
17
+ depth?: boolean | undefined;
18
+ samples?: number | undefined;
13
19
  }
14
20
 
15
21
  declare class ReflectorNode extends TextureNode {
@@ -26,7 +32,7 @@ declare class ReflectorBaseNode extends Node {
26
32
  textureNode: TextureNode;
27
33
 
28
34
  target: Object3D;
29
- resolution: number;
35
+ resolutionScale: number;
30
36
  generateMipmaps: boolean;
31
37
  bounces: boolean;
32
38
 
@@ -40,6 +46,15 @@ declare class ReflectorBaseNode extends Node {
40
46
  getVirtualCamera(camera: Camera): Camera;
41
47
 
42
48
  getRenderTarget(camera: Camera): RenderTarget;
49
+
50
+ /**
51
+ * @deprecated The "resolution" property has been renamed to "resolutionScale" and is now of type `number`.
52
+ */
53
+ get resolution(): number;
54
+ /**
55
+ * @deprecated The "resolution" property has been renamed to "resolutionScale" and is now of type `number`.
56
+ */
57
+ set resolution(value: number);
43
58
  }
44
59
 
45
60
  export const reflector: (parameters?: ReflectorNodeParameters) => ShaderNodeObject<ReflectorNode>;
@@ -3,14 +3,15 @@ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  declare class SampleNode extends Node {
5
5
  callback: (uv: Node) => Node;
6
+ uvNode: Node | null;
6
7
 
7
8
  readonly isSampleNode: true;
8
9
 
9
- constructor(callback: (uv: Node) => Node);
10
+ constructor(callback: (uv: Node) => Node, uvNode?: Node | null);
10
11
 
11
12
  sample(uv: Node): Node;
12
13
  }
13
14
 
14
15
  export default SampleNode;
15
16
 
16
- export const sample: (callback: (uv: Node) => Node) => ShaderNodeObject<SampleNode>;
17
+ export const sample: (callback: (uv: Node) => Node, uv?: Node | null) => ShaderNodeObject<SampleNode>;
@@ -4,18 +4,3 @@ import { ShaderNodeObject } from "../tsl/TSLCore.js";
4
4
  export const time: ShaderNodeObject<Node>;
5
5
  export const deltaTime: ShaderNodeObject<Node>;
6
6
  export const frameId: ShaderNodeObject<Node>;
7
-
8
- /**
9
- * @deprecated Use "time" instead.
10
- */
11
- export const timerLocal: (timeScale?: number) => ShaderNodeObject<Node>;
12
-
13
- /**
14
- * @deprecated Use "time" instead.
15
- */
16
- export const timerGlobal: (timeScale?: number) => ShaderNodeObject<Node>;
17
-
18
- /**
19
- * @deprecated Use "deltaTime" instead.
20
- */
21
- export const timerDelta: (timeScale?: number) => ShaderNodeObject<Node>;
@@ -28,7 +28,6 @@ export interface InstancedMeshEventMap extends Object3DEventMap {
28
28
  * A special version of {@link THREE.Mesh | Mesh} with instanced rendering support
29
29
  * @remarks
30
30
  * Use {@link InstancedMesh} if you have to render a large number of objects with the same geometry and material(s) but with different world transformations
31
- * @remarks
32
31
  * The usage of {@link InstancedMesh} will help you to reduce the number of draw calls and thus improve the overall rendering performance in your application.
33
32
  * @see Example: {@link https://threejs.org/examples/#webgl_instancing_dynamic | WebGL / instancing / dynamic}
34
33
  * @see Example: {@link https://threejs.org/examples/#webgl_instancing_performance | WebGL / instancing / performance}
@@ -76,8 +75,8 @@ export class InstancedMesh<
76
75
  * @remarks
77
76
  * The `count` value passed into the {@link InstancedMesh | constructor} represents the **maximum** number of instances of this mesh.
78
77
  * You can change the number of instances at runtime to an integer value in the range `[0, count]`.
79
- * @remarks If you need more instances than the original `count` value, you have to create a new InstancedMesh.
80
- * @remarks Expects a `Integer`
78
+ * If you need more instances than the original `count` value, you have to create a new InstancedMesh.
79
+ * Expects a `Integer`
81
80
  */
82
81
  count: number;
83
82
 
@@ -12,8 +12,6 @@ import { Vector2 } from "../math/Vector2.js";
12
12
  import { Vector3 } from "../math/Vector3.js";
13
13
  import { Vector4 } from "../math/Vector4.js";
14
14
  import { Scene } from "../scenes/Scene.js";
15
- import { Data3DTexture } from "../textures/Data3DTexture.js";
16
- import { DataArrayTexture } from "../textures/DataArrayTexture.js";
17
15
  import { OffscreenCanvas, Texture } from "../textures/Texture.js";
18
16
  import { WebGLCapabilities, WebGLCapabilitiesParameters } from "./webgl/WebGLCapabilities.js";
19
17
  import { WebGLExtensions } from "./webgl/WebGLExtensions.js";
@@ -456,29 +454,6 @@ export class WebGLRenderer {
456
454
  dstLevel?: number,
457
455
  ): void;
458
456
 
459
- /**
460
- * @deprecated Use "copyTextureToTexture" instead.
461
- *
462
- * Copies the pixels of a texture in the bounds `srcRegion` in the destination texture starting from the given
463
- * position. The `depthTexture` and `texture` property of 3D render targets are supported as well.
464
- *
465
- * When using render target textures as `srcTexture` and `dstTexture`, you must make sure both render targets are
466
- * initialized e.g. via {@link .initRenderTarget}().
467
- *
468
- * @param srcTexture Specifies the source texture.
469
- * @param dstTexture Specifies the destination texture.
470
- * @param srcRegion Specifies the bounds
471
- * @param dstPosition Specifies the pixel offset into the dstTexture where the copy will occur.
472
- * @param level Specifies the destination mipmap level of the texture.
473
- */
474
- copyTextureToTexture3D(
475
- srcTexture: Texture,
476
- dstTexture: Data3DTexture | DataArrayTexture,
477
- srcRegion?: Box3 | null,
478
- dstPosition?: Vector3 | null,
479
- level?: number,
480
- ): void;
481
-
482
457
  /**
483
458
  * Initializes the given WebGLRenderTarget memory. Useful for initializing a render target so data can be copied
484
459
  * into it using {@link WebGLRenderer.copyTextureToTexture} before it has been rendered to.
@@ -30,7 +30,7 @@ declare class Attributes extends DataMap<{
30
30
  * Deletes the data for the given attribute.
31
31
  *
32
32
  * @param {BufferAttribute} attribute - The attribute.
33
- * @return {Object|null} The deleted attribute data.
33
+ * @return {?Object} The deleted attribute data.
34
34
  */
35
35
  delete(attribute: BufferAttribute | InterleavedBufferAttribute): Data;
36
36
  /**
@@ -27,8 +27,8 @@ declare class Color4 extends Color {
27
27
  * string argument to this method.
28
28
  *
29
29
  * @param {number|string|Color} r - The red value.
30
- * @param {number} g - The green value.
31
- * @param {number} b - The blue value.
30
+ * @param {number} [g] - The green value.
31
+ * @param {number} [b] - The blue value.
32
32
  * @param {number} [a=1] - The alpha value.
33
33
  * @return {Color4} A reference to this object.
34
34
  */
@@ -625,15 +625,15 @@ declare class Renderer {
625
625
  */
626
626
  clearStencilAsync(): Promise<void>;
627
627
  /**
628
- * The current output tone mapping of the renderer. When a render target is set,
629
- * the output tone mapping is always `NoToneMapping`.
628
+ * The current tone mapping of the renderer. When not producing screen output,
629
+ * the tone mapping is always `NoToneMapping`.
630
630
  *
631
631
  * @type {number}
632
632
  */
633
633
  get currentToneMapping(): ToneMapping;
634
634
  /**
635
- * The current output color space of the renderer. When a render target is set,
636
- * the output color space is always `LinearSRGBColorSpace`.
635
+ * The current color space of the renderer. When not producing screen output,
636
+ * the color space is always the working color space.
637
637
  *
638
638
  * @type {string}
639
639
  */
@@ -742,17 +742,25 @@ declare class Renderer {
742
742
  * if the renderer has been initialized.
743
743
  *
744
744
  * @param {Node|Array<Node>} computeNodes - The compute node(s).
745
+ * @param {?(Array<number>|number)} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count.
745
746
  * @return {Promise|undefined} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized.
746
747
  */
747
- compute(computeNodes: ComputeNode | ComputeNode[]): Promise<void> | undefined;
748
+ compute(
749
+ computeNodes: ComputeNode | ComputeNode[],
750
+ dispatchSizeOrCount?: number[] | number | null,
751
+ ): Promise<void> | undefined;
748
752
  /**
749
753
  * Execute a single or an array of compute nodes.
750
754
  *
751
755
  * @async
752
756
  * @param {Node|Array<Node>} computeNodes - The compute node(s).
757
+ * @param {?(Array<number>|number)} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count.
753
758
  * @return {Promise} A Promise that resolve when the compute has finished.
754
759
  */
755
- computeAsync(computeNodes: ComputeNode | ComputeNode[]): Promise<void>;
760
+ computeAsync(
761
+ computeNodes: ComputeNode | ComputeNode[],
762
+ dispatchSizeOrCount?: number[] | number | null,
763
+ ): Promise<void>;
756
764
  /**
757
765
  * Checks if the given feature is supported by the selected backend.
758
766
  *
@@ -798,7 +806,7 @@ declare class Renderer {
798
806
  * Copies the current bound framebuffer into the given texture.
799
807
  *
800
808
  * @param {FramebufferTexture} framebufferTexture - The texture.
801
- * @param {?Vector2|Vector4} [rectangle=null] - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied.
809
+ * @param {?(Vector2|Vector4)} [rectangle=null] - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied.
802
810
  */
803
811
  copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?: Rectangle | null): void;
804
812
  /**
@@ -938,7 +946,7 @@ declare class Renderer {
938
946
  * @param {LightsNode} lightsNode - The current lights node.
939
947
  * @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
940
948
  * @param {ClippingContext} clippingContext - The clipping context.
941
- * @param {?string} [passId=null] - An optional ID for identifying the pass.
949
+ * @param {string} [passId] - An optional ID for identifying the pass.
942
950
  */
943
951
  _renderObjectDirect(
944
952
  object: Object3D,
@@ -962,7 +970,7 @@ declare class Renderer {
962
970
  * @param {LightsNode} lightsNode - The current lights node.
963
971
  * @param {?{start: number, count: number}} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
964
972
  * @param {ClippingContext} clippingContext - The clipping context.
965
- * @param {?string} [passId=null] - An optional ID for identifying the pass.
973
+ * @param {string} [passId] - An optional ID for identifying the pass.
966
974
  */
967
975
  _createObjectPipeline(
968
976
  object: Object3D,
@@ -1,21 +1,14 @@
1
1
  import { Texture } from "../../textures/Texture.js";
2
- import Binding from "./Binding.js";
2
+ import Sampler from "./Sampler.js";
3
3
 
4
- declare class SampledTexture extends Binding {
4
+ declare class SampledTexture extends Sampler {
5
5
  id: number;
6
6
 
7
- texture: Texture | null;
8
- version: number;
9
7
  store: boolean;
10
- generation: number | null;
11
8
 
12
9
  readonly isSampledTexture: true;
13
10
 
14
11
  constructor(name: string, texture: Texture | null);
15
-
16
- needsBindingsUpdate(generation: number): boolean;
17
-
18
- update(): boolean;
19
12
  }
20
13
 
21
14
  declare class SampledArrayTexture extends SampledTexture {
@@ -1,11 +1,17 @@
1
- import TextureNode from "../../nodes/accessors/TextureNode.js";
1
+ import { Texture } from "../../textures/Texture.js";
2
2
  import Binding from "./Binding.js";
3
3
 
4
4
  declare class Sampler extends Binding {
5
- texture: TextureNode | null;
6
5
  version: number;
6
+
7
+ generation: number | null;
8
+
7
9
  readonly isSampler: true;
8
- constructor(name: string, texture: TextureNode | null);
10
+
11
+ constructor(name: string, texture: Texture | null);
12
+
13
+ set texture(value: Texture | null);
14
+ get texture(): Texture | null;
9
15
  }
10
16
 
11
17
  export default Sampler;
@@ -35,6 +35,8 @@ declare class Storage3DTexture extends Texture {
35
35
  * @param {number} [depth=1] - The storage texture's depth.
36
36
  */
37
37
  constructor(width?: number, height?: number, depth?: number);
38
+
39
+ setSize(width: number, height: number, depth: number): void;
38
40
  }
39
41
 
40
42
  export default Storage3DTexture;
@@ -24,6 +24,8 @@ declare class Storage3DTexture extends Texture {
24
24
  * @param {number} [depth=1] - The storage texture's depth.
25
25
  */
26
26
  constructor(width?: number, height?: number, depth?: number);
27
+
28
+ setSize(width: number, height: number, depth: number): void;
27
29
  }
28
30
 
29
31
  export default Storage3DTexture;
@@ -2,4 +2,6 @@ import { Texture } from "../../textures/Texture.js";
2
2
 
3
3
  export default class StorageTexture extends Texture {
4
4
  constructor(width?: number, height?: number);
5
+
6
+ setSize(width: number, height: number, depth: number): void;
5
7
  }
@@ -110,7 +110,7 @@ declare class Textures extends DataMap<{
110
110
  */
111
111
  getMipLevels(texture: Texture, width: number, height: number): number;
112
112
  /**
113
- * Returns `true` if the given texture requires mipmaps.
113
+ * Returns `true` if the given texture makes use of mipmapping.
114
114
  *
115
115
  * @param {Texture} texture - The texture.
116
116
  * @return {boolean} Whether mipmaps are required or not.
@@ -1,4 +1,3 @@
1
- import RenderContext from "./RenderContext.js";
2
1
  /**
3
2
  * Abstract base class of a timestamp query pool.
4
3
  *
@@ -19,13 +18,13 @@ declare abstract class TimestampQueryPool {
19
18
  */
20
19
  constructor(maxQueries?: number);
21
20
  /**
22
- * Allocate queries for a specific renderContext.
21
+ * Allocate queries for a specific uid.
23
22
  *
24
23
  * @abstract
25
- * @param {Object} renderContext - The render context to allocate queries for.
24
+ * @param {string} uid - A unique identifier for the render context.
26
25
  * @returns {?number}
27
26
  */
28
- abstract allocateQueriesForContext(renderContext: RenderContext): number | null;
27
+ abstract allocateQueriesForContext(uid: string): number | null;
29
28
  /**
30
29
  * Resolve all timestamps and return data (or process them).
31
30
  *
@@ -78,7 +78,9 @@ declare class XRManager extends EventDispatcher<XRManagerEventMap> {
78
78
  _controllerInputSources: (XRInputSource | null)[];
79
79
  _xrRenderTarget: XRRenderTarget | null;
80
80
  _layers: XRLayerObject[];
81
+ _sessionUsesLayers: boolean;
81
82
  _supportsLayers: boolean;
83
+ _supportsGlBinding: boolean;
82
84
  _frameBufferTargets:
83
85
  | WeakMap<XRRenderTarget, {
84
86
  frameBufferTarget: RenderTarget | null;
@@ -207,6 +209,15 @@ declare class XRManager extends EventDispatcher<XRManagerEventMap> {
207
209
  * @return {'opaque'|'additive'|'alpha-blend'|undefined} The environment blend mode. Returns `undefined` when used outside of a XR session.
208
210
  */
209
211
  getEnvironmentBlendMode(): XREnvironmentBlendMode | undefined;
212
+ /**
213
+ * Returns the current XR binding.
214
+ *
215
+ * Creates a new binding if needed and the browser is
216
+ * capable of doing so.
217
+ *
218
+ * @return {?XRWebGLBinding} The XR binding. Returns `null` if one cannot be created.
219
+ */
220
+ getBinding(): XRWebGLBinding | null;
210
221
  /**
211
222
  * Returns the current XR frame.
212
223
  *
@@ -92,17 +92,17 @@ declare class NodeLibrary {
92
92
  /**
93
93
  * Adds a node class definition for the given type to the provided type library.
94
94
  *
95
- * @param {any} nodeClass - The node class definition.
95
+ * @param {Node.constructor} nodeClass - The node class definition.
96
96
  * @param {number|string} type - The object type.
97
- * @param {Map} library - The type library.
97
+ * @param {Map<number|string,Node.constructor>} library - The type library.
98
98
  */
99
99
  addType<TNodeClass, TType>(nodeClass: TNodeClass, type: TType, library: Map<TType, TNodeClass>): void;
100
100
  /**
101
101
  * Adds a node class definition for the given class definition to the provided type library.
102
102
  *
103
- * @param {any} nodeClass - The node class definition.
104
- * @param {any} baseClass - The class definition.
105
- * @param {WeakMap} library - The type library.
103
+ * @param {Node.constructor} nodeClass - The node class definition.
104
+ * @param {Node.constructor} baseClass - The class definition.
105
+ * @param {WeakMap<Node.constructor, Node.constructor>} library - The type library.
106
106
  */
107
107
  addClass<TNodeClass, TBaseClass extends object>(
108
108
  nodeClass: TNodeClass,
@@ -14,7 +14,7 @@ export interface WebGLCapabilitiesParameters {
14
14
  /**
15
15
  * default is false.
16
16
  */
17
- reverseDepthBuffer?: boolean | undefined;
17
+ reversedDepthBuffer?: boolean | undefined;
18
18
  }
19
19
 
20
20
  export class WebGLCapabilities {
@@ -30,7 +30,7 @@ export class WebGLCapabilities {
30
30
 
31
31
  precision: string;
32
32
  logarithmicDepthBuffer: boolean;
33
- reverseDepthBuffer: boolean;
33
+ reversedDepthBuffer: boolean;
34
34
 
35
35
  maxTextures: number;
36
36
  maxVertexTextures: number;
@@ -19,7 +19,6 @@ export default class WGSLNodeBuilder extends NodeBuilder {
19
19
  builtins: { [key in BuiltinStage]: Map<string, BuiltinType> };
20
20
  uniformGroups: { [key in NodeShaderStage]: NodeUniformsGroup };
21
21
 
22
- needsToWorkingColorSpace(texture: Texture): boolean;
23
22
  _generateTextureSample(
24
23
  texture: Texture,
25
24
  textureProperty: string,
@@ -112,7 +112,7 @@ export enum GPUTextureFormat {
112
112
  // Packed 32-bit formats
113
113
  RGB9E5UFloat = "rgb9e5ufloat",
114
114
  RGB10A2Unorm = "rgb10a2unorm",
115
- RG11B10UFloat = "rgb10a2unorm",
115
+ RG11B10UFloat = "rg11b10ufloat",
116
116
 
117
117
  // 64-bit formats
118
118
 
@@ -1,10 +1,9 @@
1
1
  import { Mesh } from "../../objects/Mesh.js";
2
- import { Texture } from "../../textures/Texture.js";
3
- import { WebGLRenderer } from "../WebGLRenderer.js";
2
+ import { ExternalTexture } from "../../textures/ExternalTexture.js";
4
3
  import { WebXRArrayCamera } from "./WebXRManager.js";
5
4
 
6
5
  export class WebXRDepthSensing {
7
- texture: Texture | null;
6
+ texture: ExternalTexture | null;
8
7
  mesh: Mesh | null;
9
8
 
10
9
  depthNear: number;
@@ -12,11 +11,11 @@ export class WebXRDepthSensing {
12
11
 
13
12
  constructor();
14
13
 
15
- init(renderer: WebGLRenderer, depthData: XRWebGLDepthInformation, renderState: XRRenderState): void;
14
+ init(depthData: XRWebGLDepthInformation, renderState: XRRenderState): void;
16
15
 
17
16
  getMesh(cameraXR: WebXRArrayCamera): Mesh | null;
18
17
 
19
18
  reset(): void;
20
19
 
21
- getDepthTexture(): Texture | null;
20
+ getDepthTexture(): ExternalTexture | null;
22
21
  }
@@ -5,7 +5,7 @@ import { PerspectiveCamera } from "../../cameras/PerspectiveCamera.js";
5
5
  import { EventDispatcher } from "../../core/EventDispatcher.js";
6
6
  import { Vector4 } from "../../math/Vector4.js";
7
7
  import { Mesh } from "../../objects/Mesh.js";
8
- import { Texture } from "../../textures/Texture.js";
8
+ import { ExternalTexture } from "../../textures/ExternalTexture.js";
9
9
  import { WebGLRenderer } from "../WebGLRenderer.js";
10
10
  import { XRGripSpace, XRHandSpace, XRTargetRaySpace } from "./WebXRController.js";
11
11
 
@@ -65,7 +65,7 @@ export class WebXRManager extends EventDispatcher<WebXRManagerEventMap> {
65
65
 
66
66
  getEnvironmentBlendMode: () => XREnvironmentBlendMode | undefined;
67
67
 
68
- getDepthTexture: () => Texture | null;
68
+ getDepthTexture: () => ExternalTexture | null;
69
69
 
70
70
  updateCamera: (camera: PerspectiveCamera) => void;
71
71
 
@@ -79,6 +79,8 @@ export class WebXRManager extends EventDispatcher<WebXRManagerEventMap> {
79
79
 
80
80
  getDepthSensingMesh: () => Mesh | null;
81
81
 
82
+ getCameraTexture: (xrCamera: WebXRCamera) => ExternalTexture | undefined;
83
+
82
84
  setAnimationLoop: (callback: XRFrameRequestCallback | null) => void;
83
85
 
84
86
  dispose: () => void;
@@ -39,9 +39,9 @@ export class CompressedTexture extends Texture {
39
39
  * @param colorSpace See {@link Texture.colorSpace .colorSpace}. Default {@link NoColorSpace}
40
40
  */
41
41
  constructor(
42
- mipmaps?: CompressedTextureMipmap[],
43
- width?: number,
44
- height?: number,
42
+ mipmaps: CompressedTextureMipmap[],
43
+ width: number,
44
+ height: number,
45
45
  format?: CompressedPixelFormat,
46
46
  type?: TextureDataType,
47
47
  mapping?: Mapping,
@@ -71,7 +71,7 @@ export class CompressedTexture extends Texture {
71
71
  * The mipmaps array should contain objects with data, width and height. The mipmaps should be of the correct
72
72
  * format and type.
73
73
  */
74
- mipmaps: CompressedTextureMipmap[] | undefined;
74
+ mipmaps: CompressedTextureMipmap[];
75
75
 
76
76
  /**
77
77
  * @override
@@ -1,4 +1,5 @@
1
1
  import { MagnificationTextureFilter, MinificationTextureFilter, Wrapping } from "../constants.js";
2
+ import { TypedArray } from "../core/BufferAttribute.js";
2
3
  import { TextureImageData } from "./DataTexture.js";
3
4
  import { Texture } from "./Texture.js";
4
5
 
@@ -40,7 +41,7 @@ export class Data3DTexture extends Texture {
40
41
  * @param height Height of the texture. Default `1`.
41
42
  * @param depth Depth of the texture. Default `1`.
42
43
  */
43
- constructor(data?: BufferSource | null, width?: number, height?: number, depth?: number);
44
+ constructor(data?: TypedArray | null, width?: number, height?: number, depth?: number);
44
45
 
45
46
  /**
46
47
  * Read-only flag to check if a given object is of type {@link Data3DTexture}.
@@ -6,6 +6,7 @@ import {
6
6
  TextureDataType,
7
7
  Wrapping,
8
8
  } from "../constants.js";
9
+ import { TypedArray } from "../core/BufferAttribute.js";
9
10
  import { Texture } from "./Texture.js";
10
11
 
11
12
  /**
@@ -51,7 +52,7 @@ export class DataTexture extends Texture {
51
52
  * @param colorSpace See {@link Texture.colorSpace | .colorSpace}. Default {@link NoColorSpace}
52
53
  */
53
54
  constructor(
54
- data?: ArrayBufferView | null,
55
+ data?: TypedArray | null,
55
56
  width?: number,
56
57
  height?: number,
57
58
  format?: PixelFormat,
@@ -111,7 +112,7 @@ export class DataTexture extends Texture {
111
112
  }
112
113
 
113
114
  export interface TextureImageData {
114
- data: ArrayBufferView;
115
+ data: TypedArray;
115
116
  height: number;
116
117
  width: number;
117
118
  }
@@ -0,0 +1,11 @@
1
+ import { Texture } from "./Texture.js";
2
+
3
+ declare class ExternalTexture extends Texture {
4
+ sourceTexture: WebGLTexture | GPUTexture | null;
5
+
6
+ readonly isExternalTexture: true;
7
+
8
+ constructor(sourceTexture?: WebGLTexture | GPUTexture | null);
9
+ }
10
+
11
+ export { ExternalTexture };
@@ -207,7 +207,7 @@ export class Texture extends EventDispatcher<{ dispose: {} }> {
207
207
  * Array of user-specified mipmaps
208
208
  * @defaultValue `[]`
209
209
  */
210
- mipmaps: CompressedTextureMipmap[] | CubeTexture[] | HTMLCanvasElement[] | undefined;
210
+ mipmaps: CompressedTextureMipmap[] | CubeTexture[] | HTMLCanvasElement[];
211
211
 
212
212
  /**
213
213
  * How the image is applied to the object.