@types/three 0.168.0 → 0.170.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 (213) hide show
  1. three/README.md +1 -1
  2. three/build/three.webgpu.nodes.d.ts +1 -0
  3. three/build/three.webgpu.nodes.min.d.ts +1 -0
  4. three/examples/jsm/Addons.d.ts +3 -10
  5. three/examples/jsm/animation/MMDAnimationHelper.d.ts +4 -0
  6. three/examples/jsm/animation/MMDPhysics.d.ts +4 -0
  7. three/examples/jsm/controls/ArcballControls.d.ts +1 -1
  8. three/examples/jsm/controls/DragControls.d.ts +0 -15
  9. three/examples/jsm/controls/TransformControls.d.ts +195 -24
  10. three/examples/jsm/csm/CSMFrustum.d.ts +8 -2
  11. three/examples/jsm/csm/CSMHelper.d.ts +2 -1
  12. three/examples/jsm/csm/CSMShadowNode.d.ts +46 -0
  13. three/examples/jsm/curves/NURBSCurve.d.ts +12 -1
  14. three/examples/jsm/exporters/EXRExporter.d.ts +7 -2
  15. three/examples/jsm/exporters/GLTFExporter.d.ts +20 -3
  16. three/examples/jsm/exporters/KTX2Exporter.d.ts +3 -1
  17. three/examples/jsm/exporters/MMDExporter.d.ts +4 -0
  18. three/examples/jsm/exporters/USDZExporter.d.ts +4 -0
  19. three/examples/jsm/geometries/DecalGeometry.d.ts +9 -3
  20. three/examples/jsm/geometries/TeapotGeometry.d.ts +2 -2
  21. three/examples/jsm/helpers/LightProbeHelper.d.ts +5 -3
  22. three/examples/jsm/helpers/LightProbeHelperGPU.d.ts +12 -0
  23. three/examples/jsm/helpers/TextureHelperGPU.d.ts +10 -0
  24. three/examples/jsm/lighting/TiledLighting.d.ts +10 -0
  25. three/examples/jsm/lights/LightProbeGenerator.d.ts +5 -1
  26. three/examples/jsm/lines/Line2.d.ts +15 -1
  27. three/examples/jsm/lines/LineGeometry.d.ts +18 -1
  28. three/examples/jsm/lines/LineMaterial.d.ts +65 -12
  29. three/examples/jsm/lines/LineSegments2.d.ts +25 -2
  30. three/examples/jsm/lines/LineSegmentsGeometry.d.ts +46 -9
  31. three/examples/jsm/lines/Wireframe.d.ts +5 -2
  32. three/examples/jsm/lines/WireframeGeometry2.d.ts +1 -1
  33. three/examples/jsm/lines/webgpu/Wireframe.d.ts +13 -0
  34. three/examples/jsm/loaders/DRACOLoader.d.ts +6 -0
  35. three/examples/jsm/loaders/EXRLoader.d.ts +2 -2
  36. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -2
  37. three/examples/jsm/loaders/KTX2Loader.d.ts +1 -0
  38. three/examples/jsm/loaders/LDrawLoader.d.ts +10 -0
  39. three/examples/jsm/loaders/MMDLoader.d.ts +4 -0
  40. three/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts +9 -0
  41. three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts +9 -0
  42. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +0 -1
  43. three/examples/jsm/math/ColorSpaces.d.ts +11 -0
  44. three/examples/jsm/misc/ProgressiveLightMap.d.ts +8 -10
  45. three/examples/jsm/misc/ProgressiveLightMapGPU.d.ts +27 -0
  46. three/examples/jsm/modifiers/CurveModifier.d.ts +7 -3
  47. three/examples/jsm/modifiers/CurveModifierGPU.d.ts +31 -0
  48. three/examples/jsm/objects/Lensflare.d.ts +13 -9
  49. three/examples/jsm/objects/LensflareMesh.d.ts +21 -0
  50. three/examples/jsm/renderers/SVGRenderer.d.ts +2 -2
  51. three/{src/nodes → examples/jsm/tsl}/display/AfterImageNode.d.ts +1 -5
  52. three/{src/nodes → examples/jsm/tsl}/display/AnaglyphPassNode.d.ts +2 -3
  53. three/{src/nodes → examples/jsm/tsl}/display/AnamorphicNode.d.ts +2 -4
  54. three/examples/jsm/tsl/display/BleachBypass.d.ts +3 -0
  55. three/{src/nodes → examples/jsm/tsl}/display/BloomNode.d.ts +1 -5
  56. three/{src/nodes → examples/jsm/tsl}/display/DenoiseNode.d.ts +2 -6
  57. three/{src/nodes → examples/jsm/tsl}/display/DepthOfFieldNode.d.ts +1 -5
  58. three/{src/nodes → examples/jsm/tsl}/display/DotScreenNode.d.ts +2 -5
  59. three/{src/nodes → examples/jsm/tsl}/display/FXAANode.d.ts +1 -3
  60. three/{src/nodes → examples/jsm/tsl}/display/FilmNode.d.ts +1 -3
  61. three/{src/nodes → examples/jsm/tsl}/display/GTAONode.d.ts +2 -8
  62. three/{src/nodes → examples/jsm/tsl}/display/GaussianBlurNode.d.ts +13 -5
  63. three/examples/jsm/tsl/display/LensflareNode.d.ts +35 -0
  64. three/{src/nodes → examples/jsm/tsl}/display/Lut3DNode.d.ts +2 -6
  65. three/{src/nodes → examples/jsm/tsl}/display/MotionBlur.d.ts +1 -2
  66. three/examples/jsm/tsl/display/OutlineNode.d.ts +32 -0
  67. three/{src/nodes → examples/jsm/tsl}/display/ParallaxBarrierPassNode.d.ts +2 -3
  68. three/{src/nodes → examples/jsm/tsl}/display/PixelationPassNode.d.ts +2 -5
  69. three/{src/nodes → examples/jsm/tsl}/display/RGBShiftNode.d.ts +1 -4
  70. three/examples/jsm/tsl/display/SMAANode.d.ts +17 -0
  71. three/{src/nodes → examples/jsm/tsl}/display/SSAAPassNode.d.ts +2 -7
  72. three/examples/jsm/tsl/display/SSRNode.d.ts +38 -0
  73. three/examples/jsm/tsl/display/Sepia.d.ts +3 -0
  74. three/{src/nodes → examples/jsm/tsl}/display/SobelOperatorNode.d.ts +1 -3
  75. three/{src/nodes → examples/jsm/tsl}/display/StereoCompositePassNode.d.ts +2 -5
  76. three/{src/nodes → examples/jsm/tsl}/display/StereoPassNode.d.ts +2 -5
  77. three/examples/jsm/tsl/display/TRAAPassNode.d.ts +15 -0
  78. three/{src/nodes → examples/jsm/tsl}/display/TransitionNode.d.ts +1 -5
  79. three/examples/jsm/tsl/display/hashBlur.d.ts +7 -0
  80. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +22 -0
  81. three/examples/jsm/utils/GeometryCompressionUtils.d.ts +20 -4
  82. three/examples/jsm/utils/ShadowMapViewer.d.ts +8 -6
  83. three/examples/jsm/utils/ShadowMapViewerGPU.d.ts +26 -0
  84. three/examples/jsm/utils/SkeletonUtils.d.ts +25 -5
  85. three/examples/jsm/utils/WebGPUTextureUtils.d.ts +3 -0
  86. three/package.json +4 -3
  87. three/src/Three.WebGPU.Nodes.d.ts +205 -0
  88. three/src/Three.WebGPU.d.ts +7 -2
  89. three/src/Three.d.ts +2 -7
  90. three/src/audio/Audio.d.ts +4 -1
  91. three/src/constants.d.ts +1 -9
  92. three/src/core/BufferAttribute.d.ts +0 -15
  93. three/src/core/BufferGeometry.d.ts +13 -2
  94. three/src/core/InterleavedBuffer.d.ts +0 -12
  95. three/src/core/Object3D.d.ts +1 -1
  96. three/src/core/Raycaster.d.ts +2 -1
  97. three/src/core/RenderTarget.d.ts +1 -2
  98. three/src/extras/Controls.d.ts +3 -3
  99. three/src/loaders/FileLoader.d.ts +3 -3
  100. three/src/loaders/MaterialLoader.d.ts +2 -0
  101. three/src/loaders/nodes/NodeLoader.d.ts +5 -0
  102. three/src/loaders/nodes/NodeMaterialLoader.d.ts +3 -0
  103. three/src/loaders/nodes/NodeObjectLoader.d.ts +12 -0
  104. three/src/materials/LineBasicMaterial.d.ts +0 -5
  105. three/src/materials/LineDashedMaterial.d.ts +0 -5
  106. three/src/materials/Material.d.ts +4 -6
  107. three/src/materials/MeshBasicMaterial.d.ts +0 -5
  108. three/src/materials/MeshDepthMaterial.d.ts +0 -5
  109. three/src/materials/MeshDistanceMaterial.d.ts +0 -5
  110. three/src/materials/MeshLambertMaterial.d.ts +0 -5
  111. three/src/materials/MeshMatcapMaterial.d.ts +0 -5
  112. three/src/materials/MeshNormalMaterial.d.ts +0 -5
  113. three/src/materials/MeshPhongMaterial.d.ts +0 -5
  114. three/src/materials/MeshPhysicalMaterial.d.ts +0 -5
  115. three/src/materials/MeshStandardMaterial.d.ts +0 -5
  116. three/src/materials/MeshToonMaterial.d.ts +0 -5
  117. three/src/materials/PointsMaterial.d.ts +0 -5
  118. three/src/materials/RawShaderMaterial.d.ts +0 -2
  119. three/src/materials/ShaderMaterial.d.ts +0 -5
  120. three/src/materials/ShadowMaterial.d.ts +0 -5
  121. three/src/materials/SpriteMaterial.d.ts +0 -5
  122. three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +2 -2
  123. three/src/materials/nodes/NodeMaterial.d.ts +4 -4
  124. three/src/materials/nodes/NodeMaterials.d.ts +19 -16
  125. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +96 -0
  126. three/src/math/Color.d.ts +39 -22
  127. three/src/math/ColorManagement.d.ts +24 -24
  128. three/src/math/Quaternion.d.ts +4 -3
  129. three/src/math/Triangle.d.ts +24 -0
  130. three/src/math/Vector4.d.ts +2 -0
  131. three/src/nodes/Nodes.d.ts +3 -23
  132. three/src/nodes/TSL.d.ts +75 -187
  133. three/src/nodes/accessors/BufferAttributeNode.d.ts +1 -0
  134. three/src/nodes/accessors/Camera.d.ts +0 -1
  135. three/src/nodes/accessors/MaterialNode.d.ts +0 -1
  136. three/src/nodes/accessors/ModelNode.d.ts +7 -3
  137. three/src/nodes/accessors/Normal.d.ts +6 -0
  138. three/src/nodes/accessors/Object3DNode.d.ts +1 -5
  139. three/src/nodes/accessors/SceneNode.d.ts +2 -0
  140. three/src/nodes/accessors/UniformArrayNode.d.ts +2 -2
  141. three/src/nodes/accessors/VelocityNode.d.ts +6 -1
  142. three/src/nodes/code/ScriptableNode.d.ts +1 -1
  143. three/src/nodes/core/Node.d.ts +3 -12
  144. three/src/nodes/core/NodeUtils.d.ts +5 -1
  145. three/src/nodes/core/StackNode.d.ts +4 -4
  146. three/src/nodes/core/StructTypeNode.d.ts +1 -0
  147. three/src/nodes/core/UniformNode.d.ts +1 -0
  148. three/src/nodes/core/VarNode.d.ts +12 -1
  149. three/src/nodes/display/ColorAdjustment.d.ts +29 -0
  150. three/src/nodes/display/ColorSpaceFunctions.d.ts +2 -2
  151. three/src/nodes/display/ColorSpaceNode.d.ts +33 -8
  152. three/src/nodes/display/RenderOutputNode.d.ts +4 -4
  153. three/src/nodes/display/ScreenNode.d.ts +48 -0
  154. three/src/nodes/display/ToneMappingFunctions.d.ts +6 -6
  155. three/src/nodes/display/ToonOutlinePassNode.d.ts +24 -0
  156. three/src/nodes/display/ViewportDepthNode.d.ts +2 -0
  157. three/src/nodes/functions/material/getAlphaHashThreshold.d.ts +6 -0
  158. three/src/nodes/functions/material/getParallaxCorrectNormal.d.ts +10 -0
  159. three/src/nodes/functions/material/getShIrradianceAt.d.ts +6 -0
  160. three/src/nodes/gpgpu/ComputeNode.d.ts +5 -0
  161. three/src/nodes/lighting/LightsNode.d.ts +7 -2
  162. three/src/nodes/lighting/PointLightNode.d.ts +11 -1
  163. three/src/nodes/lighting/ShadowNode.d.ts +12 -0
  164. three/src/nodes/utils/Discard.d.ts +1 -1
  165. three/src/nodes/utils/Oscillators.d.ts +7 -0
  166. three/src/nodes/utils/PostProcessingUtils.d.ts +45 -0
  167. three/src/nodes/utils/ReflectorNode.d.ts +17 -4
  168. three/src/nodes/utils/Timer.d.ts +21 -0
  169. three/src/objects/BatchedMesh.d.ts +78 -0
  170. three/src/objects/Group.d.ts +0 -6
  171. three/src/objects/LOD.d.ts +7 -0
  172. three/src/renderers/WebGLRenderer.d.ts +24 -23
  173. three/src/renderers/common/BundleGroup.d.ts +10 -0
  174. three/src/renderers/common/ClippingContext.d.ts +1 -1
  175. three/src/renderers/common/Constants.d.ts +2 -1
  176. three/src/renderers/common/Geometries.d.ts +1 -0
  177. three/src/renderers/common/IndirectStorageBufferAttribute.d.ts +10 -0
  178. three/src/renderers/common/Lighting.d.ts +15 -0
  179. three/src/renderers/common/PostProcessingUtils.d.ts +66 -0
  180. three/src/renderers/common/RenderBundles.d.ts +3 -3
  181. three/src/renderers/common/RenderContext.d.ts +2 -2
  182. three/src/renderers/common/RenderList.d.ts +7 -3
  183. three/src/renderers/common/RenderLists.d.ts +3 -1
  184. three/src/renderers/common/RenderObject.d.ts +20 -1
  185. three/src/renderers/common/Renderer.d.ts +43 -10
  186. three/src/renderers/common/extras/PMREMGenerator.d.ts +5 -1
  187. three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -2
  188. three/src/renderers/common/nodes/NodeLibrary.d.ts +0 -7
  189. three/src/renderers/common/nodes/Nodes.d.ts +8 -0
  190. three/src/renderers/webgl/WebGLCapabilities.d.ts +13 -0
  191. three/src/renderers/webgl/WebGLPrograms.d.ts +4 -10
  192. three/src/renderers/webgl/WebGLState.d.ts +13 -10
  193. three/src/renderers/webgl/WebGLUtils.d.ts +2 -2
  194. three/src/renderers/webgpu/WebGPURenderer.Nodes.d.ts +12 -0
  195. three/src/renderers/webgpu/WebGPURenderer.d.ts +7 -3
  196. three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +5 -0
  197. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +5 -0
  198. three/src/textures/CompressedTexture.d.ts +1 -2
  199. three/src/textures/CubeTexture.d.ts +1 -2
  200. three/src/textures/DataTexture.d.ts +1 -2
  201. three/src/textures/Texture.d.ts +3 -4
  202. three/examples/jsm/cameras/CinematicCamera.d.ts +0 -34
  203. three/examples/jsm/geometries/SDFGeometryGenerator.d.ts +0 -16
  204. three/examples/jsm/loaders/TiltLoader.d.ts +0 -7
  205. three/examples/jsm/utils/GPUStatsPanel.d.ts +0 -12
  206. three/examples/jsm/utils/PackedPhongMaterial.d.ts +0 -10
  207. three/src/nodes/display/BleachBypass.d.ts +0 -4
  208. three/src/nodes/display/Sepia.d.ts +0 -4
  209. three/src/nodes/display/ViewportNode.d.ts +0 -38
  210. three/src/nodes/utils/OscNode.d.ts +0 -25
  211. three/src/nodes/utils/TimerNode.d.ts +0 -25
  212. three/src/renderers/common/StandardRenderer.d.ts +0 -12
  213. /three/examples/jsm/utils/{TextureUtils.d.ts → WebGLTextureUtils.d.ts} +0 -0
