@types/three 0.176.0 → 0.178.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 (214) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +0 -1
  3. three/examples/jsm/capabilities/WebGL.d.ts +0 -11
  4. three/examples/jsm/controls/TransformControls.d.ts +16 -1
  5. three/examples/jsm/helpers/TextureHelper.d.ts +2 -2
  6. three/examples/jsm/helpers/TextureHelperGPU.d.ts +2 -2
  7. three/examples/jsm/loaders/LDrawLoader.d.ts +8 -3
  8. three/examples/jsm/loaders/SVGLoader.d.ts +1 -1
  9. three/examples/jsm/math/Octree.d.ts +3 -0
  10. three/examples/jsm/physics/RapierPhysics.d.ts +1 -0
  11. three/examples/jsm/postprocessing/AfterimagePass.d.ts +13 -10
  12. three/examples/jsm/postprocessing/FXAAPass.d.ts +7 -0
  13. three/examples/jsm/transpiler/AST.d.ts +77 -26
  14. three/examples/jsm/transpiler/TSLEncoder.d.ts +9 -3
  15. three/examples/jsm/tsl/display/AnamorphicNode.d.ts +4 -4
  16. three/examples/jsm/tsl/display/BleachBypass.d.ts +2 -2
  17. three/examples/jsm/tsl/display/BloomNode.d.ts +2 -2
  18. three/examples/jsm/tsl/display/ChromaticAberrationNode.d.ts +20 -0
  19. three/examples/jsm/tsl/display/DenoiseNode.d.ts +4 -4
  20. three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +6 -6
  21. three/examples/jsm/tsl/display/DotScreenNode.d.ts +2 -2
  22. three/examples/jsm/tsl/display/FXAANode.d.ts +3 -3
  23. three/examples/jsm/tsl/display/FilmNode.d.ts +4 -4
  24. three/examples/jsm/tsl/display/GTAONode.d.ts +3 -3
  25. three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +5 -5
  26. three/examples/jsm/tsl/display/LensflareNode.d.ts +8 -8
  27. three/examples/jsm/tsl/display/Lut3DNode.d.ts +4 -4
  28. three/examples/jsm/tsl/display/MotionBlur.d.ts +4 -4
  29. three/examples/jsm/tsl/display/OutlineNode.d.ts +3 -3
  30. three/examples/jsm/tsl/display/RGBShiftNode.d.ts +3 -3
  31. three/examples/jsm/tsl/display/SMAANode.d.ts +3 -3
  32. three/examples/jsm/tsl/display/SSRNode.d.ts +5 -5
  33. three/examples/jsm/tsl/display/Sepia.d.ts +2 -2
  34. three/examples/jsm/tsl/display/SobelOperatorNode.d.ts +3 -3
  35. three/examples/jsm/tsl/display/TransitionNode.d.ts +4 -4
  36. three/examples/jsm/tsl/display/hashBlur.d.ts +10 -4
  37. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +5 -5
  38. three/package.json +3 -3
  39. three/src/Three.Core.d.ts +0 -2
  40. three/src/Three.TSL.d.ts +11 -18
  41. three/src/Three.WebGPU.Nodes.d.ts +1 -0
  42. three/src/Three.WebGPU.d.ts +3 -0
  43. three/src/animation/tracks/NumberKeyframeTrack.d.ts +1 -1
  44. three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +1 -1
  45. three/src/animation/tracks/StringKeyframeTrack.d.ts +1 -1
  46. three/src/animation/tracks/VectorKeyframeTrack.d.ts +1 -1
  47. three/src/constants.d.ts +13 -5
  48. three/src/core/BufferGeometry.d.ts +11 -2
  49. three/src/core/GLBufferAttribute.d.ts +18 -1
  50. three/src/core/RenderTarget.d.ts +3 -20
  51. three/src/extras/DataUtils.d.ts +4 -4
  52. three/src/geometries/CapsuleGeometry.d.ts +1 -0
  53. three/src/helpers/AxesHelper.d.ts +3 -1
  54. three/src/lights/SpotLightShadow.d.ts +2 -0
  55. three/src/lights/webgpu/ProjectorLight.d.ts +17 -0
  56. three/src/materials/LineBasicMaterial.d.ts +66 -34
  57. three/src/materials/LineDashedMaterial.d.ts +41 -21
  58. three/src/materials/Material.d.ts +408 -398
  59. three/src/materials/MeshBasicMaterial.d.ts +101 -62
  60. three/src/materials/MeshDepthMaterial.d.ts +71 -32
  61. three/src/materials/MeshDistanceMaterial.d.ts +65 -29
  62. three/src/materials/MeshLambertMaterial.d.ts +179 -103
  63. three/src/materials/MeshMatcapMaterial.d.ts +97 -55
  64. three/src/materials/MeshNormalMaterial.d.ts +76 -41
  65. three/src/materials/MeshPhongMaterial.d.ts +164 -100
  66. three/src/materials/MeshPhysicalMaterial.d.ts +164 -116
  67. three/src/materials/MeshStandardMaterial.d.ts +178 -91
  68. three/src/materials/MeshToonMaterial.d.ts +130 -81
  69. three/src/materials/PointsMaterial.d.ts +77 -30
  70. three/src/materials/RawShaderMaterial.d.ts +12 -7
  71. three/src/materials/ShaderMaterial.d.ts +186 -98
  72. three/src/materials/ShadowMaterial.d.ts +49 -23
  73. three/src/materials/SpriteMaterial.d.ts +62 -33
  74. three/src/materials/nodes/Line2NodeMaterial.d.ts +87 -40
  75. three/src/materials/nodes/LineBasicNodeMaterial.d.ts +35 -16
  76. three/src/materials/nodes/LineDashedNodeMaterial.d.ts +75 -20
  77. three/src/materials/nodes/MeshBasicNodeMaterial.d.ts +49 -30
  78. three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +49 -42
  79. three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts +38 -26
  80. three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +36 -22
  81. three/src/materials/nodes/MeshPhongNodeMaterial.d.ts +68 -48
  82. three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts +240 -65
  83. three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +99 -3
  84. three/src/materials/nodes/MeshStandardNodeMaterial.d.ts +83 -47
  85. three/src/materials/nodes/MeshToonNodeMaterial.d.ts +42 -36
  86. three/src/materials/nodes/NodeMaterial.d.ts +418 -55
  87. three/src/materials/nodes/NodeMaterials.d.ts +3 -2
  88. three/src/materials/nodes/PointsNodeMaterial.d.ts +31 -7
  89. three/src/materials/nodes/ShadowNodeMaterial.d.ts +38 -11
  90. three/src/materials/nodes/SpriteNodeMaterial.d.ts +68 -18
  91. three/src/materials/nodes/VolumeNodeMaterial.d.ts +50 -14
  92. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +4 -0
  93. three/src/math/Box3.d.ts +8 -0
  94. three/src/math/Color.d.ts +1 -1
  95. three/src/math/ColorManagement.d.ts +12 -2
  96. three/src/math/Sphere.d.ts +8 -0
  97. three/src/math/Triangle.d.ts +3 -3
  98. three/src/nodes/Nodes.d.ts +2 -3
  99. three/src/nodes/TSL.d.ts +4 -3
  100. three/src/nodes/accessors/AccessorsUtils.d.ts +3 -3
  101. three/src/nodes/accessors/Bitangent.d.ts +0 -2
  102. three/src/nodes/accessors/CubeTextureNode.d.ts +16 -5
  103. three/src/nodes/accessors/Normal.d.ts +19 -5
  104. three/src/nodes/accessors/ReferenceBaseNode.d.ts +1 -1
  105. three/src/nodes/accessors/StorageBufferNode.d.ts +3 -2
  106. three/src/nodes/accessors/StorageTextureNode.d.ts +5 -5
  107. three/src/nodes/accessors/Tangent.d.ts +0 -2
  108. three/src/nodes/accessors/TangentUtils.d.ts +22 -0
  109. three/src/nodes/accessors/Texture3DNode.d.ts +5 -4
  110. three/src/nodes/accessors/TextureBicubic.d.ts +4 -2
  111. three/src/nodes/accessors/TextureNode.d.ts +24 -19
  112. three/src/nodes/accessors/TextureSizeNode.d.ts +3 -3
  113. three/src/nodes/accessors/UniformArrayNode.d.ts +2 -7
  114. three/src/nodes/code/FunctionCallNode.d.ts +3 -1
  115. three/src/nodes/code/FunctionNode.d.ts +2 -2
  116. three/src/nodes/code/ScriptableNode.d.ts +2 -2
  117. three/src/nodes/core/AssignNode.d.ts +7 -3
  118. three/src/nodes/core/AttributeNode.d.ts +1 -1
  119. three/src/nodes/core/BypassNode.d.ts +2 -2
  120. three/src/nodes/core/CacheNode.d.ts +1 -0
  121. three/src/nodes/core/ContextNode.d.ts +3 -3
  122. three/src/nodes/core/Node.d.ts +5 -4
  123. three/src/nodes/core/NodeUtils.d.ts +4 -0
  124. three/src/nodes/core/StackNode.d.ts +3 -13
  125. three/src/nodes/core/SubBuildNode.d.ts +15 -0
  126. three/src/nodes/core/VarNode.d.ts +4 -4
  127. three/src/nodes/core/VaryingNode.d.ts +3 -3
  128. three/src/nodes/display/BlendModes.d.ts +14 -10
  129. three/src/nodes/display/BumpMapNode.d.ts +4 -3
  130. three/src/nodes/display/ColorAdjustment.d.ts +17 -17
  131. three/src/nodes/display/ColorSpaceFunctions.d.ts +3 -3
  132. three/src/nodes/display/ColorSpaceNode.d.ts +6 -16
  133. three/src/nodes/display/FrontFacingNode.d.ts +1 -0
  134. three/src/nodes/display/PosterizeNode.d.ts +3 -3
  135. three/src/nodes/display/RenderOutputNode.d.ts +2 -2
  136. three/src/nodes/display/ScreenNode.d.ts +0 -10
  137. three/src/nodes/display/ToneMappingFunctions.d.ts +7 -7
  138. three/src/nodes/display/ToneMappingNode.d.ts +6 -6
  139. three/src/nodes/display/ViewportDepthTextureNode.d.ts +3 -3
  140. three/src/nodes/fog/Fog.d.ts +10 -10
  141. three/src/nodes/functions/BSDF/Schlick_to_F0.d.ts +4 -4
  142. three/src/nodes/functions/material/getAlphaHashThreshold.d.ts +2 -2
  143. three/src/nodes/functions/material/getParallaxCorrectNormal.d.ts +4 -4
  144. three/src/nodes/geometry/RangeNode.d.ts +9 -2
  145. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +20 -20
  146. three/src/nodes/gpgpu/ComputeNode.d.ts +2 -2
  147. three/src/nodes/lighting/PointShadowNode.d.ts +11 -11
  148. three/src/nodes/lighting/ProjectorLightNode.d.ts +5 -0
  149. three/src/nodes/lighting/ShadowFilterNode.d.ts +11 -11
  150. three/src/nodes/lighting/SpotLightNode.d.ts +15 -1
  151. three/src/nodes/materialx/MaterialXNodes.d.ts +59 -59
  152. three/src/nodes/materialx/lib/mx_hsv.d.ts +3 -3
  153. three/src/nodes/materialx/lib/mx_noise.d.ts +206 -206
  154. three/src/nodes/materialx/lib/mx_transform_color.d.ts +2 -2
  155. three/src/nodes/math/ConditionalNode.d.ts +4 -19
  156. three/src/nodes/math/Hash.d.ts +2 -2
  157. three/src/nodes/math/MathNode.d.ts +21 -17
  158. three/src/nodes/math/OperatorNode.d.ts +41 -52
  159. three/src/nodes/math/TriNoise3D.d.ts +6 -6
  160. three/src/nodes/pmrem/PMREMNode.d.ts +3 -3
  161. three/src/nodes/pmrem/PMREMUtils.d.ts +20 -20
  162. three/src/nodes/procedural/Checker.d.ts +2 -2
  163. three/src/nodes/shapes/Shapes.d.ts +2 -2
  164. three/src/nodes/tsl/TSLBase.d.ts +1 -0
  165. three/src/nodes/tsl/TSLCore.d.ts +186 -81
  166. three/src/nodes/utils/CubeMapNode.d.ts +2 -2
  167. three/src/nodes/utils/DebugNode.d.ts +2 -2
  168. three/src/nodes/utils/Discard.d.ts +2 -2
  169. three/src/nodes/utils/EquirectUV.d.ts +4 -0
  170. three/src/nodes/utils/LoopNode.d.ts +2 -7
  171. three/src/nodes/utils/MatcapUV.d.ts +4 -0
  172. three/src/nodes/utils/Oscillators.d.ts +5 -5
  173. three/src/nodes/utils/Packing.d.ts +3 -3
  174. three/src/nodes/utils/PostProcessingUtils.d.ts +9 -9
  175. three/src/nodes/utils/RTTNode.d.ts +3 -3
  176. three/src/nodes/utils/ReflectorNode.d.ts +1 -0
  177. three/src/nodes/utils/RemapNode.d.ts +9 -9
  178. three/src/nodes/utils/RotateNode.d.ts +3 -3
  179. three/src/nodes/utils/SampleNode.d.ts +16 -0
  180. three/src/nodes/utils/SpriteSheetUVNode.d.ts +4 -4
  181. three/src/nodes/utils/SpriteUtils.d.ts +2 -2
  182. three/src/nodes/utils/StorageArrayElementNode.d.ts +4 -3
  183. three/src/nodes/utils/TriplanarTextures.d.ts +20 -0
  184. three/src/nodes/utils/UVUtils.d.ts +8 -7
  185. three/src/nodes/utils/ViewportUtils.d.ts +2 -2
  186. three/src/objects/LOD.d.ts +1 -1
  187. three/src/objects/Mesh.d.ts +8 -0
  188. three/src/objects/Sprite.d.ts +8 -0
  189. three/src/renderers/WebGLRenderer.d.ts +3 -3
  190. three/src/renderers/common/Backend.d.ts +3 -3
  191. three/src/renderers/common/RenderObject.d.ts +10 -2
  192. three/src/renderers/common/Renderer.d.ts +10 -5
  193. three/src/renderers/common/Storage3DTexture.d.ts +40 -0
  194. three/src/renderers/common/StorageArrayTexture.d.ts +29 -0
  195. three/src/renderers/common/Textures.d.ts +2 -2
  196. three/src/renderers/common/XRManager.d.ts +45 -0
  197. three/src/renderers/common/XRRenderTarget.d.ts +3 -2
  198. three/src/renderers/common/nodes/NodeLibrary.d.ts +4 -9
  199. three/src/renderers/common/nodes/NodeSampledTexture.d.ts +1 -1
  200. three/src/renderers/common/nodes/Nodes.d.ts +1 -1
  201. three/src/renderers/webgpu/WebGPURenderer.d.ts +3 -0
  202. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +65 -0
  203. three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +1 -0
  204. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +10 -1
  205. three/src/textures/DepthTexture.d.ts +4 -2
  206. three/src/textures/Source.d.ts +20 -16
  207. three/src/textures/Texture.d.ts +69 -2
  208. three/examples/jsm/effects/PeppersGhostEffect.d.ts +0 -10
  209. three/src/core/RenderTargetArray.d.ts +0 -9
  210. three/src/nodes/utils/EquirectUVNode.d.ts +0 -8
  211. three/src/nodes/utils/MatcapUVNode.d.ts +0 -8
  212. three/src/nodes/utils/TriplanarTexturesNode.d.ts +0 -36
  213. three/src/renderers/common/nodes/StandardNodeLibrary.d.ts +0 -5
  214. three/src/textures/DepthArrayTexture.d.ts +0 -14
