@types/three 0.164.1 → 0.166.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 (181) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/controls/TransformControls.d.ts +8 -6
  3. three/examples/jsm/exporters/GLTFExporter.d.ts +6 -0
  4. three/examples/jsm/exporters/USDZExporter.d.ts +4 -2
  5. three/examples/jsm/geometries/TeapotGeometry.d.ts +24 -0
  6. three/examples/jsm/helpers/ViewHelper.d.ts +8 -6
  7. three/examples/jsm/lines/LineMaterial.d.ts +2 -4
  8. three/examples/jsm/loaders/DDSLoader.d.ts +8 -2
  9. three/examples/jsm/loaders/FontLoader.d.ts +1 -1
  10. three/examples/jsm/loaders/GLTFLoader.d.ts +12 -7
  11. three/examples/jsm/loaders/KTXLoader.d.ts +8 -2
  12. three/examples/jsm/loaders/LDrawLoader.d.ts +1 -1
  13. three/examples/jsm/loaders/PVRLoader.d.ts +2 -2
  14. three/examples/jsm/modifiers/EdgeSplitModifier.d.ts +17 -10
  15. three/examples/jsm/nodes/Nodes.d.ts +21 -57
  16. three/examples/jsm/nodes/accessors/BitangentNode.d.ts +4 -22
  17. three/examples/jsm/nodes/accessors/BufferAttributeNode.d.ts +50 -0
  18. three/examples/jsm/nodes/accessors/BufferNode.d.ts +3 -4
  19. three/examples/jsm/nodes/accessors/CameraNode.d.ts +11 -20
  20. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +1 -1
  21. three/examples/jsm/nodes/accessors/MaterialNode.d.ts +4 -1
  22. three/examples/jsm/nodes/accessors/ModelNode.d.ts +3 -0
  23. three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +1 -2
  24. three/examples/jsm/nodes/accessors/NormalNode.d.ts +9 -17
  25. three/examples/jsm/nodes/accessors/PositionNode.d.ts +6 -26
  26. three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +3 -4
  27. three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +3 -8
  28. three/examples/jsm/nodes/accessors/RendererReferenceNode.d.ts +2 -3
  29. three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +16 -4
  30. three/examples/jsm/nodes/accessors/StorageTextureNode.d.ts +40 -0
  31. three/examples/jsm/nodes/accessors/TangentNode.d.ts +8 -23
  32. three/examples/jsm/nodes/accessors/Texture3DNode.d.ts +16 -0
  33. three/examples/jsm/nodes/accessors/TextureNode.d.ts +1 -1
  34. three/examples/jsm/nodes/accessors/UVNode.d.ts +1 -8
  35. three/examples/jsm/nodes/accessors/UniformsNode.d.ts +0 -2
  36. three/examples/jsm/nodes/accessors/UserDataNode.d.ts +4 -3
  37. three/examples/jsm/nodes/code/CodeNode.d.ts +0 -1
  38. three/examples/jsm/nodes/code/ExpressionNode.d.ts +2 -3
  39. three/examples/jsm/nodes/core/AttributeNode.d.ts +11 -4
  40. three/examples/jsm/nodes/core/CacheNode.d.ts +4 -5
  41. three/examples/jsm/nodes/core/ConstNode.d.ts +1 -2
  42. three/examples/jsm/nodes/core/InputNode.d.ts +1 -2
  43. three/examples/jsm/nodes/core/LightingModel.d.ts +11 -0
  44. three/examples/jsm/nodes/core/Node.d.ts +102 -42
  45. three/examples/jsm/nodes/core/NodeAttribute.d.ts +7 -4
  46. three/examples/jsm/nodes/core/NodeBuilder.d.ts +30 -26
  47. three/examples/jsm/nodes/core/NodeCache.d.ts +48 -6
  48. three/examples/jsm/nodes/core/NodeFunction.d.ts +2 -2
  49. three/examples/jsm/nodes/core/NodeKeywords.d.ts +10 -7
  50. three/examples/jsm/nodes/core/NodeParser.d.ts +4 -4
  51. three/examples/jsm/nodes/core/NodeUniform.d.ts +8 -11
  52. three/examples/jsm/nodes/core/NodeVar.d.ts +5 -4
  53. three/examples/jsm/nodes/core/NodeVarying.d.ts +5 -6
  54. three/examples/jsm/nodes/core/PropertyNode.d.ts +4 -4
  55. three/examples/jsm/nodes/core/StackNode.d.ts +7 -1
  56. three/examples/jsm/nodes/core/StructTypeNode.d.ts +8 -0
  57. three/examples/jsm/nodes/core/TempNode.d.ts +1 -2
  58. three/examples/jsm/nodes/core/UniformGroup.d.ts +7 -0
  59. three/examples/jsm/nodes/core/UniformGroupNode.d.ts +21 -0
  60. three/examples/jsm/nodes/core/UniformNode.d.ts +16 -11
  61. three/examples/jsm/nodes/core/VarNode.d.ts +2 -0
  62. three/examples/jsm/nodes/core/VaryingNode.d.ts +4 -0
  63. three/examples/jsm/nodes/core/constants.d.ts +27 -79
  64. three/examples/jsm/nodes/display/DepthOfFieldNode.d.ts +30 -0
  65. three/examples/jsm/nodes/display/DotScreenNode.d.ts +32 -0
  66. three/examples/jsm/nodes/display/PassNode.d.ts +1 -1
  67. three/examples/jsm/nodes/display/RGBShiftNode.d.ts +24 -0
  68. three/examples/jsm/nodes/display/SobelOperatorNode.d.ts +17 -0
  69. three/examples/jsm/nodes/display/ViewportDepthNode.d.ts +4 -6
  70. three/examples/jsm/nodes/functions/BSDF/LTC.d.ts +9 -0
  71. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +2 -0
  72. three/examples/jsm/nodes/functions/ToonLightingModel.d.ts +4 -0
  73. three/examples/jsm/nodes/lighting/RectAreaLightNode.d.ts +10 -0
  74. three/examples/jsm/nodes/loaders/NodeLoader.d.ts +3 -3
  75. three/examples/jsm/nodes/loaders/NodeObjectLoader.d.ts +2 -3
  76. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +2 -0
  77. three/examples/jsm/nodes/materials/Materials.d.ts +3 -0
  78. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +5 -1
  79. three/examples/jsm/nodes/materials/MeshMatcapNodeMaterial.d.ts +28 -0
  80. three/examples/jsm/nodes/materials/MeshNormalNodeMaterial.d.ts +2 -0
  81. three/examples/jsm/nodes/materials/MeshPhongNodeMaterial.d.ts +7 -4
  82. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +24 -17
  83. three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +6 -7
  84. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +8 -5
  85. three/examples/jsm/nodes/materials/MeshToonNodeMaterial.d.ts +38 -0
  86. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +41 -37
  87. three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +1 -0
  88. three/examples/jsm/nodes/materials/ShadowNodeMaterial.d.ts +1 -0
  89. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +3 -3
  90. three/examples/jsm/nodes/materials/VolumeNodeMaterial.d.ts +10 -0
  91. three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +1 -0
  92. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +230 -0
  93. three/examples/jsm/nodes/math/MathNode.d.ts +5 -1
  94. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +58 -36
  95. three/examples/jsm/nodes/utils/ConvertNode.d.ts +2 -3
  96. three/examples/jsm/nodes/utils/DiscardNode.d.ts +1 -0
  97. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +2 -2
  98. three/examples/jsm/nodes/utils/SplitNode.d.ts +1 -1
  99. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +4 -5
  100. three/examples/jsm/objects/Sky.d.ts +18 -0
  101. three/examples/jsm/renderers/common/Animation.d.ts +14 -0
  102. three/examples/jsm/renderers/common/Attributes.d.ts +20 -0
  103. three/examples/jsm/renderers/common/Background.d.ts +22 -0
  104. three/examples/jsm/renderers/common/BindGroup.d.ts +9 -0
  105. three/examples/jsm/renderers/common/Binding.d.ts +8 -0
  106. three/examples/jsm/renderers/common/Bindings.d.ts +42 -0
  107. three/examples/jsm/renderers/common/Buffer.d.ts +11 -0
  108. three/examples/jsm/renderers/common/BufferUtils.d.ts +4 -0
  109. three/examples/jsm/renderers/common/ChainMap.d.ts +9 -0
  110. three/examples/jsm/renderers/common/ClippingContext.d.ts +18 -0
  111. three/examples/jsm/renderers/common/Color4.d.ts +6 -5
  112. three/examples/jsm/renderers/common/ComputePipeline.d.ts +8 -0
  113. three/examples/jsm/renderers/common/Constants.d.ts +9 -0
  114. three/examples/jsm/renderers/common/CubeRenderTarget.d.ts +7 -0
  115. three/examples/jsm/renderers/common/DataMap.d.ts +20 -0
  116. three/examples/jsm/renderers/common/Geometries.d.ts +28 -0
  117. three/examples/jsm/renderers/common/Info.d.ts +25 -13
  118. three/examples/jsm/renderers/common/Pipeline.d.ts +6 -0
  119. three/examples/jsm/renderers/common/Pipelines.d.ts +68 -0
  120. three/examples/jsm/renderers/common/PostProcessing.d.ts +2 -0
  121. three/examples/jsm/renderers/common/ProgrammableStage.d.ts +15 -0
  122. three/examples/jsm/renderers/common/RenderBundle.d.ts +8 -0
  123. three/examples/jsm/renderers/common/RenderBundles.d.ts +10 -0
  124. three/examples/jsm/renderers/common/RenderContext.d.ts +38 -0
  125. three/examples/jsm/renderers/common/RenderContexts.d.ts +13 -0
  126. three/examples/jsm/renderers/common/RenderList.d.ts +62 -0
  127. three/examples/jsm/renderers/common/RenderLists.d.ts +10 -0
  128. three/examples/jsm/renderers/common/RenderObject.d.ts +73 -0
  129. three/examples/jsm/renderers/common/RenderObjects.d.ts +59 -0
  130. three/examples/jsm/renderers/common/RenderPipeline.d.ts +8 -0
  131. three/examples/jsm/renderers/common/Renderer.d.ts +186 -208
  132. three/examples/jsm/renderers/common/SampledTexture.d.ts +27 -0
  133. three/examples/jsm/renderers/common/Sampler.d.ts +11 -0
  134. three/examples/jsm/renderers/common/StorageBufferAttribute.d.ts +7 -0
  135. three/examples/jsm/renderers/common/StorageInstancedBufferAttribute.d.ts +7 -0
  136. three/examples/jsm/renderers/common/Textures.d.ts +64 -0
  137. three/examples/jsm/renderers/common/Uniform.d.ts +40 -0
  138. three/examples/jsm/renderers/common/UniformBuffer.d.ts +6 -0
  139. three/examples/jsm/renderers/common/UniformsGroup.d.ts +32 -0
  140. three/examples/jsm/renderers/common/nodes/NodeBuilderState.d.ts +30 -0
  141. three/examples/jsm/renderers/common/nodes/NodeSampledTexture.d.ts +29 -0
  142. three/examples/jsm/renderers/common/nodes/NodeSampler.d.ts +12 -0
  143. three/examples/jsm/renderers/common/nodes/NodeUniform.d.ts +63 -0
  144. three/examples/jsm/renderers/common/nodes/NodeUniformsGroup.d.ts +11 -0
  145. three/examples/jsm/renderers/common/nodes/Nodes.d.ts +95 -0
  146. three/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +123 -0
  147. three/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +6 -0
  148. three/examples/jsm/renderers/webgpu/nodes/WGSLNodeParser.d.ts +6 -0
  149. three/examples/jsm/renderers/webgpu/utils/WebGPUConstants.d.ts +328 -0
  150. three/examples/jsm/utils/SceneUtils.d.ts +9 -3
  151. three/package.json +4 -4
  152. three/src/Three.d.ts +1 -0
  153. three/src/animation/tracks/StringKeyframeTrack.d.ts +1 -2
  154. three/src/constants.d.ts +6 -0
  155. three/src/core/BufferGeometry.d.ts +19 -17
  156. three/src/core/InterleavedBuffer.d.ts +2 -0
  157. three/src/extras/ShapeUtils.d.ts +5 -8
  158. three/src/extras/TextureUtils.d.ts +42 -0
  159. three/src/lights/LightShadow.d.ts +5 -0
  160. three/src/loaders/LoaderUtils.d.ts +9 -6
  161. three/src/materials/Material.d.ts +21 -12
  162. three/src/math/Color.d.ts +1 -1
  163. three/src/math/Matrix3.d.ts +2 -0
  164. three/src/math/Matrix4.d.ts +2 -0
  165. three/src/math/Vector4.d.ts +6 -0
  166. three/src/objects/BatchedMesh.d.ts +66 -47
  167. three/src/objects/InstancedMesh.d.ts +3 -3
  168. three/src/renderers/WebGLRenderer.d.ts +41 -19
  169. three/src/renderers/shaders/UniformsLib.d.ts +3 -0
  170. three/src/renderers/webgl/WebGLPrograms.d.ts +1 -1
  171. three/src/renderers/webxr/WebXRDepthSensing.d.ts +3 -1
  172. three/src/renderers/webxr/WebXRManager.d.ts +33 -23
  173. three/src/textures/CompressedArrayTexture.d.ts +36 -19
  174. three/src/textures/CompressedTexture.d.ts +16 -8
  175. three/src/textures/DataArrayTexture.d.ts +37 -20
  176. three/src/textures/FramebufferTexture.d.ts +1 -1
  177. three/src/textures/Texture.d.ts +3 -1
  178. three/src/utils.d.ts +2 -0
  179. three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +0 -17
  180. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +0 -37
  181. three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +0 -3
