@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
@@ -16,9 +16,9 @@ export default class Object3DNode extends Node {
16
16
  static RADIUS: "radius";
17
17
  }
18
18
 
19
- export const objectDirection: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
20
- export const objectWorldMatrix: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
21
- export const objectPosition: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
22
- export const objectScale: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
23
- export const objectViewPosition: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
24
- export const objectRadius: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
19
+ export const objectDirection: (object3d: Object3D | null) => ShaderNodeObject<Object3DNode>;
20
+ export const objectWorldMatrix: (object3d: Object3D | null) => ShaderNodeObject<Object3DNode>;
21
+ export const objectPosition: (object3d: Object3D | null) => ShaderNodeObject<Object3DNode>;
22
+ export const objectScale: (object3d: Object3D | null) => ShaderNodeObject<Object3DNode>;
23
+ export const objectViewPosition: (object3d: Object3D | null) => ShaderNodeObject<Object3DNode>;
24
+ export const objectRadius: (object3d: Object3D | null) => ShaderNodeObject<Object3DNode>;
@@ -5,7 +5,6 @@ import { ShaderNodeObject } from "../tsl/TSLCore.js";
5
5
 
6
6
  export default class SkinningNode extends Node {
7
7
  skinnedMesh: SkinnedMesh;
8
- useReference: boolean;
9
8
 
10
9
  skinIndexNode: Node;
11
10
  skinWeightNode: Node;
@@ -13,9 +12,11 @@ export default class SkinningNode extends Node {
13
12
  bindMatrixNode: Node;
14
13
  bindMatrixInverseNode: Node;
15
14
  boneMatricesNode: Node;
15
+ positionNode: Node;
16
+ toPositionNode: Node;
16
17
  previousBoneMatricesNode: Node | null;
17
18
 
18
- constructor(skinnedMesh: SkinnedMesh, useReference?: boolean);
19
+ constructor(skinnedMesh: SkinnedMesh);
19
20
 
20
21
  getSkinnedPosition(boneMatrices?: Node, position?: Node): ShaderNodeObject<Node>;
21
22
 
@@ -27,4 +28,4 @@ export default class SkinningNode extends Node {
27
28
  }
28
29
 
29
30
  export const skinning: (skinnedMesh: SkinnedMesh) => ShaderNodeObject<SkinningNode>;
30
- export const skinningReference: (skinnedMesh: SkinnedMesh) => ShaderNodeObject<SkinningNode>;
31
+ export const computeSkinning: (skinnedMesh: SkinnedMesh, toPosition?: Node | null) => ShaderNodeObject<SkinningNode>;
@@ -31,12 +31,12 @@ export default class StorageTextureNode extends TextureNode {
31
31
 
32
32
  export const storageTexture: (
33
33
  value: Texture,
34
- uvNode?: NodeRepresentation,
34
+ uvNode?: NodeRepresentation | null,
35
35
  storeNode?: NodeRepresentation,
36
36
  ) => ShaderNodeObject<StorageTextureNode>;
37
37
 
38
38
  export const textureStore: (
39
39
  value: Texture,
40
- uvNode?: NodeRepresentation,
40
+ uvNode?: NodeRepresentation | null,
41
41
  storeNode?: NodeRepresentation,
42
42
  ) => ShaderNodeObject<StorageTextureNode>;
@@ -68,4 +68,6 @@ export const textureLoad: (
68
68
  biasNode?: NodeRepresentation,
69
69
  ) => ShaderNodeObject<TextureNode>;
70
70
 
71
- export const sampler: (aTexture: Texture | TextureNode) => ShaderNodeObject<Node>;
71
+ export const sampler: (value: Texture | TextureNode) => ShaderNodeObject<Node>;
72
+
73
+ export const samplerComparison: (value: Texture | TextureNode) => ShaderNodeObject<Node>;
@@ -6,7 +6,7 @@ export default class VertexColorNode extends AttributeNode {
6
6
 
7
7
  index: number;
8
8
 
9
- constructor(index?: number);
9
+ constructor(index: number);
10
10
  }
11
11
 
12
12
  export const vertexColor: (index?: number) => ShaderNodeObject<VertexColorNode>;
@@ -2,8 +2,9 @@ import TempNode from "../core/TempNode.js";
2
2
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  export default class ExpressionNode extends TempNode {
5
- snipped: string; /* sic */
5
+ snipped: string;
6
+
6
7
  constructor(snipped?: string, nodeType?: string);
7
8
  }
8
9
 
9
- export const expression: (snipped?: string, nodeType?: string) => ShaderNodeObject<ExpressionNode>;
10
+ export const expression: (snipped: string, nodeType?: string) => ShaderNodeObject<ExpressionNode>;
@@ -17,6 +17,6 @@ declare class ScriptableNode extends Node {
17
17
  export default ScriptableNode;
18
18
 
19
19
  export const scriptable: (
20
- codeNode?: NodeRepresentation | null,
20
+ codeNode: NodeRepresentation,
21
21
  parameters?: Record<string, unknown>,
22
22
  ) => ShaderNodeObject<ScriptableNode>;
@@ -7,4 +7,4 @@ declare class ScriptableValueNode extends Node {
7
7
 
8
8
  export default ScriptableValueNode;
9
9
 
10
- export const scriptableValue: (value?: unknown) => ShaderNodeObject<ScriptableValueNode>;
10
+ export const scriptableValue: (value: unknown) => ShaderNodeObject<ScriptableValueNode>;
@@ -75,6 +75,7 @@ declare class Node extends EventDispatcher<{
75
75
  _cacheKey: number | null;
76
76
  _cacheKeyVersion: number;
77
77
  global: boolean;
78
+ parents: boolean;
78
79
  readonly isNode: true;
79
80
  readonly id: number;
80
81
  self?: this;
@@ -319,14 +320,16 @@ declare class Node extends EventDispatcher<{
319
320
  */
320
321
  update(frame: NodeFrame): void;
321
322
  /**
322
- * This method performs the build of a node. The behavior of this method as well as its return value depend
323
- * on the current build stage (setup, analyze or generate).
323
+ * This method performs the build of a node. The behavior and return value depend on the current build stage:
324
+ * - **setup**: Prepares the node and its children for the build process. This process can also create new nodes. Returns the node itself or a variant.
325
+ * - **analyze**: Analyzes the node hierarchy for optimizations in the code generation stage. Returns `null`.
326
+ * - **generate**: Generates the shader code for the node. Returns the generated shader string.
324
327
  *
325
328
  * @param {NodeBuilder} builder - The current node builder.
326
- * @param {?string} output - Can be used to define the output type.
327
- * @return {?string} When this method is executed in the setup or analyze stage, `null` is returned. In the generate stage, the generated shader string.
329
+ * @param {?string} [output=null] - Can be used to define the output type.
330
+ * @return {Node|string|null} The result of the build process, depending on the build stage.
328
331
  */
329
- build(builder: NodeBuilder, output?: string | null): string | null;
332
+ build(builder: NodeBuilder, output?: string | null): Node | string | null;
330
333
  /**
331
334
  * Returns the child nodes as a JSON object.
332
335
  *
@@ -1,3 +1,4 @@
1
+ import { InterpolationSamplingMode, InterpolationSamplingType } from "../../constants.js";
1
2
  import NodeVar from "./NodeVar.js";
2
3
  /**
3
4
  * {@link NodeBuilder} is going to create instances of this class during the build process
@@ -10,12 +11,21 @@ import NodeVar from "./NodeVar.js";
10
11
  declare class NodeVarying extends NodeVar {
11
12
  needsInterpolation: boolean;
12
13
  readonly isNodeVarying: true;
14
+ interpolationType: InterpolationSamplingType | null;
15
+ interpolationSampling: InterpolationSamplingMode | null;
13
16
  /**
14
17
  * Constructs a new node varying.
15
18
  *
16
19
  * @param {string} name - The name of the varying.
17
20
  * @param {string} type - The type of the varying.
21
+ * @param {?string} interpolationType - The interpolation type of the varying.
22
+ * @param {?string} interpolationSampling - The interpolation sampling type of the varying.
18
23
  */
19
- constructor(name: string, type: string | null);
24
+ constructor(
25
+ name: string,
26
+ type: string,
27
+ interpolationType?: InterpolationSamplingType | null,
28
+ interpolationSampling?: InterpolationSamplingMode | null,
29
+ );
20
30
  }
21
31
  export default NodeVarying;
@@ -1,4 +1,4 @@
1
- import { ShaderNodeObject } from "../tsl/TSLCore.js";
1
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
2
2
  import Node from "./Node.js";
3
3
 
4
4
  declare class StackNode extends Node {
@@ -16,6 +16,12 @@ declare class StackNode extends Node {
16
16
 
17
17
  Else(method: () => void): this;
18
18
 
19
+ Switch(expression: NodeRepresentation): this;
20
+
21
+ Case(...params: NodeRepresentation[]): this;
22
+
23
+ Default(method: () => void): this;
24
+
19
25
  /**
20
26
  * @deprecated Use {@link StackNode#ElseIf Else()} instead.
21
27
  */
@@ -28,7 +28,7 @@ declare class StructTypeNode extends Node {
28
28
  * Creates an instance of StructTypeNode.
29
29
  *
30
30
  * @param {Object} membersLayout - The layout of the members for the struct.
31
- * @param {string} [name=null] - The optional name of the struct.
31
+ * @param {?string} [name=null] - The optional name of the struct.
32
32
  */
33
33
  constructor(membersLayout: MembersLayout, name?: string | null);
34
34
  /**
@@ -1,3 +1,4 @@
1
+ import { InterpolationSamplingMode, InterpolationSamplingType } from "../../constants.js";
1
2
  import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
2
3
  import Node from "./Node.js";
3
4
  import NodeBuilder from "./NodeBuilder.js";
@@ -6,9 +7,14 @@ import NodeVarying from "./NodeVarying.js";
6
7
  export default class VaryingNode extends Node {
7
8
  node: Node;
8
9
  name: string | null;
10
+ readonly isVaryingNode: true;
11
+ interpolationType: InterpolationSamplingType | null;
12
+ interpolationSampling: InterpolationSamplingMode | null;
9
13
 
10
14
  constructor(node: Node, name?: string | null);
11
15
 
16
+ setInterpolation(type: InterpolationSamplingType | null, sampling?: InterpolationSamplingMode | null): this;
17
+
12
18
  setupVarying(builder: NodeBuilder): NodeVarying;
13
19
  }
14
20
 
@@ -1,5 +1,4 @@
1
1
  import Node from "../core/Node.js";
2
- import TempNode from "../core/TempNode.js";
3
2
  import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
3
 
5
4
  export type AtomicMethod =
@@ -13,13 +12,13 @@ export type AtomicMethod =
13
12
  | typeof AtomicFunctionNode.ATOMIC_OR
14
13
  | typeof AtomicFunctionNode.ATOMIC_XOR;
15
14
 
16
- declare class AtomicFunctionNode extends TempNode {
15
+ declare class AtomicFunctionNode extends Node {
17
16
  method: AtomicMethod;
18
17
  pointerNode: Node;
19
18
  valueNode: Node;
20
- storeNode: Node;
19
+ parents: boolean;
21
20
 
22
- constructor(method: AtomicMethod, pointerNode: Node, valueNode: Node, storeNode?: Node | null);
21
+ constructor(method: AtomicMethod, pointerNode: Node, valueNode: Node);
23
22
 
24
23
  static ATOMIC_LOAD: "atomicLoad";
25
24
  static ATOMIC_STORE: "atomicStore";
@@ -36,58 +35,48 @@ export const atomicFunc: (
36
35
  method: AtomicMethod,
37
36
  pointerNode: NodeRepresentation,
38
37
  valueNode: NodeRepresentation,
39
- storeNode?: NodeRepresentation | null,
40
38
  ) => ShaderNodeObject<AtomicFunctionNode>;
41
39
 
42
40
  export const atomicLoad: (
43
41
  pointerNode: NodeRepresentation,
44
- storeNode?: NodeRepresentation | null,
45
42
  ) => ShaderNodeObject<AtomicFunctionNode>;
46
43
 
47
44
  export const atomicStore: (
48
45
  pointerNode: NodeRepresentation,
49
46
  valueNode: NodeRepresentation,
50
- storeNode?: NodeRepresentation | null,
51
47
  ) => ShaderNodeObject<AtomicFunctionNode>;
52
48
 
53
49
  export const atomicAdd: (
54
50
  pointerNode: NodeRepresentation,
55
51
  valueNode: NodeRepresentation,
56
- storeNode?: NodeRepresentation | null,
57
52
  ) => ShaderNodeObject<AtomicFunctionNode>;
58
53
 
59
54
  export const atomicSub: (
60
55
  pointerNode: NodeRepresentation,
61
56
  valueNode: NodeRepresentation,
62
- storeNode?: NodeRepresentation | null,
63
57
  ) => ShaderNodeObject<AtomicFunctionNode>;
64
58
 
65
59
  export const atomicMax: (
66
60
  pointerNode: NodeRepresentation,
67
61
  valueNode: NodeRepresentation,
68
- storeNode?: NodeRepresentation | null,
69
62
  ) => ShaderNodeObject<AtomicFunctionNode>;
70
63
 
71
64
  export const atomicMin: (
72
65
  pointerNode: NodeRepresentation,
73
66
  valueNode: NodeRepresentation,
74
- storeNode?: NodeRepresentation | null,
75
67
  ) => ShaderNodeObject<AtomicFunctionNode>;
76
68
 
77
69
  export const atomicAnd: (
78
70
  pointerNode: NodeRepresentation,
79
71
  valueNode: NodeRepresentation,
80
- storeNode?: NodeRepresentation | null,
81
72
  ) => ShaderNodeObject<AtomicFunctionNode>;
82
73
 
83
74
  export const atomicOr: (
84
75
  pointerNode: NodeRepresentation,
85
76
  valueNode: NodeRepresentation,
86
- storeNode?: NodeRepresentation | null,
87
77
  ) => ShaderNodeObject<AtomicFunctionNode>;
88
78
 
89
79
  export const atomicXor: (
90
80
  pointerNode: NodeRepresentation,
91
81
  valueNode: NodeRepresentation,
92
- storeNode?: NodeRepresentation | null,
93
82
  ) => ShaderNodeObject<AtomicFunctionNode>;
@@ -0,0 +1,28 @@
1
+ import { Light } from "../../lights/Light.js";
2
+ import NodeMaterial from "../../materials/nodes/NodeMaterial.js";
3
+ import Node from "../core/Node.js";
4
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
5
+
6
+ export const BasicShadowFilter: (
7
+ depthTexture: NodeRepresentation,
8
+ shadowCoord: NodeRepresentation,
9
+ ) => ShaderNodeObject<Node>;
10
+
11
+ export const PCFShadowFilter: (
12
+ depthTexture: NodeRepresentation,
13
+ shadowCoord: NodeRepresentation,
14
+ shadow: NodeRepresentation,
15
+ ) => ShaderNodeObject<Node>;
16
+
17
+ export const PCFSoftShadowFilter: (
18
+ depthTexture: NodeRepresentation,
19
+ shadowCoord: NodeRepresentation,
20
+ shadow: NodeRepresentation,
21
+ ) => ShaderNodeObject<Node>;
22
+
23
+ export const VSMShadowFilter: (
24
+ depthTexture: NodeRepresentation,
25
+ shadowCoord: NodeRepresentation,
26
+ ) => ShaderNodeObject<Node>;
27
+
28
+ export const getShadowMaterial: (light: Light) => NodeMaterial;
@@ -1,30 +1,33 @@
1
+ import { Camera } from "../../cameras/Camera.js";
2
+ import { BufferGeometry } from "../../core/BufferGeometry.js";
3
+ import { Object3D } from "../../core/Object3D.js";
1
4
  import { Light } from "../../lights/Light.js";
2
5
  import { LightShadow } from "../../lights/LightShadow.js";
3
- import Node from "../core/Node.js";
4
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
6
+ import { Material } from "../../materials/Material.js";
7
+ import { Group } from "../../objects/Group.js";
8
+ import ClippingContext from "../../renderers/common/ClippingContext.js";
9
+ import Renderer from "../../renderers/common/Renderer.js";
10
+ import { Scene } from "../../scenes/Scene.js";
11
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
12
+ import LightsNode from "./LightsNode.js";
5
13
  import ShadowBaseNode from "./ShadowBaseNode.js";
6
14
 
7
- export const BasicShadowFilter: (
8
- depthTexture: NodeRepresentation,
9
- shadowCoord: NodeRepresentation,
10
- ) => ShaderNodeObject<Node>;
11
-
12
- export const PCFShadowFilter: (
13
- depthTexture: NodeRepresentation,
14
- shadowCoord: NodeRepresentation,
15
- shadow: NodeRepresentation,
16
- ) => ShaderNodeObject<Node>;
17
-
18
- export const PCFSoftShadowFilter: (
19
- depthTexture: NodeRepresentation,
20
- shadowCoord: NodeRepresentation,
21
- shadow: NodeRepresentation,
22
- ) => ShaderNodeObject<Node>;
23
-
24
- export const VSMShadowFilter: (
25
- depthTexture: NodeRepresentation,
26
- shadowCoord: NodeRepresentation,
27
- ) => ShaderNodeObject<Node>;
15
+ export const getShadowRenderObjectFunction: (
16
+ renderer: Renderer,
17
+ shadow: LightShadow,
18
+ shadowType: number,
19
+ useVelocity: boolean,
20
+ ) => (
21
+ object: Object3D,
22
+ scene: Scene,
23
+ _camera: Camera,
24
+ geometry: BufferGeometry,
25
+ material: Material,
26
+ group: Group,
27
+ lightsNode: LightsNode,
28
+ clippingContext?: ClippingContext | null,
29
+ passId?: string | null,
30
+ ) => void;
28
31
 
29
32
  declare class ShadowNode extends ShadowBaseNode {
30
33
  constructor(light: Light, shadow: LightShadow | null);
@@ -33,4 +36,3 @@ declare class ShadowNode extends ShadowBaseNode {
33
36
  export default ShadowNode;
34
37
 
35
38
  export const shadow: (light: Light, shadow?: LightShadow) => ShaderNodeObject<ShadowNode>;
36
- export const shadows: ShaderNodeObject<Node>;
@@ -4,9 +4,9 @@ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
4
  declare class ConditionalNode extends Node {
5
5
  condNode: Node;
6
6
  ifNode: Node;
7
- elseNode: Node;
7
+ elseNode: Node | null;
8
8
 
9
- constructor(condNode: Node, ifNode: Node, elseNode: Node);
9
+ constructor(condNode: Node, ifNode: Node, elseNode?: Node | null);
10
10
  }
11
11
 
12
12
  export default ConditionalNode;
@@ -14,7 +14,7 @@ export default ConditionalNode;
14
14
  export const select: (
15
15
  condNode: NodeRepresentation,
16
16
  ifNode: NodeRepresentation,
17
- elseNode: NodeRepresentation,
17
+ elseNode?: NodeRepresentation | null,
18
18
  ) => ShaderNodeObject<Node>;
19
19
 
20
20
  declare module "../tsl/TSLCore.js" {
@@ -29,7 +29,7 @@ declare module "../tsl/TSLCore.js" {
29
29
  export const cond: (
30
30
  condNode: NodeRepresentation,
31
31
  ifNode: NodeRepresentation,
32
- elseNode: NodeRepresentation,
32
+ elseNode?: NodeRepresentation | null,
33
33
  ) => ShaderNodeObject<Node>;
34
34
 
35
35
  declare module "../tsl/TSLCore.js" {
@@ -39,7 +39,6 @@ export type MathNodeMethod1 =
39
39
  export type MathNodeMethod2 =
40
40
  | typeof MathNode.MIN
41
41
  | typeof MathNode.MAX
42
- | typeof MathNode.MOD
43
42
  | typeof MathNode.STEP
44
43
  | typeof MathNode.REFLECT
45
44
  | typeof MathNode.DISTANCE
@@ -100,7 +99,6 @@ export default class MathNode extends TempNode {
100
99
 
101
100
  static MIN: "min";
102
101
  static MAX: "max";
103
- static MOD: "mod";
104
102
  static STEP: "step";
105
103
  static REFLECT: "reflect";
106
104
  static DISTANCE: "distance";
@@ -138,6 +136,10 @@ type Unary = (a: NodeRepresentation) => ShaderNodeObject<MathNode>;
138
136
 
139
137
  export const all: Unary;
140
138
  export const any: Unary;
139
+
140
+ /**
141
+ * @deprecated "equals" is deprecated. Use "equal" inside a vector instead, like: "bvec*( equal( ... ) )"
142
+ */
141
143
  export const equals: Unary;
142
144
 
143
145
  export const radians: Unary;
@@ -169,14 +171,21 @@ export const round: Unary;
169
171
  export const reciprocal: Unary;
170
172
  export const trunc: Unary;
171
173
  export const fwidth: Unary;
172
- export const bitcast: Unary;
173
174
  export const transpose: Unary;
174
175
 
175
176
  type Binary = (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<MathNode>;
176
177
 
177
- export const min: Binary;
178
- export const max: Binary;
179
- export const mod: Binary;
178
+ export const bitcast: Binary;
179
+ export const min: (
180
+ x: NodeRepresentation,
181
+ y: NodeRepresentation,
182
+ ...values: NodeRepresentation[]
183
+ ) => ShaderNodeObject<MathNode>;
184
+ export const max: (
185
+ x: NodeRepresentation,
186
+ y: NodeRepresentation,
187
+ ...values: NodeRepresentation[]
188
+ ) => ShaderNodeObject<MathNode>;
180
189
  export const step: Binary;
181
190
  export const reflect: Binary;
182
191
  export const distance: Binary;
@@ -184,15 +193,15 @@ export const difference: Binary;
184
193
  export const dot: Binary;
185
194
  export const cross: Binary;
186
195
  export const pow: Binary;
187
- export const pow2: Binary;
188
- export const pow3: Binary;
189
- export const pow4: Binary;
196
+ export const pow2: Unary;
197
+ export const pow3: Unary;
198
+ export const pow4: Unary;
190
199
  export const transformDirection: Binary;
200
+ export const cbrt: Unary;
201
+ export const lengthSq: Unary;
191
202
 
192
203
  type Ternary = (a: NodeRepresentation, b: NodeRepresentation, c: NodeRepresentation) => ShaderNodeObject<MathNode>;
193
204
 
194
- export const cbrt: Unary;
195
- export const lengthSq: Unary;
196
205
  export const mix: Ternary;
197
206
  export const clamp: (
198
207
  a: NodeRepresentation,
@@ -259,7 +268,6 @@ declare module "../tsl/TSLCore.js" {
259
268
  atan2: typeof atan2;
260
269
  min: typeof min;
261
270
  max: typeof max;
262
- mod: typeof mod;
263
271
  step: typeof step;
264
272
  reflect: typeof reflect;
265
273
  distance: typeof distance;
@@ -33,33 +33,56 @@ export default class OperatorNode extends TempNode {
33
33
  constructor(op: OperatorNodeOp, ...params: [Node, Node, ...Node[]]);
34
34
  }
35
35
 
36
- type Operator = (
36
+ export const add: (
37
37
  a: NodeRepresentation,
38
38
  b: NodeRepresentation,
39
- ...others: NodeRepresentation[]
39
+ ...params: NodeRepresentation[]
40
40
  ) => ShaderNodeObject<OperatorNode>;
41
+ export const sub: (
42
+ a: NodeRepresentation,
43
+ b: NodeRepresentation,
44
+ ...params: NodeRepresentation[]
45
+ ) => ShaderNodeObject<OperatorNode>;
46
+ export const mul: (
47
+ a: NodeRepresentation,
48
+ b: NodeRepresentation,
49
+ ...params: NodeRepresentation[]
50
+ ) => ShaderNodeObject<OperatorNode>;
51
+ export const div: (
52
+ a: NodeRepresentation,
53
+ b: NodeRepresentation,
54
+ ...params: NodeRepresentation[]
55
+ ) => ShaderNodeObject<OperatorNode>;
56
+ export const mod: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
57
+ export const equal: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
58
+ export const notEqual: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
59
+ export const lessThan: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
60
+ export const greaterThan: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
61
+ export const lessThanEqual: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
62
+ export const greaterThanEqual: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
63
+ export const and: (
64
+ a: NodeRepresentation,
65
+ b: NodeRepresentation,
66
+ ...params: NodeRepresentation[]
67
+ ) => ShaderNodeObject<OperatorNode>;
68
+ export const or: (
69
+ a: NodeRepresentation,
70
+ b: NodeRepresentation,
71
+ ...params: NodeRepresentation[]
72
+ ) => ShaderNodeObject<OperatorNode>;
73
+ export const not: (value: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
74
+ export const xor: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
75
+ export const bitAnd: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
76
+ export const bitNot: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
77
+ export const bitOr: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
78
+ export const bitXor: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
79
+ export const shiftLeft: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
80
+ export const shiftRight: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
41
81
 
42
- export const add: Operator;
43
- export const sub: Operator;
44
- export const mul: Operator;
45
- export const div: Operator;
46
- export const modInt: Operator;
47
- export const equal: Operator;
48
- export const notEqual: Operator;
49
- export const lessThan: Operator;
50
- export const greaterThan: Operator;
51
- export const lessThanEqual: Operator;
52
- export const greaterThanEqual: Operator;
53
- export const and: Operator;
54
- export const or: Operator;
55
- export const not: (a: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
56
- export const xor: Operator;
57
- export const bitAnd: Operator;
58
- export const bitNot: (a: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
59
- export const bitOr: Operator;
60
- export const bitXor: Operator;
61
- export const shiftLeft: Operator;
62
- export const shiftRight: Operator;
82
+ export const incrementBefore: (a: NodeRepresentation) => ShaderNodeObject<Node>;
83
+ export const decrementBefore: (a: NodeRepresentation) => ShaderNodeObject<Node>;
84
+ export const increment: (a: NodeRepresentation) => ShaderNodeObject<Node>;
85
+ export const decrement: (a: NodeRepresentation) => ShaderNodeObject<Node>;
63
86
 
64
87
  declare module "../tsl/TSLCore.js" {
65
88
  interface NodeElements {
@@ -67,7 +90,7 @@ declare module "../tsl/TSLCore.js" {
67
90
  sub: typeof sub;
68
91
  mul: typeof mul;
69
92
  div: typeof div;
70
- modInt: typeof modInt;
93
+ mod: typeof mod;
71
94
  equal: typeof equal;
72
95
  notEqual: typeof notEqual;
73
96
  lessThan: typeof lessThan;
@@ -84,13 +107,26 @@ declare module "../tsl/TSLCore.js" {
84
107
  bitXor: typeof bitXor;
85
108
  shiftLeft: typeof shiftLeft;
86
109
  shiftRight: typeof shiftRight;
110
+ incrementBefore: typeof incrementBefore;
111
+ decrementBefore: typeof decrement;
112
+ increment: typeof increment;
113
+ decrement: typeof decrement;
87
114
  }
88
115
  }
89
116
 
90
117
  /**
91
118
  * @deprecated .remainder() has been renamed to .modInt().
92
119
  */
93
- export const remainder: Operator;
120
+ export const remainder: (
121
+ aNode: NodeRepresentation,
122
+ bNode: NodeRepresentation,
123
+ ...params: NodeRepresentation[]
124
+ ) => ShaderNodeObject<OperatorNode>;
125
+
126
+ /**
127
+ * @deprecated "modInt()" is deprecated. Use "mod( int( ... ) )" instead.
128
+ */
129
+ export const modInt: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
94
130
 
95
131
  declare module "../tsl/TSLCore.js" {
96
132
  interface NodeElements {
@@ -98,5 +134,9 @@ declare module "../tsl/TSLCore.js" {
98
134
  * @deprecated .remainder() has been renamed to .modInt().
99
135
  */
100
136
  remainder: typeof remainder;
137
+ /**
138
+ * @deprecated "modInt()" is deprecated. Use "mod( int( ... ) )" instead.
139
+ */
140
+ modInt: typeof modInt;
101
141
  }
102
142
  }
@@ -17,6 +17,7 @@ export * from "../gpgpu/ComputeNode.js";
17
17
  export * from "../math/ConditionalNode.js";
18
18
  export * from "../math/MathNode.js";
19
19
  export * from "../math/OperatorNode.js";
20
+ export * from "../utils/DebugNode.js";
20
21
  export * from "../utils/Discard.js";
21
22
  export * from "../utils/RemapNode.js";
22
23
  export * from "./TSLCore.js";