@@ -10,11 +10,22 @@ export default class VarNode extends Node {
10
10
  constructor(node: Node, name?: string | null);
11
11
  }
12
12
 
13
+ declare module "../tsl/TSLCore.js" {
14
+ interface NodeElements {
15
+ toVar: (node: NodeRepresentation, name?: string | null) => ShaderNodeObject<VarNode>;
16
+ }
17
+ }
18
+
19
+ /**
20
+ * @deprecated Use ".toVar()" instead.
21
+ */
13
22
  export const temp: (node: NodeRepresentation, name?: string | null) => ShaderNodeObject<VarNode>;
14
23
 
15
24
  declare module "../tsl/TSLCore.js" {
16
25
  interface NodeElements {
26
+ /**
27
+ * @deprecated Use ".toVar()" instead.
28
+ */
17
29
  temp: typeof temp;
18
- toVar: typeof temp;
19
30
  }
20
31
  }
@@ -25,3 +25,32 @@ export const luminance: (
25
25
  ) => ShaderNodeObject<MathNode>;
26
26
 
27
27
  export const threshold: (color: NodeRepresentation, thershold: NodeRepresentation) => ShaderNodeObject<MathNode>;
28
+
29
+ /**
30
+ * Color Decision List (CDL) v1.2
31
+ *
32
+ * Compact representation of color grading information, defined by slope, offset, power, and saturation. The CDL should
33
+ * be typically be given input in a log space (such as LogC, ACEScc, or AgX Log), and will return output in the same
34
+ * space. Output may require clamping >=0.
35
+ *
36
+ * References:
37
+ * - ASC CDL v1.2
38
+ * - https://blender.stackexchange.com/a/55239/43930
39
+ * - https://docs.acescentral.com/specifications/acescc/
40
+ *
41
+ * @param color Input (-Infinity < input < +Infinity)
42
+ * @param slope Slope (0 ≤ slope < +Infinity)
43
+ * @param offset Offset (-Infinity < offset < +Infinity; typically -1 < offset < 1)
44
+ * @param power Power (0 < power < +Infinity)
45
+ * @param saturation Saturation (0 ≤ saturation < +Infinity; typically 0 ≤ saturation < 4)
46
+ * @param luminanceCoefficients Luminance coefficients for saturation term, typically Rec. 709
47
+ * @return Output, -Infinity < output < +Infinity
48
+ */
49
+ export const cdl: (
50
+ color: NodeRepresentation,
51
+ slope?: NodeRepresentation,
52
+ offset?: NodeRepresentation,
53
+ power?: NodeRepresentation,
54
+ saturation?: NodeRepresentation,
55
+ luminanceCoefficients?: NodeRepresentation,
56
+ ) => ShaderNodeObject<Node>;
@@ -1,6 +1,6 @@
1
1
  import Node from "../core/Node.js";