@@ -7,12 +7,34 @@ export const mx_select: (
7
7
  t_immutable: NodeRepresentation,
8
8
  f_immutable: NodeRepresentation,
9
9
  ) => ShaderNodeObject<Node>;
10
+
10
11
  export const mx_negate_if: (
11
12
  val_immutable: NodeRepresentation,
12
13
  b_immutable: NodeRepresentation,
13
14
  ) => ShaderNodeObject<Node>;
15
+
14
16
  export const mx_floor: (x_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
17
+
15
18
  export const mx_floorfrac: (x_immutable: NodeRepresentation, i: ShaderNodeObject<VarNode>) => ShaderNodeObject<Node>;
19
+
20
+ export const mx_bilerp_0: (
21
+ v0_immutable: NodeRepresentation,
22
+ v1_immutable: NodeRepresentation,
23
+ v2_immutable: NodeRepresentation,
24
+ v3_immutable: NodeRepresentation,
25
+ s_immutable: NodeRepresentation,
26
+ t_immutable: NodeRepresentation,
27
+ ) => ShaderNodeObject<Node>;
28
+
29
+ export const mx_bilerp_1: (
30
+ v0_immutable: NodeRepresentation,
31
+ v1_immutable: NodeRepresentation,
32
+ v2_immutable: NodeRepresentation,
33
+ v3_immutable: NodeRepresentation,
34
+ s_immutable: NodeRepresentation,
35
+ t_immutable: NodeRepresentation,
36
+ ) => ShaderNodeObject<Node>;
37
+
16
38
  export const mx_bilerp: (
17
39
  v0_immutable: NodeRepresentation,
18
40
  v1_immutable: NodeRepresentation,
@@ -21,6 +43,35 @@ export const mx_bilerp: (
21
43
  s_immutable: NodeRepresentation,
22
44
  t_immutable: NodeRepresentation,
23
45
  ) => ShaderNodeObject<Node>;
46
+
47
+ export const mx_trilerp_0: (
48
+ v0_immutable: NodeRepresentation,
49
+ v1_immutable: NodeRepresentation,
50
+ v2_immutable: NodeRepresentation,
51
+ v3_immutable: NodeRepresentation,
52
+ v4_immutable: NodeRepresentation,
53
+ v5_immutable: NodeRepresentation,
54
+ v6_immutable: NodeRepresentation,
55
+ v7_immutable: NodeRepresentation,
56
+ s_immutable: NodeRepresentation,
57
+ t_immutable: NodeRepresentation,
58
+ r_immutable: NodeRepresentation,
59
+ ) => ShaderNodeObject<Node>;
60
+
61
+ export const mx_trilerp_1: (
62
+ v0_immutable: NodeRepresentation,
63
+ v1_immutable: NodeRepresentation,
64
+ v2_immutable: NodeRepresentation,
65
+ v3_immutable: NodeRepresentation,
66
+ v4_immutable: NodeRepresentation,
67
+ v5_immutable: NodeRepresentation,
68
+ v6_immutable: NodeRepresentation,
69
+ v7_immutable: NodeRepresentation,
70
+ s_immutable: NodeRepresentation,
71
+ t_immutable: NodeRepresentation,
72
+ r_immutable: NodeRepresentation,
73
+ ) => ShaderNodeObject<Node>;
74
+
24
75
  export const mx_trilerp: (
25
76
  v0_immutable: NodeRepresentation,
26
77
  v1_immutable: NodeRepresentation,
@@ -34,33 +85,105 @@ export const mx_trilerp: (
34
85
  t_immutable: NodeRepresentation,
35
86
  r_immutable: NodeRepresentation,
36
87
  ) => ShaderNodeObject<Node>;
88
+
89
+ export const mx_gradient_float_0: (
90
+ hash_immutable: NodeRepresentation,
91
+ x_immutable: NodeRepresentation,
92
+ y_immutable: NodeRepresentation,
93
+ ) => ShaderNodeObject<Node>;
94
+
95
+ export const mx_gradient_float_1: (
96
+ hash_immutable: NodeRepresentation,
97
+ x_immutable: NodeRepresentation,
98
+ y_immutable: NodeRepresentation,
99
+ z_immutable: NodeRepresentation,
100
+ ) => ShaderNodeObject<Node>;
101
+
37
102
  export const mx_gradient_float: (
38
103
  hash_immutable: NodeRepresentation,
39
104
  x_immutable: NodeRepresentation,
40
105
  y_immutable: NodeRepresentation,
41
106
  z_immutable?: NodeRepresentation,
42
107
  ) => ShaderNodeObject<Node>;
108
+
109
+ export const mx_gradient_vec3_0: (
110
+ hash_immutable: NodeRepresentation,
111
+ x_immutable: NodeRepresentation,
112
+ y_immutable: NodeRepresentation,
113
+ ) => ShaderNodeObject<Node>;
114
+
115
+ export const mx_gradient_vec3_1: (
116
+ hash_immutable: NodeRepresentation,
117
+ x_immutable: NodeRepresentation,
118
+ y_immutable: NodeRepresentation,
119
+ z_immutable: NodeRepresentation,
120
+ ) => ShaderNodeObject<Node>;
121
+
43
122
  export const mx_gradient_vec3: (
44
123
  hash_immutable: NodeRepresentation,
45
124
  x_immutable: NodeRepresentation,
46
125
  y_immutable: NodeRepresentation,
47
126
  z_immutable?: NodeRepresentation,
48
127
  ) => ShaderNodeObject<Node>;
128
+
129
+ export const mx_gradient_scale2d_0: (v_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
130
+
131
+ export const mx_gradient_scale3d_0: (v_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
132
+
133
+ export const mx_gradient_scale2d_1: (v_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
134
+
49
135
  export const mx_gradient_scale2d: (v_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
136
+
137
+ export const mx_gradient_scale3d_1: (v_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
138
+
50
139
  export const mx_gradient_scale3d: (v_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
140
+
51
141
  export const mx_rotl32: (x_immutable: NodeRepresentation, k_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
142
+
52
143
  export const mx_bjmix: (
53
144
  a: ShaderNodeObject<VarNode>,
54
145
  b: ShaderNodeObject<VarNode>,
55
146
  c: ShaderNodeObject<VarNode>,
56
147
  ) => ShaderNodeObject<Node>;
148
+
57
149
  export const mx_bjfinal: (
58
150
  a_immutable: NodeRepresentation,
59
151
  b_immutable: NodeRepresentation,
60
152
  c_immutable: NodeRepresentation,
61
153
  ) => ShaderNodeObject<Node>;
154
+
62
155
  export const mx_bits_to_01: (bits_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
156
+
63
157
  export const mx_fade: (t_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
158
+
159
+ export const mx_hash_int_0: (x_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
160
+
161
+ export const mx_hash_int_1: (
162
+ x_immutable: NodeRepresentation,
163
+ y_immutable: NodeRepresentation,
164
+ ) => ShaderNodeObject<Node>;
165
+
166
+ export const mx_hash_int_2: (
167
+ x_immutable: NodeRepresentation,
168
+ y_immutable: NodeRepresentation,
169
+ z_immutable: NodeRepresentation,
170
+ ) => ShaderNodeObject<Node>;
171
+
172
+ export const mx_hash_int_3: (
173
+ x_immutable: NodeRepresentation,
174
+ y_immutable: NodeRepresentation,
175
+ z_immutable: NodeRepresentation,
176
+ xx_immutable: NodeRepresentation,
177
+ ) => ShaderNodeObject<Node>;
178
+
179
+ export const mx_hash_int_4: (
180
+ x_immutable: NodeRepresentation,
181
+ y_immutable: NodeRepresentation,
182
+ z_immutable: NodeRepresentation,
183
+ xx_immutable: NodeRepresentation,
184
+ yy_immutable: NodeRepresentation,
185
+ ) => ShaderNodeObject<Node>;
186
+
64
187
  export const mx_hash_int: (
65
188
  x_immutable: NodeRepresentation,
66
189
  y_immutable?: NodeRepresentation,
@@ -68,39 +191,107 @@ export const mx_hash_int: (
68
191
  xx_immutable?: NodeRepresentation,
69
192
  yy_immutable?: NodeRepresentation,
70
193
  ) => ShaderNodeObject<Node>;
194
+
195
+ export const mx_hash_vec3_0: (
196
+ x_immutable: NodeRepresentation,
197
+ y_immutable: NodeRepresentation,
198
+ ) => ShaderNodeObject<Node>;
199
+
200
+ export const mx_hash_vec3_1: (
201
+ x_immutable: NodeRepresentation,
202
+ y_immutable: NodeRepresentation,
203
+ z_immutable: NodeRepresentation,
204
+ ) => ShaderNodeObject<Node>;
205
+
71
206
  export const mx_hash_vec3: (
72
207
  x_immutable: NodeRepresentation,
73
208
  y_immutable: NodeRepresentation,
74
209
  z_immutable?: NodeRepresentation,
75
210
  ) => ShaderNodeObject<Node>;
211
+
212
+ export const mx_perlin_noise_float_0: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
213
+
214
+ export const mx_perlin_noise_float_1: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
215
+
76
216
  export const mx_perlin_noise_float: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
217
+
218
+ export const mx_perlin_noise_vec3_0: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
219
+
220
+ export const mx_perlin_noise_vec3_1: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
221
+
77
222
  export const mx_perlin_noise_vec3: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
223
+
224
+ export const mx_cell_noise_float_0: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
225
+
226
+ export const mx_cell_noise_float_1: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
227
+
228
+ export const mx_cell_noise_float_2: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
229
+
230
+ export const mx_cell_noise_float_3: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
231
+
78
232
  export const mx_cell_noise_float: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
233
+
234
+ export const mx_cell_noise_vec3_0: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
235
+
236
+ export const mx_cell_noise_vec3_1: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
237
+
238
+ export const mx_cell_noise_vec3_2: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
239
+
240
+ export const mx_cell_noise_vec3_3: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
241
+
79
242
  export const mx_cell_noise_vec3: (p_immutable: NodeRepresentation) => ShaderNodeObject<Node>;
243
+
80
244
  export const mx_fractal_noise_float: (
81
245
  p_immutable: NodeRepresentation,
82
246
  octaves_immutable: NodeRepresentation,
83
247
  lacunarity_immutable: NodeRepresentation,
84
248
  diminish_immutable: NodeRepresentation,
85
249
  ) => ShaderNodeObject<Node>;
250
+
86
251
  export const mx_fractal_noise_vec3: (
87
252
  p_immutable: NodeRepresentation,
88
253
  octaves_immutable: NodeRepresentation,
89
254
  lacunarity_immutable: NodeRepresentation,
90
255
  diminish_immutable: NodeRepresentation,
91
256
  ) => ShaderNodeObject<Node>;
257
+
92
258
  export const mx_fractal_noise_vec2: (
93
259
  p_immutable: NodeRepresentation,
94
260
  octaves_immutable: NodeRepresentation,
95
261
  lacunarity_immutable: NodeRepresentation,
96
262
  diminish_immutable: NodeRepresentation,
97
263
  ) => ShaderNodeObject<Node>;
264
+
98
265
  export const mx_fractal_noise_vec4: (
99
266
  p_immutable: NodeRepresentation,
100
267
  octaves_immutable: NodeRepresentation,
101
268
  lacunarity_immutable: NodeRepresentation,
102
269
  diminish_immutable: NodeRepresentation,
103
270
  ) => ShaderNodeObject<Node>;
271
+
272
+ export const mx_worley_distance_0: (
273
+ p_immutable: NodeRepresentation,
274
+ x_immutable: NodeRepresentation,
275
+ y_immutable: NodeRepresentation,
276
+ z_immutable: NodeRepresentation,
277
+ xoff_immutable: NodeRepresentation,
278
+ yoff_immutable: NodeRepresentation,
279
+ jitter_immutable: NodeRepresentation,
280
+ metric_immutable: NodeRepresentation,
281
+ ) => ShaderNodeObject<Node>;
282
+
283
+ export const mx_worley_distance_1: (
284
+ p_immutable: NodeRepresentation,
285
+ x_immutable: NodeRepresentation,
286
+ y_immutable: NodeRepresentation,
287
+ z_immutable: NodeRepresentation,
288
+ xoff_immutable: NodeRepresentation,
289
+ yoff_immutable: NodeRepresentation,
290
+ zoff_immutable: NodeRepresentation,
291
+ jitter_immutable: NodeRepresentation,
292
+ metric_immutable: NodeRepresentation,
293
+ ) => ShaderNodeObject<Node>;
294
+
104
295
  export const mx_worley_distance: (
105
296
  p_immutable: NodeRepresentation,
106
297
  x_immutable: NodeRepresentation,
@@ -110,18 +301,57 @@ export const mx_worley_distance: (
110
301
  yoff_immutable: NodeRepresentation,
111
302
  zoff_immutable: NodeRepresentation,
112
303
  jitter_immutable: NodeRepresentation,
304
+ metric_immutable?: NodeRepresentation,
305
+ ) => ShaderNodeObject<Node>;
306
+
307
+ export const mx_worley_noise_float_0: (
308
+ p_immutable: NodeRepresentation,
309
+ jitter_immutable: NodeRepresentation,
310
+ metric_immutable: NodeRepresentation,
311
+ ) => ShaderNodeObject<Node>;
312
+
313
+ export const mx_worley_noise_vec2_0: (
314
+ p_immutable: NodeRepresentation,
315
+ jitter_immutable: NodeRepresentation,
113
316
  metric_immutable: NodeRepresentation,
114
317
  ) => ShaderNodeObject<Node>;
318
+
319
+ export const mx_worley_noise_vec3_0: (
320
+ p_immutable: NodeRepresentation,
321
+ jitter_immutable: NodeRepresentation,
322
+ metric_immutable: NodeRepresentation,
323
+ ) => ShaderNodeObject<Node>;
324
+
325
+ export const mx_worley_noise_float_1: (
326
+ p_immutable: NodeRepresentation,
327
+ jitter_immutable: NodeRepresentation,
328
+ metric_immutable: NodeRepresentation,
329
+ ) => ShaderNodeObject<Node>;
330
+
115
331
  export const mx_worley_noise_float: (
116
332
  p_immutable: NodeRepresentation,
117
333
  jitter_immutable: NodeRepresentation,
118
334
  metric_immutable: NodeRepresentation,
119
335
  ) => ShaderNodeObject<Node>;
336
+
337
+ export const mx_worley_noise_vec2_1: (
338
+ p_immutable: NodeRepresentation,
339
+ jitter_immutable: NodeRepresentation,
340
+ metric_immutable: NodeRepresentation,
341
+ ) => ShaderNodeObject<Node>;
342
+
120
343
  export const mx_worley_noise_vec2: (
121
344
  p_immutable: NodeRepresentation,
122
345
  jitter_immutable: NodeRepresentation,
123
346
  metric_immutable: NodeRepresentation,
124
347
  ) => ShaderNodeObject<Node>;
348
+
349
+ export const mx_worley_noise_vec3_1: (
350
+ p_immutable: NodeRepresentation,
351
+ jitter_immutable: NodeRepresentation,
352
+ metric_immutable: NodeRepresentation,
353
+ ) => ShaderNodeObject<Node>;
354
+
125
355
  export const mx_worley_noise_vec3: (
126
356
  p_immutable: NodeRepresentation,
127
357
  jitter_immutable: NodeRepresentation,
@@ -32,7 +32,8 @@ export type MathNodeMethod1 =
32
32
  | typeof MathNode.RECIPROCAL
33
33
  | typeof MathNode.TRUNC
34
34
  | typeof MathNode.FWIDTH
35
- | typeof MathNode.BITCAST;
35
+ | typeof MathNode.BITCAST
36
+ | typeof MathNode.TRANSPOSE;
36
37
 
37
38
  export type MathNodeMethod2 =
38
39
  | typeof MathNode.ATAN2
@@ -93,6 +94,7 @@ export default class MathNode extends TempNode {
93
94
  static TRUNC: "trunc";
94
95
  static FWIDTH: "fwidth";
95
96
  static BITCAST: "bitcast";
97
+ static TRANSPOSE: "transpose";
96
98
 
97
99
  // 2 inputs
98
100
 
@@ -167,6 +169,7 @@ export const reciprocal: Unary;
167
169
  export const trunc: Unary;
168
170
  export const fwidth: Unary;
169
171
  export const bitcast: Unary;
172
+ export const transpose: Unary;
170
173
 
171
174
  type Binary = (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<MathNode>;
172
175
 
@@ -261,5 +264,6 @@ declare module "../shadernode/ShaderNode.js" {
261
264
  difference: typeof difference;
262
265
  saturate: typeof saturate;
263
266
  cbrt: typeof cbrt;
267
+ transpose: typeof transpose;
264
268
  }
265
269
  }
@@ -1,42 +1,42 @@
1
- import { AnyObject, NodeTypeOption, SwizzleOption } from "../core/constants.js";
2
1
  import ConstNode from "../core/ConstNode.js";
3
2
  import Node from "../core/Node.js";
4
3
  import NodeBuilder from "../core/NodeBuilder.js";
4
+ import StackNode from "../core/StackNode.js";
5
5
 
6
6
  export interface NodeElements {
7
+ toGlobal: (node: Node) => Node;
8
+
7
9
  append: typeof append;
8
10
 
9
- color: typeof color;
10
- float: typeof float;
11
- int: typeof int;
12
- uint: typeof uint;
13
- bool: typeof bool;
14
- vec2: typeof vec2;
15
- ivec2: typeof ivec2;
16
- uvec2: typeof uvec2;
17
- bvec2: typeof bvec2;
18
- vec3: typeof vec3;
19
- ivec3: typeof ivec3;
20
- uvec3: typeof uvec3;
21
- bvec3: typeof bvec3;
22
- vec4: typeof vec4;
23
- ivec4: typeof ivec4;
24
- uvec4: typeof uvec4;
25
- bvec4: typeof bvec4;
26
- mat2: typeof mat2;
27
- imat2: typeof imat2;
28
- umat2: typeof umat2;
29
- bmat2: typeof bmat2;
30
- mat3: typeof mat3;
31
- imat3: typeof imat3;
32
- umat3: typeof umat3;
33
- bmat3: typeof bmat3;
34
- mat4: typeof mat4;
35
- imat4: typeof imat4;
36
- umat4: typeof umat4;
37
- bmat4: typeof bmat4;
38
- string: typeof string;
39
- arrayBuffer: typeof arrayBuffer;
11
+ toColor: typeof color;
12
+ toFloat: typeof float;
13
+ toInt: typeof int;
14
+ toUint: typeof uint;
15
+ toBool: typeof bool;
16
+ toVec2: typeof vec2;
17
+ toIvec2: typeof ivec2;
18
+ toUvec2: typeof uvec2;
19
+ toBvec2: typeof bvec2;
20
+ toVec3: typeof vec3;
21
+ toIvec3: typeof ivec3;
22
+ toUvec3: typeof uvec3;
23
+ toBvec3: typeof bvec3;
24
+ toVec4: typeof vec4;
25
+ toIvec4: typeof ivec4;
26
+ toUvec4: typeof uvec4;
27
+ toBvec4: typeof bvec4;
28
+ toMat2: typeof mat2;
29
+ toImat2: typeof imat2;
30
+ toUmat2: typeof umat2;
31
+ toBmat2: typeof bmat2;
32
+ toMat3: typeof mat3;
33
+ toImat3: typeof imat3;
34
+ toUmat3: typeof umat3;
35
+ toBmat3: typeof bmat3;
36
+ toMat4: typeof mat4;
37
+ toImat4: typeof imat4;
38
+ toUmat4: typeof umat4;
39
+ toBmat4: typeof bmat4;
40
40
 
41
41
  element: typeof element;
42
42
  convert: typeof convert;
@@ -44,6 +44,16 @@ export interface NodeElements {
44
44
 
45
45
  export function addNodeElement(name: string, nodeElement: unknown): void;
46
46
 
47
+ export type SwizzleCharacter = "x" | "y" | "z" | "w" | "r" | "g" | "b" | "a" | "s" | "t" | "p" | "q";
48
+
49
+ export type SwizzleOption = Exclude<
50
+ | `${SwizzleCharacter}`
51
+ | `${SwizzleCharacter}${SwizzleCharacter}`
52
+ | `${SwizzleCharacter}${SwizzleCharacter}${SwizzleCharacter}`
53
+ | `${SwizzleCharacter}${SwizzleCharacter}${SwizzleCharacter}${SwizzleCharacter}`,
54
+ "abs" | "sqrt"
55
+ >;
56
+
47
57
  export type Swizzable<T extends Node = Node> =
48
58
  & T
49
59
  & {
@@ -57,6 +67,12 @@ export type ShaderNodeObject<T extends Node> =
57
67
  : NodeElements[Key] extends (node: T, ...args: infer Args) => infer R ? (...args: Args) => R
58
68
  : never;
59
69
  }
70
+ & {
71
+ [Key in keyof NodeElements as `${Key}Assign`]: T extends { [K in Key]: infer M } ? M
72
+ : NodeElements[Key] extends (node: T, ...args: infer Args) => unknown
73
+ ? (...args: Args) => ShaderNodeObject<T>
74
+ : never;
75
+ }
60
76
  & Swizzable<T>;
61
77
 
62
78
  /** anything that can be passed to {@link nodeObject} and returns a proxy */
@@ -160,9 +176,9 @@ type NodeArray<T extends NodeObjectOption[]> = { [index in keyof T]: NodeObject<
160
176
  type NodeObjects<T> = { [key in keyof T]: T[key] extends NodeObjectOption ? NodeObject<T[key]> : T[key] };
161
177
  type ConstructedNode<T> = T extends new(...args: any[]) => infer R ? (R extends Node ? R : never) : never;
162
178
 
163
- export type NodeOrType = Node | NodeTypeOption;
179
+ export type NodeOrType = Node | string;
164
180
 
165
- export const getConstNodeType: (value: NodeOrType) => NodeTypeOption | null;
181
+ export const getConstNodeType: (value: NodeOrType) => string | null;
166
182
 
167
183
  export class ShaderNode<T = {}, R extends Node = Node> {
168
184
  constructor(jsFunc: (inputs: NodeObjects<T>, builder: NodeBuilder) => NodeRepresentation);
@@ -201,10 +217,16 @@ export function tslFn<R extends Node = ShaderNodeObject<Node>>(jsFunc: () => R):
201
217
  export function tslFn<T extends any[], R extends Node = ShaderNodeObject<Node>>(
202
218
  jsFunc: (args: T) => R,
203
219
  ): (...args: ProxiedTuple<T>) => R;
204
- export function tslFn<T extends AnyObject, R extends Node = ShaderNodeObject<Node>>(
220
+ export function tslFn<T extends { [key: string]: unknown }, R extends Node = ShaderNodeObject<Node>>(
205
221
  jsFunc: (args: T) => R,
206
222
  ): (args: ProxiedObject<T>) => R;
207
223
 
224
+ export const setCurrentStack: (stack: StackNode | null) => void;
225
+
226
+ export const getCurrentStack: () => StackNode | null;
227
+
228
+ export const If: (boolNode: Node, method: () => void) => void;
229
+
208
230
  export function append(node: Node): Node;
209
231
 
210
232
  export const color: ConvertType;
@@ -248,4 +270,4 @@ export const string: (value?: string) => ShaderNodeObject<ConstNode<string>>;
248
270
  export const arrayBuffer: (value: ArrayBuffer) => ShaderNodeObject<ConstNode<ArrayBuffer>>;
249
271
 
250
272
  export const element: (node: NodeRepresentation, indexNode: NodeRepresentation) => ShaderNodeObject<Node>;
251
- export const convert: (node: NodeRepresentation, types: NodeTypeOption) => ShaderNodeObject<Node>;
273
+ export const convert: (node: NodeRepresentation, types: string) => ShaderNodeObject<Node>;
@@ -1,8 +1,7 @@
1
1
  import Node from "../core/Node.js";
2
- import { NodeTypeOption } from "../Nodes.js";
3
2
 
4
3
  export default class ConvertNode extends Node {
5
4
  node: Node;
6
- convertTo: NodeTypeOption;
7
- constructor(node: Node, convertTo: NodeTypeOption);
5
+ convertTo: string;
6
+ constructor(node: Node, convertTo: string);
8
7
  }
@@ -8,6 +8,7 @@ export default class DiscardNode extends CondNode {
8
8
 
9
9
  export const inlineDiscard: (condNode: NodeRepresentation) => ShaderNodeObject<DiscardNode>;
10
10
  export const discard: (condNode: NodeRepresentation) => ShaderNodeObject<Node>;
11
+ export const Return: (condNode: NodeRepresentation) => ShaderNodeObject<Node>;
11
12
 
12
13
  declare module "../shadernode/ShaderNode.js" {
13
14
  interface NodeElements {
@@ -1,8 +1,8 @@
1
- import { PositionNode, TempNode } from "../Nodes.js";
1
+ import { Node, TempNode } from "../Nodes.js";
2
2
  import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
3
3
 
4
4
  export default class EquirectUVNode extends TempNode {
5
- constructor(dirNode?: ShaderNodeObject<PositionNode>);
5
+ constructor(dirNode?: ShaderNodeObject<Node>);
6
6
  }
7
7
 
8
8
  export const equirectUV: ShaderNodeObject<EquirectUVNode>;
@@ -1,5 +1,5 @@
1
- import { SwizzleOption } from "../core/constants.js";
2
1
  import Node from "../core/Node.js";
2
+ import { SwizzleOption } from "../shadernode/ShaderNode.js";
3
3
 
4
4
  /** swizzle node */
5
5
  export default class SplitNode extends Node {
@@ -1,4 +1,3 @@
1
- import PositionNode from "../accessors/PositionNode.js";
2
1
  import TextureNode from "../accessors/TextureNode.js";
3
2
  import Node from "../core/Node.js";
4
3
  import { NodeRepresentation, ShaderNodeObject } from "../shadernode/ShaderNode.js";
@@ -10,16 +9,16 @@ export default class TriplanarTexturesNode extends Node {
10
9
 
11
10
  scaleNode: ShaderNodeObject<Node>;
12
11
 
13
- positionNode: ShaderNodeObject<PositionNode>;
14
- normalNode: ShaderNodeObject<PositionNode>;
12
+ positionNode: ShaderNodeObject<Node>;
13
+ normalNode: ShaderNodeObject<Node>;
15
14
 
16
15
  constructor(
17
16
  textureXNode: Node,
18
17
  textureYNode?: TextureNode | null,
19
18
  textureZNode?: TextureNode | null,
20
19
  scaleNode?: ShaderNodeObject<Node>,
21
- positionNode?: ShaderNodeObject<PositionNode>,
22
- normalNode?: ShaderNodeObject<PositionNode>,
20
+ positionNode?: ShaderNodeObject<Node>,
21
+ normalNode?: ShaderNodeObject<Node>,
23
22
  );
24
23
  }
25
24
 
@@ -1,6 +1,24 @@
1
1
  import { BoxGeometry, Mesh, ShaderMaterial } from "three";
2
2
 
3
+ /**
4
+ * {@link Sky} creates a ready to go sky environment for your scenes.
5
+ *
6
+ * @example
7
+ * const sky = new Sky();
8
+ * sky.scale.setScalar( 450000 );
9
+ *
10
+ * const phi = MathUtils.degToRad( 90 );
11
+ * const theta = MathUtils.degToRad( 180 );
12
+ * const sunPosition = new Vector3().setFromSphericalCoords( 1, phi, theta );
13
+ *
14
+ * sky.material.uniforms.sunPosition.value = sunPosition;
15
+ *
16
+ * scene.add( sky );
17
+ */
3
18
  export class Sky extends Mesh {
19
+ /**
20
+ * Create a new {@link Sky} instance.
21
+ */
4
22
  constructor();
5
23
 
6
24
  geometry: BoxGeometry;
@@ -0,0 +1,14 @@
1
+ /// <reference types="webxr" />
2
+ import Info from "./Info.js";
3
+ import Nodes from "./nodes/Nodes.js";
4
+ declare class Animation {
5
+ nodes: Nodes;
6
+ info: Info;
7
+ animationLoop: ((time: DOMHighResTimeStamp, frame?: XRFrame) => void) | null;
8
+ requestId: number | null;
9
+ constructor(nodes: Nodes, info: Info);
10
+ _init(): void;
11
+ dispose(): void;
12
+ setAnimationLoop(callback: ((time: DOMHighResTimeStamp, frame?: XRFrame) => void) | null): void;
13
+ }
14
+ export default Animation;
@@ -0,0 +1,20 @@
1
+ import { BufferAttribute, InterleavedBuffer, InterleavedBufferAttribute } from "three";
2
+ import Backend from "./Backend.js";
3
+ import { AttributeType } from "./Constants.js";
4
+ import DataMap from "./DataMap.js";
5
+ interface Data {
6
+ version?: number | undefined;
7
+ }
8
+ declare class Attributes extends DataMap<{
9
+ attribute: {
10
+ key: BufferAttribute | InterleavedBufferAttribute;
11
+ value: Data;
12
+ };
13
+ }> {
14
+ backend: Backend;
15
+ constructor(backend: Backend);
16
+ delete(attribute: BufferAttribute | InterleavedBufferAttribute): Data;
17
+ update(attribute: BufferAttribute | InterleavedBufferAttribute, type: AttributeType): void;
18
+ _getBufferAttribute(attribute: BufferAttribute | InterleavedBufferAttribute): InterleavedBuffer | BufferAttribute;
19
+ }
20
+ export default Attributes;
@@ -0,0 +1,22 @@
1
+ import { Mesh, Scene } from "three";
2
+ import DataMap from "./DataMap.js";
3
+ import Nodes from "./nodes/Nodes.js";
4
+ import RenderContext from "./RenderContext.js";
5
+ import Renderer from "./Renderer.js";
6
+ import RenderList from "./RenderList.js";
7
+ interface SceneData {
8
+ backgroundMesh?: Mesh;
9
+ backgroundCacheKey: string;
10
+ }
11
+ declare class Background extends DataMap<{
12
+ scene: {
13
+ key: Scene;
14
+ value: SceneData;
15
+ };
16
+ }> {
17
+ renderer: Renderer;
18
+ nodes: Nodes;
19
+ constructor(renderer: Renderer, nodes: Nodes);
20
+ update(scene: Scene, renderList: RenderList, renderContext: RenderContext): void;
21
+ }
22
+ export default Background;
@@ -0,0 +1,9 @@
1
+ import Binding from "./Binding.js";
2
+ import NodeUniformsGroup from "./nodes/NodeUniformsGroup.js";
3
+ declare class BindGroup {
4
+ name: string;
5
+ bindings: NodeUniformsGroup[] | Binding[];
6
+ id: number;
7
+ constructor(name?: string, bindings?: NodeUniformsGroup[]);
8
+ }
9
+ export default BindGroup;