@types/three 0.174.0 → 0.176.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 (102) hide show
  1. three/README.md +2 -2
  2. three/examples/jsm/Addons.d.ts +1 -1
  3. three/examples/jsm/controls/PointerLockControls.d.ts +4 -1
  4. three/examples/jsm/geometries/ParametricFunctions.d.ts +8 -0
  5. three/examples/jsm/helpers/RapierHelper.d.ts +13 -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/LottieLoader.d.ts +4 -0
  9. three/examples/jsm/misc/MD2CharacterComplex.d.ts +1 -1
  10. three/examples/jsm/physics/RapierPhysics.d.ts +12 -0
  11. three/examples/jsm/postprocessing/BokehPass.d.ts +2 -2
  12. three/examples/jsm/postprocessing/HalftonePass.d.ts +1 -1
  13. three/examples/jsm/postprocessing/LUTPass.d.ts +1 -1
  14. three/examples/jsm/postprocessing/SMAAPass.d.ts +1 -1
  15. three/examples/jsm/transpiler/AST.d.ts +218 -1
  16. three/examples/jsm/transpiler/TSLEncoder.d.ts +35 -1
  17. three/examples/jsm/tsl/shadows/TileShadowNode.d.ts +14 -0
  18. three/examples/jsm/tsl/shadows/TileShadowNodeHelper.d.ts +14 -0
  19. three/examples/jsm/webxr/VRButton.d.ts +4 -2
  20. three/package.json +4 -3
  21. three/src/Three.Core.d.ts +2 -0
  22. three/src/Three.TSL.d.ts +11 -1
  23. three/src/animation/AnimationAction.d.ts +219 -19
  24. three/src/animation/AnimationClip.d.ts +140 -28
  25. three/src/animation/AnimationMixer.d.ts +100 -8
  26. three/src/animation/AnimationObjectGroup.d.ts +55 -14
  27. three/src/animation/AnimationUtils.d.ts +154 -43
  28. three/src/animation/KeyframeTrack.d.ts +134 -25
  29. three/src/animation/PropertyBinding.d.ts +89 -31
  30. three/src/animation/PropertyMixer.d.ts +62 -5
  31. three/src/animation/tracks/BooleanKeyframeTrack.d.ts +12 -4
  32. three/src/animation/tracks/ColorKeyframeTrack.d.ts +10 -4
  33. three/src/animation/tracks/NumberKeyframeTrack.d.ts +10 -4
  34. three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +10 -4
  35. three/src/animation/tracks/StringKeyframeTrack.d.ts +12 -4
  36. three/src/animation/tracks/VectorKeyframeTrack.d.ts +10 -4
  37. three/src/audio/AudioListener.d.ts +1 -1
  38. three/src/cameras/ArrayCamera.d.ts +5 -0
  39. three/src/constants.d.ts +18 -17
  40. three/src/core/BufferAttribute.d.ts +11 -0
  41. three/src/core/BufferGeometry.d.ts +1 -3
  42. three/src/core/RenderTarget.d.ts +9 -0
  43. three/src/extras/Controls.d.ts +1 -1
  44. three/src/extras/Earcut.d.ts +5 -3
  45. three/src/extras/ImageUtils.d.ts +1 -0
  46. three/src/geometries/CapsuleGeometry.d.ts +10 -3
  47. three/src/lights/LightShadow.d.ts +8 -0
  48. three/src/lights/PointLight.d.ts +1 -1
  49. three/src/loaders/FileLoader.d.ts +2 -2
  50. three/src/loaders/LoaderUtils.d.ts +0 -5
  51. three/src/materials/Material.d.ts +6 -8
  52. three/src/materials/ShaderMaterial.d.ts +1 -1
  53. three/src/materials/nodes/NodeMaterial.d.ts +10 -2
  54. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +8 -0
  55. three/src/math/FrustumArray.d.ts +27 -0
  56. three/src/nodes/Nodes.d.ts +1 -0
  57. three/src/nodes/TSL.d.ts +1 -0
  58. three/src/nodes/accessors/BufferAttributeNode.d.ts +11 -4
  59. three/src/nodes/accessors/InstanceNode.d.ts +2 -3
  60. three/src/nodes/accessors/Object3DNode.d.ts +6 -6
  61. three/src/nodes/accessors/SkinningNode.d.ts +4 -3
  62. three/src/nodes/accessors/StorageTextureNode.d.ts +2 -2
  63. three/src/nodes/accessors/TextureNode.d.ts +3 -1
  64. three/src/nodes/accessors/VertexColorNode.d.ts +1 -1
  65. three/src/nodes/code/ExpressionNode.d.ts +3 -2
  66. three/src/nodes/code/ScriptableNode.d.ts +1 -1
  67. three/src/nodes/code/ScriptableValueNode.d.ts +1 -1
  68. three/src/nodes/core/Node.d.ts +8 -5
  69. three/src/nodes/core/NodeVarying.d.ts +11 -1
  70. three/src/nodes/core/StackNode.d.ts +7 -1
  71. three/src/nodes/core/StructTypeNode.d.ts +1 -1
  72. three/src/nodes/core/VaryingNode.d.ts +6 -0
  73. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +3 -14
  74. three/src/nodes/lighting/ShadowFilterNode.d.ts +28 -0
  75. three/src/nodes/lighting/ShadowNode.d.ts +26 -24
  76. three/src/nodes/math/ConditionalNode.d.ts +4 -4
  77. three/src/nodes/math/MathNode.d.ts +20 -12
  78. three/src/nodes/math/OperatorNode.d.ts +65 -25
  79. three/src/nodes/tsl/TSLBase.d.ts +1 -0
  80. three/src/nodes/tsl/TSLCore.d.ts +34 -26
  81. three/src/nodes/utils/DebugNode.d.ts +21 -0
  82. three/src/nodes/utils/ReflectorNode.d.ts +1 -1
  83. three/src/nodes/utils/SpriteSheetUVNode.d.ts +2 -2
  84. three/src/renderers/common/Animation.d.ts +4 -4
  85. three/src/renderers/common/Attributes.d.ts +1 -1
  86. three/src/renderers/common/Color4.d.ts +1 -1
  87. three/src/renderers/common/CubeRenderTarget.d.ts +6 -0
  88. three/src/renderers/common/RenderList.d.ts +2 -2
  89. three/src/renderers/common/RenderObject.d.ts +1 -1
  90. three/src/renderers/common/RenderObjects.d.ts +2 -2
  91. three/src/renderers/common/Renderer.d.ts +55 -27
  92. three/src/renderers/common/Textures.d.ts +0 -7
  93. three/src/renderers/common/TimestampQueryPool.d.ts +1 -0
  94. three/src/renderers/common/XRManager.d.ts +79 -4
  95. three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -3
  96. three/src/renderers/webgpu/WebGPUBackend.d.ts +1 -0
  97. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +1 -1
  98. three/src/textures/CanvasTexture.d.ts +1 -1
  99. three/src/textures/DepthArrayTexture.d.ts +14 -0
  100. three/src/textures/Texture.d.ts +8 -1
  101. three/src/textures/VideoFrameTexture.d.ts +1 -1
  102. three/examples/jsm/geometries/ParametricGeometries.d.ts +0 -32