2
2
  import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
- export const sRGBToLinear: (color: NodeRepresentation) => ShaderNodeObject<Node>;
4
+ export const sRGBTransferEOTF: (color: NodeRepresentation) => ShaderNodeObject<Node>;
5
5
 
6
- export const LinearTosRGB: (color: NodeRepresentation) => ShaderNodeObject<Node>;
6
+ export const sRGBTransferOETF: (color: NodeRepresentation) => ShaderNodeObject<Node>;
@@ -1,35 +1,60 @@
1
- import { ColorSpace, LinearSRGBColorSpace, SRGBColorSpace } from "../../constants.js";
1
+ import { LinearSRGBColorSpace, SRGBColorSpace } from "../../constants.js";
2
2
  import Node from "../core/Node.js";
3
+ import NodeBuilder from "../core/NodeBuilder.js";
3
4
  import TempNode from "../core/TempNode.js";
4
5
  import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
5
6
 
7
+ export type WorkingOrOutputColorSpace = "WorkingColorSpace" | "OutputColorSpace";
8
+
6
9
  export type ColorSpaceMethod = "LinearTosRGB" | "sRGBToLinear" | "LinearToLinear" | "sRGBTosRGB";
7
10
 
8
- export const getColorSpaceMethod: (
11
+ export function getColorSpaceMethod(
9
12
  source: typeof LinearSRGBColorSpace | typeof SRGBColorSpace,
10
13
  target: typeof LinearSRGBColorSpace | typeof SRGBColorSpace,
11
- ) => ColorSpaceMethod;
14
+ ): ColorSpaceMethod;
12
15
 
