@types/three 0.173.0 → 0.175.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +1 -1
  3. three/examples/jsm/animation/CCDIKSolver.d.ts +3 -2
  4. three/examples/jsm/controls/PointerLockControls.d.ts +4 -1
  5. three/examples/jsm/geometries/ParametricFunctions.d.ts +8 -0
  6. three/examples/jsm/interactive/HTMLMesh.d.ts +9 -2
  7. three/examples/jsm/loaders/LUTImageLoader.d.ts +2 -2
  8. three/examples/jsm/loaders/MTLLoader.d.ts +2 -1
  9. three/examples/jsm/misc/Timer.d.ts +13 -2
  10. three/examples/jsm/objects/Reflector.d.ts +1 -0
  11. three/examples/jsm/postprocessing/HalftonePass.d.ts +1 -1
  12. three/examples/jsm/postprocessing/LUTPass.d.ts +1 -1
  13. three/examples/jsm/postprocessing/SMAAPass.d.ts +1 -1
  14. three/examples/jsm/transpiler/AST.d.ts +218 -1
  15. three/examples/jsm/transpiler/TSLEncoder.d.ts +35 -1
  16. three/examples/jsm/tsl/math/Bayer.d.ts +4 -0
  17. three/examples/jsm/tsl/utils/Raymarching.d.ts +9 -0
  18. three/examples/jsm/webxr/VRButton.d.ts +4 -2
  19. three/package.json +2 -2
  20. three/src/Three.TSL.d.ts +7 -1
  21. three/src/Three.d.ts +6 -1
  22. three/src/animation/AnimationAction.d.ts +219 -19
  23. three/src/animation/AnimationClip.d.ts +140 -28
  24. three/src/animation/AnimationMixer.d.ts +100 -8
  25. three/src/animation/AnimationObjectGroup.d.ts +55 -14
  26. three/src/animation/AnimationUtils.d.ts +154 -43
  27. three/src/animation/KeyframeTrack.d.ts +134 -25
  28. three/src/animation/PropertyBinding.d.ts +89 -31
  29. three/src/animation/PropertyMixer.d.ts +62 -5
  30. three/src/animation/tracks/BooleanKeyframeTrack.d.ts +12 -4
  31. three/src/animation/tracks/ColorKeyframeTrack.d.ts +10 -4
  32. three/src/animation/tracks/NumberKeyframeTrack.d.ts +10 -4
  33. three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +10 -4
  34. three/src/animation/tracks/StringKeyframeTrack.d.ts +12 -4
  35. three/src/animation/tracks/VectorKeyframeTrack.d.ts +10 -4
  36. three/src/constants.d.ts +2 -2
  37. three/src/core/BufferAttribute.d.ts +11 -0
  38. three/src/core/BufferGeometry.d.ts +1 -3
  39. three/src/core/Raycaster.d.ts +4 -0
  40. three/src/extras/Controls.d.ts +1 -1
  41. three/src/extras/Earcut.d.ts +5 -3
  42. three/src/extras/ImageUtils.d.ts +1 -0
  43. three/src/extras/PMREMGenerator.d.ts +15 -2
  44. three/src/geometries/TorusGeometry.d.ts +5 -6
  45. three/src/lights/PointLight.d.ts +1 -1
  46. three/src/loaders/FileLoader.d.ts +2 -2
  47. three/src/loaders/LoaderUtils.d.ts +0 -5
  48. three/src/materials/Material.d.ts +3 -0
  49. three/src/materials/nodes/NodeMaterial.d.ts +2 -1
  50. three/src/materials/nodes/VolumeNodeMaterial.d.ts +14 -2
  51. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +4 -4
  52. three/src/nodes/Nodes.d.ts +2 -2
  53. three/src/nodes/TSL.d.ts +1 -0
  54. three/src/nodes/accessors/BufferAttributeNode.d.ts +36 -26
  55. three/src/nodes/accessors/Lights.d.ts +1 -1
  56. three/src/nodes/accessors/MaterialProperties.d.ts +5 -0
  57. three/src/nodes/accessors/ModelNode.d.ts +1 -0
  58. three/src/nodes/accessors/Object3DNode.d.ts +7 -5
  59. three/src/nodes/accessors/SkinningNode.d.ts +4 -3
  60. three/src/nodes/accessors/StorageTextureNode.d.ts +2 -2
  61. three/src/nodes/accessors/Texture3DNode.d.ts +2 -2
  62. three/src/nodes/accessors/TextureNode.d.ts +3 -1
  63. three/src/nodes/code/ExpressionNode.d.ts +3 -2
  64. three/src/nodes/code/ScriptableNode.d.ts +1 -1
  65. three/src/nodes/code/ScriptableValueNode.d.ts +1 -1
  66. three/src/nodes/core/LightingModel.d.ts +13 -28
  67. three/src/nodes/core/Node.d.ts +24 -24
  68. three/src/nodes/core/NodeAttribute.d.ts +3 -3
  69. three/src/nodes/core/NodeCache.d.ts +2 -2
  70. three/src/nodes/core/NodeParser.d.ts +1 -1
  71. three/src/nodes/core/NodeUniform.d.ts +4 -4
  72. three/src/nodes/core/NodeVar.d.ts +4 -4
  73. three/src/nodes/core/NodeVarying.d.ts +2 -2
  74. three/src/nodes/core/StructTypeNode.d.ts +3 -3
  75. three/src/nodes/core/UniformNode.d.ts +7 -7
  76. three/src/nodes/core/constants.d.ts +0 -1
  77. three/src/nodes/display/PassNode.d.ts +10 -1
  78. three/src/nodes/functions/BSDF/LTC.d.ts +5 -1
  79. three/src/nodes/functions/VolumetricLightingModel.d.ts +6 -0
  80. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +1 -12
  81. three/src/nodes/lighting/AnalyticLightNode.d.ts +13 -1
  82. three/src/nodes/lighting/LightingContextNode.d.ts +18 -4
  83. three/src/nodes/lighting/LightsNode.d.ts +24 -0
  84. three/src/nodes/lighting/PointLightNode.d.ts +8 -7
  85. three/src/nodes/lighting/ShadowBaseNode.d.ts +3 -0
  86. three/src/nodes/math/ConditionalNode.d.ts +4 -4
  87. three/src/nodes/math/MathNode.d.ts +20 -12
  88. three/src/nodes/math/OperatorNode.d.ts +57 -26
  89. three/src/nodes/tsl/TSLBase.d.ts +1 -0
  90. three/src/nodes/tsl/TSLCore.d.ts +3 -0
  91. three/src/nodes/utils/DebugNode.d.ts +20 -0
  92. three/src/nodes/utils/ReflectorNode.d.ts +1 -0
  93. three/src/nodes/utils/SpriteSheetUVNode.d.ts +2 -2
  94. three/src/objects/LOD.d.ts +4 -3
  95. three/src/renderers/common/Animation.d.ts +6 -6
  96. three/src/renderers/common/Attributes.d.ts +2 -2
  97. three/src/renderers/common/BindGroup.d.ts +2 -2
  98. three/src/renderers/common/Binding.d.ts +2 -2
  99. three/src/renderers/common/Buffer.d.ts +3 -3
  100. three/src/renderers/common/BufferUtils.d.ts +7 -8
  101. three/src/renderers/common/BundleGroup.d.ts +2 -2
  102. three/src/renderers/common/ChainMap.d.ts +3 -3
  103. three/src/renderers/common/ClippingContext.d.ts +3 -3
  104. three/src/renderers/common/Color4.d.ts +8 -8
  105. three/src/renderers/common/ComputePipeline.d.ts +1 -1
  106. three/src/renderers/common/CubeRenderTarget.d.ts +6 -0
  107. three/src/renderers/common/DataMap.d.ts +2 -2
  108. three/src/renderers/common/Geometries.d.ts +4 -4
  109. three/src/renderers/common/Info.d.ts +2 -2
  110. three/src/renderers/common/Pipeline.d.ts +1 -1
  111. three/src/renderers/common/Pipelines.d.ts +9 -9
  112. three/src/renderers/common/ProgrammableStage.d.ts +4 -4
  113. three/src/renderers/common/RenderContext.d.ts +2 -2
  114. three/src/renderers/common/RenderContexts.d.ts +3 -3
  115. three/src/renderers/common/RenderList.d.ts +11 -11
  116. three/src/renderers/common/RenderObject.d.ts +13 -13
  117. three/src/renderers/common/RenderObjects.d.ts +3 -3
  118. three/src/renderers/common/RenderPipeline.d.ts +1 -1
  119. three/src/renderers/common/Renderer.d.ts +143 -108
  120. three/src/renderers/common/Textures.d.ts +6 -6
  121. three/src/renderers/common/TimestampQueryPool.d.ts +13 -1
  122. three/src/renderers/common/Uniform.d.ts +13 -13
  123. three/src/renderers/common/UniformBuffer.d.ts +1 -1
  124. three/src/renderers/common/UniformsGroup.d.ts +13 -13
  125. three/src/renderers/common/XRManager.d.ts +79 -15
  126. three/src/renderers/common/XRRenderTarget.d.ts +4 -4
  127. three/src/renderers/common/extras/PMREMGenerator.d.ts +9 -2
  128. three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -3
  129. three/src/renderers/common/nodes/NodeLibrary.d.ts +11 -11
  130. three/src/renderers/common/nodes/NodeUniform.d.ts +9 -9
  131. three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +1 -1
  132. three/src/renderers/common/nodes/Nodes.d.ts +11 -11
  133. three/src/renderers/webgl/WebGLState.d.ts +7 -6
  134. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +1 -1
  135. three/src/textures/CanvasTexture.d.ts +1 -1
  136. three/examples/jsm/geometries/ParametricGeometries.d.ts +0 -32