@@ -1,10 +1,18 @@
1
1
  import { KeyframeTrack } from "../KeyframeTrack.js";
2
2
 
3
+ /**
4
+ * A track for boolean keyframe values.
5
+ */
3
6
  export class BooleanKeyframeTrack extends KeyframeTrack {
4
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>);
5
-
6
7
  /**
7
- * @default 'bool'
8
+ * Constructs a new boolean keyframe track.
9
+ *
10
+ * This keyframe track type has no `interpolation` parameter because the
11
+ * interpolation is always discrete.
12
+ *
13
+ * @param {string} name - The keyframe track's name.
14
+ * @param {Array<number>} times - A list of keyframe times.
15
+ * @param {Array<number>} values - A list of keyframe values.
8
16
  */
9
- ValueTypeName: string;
17
+ constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>);
10
18
  }
@@ -1,11 +1,17 @@
1
1
  import { InterpolationModes } from "../../constants.js";
2
2
  import { KeyframeTrack } from "../KeyframeTrack.js";
3
3
 
4
+ /**
5
+ * A track for color keyframe values.
6
+ */
4
7
  export class ColorKeyframeTrack extends KeyframeTrack {
5
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
6
-
7
8
  /**
8
- * @default 'color'
9
+ * Constructs a new color keyframe track.
10
+ *
11
+ * @param {string} name - The keyframe track's name.
12
+ * @param {Array<number>} times - A list of keyframe times.
13
+ * @param {Array<number>} values - A list of keyframe values.
14
+ * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
9
15
  */
10
- ValueTypeName: string;
16
+ constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
11
17
  }
@@ -1,11 +1,17 @@
1
1
  import { InterpolationModes } from "../../constants.js";
2
2
  import { KeyframeTrack } from "../KeyframeTrack.js";
3
3
 
