@types/three 0.184.1 → 0.185.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 (205) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +2 -0
  3. three/examples/jsm/controls/FirstPersonControls.d.ts +9 -0
  4. three/examples/jsm/controls/OrbitControls.d.ts +2 -2
  5. three/examples/jsm/controls/TransformControls.d.ts +32 -1
  6. three/examples/jsm/csm/CSMFrustum.d.ts +73 -13
  7. three/examples/jsm/exporters/DRACOExporter.d.ts +1 -1
  8. three/examples/jsm/exporters/GLTFExporter.d.ts +2 -2
  9. three/examples/jsm/exporters/PLYExporter.d.ts +5 -4
  10. three/examples/jsm/exporters/USDZExporter.d.ts +5 -1
  11. three/examples/jsm/generators/CityGenerator.d.ts +75 -0
  12. three/examples/jsm/generators/ForestGenerator.d.ts +79 -0
  13. three/examples/jsm/generators/TerrainGenerator.d.ts +67 -0
  14. three/examples/jsm/generators/TreeGenerator.d.ts +97 -0
  15. three/examples/jsm/generators/city/SidewalkGenerator.d.ts +40 -0
  16. three/examples/jsm/generators/city/SkyscraperGenerator.d.ts +83 -0
  17. three/examples/jsm/geometries/LoftGeometry.d.ts +83 -0
  18. three/examples/jsm/inspector/tabs/Parameters.d.ts +5 -2
  19. three/examples/jsm/lighting/ClusteredLighting.d.ts +45 -0
  20. three/examples/jsm/lighting/LightProbeGrid.d.ts +131 -13
  21. three/examples/jsm/loaders/DRACOLoader.d.ts +20 -6
  22. three/examples/jsm/loaders/EXRLoader.d.ts +2 -12
  23. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -1
  24. three/examples/jsm/loaders/HDRLoader.d.ts +2 -12
  25. three/examples/jsm/loaders/KTX2Loader.d.ts +1 -1
  26. three/examples/jsm/loaders/LWOLoader.d.ts +6 -0
  27. three/examples/jsm/loaders/RGBELoader.d.ts +1 -7
  28. three/examples/jsm/loaders/SVGLoader.d.ts +9 -6
  29. three/examples/jsm/loaders/TGALoader.d.ts +2 -2
  30. three/examples/jsm/loaders/TIFFLoader.d.ts +2 -11
  31. three/examples/jsm/loaders/USDLoader.d.ts +6 -1
  32. three/examples/jsm/misc/TileCreasedNormalsPlugin.d.ts +49 -0
  33. three/examples/jsm/objects/MarchingCubes.d.ts +2 -2
  34. three/examples/jsm/objects/Reflector.d.ts +38 -5
  35. three/examples/jsm/objects/SkyMesh.d.ts +1 -1
  36. three/examples/jsm/physics/RapierPhysics.d.ts +1 -0
  37. three/examples/jsm/tsl/display/BloomNode.d.ts +23 -6
  38. three/examples/jsm/tsl/display/ImportanceSampledEnvironment.d.ts +84 -0
  39. three/examples/jsm/tsl/display/RecurrentDenoiseNode.d.ts +89 -0
  40. three/examples/jsm/tsl/display/SSAAPassNode.d.ts +0 -2
  41. three/examples/jsm/tsl/display/SSGINode.d.ts +4 -1
  42. three/examples/jsm/tsl/display/SSRNode.d.ts +303 -30
  43. three/examples/jsm/tsl/display/TRAANode.d.ts +1 -1
  44. three/examples/jsm/tsl/display/TemporalReprojectNode.d.ts +64 -0
  45. three/examples/jsm/tsl/lighting/ClusteredLightsNode.d.ts +54 -0
  46. three/examples/jsm/tsl/math/curlNoise.d.ts +38 -0
  47. three/examples/jsm/tsl/utils/GroundedSkybox.d.ts +17 -0
  48. three/examples/jsm/tsl/utils/RNoise.d.ts +12 -0
  49. three/examples/jsm/tsl/utils/SpecularHelpers.d.ts +20 -0
  50. three/examples/jsm/webxr/WebGLXRFallback.d.ts +14 -0
  51. three/package.json +3 -3
  52. three/src/Three.TSL.d.ts +10 -3
  53. three/src/Three.WebGPU.Nodes.d.ts +2 -2
  54. three/src/Three.WebGPU.d.ts +5 -3
  55. three/src/animation/AnimationClip.d.ts +0 -10
  56. three/src/cameras/Camera.d.ts +1 -1
  57. three/src/core/InterleavedBuffer.d.ts +1 -1
  58. three/src/core/Object3D.d.ts +8 -4
  59. three/src/core/RenderTarget.d.ts +11 -0
  60. three/src/core/Timer.d.ts +1 -1
  61. three/src/core/UniformsGroup.d.ts +1 -1
  62. three/src/extras/Controls.d.ts +6 -5
  63. three/src/extras/core/ShapePath.d.ts +61 -65
  64. three/src/loaders/DataTextureLoader.d.ts +37 -3
  65. three/src/loaders/MaterialLoader.d.ts +8 -0
  66. three/src/materials/LineBasicMaterial.d.ts +5 -0
  67. three/src/materials/Material.d.ts +9 -1
  68. three/src/materials/MeshBasicMaterial.d.ts +30 -0
  69. three/src/materials/MeshDepthMaterial.d.ts +13 -0
  70. three/src/materials/MeshDistanceMaterial.d.ts +13 -0
  71. three/src/materials/MeshLambertMaterial.d.ts +50 -1
  72. three/src/materials/MeshMatcapMaterial.d.ts +31 -1
  73. three/src/materials/MeshNormalMaterial.d.ts +11 -1
  74. three/src/materials/MeshPhongMaterial.d.ts +50 -1
  75. three/src/materials/MeshPhysicalMaterial.d.ts +50 -0
  76. three/src/materials/MeshStandardMaterial.d.ts +53 -1
  77. three/src/materials/MeshToonMaterial.d.ts +43 -1
  78. three/src/materials/PointsMaterial.d.ts +9 -0
  79. three/src/materials/ShaderMaterial.d.ts +2 -0
  80. three/src/materials/SpriteMaterial.d.ts +9 -0
  81. three/src/materials/nodes/Line2NodeMaterial.d.ts +18 -13
  82. three/src/materials/nodes/NodeMaterial.d.ts +33 -13
  83. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +0 -84
  84. three/src/math/Box2.d.ts +3 -3
  85. three/src/math/Box3.d.ts +255 -19
  86. three/src/math/Color.d.ts +10 -10
  87. three/src/math/FrustumArray.d.ts +75 -16
  88. three/src/math/Interpolant.d.ts +111 -8
  89. three/src/math/Matrix3.d.ts +9 -0
  90. three/src/math/Matrix4.d.ts +329 -105
  91. three/src/math/Vector3.d.ts +2 -2
  92. three/src/math/interpolants/BezierInterpolant.d.ts +19 -3
  93. three/src/math/interpolants/CubicInterpolant.d.ts +18 -3
  94. three/src/math/interpolants/DiscreteInterpolant.d.ts +8 -3
  95. three/src/math/interpolants/LinearInterpolant.d.ts +7 -3
  96. three/src/math/interpolants/QuaternionLinearInterpolant.d.ts +7 -3
  97. three/src/nodes/Nodes.d.ts +4 -13
  98. three/src/nodes/TSL.d.ts +7 -5
  99. three/src/nodes/accessors/Batch.d.ts +19 -0
  100. three/src/nodes/accessors/Instance.d.ts +34 -0
  101. three/src/nodes/accessors/MaterialNode.d.ts +86 -79
  102. three/src/nodes/accessors/Morph.d.ts +11 -0
  103. three/src/nodes/accessors/Skinning.d.ts +23 -0
  104. three/src/nodes/accessors/StorageBufferNode.d.ts +22 -23
  105. three/src/nodes/accessors/StorageTexture3DNode.d.ts +17 -0
  106. three/src/nodes/accessors/StorageTextureNode.d.ts +6 -4
  107. three/src/nodes/accessors/TextureNode.d.ts +15 -10
  108. three/src/nodes/core/ArrayNode.d.ts +16 -8
  109. three/src/nodes/core/ContextNode.d.ts +5 -6
  110. three/src/nodes/core/LightingModel.d.ts +2 -0
  111. three/src/nodes/core/Node.d.ts +50 -51
  112. three/src/nodes/core/NodeBuilder.d.ts +1 -133
  113. three/src/nodes/core/OverrideContextNode.d.ts +92 -0
  114. three/src/nodes/core/PropertyNode.d.ts +13 -2
  115. three/src/nodes/core/StructNode.d.ts +0 -2
  116. three/src/nodes/core/StructTypeNode.d.ts +5 -4
  117. three/src/nodes/core/UniformNode.d.ts +48 -9
  118. three/src/nodes/display/BlendModes.d.ts +72 -11
  119. three/src/nodes/display/FrontFacingNode.d.ts +62 -3
  120. three/src/nodes/display/PassNode.d.ts +0 -2
  121. three/src/nodes/display/PremultiplyAlphaFunctions.d.ts +37 -0
  122. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +53 -45
  123. three/src/nodes/lighting/LightingContextNode.d.ts +9 -2
  124. three/src/nodes/lighting/LightsNode.d.ts +4 -4
  125. three/src/nodes/math/MathNode.d.ts +358 -304
  126. three/src/nodes/math/OperatorNode.d.ts +253 -82
  127. three/src/nodes/tsl/TSLCore.d.ts +16 -9
  128. three/src/nodes/utils/ArrayElementNode.d.ts +5 -4
  129. three/src/nodes/utils/EquirectUV.d.ts +31 -1
  130. three/src/nodes/utils/Packing.d.ts +50 -3
  131. three/src/nodes/utils/RTTNode.d.ts +7 -12
  132. three/src/nodes/utils/Remap.d.ts +216 -29
  133. three/src/nodes/utils/SampleNode.d.ts +18 -8
  134. three/src/objects/BatchedMesh.d.ts +1 -1
  135. three/src/objects/InstancedMesh.d.ts +0 -8
  136. three/src/objects/Skeleton.d.ts +0 -2
  137. three/src/renderers/common/Backend.d.ts +0 -3
  138. three/src/renderers/common/CanvasTarget.d.ts +0 -49
  139. three/src/renderers/common/ClippingContext.d.ts +6 -1
  140. three/src/renderers/common/CubeRenderTarget.d.ts +2 -1
  141. three/src/renderers/common/Info.d.ts +26 -66
  142. three/src/renderers/common/InspectorBase.d.ts +0 -7
  143. three/src/renderers/common/Lighting.d.ts +49 -5
  144. three/src/renderers/common/Renderer.d.ts +34 -458
  145. three/src/renderers/common/RendererUtils.d.ts +1 -2
  146. three/src/renderers/common/TimestampQueryPool.d.ts +1 -1
  147. three/src/renderers/common/XRManager.d.ts +32 -299
  148. three/src/renderers/common/nodes/NodeLibrary.d.ts +0 -117
  149. three/src/renderers/webgl/WebGLPrograms.d.ts +2 -0
  150. three/src/renderers/webgl/WebGLRenderLists.d.ts +5 -1
  151. three/src/renderers/webgl/WebGLState.d.ts +2 -0
  152. three/src/renderers/webgl-fallback/WebGLBackend.d.ts +1 -1
  153. three/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts +0 -10
  154. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +0 -1
  155. three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +5 -121
  156. three/src/textures/CubeDepthTexture.d.ts +2 -3
  157. three/src/textures/DataTexture.d.ts +2 -1
  158. three/src/textures/DepthTexture.d.ts +5 -5
  159. three/examples/jsm/lighting/TiledLighting.d.ts +0 -9
  160. three/examples/jsm/tsl/display/AnamorphicNode.d.ts +0 -31
  161. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +0 -22
  162. three/src/nodes/accessors/BatchNode.d.ts +0 -12
  163. three/src/nodes/accessors/InstanceNode.d.ts +0 -30
  164. three/src/nodes/accessors/InstancedMeshNode.d.ts +0 -10
  165. three/src/nodes/accessors/MorphNode.d.ts +0 -14
  166. three/src/nodes/accessors/SkinningNode.d.ts +0 -32
  167. three/src/renderers/common/Animation.d.ts +0 -102
  168. three/src/renderers/common/Attributes.d.ts +0 -59
  169. three/src/renderers/common/Background.d.ts +0 -47
  170. three/src/renderers/common/BindGroup.d.ts +0 -39
  171. three/src/renderers/common/Binding.d.ts +0 -50
  172. three/src/renderers/common/Bindings.d.ts +0 -132
  173. three/src/renderers/common/Buffer.d.ts +0 -90
  174. three/src/renderers/common/ChainMap.d.ts +0 -49
  175. three/src/renderers/common/Color4.d.ts +0 -55
  176. three/src/renderers/common/ComputePipeline.d.ts +0 -34
  177. three/src/renderers/common/DataMap.d.ts +0 -42
  178. three/src/renderers/common/Geometries.d.ts +0 -111
  179. three/src/renderers/common/Pipeline.d.ts +0 -29
  180. three/src/renderers/common/Pipelines.d.ts +0 -186
  181. three/src/renderers/common/ProgrammableStage.d.ts +0 -73
  182. three/src/renderers/common/RenderBundle.d.ts +0 -25
  183. three/src/renderers/common/RenderBundles.d.ts +0 -34
  184. three/src/renderers/common/RenderContext.d.ts +0 -235
  185. three/src/renderers/common/RenderContexts.d.ts +0 -47
  186. three/src/renderers/common/RenderList.d.ts +0 -226
  187. three/src/renderers/common/RenderLists.d.ts +0 -46
  188. three/src/renderers/common/RenderObject.d.ts +0 -448
  189. three/src/renderers/common/RenderObjectPipeline.d.ts +0 -33
  190. three/src/renderers/common/RenderObjects.d.ts +0 -151
  191. three/src/renderers/common/SampledTexture.d.ts +0 -28
  192. three/src/renderers/common/Sampler.d.ts +0 -19
  193. three/src/renderers/common/Textures.d.ts +0 -125
  194. three/src/renderers/common/Uniform.d.ts +0 -262
  195. three/src/renderers/common/UniformBuffer.d.ts +0 -20
  196. three/src/renderers/common/UniformsGroup.d.ts +0 -152
  197. three/src/renderers/common/XRRenderTarget.d.ts +0 -67
  198. three/src/renderers/common/nodes/NodeBuilderState.d.ts +0 -121
  199. three/src/renderers/common/nodes/NodeManager.d.ts +0 -309
  200. three/src/renderers/common/nodes/NodeSampledTexture.d.ts +0 -29
  201. three/src/renderers/common/nodes/NodeSampler.d.ts +0 -12
  202. three/src/renderers/common/nodes/NodeUniform.d.ts +0 -250
  203. three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +0 -41
  204. three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +0 -6
  205. three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts +0 -6
