@types/three 0.167.2 → 0.168.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 (247) hide show
  1. three/README.md +2 -2
  2. three/examples/jsm/Addons.d.ts +5 -1
  3. three/examples/jsm/capabilities/WebGL.d.ts +11 -3
  4. three/examples/jsm/controls/ArcballControls.d.ts +111 -77
  5. three/examples/jsm/controls/DragControls.d.ts +56 -27
  6. three/examples/jsm/controls/FirstPersonControls.d.ts +82 -12
  7. three/examples/jsm/controls/FlyControls.d.ts +35 -11
  8. three/examples/jsm/controls/OrbitControls.d.ts +84 -137
  9. three/examples/jsm/controls/PointerLockControls.d.ts +68 -9
  10. three/examples/jsm/controls/TrackballControls.d.ts +110 -26
  11. three/examples/jsm/effects/AnaglyphEffect.d.ts +11 -5
  12. three/examples/jsm/effects/ParallaxBarrierEffect.d.ts +7 -4
  13. three/examples/jsm/environments/RoomEnvironment.d.ts +2 -2
  14. three/examples/jsm/loaders/KTX2Loader.d.ts +4 -0
  15. three/examples/jsm/objects/SkyMesh.d.ts +17 -0
  16. three/examples/jsm/objects/Water2.d.ts +2 -2
  17. three/examples/jsm/objects/Water2Mesh.d.ts +42 -0
  18. three/examples/jsm/objects/WaterMesh.d.ts +31 -0
  19. three/examples/jsm/postprocessing/OutlinePass.d.ts +1 -1
  20. three/examples/jsm/postprocessing/SSAARenderPass.d.ts +11 -2
  21. three/package.json +4 -3
  22. three/src/Three.WebGPU.d.ts +6 -0
  23. three/src/Three.d.ts +1 -0
  24. three/src/core/EventDispatcher.d.ts +0 -3
  25. three/src/core/Object3D.d.ts +2 -0
  26. three/src/extras/Controls.d.ts +54 -0
  27. three/src/{nodes/loaders → loaders/nodes}/NodeLoader.d.ts +3 -3
  28. three/src/{nodes/loaders → loaders/nodes}/NodeMaterialLoader.d.ts +1 -1
  29. three/src/{nodes/loaders → loaders/nodes}/NodeObjectLoader.d.ts +1 -1
  30. three/src/materials/Material.d.ts +17 -13
  31. three/src/materials/nodes/InstancedPointsNodeMaterial.d.ts +33 -0
  32. three/src/{nodes/materials → materials/nodes}/Line2NodeMaterial.d.ts +2 -2
  33. three/src/{nodes/materials → materials/nodes}/LineBasicNodeMaterial.d.ts +1 -1
  34. three/src/materials/nodes/LineDashedNodeMaterial.d.ts +29 -0
  35. three/src/{nodes/materials → materials/nodes}/MeshBasicNodeMaterial.d.ts +1 -1
  36. three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +49 -0
  37. three/src/{nodes/materials → materials/nodes}/MeshMatcapNodeMaterial.d.ts +2 -2
  38. three/src/{nodes/materials → materials/nodes}/MeshNormalNodeMaterial.d.ts +1 -1
  39. three/src/{nodes/materials → materials/nodes}/MeshPhongNodeMaterial.d.ts +2 -2
  40. three/src/{nodes/materials → materials/nodes}/MeshPhysicalNodeMaterial.d.ts +5 -2
  41. three/src/{nodes/materials → materials/nodes}/MeshSSSNodeMaterial.d.ts +2 -2
  42. three/src/{nodes/materials → materials/nodes}/MeshStandardNodeMaterial.d.ts +3 -3
  43. three/src/{nodes/materials → materials/nodes}/MeshToonNodeMaterial.d.ts +2 -2
  44. three/src/materials/nodes/NodeMaterial.d.ts +91 -0
  45. three/src/{nodes/materials/Materials.d.ts → materials/nodes/NodeMaterials.d.ts} +5 -2
  46. three/src/{nodes/materials → materials/nodes}/PointsNodeMaterial.d.ts +1 -2
  47. three/src/{nodes/materials → materials/nodes}/ShadowNodeMaterial.d.ts +1 -1
  48. three/src/{nodes/materials → materials/nodes}/SpriteNodeMaterial.d.ts +2 -2
  49. three/src/{nodes/materials → materials/nodes}/VolumeNodeMaterial.d.ts +1 -1
  50. three/src/nodes/Nodes.d.ts +117 -362
  51. three/src/nodes/TSL.d.ts +269 -0
  52. three/src/nodes/accessors/AccessorsUtils.d.ts +1 -1
  53. three/src/nodes/accessors/BatchNode.d.ts +1 -2
  54. three/src/nodes/accessors/{BitangentNode.d.ts → Bitangent.d.ts} +1 -1
  55. three/src/nodes/accessors/BufferAttributeNode.d.ts +4 -4
  56. three/src/nodes/accessors/BufferNode.d.ts +1 -1
  57. three/src/nodes/accessors/{CameraNode.d.ts → Camera.d.ts} +1 -1
  58. three/src/nodes/accessors/ClippingNode.d.ts +1 -1
  59. three/src/nodes/accessors/CubeTextureNode.d.ts +1 -7
  60. three/src/nodes/accessors/InstanceNode.d.ts +1 -1
  61. three/src/nodes/accessors/MaterialNode.d.ts +3 -3
  62. three/src/nodes/accessors/MaterialProperties.d.ts +4 -0
  63. three/src/nodes/accessors/MaterialReferenceNode.d.ts +3 -1
  64. three/src/nodes/accessors/ModelNode.d.ts +1 -1
  65. three/src/nodes/accessors/ModelViewProjectionNode.d.ts +1 -1
  66. three/src/nodes/accessors/MorphNode.d.ts +15 -0
  67. three/src/nodes/accessors/{NormalNode.d.ts → Normal.d.ts} +11 -4
  68. three/src/nodes/accessors/Object3DNode.d.ts +1 -1
  69. three/src/nodes/accessors/PointUVNode.d.ts +1 -1
  70. three/src/nodes/accessors/{PositionNode.d.ts → Position.d.ts} +2 -1
  71. three/src/nodes/accessors/ReferenceBaseNode.d.ts +27 -0
  72. three/src/nodes/accessors/ReferenceNode.d.ts +7 -5
  73. three/src/nodes/accessors/{ReflectVectorNode.d.ts → ReflectVector.d.ts} +1 -1
  74. three/src/nodes/accessors/RendererReferenceNode.d.ts +1 -1
  75. three/src/nodes/accessors/SceneNode.d.ts +20 -0
  76. three/src/nodes/accessors/SkinningNode.d.ts +11 -1
  77. three/src/nodes/accessors/StorageBufferNode.d.ts +2 -2
  78. three/src/nodes/accessors/StorageTextureNode.d.ts +1 -1
  79. three/src/nodes/accessors/{TangentNode.d.ts → Tangent.d.ts} +1 -1
  80. three/src/nodes/accessors/Texture3DNode.d.ts +1 -1
  81. three/src/nodes/accessors/TextureBicubic.d.ts +4 -0
  82. three/src/nodes/accessors/TextureNode.d.ts +26 -7
  83. three/src/nodes/accessors/TextureSizeNode.d.ts +18 -0
  84. three/src/nodes/accessors/{UVNode.d.ts → UV.d.ts} +1 -1
  85. three/src/nodes/accessors/UniformArrayNode.d.ts +30 -0
  86. three/src/nodes/accessors/UserDataNode.d.ts +1 -1
  87. three/src/nodes/accessors/VelocityNode.d.ts +15 -0
  88. three/src/nodes/accessors/VertexColorNode.d.ts +1 -1
  89. three/src/nodes/code/CodeNode.d.ts +1 -1
  90. three/src/nodes/code/ExpressionNode.d.ts +1 -1
  91. three/src/nodes/code/FunctionCallNode.d.ts +2 -2
  92. three/src/nodes/code/FunctionNode.d.ts +5 -6
  93. three/src/nodes/code/ScriptableNode.d.ts +22 -0
  94. three/src/nodes/code/ScriptableValueNode.d.ts +10 -0
  95. three/src/nodes/core/AssignNode.d.ts +2 -2
  96. three/src/nodes/core/AttributeNode.d.ts +2 -5
  97. three/src/nodes/core/BypassNode.d.ts +2 -2
  98. three/src/nodes/core/CacheNode.d.ts +2 -2
  99. three/src/nodes/core/ContextNode.d.ts +10 -7
  100. three/src/nodes/core/IndexNode.d.ts +11 -3
  101. three/src/nodes/core/MRTNode.d.ts +7 -2
  102. three/src/nodes/core/Node.d.ts +8 -2
  103. three/src/nodes/core/OutputStructNode.d.ts +1 -1
  104. three/src/nodes/core/ParameterNode.d.ts +12 -0
  105. three/src/nodes/core/PropertyNode.d.ts +1 -1
  106. three/src/nodes/core/StackNode.d.ts +12 -2
  107. three/src/nodes/core/UniformNode.d.ts +1 -1
  108. three/src/nodes/core/VarNode.d.ts +2 -10
  109. three/src/nodes/core/VaryingNode.d.ts +2 -2
  110. three/src/nodes/display/AfterImageNode.d.ts +1 -7
  111. three/src/nodes/display/AnaglyphPassNode.d.ts +14 -0
  112. three/src/nodes/display/AnamorphicNode.d.ts +1 -7
  113. three/src/nodes/display/BleachBypass.d.ts +4 -0
  114. three/src/nodes/display/BlendMode.d.ts +10 -0
  115. three/src/nodes/display/BloomNode.d.ts +1 -7
  116. three/src/nodes/display/BumpMapNode.d.ts +16 -0
  117. three/src/nodes/display/ColorAdjustment.d.ts +27 -0
  118. three/src/nodes/display/ColorSpaceFunctions.d.ts +6 -0
  119. three/src/nodes/display/ColorSpaceNode.d.ts +23 -23
  120. three/src/nodes/display/DenoiseNode.d.ts +3 -9
  121. three/src/nodes/display/DepthOfFieldNode.d.ts +4 -8
  122. three/src/nodes/display/DotScreenNode.d.ts +4 -8
  123. three/src/nodes/display/FXAANode.d.ts +3 -9
  124. three/src/nodes/display/FilmNode.d.ts +3 -9
  125. three/src/nodes/display/FrontFacingNode.d.ts +4 -2
  126. three/src/nodes/display/GTAONode.d.ts +3 -9
  127. three/src/nodes/display/GaussianBlurNode.d.ts +4 -8
  128. three/src/nodes/display/Lut3DNode.d.ts +3 -9
  129. three/src/nodes/display/MotionBlur.d.ts +8 -0
  130. three/src/nodes/display/NormalMapNode.d.ts +4 -8
  131. three/src/nodes/display/ParallaxBarrierPassNode.d.ts +14 -0
  132. three/src/nodes/display/PassNode.d.ts +11 -2
  133. three/src/nodes/display/PixelationPassNode.d.ts +1 -37
  134. three/src/nodes/display/PosterizeNode.d.ts +1 -7
  135. three/src/nodes/display/RGBShiftNode.d.ts +1 -7
  136. three/src/nodes/display/RenderOutputNode.d.ts +2 -2
  137. three/src/nodes/display/SSAAPassNode.d.ts +26 -0
  138. three/src/nodes/display/Sepia.d.ts +4 -0
  139. three/src/nodes/display/SobelOperatorNode.d.ts +4 -8
  140. three/src/nodes/display/StereoCompositePassNode.d.ts +17 -0
  141. three/src/nodes/display/StereoPassNode.d.ts +17 -0
  142. three/src/nodes/display/ToneMappingFunctions.d.ts +14 -0
  143. three/src/nodes/display/ToneMappingNode.d.ts +5 -6
  144. three/src/nodes/display/TransitionNode.d.ts +3 -9
  145. three/src/nodes/display/ViewportDepthNode.d.ts +6 -2
  146. three/src/nodes/display/ViewportDepthTextureNode.d.ts +4 -2
  147. three/src/nodes/display/ViewportNode.d.ts +23 -16
  148. three/src/nodes/display/ViewportSharedTextureNode.d.ts +4 -8
  149. three/src/nodes/display/ViewportTextureNode.d.ts +4 -9
  150. three/src/nodes/fog/FogExp2Node.d.ts +4 -8
  151. three/src/nodes/fog/FogNode.d.ts +4 -8
  152. three/src/nodes/fog/FogRangeNode.d.ts +4 -8
  153. three/src/nodes/functions/BSDF/BRDF_GGX.d.ts +1 -1
  154. three/src/nodes/functions/BSDF/BRDF_Lambert.d.ts +1 -1
  155. three/src/nodes/functions/BSDF/BRDF_Sheen.d.ts +1 -1
  156. three/src/nodes/functions/BSDF/DFGApprox.d.ts +1 -1
  157. three/src/nodes/functions/BSDF/D_GGX.d.ts +1 -1
  158. three/src/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts +1 -1
  159. three/src/nodes/functions/BSDF/F_Schlick.d.ts +1 -1
  160. three/src/nodes/functions/BSDF/Schlick_to_F0.d.ts +10 -0
  161. three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +1 -1
  162. three/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts +1 -1
  163. three/src/nodes/functions/ShadowMaskModel.d.ts +1 -1
  164. three/src/nodes/functions/material/getGeometryRoughness.d.ts +1 -1
  165. three/src/nodes/functions/material/getRoughness.d.ts +1 -1
  166. three/src/nodes/geometry/RangeNode.d.ts +1 -1
  167. three/src/nodes/gpgpu/ComputeNode.d.ts +2 -2
  168. three/src/nodes/lighting/AmbientLightNode.d.ts +8 -0
  169. three/src/nodes/lighting/DirectionalLightNode.d.ts +8 -0
  170. three/src/nodes/lighting/IESSpotLightNode.d.ts +5 -0
  171. three/src/nodes/lighting/LightNode.d.ts +18 -0
  172. three/src/nodes/lighting/LightProbeNode.d.ts +11 -0
  173. three/src/nodes/lighting/LightUtils.d.ts +3 -3
  174. three/src/nodes/lighting/LightingContextNode.d.ts +1 -7
  175. three/src/nodes/lighting/LightsNode.d.ts +9 -13
  176. three/src/nodes/materialx/MaterialXNodes.d.ts +1 -1
  177. three/src/nodes/materialx/lib/mx_hsv.d.ts +2 -2
  178. three/src/nodes/materialx/lib/mx_noise.d.ts +1 -1
  179. three/src/nodes/materialx/lib/mx_transform_color.d.ts +1 -1
  180. three/src/nodes/math/ConditionalNode.d.ts +39 -0
  181. three/src/nodes/math/Hash.d.ts +4 -0
  182. three/src/nodes/math/MathNode.d.ts +2 -2
  183. three/src/nodes/math/MathUtils.d.ts +0 -10
  184. three/src/nodes/math/OperatorNode.d.ts +18 -4
  185. three/src/nodes/math/TriNoise3D.d.ts +1 -1
  186. three/src/nodes/parsers/GLSLNodeFunction.d.ts +9 -0
  187. three/src/nodes/parsers/GLSLNodeParser.d.ts +8 -0
  188. three/src/nodes/pmrem/PMREMNode.d.ts +4 -2
  189. three/src/nodes/pmrem/PMREMUtils.d.ts +28 -0
  190. three/src/nodes/procedural/Checker.d.ts +4 -0
  191. three/src/nodes/tsl/TSLBase.d.ts +21 -0
  192. three/src/nodes/{shadernode/ShaderNode.d.ts → tsl/TSLCore.d.ts} +23 -23
  193. three/src/nodes/utils/CubeMapNode.d.ts +13 -0
  194. three/src/nodes/utils/Discard.d.ts +11 -0
  195. three/src/nodes/utils/EquirectUVNode.d.ts +1 -1
  196. three/src/nodes/utils/FunctionOverloadingNode.d.ts +13 -0
  197. three/src/nodes/utils/LoopNode.d.ts +22 -0
  198. three/src/nodes/utils/MatcapUVNode.d.ts +1 -1
  199. three/src/nodes/utils/MaxMipLevelNode.d.ts +1 -1
  200. three/src/nodes/utils/OscNode.d.ts +1 -1
  201. three/src/nodes/utils/Packing.d.ts +5 -0
  202. three/src/nodes/utils/RTTNode.d.ts +7 -7
  203. three/src/nodes/utils/ReflectorNode.d.ts +1 -1
  204. three/src/nodes/utils/RemapNode.d.ts +2 -2
  205. three/src/nodes/utils/RotateNode.d.ts +1 -7
  206. three/src/nodes/utils/SetNode.d.ts +11 -0
  207. three/src/nodes/utils/SplitNode.d.ts +1 -1
  208. three/src/nodes/utils/SpriteSheetUVNode.d.ts +1 -1
  209. three/src/nodes/utils/SpriteUtils.d.ts +6 -0
  210. three/src/nodes/utils/{StoargeArrayElementNode.d.ts → StorageArrayElementNode.d.ts} +1 -7
  211. three/src/nodes/utils/TimerNode.d.ts +1 -1
  212. three/src/nodes/utils/TriplanarTexturesNode.d.ts +1 -7
  213. three/src/nodes/utils/UVUtils.d.ts +14 -0
  214. three/src/nodes/utils/ViewportUtils.d.ts +4 -0
  215. three/src/renderers/common/BindGroup.d.ts +8 -1
  216. three/src/renderers/common/Bindings.d.ts +2 -2
  217. three/src/renderers/common/ClippingContext.d.ts +1 -0
  218. three/src/renderers/common/QuadMesh.d.ts +2 -0
  219. three/src/renderers/common/RenderContext.d.ts +2 -0
  220. three/src/renderers/common/RenderContexts.d.ts +6 -4
  221. three/src/renderers/common/RenderObjects.d.ts +1 -1
  222. three/src/renderers/common/Renderer.d.ts +16 -4
  223. three/src/renderers/common/SampledTexture.d.ts +7 -1
  224. three/src/renderers/common/StandardRenderer.d.ts +12 -0
  225. three/src/renderers/common/Textures.d.ts +1 -0
  226. three/src/renderers/common/nodes/NodeLibrary.d.ts +56 -0
  227. three/src/renderers/common/nodes/NodeSampledTexture.d.ts +3 -3
  228. three/src/renderers/common/nodes/Nodes.d.ts +7 -9
  229. three/src/renderers/common/nodes/StandardNodeLibrary.d.ts +5 -0
  230. three/src/renderers/webgl/WebGLProperties.d.ts +5 -4
  231. three/src/renderers/webgpu/WebGPUBackend.d.ts +6 -2
  232. three/src/renderers/webgpu/WebGPURenderer.d.ts +3 -3
  233. three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +2 -2
  234. three/src/renderers/webxr/WebXRManager.d.ts +0 -2
  235. three/examples/jsm/loaders/LogLuvLoader.d.ts +0 -19
  236. three/src/nodes/accessors/TextureBicubicNode.d.ts +0 -18
  237. three/src/nodes/accessors/UniformsNode.d.ts +0 -23
  238. three/src/nodes/core/NodeKeywords.d.ts +0 -17
  239. three/src/nodes/display/BlendModeNode.d.ts +0 -47
  240. three/src/nodes/display/ColorAdjustmentNode.d.ts +0 -47
  241. three/src/nodes/materials/NodeMaterial.d.ts +0 -124
  242. three/src/nodes/math/CondNode.d.ts +0 -22
  243. three/src/nodes/math/HashNode.d.ts +0 -16
  244. three/src/nodes/procedural/CheckerNode.d.ts +0 -15
  245. three/src/nodes/utils/DiscardNode.d.ts +0 -17
  246. three/src/nodes/utils/PackingNode.d.ts +0 -24
  247. three/src/nodes/utils/RotateUVNode.d.ts +0 -19