13
16
  export default class ColorSpaceNode extends TempNode {
14
17
  colorNode: Node;
15
- target: ColorSpace | null;
16
- source: ColorSpace | null;
18
+ source: string;
19
+ target: string;
20
+
21
+ constructor(
22
+ colorNode: Node,
23
+ source: string,
24
+ target: string,
25
+ );
17
26
 
18
- constructor(colorNode: Node, target?: ColorSpace | null, source?: ColorSpace | null);
27
+ resolveColorSpace(nodeBuilder: NodeBuilder, colorSpace: WorkingOrOutputColorSpace): string;
19
28
  }
20
29
 
21
30
  export const toOutputColorSpace: (
22
31
  node: NodeRepresentation,
23
- colorSpace?: ColorSpace | null,
24
32
  ) => ShaderNodeObject<ColorSpaceNode>;
25
33
  export const toWorkingColorSpace: (
26
34
  node: NodeRepresentation,
27
- colorSpace?: ColorSpace | null,
35
+ ) => ShaderNodeObject<ColorSpaceNode>;
36
+
37
+ export const workingToColorSpace: (
38
+ node: NodeRepresentation,
39
+ colorSpace: string,
40
+ ) => ShaderNodeObject<ColorSpaceNode>;
41
+ export const colorSpaceToWorking: (
42
+ node: NodeRepresentation,
43
+ colorSpace: string,
44
+ ) => ShaderNodeObject<ColorSpaceNode>;
45
+
46
+ export const convertColorSpace: (
47
+ node: NodeRepresentation,
48
+ sourceColorSpace: string,
49
+ targetColorSpace: string,
28
50
  ) => ShaderNodeObject<ColorSpaceNode>;