@@ -1,5 +1,52 @@
1
+ import { Vector2 } from "../../math/Vector2.js";
2
+ import { Vector3 } from "../../math/Vector3.js";
1
3
  import Node from "../core/Node.js";
2
4
 
3
- export const directionToColor: (node: Node) => Node<"vec3">;
4
- export const colorToDirection: (node: Node) => Node<"vec3">;
5
- export const unpackNormal: (xy: Node) => Node<"vec3">;
5
+ /**
6
+ * Packs a normal vector into a color value.
7
+ *
8
+ * @tsl
9
+ * @function
10
+ * @param {Node<vec3>} node - The direction to pack.
11
+ * @return {Node<vec3>} The color.
12
+ */
13
+ export const packNormalToRGB: (node: Node<"vec3"> | Vector3) => Node<"vec3">;
14
+
15
+ /**
16
+ * Unpacks a color value into a normal vector.
17
+ *
18
+ * @tsl
19
+ * @function
20
+ * @param {Node<vec3>} node - The color to unpack.
21
+ * @return {Node<vec3>} The direction.
22
+ */
23
+ export const unpackRGBToNormal: (node: Node<"vec3"> | Node<"vec4"> | Vector3) => Node<"vec3">;
24
+
25
+ /**
26
+ * Unpacks a tangent space normal, reconstructing the Z component by projecting the X,Y coordinates onto the hemisphere.
27
+ * The X,Y coordinates are expected to be in the [-1, 1] range.
28
+ *
29
+ * @tsl
30
+ * @function
31
+ * @param {Node<vec2>} xy - The X,Y coordinates of the normal.
32
+ * @return {Node<vec3>} The resulting normal.
33
+ */
34
+ export const unpackNormal: (xy: Node<"vec2"> | Vector2) => Node<"vec3">;
35
+
36
+ /**
37
+ * @tsl
38
+ * @function
39
+ * @deprecated since r185. Use {@link packNormalToRGB} instead.
40
+ * @param {Node<vec3>} node - The direction to pack.
41
+ * @returns {Node<vec3>}
42
+ */
43
+ export const directionToColor: (node: Node<"vec3"> | Vector3) => Node<"vec3">;
44
+
45
+ /**
46
+ * @tsl
47
+ * @function
48
+ * @deprecated since r185. Use {@link unpackRGBToNormal} instead.
49
+ * @param {Node<vec3>} node - The color to unpack.
50
+ * @returns {Node<vec3>}
51
+ */
52
+ export const colorToDirection: (node: Node<"vec3"> | Node<"vec4"> | Vector3) => Node<"vec3">;
@@ -1,12 +1,7 @@
1
- import { TextureDataType } from "../../constants.js";
2
- import { RenderTarget } from "../../core/RenderTarget.js";
1
+ import { RenderTarget, RenderTargetOptions } from "../../core/RenderTarget.js";
3
2
  import TextureNode from "../accessors/TextureNode.js";