@@ -1,5 +1,5 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  declare class TextureSizeNode extends Node {
5
5
  readonly isTextureSizeNode: true;
@@ -13,6 +13,6 @@ declare class TextureSizeNode extends Node {
13
13
  export default TextureSizeNode;
14
14
 
15
15
  export const textureSize: (
16
- textureNode: NodeRepresentation,
17
- levelNode?: NodeRepresentation | null,
16
+ textureNode: Node,
17
+ levelNode?: Node | null,
18
18
  ) => ShaderNodeObject<TextureSizeNode>;
@@ -1,5 +1,5 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
  import ArrayElementNode from "../utils/ArrayElementNode.js";
4
4
  import BufferNode from "./BufferNode.js";
5
5
 
@@ -18,14 +18,9 @@ declare class UniformArrayNode extends BufferNode<unknown[]> {
18
18
 
19
19
  getPaddedType(): string;
20
20
 
21
- element(indexNode: NodeRepresentation): ShaderNodeObject<UniformArrayElementNode>;
21
+ element(indexNode: Node): ShaderNodeObject<UniformArrayElementNode>;
22
22
  }
23
23
 
24
24
  export default UniformArrayNode;
25
25
 
26
26
  export const uniformArray: (values: unknown[], nodeType?: string | null) => ShaderNodeObject<UniformArrayNode>;
27
-
28
- /**
29
- * @deprecated uniforms() has been renamed to uniformArray().
30
- */
31
- export const uniforms: (values: unknown[], nodeType?: string | null) => ShaderNodeObject<UniformArrayNode>;
@@ -3,7 +3,9 @@ import TempNode from "../core/TempNode.js";
3
3
  import { ProxiedObject, ShaderNodeObject } from "../tsl/TSLCore.js";
4
4
  import FunctionNode, { FunctionNodeArguments } from "./FunctionNode.js";
5
5
 
6
- export default class FunctionCallNode<P extends Node[] | { [name: string]: Node }> extends TempNode {
6
+ export default class FunctionCallNode<P extends Array<Node | number> | { [name: string]: Node | number }>
7
+ extends TempNode
8
+ {
7
9
  functionNode: FunctionNode<P>;
8
10
  parameters: { [name: string]: Node };
9
11
 
@@ -6,9 +6,9 @@ import { ProxiedObject, ProxiedTuple, ShaderNodeObject } from "../tsl/TSLCore.js
6
6
  import CodeNode, { CodeNodeInclude } from "./CodeNode.js";
7
7
  import FunctionCallNode from "./FunctionCallNode.js";
8
8
 
9
- export type FunctionNodeArguments = Node[] | { [name: string]: Node };
9
+ export type FunctionNodeArguments = Array<Node | number> | { [name: string]: Node | number };
10
10
 
11
- export default class FunctionNode<P extends Node[] | { [name: string]: Node }> extends CodeNode {
11
+ export default class FunctionNode<P extends Array<Node | number> | { [name: string]: Node | number }> extends CodeNode {
12
12
  constructor(code?: string, includes?: CodeNodeInclude[], language?: string);
13
13
 
14
14
  getInputs(builder: NodeBuilder): NodeFunctionInput[];
@@ -1,5 +1,5 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  declare class Resources extends Map<string, unknown> {
5
5
  get<TArgs extends unknown[]>(key: string, callback?: ((...args: TArgs) => void) | null, ...params: TArgs): unknown;
@@ -17,6 +17,6 @@ declare class ScriptableNode extends Node {
17
17
  export default ScriptableNode;
18
18
 
19
19
  export const scriptable: (
20
- codeNode: NodeRepresentation,
20
+ codeNode: Node,
21
21
  parameters?: Record<string, unknown>,
22
22
  ) => ShaderNodeObject<ScriptableNode>;
@@ -1,15 +1,19 @@
1
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
1
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
2
2
  import Node from "./Node.js";
3
3
  import NodeBuilder from "./NodeBuilder.js";
4
4
  import TempNode from "./TempNode.js";
5
5
 
6
- export default class AssignNode extends TempNode {
6
+ declare class AssignNode extends TempNode {
7
+ readonly isAssignNode: true;
8
+
7
9
  constructor(targetNode: Node, sourceNode: Node);
8
10
 
9
11
  needsSplitAssign(builder: NodeBuilder): boolean;
10
12
  }
11
13
 
12
- export const assign: (targetNode: NodeRepresentation, sourceNode: NodeRepresentation) => ShaderNodeObject<AssignNode>;
14
+ export default AssignNode;
15
+
16
+ export const assign: (targetNode: Node, sourceNode: Node | number) => ShaderNodeObject<AssignNode>;
13
17
 
14
18
  declare module "../tsl/TSLCore.js" {
15
19
  interface NodeElements {
@@ -1,4 +1,4 @@
1
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
1
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
2
2
  import Node from "./Node.js";
3
3
  import NodeBuilder from "./NodeBuilder.js";
4
4
 
@@ -1,4 +1,4 @@
1
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
1
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
2
2
  import Node from "./Node.js";
3
3
 
4
4
  export default class BypassNode extends Node {
@@ -9,7 +9,7 @@ export default class BypassNode extends Node {
9
9
  constructor(returnNode: Node, callNode: Node);
10
10
  }
11
11
 
12
- export const bypass: (returnNode: NodeRepresentation, callNode: NodeRepresentation) => ShaderNodeObject<BypassNode>;
12
+ export const bypass: (returnNode: Node, callNode: Node) => ShaderNodeObject<BypassNode>;
13
13
 
14
14
  declare module "../tsl/TSLCore.js" {
15
15
  interface NodeElements {
@@ -1,4 +1,5 @@
1
1
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import ContextNode from "./ContextNode.js";
2
3
  import Node from "./Node.js";
3
4
  import NodeCache from "./NodeCache.js";
4
5
 
@@ -1,4 +1,4 @@
1
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
1
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
2
2
  import Node from "./Node.js";
3
3
  import { NodeBuilderContext } from "./NodeBuilder.js";
4
4
 
@@ -13,8 +13,8 @@ declare class ContextNode extends Node {
13
13
 
14
14
  export default ContextNode;
15
15
 
16
- export const context: (node: NodeRepresentation, context?: NodeBuilderContext) => ShaderNodeObject<ContextNode>;
17
- export const label: (node: NodeRepresentation, label: string) => ShaderNodeObject<ContextNode>;
16
+ export const context: (node: Node, context?: NodeBuilderContext) => ShaderNodeObject<ContextNode>;
17
+ export const label: (node: Node, label: string) => ShaderNodeObject<ContextNode>;
18
18
 
19
19
  declare module "../tsl/TSLCore.js" {
20
20
  interface NodeElements {
@@ -157,7 +157,7 @@ declare class Node extends EventDispatcher<{
157
157
  /**
158
158
  * By default this method returns the value of the {@link Node#global} flag. This method
159
159
  * can be overwritten in derived classes if an analytical way is required to determine the
160
- * global status.
160
+ * global cache referring to the current shader-stage.
161
161
  *
162
162
  * @param {NodeBuilder} builder - The current node builder.
163
163
  * @return {boolean} Whether this node is global or not.
@@ -281,8 +281,9 @@ declare class Node extends EventDispatcher<{
281
281
  * This stage analyzes the node hierarchy and ensures descendent nodes are built.
282
282
  *
283
283
  * @param {NodeBuilder} builder - The current node builder.
284
+ * @param {?Node} output - The target output node.
284
285
  */
285
- analyze(builder: NodeBuilder): void;
286
+ analyze(builder: NodeBuilder, output?: Node | null): void;
286
287
  /**
287
288
  * Represents the generate stage which is the third step of the build process, see {@link Node#build} method.
288
289
  * This state builds the output node and returns the resulting shader string.
@@ -326,10 +327,10 @@ declare class Node extends EventDispatcher<{
326
327
  * - **generate**: Generates the shader code for the node. Returns the generated shader string.
327
328
  *
328
329
  * @param {NodeBuilder} builder - The current node builder.
329
- * @param {?string} [output=null] - Can be used to define the output type.
330
+ * @param {string|Node|null} [output=null] - Can be used to define the output type.
330
331
  * @return {Node|string|null} The result of the build process, depending on the build stage.
331
332
  */
332
- build(builder: NodeBuilder, output?: string | null): Node | string | null;
333
+ build(builder: NodeBuilder, output?: string | Node | null): Node | string | null;
333
334
  /**
334
335
  * Returns the child nodes as a JSON object.
335
336
  *
@@ -24,6 +24,10 @@ export function getTypeFromLength(length: number): string | undefined;
24
24
 
25
25
  export function getLengthFromType(type: string): number | undefined;
26
26
 
27
+ export function getMemoryLengthFromType(type: string): number | undefined;
28
+
29
+ export function getByteBoundaryFromType(type: string): number | undefined;
30
+
27
31
  export function getValueType(value: unknown): string | null;
28
32
 
29
33
  export function getValueFromType(
@@ -1,4 +1,4 @@
1
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
1
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
2
2
  import Node from "./Node.js";
3
3
 
4
4
  declare class StackNode extends Node {
@@ -16,21 +16,11 @@ declare class StackNode extends Node {
16
16
 
17
17
  Else(method: () => void): this;
18
18
 
19
- Switch(expression: NodeRepresentation): this;
19
+ Switch(expression: Node): this;
20
20
 
21
- Case(...params: NodeRepresentation[]): this;
21
+ Case(...params: Node[]): this;
22
22
 
23
23
  Default(method: () => void): this;
24
-
25
- /**
26
- * @deprecated Use {@link StackNode#ElseIf Else()} instead.
27
- */
28
- elseif(boolNode: Node, method: () => void): this;
29
-
30
- /**
31
- * @deprecated Use {@link StackNode#Else Else()} instead.
32
- */
33
- else(method: () => void): this;
34
24
  }
35
25
 
36
26
  export default StackNode;
@@ -0,0 +1,15 @@
1
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import Node from "./Node.js";
3
+
4
+ declare class SubBuildNode extends Node {
5
+ node: Node;
6
+ name: string;
7
+
8
+ readonly isSubBuildNode: true;
9
+
10
+ constructor(node: Node, name: string, nodeType?: string | null);
11
+ }
12
+
13
+ export default SubBuildNode;
14
+
15
+ export const subBuild: (node: Node, name: string, type?: string | null) => ShaderNodeObject<SubBuildNode>;
@@ -1,4 +1,4 @@
1
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
1
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
2
2
  import Node from "./Node.js";
3
3
 
4
4
  export default class VarNode extends Node {
@@ -18,15 +18,15 @@ export const Const: (node: Node, name?: string | null) => ShaderNodeObject<VarNo
18
18
 
19
19
  declare module "../tsl/TSLCore.js" {
20
20
  interface NodeElements {
21
- toVar: (node: NodeRepresentation, name?: string | null) => ShaderNodeObject<VarNode>;
22
- toConst: (node: NodeRepresentation, name?: string | null) => ShaderNodeObject<VarNode>;
21
+ toVar: (node: Node, name?: string | null) => ShaderNodeObject<VarNode>;
22
+ toConst: (node: Node, name?: string | null) => ShaderNodeObject<VarNode>;
23
23
  }
24
24
  }
25
25
 
26
26
  /**
27
27
  * @deprecated Use ".toVar()" instead.
28
28
  */
29
- export const temp: (node: NodeRepresentation, name?: string | null) => ShaderNodeObject<VarNode>;
29
+ export const temp: (node: Node, name?: string | null) => ShaderNodeObject<VarNode>;
30
30
 
31
31
  declare module "../tsl/TSLCore.js" {
32
32
  interface NodeElements {
@@ -1,5 +1,5 @@
1
1
  import { InterpolationSamplingMode, InterpolationSamplingType } from "../../constants.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
  import Node from "./Node.js";
4
4
  import NodeBuilder from "./NodeBuilder.js";
5
5
  import NodeVarying from "./NodeVarying.js";
@@ -18,9 +18,9 @@ export default class VaryingNode extends Node {
18
18
  setupVarying(builder: NodeBuilder): NodeVarying;
19
19
  }
20
20
 
21
- export const varying: (node: NodeRepresentation, name?: string) => ShaderNodeObject<VaryingNode>;
21
+ export const varying: (node: Node, name?: string) => ShaderNodeObject<VaryingNode>;
22
22
 
23
- export const vertexStage: (node: NodeRepresentation) => ShaderNodeObject<VaryingNode>;
23
+ export const vertexStage: (node: Node) => ShaderNodeObject<VaryingNode>;
24
24
 
25
25
  declare module "../tsl/TSLCore.js" {
26
26
  interface NodeElements {
@@ -1,32 +1,36 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
- export const blendBurn: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
4
+ export const blendBurn: (base: Node, blend: Node) => ShaderNodeObject<Node>;
5
5
 
6
- export const blendDodge: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
6
+ export const blendDodge: (base: Node, blend: Node) => ShaderNodeObject<Node>;
7
7
 
8
- export const blendScreen: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
8
+ export const blendScreen: (base: Node, blend: Node) => ShaderNodeObject<Node>;
9
9
 
10
- export const blendOverlay: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
10
+ export const blendOverlay: (base: Node, blend: Node) => ShaderNodeObject<Node>;
11
11
 
12
- export const blendColor: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
12
+ export const blendColor: (base: Node, blend: Node) => ShaderNodeObject<Node>;
13
+
14
+ export const premultiplyAlpha: (color: Node) => ShaderNodeObject<Node>;
15
+
16
+ export const unpremultiplyAlpha: (color: Node) => ShaderNodeObject<Node>;
13
17
 
14
18
  /**
15
19
  * @deprecated
16
20
  */
17
- export const burn: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
21
+ export const burn: (base: Node, blend: Node) => ShaderNodeObject<Node>;
18
22
 
19
23
  /**
20
24
  * @deprecated
21
25
  */
22
- export const dodge: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
26
+ export const dodge: (base: Node, blend: Node) => ShaderNodeObject<Node>;
23
27
 
24
28
  /**
25
29
  * @deprecated
26
30
  */
27
- export const screen: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
31
+ export const screen: (base: Node, blend: Node) => ShaderNodeObject<Node>;
28
32
 
29
33
  /**
30
34
  * @deprecated
31
35
  */
32
- export const overlay: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
36
+ export const overlay: (base: Node, blend: Node) => ShaderNodeObject<Node>;
@@ -1,5 +1,6 @@
1
+ import Node from "../core/Node.js";
1
2
  import TempNode from "../core/TempNode.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
4
 
4
5
  declare class BumpMapNode extends TempNode {
5
6
  textureNode: Node;
@@ -11,6 +12,6 @@ declare class BumpMapNode extends TempNode {
11
12
  export default BumpMapNode;
12
13
 
13
14
  export const bumpMap: (
14
- textureNode: NodeRepresentation,
15
- scaleNode?: NodeRepresentation | null,
15
+ textureNode: Node,
16
+ scaleNode?: Node | null,
16
17
  ) => ShaderNodeObject<BumpMapNode>;
@@ -1,30 +1,30 @@
1
1
  import Node from "../core/Node.js";
2
2
  import MathNode from "../math/MathNode.js";
3
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
4
4
 
5
- export const grayscale: (color: NodeRepresentation) => ShaderNodeObject<Node>;
5
+ export const grayscale: (color: Node) => ShaderNodeObject<Node>;
6
6
 
7
7
  export const saturation: (
8
- color: NodeRepresentation,
9
- adjustment?: NodeRepresentation,
8
+ color: Node,
9
+ adjustment?: Node | number,
10
10
  ) => ShaderNodeObject<Node>;
11
11
 
12
12
  export const vibrance: (
13
- color: NodeRepresentation,
14
- adjustment?: NodeRepresentation,
13
+ color: Node,
14
+ adjustment?: Node | number,
15
15
  ) => ShaderNodeObject<Node>;
16
16
 
17
17
  export const hue: (
18
- color: NodeRepresentation,
19
- adjustment?: NodeRepresentation,
18
+ color: Node,
19
+ adjustment?: Node | number,
20
20
  ) => ShaderNodeObject<Node>;
21
21
 
22
22
  export const luminance: (
23
- color: NodeRepresentation,
24
- luminanceCoefficients?: NodeRepresentation,
23
+ color: Node,
24
+ luminanceCoefficients?: Node,
25
25
  ) => ShaderNodeObject<MathNode>;
26
26
 
27
- export const threshold: (color: NodeRepresentation, thershold: NodeRepresentation) => ShaderNodeObject<MathNode>;
27
+ export const threshold: (color: Node, thershold: Node) => ShaderNodeObject<MathNode>;
28
28
 
29
29
  /**
30
30
  * Color Decision List (CDL) v1.2
@@ -47,10 +47,10 @@ export const threshold: (color: NodeRepresentation, thershold: NodeRepresentatio
47
47
  * @return Output, -Infinity < output < +Infinity
48
48
  */
49
49
  export const cdl: (
50
- color: NodeRepresentation,
51
- slope?: NodeRepresentation,
52
- offset?: NodeRepresentation,
53
- power?: NodeRepresentation,
54
- saturation?: NodeRepresentation,
55
- luminanceCoefficients?: NodeRepresentation,
50
+ color: Node,
51
+ slope?: Node,
52
+ offset?: Node,
53
+ power?: Node,
54
+ saturation?: Node,
55
+ luminanceCoefficients?: Node,
56
56
  ) => ShaderNodeObject<Node>;
@@ -1,6 +1,6 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
- export const sRGBTransferEOTF: (color: NodeRepresentation) => ShaderNodeObject<Node>;
4
+ export const sRGBTransferEOTF: (color: Node) => ShaderNodeObject<Node>;
5
5
 
6
- export const sRGBTransferOETF: (color: NodeRepresentation) => ShaderNodeObject<Node>;
6
+ export const sRGBTransferOETF: (color: Node) => ShaderNodeObject<Node>;
@@ -2,7 +2,7 @@ import { LinearSRGBColorSpace, SRGBColorSpace } from "../../constants.js";
2
2
  import Node from "../core/Node.js";
3
3
  import NodeBuilder from "../core/NodeBuilder.js";
4
4
  import TempNode from "../core/TempNode.js";
5
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
5
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
6
6
 
7
7
  export type WorkingOrOutputColorSpace = "WorkingColorSpace" | "OutputColorSpace";
8
8
 
@@ -27,33 +27,23 @@ export default class ColorSpaceNode extends TempNode {
27
27
  resolveColorSpace(nodeBuilder: NodeBuilder, colorSpace: WorkingOrOutputColorSpace): string;
28
28
  }
29
29
 
30
- export const toOutputColorSpace: (
31
- node: NodeRepresentation,
32
- ) => ShaderNodeObject<ColorSpaceNode>;
33
- export const toWorkingColorSpace: (
34
- node: NodeRepresentation,
35
- ) => ShaderNodeObject<ColorSpaceNode>;
36
-
37
30
  export const workingToColorSpace: (
38
- node: NodeRepresentation,
39
- colorSpace: string,
31
+ node: Node,
32
+ targetColorSpace: string,
40
33
  ) => ShaderNodeObject<ColorSpaceNode>;
41
34
  export const colorSpaceToWorking: (
42
- node: NodeRepresentation,
43
- colorSpace: string,
35
+ node: Node,
36
+ sourceColorSpace: string,
44
37
  ) => ShaderNodeObject<ColorSpaceNode>;
45
38
 
46
39
  export const convertColorSpace: (
47
- node: NodeRepresentation,
40
+ node: Node,
48
41
  sourceColorSpace: string,
49
42
  targetColorSpace: string,
50
43
  ) => ShaderNodeObject<ColorSpaceNode>;
51
44
 
52
45
  declare module "../tsl/TSLCore.js" {
53
46
  interface NodeElements {
54
- toOutputColorSpace: typeof toOutputColorSpace;
55
- toWorkingColorSpace: typeof toWorkingColorSpace;
56
-
57
47
  workingToColorSpace: typeof workingToColorSpace;
58
48
  colorSpaceToWorking: typeof colorSpaceToWorking;
59
49
  }
@@ -10,3 +10,4 @@ export default FrontFacingNode;
10
10
 
11
11
  export const frontFacing: ShaderNodeObject<FrontFacingNode>;
12
12
  export const faceDirection: ShaderNodeObject<Node>;
13
+ export const directionToFaceDirection: (direction: Node) => ShaderNodeObject<Node>;
@@ -1,5 +1,5 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  export default class PosterizeNode extends Node {
5
5
  sourceNode: Node;
@@ -9,6 +9,6 @@ export default class PosterizeNode extends Node {
9
9
  }
10
10
 
11
11
  export const posterize: (
12
- sourceNode: NodeRepresentation,
13
- stepsNode: NodeRepresentation,
12
+ sourceNode: Node,
13
+ stepsNode: Node | number,
14
14
  ) => ShaderNodeObject<PosterizeNode>;
@@ -1,7 +1,7 @@
1
1
  import { ToneMapping } from "../../constants.js";
2
2
  import Node from "../core/Node.js";
3
3
  import TempNode from "../core/TempNode.js";
4
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
5
5
 
6
6
  declare class RenderOutputNode extends TempNode {
7
7
  colorNode: Node;
@@ -16,7 +16,7 @@ declare class RenderOutputNode extends TempNode {
16
16
  export default RenderOutputNode;
17
17
 
18
18
  export const renderOutput: (
19
- color: NodeRepresentation,
19
+ color: Node,
20
20
  toneMapping?: ToneMapping | null,
21
21
  outputColorSpace?: string | null,
22
22
  ) => ShaderNodeObject<RenderOutputNode>;
@@ -41,13 +41,3 @@ export const viewportUV: ShaderNodeObject<Node>;
41
41
  * @deprecated "viewportResolution" is deprecated. Use "screenSize" instead.
42
42
  */
43
43
  export const viewportResolution: ShaderNodeObject<ScreenNode>;
44
-
45
- /**
46
- * @deprecated "viewportTopLeft" is deprecated. Use "viewportUV" instead.
47
- */
48
- export const viewportTopLeft: ShaderNodeObject<ScreenNode>;
49
-
50
- /**
51
- * @deprecated "viewportBottomLeft" is deprecated. Use "viewportUV.flipY()" instead.
52
- */
53
- export const viewportBottomLeft: ShaderNodeObject<ScreenNode>;
@@ -1,14 +1,14 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
- export const linearToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
4
+ export const linearToneMapping: (color: Node, exposure: Node) => ShaderNodeObject<Node>;
5
5
 
6
- export const reinhardToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
6
+ export const reinhardToneMapping: (color: Node, exposure: Node) => ShaderNodeObject<Node>;
7
7
 
8
- export const cineonToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
8
+ export const cineonToneMapping: (color: Node, exposure: Node) => ShaderNodeObject<Node>;
9
9
 
10
- export const acesFilmicToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
10
+ export const acesFilmicToneMapping: (color: Node, exposure: Node) => ShaderNodeObject<Node>;
11
11
 
12
- export const agxToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
12
+ export const agxToneMapping: (color: Node, exposure: Node) => ShaderNodeObject<Node>;
13
13
 
14
- export const neutralToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
14
+ export const neutralToneMapping: (color: Node, exposure: Node) => ShaderNodeObject<Node>;
@@ -2,7 +2,7 @@ import { ToneMapping } from "../../constants.js";
2
2
  import RendererReferenceNode from "../accessors/RendererReferenceNode.js";
3
3
  import Node from "../core/Node.js";
4
4
  import TempNode from "../core/TempNode.js";
5
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
5
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
6
6
 
7
7
  declare class ToneMappingNode extends TempNode {
8
8
  toneMapping: ToneMapping;
@@ -16,17 +16,17 @@ export default ToneMappingNode;
16
16
 
17
17
  export const toneMapping: (
18
18
  mapping: ToneMapping,
19
- exposure: NodeRepresentation,
20
- color?: NodeRepresentation,
19
+ exposure: Node,
20
+ color?: Node,
21
21
  ) => ShaderNodeObject<ToneMappingNode>;
22
22
  export const toneMappingExposure: ShaderNodeObject<RendererReferenceNode>;
23
23
 
24
24
  declare module "../tsl/TSLCore.js" {
25
25
  interface NodeElements {
26
26
  toneMapping: (
27
- color: NodeRepresentation,
28
- mapping?: NodeRepresentation,
29
- exposure?: NodeRepresentation,
27
+ color: Node,
28
+ mapping?: ToneMapping,
29
+ exposure?: Node,
30
30
  ) => ShaderNodeObject<ToneMappingNode>;
31
31
  }
32
32
  }
@@ -1,5 +1,5 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
  import ViewportTextureNode from "./ViewportTextureNode.js";
4
4
 
5
5
  declare class ViewportDepthTextureNode extends ViewportTextureNode {
@@ -9,6 +9,6 @@ declare class ViewportDepthTextureNode extends ViewportTextureNode {
9
9
  export default ViewportDepthTextureNode;
10
10
 
11
11
  export const viewportDepthTexture: (
12
- uvNode?: NodeRepresentation,
13
- levelNode?: NodeRepresentation,
12
+ uvNode?: Node,
13
+ levelNode?: Node,
14
14
  ) => ShaderNodeObject<ViewportDepthTextureNode>;
@@ -1,26 +1,26 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
- export const rangeFogFactor: (near: NodeRepresentation, far: NodeRepresentation) => ShaderNodeObject<Node>;
4
+ export const rangeFogFactor: (near: Node | number, far: Node | number) => ShaderNodeObject<Node>;
5
5
 
6
- export const densityFogFactor: (density: NodeRepresentation) => ShaderNodeObject<Node>;
6
+ export const densityFogFactor: (density: Node) => ShaderNodeObject<Node>;
7
7
 
8
- export const fog: (color: NodeRepresentation, factor: NodeRepresentation) => ShaderNodeObject<Node>;
8
+ export const fog: (color: Node, factor: Node) => ShaderNodeObject<Node>;
9
9
 
10
10
  /**
11
11
  * @deprecated
12
12
  */
13
13
  export function rangeFog(
14
- color: NodeRepresentation,
15
- near: NodeRepresentation,
16
- far: NodeRepresentation,
14
+ color: Node,
15
+ near: Node,
16
+ far: Node,
17
17
  ): ShaderNodeObject<Node>;
18
18
 
19
19
  /**
20
20
  * @deprecated
21
21
  */
22
22
  export function densityFog(
23
- color: NodeRepresentation,
24
- near: NodeRepresentation,
25
- far: NodeRepresentation,
23
+ color: Node,
24
+ near: Node,
25
+ far: Node,
26
26
  ): ShaderNodeObject<Node>;