@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
@@ -16,6 +16,7 @@ export const modelWorldMatrix: ShaderNodeObject<ModelNode>;
16
16
  export const modelPosition: ShaderNodeObject<ModelNode>;
17
17
  export const modelScale: ShaderNodeObject<ModelNode>;
18
18
  export const modelViewPosition: ShaderNodeObject<ModelNode>;
19
+ export const modelRadius: ShaderNodeObject<ModelNode>;
19
20
  export const modelNormalMatrix: ShaderNodeObject<Node>;
20
21
  export const modelWorldMatrixInverse: ShaderNodeObject<UniformNode<Matrix4>>;
21
22
 
@@ -13,10 +13,12 @@ export default class Object3DNode extends Node {
13
13
  static SCALE: "scale";
14
14
  static VIEW_POSITION: "viewPosition";
15
15
  static DIRECTION: "direction";
16
+ static RADIUS: "radius";
16
17
  }
17
18
 
18
- export const objectDirection: (object3d: Object3D) => ShaderNodeObject<Object3DNode>;
19
- export const objectWorldMatrix: (object3d: Object3D) => ShaderNodeObject<Object3DNode>;
20
- export const objectPosition: (object3d: Object3D) => ShaderNodeObject<Object3DNode>;
21
- export const objectScale: (object3d: Object3D) => ShaderNodeObject<Object3DNode>;
22
- export const objectViewPosition: (object3d: Object3D) => 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>;
@@ -12,6 +12,6 @@ export default class Texture3DNode extends TextureNode {
12
12
 
13
13
  export const texture3D: (
14
14
  value: Texture,
15
- uvNode?: NodeRepresentation,
16
- levelNode?: NodeRepresentation,
15
+ uvNode?: NodeRepresentation | null,
16
+ levelNode?: NodeRepresentation | null,
17
17
  ) => ShaderNodeObject<Texture3DNode>;
@@ -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>;
@@ -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>;
@@ -1,6 +1,6 @@
1
+ import { DirectLightData, DirectRectAreaLightData } from "../lighting/LightsNode.js";
1
2
  import Node from "./Node.js";
2
3
  import NodeBuilder from "./NodeBuilder.js";
3
- import StackNode from "./StackNode.js";
4
4
 
5
5
  export interface LightingModelReflectedLight {
6
6
  directDiffuse: Node;
@@ -9,38 +9,23 @@ export interface LightingModelReflectedLight {
9
9
  indirectSpecular: Node;
10
10
  }
11
11
 
12
- export interface LightingModelDirectInput {
13
- lightDirection: Node;
14
- lightColor: Node;
12
+ export interface LightingModelDirectInput extends DirectLightData {
13
+ lightNode: Node;
15
14
  reflectedLight: LightingModelReflectedLight;
16
15
  }
17
16
 
18
- export interface LightingModelDirectRectAreaInput {
19
- lightColor: Node;
20
- lightPosition: Node;
21
- halfWidth: Node;
22
- halfHeight: Node;
17
+ export interface LightingModelDirectRectAreaInput extends DirectRectAreaLightData {
18
+ lightNode: Node;
23
19
  reflectedLight: LightingModelReflectedLight;
24
- ltc_1: Node;
25
- ltc_2: Node;
26
20
  }
27
21
 
28
- export interface LightingModelIndirectInput {
29
- radiance: Node;
30
- irradiance: Node;
31
- iblIrradiance: Node;
32
- ambientOcclusion: Node;
33
- reflectedLight: LightingModelReflectedLight;
34
- backdrop: Node;
35
- backdropAlpha: Node;
36
- outgoingLight: Node;
22
+ declare class LightingModel {
23
+ start(builder: NodeBuilder): void;
24
+ finish(builder: NodeBuilder): void;
25
+ direct(lightData: LightingModelDirectInput, builder: NodeBuilder): void;
26
+ directRectArea(lightData: LightingModelDirectRectAreaInput, builder: NodeBuilder): void;
27
+ indirect(builder: NodeBuilder): void;
28
+ ambientOcclusion(builder: NodeBuilder): void;
37
29
  }
38
30
 
39
- export default class LightingModel {
40
- start(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void;
41
- finish(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void;
42
- direct(input: LightingModelDirectInput, stack: StackNode, builder: NodeBuilder): void;
43
- directRectArea(input: LightingModelDirectRectAreaInput, stack: StackNode, builder: NodeBuilder): void;
44
- indirect(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void;
45
- ambientOcclusion(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void;
46
- }
31
+ export default LightingModel;
@@ -81,13 +81,13 @@ declare class Node extends EventDispatcher<{
81
81
  /**
82
82
  * Constructs a new node.
83
83
  *
84
- * @param {String?} nodeType - The node type.
84
+ * @param {?string} nodeType - The node type.
85
85
  */
86
86
  constructor(nodeType?: string | null);
87
87
  /**
88
88
  * Set this property to `true` when the node should be regenerated.
89
89
  *
90
- * @type {Boolean}
90
+ * @type {boolean}
91
91
  * @default false
92
92
  * @param {boolean} value
93
93
  */
@@ -95,7 +95,7 @@ declare class Node extends EventDispatcher<{
95
95
  /**
96
96
  * The type of the class. The value is usually the constructor name.
97
97
  *
98
- * @type {String}
98
+ * @type {string}
99
99
  * @readonly
100
100
  */
101
101
  get type(): string | undefined;
@@ -103,7 +103,7 @@ declare class Node extends EventDispatcher<{
103
103
  * Convenient method for defining {@link Node#update}.
104
104
  *
105
105
  * @param {Function} callback - The update method.
106
- * @param {String} updateType - The update type.
106
+ * @param {string} updateType - The update type.
107
107
  * @return {Node} A reference to this node.
108
108
  */
109
109
  onUpdate(callback: (this: this, frame: NodeFrame) => unknown, updateType: NodeUpdateType): this;
@@ -149,8 +149,8 @@ declare class Node extends EventDispatcher<{
149
149
  * Nodes might refer to other objects like materials. This method allows to dynamically update the reference
150
150
  * to such objects based on a given state (e.g. the current node frame or builder).
151
151
  *
152
- * @param {Any} state - This method can be invocated in different contexts so `state` can refer to any object type.
153
- * @return {Any} The updated reference.
152
+ * @param {any} state - This method can be invocated in different contexts so `state` can refer to any object type.
153
+ * @return {any} The updated reference.
154
154
  */
155
155
  updateReference(state: NodeBuilder | NodeFrame): unknown;
156
156
  /**
@@ -159,7 +159,7 @@ declare class Node extends EventDispatcher<{
159
159
  * global status.
160
160
  *
161
161
  * @param {NodeBuilder} builder - The current node builder.
162
- * @return {Boolean} Whether this node is global or not.
162
+ * @return {boolean} Whether this node is global or not.
163
163
  */
164
164
  isGlobal(builder: NodeBuilder): boolean;
165
165
  /**
@@ -189,14 +189,14 @@ declare class Node extends EventDispatcher<{
189
189
  /**
190
190
  * Returns the cache key for this node.
191
191
  *
192
- * @param {Boolean} [force=false] - When set to `true`, a recomputation of the cache key is forced.
193
- * @return {Number} The cache key of the node.
192
+ * @param {boolean} [force=false] - When set to `true`, a recomputation of the cache key is forced.
193
+ * @return {number} The cache key of the node.
194
194
  */
195
195
  getCacheKey(force?: boolean): number;
196
196
  /**
197
197
  * Generate a custom cache key for this node.
198
198
  *
199
- * @return {Number} The cache key of the node.
199
+ * @return {number} The cache key of the node.
200
200
  */
201
201
  customCacheKey(): number;
202
202
  /**
@@ -211,7 +211,7 @@ declare class Node extends EventDispatcher<{
211
211
  * depending on their implementation.
212
212
  *
213
213
  * @param {NodeBuilder} builder - The current node builder.
214
- * @return {String} The hash.
214
+ * @return {string} The hash.
215
215
  */
216
216
  getHash(builder: NodeBuilder): string;
217
217
  /**
@@ -238,22 +238,22 @@ declare class Node extends EventDispatcher<{
238
238
  * these elements.
239
239
  *
240
240
  * @param {NodeBuilder} builder - The current node builder.
241
- * @return {String} The type of the node.
241
+ * @return {string} The type of the node.
242
242
  */
243
243
  getElementType(builder: NodeBuilder): "bool" | "int" | "float" | "vec2" | "vec3" | "vec4" | "uint" | null;
244
244
  /**
245
245
  * Returns the node member type for the given name.
246
246
  *
247
247
  * @param {NodeBuilder} builder - The current node builder.
248
- * @param {String} name - The name of the member.
249
- * @return {String} The type of the node.
248
+ * @param {string} name - The name of the member.
249
+ * @return {string} The type of the node.
250
250
  */
251
251
  getMemberType(builder: NodeBuilder, name: string): string;
252
252
  /**
253
253
  * Returns the node's type.
254
254
  *
255
255
  * @param {NodeBuilder} builder - The current node builder.
256
- * @return {String} The type of the node.
256
+ * @return {string} The type of the node.
257
257
  */
258
258
  getNodeType(builder: NodeBuilder): string | null;
259
259
  /**
@@ -272,7 +272,7 @@ declare class Node extends EventDispatcher<{
272
272
  * The output node must be returned in the `return` statement.
273
273
  *
274
274
  * @param {NodeBuilder} builder - The current node builder.
275
- * @return {Node?} The output node.
275
+ * @return {?Node} The output node.
276
276
  */
277
277
  setup(builder: NodeBuilder): unknown;
278
278
  /**
@@ -287,8 +287,8 @@ declare class Node extends EventDispatcher<{
287
287
  * This state builds the output node and returns the resulting shader string.
288
288
  *
289
289
  * @param {NodeBuilder} builder - The current node builder.
290
- * @param {String?} output - Can be used to define the output type.
291
- * @return {String?} The generated shader string.
290
+ * @param {?string} output - Can be used to define the output type.
291
+ * @return {?string} The generated shader string.
292
292
  */
293
293
  generate(builder: NodeBuilder, output?: string | null): string | null | undefined;
294
294
  /**
@@ -297,7 +297,7 @@ declare class Node extends EventDispatcher<{
297
297
  *
298
298
  * @abstract
299
299
  * @param {NodeFrame} frame - A reference to the current node frame.
300
- * @return {Boolean?} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching).
300
+ * @return {?boolean} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching).
301
301
  */
302
302
  updateBefore(frame: NodeFrame): void;
303
303
  /**
@@ -306,7 +306,7 @@ declare class Node extends EventDispatcher<{
306
306
  *
307
307
  * @abstract
308
308
  * @param {NodeFrame} frame - A reference to the current node frame.
309
- * @return {Boolean?} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching).
309
+ * @return {?boolean} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching).
310
310
  */
311
311
  updateAfter(frame: NodeFrame): void;
312
312
  /**
@@ -315,7 +315,7 @@ declare class Node extends EventDispatcher<{
315
315
  *
316
316
  * @abstract
317
317
  * @param {NodeFrame} frame - A reference to the current node frame.
318
- * @return {Boolean?} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching).
318
+ * @return {?boolean} An optional bool that indicates whether the implementation actually performed an update or not (e.g. due to caching).
319
319
  */
320
320
  update(frame: NodeFrame): void;
321
321
  /**
@@ -323,8 +323,8 @@ declare class Node extends EventDispatcher<{
323
323
  * on the current build stage (setup, analyze or generate).
324
324
  *
325
325
  * @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.
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.
328
328
  */
329
329
  build(builder: NodeBuilder, output?: string | null): string | null;
330
330
  /**
@@ -348,7 +348,7 @@ declare class Node extends EventDispatcher<{
348
348
  /**
349
349
  * Serializes the node into the three.js JSON Object/Scene format.
350
350
  *
351
- * @param {Object?} meta - An optional JSON object that already holds serialized data from other scene objects.
351
+ * @param {?Object} meta - An optional JSON object that already holds serialized data from other scene objects.
352
352
  * @return {Object} The serialized node.
353
353
  */
354
354
  toJSON(meta?: NodeJSONMeta | string): NodeJSONOutputData;
@@ -13,9 +13,9 @@ declare class NodeAttribute {
13
13
  /**
14
14
  * Constructs a new node attribute.
15
15
  *
16
- * @param {String} name - The name of the attribute.
17
- * @param {String} type - The type of the attribute.
18
- * @param {Node?} node - An optional reference to the node.
16
+ * @param {string} name - The name of the attribute.
17
+ * @param {string} type - The type of the attribute.
18
+ * @param {?Node} node - An optional reference to the node.
19
19
  */
20
20
  constructor(name: string, type: string | null, node?: Node | null);
21
21
  }
@@ -51,14 +51,14 @@ declare class NodeCache {
51
51
  /**
52
52
  * Constructs a new node cache.
53
53
  *
54
- * @param {NodeCache?} parent - A reference to a parent cache.
54
+ * @param {?NodeCache} parent - A reference to a parent cache.
55
55
  */
56
56
  constructor(parent?: NodeCache | null);
57
57
  /**
58
58
  * Returns the data for the given node.
59
59
  *
60
60
  * @param {Node} node - The node.
61
- * @return {Object?} The data for the node.
61
+ * @return {?Object} The data for the node.
62
62
  */
63
63
  getData(node: Node): NodeData | undefined;
64
64
  getData(node: TypedArray | InterleavedBuffer | BufferAttribute): BufferAttributeData | undefined;
@@ -8,7 +8,7 @@ declare abstract class NodeParser {
8
8
  * The method parses the given native code an returns a node function.
9
9
  *
10
10
  * @abstract
11
- * @param {String} source - The native shader code.
11
+ * @param {string} source - The native shader code.
12
12
  * @return {NodeFunction} A node function.
13
13
  */
14
14
  abstract parseFunction(source: string): NodeFunction;
@@ -14,22 +14,22 @@ declare class NodeUniform<TValue> {
14
14
  /**
15
15
  * Constructs a new node uniform.
16
16
  *
17
- * @param {String} name - The name of the uniform.
18
- * @param {String} type - The type of the uniform.
17
+ * @param {string} name - The name of the uniform.
18
+ * @param {string} type - The type of the uniform.
19
19
  * @param {UniformNode} node - An reference to the node.
20
20
  */
21
21
  constructor(name: string, type: string | null, node: UniformNode<TValue>);
22
22
  /**
23
23
  * The value of the uniform node.
24
24
  *
25
- * @type {Any}
25
+ * @type {any}
26
26
  */
27
27
  get value(): TValue;
28
28
  set value(val: TValue);
29
29
  /**
30
30
  * The id of the uniform node.
31
31
  *
32
- * @type {Number}
32
+ * @type {number}
33
33
  */
34
34
  get id(): number;
35
35
  /**
@@ -13,10 +13,10 @@ declare class NodeVar {
13
13
  /**
14
14
  * Constructs a new node variable.
15
15
  *
16
- * @param {String} name - The name of the variable.
17
- * @param {String} type - The type of the variable.
18
- * @param {Boolean} [readOnly=false] - The read-only flag.
19
- * @param {Number?} [count=null] - The size.
16
+ * @param {string} name - The name of the variable.
17
+ * @param {string} type - The type of the variable.
18
+ * @param {boolean} [readOnly=false] - The read-only flag.
19
+ * @param {?number} [count=null] - The size.
20
20
  */
21
21
  constructor(name: string, type: string, readOnly?: boolean, count?: number | null);
22
22
  }
@@ -13,8 +13,8 @@ declare class NodeVarying extends NodeVar {
13
13
  /**
14
14
  * Constructs a new node varying.
15
15
  *
16
- * @param {String} name - The name of the varying.
17
- * @param {String} type - The type of the varying.
16
+ * @param {string} name - The name of the varying.
17
+ * @param {string} type - The type of the varying.
18
18
  */
19
19
  constructor(name: string, type: string | null);
20
20
  }
@@ -1,6 +1,5 @@
1
1
  import Node from "./Node.js";
2
2
  import NodeBuilder from "./NodeBuilder.js";
3
- /** @module StructTypeNode **/
4
3
  export interface MembersLayout {
5
4
  [name: string]: string | {
6
5
  type: string;
@@ -29,18 +28,19 @@ declare class StructTypeNode extends Node {
29
28
  * Creates an instance of StructTypeNode.
30
29
  *
31
30
  * @param {Object} membersLayout - The layout of the members for the struct.
32
- * @param {string} [name=null] - The optional name of the struct.
31
+ * @param {?string} [name=null] - The optional name of the struct.
33
32
  */
34
33
  constructor(membersLayout: MembersLayout, name?: string | null);
35
34
  /**
36
35
  * Returns the length of the struct.
37
36
  * The length is calculated by summing the lengths of the struct's members.
38
37
  *
39
- * @returns {Number} The length of the struct.
38
+ * @returns {number} The length of the struct.
40
39
  */
41
40
  getLength(): number;
42
41
  getMemberType(builder: NodeBuilder, name: string): string;
43
42
  getNodeType(builder: NodeBuilder): string;
43
+ setup(builder: NodeBuilder): void;
44
44
  generate(builder: NodeBuilder): string;
45
45
  }
46
46
  export default StructTypeNode;
@@ -4,7 +4,6 @@ import Node from "./Node.js";
4
4
  import NodeBuilder from "./NodeBuilder.js";
5
5
  import NodeFrame from "./NodeFrame.js";
6
6
  import UniformGroupNode from "./UniformGroupNode.js";
7
- /** @module UniformNode **/
8
7
  /**
9
8
  * Class for representing a uniform.
10
9
  *
@@ -18,14 +17,14 @@ declare class UniformNode<TValue> extends InputNode<TValue> {
18
17
  /**
19
18
  * Constructs a new uniform node.
20
19
  *
21
- * @param {Any} value - The value of this node. Usually a JS primitive or three.js object (vector, matrix, color, texture).
22
- * @param {String?} nodeType - The node type. If no explicit type is defined, the node tries to derive the type from its value.
20
+ * @param {any} value - The value of this node. Usually a JS primitive or three.js object (vector, matrix, color, texture).
21
+ * @param {?string} nodeType - The node type. If no explicit type is defined, the node tries to derive the type from its value.
23
22
  */
24
23
  constructor(value: TValue, nodeType?: string | null);
25
24
  /**
26
25
  * Sets the {@link UniformNode#name} property.
27
26
  *
28
- * @param {String} name - The name of the uniform.
27
+ * @param {string} name - The name of the uniform.
29
28
  * @return {UniformNode} A reference to this node.
30
29
  */
31
30
  label(name: string): this;
@@ -47,7 +46,7 @@ declare class UniformNode<TValue> extends InputNode<TValue> {
47
46
  * classes might overwrite this method with a different implementation.
48
47
  *
49
48
  * @param {NodeBuilder} builder - The current node builder.
50
- * @return {String} The uniform hash.
49
+ * @return {string} The uniform hash.
51
50
  */
52
51
  getUniformHash(builder: NodeBuilder): string;
53
52
  onUpdate(callback: (frame: NodeFrame, self: this) => TValue | undefined, updateType: NodeUpdateType): this;
@@ -57,9 +56,10 @@ export default UniformNode;
57
56
  /**
58
57
  * TSL function for creating a uniform node.
59
58
  *
59
+ * @tsl
60
60
  * @function
61
- * @param {Any} arg1 - The value of this node. Usually a JS primitive or three.js object (vector, matrix, color, texture).
62
- * @param {String?} arg2 - The node type. If no explicit type is defined, the node tries to derive the type from its value.
61
+ * @param {any} arg1 - The value of this node. Usually a JS primitive or three.js object (vector, matrix, color, texture).
62
+ * @param {string} [arg2] - The node type. If no explicit type is defined, the node tries to derive the type from its value.
63
63
  * @returns {UniformNode}
64
64
  */
65
65
  export declare const uniform: <TValue>(
@@ -1,4 +1,3 @@
1
- /** @module NodeConstants **/
2
1
  /**
3
2
  * Possible shader stages.
4
3
  *
@@ -1,4 +1,5 @@
1
1
  import { Camera } from "../../cameras/Camera.js";
2
+ import { Layers } from "../../core/Layers.js";
2
3
  import { RenderTarget, RenderTargetOptions } from "../../core/RenderTarget.js";
3
4
  import { Scene } from "../../scenes/Scene.js";
4
5
  import { Texture } from "../../textures/Texture.js";
@@ -34,6 +35,14 @@ declare class PassNode extends TempNode {
34
35
 
35
36
  constructor(scope: PassNodeScope, scene: Scene, camera: Camera, options?: RenderTargetOptions);
36
37
 
38
+ setResolution(resolution: number): this;
39
+
40
+ getResolution(): number;
41
+
42
+ setLayers(layers: Layers): this;
43
+
44
+ getLayers(): Layers;
45
+
37
46
  setMRT(mrt: MRTNode | null): this;
38
47
 
39
48
  getMRT(): MRTNode | null;
@@ -44,7 +53,7 @@ declare class PassNode extends TempNode {
44
53
 
45
54
  toggleTexture(name: string): void;
46
55
 
47
- getTextureNode(name?: string): ShaderNodeObject<Node>;
56
+ getTextureNode(name?: string): ShaderNodeObject<TextureNode>;
48
57
 
49
58
  getPreviousTextureNode(name?: string): ShaderNodeObject<Node>;
50
59
 
@@ -6,4 +6,8 @@ declare const LTC_Evaluate: (
6
6
  args: { N: Node; V: Node; P: Node; mInv: Node; p0: Node; p1: Node; p2: Node; p3: Node },
7
7
  ) => Node;
8
8
 
9
- export { LTC_Evaluate, LTC_Uv };
9
+ declare const LTC_Evaluate_Volume: (
10
+ args: { P: Node; p0: Node; p1: Node; p2: Node; p3: Node },
11
+ ) => Node;
12
+
13
+ export { LTC_Evaluate, LTC_Evaluate_Volume, LTC_Uv };
@@ -0,0 +1,6 @@
1
+ import LightingModel from "../core/LightingModel.js";
2
+
3
+ declare class VolumetricLightingModel extends LightingModel {
4
+ }
5
+
6
+ export default VolumetricLightingModel;
@@ -17,9 +17,8 @@ declare class AtomicFunctionNode extends TempNode {
17
17
  method: AtomicMethod;
18
18
  pointerNode: Node;
19
19
  valueNode: Node;
20
- storeNode: Node;
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>;