@types/three 0.177.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 (178) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/capabilities/WebGL.d.ts +0 -11
  3. three/examples/jsm/controls/TransformControls.d.ts +16 -1
  4. three/examples/jsm/helpers/TextureHelper.d.ts +2 -2
  5. three/examples/jsm/helpers/TextureHelperGPU.d.ts +2 -2
  6. three/examples/jsm/loaders/SVGLoader.d.ts +1 -1
  7. three/examples/jsm/physics/RapierPhysics.d.ts +1 -0
  8. three/examples/jsm/transpiler/AST.d.ts +77 -26
  9. three/examples/jsm/transpiler/TSLEncoder.d.ts +9 -3
  10. three/examples/jsm/tsl/display/AnamorphicNode.d.ts +4 -4
  11. three/examples/jsm/tsl/display/BleachBypass.d.ts +2 -2
  12. three/examples/jsm/tsl/display/BloomNode.d.ts +2 -2
  13. three/examples/jsm/tsl/display/ChromaticAberrationNode.d.ts +20 -0
  14. three/examples/jsm/tsl/display/DenoiseNode.d.ts +4 -4
  15. three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +6 -6
  16. three/examples/jsm/tsl/display/DotScreenNode.d.ts +2 -2
  17. three/examples/jsm/tsl/display/FXAANode.d.ts +3 -3
  18. three/examples/jsm/tsl/display/FilmNode.d.ts +4 -4
  19. three/examples/jsm/tsl/display/GTAONode.d.ts +3 -3
  20. three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +5 -5
  21. three/examples/jsm/tsl/display/LensflareNode.d.ts +8 -8
  22. three/examples/jsm/tsl/display/Lut3DNode.d.ts +4 -4
  23. three/examples/jsm/tsl/display/MotionBlur.d.ts +4 -4
  24. three/examples/jsm/tsl/display/OutlineNode.d.ts +3 -3
  25. three/examples/jsm/tsl/display/RGBShiftNode.d.ts +3 -3
  26. three/examples/jsm/tsl/display/SMAANode.d.ts +3 -3
  27. three/examples/jsm/tsl/display/SSRNode.d.ts +5 -5
  28. three/examples/jsm/tsl/display/Sepia.d.ts +2 -2
  29. three/examples/jsm/tsl/display/SobelOperatorNode.d.ts +3 -3
  30. three/examples/jsm/tsl/display/TransitionNode.d.ts +4 -4
  31. three/examples/jsm/tsl/display/hashBlur.d.ts +5 -5
  32. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +5 -5
  33. three/package.json +2 -2
  34. three/src/Three.TSL.d.ts +9 -16
  35. three/src/Three.WebGPU.d.ts +2 -0
  36. three/src/constants.d.ts +13 -5
  37. three/src/core/BufferGeometry.d.ts +6 -1
  38. three/src/core/GLBufferAttribute.d.ts +18 -1
  39. three/src/helpers/AxesHelper.d.ts +3 -1
  40. three/src/materials/LineBasicMaterial.d.ts +66 -34
  41. three/src/materials/LineDashedMaterial.d.ts +41 -21
  42. three/src/materials/Material.d.ts +408 -398
  43. three/src/materials/MeshBasicMaterial.d.ts +101 -62
  44. three/src/materials/MeshDepthMaterial.d.ts +71 -32
  45. three/src/materials/MeshDistanceMaterial.d.ts +65 -29
  46. three/src/materials/MeshLambertMaterial.d.ts +179 -103
  47. three/src/materials/MeshMatcapMaterial.d.ts +97 -55
  48. three/src/materials/MeshNormalMaterial.d.ts +76 -41
  49. three/src/materials/MeshPhongMaterial.d.ts +164 -100
  50. three/src/materials/MeshPhysicalMaterial.d.ts +164 -116
  51. three/src/materials/MeshStandardMaterial.d.ts +178 -91
  52. three/src/materials/MeshToonMaterial.d.ts +130 -81
  53. three/src/materials/PointsMaterial.d.ts +77 -30
  54. three/src/materials/RawShaderMaterial.d.ts +12 -7
  55. three/src/materials/ShaderMaterial.d.ts +186 -98
  56. three/src/materials/ShadowMaterial.d.ts +49 -23
  57. three/src/materials/SpriteMaterial.d.ts +62 -33
  58. three/src/materials/nodes/Line2NodeMaterial.d.ts +87 -40
  59. three/src/materials/nodes/LineBasicNodeMaterial.d.ts +35 -16
  60. three/src/materials/nodes/LineDashedNodeMaterial.d.ts +75 -20
  61. three/src/materials/nodes/MeshBasicNodeMaterial.d.ts +49 -30
  62. three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +49 -42
  63. three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts +38 -26
  64. three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +36 -22
  65. three/src/materials/nodes/MeshPhongNodeMaterial.d.ts +68 -48
  66. three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts +240 -65
  67. three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +99 -3
  68. three/src/materials/nodes/MeshStandardNodeMaterial.d.ts +83 -47
  69. three/src/materials/nodes/MeshToonNodeMaterial.d.ts +42 -36
  70. three/src/materials/nodes/NodeMaterial.d.ts +417 -56
  71. three/src/materials/nodes/NodeMaterials.d.ts +3 -2
  72. three/src/materials/nodes/PointsNodeMaterial.d.ts +31 -7
  73. three/src/materials/nodes/ShadowNodeMaterial.d.ts +38 -11
  74. three/src/materials/nodes/SpriteNodeMaterial.d.ts +68 -20
  75. three/src/materials/nodes/VolumeNodeMaterial.d.ts +50 -14
  76. three/src/math/Color.d.ts +1 -1
  77. three/src/nodes/Nodes.d.ts +1 -3
  78. three/src/nodes/TSL.d.ts +4 -3
  79. three/src/nodes/accessors/AccessorsUtils.d.ts +3 -3
  80. three/src/nodes/accessors/Bitangent.d.ts +0 -2
  81. three/src/nodes/accessors/CubeTextureNode.d.ts +7 -7
  82. three/src/nodes/accessors/Normal.d.ts +19 -5
  83. three/src/nodes/accessors/ReferenceBaseNode.d.ts +1 -1
  84. three/src/nodes/accessors/StorageBufferNode.d.ts +3 -2
  85. three/src/nodes/accessors/StorageTextureNode.d.ts +5 -5
  86. three/src/nodes/accessors/Tangent.d.ts +0 -2
  87. three/src/nodes/accessors/TangentUtils.d.ts +22 -0
  88. three/src/nodes/accessors/Texture3DNode.d.ts +5 -4
  89. three/src/nodes/accessors/TextureBicubic.d.ts +4 -2
  90. three/src/nodes/accessors/TextureNode.d.ts +16 -16
  91. three/src/nodes/accessors/TextureSizeNode.d.ts +3 -3
  92. three/src/nodes/accessors/UniformArrayNode.d.ts +2 -7
  93. three/src/nodes/code/FunctionCallNode.d.ts +3 -1
  94. three/src/nodes/code/FunctionNode.d.ts +2 -2
  95. three/src/nodes/code/ScriptableNode.d.ts +2 -2
  96. three/src/nodes/core/AssignNode.d.ts +2 -2
  97. three/src/nodes/core/AttributeNode.d.ts +1 -1
  98. three/src/nodes/core/BypassNode.d.ts +2 -2
  99. three/src/nodes/core/CacheNode.d.ts +0 -2
  100. three/src/nodes/core/ContextNode.d.ts +3 -3
  101. three/src/nodes/core/StackNode.d.ts +3 -13
  102. three/src/nodes/core/SubBuildNode.d.ts +15 -0
  103. three/src/nodes/core/VarNode.d.ts +4 -4
  104. three/src/nodes/core/VaryingNode.d.ts +3 -3
  105. three/src/nodes/display/BlendModes.d.ts +12 -12
  106. three/src/nodes/display/BumpMapNode.d.ts +4 -3
  107. three/src/nodes/display/ColorAdjustment.d.ts +17 -17
  108. three/src/nodes/display/ColorSpaceFunctions.d.ts +3 -3
  109. three/src/nodes/display/ColorSpaceNode.d.ts +4 -4
  110. three/src/nodes/display/FrontFacingNode.d.ts +1 -0
  111. three/src/nodes/display/PosterizeNode.d.ts +3 -3
  112. three/src/nodes/display/RenderOutputNode.d.ts +2 -2
  113. three/src/nodes/display/ScreenNode.d.ts +0 -10
  114. three/src/nodes/display/ToneMappingFunctions.d.ts +7 -7
  115. three/src/nodes/display/ToneMappingNode.d.ts +6 -6
  116. three/src/nodes/display/ViewportDepthTextureNode.d.ts +3 -3
  117. three/src/nodes/fog/Fog.d.ts +10 -10
  118. three/src/nodes/functions/BSDF/Schlick_to_F0.d.ts +4 -4
  119. three/src/nodes/functions/material/getAlphaHashThreshold.d.ts +2 -2
  120. three/src/nodes/functions/material/getParallaxCorrectNormal.d.ts +4 -4
  121. three/src/nodes/geometry/RangeNode.d.ts +9 -2
  122. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +20 -20
  123. three/src/nodes/gpgpu/ComputeNode.d.ts +2 -2
  124. three/src/nodes/lighting/PointShadowNode.d.ts +11 -11
  125. three/src/nodes/lighting/ShadowFilterNode.d.ts +11 -11
  126. three/src/nodes/materialx/MaterialXNodes.d.ts +59 -59
  127. three/src/nodes/materialx/lib/mx_hsv.d.ts +3 -3
  128. three/src/nodes/materialx/lib/mx_noise.d.ts +206 -206
  129. three/src/nodes/materialx/lib/mx_transform_color.d.ts +2 -2
  130. three/src/nodes/math/ConditionalNode.d.ts +4 -19
  131. three/src/nodes/math/Hash.d.ts +2 -2
  132. three/src/nodes/math/MathNode.d.ts +21 -17
  133. three/src/nodes/math/OperatorNode.d.ts +41 -52
  134. three/src/nodes/math/TriNoise3D.d.ts +6 -6
  135. three/src/nodes/pmrem/PMREMNode.d.ts +3 -3
  136. three/src/nodes/pmrem/PMREMUtils.d.ts +20 -20
  137. three/src/nodes/procedural/Checker.d.ts +2 -2
  138. three/src/nodes/shapes/Shapes.d.ts +2 -2
  139. three/src/nodes/tsl/TSLBase.d.ts +1 -0
  140. three/src/nodes/tsl/TSLCore.d.ts +176 -76
  141. three/src/nodes/utils/CubeMapNode.d.ts +2 -2
  142. three/src/nodes/utils/DebugNode.d.ts +2 -2
  143. three/src/nodes/utils/Discard.d.ts +2 -2
  144. three/src/nodes/utils/EquirectUV.d.ts +4 -0
  145. three/src/nodes/utils/LoopNode.d.ts +2 -7
  146. three/src/nodes/utils/MatcapUV.d.ts +4 -0
  147. three/src/nodes/utils/Oscillators.d.ts +5 -5
  148. three/src/nodes/utils/Packing.d.ts +3 -3
  149. three/src/nodes/utils/PostProcessingUtils.d.ts +9 -9
  150. three/src/nodes/utils/RTTNode.d.ts +3 -3
  151. three/src/nodes/utils/RemapNode.d.ts +9 -9
  152. three/src/nodes/utils/RotateNode.d.ts +3 -3
  153. three/src/nodes/utils/SampleNode.d.ts +16 -0
  154. three/src/nodes/utils/SpriteSheetUVNode.d.ts +4 -4
  155. three/src/nodes/utils/SpriteUtils.d.ts +2 -2
  156. three/src/nodes/utils/StorageArrayElementNode.d.ts +4 -3
  157. three/src/nodes/utils/TriplanarTextures.d.ts +20 -0
  158. three/src/nodes/utils/UVUtils.d.ts +8 -7
  159. three/src/nodes/utils/ViewportUtils.d.ts +2 -2
  160. three/src/objects/LOD.d.ts +1 -1
  161. three/src/renderers/WebGLRenderer.d.ts +1 -1
  162. three/src/renderers/common/Backend.d.ts +3 -3
  163. three/src/renderers/common/RenderObject.d.ts +10 -2
  164. three/src/renderers/common/Renderer.d.ts +5 -5
  165. three/src/renderers/common/Storage3DTexture.d.ts +40 -0
  166. three/src/renderers/common/StorageArrayTexture.d.ts +29 -0
  167. three/src/renderers/common/Textures.d.ts +2 -2
  168. three/src/renderers/common/XRRenderTarget.d.ts +3 -2
  169. three/src/renderers/common/nodes/NodeLibrary.d.ts +4 -9
  170. three/src/renderers/common/nodes/NodeSampledTexture.d.ts +1 -1
  171. three/src/renderers/common/nodes/Nodes.d.ts +1 -1
  172. three/src/renderers/webgpu/WebGPURenderer.d.ts +3 -0
  173. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +65 -0
  174. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +9 -0
  175. three/src/nodes/utils/EquirectUVNode.d.ts +0 -8
  176. three/src/nodes/utils/MatcapUVNode.d.ts +0 -8
  177. three/src/nodes/utils/TriplanarTexturesNode.d.ts +0 -36
  178. three/src/renderers/common/nodes/StandardNodeLibrary.d.ts +0 -5