4
+ /**
5
+ * A track for numeric keyframe values.
6
+ */
4
7
  export class NumberKeyframeTrack extends KeyframeTrack {
5
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
6
-
7
8
  /**
8
- * @default 'number'
9
+ * Constructs a new number keyframe track.
10
+ *
11
+ * @param {string} name - The keyframe track's name.
12
+ * @param {Array<number>} times - A list of keyframe times.
13
+ * @param {Array<number>} values - A list of keyframe values.
14
+ * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
9
15
  */
10
- ValueTypeName: string;
16
+ constructor(name: string, times: Array<number>, values: Array<number>, interpolation?: InterpolationModes);
11
17
  }
@@ -1,11 +1,17 @@
1
1
  import { InterpolationModes } from "../../constants.js";
2
2
  import { KeyframeTrack } from "../KeyframeTrack.js";
3
3
 
4
+ /**
5
+ * A track for Quaternion keyframe values.
6
+ */
4
7
  export class QuaternionKeyframeTrack extends KeyframeTrack {
5
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
6
-
7
8
  /**
8
- * @default 'quaternion'
9
+ * Constructs a new Quaternion keyframe track.
10
+ *
11
+ * @param {string} name - The keyframe track's name.
12
+ * @param {Array<number>} times - A list of keyframe times.
13
+ * @param {Array<number>} values - A list of keyframe values.
14
+ * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
9
15
  */
10
- ValueTypeName: string;
16
+ constructor(name: string, times: Array<number>, values: Array<number>, interpolation?: InterpolationModes);
11
17
  }
@@ -1,10 +1,18 @@
1
1
  import { KeyframeTrack } from "../KeyframeTrack.js";
2
2
 
3
+ /**
4
+ * A track for string keyframe values.
5
+ */
3
6
  export class StringKeyframeTrack extends KeyframeTrack {
4
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>);
5
-
6
7
  /**
7
- * @default 'string'
8
+ * Constructs a new string keyframe track.
9
+ *
10
+ * This keyframe track type has no `interpolation` parameter because the
11
+ * interpolation is always discrete.
12
+ *
13
+ * @param {string} name - The keyframe track's name.
14
+ * @param {Array<number>} times - A list of keyframe times.
15
+ * @param {Array<number>} values - A list of keyframe values.
8
16
  */
9
- ValueTypeName: string;
17
+ constructor(name: string, times: Array<number>, values: Array<number>);
10
18
  }
@@ -1,11 +1,17 @@
1
1
  import { InterpolationModes } from "../../constants.js";
2
2
  import { KeyframeTrack } from "../KeyframeTrack.js";
3
3
 
4
+ /**
5
+ * A track for vector keyframe values.
6
+ */
4
7
  export class VectorKeyframeTrack extends KeyframeTrack {
5
- constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
6
-
7
8
  /**
8
- * @default 'vector'
9
+ * Constructs a new vector keyframe track.
10
+ *
11
+ * @param {string} name - The keyframe track's name.
12
+ * @param {Array<number>} times - A list of keyframe times.
13
+ * @param {Array<number>} values - A list of keyframe values.
14
+ * @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
9
15
  */
10
- ValueTypeName: string;
16
+ constructor(name: string, times: Array<number>, values: Array<number>, interpolation?: InterpolationModes);
11
17
  }
@@ -4,7 +4,7 @@ import { AudioContext } from "./AudioContext.js";
4
4
  /**
5
5
  * The {@link AudioListener} represents a virtual {@link https://developer.mozilla.org/en-US/docs/Web/API/AudioListener | listener} of the all positional and non-positional audio effects in the scene.
6
6
  * A three.js application usually creates a single instance of {@link AudioListener} * @remarks
7
- * It is a mandatory construtor parameter for audios entities like {@link Audio | Audio} and {@link PositionalAudio | PositionalAudio}.
7
+ * It is a mandatory constructor parameter for audios entities like {@link Audio | Audio} and {@link PositionalAudio | PositionalAudio}.
8
8
  * In most cases, the listener object is a child of the camera
9
9
  * So the 3D transformation of the camera represents the 3D transformation of the listener.
10
10
  * @example
@@ -18,6 +18,11 @@ export class ArrayCamera extends PerspectiveCamera {
18
18
  */
19
19
  readonly isArrayCamera: true;
20
20
 
21
+ /**
22
+ * Whether this camera is used with multiview rendering or not.
23
+ */
24
+ isMultiViewCamera: boolean;
25
+
21
26
  /**
22
27
  * An array of cameras.
23
28
  * @defaultValue `[]`
three/src/constants.d.ts CHANGED
@@ -371,19 +371,6 @@ export const RGBFormat: 1022;
371
371
  /** {@link RGBAFormat} is the default and reads the red, green, blue and alpha components. */