@@ -1,7 +1,9 @@
1
1
  import { Light } from "../../lights/Light.js";
2
2
  import Node from "../core/Node.js";
3
+ import NodeBuilder from "../core/NodeBuilder.js";
3
4
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
4
5
  import LightingNode from "./LightingNode.js";
6
+ import { DirectLightData, DirectRectAreaLightData } from "./LightsNode.js";
5
7
  import ShadowNode from "./ShadowNode.js";
6
8
 
7
9
  declare module "../../lights/LightShadow.js" {
@@ -10,10 +12,20 @@ declare module "../../lights/LightShadow.js" {
10
12
  }
11
13
  }
12
14
 
13
- export default class AnalyticLightNode<T extends Light> extends LightingNode {
15
+ declare class AnalyticLightNode<T extends Light> extends LightingNode {
14
16
  light: T | null;
15
17
 
16
18
  constructor(light?: T | null);
17
19
 
20
+ getLightVector(builder: NodeBuilder): Node;
21
+
22
+ setupDirect(builder: NodeBuilder): DirectLightData | undefined;
23
+
24
+ setupDirectRectArea(builder: NodeBuilder): DirectRectAreaLightData | undefined;
25
+
18
26
  setupShadowNode(): ShaderNodeObject<ShadowNode>;
27
+
28
+ setupShadow(builder: NodeBuilder): void;
19
29
  }
30
+
31
+ export default AnalyticLightNode;
@@ -1,7 +1,18 @@
1
1
  import ContextNode from "../core/ContextNode.js";
2
- import LightingModel, { LightingModelIndirectInput } from "../core/LightingModel.js";
2
+ import LightingModel, { LightingModelReflectedLight } from "../core/LightingModel.js";
3
3
  import Node from "../core/Node.js";
4
4
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
5
+ import LightsNode from "./LightsNode.js";
6
+
7
+ export interface LightingContext {
8
+ radiance: Node;
9
+ irradiance: Node;
10
+ iblIrradiance: Node;
11
+ ambientOcclusion: Node;
12
+ reflectedLight: LightingModelReflectedLight;
13
+ backdrop: Node;
14
+ backdropAlpha: Node;
15
+ }
5
16
 
6
17
  export default class LightingContextNode extends ContextNode {
7
18
  lightingModelNode: LightingModel | null;
@@ -9,13 +20,16 @@ export default class LightingContextNode extends ContextNode {
9
20
  backdropAlphaNode: Node | null;
10
21
 
11
22
  constructor(
12
- node: Node,
23
+ lightsNode: LightsNode,
13
24
  lightingModel?: LightingModel | null,
14
25
  backdropNode?: Node | null,
15
26
  backdropAlphaNode?: Node | null,
16
27
  );
17
28
 
18
- getContext(): LightingModelIndirectInput;
29
+ getContext(): LightingContext;
19
30
  }
20
31
 
21
- export const lightingContext: (node: Node, lightingModelNode?: LightingModel) => ShaderNodeObject<LightingContextNode>;
32
+ export const lightingContext: (
33
+ node: LightsNode,
34
+ lightingModelNode?: LightingModel,
35
+ ) => ShaderNodeObject<LightingContextNode>;
@@ -4,13 +4,37 @@ import { NodeBuilder } from "../Nodes.js";
4
4
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
5
5
  import LightingNode from "./LightingNode.js";
6
6
 
7
+ export interface DirectLightData {
8
+ lightDirection: Node;
9
+ lightColor: Node;
10
+ }
11
+
12
+ export interface DirectRectAreaLightData {
13
+ lightColor: Node;
14
+ lightPosition: Node;
15
+ halfWidth: Node;
16
+ halfHeight: Node;
17
+ ltc_1: Node;
18
+ ltc_2: Node;
19
+ }
20
+
7
21
  declare class LightsNode extends Node {
22
+ totalDiffuseNode: Node;
23
+ totalSpecularNode: Node;
24
+ outgoingLightNode: Node;
25
+
8
26
  constructor();
9
27
 
10
28
  setupLightsNode(builder: NodeBuilder): void;
11
29
 
30
+ setupDirectLight(builder: NodeBuilder, lightNode: Node, lightData: DirectLightData): void;
31
+
32
+ setupDirectRectAreaLight(builder: NodeBuilder, lightNode: Node, lightData: DirectRectAreaLightData): void;
33
+
12
34
  setupLights(builder: NodeBuilder, lightNodes: LightingNode[]): void;
13
35
 
36
+ getLightNodes(): LightingNode[];
37
+
14
38
  setLights(lights: Light[]): this;
15
39
 
16
40
  getLights(): Light[];
@@ -1,15 +1,16 @@
1
1
  import { PointLight } from "../../lights/PointLight.js";
2
2
  import Node from "../core/Node.js";
3
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
4
4
  import AnalyticLightNode from "./AnalyticLightNode.js";
5
+ import { DirectLightData } from "./LightsNode.js";
5
6
  import PointShadowNode from "./PointShadowNode.js";
6
7
 
7
- export const directPointLight: (
8
- color: NodeRepresentation,
9
- lightViewPosition: NodeRepresentation,
10
- cutoffDistance: NodeRepresentation,
11
- decayExponent: NodeRepresentation,
12
- ) => ShaderNodeObject<Node>;
8
+ export const directPointLight: (params: {
9
+ color: ShaderNodeObject<Node>;
10
+ lightViewPosition: ShaderNodeObject<Node>;
11
+ cutoffDistance: ShaderNodeObject<Node>;
12
+ decayExponent: ShaderNodeObject<Node>;
13
+ }) => DirectLightData;
13
14
 
14
15
  declare class PointLightNode extends AnalyticLightNode<PointLight> {
15
16
  cutoffDistanceNode: Node;
@@ -1,5 +1,6 @@
1
1
  import { Light } from "../../lights/Light.js";
2
2
  import Node from "../core/Node.js";
3
+ import NodeBuilder from "../core/NodeBuilder.js";
3
4
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
4
5
 
5
6
  declare class ShadowBaseNode extends Node {
@@ -8,6 +9,8 @@ declare class ShadowBaseNode extends Node {
8
9
  readonly isShadowBasedNode: true;
9
10
 
10
11
  constructor(light: Light);
12
+
13
+ setupShadowPosition(builder: NodeBuilder): void;
11
14
  }
12
15
 
13
16
  export const shadowPositionWorld: 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,51 @@ 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
-
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;
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>;
63
81
 
64
82
  declare module "../tsl/TSLCore.js" {
65
83
  interface NodeElements {
@@ -67,7 +85,7 @@ declare module "../tsl/TSLCore.js" {
67
85
  sub: typeof sub;
68
86
  mul: typeof mul;
69
87
  div: typeof div;
70
- modInt: typeof modInt;
88
+ mod: typeof mod;
71
89
  equal: typeof equal;
72
90
  notEqual: typeof notEqual;
73
91
  lessThan: typeof lessThan;
@@ -90,7 +108,16 @@ declare module "../tsl/TSLCore.js" {
90
108
  /**
91
109
  * @deprecated .remainder() has been renamed to .modInt().
92
110
  */
93
- export const remainder: Operator;
111
+ export const remainder: (
112
+ aNode: NodeRepresentation,
113
+ bNode: NodeRepresentation,
114
+ ...params: NodeRepresentation[]
115
+ ) => ShaderNodeObject<OperatorNode>;
116
+
117
+ /**
118
+ * @deprecated "modInt()" is deprecated. Use "mod( int( ... ) )" instead.
119
+ */
120
+ export const modInt: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
94
121
 
95
122
  declare module "../tsl/TSLCore.js" {
96
123
  interface NodeElements {
@@ -98,5 +125,9 @@ declare module "../tsl/TSLCore.js" {
98
125
  * @deprecated .remainder() has been renamed to .modInt().
99
126
  */
100
127
  remainder: typeof remainder;
128
+ /**
129
+ * @deprecated "modInt()" is deprecated. Use "mod( int( ... ) )" instead.
130
+ */
131
+ modInt: typeof modInt;
101
132
  }
102
133
  }
@@ -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";
@@ -67,6 +67,9 @@ export type Swizzable<T extends Node = Node> =
67
67
  & {
68
68
  [Key in SwizzleOption | number]: ShaderNodeObject<Node>;
69
69
  }
70
+ & {
71
+ [Key in SwizzleOption as `set${Uppercase<Key>}`]: (value: Node) => ShaderNodeObject<Node>;
72
+ }
70
73
  & {
71
74
  [Key in SwizzleOption as `flip${Uppercase<Key>}`]: () => ShaderNodeObject<Node>;
72
75
  };
@@ -0,0 +1,20 @@
1
+ import Node from "../core/Node.js";
2
+ import TempNode from "../core/TempNode.js";
3
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
+
5
+ declare class DebugNode extends TempNode {
6
+ constructor(node: Node, callback?: ((code: string) => void) | null);
7
+ }
8
+
9
+ export default DebugNode;
10
+
11
+ export const debug: (
12
+ node: NodeRepresentation,
13
+ callback?: ((code: string) => void) | null,
14
+ ) => ShaderNodeObject<DebugNode>;
15
+
16
+ declare module "../tsl/TSLCore.js" {
17
+ interface NodeElements {
18
+ debug: typeof debug;
19
+ }
20
+ }
@@ -32,6 +32,7 @@ declare class ReflectorBaseNode extends Node {
32
32
 
33
33
  virtualCameras: WeakMap<Camera, Camera>;
34
34
  renderTargets: WeakMap<Camera, RenderTarget>;
35
+ forceUpdate: boolean;
35
36
 
36
37
  constructor(textureNode: TextureNode, parameters?: ReflectorNodeParameters);
37
38
 
@@ -11,6 +11,6 @@ export default class SpriteSheetUVNode extends Node {
11
11
 
12
12
  export const spritesheetUV: (
13
13
  countNode: NodeRepresentation,
14
- uvNode?: NodeRepresentation,
15
- frameNode?: NodeRepresentation,
14
+ uvNode: NodeRepresentation | null,
15
+ frameNode: NodeRepresentation | null,
16
16
  ) => ShaderNodeObject<SpriteSheetUVNode>;
@@ -20,8 +20,9 @@ export interface LODJSON extends Object3DJSON {
20
20
  * @remarks
21
21
  * Typically you would create, say, three meshes, one for far away (low detail), one for mid range (medium detail) and one for close up (high detail).
22
22
  * @example
23
- * ```typescript
24
- * const {@link LOD} = new THREE.LOD();
23
+ * const lod = new THREE.LOD();
24
+ * const material = new THREE.MeshBasicMaterial( { color: 0xffff00 } );
25
+ *
25
26
  * //Create spheres with 3 levels of detail and create new {@link LOD} levels for them
26
27
  * for (let i = 0; i & lt; 3; i++) {
27
28
  * const geometry = new THREE.IcosahedronGeometry(10, 3 - i)
@@ -29,7 +30,7 @@ export interface LODJSON extends Object3DJSON {
29
30
  * lod.addLevel(mesh, i * 75);
30
31
  * }
31
32
  * scene.add(lod);
32
- * ```
33
+ *
33
34
  * @see Example: {@link https://threejs.org/examples/#webgl_lod | webgl / {@link LOD} }
34
35
  * @see {@link https://threejs.org/docs/index.html#api/en/objects/LOD | Official Documentation}
35
36
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/LOD.js | Source}
@@ -1,7 +1,7 @@
1
1
  import Info from "./Info.js";
2
2
  import Nodes from "./nodes/Nodes.js";
3
3
  export interface AnimationContext {
4
- requestAnimationFrame(callback: FrameRequestCallback, frame?: XRFrame): number;
4
+ requestAnimationFrame(callback: FrameRequestCallback, xrFrame?: XRFrame): number;
5
5
  cancelAnimationFrame(handle: number): void;
6
6
  }
7
7
  /**
@@ -13,7 +13,7 @@ declare class Animation {
13
13
  nodes: Nodes;
14
14
  info: Info;
15
15
  _context: AnimationContext;
16
- _animationLoop: ((time: DOMHighResTimeStamp, frame?: XRFrame) => void) | null;
16
+ _animationLoop: ((time: DOMHighResTimeStamp, xrFrame?: XRFrame) => void) | null;
17
17
  _requestId: number | null;
18
18
  /**
19
19
  * Constructs a new animation loop management component.
@@ -33,15 +33,15 @@ declare class Animation {
33
33
  /**
34
34
  * Returns the user-level animation loop.
35
35
  *
36
- * @return {Function} The animation loop.
36
+ * @return {?Function} The animation loop.
37
37
  */
38
- getAnimationLoop(): ((time: DOMHighResTimeStamp, frame?: XRFrame) => void) | null;
38
+ getAnimationLoop(): ((time: DOMHighResTimeStamp, xrFrame?: XRFrame) => void) | null;
39
39
  /**
40
40
  * Defines the user-level animation loop.
41
41
  *
42
- * @param {Function} callback - The animation loop.
42
+ * @param {?Function} callback - The animation loop.
43
43
  */
44
- setAnimationLoop(callback: ((time: DOMHighResTimeStamp, frame?: XRFrame) => void) | null): void;
44
+ setAnimationLoop(callback: ((time: DOMHighResTimeStamp, xrFrame?: XRFrame) => void) | null): void;
45
45
  /**
46
46
  * Returns the animation context.
47
47
  *
@@ -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} The deleted attribute data.
33
+ * @return {Object|null} The deleted attribute data.
34
34
  */
35
35
  delete(attribute: BufferAttribute | InterleavedBufferAttribute): Data;
36
36
  /**
@@ -38,7 +38,7 @@ declare class Attributes extends DataMap<{
38
38
  * for new attributes and updates data for existing ones.
39
39
  *
40
40
  * @param {BufferAttribute} attribute - The attribute to update.
41
- * @param {Number} type - The attribute type.
41
+ * @param {number} type - The attribute type.
42
42
  */
43
43
  update(attribute: BufferAttribute | InterleavedBufferAttribute, type: AttributeType): void;
44
44
  /**
@@ -16,9 +16,9 @@ declare class BindGroup {
16
16
  /**
17
17
  * Constructs a new bind group.
18
18
  *
19
- * @param {String} name - The bind group's name.
19
+ * @param {string} name - The bind group's name.
20
20
  * @param {Array<Binding>} bindings - An array of bindings.
21
- * @param {Number} index - The group index.
21
+ * @param {number} index - The group index.
22
22
  * @param {Array<Binding>} bindingsReference - An array of reference bindings.
23
23
  */
24
24
  constructor(
@@ -13,13 +13,13 @@ declare class Binding {
13
13
  /**
14
14
  * Constructs a new binding.
15
15
  *
16
- * @param {String} [name=''] - The binding's name.
16
+ * @param {string} [name=''] - The binding's name.
17
17
  */
18
18
  constructor(name?: string);
19
19
  /**
20
20
  * Makes sure binding's resource is visible for the given shader stage.
21
21
  *
22
- * @param {Number} visibility - The shader stage.
22
+ * @param {number} visibility - The shader stage.
23
23
  */
24
24
  setVisibility(visibility: number): void;
25
25
  /**
@@ -13,14 +13,14 @@ declare class Buffer extends Binding {
13
13
  /**
14
14
  * Constructs a new buffer.
15
15
  *
16
- * @param {String} name - The buffer's name.
16
+ * @param {string} name - The buffer's name.
17
17
  * @param {TypedArray} [buffer=null] - The buffer.
18
18
  */
19
19
  constructor(name?: string, buffer?: Float32Array | null);
20
20
  /**
21
21
  * The buffer's byte length.
22
22
  *
23
- * @type {Number}
23
+ * @type {number}
24
24
  * @readonly
25
25
  */
26
26
  get byteLength(): number;
@@ -34,7 +34,7 @@ declare class Buffer extends Binding {
34
34
  /**
35
35
  * Updates the binding.
36
36
  *
37
- * @return {Boolean} Whether the buffer has been updated and must be
37
+ * @return {boolean} Whether the buffer has been updated and must be
38
38
  * uploaded to the GPU.
39
39
  */
40
40
  update(): boolean;
@@ -1,11 +1,10 @@
1
- /** @module BufferUtils **/
2
1
  /**
3
2
  * This function is usually called with the length in bytes of an array buffer.
4
3
  * It returns an padded value which ensure chunk size alignment according to STD140 layout.
5
4
  *
6
5
  * @function
7
- * @param {Number} floatLength - The buffer length.
8
- * @return {Number} The padded length.
6
+ * @param {number} floatLength - The buffer length.
7
+ * @return {number} The padded length.
9
8
  */
10
9
  declare function getFloatLength(floatLength: number): number;
11
10
  /**
@@ -13,9 +12,9 @@ declare function getFloatLength(floatLength: number): number;
13
12
  * a total length in bytes with buffer alignment according to STD140 layout.
14
13
  *
15
14
  * @function
16
- * @param {Number} count - The number of vectors.
17
- * @param {Number} [vectorLength=4] - The vector length.
18
- * @return {Number} The padded length.
15
+ * @param {number} count - The number of vectors.
16
+ * @param {number} [vectorLength=4] - The vector length.
17
+ * @return {number} The padded length.
19
18
  */
20
19
  declare function getVectorLength(count: number, vectorLength?: number): number;
21
20
  /**
@@ -23,8 +22,8 @@ declare function getVectorLength(count: number, vectorLength?: number): number;
23
22
  * matches a predefined stride (in this case `4`).
24
23
  *
25
24
  * @function
26
- * @param {Number} vectorLength - The vector length.
27
- * @return {Number} The padded length.
25
+ * @param {number} vectorLength - The vector length.
26
+ * @return {number} The padded length.
28
27
  */
29
28
  declare function getStrideLength(vectorLength: number): number;
30
29
  export { getFloatLength, getStrideLength, getVectorLength };
@@ -23,9 +23,9 @@ declare class BundleGroup extends Group {
23
23
  /**
24
24
  * Set this property to `true` when the bundle group has changed.
25
25
  *
26
- * @type {Boolean}
26
+ * @type {boolean}
27
27
  * @default false
28
- * @param {Boolean} value
28
+ * @param {boolean} value
29
29
  */
30
30
  set needsUpdate(value: boolean);
31
31
  }
@@ -17,14 +17,14 @@ declare class ChainMap<K extends readonly object[], V> {
17
17
  * Returns the value for the given array of keys.
18
18
  *
19
19
  * @param {Array<Object>} keys - List of keys.
20
- * @return {Any} The value. Returns `undefined` if no value was found.
20
+ * @return {any} The value. Returns `undefined` if no value was found.
21
21
  */
22
22
  get(keys: K): V | undefined;
23
23
  /**
24
24
  * Sets the value for the given keys.
25
25
  *
26
26
  * @param {Array<Object>} keys - List of keys.
27
- * @param {Any} value - The value to set.
27
+ * @param {any} value - The value to set.
28
28
  * @return {ChainMap} A reference to this Chain Map.
29
29
  */
30
30
  set(keys: K, value: V): this;
@@ -32,7 +32,7 @@ declare class ChainMap<K extends readonly object[], V> {
32
32
  * Deletes a value for the given keys.
33
33
  *
34
34
  * @param {Array<Object>} keys - The keys.
35
- * @return {Boolean} Returns `true` if the value has been removed successfully and `false` if the value has not be found.
35
+ * @return {boolean} Returns `true` if the value has been removed successfully and `false` if the value has not be found.
36
36
  */
37
37
  delete(keys: K): boolean;
38
38
  }