@@ -1,4 +1,4 @@
1
1
  import Node from "../../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../../shadernode/ShaderNode.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../../tsl/TSLCore.js";
3
3
 
4
4
  export const mx_srgb_texture_to_lin_rec709: (color_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
@@ -0,0 +1,39 @@
1
+ import Node from "../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ declare class ConditionalNode extends Node {
5
+ condNode: Node;
6
+ ifNode: Node;
7
+ elseNode: Node;
8
+
9
+ constructor(condNode: Node, ifNode: Node, elseNode: Node);
10
+ }
11
+
12
+ export default ConditionalNode;
13
+
14
+ export const select: (
15
+ condNode: NodeRepresentation,
16
+ ifNode: NodeRepresentation,
17
+ elseNode: NodeRepresentation,
18
+ ) => ShaderNodeObject<Node>;
19
+
20
+ declare module "../tsl/TSLCore.js" {
21
+ interface NodeElements {
22
+ select: typeof select;
23
+ }
24
+ }
25
+
26
+ /**
27
+ * @deprecated cond() has been renamed to select()
28
+ */
29
+ export const cond: (
30
+ condNode: NodeRepresentation,
31
+ ifNode: NodeRepresentation,
32
+ elseNode: NodeRepresentation,
33
+ ) => ShaderNodeObject<Node>;
34
+
35
+ declare module "../tsl/TSLCore.js" {
36
+ interface NodeElements {
37
+ cond: typeof cond;
38
+ }
39
+ }
@@ -0,0 +1,4 @@
1
+ import Node from "../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ export const hash: (seed: NodeRepresentation) => ShaderNodeObject<Node>;
@@ -1,6 +1,6 @@
1
1
  import Node from "../core/Node.js";