29
51
 
30
52
  declare module "../tsl/TSLCore.js" {
31
53
  interface NodeElements {
32
54
  toOutputColorSpace: typeof toOutputColorSpace;
33
55
  toWorkingColorSpace: typeof toWorkingColorSpace;
56
+
57
+ workingToColorSpace: typeof workingToColorSpace;
58
+ colorSpaceToWorking: typeof colorSpaceToWorking;
34
59
  }
35
60
  }
@@ -1,4 +1,4 @@
1
- import { ColorSpace, ToneMapping } from "../../constants.js";
1
+ import { ToneMapping } from "../../constants.js";
2
2
  import Node from "../core/Node.js";
3
3
  import TempNode from "../core/TempNode.js";
4
4
  import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
@@ -6,11 +6,11 @@ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
6
6
  declare class RenderOutputNode extends TempNode {
7
7
  colorNode: Node;
8
8
  toneMapping: ToneMapping | null;
9
- outputColorSpace: ColorSpace | null;
9
+ outputColorSpace: string | null;
10
10
 
11
11
  readonly isRenderOutput: true;
12
12
 
13
- constructor(colorNode: Node, toneMapping?: ToneMapping | null, outputColorSpace?: ColorSpace | null);
13
+ constructor(colorNode: Node, toneMapping?: ToneMapping | null, outputColorSpace?: string | null);
14
14
  }
15
15
 
16
16
  export default RenderOutputNode;
@@ -18,7 +18,7 @@ export default RenderOutputNode;
18
18
  export const renderOutput: (
19
19
  color: NodeRepresentation,
20
20
  toneMapping?: ToneMapping | null,
21
- outputColorSpace?: ColorSpace | null,
21
+ outputColorSpace?: string | null,
22
22
  ) => ShaderNodeObject<RenderOutputNode>;
23
23
 