@@ -1,28 +1,76 @@
1
- import { Color } from "../../math/Color.js";
2
1
  import Node from "../../nodes/core/Node.js";
3
- import { Texture } from "../../textures/Texture.js";
4
- import { SpriteMaterialParameters } from "../SpriteMaterial.js";
5
- import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
6
-
7
- export interface SpriteNodeMaterialParameters extends NodeMaterialParameters, SpriteMaterialParameters {
8
- rotationNode?: Node | null | undefined;
9
- scaleNode?: Node | null | undefined;
10
- }
11
-
12
- export default class SpriteNodeMaterial extends NodeMaterial {
13
- isSpriteNodeMaterial: true;
2
+ import NodeBuilder from "../../nodes/core/NodeBuilder.js";
3
+ import { MapColorPropertiesToColorRepresentations } from "../Material.js";
4
+ import { SpriteMaterialParameters, SpriteMaterialProperties } from "../SpriteMaterial.js";
5
+ import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js";
14
6
 
7
+ export interface SpriteNodeMaterialNodeProperties extends NodeMaterialNodeProperties {
8
+ /**
9
+ * The rotation of sprite materials is by default inferred from the `rotation`,
10
+ * property. This node property allows to overwrite the default and define
11
+ * the rotation with a node instead.
12
+ *
13
+ * If you don't want to overwrite the rotation but modify the existing
14
+ * value instead, use {@link materialRotation}.
15
+ *
16
+ * @default null
17
+ */
15
18
  rotationNode: Node | null;
19
+ /**
20
+ * This node property provides an additional way to scale sprites next to
21
+ * `Object3D.scale`. The scale transformation based in `Object3D.scale`
22
+ * is multiplied with the scale value of this node in the vertex shader.
23
+ *
24
+ * @default null
25
+ */
16
26
  scaleNode: Node | null;
27
+ set sizeAttenuation(value: boolean);
28
+ /**
29
+ * Whether to use size attenuation or not.
30
+ *
31
+ * @type {boolean}
32
+ * @default true
33
+ */
34
+ get sizeAttenuation(): boolean;
35
+ }
17
36
 
18
- // Properties from SpriteMaterial
19
- readonly isSpriteMaterial: true;
20
- color: Color;
21
- map: Texture | null;
22
- alphaMap: Texture | null;
23
- rotation: number;
24
- sizeAttenuation: boolean;
25
- fog: boolean;
37
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
38
+ export interface SpriteNodeMaterialParameters
39
+ extends
40
+ Partial<MapColorPropertiesToColorRepresentations<SpriteNodeMaterialNodeProperties>>,
41
+ SpriteMaterialParameters
42
+ {}
26
43
 
44
+ /**
45
+ * Node material version of {@link SpriteMaterial}.
46
+ */
47
+ declare class SpriteNodeMaterial extends NodeMaterial {
48
+ /**
49
+ * Constructs a new sprite node material.
50
+ *
51
+ * @param {Object} [parameters] - The configuration parameter.
52
+ */
27
53
  constructor(parameters?: SpriteNodeMaterialParameters);
54
+ readonly isSpriteMaterial: boolean;
55
+ /**
56
+ * This flag can be used for type testing.
57
+ *
58
+ * @type {boolean}
59
+ * @readonly
60
+ * @default true
61
+ */
62
+ readonly isSpriteNodeMaterial: boolean;
63
+ /**
64
+ * Setups the position node in view space. This method implements
65
+ * the sprite specific vertex shader.
66
+ *
67
+ * @param {NodeBuilder} builder - The current node builder.
68
+ * @return {Node<vec3>} The position in view space.
69
+ */
70
+ setupPositionView(builder: NodeBuilder): Node;
28
71
  }
72
+
73
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
74
+ interface SpriteNodeMaterial extends SpriteNodeMaterialNodeProperties, SpriteMaterialProperties {}
75
+
76
+ export default SpriteNodeMaterial;
@@ -1,22 +1,58 @@
1
- import FunctionNode from "../../nodes/code/FunctionNode.js";
2
1
  import Node from "../../nodes/core/Node.js";
2
+ import VolumetricLightingModel from "../../nodes/functions/VolumetricLightingModel.js";
3
3
  import { ShaderNodeObject } from "../../nodes/tsl/TSLCore.js";
4
- import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
5
-
6
- export interface VolumeNodeMaterialParameters extends NodeMaterialParameters {
7
- steps?: number | undefined;
8
-
9
- scatteringNode?: Node | null | undefined;
10
- }
11
-
12
- export default class VolumeNodeMaterial extends NodeMaterial {
13
- readonly isVolumeNodeMaterial: true;
4
+ import { MapColorPropertiesToColorRepresentations, MaterialParameters, MaterialProperties } from "../Material.js";
5
+ import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js";
14
6
 
7
+ export interface VolumeNodeMaterialNodeProperties extends NodeMaterialNodeProperties {
8
+ /**
9
+ * Number of steps used for raymarching.
10
+ *
11
+ * @default 25
12
+ */
15
13
  steps: number;
16
-
14
+ /**
15
+ * Offsets the distance a ray has been traveled through a volume.
16
+ * Can be used to implement dithering to reduce banding.
17
+ *
18
+ * @default null
19
+ */
20
+ offsetNode: Node;
21
+ /**
22
+ * Node used for scattering calculations.
23
+ *
24
+ * @default null
25
+ */
17
26
  scatteringNode: (params: { positionRay: ShaderNodeObject<Node> }) => Node | null;
27
+ }
18
28
 
19
- offsetNode?: Node | undefined;
29
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
30
+ export interface VolumeNodeMaterialParameters
31
+ extends Partial<MapColorPropertiesToColorRepresentations<VolumeNodeMaterialNodeProperties>>, MaterialParameters
32
+ {}
20
33
 
21
- constructor(parameters?: NodeMaterialParameters);
34
+ /**
35
+ * Volume node material.
36
+ *
37
+ * @augments NodeMaterial
38
+ */
39
+ declare class VolumeNodeMaterial extends NodeMaterial {
40
+ /**
41
+ * Constructs a new volume node material.
42
+ *
43
+ * @param {Object} [parameters] - The configuration parameter.
44
+ */
45
+ constructor(parameters?: VolumeNodeMaterialParameters);
46
+ /**
47
+ * This flag can be used for type testing.
48
+ *
49
+ * @default true
50
+ */
51
+ readonly isVolumeNodeMaterial: boolean;
52
+ setupLightingModel(): VolumetricLightingModel;
22
53
  }
54
+
55
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
56
+ interface VolumeNodeMaterial extends VolumeNodeMaterialNodeProperties, MaterialProperties {}
57
+
58
+ export default VolumeNodeMaterial;
three/src/math/Color.d.ts CHANGED
@@ -302,7 +302,7 @@ export class Color {
302
302
  getHex(colorSpace?: string): number;
303
303
 
304
304
  /**
305
- * Returns the string formated hexadecimal value of this color.
305
+ * Returns the string formatted hexadecimal value of this color.
306
306
  */
307
307
  getHexString(colorSpace?: string): string;
308
308
 
@@ -39,6 +39,7 @@ export { default as PropertyNode } from "./core/PropertyNode.js";
39
39
  export { default as StackNode } from "./core/StackNode.js";
40
40
  export { default as StructNode } from "./core/StructNode.js";
41
41
  export { default as StructTypeNode } from "./core/StructTypeNode.js";
42
+ export { default as SubBuildNode } from "./core/SubBuildNode.js";
42
43
  export { default as TempNode } from "./core/TempNode.js";
43
44
  export { default as UniformGroupNode } from "./core/UniformGroupNode.js";
44
45
  export { default as UniformNode } from "./core/UniformNode.js";
@@ -52,11 +53,9 @@ export { NodeUtils };
52
53
  export { default as ArrayElementNode } from "./utils/ArrayElementNode.js";
53
54
  export { default as ConvertNode } from "./utils/ConvertNode.js";
54
55
  export { default as DebugNode } from "./utils/DebugNode.js";
55
- export { default as EquirectUVNode } from "./utils/EquirectUVNode.js";
56
56
  export { default as FunctionOverloadingNode } from "./utils/FunctionOverloadingNode.js";
57
57
  export { default as JoinNode } from "./utils/JoinNode.js";
58
58
  export { default as LoopNode } from "./utils/LoopNode.js";
59
- export { default as MatcapUVNode } from "./utils/MatcapUVNode.js";
60
59
  export { default as MaxMipLevelNode } from "./utils/MaxMipLevelNode.js";
61
60
  export { default as MemberNode } from "./utils/MemberNode.js";
62
61
  export { default as ReflectorNode, ReflectorNodeParameters } from "./utils/ReflectorNode.js";
@@ -67,7 +66,6 @@ export { default as SetNode } from "./utils/SetNode.js";
67
66
  export { default as SplitNode } from "./utils/SplitNode.js";
68
67
  export { default as SpriteSheetUVNode } from "./utils/SpriteSheetUVNode.js";
69
68
  export { default as StorageArrayElementNode } from "./utils/StorageArrayElementNode.js";
70
- export { default as TriplanarTexturesNode } from "./utils/TriplanarTexturesNode.js";
71
69
 
72
70
  // accessors
73
71
  export { default as BatchNode } from "./accessors/BatchNode.js";
three/src/nodes/TSL.d.ts CHANGED
@@ -24,10 +24,10 @@ export * from "./math/MathUtils.js";
24
24
  export * from "./math/TriNoise3D.js";
25
25
 
26
26
  // utils
27
- export * from "./utils/EquirectUVNode.js";
27
+ export * from "./utils/EquirectUV.js";
28
28
  export * from "./utils/FunctionOverloadingNode.js";
29
29
  export * from "./utils/LoopNode.js";
30
- export * from "./utils/MatcapUVNode.js";
30
+ export * from "./utils/MatcapUV.js";
31
31
  export * from "./utils/MaxMipLevelNode.js";
32
32
  export * from "./utils/Oscillators.js";
33
33
  export * from "./utils/Packing.js";
@@ -36,10 +36,11 @@ export * from "./utils/ReflectorNode.js";
36
36
  export * from "./utils/RemapNode.js";
37
37
  export * from "./utils/RotateNode.js";
38
38
  export * from "./utils/RTTNode.js";
39
+ export * from "./utils/SampleNode.js";
39
40
  export * from "./utils/SpriteSheetUVNode.js";
40
41
  export * from "./utils/SpriteUtils.js";
41
42
  export * from "./utils/Timer.js";
42
- export * from "./utils/TriplanarTexturesNode.js";
43
+ export * from "./utils/TriplanarTextures.js";
43
44
  export * from "./utils/UVUtils.js";
44
45
  export * from "./utils/ViewportUtils.js";
45
46
 
@@ -1,9 +1,9 @@
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 const TBNViewMatrix: ShaderNodeObject<Node>;
5
5
 
6
6
  export const parallaxDirection: ShaderNodeObject<Node>;
7
- export const parallaxUV: (uv: ShaderNodeObject<Node>, scale: NodeRepresentation) => ShaderNodeObject<Node>;
7
+ export const parallaxUV: (uv: ShaderNodeObject<Node>, scale: Node) => ShaderNodeObject<Node>;
8
8
 
9
- export const transformedBentNormalView: ShaderNodeObject<Node>;
9
+ export const bentNormalView: ShaderNodeObject<Node>;
@@ -5,5 +5,3 @@ export const bitangentGeometry: ShaderNodeObject<MathNode>;
5
5
  export const bitangentLocal: ShaderNodeObject<MathNode>;
6
6
  export const bitangentView: ShaderNodeObject<MathNode>;
7
7
  export const bitangentWorld: ShaderNodeObject<MathNode>;
8
- export const transformedBitangentView: ShaderNodeObject<MathNode>;
9
- export const transformedBitangentWorld: ShaderNodeObject<MathNode>;
@@ -1,6 +1,6 @@
1
1
  import { CubeTexture } from "../../textures/CubeTexture.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 TextureNode from "./TextureNode.js";
5
5
 
6
6
  declare class CubeTextureNode extends TextureNode {
@@ -22,16 +22,16 @@ export default CubeTextureNode;
22
22
 
23
23
  export const cubeTextureBase: (
24
24
  value: CubeTexture,
25
- uvNode?: NodeRepresentation,
26
- levelNode?: NodeRepresentation,
27
- biasNode?: NodeRepresentation,
25
+ uvNode?: Node,
26
+ levelNode?: Node,
27
+ biasNode?: Node,
28
28
  ) => ShaderNodeObject<CubeTextureNode>;
29
29
 
30
30
  export const cubeTexture: (
31
31
  value?: CubeTexture,
32
- uvNode?: NodeRepresentation | null,
33
- levelNode?: NodeRepresentation | null,
34
- biasNode?: NodeRepresentation | null,
32
+ uvNode?: Node | null,
33
+ levelNode?: Node | null,
34
+ biasNode?: Node | null,
35
35
  ) => ShaderNodeObject<CubeTextureNode>;
36
36
 
37
37
  export const uniformCubeTexture: (
@@ -1,4 +1,3 @@
1
- import { Matrix4 } from "../../math/Matrix4.js";
2
1
  import AttributeNode from "../core/AttributeNode.js";
3
2
  import Node from "../core/Node.js";
4
3
  import VarNode from "../core/VarNode.js";
@@ -10,16 +9,31 @@ export const normalLocal: ShaderNodeObject<VarNode>;
10
9
 
11
10
  export const normalFlat: ShaderNodeObject<VarNode>;
12
11
 
12
+ export const normalViewGeometry: ShaderNodeObject<VarNode>;
13
+
14
+ export const normalWorldGeometry: ShaderNodeObject<VarNode>;
15
+
13
16
  export const normalView: ShaderNodeObject<VarNode>;
14
17
 
15
18
  export const normalWorld: ShaderNodeObject<VarNode>;
16
19
 
20
+ export const clearcoatNormalView: ShaderNodeObject<VarNode>;
21
+
22
+ export const transformNormal: (normal: Node, matrix?: Node) => ShaderNodeObject<Node>;
23
+
24
+ export const transformNormalToView: (normal: Node) => ShaderNodeObject<Node>;
25
+
26
+ /**
27
+ * @deprecated since r178. Use `normalView` instead.
28
+ */
17
29
  export const transformedNormalView: ShaderNodeObject<VarNode>;
18
30
 
31
+ /**
32
+ * @deprecated since r178. Use `normalWorld` instead.
33
+ */
19
34
  export const transformedNormalWorld: ShaderNodeObject<VarNode>;
20
35
 
36
+ /**
37
+ * @deprecated since r178. Use `clearcoatNormalView` instead.
38
+ */
21
39
  export const transformedClearcoatNormalView: ShaderNodeObject<VarNode>;
22
-
23
- export const transformNormal: (normal: Node, matrix?: Node) => ShaderNodeObject<Node>;
24
-
25
- export const transformNormalToView: (normal: 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
  declare class ReferenceBaseNode<T> extends Node {
5
5
  property: string;
@@ -1,9 +1,10 @@
1
1
  import StorageBufferAttribute from "../../renderers/common/StorageBufferAttribute.js";
2
2
  import StorageInstancedBufferAttribute from "../../renderers/common/StorageInstancedBufferAttribute.js";
3
3
  import { NodeAccess } from "../core/constants.js";
4
+ import Node from "../core/Node.js";
4
5
  import { Struct } from "../core/StructNode.js";
5
6
  import StructTypeNode from "../core/StructTypeNode.js";
6
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
7
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
7
8
  import StorageArrayElementNode from "../utils/StorageArrayElementNode.js";
8
9
  import BufferNode from "./BufferNode.js";
9
10
 
@@ -24,7 +25,7 @@ export default class StorageBufferNode extends BufferNode<StorageBufferAttribute
24
25
  bufferCount?: number,
25
26
  );
26
27
 
27
- element(indexNode: NodeRepresentation): ShaderNodeObject<StorageArrayElementNode>;
28
+ element(indexNode: Node | number): ShaderNodeObject<StorageArrayElementNode>;
28
29
 
29
30
  setPBO(value: boolean): this;
30
31
 
@@ -2,7 +2,7 @@ import { Texture } from "../../textures/Texture.js";
2
2
  import { NodeAccess } from "../core/constants.js";
3
3
  import Node from "../core/Node.js";
4
4
  import NodeBuilder from "../core/NodeBuilder.js";
5
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
5
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
6
6
  import TextureNode from "./TextureNode.js";
7
7
 
8
8
  export default class StorageTextureNode extends TextureNode {
@@ -31,12 +31,12 @@ export default class StorageTextureNode extends TextureNode {
31
31
 
32
32
  export const storageTexture: (
33
33
  value: Texture,
34
- uvNode?: NodeRepresentation | null,
35
- storeNode?: NodeRepresentation,
34
+ uvNode?: Node | null,
35
+ storeNode?: Node,
36
36
  ) => ShaderNodeObject<StorageTextureNode>;
37
37
 
38
38
  export const textureStore: (
39
39
  value: Texture,
40
- uvNode?: NodeRepresentation | null,
41
- storeNode?: NodeRepresentation,
40
+ uvNode?: Node | null,
41
+ storeNode?: Node,
42
42
  ) => ShaderNodeObject<StorageTextureNode>;
@@ -8,5 +8,3 @@ export const tangentGeometry: ShaderNodeObject<AttributeNode>;
8
8
  export const tangentLocal: ShaderNodeObject<VaryingNode>;
9
9
  export const tangentView: ShaderNodeObject<MathNode>;
10
10
  export const tangentWorld: ShaderNodeObject<MathNode>;
11
- export const transformedTangentView: ShaderNodeObject<VarNode>;
12
- export const transformedTangentWorld: ShaderNodeObject<MathNode>;
@@ -0,0 +1,22 @@
1
+ import Node from "../core/Node.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ /**
5
+ * Tangent vector in view space, computed dynamically from geometry and UV derivatives.
6
+ * Useful for normal mapping without precomputed tangents.
7
+ *
8
+ * Reference: http://www.thetenthplanet.de/archives/1180
9
+ *
10
+ * @tsl
11
+ */
12
+ export const tangentViewFrame: ShaderNodeObject<Node>;
13
+
14
+ /**
15
+ * Bitangent vector in view space, computed dynamically from geometry and UV derivatives.
16
+ * Complements the tangentViewFrame for constructing the tangent space basis.
17
+ *
18
+ * Reference: http://www.thetenthplanet.de/archives/1180
19
+ *
20
+ * @tsl
21
+ */
22
+ export const bitangentViewFrame: ShaderNodeObject<Node>;
@@ -1,17 +1,18 @@
1
- import { CubeTexture } from "../../textures/CubeTexture.js";
2
1
  import { Texture } from "../../textures/Texture.js";
3
2
  import Node from "../core/Node.js";
4
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
5
4
  import TextureNode from "./TextureNode.js";
6
5
 
7
6
  export default class Texture3DNode extends TextureNode {
8
7
  readonly isTexture3DNode: true;
9
8
 
10
9
  constructor(value: Texture, uvNode?: ShaderNodeObject<Node> | null, levelNode?: ShaderNodeObject<Node> | null);
10
+
11
+ normal(uvNode: Node): ShaderNodeObject<Node>;
11
12
  }
12
13
 
13
14
  export const texture3D: (
14
15
  value: Texture,
15
- uvNode?: NodeRepresentation | null,
16
- levelNode?: NodeRepresentation | null,
16
+ uvNode?: Node | null,
17
+ levelNode?: Node | number | null,
17
18
  ) => ShaderNodeObject<Texture3DNode>;
@@ -1,4 +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 textureBicubic: (textureNode: Node, lodNode?: NodeRepresentation) => ShaderNodeObject<Node>;
4
+ export const textureBicubicLevel: (textureNode: Node, lodNode: Node) => ShaderNodeObject<Node>;
5
+
6
+ export const textureBicubic: (textureNode: Node, strength: Node) => ShaderNodeObject<Node>;
@@ -1,7 +1,7 @@
1
1
  import { Texture } from "../../textures/Texture.js";
2
2
  import Node from "../core/Node.js";
3
3
  import UniformNode from "../core/UniformNode.js";
4
- import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
5
5
 
6
6
  export default class TextureNode extends UniformNode<Texture> {
7
7
  readonly isTextureNode: true;
@@ -34,32 +34,32 @@ export default class TextureNode extends UniformNode<Texture> {
34
34
  /**
35
35
  * @deprecated
36
36
  */
37
- uv(uvNode: NodeRepresentation): ShaderNodeObject<Node>;
37
+ uv(uvNode: Node): ShaderNodeObject<Node>;
38
38
 
39
- sample(uvNode: NodeRepresentation): ShaderNodeObject<Node>;
39
+ sample(uvNode: Node): ShaderNodeObject<Node>;
40
40
 
41
- blur(amountNode: NodeRepresentation): ShaderNodeObject<Node>;
41
+ blur(amountNode: Node): ShaderNodeObject<Node>;
42
42
 
43
- level(levelNode: NodeRepresentation): ShaderNodeObject<Node>;
43
+ level(levelNode: Node): ShaderNodeObject<Node>;
44
44
 
45
- size(levelNode: NodeRepresentation): ShaderNodeObject<Node>;
45
+ size(levelNode: Node): ShaderNodeObject<Node>;
46
46
 
47
- bias(biasNode: NodeRepresentation): ShaderNodeObject<Node>;
47
+ bias(biasNode: Node): ShaderNodeObject<Node>;
48
48
 
49
- compare(compareNode: NodeRepresentation): ShaderNodeObject<Node>;
49
+ compare(compareNode: Node): ShaderNodeObject<Node>;
50
50
 
51
- grad(gradeNodeX: NodeRepresentation, gradeNodeY: NodeRepresentation): ShaderNodeObject<Node>;
51
+ grad(gradeNodeX: Node, gradeNodeY: Node): ShaderNodeObject<Node>;
52
52
 
53
- depth(depthNode: NodeRepresentation): ShaderNodeObject<Node>;
53
+ depth(depthNode: Node): ShaderNodeObject<Node>;
54
54
 
55
55
  clone(): this;
56
56
  }
57
57
 
58
58
  export const texture: (
59
59
  value?: Texture,
60
- uvNode?: NodeRepresentation | null,
61
- levelNode?: NodeRepresentation | null,
62
- biasNode?: NodeRepresentation | null,
60
+ uvNode?: Node | null,
61
+ levelNode?: Node | number | null,
62
+ biasNode?: Node | null,
63
63
  ) => ShaderNodeObject<TextureNode>;
64
64
 
65
65
  export const uniformTexture: (
@@ -68,9 +68,9 @@ export const uniformTexture: (
68
68
 
69
69
  export const textureLoad: (
70
70
  value?: Texture,
71
- uvNode?: NodeRepresentation,
72
- levelNode?: NodeRepresentation,
73
- biasNode?: NodeRepresentation,
71
+ uvNode?: Node,
72
+ levelNode?: Node | number,
73
+ biasNode?: Node,
74
74
  ) => ShaderNodeObject<TextureNode>;
75
75
 
76
76
  export const sampler: (value: Texture | TextureNode) => 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
  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,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
  import TempNode from "./TempNode.js";
@@ -13,7 +13,7 @@ declare class AssignNode extends TempNode {
13
13
 
14
14
  export default AssignNode;
15
15
 
16
- export const assign: (targetNode: NodeRepresentation, sourceNode: NodeRepresentation) => ShaderNodeObject<AssignNode>;
16
+ export const assign: (targetNode: Node, sourceNode: Node | number) => ShaderNodeObject<AssignNode>;
17
17
 
18
18
  declare module "../tsl/TSLCore.js" {
19
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 {
@@ -14,8 +14,6 @@ export default class CacheNode extends Node {
14
14
 
15
15
  export const cache: (node: Node, cache?: NodeCache) => ShaderNodeObject<CacheNode>;
16
16
 
17
- export const namespace: (node: Node, namespace: string) => ShaderNodeObject<ContextNode>;
18
-
19
17
  declare module "../tsl/TSLCore.js" {
20
18
  interface NodeElements {
21
19
  cache: typeof cache;