372
372
  export const RGBAFormat: 1023;
373
373
 
374
- /**
375
- * {@link LuminanceFormat} reads each element as a single luminance component.
376
- * This is then converted to a floating point, clamped to the range `[0,1]`, and then assembled into an RGBA element by
377
- * placing the luminance value in the red, green and blue channels, and attaching `1.0` to the alpha channel.
378
- */
379
- export const LuminanceFormat: 1024;
380
-
381
- /**
382
- * {@link LuminanceAlphaFormat} reads each element as a luminance/alpha double.
383
- * The same process occurs as for the {@link LuminanceFormat}, except that the alpha channel may have values other than `1.0`.
384
- */
385
- export const LuminanceAlphaFormat: 1025;
386
-
387
374
  /**
388
375
  * {@link DepthFormat} reads each element as a single depth value, converts it to floating point, and clamps to the range `[0,1]`.
389
376
  * @remarks This is the default for {@link THREE.DepthTexture}.
@@ -420,7 +407,7 @@ export const RGFormat: 1030;
420
407
  export const RGIntegerFormat: 1031;
421
408
 
422
409
  /**
423
- * {@link RGBIntegerFormat} discrads the alpha components and reads the red, green, and blue components.
410
+ * {@link RGBIntegerFormat} discards the alpha components and reads the red, green, and blue components.
424
411
  */
425
412
  export const RGBIntegerFormat: 1032;
426
413
 
@@ -440,8 +427,6 @@ export type PixelFormat =
440
427
  | typeof AlphaFormat
441
428
  | typeof RGBFormat
442
429
  | typeof RGBAFormat
443
- | typeof LuminanceFormat
444
- | typeof LuminanceAlphaFormat
445
430
  | typeof DepthFormat
446
431
  | typeof DepthStencilFormat
447
432
  | typeof RedFormat
@@ -478,7 +463,7 @@ export const RGBA_S3TC_DXT1_Format: 33777;
478
463
  */
479
464
  export const RGBA_S3TC_DXT3_Format: 33778;
480
465
  /**
481
- * A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.
466
+ * A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs from the DXT3 compression in how the alpha compression is done.
482
467
  * @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
483
468
  */
484
469
  export const RGBA_S3TC_DXT5_Format: 33779;
@@ -797,6 +782,22 @@ export const TimestampQuery: {
797
782
  };
798
783
  export type TimestampQuery = "compute" | "render";
799
784
 
785
+ export const InterpolationSamplingType: {
786
+ PERSPECTIVE: "perspective";
787
+ LINEAR: "linear";
788
+ FLAT: "flat";
789
+ };
790
+ export type InterpolationSamplingType = "perspective" | "linear" | "flat";
791
+
792
+ export const InterpolationSamplingMode: {
793
+ NORMAL: "normal";
794
+ CENTROID: "centroid";
795
+ SAMPLE: "sample";
796
+ FLAT_FIRST: "flat first";
797
+ FLAT_EITHER: "flat either";
798
+ };
799
+ export type InterpolationSamplingMode = "normal" | "centroid" | "sample" | "flat first" | "flat either";
800
+
800
801
  ///////////////////////////////////////////////////////////////////////////////
801
802
  // Texture - Internal Pixel Formats
802
803
 
@@ -13,6 +13,17 @@ export type TypedArray =
13
13
  | Float32Array
14
14
  | Float64Array;
15
15
 
16
+ export type TypedArrayConstructor =
17
+ | Int8ArrayConstructor
18
+ | Uint8ArrayConstructor
19
+ | Uint8ClampedArrayConstructor
20
+ | Int16ArrayConstructor
21
+ | Uint16ArrayConstructor
22
+ | Int32ArrayConstructor
23
+ | Uint32ArrayConstructor
24
+ | Float32ArrayConstructor
25
+ | Float64ArrayConstructor;
26
+
16
27
  export interface BufferAttributeJSON {
17
28
  itemSize: number;
18
29
  type: string;
@@ -172,9 +172,7 @@ export class BufferGeometry<
172
172
  * You will have to call {@link dispose | .dispose}(), and create a new instance of {@link THREE.BufferGeometry | BufferGeometry}.
173
173
  * @defaultValue `{}`
174
174
  */
175
- morphAttributes: {
176
- [name: string]: Array<BufferAttribute | InterleavedBufferAttribute>; // TODO Replace for 'Record<>'
177
- };
175
+ morphAttributes: Record<"position" | "normal" | "color", Array<BufferAttribute | InterleavedBufferAttribute>>;
178
176
 
179
177
  /**
180
178
  * Used to control the morph target behavior; when set to true, the morph target data is treated as relative offsets, rather than as absolute positions/normals.
@@ -11,6 +11,7 @@ import { Texture } from "../textures/Texture.js";
11
11
  import { EventDispatcher } from "./EventDispatcher.js";
12
12
 
13
13
  export interface RenderTargetOptions {
14
+ depth?: number | undefined;
14
15
  wrapS?: Wrapping | undefined;
15
16
  wrapT?: Wrapping | undefined;
16
17
  magFilter?: MagnificationTextureFilter | undefined;
@@ -32,6 +33,7 @@ export interface RenderTargetOptions {
32
33
  */
33
34
  samples?: number | undefined;
34
35
  count?: number | undefined;
36
+ multiview?: boolean | undefined;
35
37
  }