24
24
  declare module "../tsl/TSLCore.js" {
@@ -0,0 +1,48 @@
1
+ import Node from "../core/Node.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ export type ScreenNodeScope =
5
+ | typeof ScreenNode.COORDINATE
6
+ | typeof ScreenNode.VIEWPORT
7
+ | typeof ScreenNode.SIZE
8
+ | typeof ScreenNode.UV;
9
+
10
+ declare class ScreenNode extends Node {
11
+ scope: ScreenNodeScope;
12
+
13
+ readonly isViewportNode: true;
14
+
15
+ constructor(scope: ScreenNodeScope);
16
+
17
+ static COORDINATE: "coordinate";
18
+ static VIEWPORT: "viewport";
19
+ static SIZE: "size";
20
+ static UV: "uv";
21
+ }
22
+
23
+ export default ScreenNode;
24
+
25
+ // Screen
26
+
27
+ export const screenUV: ShaderNodeObject<ScreenNode>;
28
+ export const screenSize: ShaderNodeObject<ScreenNode>;
29
+ export const screenCoordinate: ShaderNodeObject<ScreenNode>;
30
+
31
+ // Viewport
32
+
33
+ export const viewport: ShaderNodeObject<ScreenNode>;
34
+ export const viewportSize: ShaderNodeObject<Node>;
35
+ export const viewportCoordinate: ShaderNodeObject<Node>;
36
+ export const viewportUV: ShaderNodeObject<Node>;
37
+
38
+ // Deprecated
39
+
40
+ /**
41
+ * @deprecated "viewportTopLeft" is deprecated. Use "viewportUV" instead.
42
+ */
43
+ export const viewportTopLeft: ShaderNodeObject<ScreenNode>;
44
+
45
+ /**
46
+ * @deprecated "viewportBottomLeft" is deprecated. Use "viewportUV.flipY()" instead.
47
+ */
48
+ export const viewportBottomLeft: ShaderNodeObject<ScreenNode>;
@@ -1,14 +1,14 @@
1
1
  import Node from "../core/Node.js";
2
2
  import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
- export const LinearToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
4
+ export const linearToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
5
5
 
6
- export const ReinhardToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
6
+ export const reinhardToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
7
7
 
8
- export const CineonToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
8
+ export const cineonToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
9
9
 
10
- export const ACESFilmicToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
10
+ export const acesFilmicToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
11
11
 
12
- export const AgXToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
12
+ export const agxToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
13
13
 
14
- export const NeutralToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
14
+ export const neutralToneMapping: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>;
@@ -0,0 +1,24 @@
1
+ import { Camera } from "../../cameras/Camera.js";
2
+ import { Color } from "../../math/Color.js";
3
+ import { Scene } from "../../scenes/Scene.js";
4
+ import Node from "../core/Node.js";
5
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
6
+ import PassNode from "./PassNode.js";
7
+
8
+ declare class ToonOutlinePassNode extends PassNode {
9
+ colorNode: Node;
10
+ thicknessNode: Node;
11
+ alphaNode: Node;
12
+
13
+ constructor(scene: Scene, camera: Camera, colorNode: Node, thicknessNode: Node, alphaNode: Node);
14
+ }
15
+
16
+ export default ToonOutlinePassNode;
17
+
18
+ export const toonOutlinePass: (
19
+ scene: Scene,
20
+ camera: Camera,
21
+ color?: Color,
22
+ thickness?: number,
23
+ alpha?: number,
24
+ ) => ShaderNodeObject<ToonOutlinePassNode>;
@@ -29,6 +29,8 @@ export const viewZToPerspectiveDepth: (viewZ: Node, near: Node, far: Node) => No
29
29
 
30
30
  export const perspectiveDepthToViewZ: (depth: Node, near: Node, far: Node) => Node;
31
31
 
32
+ export const perspectiveDepthToLogarithmicDepth: (perspectiveW: Node, near: Node, far: Node) => Node;
33
+
32
34
  export const depth: ShaderNodeObject<ViewportDepthNode>;
33
35
  export const linearDepth: (valueNode?: Node | null) => ShaderNodeObject<ViewportDepthNode>;
34
36
  export const viewportLinearDepth: ShaderNodeObject<ViewportDepthNode>;
@@ -0,0 +1,6 @@
1
+ import Node from "../../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../../tsl/TSLCore.js";
3
+
4
+ declare const getAlphaHashThreshold: (position: NodeRepresentation) => ShaderNodeObject<Node>;
5
+
6
+ export default getAlphaHashThreshold;
@@ -0,0 +1,10 @@
1
+ import Node from "../../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../../tsl/TSLCore.js";
3
+
4
+ declare const getParallaxCorrectNormal: (
5
+ normal: NodeRepresentation,
6
+ cubeSize: NodeRepresentation,
7
+ cubePos: NodeRepresentation,
8
+ ) => ShaderNodeObject<Node>;
9
+
10
+ export default getParallaxCorrectNormal;
@@ -0,0 +1,6 @@
1
+ import Node from "../../core/Node.js";
2
+ import { ShaderNodeObject } from "../../tsl/TSLCore.js";
3
+
4
+ declare const getShIrradianceAt: (normal: Node, shCoefficients: Node) => ShaderNodeObject<Node>;
5
+
6
+ export default getShIrradianceAt;
@@ -1,3 +1,4 @@
1
+ import Renderer from "../../renderers/common/Renderer.js";
1
2
  import Node from "../core/Node.js";
2
3
  import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
4
 
@@ -8,7 +9,11 @@ export default class ComputeNode extends Node {
8
9
  workgroupSize: number[];
9
10
  dispatchCount: number;
10
11
 
12
+ onInitFunction: ((args: { renderer: Renderer }) => void) | null;
13
+
11
14
  constructor(computeNode: Node, count: number, workgroupSize?: number[]);
15
+
16
+ onInit(callback: ((args: { renderer: Renderer }) => void) | null): void;
12
17
  }
13
18
 
14
19
  export const compute: (
@@ -2,17 +2,22 @@ import { Light } from "../../lights/Light.js";
2
2
  import Node from "../core/Node.js";
3
3
  import { NodeBuilder } from "../Nodes.js";
4
4
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
5
+ import LightNode from "./LightNode.js";
5
6
 
6
7
  declare class LightsNode extends Node {
7
- constructor(lights?: Light[]);
8
+ constructor();
8
9
 
9
10
  setupLightsNode(builder: NodeBuilder): void;
10
11
 
12
+ setupLights(builder: NodeBuilder, lightNodes: LightNode[]): void;
13
+
11
14
  setLights(lights: Light[]): this;
12
15
 
13
16
  getLights(): Light[];
17
+
18
+ get hasLights(): boolean;
14
19
  }
15
20
 
16
21
  export default LightsNode;
17
22
 
18
- export const lights: (lights: Light[]) => ShaderNodeObject<LightsNode>;
23
+ export const lights: (lights?: Light[]) => ShaderNodeObject<LightsNode>;
@@ -1,10 +1,20 @@
1
1
  import { PointLight } from "../../lights/PointLight.js";
2
2
  import Node from "../core/Node.js";
3
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
4
  import AnalyticLightNode from "./AnalyticLightNode.js";
4
5
 
5
- export default class PointLightNode extends AnalyticLightNode<PointLight> {
6
+ export const directPointLight: (
7
+ color: NodeRepresentation,
8
+ lightViewPosition: NodeRepresentation,
9
+ cutoffDistance: NodeRepresentation,
10
+ decayExponent: NodeRepresentation,
11
+ ) => ShaderNodeObject<Node>;
12
+
13
+ declare class PointLightNode extends AnalyticLightNode<PointLight> {
6
14
  cutoffDistanceNode: Node;
7
15
  decayExponentNode: Node;
8
16
 
9
17
  constructor(light?: PointLight | null);
10
18
  }
19
+
20
+ export default PointLightNode;
@@ -0,0 +1,12 @@
1
+ import { Light } from "../../lights/Light.js";
2
+ import { LightShadow } from "../../lights/LightShadow.js";
3
+ import Node from "../core/Node.js";
4
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
5
+
6
+ declare class ShadowNode extends Node {
7
+ constructor(light: Light, shadow: LightShadow);
8
+ }
9
+
10
+ export default ShadowNode;
11
+
12
+ export const shadow: (light: Light, shadow: LightShadow) => ShaderNodeObject<ShadowNode>;
@@ -1,7 +1,7 @@
1
1
  import Node from "../core/Node.js";
2
2
  import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
3
 
4
- export const Discard: (conditional: NodeRepresentation) => ShaderNodeObject<Node>;
4
+ export const Discard: (conditional?: NodeRepresentation) => ShaderNodeObject<Node>;
5
5
  export const Return: () => ShaderNodeObject<Node>;
6
6
 
7
7
  declare module "../tsl/TSLCore.js" {
@@ -0,0 +1,7 @@
1
+ import Node from "../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ export const oscSine: (timeNode?: NodeRepresentation) => ShaderNodeObject<Node>;
5
+ export const oscSquare: (timeNode?: NodeRepresentation) => ShaderNodeObject<Node>;
6
+ export const oscTriangle: (timeNode?: NodeRepresentation) => ShaderNodeObject<Node>;
7
+ export const oscSawtooth: (timeNode?: NodeRepresentation) => ShaderNodeObject<Node>;
@@ -0,0 +1,45 @@
1
+ import Node from "../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ /**
5
+ * Computes a position in view space based on a fragment's screen position expressed as uv coordinates, the fragments
6
+ * depth value and the camera's inverse projection matrix.
7
+ *
8
+ * @param {vec2} screenPosition - The fragment's screen position expressed as uv coordinates.
9
+ * @param {float} depth - The fragment's depth value.
10
+ * @param {mat4} projectionMatrixInverse - The camera's inverse projection matrix.
11
+ * @return {vec3} The fragments position in view space.
12
+ */
13
+ export const getViewPosition: (
14
+ screenPosition: NodeRepresentation,
15
+ depth: NodeRepresentation,
16
+ projectionMatrixInverse: NodeRepresentation,
17
+ ) => ShaderNodeObject<Node>;
18
+
19
+ /**
20
+ * Computes a screen position expressed as uv coordinates based on a fragment's position in view space and the camera's
21
+ * projection matrix
22
+ *
23
+ * @param {vec3} viewPosition - The fragments position in view space.
24
+ * @param {mat4} projectionMatrix - The camera's projection matrix.
25
+ * @return {vec2} The fragment's screen position expressed as uv coordinates.
26
+ */
27
+ export const getScreenPosition: (
28
+ viewPosition: NodeRepresentation,
29
+ projectionMatrix: NodeRepresentation,
30
+ ) => ShaderNodeObject<Node>;
31
+
32
+ /**
33
+ * Computes a normal vector based on depth data. Can be used as a fallback when no normal render target is available or
34
+ * if flat surface normals are required.
35
+ *
36
+ * @param {vec2} uv - The texture coordinate.
37
+ * @param {DepthTexture} depthTexture - The depth texture.
38
+ * @param {mat4} projectionMatrixInverse - The camera's inverse projection matrix.
39
+ * @return {vec3} The computed normal vector.
40
+ */
41
+ export const getNormalFromDepth: (
42
+ uv: NodeRepresentation,
43
+ depthTexture: NodeRepresentation,
44
+ projectionMatrixInverse: NodeRepresentation,
45
+ ) => ShaderNodeObject<Node>;
@@ -2,6 +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 Node from "../core/Node.js";
5
6
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
6
7
 
7
8
  export interface ReflectorNodeParameters {
@@ -11,7 +12,19 @@ export interface ReflectorNodeParameters {
11
12
  bounces?: boolean | undefined;
12
13
  }
13
14
 
14
- export default class ReflectorNode extends TextureNode {
15
+ declare class ReflectorNode extends TextureNode {
16
+ constructor(parameters?: ReflectorNodeParameters);
17
+
18
+ get reflector(): ReflectorBaseNode;
19
+
20
+ get target(): Object3D;
21
+
22
+ getDepthNode(): ShaderNodeObject<ReflectorNode>;
23
+ }
24
+
25
+ declare class ReflectorBaseNode extends Node {
26
+ textureNode: TextureNode;
27
+
15
28
  target: Object3D;
16
29
  resolution: number;
17
30
  generateMipmaps: boolean;
@@ -20,9 +33,7 @@ export default class ReflectorNode extends TextureNode {
20
33
  virtualCameras: WeakMap<Camera, Camera>;
21
34
  renderTargets: WeakMap<Camera, RenderTarget>;
22
35
 
23
- constructor(parameters?: ReflectorNodeParameters);
24
-
25
- getTextureNode(): TextureNode;
36
+ constructor(textureNode: TextureNode, parameters?: ReflectorNodeParameters);
26
37
 
27
38
  getVirtualCamera(camera: Camera): Camera;
28
39
 
@@ -30,3 +41,5 @@ export default class ReflectorNode extends TextureNode {
30
41
  }
31
42
 
32
43
  export const reflector: (parameters?: ReflectorNodeParameters) => ShaderNodeObject<ReflectorNode>;
44
+
45
+ export default ReflectorNode;
@@ -0,0 +1,21 @@
1
+ import Node from "../core/Node.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ export const time: ShaderNodeObject<Node>;
5
+ export const deltaTime: ShaderNodeObject<Node>;
6
+ export const frameId: ShaderNodeObject<Node>;
7
+
8
+ /**
9
+ * @deprecated Use "time" instead.
10
+ */
11
+ export const timerLocal: (timeScale?: number) => ShaderNodeObject<Node>;
12
+
13
+ /**
14
+ * @deprecated Use "time" instead.
15
+ */
16
+ export const timerGlobal: (timeScale?: number) => ShaderNodeObject<Node>;
17
+
18
+ /**
19
+ * @deprecated Use "deltaTime" instead.
20
+ */
21
+ export const timerDelta: (timeScale?: number) => ShaderNodeObject<Node>;
@@ -7,6 +7,17 @@ import { Matrix4 } from "../math/Matrix4.js";
7
7
  import { Sphere } from "../math/Sphere.js";
8
8
  import { Mesh } from "./Mesh.js";
9
9
 
10
+ export interface BatchedMeshGeometryRange {
11
+ vertexStart: number;
12
+ vertexCount: number;
13
+ reservedVertexCount: number;
14
+ indexStart: number;
15
+ indexCount: number;
16
+ reservedIndexCount: number;
17
+ start: number;
18
+ count: number;
19
+ }
20
+
10
21
  /**
11
22
  * A special version of {@link Mesh} with multi draw batch rendering support. Use {@link BatchedMesh} if you have to
12
23
  * render a large number of objects with the same material but with different world transformations. The usage of
@@ -80,6 +91,12 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
80
91
  */
81
92
  get maxInstanceCount(): number;
82
93
 
94
+ get instanceCount(): number;
95
+
96
+ get unusedVertexCount(): number;
97
+
98
+ get unusedIndexCount(): number;
99
+
83
100
  /**
84
101
  * Read-only flag to check if a given object is of type {@link BatchedMesh}.
85
102
  */
@@ -141,6 +158,25 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
141
158
  */
142
159
  getVisibleAt(instanceId: number): boolean;
143
160
 
161
+ /**
162
+ * Get the range representing the subset of triangles related to the attached geometry, indicating the starting
163
+ * offset and count, or `null` if invalid.
164
+ *
165
+ * Return an object of the form: { start: Integer, count: Integer }
166
+ * @param geometryId The id of the geometry to get the range of.
167
+ * @param target Optional target object to copy the range in to.
168
+ */
169
+ getGeometryRangeAt(
170
+ geometryId: number,
171
+ target?: BatchedMeshGeometryRange,
172
+ ): BatchedMeshGeometryRange | null;
173
+
174
+ /**
175
+ * Get the geometryIndex of the defined instance.
176
+ * @param instanceId The id of an instance to get the geometryIndex of.
177
+ */
178
+ getGeometryIdAt(instanceId: number): number;
179
+
144
180
  /**
145
181
  * Sets the given color to the defined geometry instance.
146
182
  * @param instanceId The id of the instance to set the color of.
@@ -162,6 +198,13 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
162
198
  */
163
199
  setVisibleAt(instanceId: number, visible: boolean): this;
164
200
 
201
+ /**
202
+ * Sets the geometryIndex of the instance at the given index.
203
+ * @param instanceId The id of the instance to set the geometryIndex of.
204
+ * @param geometryId The geometryIndex to be use by the instance.
205
+ */
206
+ setGeometryIdAt(instanceId: number, geometryId: number): this;
207
+
165
208
  /**
166
209
  * Adds the given geometry to the {@link BatchedMesh} and returns the associated index referring to it.
167
210
  * @param geometry The geometry to add into the {@link BatchedMesh}.
@@ -182,6 +225,19 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
182
225
  */
183
226
  addInstance(geometryId: number): number;
184
227
 
228
+ /**
229
+ * @param geometryId The id of a geometry to remove from the [name] that was previously added via "addGeometry". Any
230
+ * instances referencing this geometry will also be removed as a side effect.
231
+ */
232
+ deleteGeometry(geometryId: number): this;
233
+
234
+ /**
235
+ * Removes an existing instance from the BatchedMesh using the given instanceId.
236
+ * @param instanceId The id of an instance to remove from the BatchedMesh that was previously added via
237
+ * "addInstance".
238
+ */
239
+ deleteInstance(instanceId: number): this;
240
+
185
241
  /**
186
242
  * Replaces the geometry at `geometryId` with the provided geometry. Throws an error if there is not enough space
187
243
  * reserved for geometry. Calling this will change all instances that are rendering that geometry.
@@ -190,6 +246,28 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
190
246
  */
191
247
  setGeometryAt(geometryId: number, geometry: BufferGeometry): number;
192
248
 
249
+ /**
250
+ * Repacks the sub geometries in [name] to remove any unused space remaining from previously deleted geometry,
251
+ * freeing up space to add new geometry.
252
+ */
253
+ optimize(): this;
254
+
255
+ /**
256
+ * Resizes the available space in BatchedMesh's vertex and index buffer attributes to the provided sizes. If the
257
+ * provided arguments shrink the geometry buffers but there is not enough unused space at the end of the geometry
258
+ * attributes then an error is thrown.
259
+ * @param maxVertexCount the max number of vertices to be used by all unique geometries to resize to.
260
+ * @param maxIndexCount the max number of indices to be used by all unique geometries to resize to.
261
+ */
262
+ setGeometrySize(maxVertexCount: number, maxIndexCount: number): void;
263
+
264
+ /**
265
+ * Resizes the necessary buffers to support the provided number of instances. If the provided arguments shrink the
266
+ * number of instances but there are not enough unused ids at the end of the list then an error is thrown.
267
+ * @param maxInstanceCount the max number of individual instances that can be added and rendered by the BatchedMesh.
268
+ */
269
+ setInstanceCount(maxInstanceCount: number): void;
270
+
193
271
  getBoundingBoxAt(geometryId: number, target: Box3): Box3 | null;
194
272
  getBoundingSphereAt(geometryId: number, target: Sphere): Sphere | null;
195
273
  }
@@ -34,10 +34,4 @@ export class Group<TEventMap extends Object3DEventMap = Object3DEventMap> extend
34
34
  * @defaultValue `true`
35
35
  */
36
36
  readonly isGroup: true;
37
-
38
- /**
39
- * @override
40
- * @defaultValue `Group`
41
- */
42
- override readonly type: string | "Group";
43
37
  }
@@ -81,6 +81,13 @@ export class LOD<TEventMap extends Object3DEventMap = Object3DEventMap> extends
81
81
  */
82
82
  addLevel(object: Object3D, distance?: number, hysteresis?: number): this;
83
83
 
84
+ /**
85
+ * Removes an existing level, based on the distance from the camera. Returns `true` when the level has been removed.
86
+ * Otherwise `false`.
87
+ * @param distance Distance of the level to delete.
88
+ */
89
+ removeLabel(distance: number): boolean;
90
+
84
91
  /**
85
92
  * Get the currently active {@link LOD} level
86
93
  * @remarks