2
2
  import TempNode from "../core/TempNode.js";
3
- import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
3
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
4
  import OperatorNode from "./OperatorNode.js";
5
5
 
6
6
  export type MathNodeMethod1 =
@@ -210,7 +210,7 @@ export const rand: (uv: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
210
210
  export const mixElement: Ternary;
211
211
  export const smoothstepElement: Ternary;
212
212
 
213
- declare module "../shadernode/ShaderNode.js" {
213
+ declare module "../tsl/TSLCore.js" {
214
214
  interface NodeElements {
215
215
  all: typeof all;
216
216
  any: typeof any;
@@ -1,16 +1,6 @@
1
1
  import { Binary, Ternary } from "./MathNode.js";
2
2
 
3
- // remapping functions
4
3
  export const parabola: Binary;
5
4
  export const gain: Binary;
6
5
  export const pcurve: Ternary;
7
6
  export const sinc: Binary;
8
-
9
- declare module "../shadernode/ShaderNode.js" {
10
- interface NodeElements {
11
- parabola: typeof parabola;
12
- gain: typeof gain;
13
- pcurve: typeof pcurve;
14
- sinc: typeof sinc;
15
- }
16
- }
@@ -1,6 +1,6 @@
1
1
  import Node from "../core/Node.js";
2
2
  import TempNode from "../core/TempNode.js";
3
- import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
3
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
4
 
5
5
  export type OperatorNodeOp =
6
6
  | "%"
@@ -40,7 +40,7 @@ export const add: Operator;
40
40
  export const sub: Operator;
41
41
  export const mul: Operator;
42
42
  export const div: Operator;
43
- export const remainder: Operator;
43
+ export const modInt: Operator;
44
44
  export const equal: Operator;
45
45
  export const lessThan: Operator;
46
46
  export const greaterThan: Operator;
@@ -57,13 +57,13 @@ export const bitXor: Operator;
57
57
  export const shiftLeft: Operator;
58
58
  export const shiftRight: Operator;
59
59
 
60
- declare module "../shadernode/ShaderNode.js" {
60
+ declare module "../tsl/TSLCore.js" {
61
61
  interface NodeElements {
62
62
  add: typeof add;
63
63
  sub: typeof sub;
64
64
  mul: typeof mul;
65
65
  div: typeof div;
66
- remainder: typeof remainder;
66
+ modInt: typeof modInt;
67
67
  equal: typeof equal;
68
68
  lessThan: typeof lessThan;
69
69
  greaterThan: typeof greaterThan;
@@ -81,3 +81,17 @@ declare module "../shadernode/ShaderNode.js" {
81
81
  shiftRight: typeof shiftRight;
82
82
  }
83
83
  }
84
+
85
+ /**
86
+ * @deprecated .remainder() has been renamed to .modInt().
87
+ */
88
+ export const remainder: Operator;
89
+
90
+ declare module "../tsl/TSLCore.js" {
91
+ interface NodeElements {
92
+ /**
93
+ * @deprecated .remainder() has been renamed to .modInt().
94
+ */
95
+ remainder: typeof remainder;
96
+ }
97
+ }
@@ -1,5 +1,5 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  export const tri: (x: NodeRepresentation) => ShaderNodeObject<Node>;
5
5
 
@@ -0,0 +1,9 @@
1
+ import NodeFunction from "../core/NodeFunction.js";
2
+
3
+ declare class GLSLNodeFunction extends NodeFunction {
4
+ constructor(source: string);
5
+
6
+ getCode(name?: string): string;
7
+ }
8
+
9
+ export default GLSLNodeFunction;
@@ -0,0 +1,8 @@
1
+ import NodeParser from "../core/NodeParser.js";
2
+ import GLSLNodeFunction from "./GLSLNodeFunction.js";
3
+
4
+ declare class GLSLNodeParser extends NodeParser {
5
+ parseFunction(source: string): GLSLNodeFunction;
6
+ }
7
+
8
+ export default GLSLNodeParser;
@@ -1,9 +1,9 @@
1
1
  import { Texture } from "../../textures/Texture.js";
2
2
  import Node from "../core/Node.js";
3
3
  import TempNode from "../core/TempNode.js";
4
- import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
4
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
5
5
 
6
- export default class PMREMNode extends TempNode {
6
+ declare class PMREMNode extends TempNode {
7
7
  uvNode: Node | null;
8
8
  levelNode: Node | null;
9
9
 
@@ -13,6 +13,8 @@ export default class PMREMNode extends TempNode {
13
13
  get value(): Texture;
14
14
  }
15
15
 
16
+ export default PMREMNode;
17
+
16
18
  export const pmremTexture: (
17
19
  value: Texture,
18
20
  uvNode?: NodeRepresentation,
@@ -0,0 +1,28 @@
1
+ import Node from "../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ export const getDirection: (uv_immutable: NodeRepresentation, face: NodeRepresentation) => ShaderNodeObject<Node>;
5
+
6
+ export const textureCubeUV: (
7
+ envMap: NodeRepresentation,
8
+ sampleDir_immutable: NodeRepresentation,
9
+ roughness_immutable: NodeRepresentation,
10
+ CUBEUV_TEXEL_WIDTH: NodeRepresentation,
11
+ CUBEUV_TEXEL_HEIGHT: NodeRepresentation,
12
+ CUBEUV_MAX_MIP: NodeRepresentation,
13
+ ) => ShaderNodeObject<Node>;
14
+
15
+ export const blur: (
16
+ n: NodeRepresentation,
17
+ latitudinal: NodeRepresentation,
18
+ poleAxis: NodeRepresentation,
19
+ outputDirection: NodeRepresentation,
20
+ weights: NodeRepresentation,
21
+ samples: NodeRepresentation,
22
+ dTheta: NodeRepresentation,
23
+ mipInt: NodeRepresentation,
24
+ envMap: NodeRepresentation,
25
+ CUBEUV_TEXEL_WIDTH: NodeRepresentation,
26
+ CUBEUV_TEXEL_HEIGHT: NodeRepresentation,
27
+ CUBEUV_MAX_MIP: NodeRepresentation,
28
+ ) => ShaderNodeObject<Node>;
@@ -0,0 +1,4 @@
1
+ import Node from "../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ export const checker: (coord?: NodeRepresentation) => ShaderNodeObject<Node>;
@@ -0,0 +1,21 @@
1
+ export * from "../accessors/BufferAttributeNode.js";
2
+ export * from "../code/ExpressionNode.js";
3
+ export * from "../code/FunctionCallNode.js";
4
+ export * from "../core/AssignNode.js";
5
+ export * from "../core/BypassNode.js";
6
+ export * from "../core/CacheNode.js";
7
+ export * from "../core/ContextNode.js";
8
+ export * from "../core/PropertyNode.js";
9
+ export * from "../core/UniformNode.js";
10
+ export * from "../core/VarNode.js";
11
+ export * from "../core/VaryingNode.js";
12
+ export * from "../display/ColorSpaceNode.js";
13
+ export * from "../display/RenderOutputNode.js";
14
+ export * from "../display/ToneMappingNode.js";
15
+ export * from "../gpgpu/ComputeNode.js";
16
+ export * from "../math/ConditionalNode.js";
17
+ export * from "../math/MathNode.js";
18
+ export * from "../math/OperatorNode.js";
19
+ export * from "../utils/Discard.js";
20
+ export * from "../utils/RemapNode.js";
21
+ export * from "./TSLCore.js";
@@ -26,23 +26,14 @@ export interface NodeElements {
26
26
  toUvec4: typeof uvec4;
27
27
  toBvec4: typeof bvec4;
28
28
  toMat2: typeof mat2;
29
- toImat2: typeof imat2;
30
- toUmat2: typeof umat2;
31
- toBmat2: typeof bmat2;
32
29
  toMat3: typeof mat3;
33
- toImat3: typeof imat3;
34
- toUmat3: typeof umat3;
35
- toBmat3: typeof bmat3;
36
30
  toMat4: typeof mat4;
37
- toImat4: typeof imat4;
38
- toUmat4: typeof umat4;
39
- toBmat4: typeof bmat4;
40
31
 
41
32
  element: typeof element;
42
33
  convert: typeof convert;
43
34
  }
44
35
 
45
- export function addNodeElement(name: string, nodeElement: unknown): void;
36
+ export function addMethodChaining(name: string, nodeElement: unknown): void;
46
37
 
47
38
  export type SwizzleCharacter = "x" | "y" | "z" | "w" | "r" | "g" | "b" | "a" | "s" | "t" | "p" | "q";
48
39
 
@@ -57,7 +48,10 @@ export type SwizzleOption = Exclude<
57
48
  export type Swizzable<T extends Node = Node> =
58
49
  & T
59
50
  & {
60
- [key in SwizzleOption | number]: ShaderNodeObject<Node>;
51
+ [Key in SwizzleOption | number]: ShaderNodeObject<Node>;
52
+ }
53
+ & {
54
+ [Key in SwizzleOption as `flip${Uppercase<Key>}`]: () => ShaderNodeObject<Node>;
61
55
  };
62
56
 
63
57
  export type ShaderNodeObject<T extends Node> =
@@ -213,10 +207,27 @@ export function nodeImmutable<T>(
213
207
  ...params: ProxiedTuple<GetConstructors<T>>
214
208
  ): ShaderNodeObject<ConstructedNode<T>>;
215
209
 
210
+ export function Fn<R extends Node = ShaderNodeObject<Node>>(jsFunc: () => R): () => R;
211
+ export function Fn<T extends any[], R extends Node = ShaderNodeObject<Node>>(
212
+ jsFunc: (args: T) => R,
213
+ ): (...args: ProxiedTuple<T>) => R;
214
+ export function Fn<T extends { [key: string]: unknown }, R extends Node = ShaderNodeObject<Node>>(
215
+ jsFunc: (args: T) => R,
216
+ ): (args: ProxiedObject<T>) => R;
217
+
218
+ /**
219
+ * @deprecated tslFn() has been renamed to Fn()
220
+ */
216
221
  export function tslFn<R extends Node = ShaderNodeObject<Node>>(jsFunc: () => R): () => R;
222
+ /**
223
+ * @deprecated tslFn() has been renamed to Fn()
224
+ */
217
225
  export function tslFn<T extends any[], R extends Node = ShaderNodeObject<Node>>(
218
226
  jsFunc: (args: T) => R,
219
227
  ): (...args: ProxiedTuple<T>) => R;
228
+ /**
229
+ * @deprecated tslFn() has been renamed to Fn()
230
+ */
220
231
  export function tslFn<T extends { [key: string]: unknown }, R extends Node = ShaderNodeObject<Node>>(
221
232
  jsFunc: (args: T) => R,
222
233
  ): (args: ProxiedObject<T>) => R;
@@ -225,7 +236,7 @@ export const setCurrentStack: (stack: StackNode | null) => void;
225
236
 
226
237
  export const getCurrentStack: () => StackNode | null;
227
238
 
228
- export const If: (boolNode: Node, method: () => void) => void;
239
+ export const If: (boolNode: Node, method: () => void) => StackNode;
229
240
 
230
241
  export function append(node: Node): Node;
231
242
 
@@ -252,19 +263,8 @@ export const uvec4: ConvertType;
252
263
  export const bvec4: ConvertType;
253
264
 
254
265
  export const mat2: ConvertType;
255
- export const imat2: ConvertType;
256
- export const umat2: ConvertType;
257
- export const bmat2: ConvertType;
258
-
259
266
  export const mat3: ConvertType;
260
- export const imat3: ConvertType;
261
- export const umat3: ConvertType;
262
- export const bmat3: ConvertType;
263
-
264
267
  export const mat4: ConvertType;
265
- export const imat4: ConvertType;
266
- export const umat4: ConvertType;
267
- export const bmat4: ConvertType;
268
268
 
269
269
  export const string: (value?: string) => ShaderNodeObject<ConstNode<string>>;
270
270
  export const arrayBuffer: (value: ArrayBuffer) => ShaderNodeObject<ConstNode<ArrayBuffer>>;
@@ -0,0 +1,13 @@
1
+ import Node from "../core/Node.js";
2
+ import TempNode from "../core/TempNode.js";
3
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
+
5
+ declare class CubeMapNode extends TempNode {
6
+ envNode: Node;
7
+
8
+ constructor(envNode: Node);
9
+ }
10
+
11
+ export default CubeMapNode;
12
+
13
+ export const cubeMapNode: (envNode: NodeRepresentation) => ShaderNodeObject<CubeMapNode>;
@@ -0,0 +1,11 @@
1
+ import Node from "../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ export const Discard: (conditional: NodeRepresentation) => ShaderNodeObject<Node>;
5
+ export const Return: () => ShaderNodeObject<Node>;
6
+
7
+ declare module "../tsl/TSLCore.js" {
8
+ interface NodeElements {
9
+ discard: typeof Discard;
10
+ }
11
+ }
@@ -1,5 +1,5 @@
1
1
  import { Node, TempNode } from "../Nodes.js";
2
- import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  export default class EquirectUVNode extends TempNode {
5
5
  constructor(dirNode?: ShaderNodeObject<Node>);
@@ -0,0 +1,13 @@
1
+ import Node from "../core/Node.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ declare class FunctionOverloadingNode extends Node {
5
+ functionNodes: Node[];
6
+ parameterNodes: Node[];
7
+
8
+ constructor(functionNodes?: Node[], ...parameterNodes: Node[]);
9
+ }
10
+
11
+ export default FunctionOverloadingNode;
12
+
13
+ export const overloadingFn: (functionNodes: Node[]) => (...params: Node[]) => ShaderNodeObject<FunctionOverloadingNode>;
@@ -0,0 +1,22 @@
1
+ import Node from "../core/Node.js";
2
+ import NodeBuilder from "../core/NodeBuilder.js";
3
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
+
5
+ declare class LoopNode extends Node {
6
+ params: unknown[];
7
+
8
+ constructor(params?: unknown[]);
9
+
10
+ getProperties(builder: NodeBuilder): unknown;
11
+ }
12
+
13
+ export default LoopNode;
14
+
15
+ export const Loop: (...params: unknown[]) => ShaderNodeObject<Node>;
16
+ export const Continue: () => ShaderNodeObject<Node>;
17
+ export const Break: () => ShaderNodeObject<Node>;
18
+
19
+ /**
20
+ * @deprecated loop() has been renamed to Loop()
21
+ */
22
+ export const loop: (...params: unknown[]) => ShaderNodeObject<Node>;
@@ -1,5 +1,5 @@
1
1
  import TempNode from "../core/TempNode.js";
2
- import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  export default class MatcapUVNode extends TempNode {
5
5
  constructor();
@@ -1,7 +1,7 @@
1
1
  import { Texture } from "../../textures/Texture.js";
2
2
  import TextureNode from "../accessors/TextureNode.js";
3
3
  import UniformNode from "../core/UniformNode.js";
4
- import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
4
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
5
5
 
6
6
  export default class MaxMipLevelNode extends UniformNode<0> {
7
7
  constructor(textureNode: TextureNode);
@@ -1,5 +1,5 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  export type OscNodeMethod =
5
5
  | typeof OscNode.SINE
@@ -0,0 +1,5 @@
1
+ import Node from "../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ export const directionToColor: (node: NodeRepresentation) => ShaderNodeObject<Node>;
5
+ export const colorToDirection: (node: NodeRepresentation) => ShaderNodeObject<Node>;
@@ -2,7 +2,7 @@ import { TextureDataType } from "../../constants.js";
2
2
  import { RenderTarget } from "../../core/RenderTarget.js";
3
3
  import TextureNode from "../accessors/TextureNode.js";
4
4
  import Node from "../core/Node.js";
5
- import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
5
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
6
6
 
7
7
  export interface RTTNodeOptions {
8
8
  type: TextureDataType;
@@ -37,9 +37,9 @@ export const rtt: (
37
37
  height?: number | null,
38
38
  options?: RTTNodeOptions,
39
39
  ) => ShaderNodeObject<RTTNode>;
40
-
41
- declare module "../shadernode/ShaderNode.js" {
42
- interface NodeElements {
43
- toTexture: typeof rtt;
44
- }
45
- }
40
+ export const convertToTexture: (
41
+ node: Node,
42
+ width?: number | null,
43
+ height?: number | null,
44
+ options?: RTTNodeOptions,
45
+ ) => ShaderNodeObject<RTTNode>;
@@ -2,7 +2,7 @@ import { Camera } from "../../cameras/Camera.js";
2
2
  import { Object3D } from "../../core/Object3D.js";
3
3
  import { RenderTarget } from "../../core/RenderTarget.js";
4
4
  import TextureNode from "../accessors/TextureNode.js";
5
- import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
5
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
6
6
 
7
7
  export interface ReflectorNodeParameters {
8
8
  target?: Object3D | undefined;
@@ -1,5 +1,5 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  export default class RemapNode extends Node {
5
5
  node: Node;
@@ -28,7 +28,7 @@ export const remapClamp: (
28
28
  outHighNode?: NodeRepresentation,
29
29
  ) => ShaderNodeObject<RemapNode>;
30
30
 
31
- declare module "../shadernode/ShaderNode.js" {
31
+ declare module "../tsl/TSLCore.js" {
32
32
  interface NodeElements {
33
33
  remap: typeof remap;
34
34
  remapClamp: typeof remapClamp;
@@ -1,6 +1,6 @@
1
1
  import Node from "../core/Node.js";
2
2
  import TempNode from "../core/TempNode.js";
3
- import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
3
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
4
 
5
5
  export default class RotateNode extends TempNode {
6
6
  positionNode: Node;
@@ -13,9 +13,3 @@ export const rotate: (
13
13
  positionNode: NodeRepresentation,
14
14
  rotationNode: NodeRepresentation,
15
15
  ) => ShaderNodeObject<RotateNode>;
16
-
17
- declare module "../shadernode/ShaderNode.js" {
18
- interface NodeElements {
19
- rotate: typeof rotate;
20
- }
21
- }
@@ -0,0 +1,11 @@
1
+ import TempNode from "../core/TempNode.js";
2
+
3
+ declare class SetNode extends TempNode {
4
+ sourceNode: Node;
5
+ components: string[];
6
+ targetNode: Node;
7
+
8
+ constructor(sourceNode: Node, components: string[], targetNode: Node);
9
+ }
10
+
11
+ export default SetNode;
@@ -1,5 +1,5 @@
1
1
  import Node from "../core/Node.js";
2
- import { SwizzleOption } from "../shadernode/ShaderNode.js";
2
+ import { SwizzleOption } from "../tsl/TSLCore.js";
3
3
 
4
4
  /** swizzle node */
5
5
  export default class SplitNode extends Node {
@@ -1,5 +1,5 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  export default class SpriteSheetUVNode extends Node {
5
5
  countNode: Node;
@@ -0,0 +1,6 @@
1
+ import Node from "../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ export const billboarding: (
5
+ args?: { position?: NodeRepresentation | null; horizontal?: boolean; vertical?: boolean },
6
+ ) => ShaderNodeObject<Node>;
@@ -1,5 +1,5 @@
1
1
  import StorageBufferNode from "../accessors/StorageBufferNode.js";
2
- import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
  import ArrayElementNode from "./ArrayElementNode.js";
4
4
 
5
5
  export default class StorageArrayElementNode extends ArrayElementNode {
@@ -17,9 +17,3 @@ export const storageElement: (
17
17
  storageBufferNode: NodeRepresentation,
18
18
  indexNode: NodeRepresentation,
19
19
  ) => ShaderNodeObject<StorageArrayElementNode>;
20
-
21
- declare module "../shadernode/ShaderNode.js" {
22
- interface NodeElements {
23
- storageElement: typeof storageElement;
24
- }
25
- }
@@ -1,5 +1,5 @@
1
1
  import UniformNode from "../core/UniformNode.js";
2
- import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
4
  export type TimerNodeScope =
5
5
  | typeof TimerNode.LOCAL
@@ -1,6 +1,6 @@
1
1
  import TextureNode from "../accessors/TextureNode.js";
2
2
  import Node from "../core/Node.js";
3
- import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
3
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
4
 
5
5
  export default class TriplanarTexturesNode extends Node {
6
6
  textureXNode: TextureNode;
@@ -34,9 +34,3 @@ export const triplanarTexture: (
34
34
  texture: NodeRepresentation,
35
35
  ...params: NodeRepresentation[]
36
36
  ) => ShaderNodeObject<TriplanarTexturesNode>;
37
-
38
- declare module "../shadernode/ShaderNode.js" {
39
- interface NodeElements {
40
- triplanarTexture: typeof triplanarTexture;
41
- }
42
- }
@@ -0,0 +1,14 @@
1
+ import OperatorNode from "../math/OperatorNode.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ export const rotateUV: (
5
+ uv: NodeRepresentation,
6
+ rotation: NodeRepresentation,
7
+ center?: NodeRepresentation,
8
+ ) => ShaderNodeObject<OperatorNode>;
9
+
10
+ export const spherizeUV: (
11
+ uv: NodeRepresentation,
12
+ strength: NodeRepresentation,
13
+ center?: NodeRepresentation,
14
+ ) => ShaderNodeObject<OperatorNode>;
@@ -0,0 +1,4 @@
1
+ import Node from "../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ export const viewportSafeUV: (uv?: NodeRepresentation | null) => ShaderNodeObject<Node>;
@@ -3,7 +3,14 @@ import NodeUniformsGroup from "./nodes/NodeUniformsGroup.js";
3
3
  declare class BindGroup {
4
4
  name: string;
5
5
  bindings: NodeUniformsGroup[] | Binding[];
6
+ index: number;
7
+ bindingsReference: NodeUniformsGroup[] | BindGroup;
6
8
  id: number;
7
- constructor(name?: string, bindings?: NodeUniformsGroup[]);
9
+ constructor(
10
+ name?: string,
11
+ bindings?: NodeUniformsGroup[],
12
+ index?: number,
13
+ bindingsReference?: NodeUniformsGroup[] | BindGroup,
14
+ );
8
15
  }
9
16
  export default BindGroup;
@@ -35,8 +35,8 @@ declare class Bindings extends DataMap<{
35
35
  getForCompute(computeNode: ComputeNode): BindGroup[];
36
36
  updateForCompute(computeNode: ComputeNode): void;
37
37
  updateForRender(renderObject: RenderObject): void;
38
- _updateBindings(object: ComputeNode | RenderObject, bindings: BindGroup[]): void;
38
+ _updateBindings(bindings: BindGroup[]): void;
39
39
  _init(bindGroup: BindGroup): void;
40
- _update(object: ComputeNode | RenderObject, bindGroup: BindGroup, bindings: BindGroup[]): void;
40
+ _update(bindGroup: BindGroup, bindings: BindGroup[]): void;
41
41
  }
42
42
  export default Bindings;