36
38
 
37
39
  export class RenderTarget<TTexture extends Texture | Texture[] = Texture> extends EventDispatcher<{ dispose: {} }> {
@@ -78,6 +80,13 @@ export class RenderTarget<TTexture extends Texture | Texture[] = Texture> extend
78
80
  */
79
81
  samples: number;
80
82
 
83
+ /**
84
+ * Whether to this target is used in multiview rendering.
85
+ *
86
+ * @default false
87
+ */
88
+ multiview: boolean;
89
+
81
90
  constructor(width?: number, height?: number, options?: RenderTargetOptions);
82
91
 
83
92
  get texture(): TTexture;
@@ -32,7 +32,7 @@ declare abstract class Controls<TEventMap extends {}> extends EventDispatcher<TE
32
32
  * Connects the controls to the DOM. This method has so called "side effects" since it adds the module's event
33
33
  * listeners to the DOM.
34
34
  */
35
- connect(): void;
35
+ connect(element: HTMLElement): void;
36
36
 
37
37
  /**
38
38
  * Disconnects the controls from the DOM.
@@ -5,11 +5,13 @@
5
5
  * @see {@link https://threejs.org/docs/index.html#api/en/extras/Earcut | Official Documentation}
6
6
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/extras/Earcut.js | Source}
7
7
  */
8
- export const Earcut: {
8
+ declare class Earcut {
9
9
  /**
10
10
  * Triangulates the given shape definition by returning an array of triangles
11
11
  * @remarks
12
12
  * A triangle is defined by three consecutive integers representing vertex indices.
13
13
  */
14
- triangulate(data: number[], holeIndices?: number[], dim?: number): number[];
15
- };
14
+ static triangulate(data: number[], holeIndices?: number[], dim?: number): number[];
15
+ }
16
+
17
+ export { Earcut };
@@ -10,6 +10,7 @@ declare class ImageUtils {
10
10
  */
11
11
  static getDataURL(
12
12
  image: HTMLImageElement | HTMLCanvasElement | CanvasImageSource | ImageBitmap | ImageData,
13
+ type?: string,
13
14
  ): string;
14
15
 
15
16
  /**
@@ -19,11 +19,18 @@ export class CapsuleGeometry extends BufferGeometry {
19
19
  /**
20
20
  * Create a new instance of {@link CapsuleGeometry}
21
21
  * @param radius Radius of the capsule. Expects a `Float`. Default `1`
22
- * @param length Length of the middle section. Expects a `Float`. Default `1`
22
+ * @param height Height of the middle section. Expects a `Float`. Default `1`
23
23
  * @param capSegments Number of curve segments used to build the caps. Expects a `Integer`. Default `4`
24
24
  * @param radialSegments Number of segmented faces around the circumference of the capsule. Expects a `Integer`. Default `8`
25
+ * @param heightSegments Number of rows of faces along the height of the capsule. Optional; defaults to `1`.
25
26
  */
26
- constructor(radius?: number, length?: number, capSegments?: number, radialSegments?: number);
27
+ constructor(
28
+ radius?: number,
29
+ height?: number,
30
+ capSegments?: number,
31
+ radialSegments?: number,
32
+ heightSegments?: number,
33
+ );
27
34
 
28
35
  /**
29
36
  * A Read-only _string_ to check if `this` object type.
@@ -38,7 +45,7 @@ export class CapsuleGeometry extends BufferGeometry {
38
45
  */
39
46
  readonly parameters: {
40
47
  readonly radius: number;
41
- readonly length: number;
48
+ readonly height: number;
42
49
  readonly capSegments: number;
43
50
  readonly radialSegments: number;
44
51
  };
@@ -1,4 +1,5 @@
1
1
  import { Camera } from "../cameras/Camera.js";
2
+ import { TextureDataType } from "../constants.js";
2
3
  import { Object3DJSONObject } from "../core/Object3D.js";
3
4
  import { Frustum } from "../math/Frustum.js";
4
5
  import { Matrix4 } from "../math/Matrix4.js";
@@ -86,6 +87,13 @@ export class LightShadow<TCamera extends Camera = Camera> {
86
87
  */
87
88
  mapSize: Vector2;
88
89
 
90
+ /**
91
+ * The type of shadow texture. The default is `UnsignedByteType`.
92
+ *
93
+ * @default UnsignedByteType
94
+ */
95
+ mapType: TextureDataType;
96
+
89
97
  /**
90
98
  * The depth map generated using the internal camera; a location beyond a pixel's depth is in shadow. Computed internally during rendering.
91
99
  * @defaultValue null
@@ -22,7 +22,7 @@ import { PointLightShadow } from "./PointLightShadow.js";
22
22
  export class PointLight extends Light<PointLightShadow> {
23
23
  /**
24
24
  * Creates a new PointLight.
25
- * @param color Hexadecimal color of the light. Default is 0xffffff (white). Expects a `Integer`
25
+ * @param color Hexadecimal color of the light. Default is 0xffffff (white). Expects an `Integer`
26
26
  * @param intensity Numeric value of the light's strength/intensity. Expects a `Float`. Default `1`
27
27
  * @param distance Maximum range of the light. Default is 0 (no limit).
28
28
  * @param decay The amount the light dims along the distance of the light. Expects a `Float`. Default `2`
@@ -11,8 +11,8 @@ export class FileLoader extends Loader<string | ArrayBuffer> {
11
11
  onError?: (err: unknown) => void,
12
12
  ): void;
13
13
 
14
- mimeType: string | undefined;
15
- responseType: string | undefined;
14
+ mimeType: string;
15
+ responseType: string;
16
16
 
17
17
  setMimeType(mimeType: string): FileLoader;
18
18
  setResponseType(responseType: string): FileLoader;
@@ -1,9 +1,4 @@
1
1
  export class LoaderUtils {
2
- /**
3
- * @deprecated decodeText() has been deprecated with r165 and will be removed with r175. Use TextDecoder instead.
4
- */
5
- static decodeText(array: BufferSource): string;
6
-
7
2
  static extractUrlBase(url: string): string;
8
3
 
9
4
  static resolveURL(url: string, path: string): string;
@@ -52,6 +52,7 @@ export interface MaterialParameters {
52
52
  precision?: "highp" | "mediump" | "lowp" | null | undefined;
53
53
  premultipliedAlpha?: boolean | undefined;
54
54
  forceSinglePass?: boolean | undefined;
55
+ allowOverride?: boolean | undefined;
55
56
  dithering?: boolean | undefined;
56
57
  side?: Side | undefined;
57
58
  shadowSide?: Side | undefined;
@@ -286,7 +287,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
286
287
  blendDst: BlendingDstFactor;
287
288
 
288
289
  /**
289
- * The tranparency of the .blendDst. Default is null.
290
+ * The transparency of the .blendDst. Default is null.
290
291
  * @default null
291
292
  */
292
293
  blendDstAlpha: number | null;
@@ -298,7 +299,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
298
299
  blendEquation: BlendingEquation;
299
300
 
300
301
  /**
301
- * The tranparency of the .blendEquation. Default is null.
302
+ * The transparency of the .blendEquation. Default is null.
302
303
  * @default null
303
304
  */
304
305
  blendEquationAlpha: number | null;
@@ -316,7 +317,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
316
317
  blendSrc: BlendingSrcFactor | BlendingDstFactor;
317
318
 
318
319
  /**
319
- * The tranparency of the .blendSrc. Default is null.
320
+ * The transparency of the .blendSrc. Default is null.
320
321
  * @default null
321
322
  */
322
323
  blendSrcAlpha: number | null;
@@ -479,6 +480,8 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
479
480
  */
480
481
  forceSinglePass: boolean;
481
482
 
483
+ allowOverride: boolean;
484
+
482
485
  /**
483
486
  * Whether to apply dithering to the color to remove the appearance of banding. Default is false.
484
487
  * @default false
@@ -625,9 +628,4 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
625
628
  * @default false
626
629
  */
627
630
  set needsUpdate(value: boolean);
628
-
629
- /**
630
- * @deprecated onBuild() has been removed.
631
- */
632
- onBuild(object: Object3D, parameters: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer): void;
633
631
  }
@@ -61,7 +61,7 @@ export interface ShaderMaterialJSON extends MaterialJSON {
61
61
  defines?: Record<string, unknown>;
62
62
 
63
63
  vertexShader: string;
64
- ragmentShader: string;
64
+ fragmentShader: string;
65
65
 
66
66
  lights: boolean;
67
67
  clipping: boolean;
@@ -27,7 +27,8 @@ export interface NodeMaterialParameters extends MaterialParameters {
27
27
  geometryNode?: Node | null | undefined;
28
28
 
29
29
  depthNode?: Node | null | undefined;
30
- shadowNode?: Node | null | undefined;
30
+ receivedShadowPositionNode?: Node | null | undefined;
31
+ castShadowPositionNode?: Node | null | undefined;
31
32
 
32
33
  outputNode?: Node | null | undefined;
33
34
 
@@ -59,7 +60,8 @@ declare class NodeMaterial extends Material {
59
60
  geometryNode: Node | null;
60
61
 
61
62
  depthNode: Node | null;
62
- shadowPositionNode: Node | null;
63
+ receivedShadowPositionNode: Node | null;
64
+ castShadowPositionNode: Node | null;
63
65
  receivedShadowNode: (() => Node) | null;
64
66
  castShadowNode: Node | null;
65
67
 
@@ -69,6 +71,12 @@ declare class NodeMaterial extends Material {
69
71
  fragmentNode: Node | null;
70
72
  vertexNode: Node | null;
71
73
 
74
+ /**
75
+ * @deprecated ".shadowPositionNode" was renamed to ".receivedShadowPositionNode".'
76
+ */
77
+ get shadowPositionNode(): Node | null;
78
+ set shadowPositionNode(value: Node | null);
79
+
72
80
  constructor();
73
81
 
74
82
  build(builder: NodeBuilder): void;
@@ -2,6 +2,7 @@ import { BufferAttribute } from "../../../core/BufferAttribute.js";
2
2
  import { Matrix4 } from "../../../math/Matrix4.js";
3
3
  import NodeBuilder from "../../../nodes/core/NodeBuilder.js";
4
4
  import NodeFrame from "../../../nodes/core/NodeFrame.js";
5
+ import Renderer from "../../../renderers/common/Renderer.js";
5
6
  import RenderObject from "../../../renderers/common/RenderObject.js";
6
7
  import { Material } from "../../Material.js";
7
8
  declare const refreshUniforms: readonly [
@@ -103,6 +104,13 @@ declare class NodeMaterialObserver {
103
104
  * @return {boolean} Whether the given render object is verified for the first time of this observer.
104
105
  */
105
106
  firstInitialization(renderObject: RenderObject): boolean;
107
+ /**
108
+ * Returns `true` if the current rendering produces motion vectors.
109
+ *
110
+ * @param {Renderer} renderer - The renderer.
111
+ * @return {boolean} Whether the current rendering produces motion vectors or not.
112
+ */
113
+ needsVelocity(renderer: Renderer): boolean;
106
114
  /**
107
115
  * Returns monitoring data for the given render object.
108
116
  *
@@ -0,0 +1,27 @@
1
+ import { ArrayCamera } from "../cameras/ArrayCamera.js";
2
+ import { CoordinateSystem } from "../constants.js";
3
+ import { Object3D } from "../core/Object3D.js";
4
+ import { Sprite } from "../objects/Sprite.js";
5
+ import { Box3 } from "./Box3.js";
6
+ import { Sphere } from "./Sphere.js";
7
+ import { Vector3 } from "./Vector3.js";
8
+
9
+ declare class FrustumArray {
10
+ coordinateSystem: CoordinateSystem;
11
+
12
+ constructor();
13
+
14
+ intersectsObject(object: Object3D, cameraArray: ArrayCamera): boolean;
15
+
16
+ intersectsSprite(sprite: Sprite, cameraArray: ArrayCamera): boolean;
17
+
18
+ intersectsSprite(sphere: Sphere, cameraArray: ArrayCamera): boolean;
19
+
20
+ intersectsBox(box: Box3, cameraArray: ArrayCamera): boolean;
21
+
22
+ containsPoint(point: Vector3, cameraArray: ArrayCamera): boolean;
23
+
24
+ clone(): FrustumArray;
25
+ }
26
+
27
+ export { FrustumArray };
@@ -51,6 +51,7 @@ export { NodeUtils };
51
51
  // utils
52
52
  export { default as ArrayElementNode } from "./utils/ArrayElementNode.js";
53
53
  export { default as ConvertNode } from "./utils/ConvertNode.js";
54
+ export { default as DebugNode } from "./utils/DebugNode.js";
54
55
  export { default as EquirectUVNode } from "./utils/EquirectUVNode.js";
55
56
  export { default as FunctionOverloadingNode } from "./utils/FunctionOverloadingNode.js";
56
57
  export { default as JoinNode } from "./utils/JoinNode.js";
three/src/nodes/TSL.d.ts CHANGED
@@ -135,6 +135,7 @@ export * from "./lighting/LightsNode.js";
135
135
  export * from "./lighting/PointLightNode.js";
136
136
  export * from "./lighting/PointShadowNode.js";
137
137
  export * from "./lighting/ShadowBaseNode.js";
138
+ export * from "./lighting/ShadowFilterNode.js";
138
139
  export * from "./lighting/ShadowNode.js";
139
140
 
140
141
  // pmrem
@@ -4,6 +4,8 @@ import { InterleavedBuffer } from "../../core/InterleavedBuffer.js";
4
4
  import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute.js";
5
5
  import InputNode from "../core/InputNode.js";
6
6
  import NodeBuilder from "../core/NodeBuilder.js";
7
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
8
+ import BufferNode from "./BufferNode.js";
7
9
  /**
8
10
  * In earlier `three.js` versions it was only possible to define attribute data
9
11
  * on geometry level. With `BufferAttributeNode`, it is also possible to do this
@@ -119,7 +121,7 @@ export declare const bufferAttribute: (
119
121
  type?: string | null,
120
122
  stride?: number,
121
123
  offset?: number,
122
- ) => import("../tsl/TSLCore.js").ShaderNodeObject<BufferAttributeNode>;
124
+ ) => ShaderNodeObject<BufferAttributeNode>;
123
125
  /**
124
126
  * TSL function for creating a buffer attribute node but with dynamic draw usage.
125
127
  * Use this function if attribute data are updated per frame.
@@ -137,7 +139,7 @@ export declare const dynamicBufferAttribute: (
137
139
  type?: string | null,
138
140
  stride?: number,
139
141
  offset?: number,
140
- ) => import("../tsl/TSLCore.js").ShaderNodeObject<BufferAttributeNode>;
142
+ ) => ShaderNodeObject<BufferAttributeNode>;
141
143
  /**
142
144
  * TSL function for creating a buffer attribute node but with enabled instancing
143
145
  *
@@ -154,7 +156,7 @@ export declare const instancedBufferAttribute: (
154
156
  type?: string | null,
155
157
  stride?: number,
156
158
  offset?: number,
157
- ) => import("../tsl/TSLCore.js").ShaderNodeObject<BufferAttributeNode>;
159
+ ) => ShaderNodeObject<BufferAttributeNode>;
158
160
  /**
159
161
  * TSL function for creating a buffer attribute node but with dynamic draw usage and enabled instancing
160
162
  *
@@ -171,4 +173,9 @@ export declare const instancedDynamicBufferAttribute: (
171
173
  type?: string | null,
172
174
  stride?: number,
173
175
  offset?: number,
174
- ) => import("../tsl/TSLCore.js").ShaderNodeObject<BufferAttributeNode>;
176
+ ) => ShaderNodeObject<BufferAttributeNode>;
177
+ declare module "../tsl/TSLCore.js" {
178
+ interface NodeElements {
179
+ toAttribute: <TValue>(bufferNode: BufferNode<TValue>) => ShaderNodeObject<BufferAttributeNode>;
180
+ }
181
+ }
@@ -1,5 +1,4 @@
1
1
  import { InstancedBufferAttribute } from "../../core/InstancedBufferAttribute.js";
2
- import { InstancedMesh } from "../../objects/InstancedMesh.js";
3
2
  import Node from "../core/Node.js";
4
3
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
5
4
 
@@ -14,12 +13,12 @@ export default class InstanceNode extends Node {
14
13
  constructor(
15
14
  count: number,
16
15
  instanceMatrix: InstancedBufferAttribute,
17
- instanceColor: InstancedBufferAttribute | null,
16
+ instanceColor?: InstancedBufferAttribute | null,
18
17
  );
19
18
  }
20
19
 
21
20
  export const instance: (
22
21
  count: number,
23
22
  instanceMatrix: InstancedBufferAttribute,
24
- instanceColor: InstancedBufferAttribute | null,
23
+ instanceColor?: InstancedBufferAttribute | null,
25
24
  ) => ShaderNodeObject<InstanceNode>;