4
3
  import Node from "../core/Node.js";
5
4
 
6
- export interface RTTNodeOptions {
7
- type: TextureDataType;
8
- }
9
-
10
5
  declare class RTTNode extends TextureNode {
11
6
  readonly isRTTNode: true;
12
7
 
@@ -19,15 +14,15 @@ declare class RTTNode extends TextureNode {
19
14
  textureNeedsUpdate: boolean;
20
15
  autoUpdate: boolean;
21
16
 
22
- pixelRatio?: number;
23
-
24
- constructor(node: Node, width?: number | null, height?: number | null, options?: RTTNodeOptions);
17
+ constructor(node: Node, width?: number | null, height?: number | null, options?: RenderTargetOptions);
25
18
 
26
19
  get autoResize(): boolean;
27
20
 
28
21
  setSize(width: number | null, height: number | null): void;
29
22
 
30
- setPixelRatio(pixelRatio: number): void;
23
+ setResolutionScale(resolutionScale: number): this;
24
+
25
+ getResolutionScale(): number;
31
26
  }
32
27
 
33
28
  export default RTTNode;
@@ -36,11 +31,11 @@ export const rtt: (
36
31
  node: Node,
37
32
  width?: number | null,
38
33
  height?: number | null,
39
- options?: RTTNodeOptions,
34
+ options?: RenderTargetOptions,
40
35
  ) => RTTNode;
41
36
  export const convertToTexture: (
42
37
  node: Node,
43
38
  width?: number | null,
44
39
  height?: number | null,
45
- options?: RTTNodeOptions,
40
+ options?: RenderTargetOptions,
46
41
  ) => RTTNode;
@@ -1,36 +1,223 @@
1
+ import { Color } from "../../math/Color.js";
2
+ import { Vector2 } from "../../math/Vector2.js";
3
+ import { Vector3 } from "../../math/Vector3.js";
4
+ import { Vector4 } from "../../math/Vector4.js";
1
5
  import Node from "../core/Node.js";
2
6
 
3
- export const remap: (
4
- node: Node<"float">,
5
- inLowNode: Node<"float"> | number,
6
- inHighNode: Node<"float"> | number,
7
- outLowNode?: Node<"float"> | number,
8
- outHighNode?: Node<"float"> | number,
9
- doClamp?: Node<"bool"> | boolean,
10
- ) => Node<"float">;
11
- export const remapClamp: (
12
- node: Node<"float">,
13
- inLowNode: Node<"float"> | number,
14
- inHighNode: Node<"float"> | number,
15
- outLowNode?: Node<"float"> | number,
16
- outHighNode?: Node<"float"> | number,
17
- ) => Node<"float">;
7
+ type FloatOrNumber = Node<"float"> | number;
8
+ type Boolean = Node<"bool"> | boolean;
9
+
10
+ type Vec2 = Node<"vec2"> | Vector2;
11
+ type Vec3 = Node<"vec3"> | Vector3 | Node<"color"> | Color;
12
+ type Vec4 = Node<"vec4"> | Vector4;
13
+
14
+ type Vec2OrFloat = Vec2 | FloatOrNumber;
15
+ type Vec3OrFloat = Vec3 | FloatOrNumber;
16
+ type Vec4OrFloat = Vec4 | FloatOrNumber;
17
+
18
+ interface RemapFunction {
19
+ (
20
+ node: FloatOrNumber,
21
+ inLowNode: FloatOrNumber,
22
+ inHighNode: FloatOrNumber,
23
+ outLowNode?: FloatOrNumber,
24
+ outHighNode?: FloatOrNumber,
25
+ doClamp?: Boolean,
26
+ ): Node<"float">;
27
+ (
28
+ node: Vec2OrFloat,
29
+ inLowNode: Vec2OrFloat,
30
+ inHighNode: Vec2OrFloat,
31
+ outLowNode?: Vec2OrFloat,
32
+ outHighNode?: Vec2OrFloat,
33
+ doClamp?: Boolean,
34
+ ): Node<"vec2">;
35
+ (
36
+ node: Vec3OrFloat,
37
+ inLowNode: Vec3OrFloat,
38
+ inHighNode: Vec3OrFloat,
39
+ outLowNode?: Vec3OrFloat,
40
+ outHighNode?: Vec3OrFloat,
41
+ doClamp?: Boolean,
42
+ ): Node<"vec3">;
43
+ (
44
+ node: Vec4OrFloat,
45
+ inLowNode: Vec4OrFloat,
46
+ inHighNode: Vec4OrFloat,
47
+ outLowNode?: Vec4OrFloat,
48
+ outHighNode?: Vec4OrFloat,
49
+ doClamp?: Boolean,
50
+ ): Node<"vec4">;
51
+ }
52
+
53
+ export const remap: RemapFunction;
54
+
55
+ interface RemapClampFunction {
56
+ (
57
+ node: FloatOrNumber,
58
+ inLowNode: FloatOrNumber,
59
+ inHighNode: FloatOrNumber,
60
+ outLowNode?: FloatOrNumber,
61
+ outHighNode?: FloatOrNumber,
62
+ ): Node<"float">;
63
+ (
64
+ node: Vec2OrFloat,
65
+ inLowNode: Vec2OrFloat,
66
+ inHighNode: Vec2OrFloat,
67
+ outLowNode?: Vec2OrFloat,
68
+ outHighNode?: Vec2OrFloat,
69
+ ): Node<"vec2">;
70
+ (
71
+ node: Vec3OrFloat,
72
+ inLowNode: Vec3OrFloat,
73
+ inHighNode: Vec3OrFloat,
74
+ outLowNode?: Vec3OrFloat,
75
+ outHighNode?: Vec3OrFloat,
76
+ ): Node<"vec3">;
77
+ (
78
+ node: Vec4OrFloat,
79
+ inLowNode: Vec4OrFloat,
80
+ inHighNode: Vec4OrFloat,
81
+ outLowNode?: Vec4OrFloat,
82
+ outHighNode?: Vec4OrFloat,
83
+ ): Node<"vec4">;
84
+ }
85
+
86
+ export const remapClamp: RemapClampFunction;
87
+
88
+ interface RemapFloatExtension {
89
+ (
90
+ inLowNode: FloatOrNumber,
91
+ inHighNode: FloatOrNumber,
92
+ outLowNode?: FloatOrNumber,
93
+ outHighNode?: FloatOrNumber,
94
+ doClamp?: Boolean,
95
+ ): Node<"float">;
96
+ (
97
+ inLowNode: Vec2OrFloat,
98
+ inHighNode: Vec2OrFloat,
99
+ outLowNode?: Vec2OrFloat,
100
+ outHighNode?: Vec2OrFloat,
101
+ doClamp?: Boolean,
102
+ ): Node<"vec2">;
103
+ (
104
+ inLowNode: Vec3OrFloat,
105
+ inHighNode: Vec3OrFloat,
106
+ outLowNode?: Vec3OrFloat,
107
+ outHighNode?: Vec3OrFloat,
108
+ doClamp?: Boolean,
109
+ ): Node<"vec3">;
110
+ (
111
+ inLowNode: Vec4OrFloat,
112
+ inHighNode: Vec4OrFloat,
113
+ outLowNode?: Vec4OrFloat,
114
+ outHighNode?: Vec4OrFloat,
115
+ doClamp?: Boolean,
116
+ ): Node<"vec4">;
117
+ }
118
+
119
+ interface RemapClampFloatExtension {
120
+ (
121
+ inLowNode: FloatOrNumber,
122
+ inHighNode: FloatOrNumber,
123
+ outLowNode?: FloatOrNumber,
124
+ outHighNode?: FloatOrNumber,
125
+ ): Node<"float">;
126
+ (
127
+ inLowNode: Vec2OrFloat,
128
+ inHighNode: Vec2OrFloat,
129
+ outLowNode?: Vec2OrFloat,
130
+ outHighNode?: Vec2OrFloat,
131
+ ): Node<"vec2">;
132
+ (
133
+ inLowNode: Vec3OrFloat,
134
+ inHighNode: Vec3OrFloat,
135
+ outLowNode?: Vec3OrFloat,
136
+ outHighNode?: Vec3OrFloat,
137
+ ): Node<"vec3">;
138
+ (
139
+ inLowNode: Vec4OrFloat,
140
+ inHighNode: Vec4OrFloat,
141
+ outLowNode?: Vec4OrFloat,
142
+ outHighNode?: Vec4OrFloat,
143
+ ): Node<"vec4">;
144
+ }
145
+
146
+ interface RemapVec2Extension {
147
+ (
148
+ inLowNode: Vec2OrFloat,
149
+ inHighNode: Vec2OrFloat,
150
+ outLowNode?: Vec2OrFloat,
151
+ outHighNode?: Vec2OrFloat,
152
+ doClamp?: Boolean,
153
+ ): Node<"vec2">;
154
+ }
155
+
156
+ interface RemapClampVec2Extension {
157
+ (
158
+ inLowNode: Vec2OrFloat,
159
+ inHighNode: Vec2OrFloat,
160
+ outLowNode?: Vec2OrFloat,
161
+ outHighNode?: Vec2OrFloat,
162
+ ): Node<"vec2">;
163
+ }
164
+
165
+ interface RemapVec3Extension {
166
+ (
167
+ inLowNode: Vec3OrFloat,
168
+ inHighNode: Vec3OrFloat,
169
+ outLowNode?: Vec3OrFloat,
170
+ outHighNode?: Vec3OrFloat,
171
+ doClamp?: Boolean,
172
+ ): Node<"vec3">;
173
+ }
174
+
175
+ interface RemapClampVec3Extension {
176
+ (
177
+ inLowNode: Vec3OrFloat,
178
+ inHighNode: Vec3OrFloat,
179
+ outLowNode?: Vec3OrFloat,
180
+ outHighNode?: Vec3OrFloat,
181
+ doClamp?: Boolean,
182
+ ): Node<"vec3">;
183
+ }
184
+
185
+ interface RemapVec4Extension {
186
+ (
187
+ inLowNode: Vec4OrFloat,
188
+ inHighNode: Vec4OrFloat,
189
+ outLowNode?: Vec4OrFloat,
190
+ outHighNode?: Vec4OrFloat,
191
+ doClamp?: Boolean,
192
+ ): Node<"vec4">;
193
+ }
194
+
195
+ interface RemapClampVec4Extension {
196
+ (
197
+ inLowNode: Vec4OrFloat,
198
+ inHighNode: Vec4OrFloat,
199
+ outLowNode?: Vec4OrFloat,
200
+ outHighNode?: Vec4OrFloat,
201
+ ): Node<"vec4">;
202
+ }
18
203
 
19
204
  declare module "../core/Node.js" {
20
205
  interface FloatExtensions {
21
- remap: (
22
- inLowNode: Node<"float"> | number,
23
- inHighNode: Node<"float"> | number,
24
- outLowNode?: Node<"float"> | number,
25
- outHighNode?: Node<"float"> | number,
26
- doClamp?: Node<"bool"> | boolean,
27
- ) => Node<"float">;
28
-
29
- remapClamp: (
30
- inLowNode: Node<"float"> | number,
31
- inHighNode: Node<"float"> | number,
32
- outLowNode?: Node<"float"> | number,
33
- outHighNode?: Node<"float"> | number,
34
- ) => Node<"float">;
206
+ remap: RemapFloatExtension;
207
+ remapClamp: RemapClampFloatExtension;
208
+ }
209
+ interface Vec2Extensions {
210
+ remap: RemapVec2Extension;
211
+ remapClamp: RemapClampVec2Extension;
212
+ }
213
+ interface Vec3Extensions {
214
+ remap: RemapVec3Extension;
215
+ remapClamp: RemapClampVec3Extension;
216
+ }
217
+ interface Vec4Extensions {
218
+ remap: RemapVec4Extension;
219
+ remapClamp: RemapClampVec4Extension;
35
220
  }
36
221
  }
222
+
223
+ export {};
@@ -1,16 +1,26 @@
1
1
  import Node from "../core/Node.js";
2
2
 
3
- declare class SampleNode extends Node {
4
- callback: (uv: Node) => Node;
5
- uvNode: Node | null;
3
+ declare interface SampleNodeInterface<TNodeType> {
4
+ callback: (uv: Node<"vec2">) => Node<TNodeType>;
5
+ uvNode: Node<"vec2"> | null;
6
6
 
7
- readonly isSampleNode: true;
7
+ readonly isSampleNode: boolean;
8
8
 
9
- constructor(callback: (uv: Node) => Node, uvNode?: Node | null);
10
-
11
- sample(uv: Node): Node;
9
+ sample(uv: Node<"vec2">): Node<TNodeType>;
12
10
  }
13
11
 
12
+ declare const SampleNode: {
13
+ new<TNodeType>(
14
+ callback: (uv: Node<"vec2">) => Node<TNodeType>,
15
+ uvNode?: Node<"vec2"> | null,
16
+ ): SampleNode<TNodeType>;
17
+ };
18
+
19
+ type SampleNode<TNodeType> = SampleNodeInterface<TNodeType> & Node<TNodeType>;
20
+
14
21
  export default SampleNode;
15
22
 
16
- export const sample: (callback: (uv: Node) => Node, uv?: Node | null) => SampleNode;
23
+ export const sample: <TNodeType>(
24
+ callback: (uv: Node<"vec2">) => Node<TNodeType>,
25
+ uvNode?: Node<"vec2"> | null,
26
+ ) => SampleNode<TNodeType>;
@@ -127,7 +127,7 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
127
127
  * Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer
128
128
  * used in your app.
129
129
  */
130
- dispose(): this;
130
+ dispose(): void;
131
131
 
132
132
  /**
133
133
  * Takes a sort a function that is run before render. The function takes a list of instances to sort and a camera.
@@ -54,14 +54,6 @@ export class InstancedMesh<
54
54
  */
55
55
  instanceMatrix: InstancedBufferAttribute;
56
56
 
57
- /**
58
- * Represents the local transformation of all instances of the previous frame.
59
- * Required for computing velocity. Maintained in {@link InstanceNode}.
60
- *
61
- * @default null
62
- */
63
- previousInstancedMatrix: InstancedBufferAttribute | null;
64
-
65
57
  /**
66
58
  * Represents the colors of all instances.
67
59
  * You have to set {@link InstancedBufferAttribute.needsUpdate | .instanceColor.needsUpdate()} flag to `true` if you modify instanced data via {@link setColorAt | .setColorAt()}.
@@ -63,8 +63,6 @@ export class Skeleton {
63
63
  */
64
64
  boneMatrices: Float32Array | null;
65
65
 
66
- previousBoneMatrices: Float32Array | null;
67
-
68
66
  /**
69
67
  * The {@link THREE.DataTexture | DataTexture} holding the bone data when using a vertex texture.
70
68
  */
@@ -1,7 +1,6 @@
1
1
  import { CoordinateSystem } from "../../constants.js";
2
2
  import NodeBuilder from "../../nodes/core/NodeBuilder.js";
3
3
  import Renderer from "./Renderer.js";
4
- import RenderObject from "./RenderObject.js";
5
4
 
6
5
  declare module "../../core/Object3D.js" {
7
6
  interface Object3D {
@@ -27,6 +26,4 @@ export default abstract class Backend {
27
26
  abstract get coordinateSystem(): CoordinateSystem;
28
27
 
29
28
  getDomElement(): HTMLCanvasElement | OffscreenCanvas;
30
-
31
- createNodeBuilder(renderObject: RenderObject, renderer: Renderer): NodeBuilder;
32
29
  }
@@ -31,49 +31,6 @@ declare class CanvasTarget<TEventMap extends CanvasTargetEventMap = CanvasTarget
31
31
  * @type {HTMLCanvasElement|OffscreenCanvas}
32
32
  */
33
33
  domElement: HTMLCanvasElement | OffscreenCanvas;
34
- /**
35
- * The renderer's pixel ratio.
36
- *
37
- * @private
38
- * @type {number}
39
- * @default 1
40
- */
41
- private _pixelRatio;
42
- /**
43
- * The width of the renderer's default framebuffer in logical pixel unit.
44
- *
45
- * @private
46
- * @type {number}
47
- */
48
- private _width;
49
- /**
50
- * The height of the renderer's default framebuffer in logical pixel unit.
51
- *
52
- * @private
53
- * @type {number}
54
- */
55
- private _height;
56
- /**
57
- * The viewport of the renderer in logical pixel unit.
58
- *
59
- * @private
60
- * @type {Vector4}
61
- */
62
- private _viewport;
63
- /**
64
- * The scissor rectangle of the renderer in logical pixel unit.
65
- *
66
- * @private
67
- * @type {Vector4}
68
- */
69
- private _scissor;
70
- /**
71
- * Whether the scissor test should be enabled or not.
72
- *
73
- * @private
74
- * @type {boolean}
75
- */
76
- private _scissorTest;
77
34
  /**
78
35
  * The color texture of the default framebuffer.
79
36
  *
@@ -189,12 +146,6 @@ declare class CanvasTarget<TEventMap extends CanvasTargetEventMap = CanvasTarget
189
146
  * @param {number} maxDepth - The maximum depth value of the viewport. WebGPU only.
190
147
  */
191
148
  setViewport(x: number, y: number, width: number, height: number, minDepth?: number, maxDepth?: number): void;
192
- /**
193
- * Dispatches the resize event.
194
- *
195
- * @private
196
- */
197
- private _dispatchResize;
198
149
  /**
199
150
  * Frees the GPU-related resources allocated by this instance. Call this
200
151
  * method whenever this instance is no longer used in your app.
@@ -48,6 +48,12 @@ declare class ClippingContext {
48
48
  * @default false
49
49
  */
50
50
  shadowPass: boolean;
51
+ /**
52
+ * The view matrix.
53
+ *
54
+ * @type {Matrix4}
55
+ */
56
+ viewMatrix: Matrix4;
51
57
  /**
52
58
  * The view normal matrix.
53
59
  *
@@ -79,7 +85,6 @@ declare class ClippingContext {
79
85
  * @readonly
80
86
  */
81
87
  readonly parentVersion: number | null;
82
- viewMatrix?: Matrix4;
83
88
  /**
84
89
  * Projects the given source clipping planes and writes the result into the
85
90
  * destination array.
@@ -1,4 +1,5 @@
1
1
  import { RenderTarget, RenderTargetOptions } from "../../core/RenderTarget.js";
2
+ import { CubeTexture } from "../../textures/CubeTexture.js";
2
3
  import { Texture } from "../../textures/Texture.js";
3
4
  import Renderer from "./Renderer.js";
4
5
 
@@ -8,7 +9,7 @@ import Renderer from "./Renderer.js";
8
9
  *
9
10
  * @augments RenderTarget
10
11
  */
11
- declare class CubeRenderTarget extends RenderTarget {
12
+ declare class CubeRenderTarget extends RenderTarget<CubeTexture> {
12
13
  /**
13
14
  * Constructs a new cube render target.
14
15
  *
@@ -1,7 +1,6 @@
1
1
  import { BufferAttribute } from "../../core/BufferAttribute.js";
2
2
  import { Object3D } from "../../core/Object3D.js";
3
3
  import { Texture } from "../../textures/Texture.js";
4
- import ProgrammableStage from "./ProgrammableStage.js";
5
4
  import ReadbackBuffer from "./ReadbackBuffer.js";
6
5
 
7
6
  /**
@@ -79,50 +78,47 @@ declare class Info {
79
78
  *
80
79
  * @type {Object}
81
80
  * @readonly
82
- * @property {number} geometries - The number of active geometries.
83
- * @property {number} textures - The number of active textures.
84
81
  * @property {number} attributes - The number of active attributes.
82
+ * @property {number} attributesSize - The memory size of active attributes in bytes.
83
+ * @property {number} geometries - The number of active geometries.
85
84
  * @property {number} indexAttributes - The number of active index attributes.
86
- * @property {number} storageAttributes - The number of active storage attributes.
85
+ * @property {number} indexAttributesSize - The memory size of active index attributes in bytes.
87
86
  * @property {number} indirectStorageAttributes - The number of active indirect storage attributes.
88
- * @property {number} readbackBuffers - The number of active readback buffers.
87
+ * @property {number} indirectStorageAttributesSize - The memory size of active indirect storage attributes in bytes.
89
88
  * @property {number} programs - The number of active programs.
89
+ * @property {number} programsSize - The memory size of active programs in bytes.
90
+ * @property {number} readbackBuffers - The number of active readback buffers.
91
+ * @property {number} readbackBuffersSize - The memory size of active readback buffers in bytes.
90
92
  * @property {number} renderTargets - The number of active renderTargets.
91
- * @property {number} total - The total memory size in bytes.
92
- * @property {number} texturesSize - The memory size of active textures in bytes.
93
- * @property {number} attributesSize - The memory size of active attributes in bytes.
94
- * @property {number} indexAttributesSize - The memory size of active index attributes in bytes.
93
+ * @property {number} storageAttributes - The number of active storage attributes.
95
94
  * @property {number} storageAttributesSize - The memory size of active storage attributes in bytes.
96
- * @property {number} indirectStorageAttributesSize - The memory size of active indirect storage attributes in bytes.
97
- * @property {number} readbackBuffersSize - The memory size of active readback buffers in bytes.
98
- * @property {number} programsSize - The memory size of active programs in bytes.
95
+ * @property {number} textures - The number of active textures.
96
+ * @property {number} texturesSize - The memory size of active textures in bytes.
97
+ * @property {number} uniformBuffers - The number of active uniform buffers.
98
+ * @property {number} uniformBuffersSize - The memory size of active uniform buffers in bytes.
99
+ * @property {number} total - The total memory size in bytes.
99
100
  */
100
101
  readonly memory: {
101
- geometries: number;
102
- textures: number;
103
102
  attributes: number;
103
+ attributesSize: number;
104
+ geometries: number;
104
105
  indexAttributes: number;
105
- storageAttributes: number;
106
+ indexAttributesSize: number;
106
107
  indirectStorageAttributes: number;
107
- readbackBuffers: number;
108
+ indirectStorageAttributesSize: number;
108
109
  programs: number;
110
+ programsSize: number;
111
+ readbackBuffers: number;
112
+ readbackBuffersSize: number;
109
113
  renderTargets: number;
110
- total: number;
111
- texturesSize: number;
112
- attributesSize: number;
113
- indexAttributesSize: number;
114
+ storageAttributes: number;
114
115
  storageAttributesSize: number;
115
- indirectStorageAttributesSize: number;
116
- readbackBuffersSize: number;
117
- programsSize: number;
116
+ textures: number;
117
+ texturesSize: number;
118
+ uniformBuffers: number;
119
+ uniformBuffersSize: number;
120
+ total: number;
118
121
  };
119
- /**
120
- * Map for storing calculated byte sizes of tracked objects.
121
- *
122
- * @type {Map<Object, number>}
123
- * @private
124
- */
125
- private memoryMap;
126
122
  /**
127
123
  * This method should be executed per draw call and updates the corresponding metrics.
128
124
  *
@@ -151,14 +147,6 @@ declare class Info {
151
147
  * @param {Texture} texture
152
148
  */
153
149
  destroyTexture(texture: Texture): void;
154
- /**
155
- * Tracks attribute memory explicitly, updating counts and byte tracking.
156
- *
157
- * @param {BufferAttribute} attribute
158
- * @param {string} type - type of attribute
159
- * @private
160
- */
161
- private _createAttribute;
162
150
  /**
163
151
  * Tracks a regular attribute memory explicitly.
164
152
  *
@@ -201,34 +189,6 @@ declare class Info {
201
189
  * @param {ReadbackBuffer} readbackBuffer - The readback buffer to track.
202
190
  */
203
191
  destroyReadbackBuffer(readbackBuffer: ReadbackBuffer): void;
204
- /**
205
- * Tracks program memory explicitly, updating counts and byte tracking.
206
- *
207
- * @param {ProgrammableStage} program - The program to track.
208
- */
209
- createProgram(program: ProgrammableStage): void;
210
- /**
211
- * Tracks program memory explicitly, updating counts and byte tracking.
212
- *
213
- * @param {Object} program - The program to track.
214
- */
215
- destroyProgram(program: ProgrammableStage): void;
216
- /**
217
- * Calculates the memory size of a texture in bytes.
218
- *
219
- * @param {Texture} texture - The texture to calculate the size for.
220
- * @return {number} The calculated size in bytes.
221
- * @private
222
- */
223
- private _getTextureMemorySize;
224
- /**
225
- * Calculates the memory size of an attribute in bytes.
226
- *
227
- * @param {BufferAttribute} attribute - The attribute to calculate the size for.
228
- * @return {number} The calculated size in bytes.
229
- * @private
230
- */
231
- private _getAttributeMemorySize;
232
192
  }
233
193
 
234
194
  export default Info;