@types/three 0.160.0 → 0.161.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 (135) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +5 -1
  3. three/examples/jsm/capabilities/WebGPU.d.ts +2 -0
  4. three/examples/jsm/curves/NURBSUtils.d.ts +136 -10
  5. three/examples/jsm/curves/NURBSVolume.d.ts +23 -0
  6. three/examples/jsm/exporters/USDZExporter.d.ts +1 -0
  7. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -0
  8. three/examples/jsm/loaders/KTX2Loader.d.ts +44 -4
  9. three/examples/jsm/loaders/LUT3dlLoader.d.ts +29 -2
  10. three/examples/jsm/loaders/LUTCubeLoader.d.ts +37 -2
  11. three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts +13 -0
  12. three/examples/jsm/nodes/Nodes.d.ts +75 -10
  13. three/examples/jsm/nodes/accessors/CameraNode.d.ts +17 -6
  14. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +8 -2
  15. three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +1 -1
  16. three/examples/jsm/nodes/accessors/ModelNode.d.ts +2 -0
  17. three/examples/jsm/nodes/accessors/Object3DNode.d.ts +10 -6
  18. three/examples/jsm/nodes/accessors/TextureBicubicNode.d.ts +18 -0
  19. three/examples/jsm/nodes/accessors/TextureNode.d.ts +11 -3
  20. three/examples/jsm/nodes/accessors/VertexColorNode.d.ts +12 -0
  21. three/examples/jsm/nodes/code/FunctionCallNode.d.ts +6 -0
  22. three/examples/jsm/nodes/core/AssignNode.d.ts +17 -0
  23. three/examples/jsm/nodes/core/BypassNode.d.ts +6 -0
  24. three/examples/jsm/nodes/core/CacheNode.d.ts +8 -0
  25. three/examples/jsm/nodes/core/ContextNode.d.ts +8 -0
  26. three/examples/jsm/nodes/core/IndexNode.d.ts +18 -0
  27. three/examples/jsm/nodes/core/LightingModel.d.ts +36 -0
  28. three/examples/jsm/nodes/core/Node.d.ts +32 -8
  29. three/examples/jsm/nodes/core/NodeBuilder.d.ts +22 -21
  30. three/examples/jsm/nodes/core/NodeFrame.d.ts +18 -6
  31. three/examples/jsm/nodes/core/PropertyNode.d.ts +19 -2
  32. three/examples/jsm/nodes/core/VarNode.d.ts +8 -2
  33. three/examples/jsm/nodes/core/VaryingNode.d.ts +6 -0
  34. three/examples/jsm/nodes/core/constants.d.ts +23 -24
  35. three/examples/jsm/nodes/display/AfterImageNode.d.ts +25 -0
  36. three/examples/jsm/nodes/display/AnamorphicNode.d.ts +32 -0
  37. three/examples/jsm/nodes/display/BlendModeNode.d.ts +14 -4
  38. three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +11 -0
  39. three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +15 -2
  40. three/examples/jsm/nodes/display/GaussianBlurNode.d.ts +28 -0
  41. three/examples/jsm/nodes/display/NormalMapNode.d.ts +6 -0
  42. three/examples/jsm/nodes/display/PassNode.d.ts +44 -0
  43. three/examples/jsm/nodes/display/PosterizeNode.d.ts +6 -0
  44. three/examples/jsm/nodes/display/ViewportDepthNode.d.ts +32 -0
  45. three/examples/jsm/nodes/display/ViewportSharedTextureNode.d.ts +18 -0
  46. three/examples/jsm/nodes/display/ViewportTextureNode.d.ts +33 -0
  47. three/examples/jsm/nodes/fog/FogExp2Node.d.ts +6 -0
  48. three/examples/jsm/nodes/fog/FogNode.d.ts +6 -0
  49. three/examples/jsm/nodes/fog/FogRangeNode.d.ts +6 -0
  50. three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +9 -2
  51. three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +3 -2
  52. three/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.d.ts +7 -0
  53. three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +3 -2
  54. three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +3 -2
  55. three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +3 -2
  56. three/examples/jsm/nodes/functions/PhongLightingModel.d.ts +7 -0
  57. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +17 -8
  58. three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +6 -0
  59. three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +20 -13
  60. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +1 -2
  61. three/examples/jsm/nodes/materials/Materials.d.ts +9 -17
  62. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +2 -4
  63. three/examples/jsm/nodes/materials/MeshPhongNodeMaterial.d.ts +12 -0
  64. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +3 -7
  65. three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +17 -0
  66. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +1 -2
  67. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +30 -14
  68. three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +2 -8
  69. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +0 -10
  70. three/examples/jsm/nodes/math/CondNode.d.ts +6 -0
  71. three/examples/jsm/nodes/math/HashNode.d.ts +16 -0
  72. three/examples/jsm/nodes/math/MathNode.d.ts +15 -9
  73. three/examples/jsm/nodes/math/MathUtils.d.ts +16 -0
  74. three/examples/jsm/nodes/math/OperatorNode.d.ts +5 -4
  75. three/examples/jsm/nodes/math/TriNoise3D.d.ts +12 -0
  76. three/examples/jsm/nodes/procedural/CheckerNode.d.ts +6 -0
  77. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +55 -4
  78. three/examples/jsm/nodes/utils/DiscardNode.d.ts +16 -0
  79. three/examples/jsm/nodes/utils/ReflectorNode.d.ts +30 -0
  80. three/examples/jsm/nodes/utils/RemapNode.d.ts +23 -4
  81. three/examples/jsm/nodes/utils/RotateNode.d.ts +21 -0
  82. three/examples/jsm/nodes/utils/RotateUVNode.d.ts +6 -0
  83. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +6 -0
  84. three/examples/jsm/objects/GroundedSkybox.d.ts +5 -0
  85. three/examples/jsm/objects/QuadMesh.d.ts +3 -1
  86. three/examples/jsm/postprocessing/GTAOPass.d.ts +3 -0
  87. three/examples/jsm/postprocessing/SSAOPass.d.ts +1 -1
  88. three/examples/jsm/renderers/common/Backend.d.ts +6 -2
  89. three/examples/jsm/renderers/common/Color4.d.ts +9 -0
  90. three/examples/jsm/renderers/common/Info.d.ts +7 -1
  91. three/examples/jsm/renderers/common/PostProcessing.d.ts +11 -0
  92. three/examples/jsm/renderers/common/Renderer.d.ts +243 -4
  93. three/examples/jsm/renderers/common/StorageTexture.d.ts +5 -0
  94. three/examples/jsm/renderers/webgl/WebGLBackend.d.ts +4 -2
  95. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +2 -2
  96. three/examples/jsm/renderers/webgpu/WebGPUBackend.d.ts +15 -6
  97. three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +7 -7
  98. three/examples/jsm/utils/BufferGeometryUtils.d.ts +0 -10
  99. three/examples/jsm/webxr/XRControllerModelFactory.d.ts +6 -5
  100. three/examples/jsm/webxr/XRHandMeshModel.d.ts +10 -2
  101. three/package.json +2 -2
  102. three/src/cameras/PerspectiveCamera.d.ts +13 -0
  103. three/src/constants.d.ts +1 -2
  104. three/src/core/InterleavedBufferAttribute.d.ts +12 -2
  105. three/src/core/Object3D.d.ts +13 -13
  106. three/src/extras/core/Curve.d.ts +9 -9
  107. three/src/extras/core/CurvePath.d.ts +8 -7
  108. three/src/geometries/RingGeometry.d.ts +1 -1
  109. three/src/materials/Material.d.ts +3 -1
  110. three/src/materials/ShaderMaterial.d.ts +9 -1
  111. three/src/math/Color.d.ts +1 -1
  112. three/src/math/Quaternion.d.ts +27 -30
  113. three/src/math/Triangle.d.ts +0 -17
  114. three/src/math/Vector2.d.ts +24 -159
  115. three/src/math/Vector3.d.ts +46 -54
  116. three/src/math/Vector4.d.ts +25 -20
  117. three/src/objects/BatchedMesh.d.ts +2 -2
  118. three/src/objects/Bone.d.ts +2 -2
  119. three/src/objects/InstancedMesh.d.ts +2 -1
  120. three/src/objects/LOD.d.ts +2 -2
  121. three/src/objects/Line.d.ts +3 -2
  122. three/src/objects/LineLoop.d.ts +3 -1
  123. three/src/objects/LineSegments.d.ts +3 -1
  124. three/src/objects/Points.d.ts +3 -2
  125. three/src/objects/SkinnedMesh.d.ts +3 -6
  126. three/src/objects/Sprite.d.ts +2 -2
  127. three/src/renderers/webgl/WebGLProgram.d.ts +0 -1
  128. three/src/renderers/webgl/WebGLPrograms.d.ts +3 -1
  129. three/src/renderers/webxr/WebXRDepthSensing.d.ts +27 -0
  130. three/src/renderers/webxr/WebXRManager.d.ts +2 -1
  131. three/src/textures/DataArrayTexture.d.ts +1 -1
  132. three/src/textures/Source.d.ts +11 -1
  133. three/build/three.d.ts +0 -2
  134. three/build/three.min.d.ts +0 -2
  135. three/examples/jsm/objects/GroundProjectedSkybox.d.ts +0 -13
@@ -0,0 +1,32 @@
1
+ import { Vector2 } from '../../../../src/Three.js';
2
+ import Node from '../core/Node.js';
3
+ import TempNode from '../core/TempNode.js';
4
+ import TextureNode from '../accessors/TextureNode.js';
5
+ import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
6
+
7
+ export default class AnamorphicNode extends TempNode {
8
+ textureNode: TextureNode;
9
+ thresholdNode: Node;
10
+ scaleNode: Node;
11
+ samples: number;
12
+ resolution: Vector2;
13
+
14
+ constructor(textureNode: TextureNode, thresholdNode: Node, scaleNode: Node, samples: number);
15
+
16
+ getTextureNode(): TextureNode;
17
+
18
+ setSize(width: number, height: number): void;
19
+ }
20
+
21
+ export const anamorphic: (
22
+ node: TextureNode,
23
+ threshold?: NodeRepresentation,
24
+ scale?: NodeRepresentation,
25
+ samples?: NodeRepresentation,
26
+ ) => ShaderNodeObject<AnamorphicNode>;
27
+
28
+ declare module '../shadernode/ShaderNode.js' {
29
+ interface NodeElements {
30
+ anamorphic: typeof anamorphic;
31
+ }
32
+ }
@@ -1,14 +1,15 @@
1
1
  import TempNode from '../core/TempNode.js';
2
2
  import Node from '../core/Node.js';
3
3
  import { NodeRepresentation, ShaderNode, ShaderNodeObject } from '../shadernode/ShaderNode.js';
4
+ import { JoinNode } from '../Nodes.js';
4
5
 
5
- export const BurnNode: ShaderNode<{ base: Node; blendNode: Node }>;
6
+ export const BurnNode: (args: { base: Node; blend: Node }) => ShaderNodeObject<JoinNode>;
6
7
 
7
- export const DodgeNode: ShaderNode<{ base: Node; blendNode: Node }>;
8
+ export const DodgeNode: (args: { base: Node; blend: Node }) => ShaderNodeObject<JoinNode>;
8
9
 
9
- export const ScreenNode: ShaderNode<{ base: Node; blendNode: Node }>;
10
+ export const ScreenNode: (args: { base: Node; blend: Node }) => ShaderNodeObject<JoinNode>;
10
11
 
11
- export const OverlayNode: ShaderNode<{ base: Node; blendNode: Node }>;
12
+ export const OverlayNode: (args: { base: Node; blend: Node }) => ShaderNodeObject<JoinNode>;
12
13
 
13
14
  export type BlendMode =
14
15
  | typeof BlendModeNode.BURN
@@ -35,3 +36,12 @@ export const burn: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation
35
36
  export const dodge: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
36
37
  export const overlay: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
37
38
  export const screen: (baseNode: NodeRepresentation, blendNode?: NodeRepresentation) => ShaderNodeObject<BlendModeNode>;
39
+
40
+ declare module '../shadernode/ShaderNode.js' {
41
+ interface NodeElements {
42
+ burn: typeof burn;
43
+ dodge: typeof dodge;
44
+ overlay: typeof overlay;
45
+ screen: typeof screen;
46
+ }
47
+ }
@@ -35,3 +35,14 @@ export const hue: (
35
35
 
36
36
  export const lumaCoeffs: ShaderNodeObject<MathNode>;
37
37
  export const luminance: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<MathNode>;
38
+
39
+ export const threshold: (color: NodeRepresentation, thershold: NodeRepresentation) => ShaderNodeObject<MathNode>;
40
+
41
+ declare module '../shadernode/ShaderNode.js' {
42
+ interface NodeElements {
43
+ saturation: typeof saturation;
44
+ vibrance: typeof vibrance;
45
+ hue: typeof hue;
46
+ threshold: typeof threshold;
47
+ }
48
+ }
@@ -1,4 +1,4 @@
1
- import { TextureEncoding } from '../../../../src/Three.js';
1
+ import { ColorSpace } from '../../../../src/Three.js';
2
2
  import TempNode from '../core/TempNode.js';
3
3
  import Node from '../core/Node.js';
4
4
  import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
@@ -19,4 +19,17 @@ export default class ColorSpaceNode extends TempNode {
19
19
  constructor(method: ColorSpaceNodeMethod | null, node: Node);
20
20
  }
21
21
 
22
- export const colorSpace: (node: NodeRepresentation, encoding: TextureEncoding) => ShaderNodeObject<ColorSpaceNode>;
22
+ export const linearToColorSpace: (node: NodeRepresentation, colorSpace: ColorSpace) => ShaderNodeObject<ColorSpaceNode>;
23
+ export const colorSpaceToLinear: (node: NodeRepresentation, colorSpace: ColorSpace) => ShaderNodeObject<ColorSpaceNode>;
24
+
25
+ export const linearTosRGB: (node: NodeRepresentation) => ShaderNodeObject<ColorSpaceNode>;
26
+ export const sRGBToLinear: (node: NodeRepresentation) => ShaderNodeObject<ColorSpaceNode>;
27
+
28
+ declare module '../shadernode/ShaderNode.js' {
29
+ interface NodeElements {
30
+ linearTosRGB: typeof linearTosRGB;
31
+ sRGBToLinear: typeof sRGBToLinear;
32
+ linearToColorSpace: typeof linearToColorSpace;
33
+ colorSpaceToLinear: typeof colorSpaceToLinear;
34
+ }
35
+ }
@@ -0,0 +1,28 @@
1
+ import { Vector2 } from '../../../../src/Three.js';
2
+ import TempNode from '../core/TempNode.js';
3
+ import TextureNode from '../accessors/TextureNode.js';
4
+ import Node from '../core/Node.js';
5
+ import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
6
+
7
+ export default class GaussianBlurNode extends TempNode {
8
+ textureNode: TextureNode;
9
+ sigma: number;
10
+
11
+ directionNode: Node;
12
+
13
+ resolution: Vector2;
14
+
15
+ constructor(textureNode: TextureNode, sigma?: number);
16
+
17
+ setSize(width: number, height: number): void;
18
+
19
+ getTextureNode(): TextureNode;
20
+ }
21
+
22
+ export const gaussianBlur: (node: NodeRepresentation, sigma?: number) => ShaderNodeObject<GaussianBlurNode>;
23
+
24
+ declare module '../shadernode/ShaderNode.js' {
25
+ interface NodeElements {
26
+ gaussianBlur: typeof gaussianBlur;
27
+ }
28
+ }
@@ -16,3 +16,9 @@ export default class NormalMapNode extends TempNode {
16
16
  export const normalMap: (node: Node, scaleNode?: Node) => ShaderNodeObject<NormalMapNode>;
17
17
 
18
18
  export const TBNViewMatrix: ShaderNodeObject<MathNode>;
19
+
20
+ declare module '../shadernode/ShaderNode.js' {
21
+ interface NodeElements {
22
+ normalMap: typeof normalMap;
23
+ }
24
+ }
@@ -0,0 +1,44 @@
1
+ import { Camera, RenderTarget, Scene, Texture } from '../../../../src/Three.js';
2
+ import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
3
+ import TempNode from '../core/TempNode.js';
4
+ import TextureNode from '../accessors/TextureNode.js';
5
+ import Node from '../core/Node.js';
6
+
7
+ declare class PassTextureNode extends TextureNode {
8
+ passNode: PassNode;
9
+
10
+ constructor(passNode: PassNode, texture: Texture);
11
+ }
12
+
13
+ export default class PassNode extends TempNode {
14
+ scope: PassNodeScope;
15
+ scene: Scene;
16
+ camera: Camera;
17
+
18
+ renderTarget: RenderTarget;
19
+
20
+ readonly isPassNode: true;
21
+
22
+ constructor(scope: PassNodeScope, scene: Scene, camera: Camera);
23
+
24
+ getTextureNode(): ShaderNodeObject<PassTextureNode>;
25
+
26
+ getTextureDepthNode(): ShaderNodeObject<PassTextureNode>;
27
+
28
+ getDepthNode(): ShaderNodeObject<Node>;
29
+
30
+ setSize(width: number, height: number): void;
31
+
32
+ setPixelRatio(pixelRatio: number): void;
33
+
34
+ dispose(): void;
35
+
36
+ static COLOR: 'color';
37
+ static DEPTH: 'depth';
38
+ }
39
+
40
+ export type PassNodeScope = typeof PassNode.COLOR | typeof PassNode.DEPTH;
41
+
42
+ export const pass: (scene: Scene, camera: Camera) => ShaderNodeObject<PassNode>;
43
+ export const texturePass: (pass: PassNode, texture: Texture) => ShaderNodeObject<PassTextureNode>;
44
+ export const depthPass: (scene: Scene, camera: Camera) => ShaderNodeObject<PassNode>;
@@ -12,3 +12,9 @@ export const posterize: (
12
12
  sourceNode: NodeRepresentation,
13
13
  stepsNode: NodeRepresentation,
14
14
  ) => ShaderNodeObject<PosterizeNode>;
15
+
16
+ declare module '../shadernode/ShaderNode.js' {
17
+ interface NodeElements {
18
+ posterize: typeof posterize;
19
+ }
20
+ }
@@ -0,0 +1,32 @@
1
+ import Node from '../core/Node.js';
2
+ import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
3
+
4
+ export default class ViewportDepthNode extends Node {
5
+ scope: ViewportDepthNodeScope;
6
+ valueNode: Node;
7
+
8
+ readonly isViewportDepthNode: true;
9
+
10
+ constructor(scope: ViewportDepthNodeScope, valueNode?: Node | null);
11
+
12
+ static DEPTH: 'depth';
13
+ static DEPTH_TEXTURE: 'depthTexture';
14
+ static DEPTH_PIXEL: 'depthPixel';
15
+ }
16
+
17
+ export type ViewportDepthNodeScope =
18
+ | typeof ViewportDepthNode.DEPTH
19
+ | typeof ViewportDepthNode.DEPTH_TEXTURE
20
+ | typeof ViewportDepthNode.DEPTH_PIXEL;
21
+
22
+ export const viewZToOrthographicDepth: (viewZ: Node, near: Node, far: Node) => Node;
23
+
24
+ export const orthographicDepthToViewZ: (depth: Node, near: Node, far: Node) => Node;
25
+
26
+ export const viewZToPerspectiveDepth: (viewZ: Node, near: Node, far: Node) => Node;
27
+
28
+ export const perspectiveDepthToViewZ: (depth: Node, near: Node, far: Node) => Node;
29
+
30
+ export const depth: ShaderNodeObject<ViewportDepthNode>;
31
+ export const depthTexture: (valueNode?: Node | null) => ShaderNodeObject<ViewportDepthNode>;
32
+ export const depthPixel: ShaderNodeObject<ViewportDepthNode>;
@@ -0,0 +1,18 @@
1
+ import Node from '../core/Node.js';
2
+ import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
3
+ import ViewportTextureNode from './ViewportTextureNode.js';
4
+
5
+ export default class ViewportSharedTextureNode extends ViewportTextureNode {
6
+ constructor(uvNode?: Node, levelNode?: Node | null);
7
+ }
8
+
9
+ export const viewportSharedTexture: (
10
+ uvNode?: Node,
11
+ levelNode?: Node | null,
12
+ ) => ShaderNodeObject<ViewportSharedTextureNode>;
13
+
14
+ declare module '../shadernode/ShaderNode.js' {
15
+ interface NodeElements {
16
+ viewportSharedTexture: typeof viewportSharedTexture;
17
+ }
18
+ }
@@ -0,0 +1,33 @@
1
+ import { FramebufferTexture } from '../../../../src/Three.js';
2
+ import TextureNode from '../accessors/TextureNode.js';
3
+ import Node from '../core/Node.js';
4
+ import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
5
+ import { NodeUpdateType } from '../core/constants.js';
6
+
7
+ export default class ViewportTextureNode extends TextureNode {
8
+ generateMipmaps: boolean;
9
+
10
+ readonly isOutputTextureNode: true;
11
+
12
+ updateBeforeType: NodeUpdateType;
13
+
14
+ constructor(uvNode?: Node, levelNode?: Node | null, framebufferTexture?: FramebufferTexture | null);
15
+ }
16
+
17
+ export const viewportTexture: (
18
+ uvNode?: Node,
19
+ levelNode?: Node | null,
20
+ framebufferTexture?: FramebufferTexture | null,
21
+ ) => ShaderNodeObject<ViewportTextureNode>;
22
+ export const viewportMipTexture: (
23
+ uvNode?: Node,
24
+ levelNode?: Node | null,
25
+ framebufferTexture?: FramebufferTexture | null,
26
+ ) => ShaderNodeObject<Node>;
27
+
28
+ declare module '../shadernode/ShaderNode.js' {
29
+ interface NodeElements {
30
+ viewportTexture: typeof viewportTexture;
31
+ viewportMipTexture: typeof viewportMipTexture;
32
+ }
33
+ }
@@ -10,3 +10,9 @@ export default class FogExp2Node extends FogNode {
10
10
  }
11
11
 
12
12
  export const densityFog: (colorNode: Node, densityNode: Node) => ShaderNodeObject<FogExp2Node>;
13
+
14
+ declare module '../shadernode/ShaderNode.js' {
15
+ interface NodeElements {
16
+ densityFog: typeof densityFog;
17
+ }
18
+ }
@@ -11,3 +11,9 @@ export default class FogNode extends Node {
11
11
  }
12
12
 
13
13
  export const fog: (colorNode: NodeRepresentation, factorNode: NodeRepresentation) => ShaderNodeObject<FogNode>;
14
+
15
+ declare module '../shadernode/ShaderNode.js' {
16
+ interface NodeElements {
17
+ fog: typeof fog;
18
+ }
19
+ }
@@ -11,3 +11,9 @@ export default class FogRangeNode extends FogNode {
11
11
  }
12
12
 
13
13
  export const rangeFog: (colorNode: Node, nearNode: Node, farNode: Node) => ShaderNodeObject<FogRangeNode>;
14
+
15
+ declare module '../shadernode/ShaderNode.js' {
16
+ interface NodeElements {
17
+ rangeFog: typeof rangeFog;
18
+ }
19
+ }
@@ -1,6 +1,13 @@
1
- import { ShaderNode } from '../../shadernode/ShaderNode.js';
1
+ import { ShaderNodeObject } from '../../shadernode/ShaderNode.js';
2
2
  import Node from '../../core/Node.js';
3
+ import OperatorNode from '../../math/OperatorNode.js';
3
4
 
4
- declare const BRDF_GGX: ShaderNode<{ lightDirection: Node; f0: Node; f90: Node; roughness: Node }>;
5
+ declare const BRDF_GGX: (args: {
6
+ lightDirection: Node;
7
+ f0: Node;
8
+ f90: Node;
9
+ roughness: Node;
10
+ iridescenceFresnel?: Node;
11
+ }) => ShaderNodeObject<OperatorNode>;
5
12
 
6
13
  export default BRDF_GGX;
@@ -1,6 +1,7 @@
1
- import { ShaderNode } from '../../shadernode/ShaderNode.js';
1
+ import { ShaderNodeObject } from '../../shadernode/ShaderNode.js';
2
2
  import Node from '../../core/Node.js';
3
+ import OperatorNode from '../../math/OperatorNode.js';
3
4
 
4
- declare const BRDF_Lambert: ShaderNode<{ diffuseColor: Node }>;
5
+ declare const BRDF_Lambert: (args: { diffuseColor: Node }) => ShaderNodeObject<OperatorNode>;
5
6
 
6
7
  export default BRDF_Lambert;
@@ -0,0 +1,7 @@
1
+ import { ShaderNodeObject } from '../../shadernode/ShaderNode.js';
2
+ import Node from '../../core/Node.js';
3
+ import OperatorNode from '../../math/OperatorNode.js';
4
+
5
+ declare const BRDF_Sheen: (args: { lightDirection: Node }) => ShaderNodeObject<OperatorNode>;
6
+
7
+ export default BRDF_Sheen;
@@ -1,10 +1,11 @@
1
- import { ShaderNode } from '../../shadernode/ShaderNode.js';
1
+ import { ShaderNodeObject } from '../../shadernode/ShaderNode.js';
2
2
  import Node from '../../core/Node.js';
3
+ import OperatorNode from '../../math/OperatorNode.js';
3
4
 
4
5
  // Analytical approximation of the DFG LUT, one half of the
5
6
  // split-sum approximation used in indirect specular lighting.
6
7
  // via 'environmentBRDF' from "Physically Based Shading on Mobile"
7
8
  // https://www.unrealengine.com/blog/physically-based-shading-on-mobile
8
- declare const DFGApprox: ShaderNode<{ roughness: Node }>;
9
+ declare const DFGApprox: (args: { roughness: Node; dotNV: Node }) => ShaderNodeObject<OperatorNode>;
9
10
 
10
11
  export default DFGApprox;
@@ -1,9 +1,10 @@
1
- import { ShaderNode } from '../../shadernode/ShaderNode.js';
1
+ import { ShaderNodeObject } from '../../shadernode/ShaderNode.js';
2
2
  import Node from '../../core/Node.js';
3
+ import OperatorNode from '../../math/OperatorNode.js';
3
4
 
4
5
  // Microfacet Models for Refraction through Rough Surfaces - equation (33)
5
6
  // http://graphicrants.blogspot.com/2013/08/specular-brdf-reference.html
6
7
  // alpha is "roughness squared" in Disney’s reparameterization
7
- declare const D_GGX: ShaderNode<{ alpha: Node; dotNH: Node }>;
8
+ declare const D_GGX: (args: { alpha: Node; dotNH: Node }) => ShaderNodeObject<OperatorNode>;
8
9
 
9
10
  export default D_GGX;
@@ -1,6 +1,7 @@
1
- import { ShaderNode } from '../../shadernode/ShaderNode.js';
1
+ import { ShaderNodeObject } from '../../shadernode/ShaderNode.js';
2
2
  import Node from '../../core/Node.js';
3
+ import OperatorNode from '../../math/OperatorNode.js';
3
4
 
4
- declare const F_Schlick: ShaderNode<{ f0: Node; f90: Node; dotVH: Node }>;
5
+ declare const F_Schlick: (args: { f0: Node; f90: Node; dotVH: Node }) => ShaderNodeObject<OperatorNode>;
5
6
 
6
7
  export default F_Schlick;
@@ -0,0 +1,7 @@
1
+ import LightingModel from '../core/LightingModel.js';
2
+
3
+ export default class PhongLightingModel extends LightingModel {
4
+ specular: boolean;
5
+
6
+ constructor(specular?: boolean);
7
+ }
@@ -1,11 +1,20 @@
1
- import { ShaderNode } from '../shadernode/ShaderNode.js';
1
+ import LightingModel from '../core/LightingModel.js';
2
2
  import Node from '../core/Node.js';
3
3
 
4
- declare const PhysicalLightingModel: {
5
- direct: ShaderNode<{ lightDirection: Node; lightColor: Node; reflectedLight: Node }>;
6
- indirectDiffuse: ShaderNode<{ irradiance: Node; reflectedLight: Node }>;
7
- indirectSpecular: ShaderNode<{ radiance: Node; iblIrradiance: Node; reflectedLight: Node }>;
8
- ambientOcclusion: ShaderNode<{ ambientOcclusion: Node; reflectedLight: Node }>;
9
- };
4
+ export default class PhysicalLightingModel extends LightingModel {
5
+ clearcoat: boolean;
6
+ sheen: boolean;
7
+ iridescence: boolean;
10
8
 
11
- export default PhysicalLightingModel;
9
+ clearcoatRadiance: Node | null;
10
+ clearcoatSpecularDirect: Node | null;
11
+ clearcoatSpecularIndirect: Node | null;
12
+ sheenSpecularDirect: Node | null;
13
+ sheenSpecularIndirect: Node | null;
14
+ iridescenceFresnel: Node | null;
15
+ iridescenceF0: Node | null;
16
+
17
+ constructor(clearcoat?: boolean, sheen?: boolean, iridescence?: boolean);
18
+
19
+ computeMultiscattering(singleScatter: Node, multiScatter: Node, specularF90?: Node): void;
20
+ }
@@ -16,3 +16,9 @@ export const compute: (
16
16
  count: number,
17
17
  workgroupSize: number[],
18
18
  ) => ShaderNodeObject<ComputeNode>;
19
+
20
+ declare module '../shadernode/ShaderNode.js' {
21
+ interface NodeElements {
22
+ compute: typeof compute;
23
+ }
24
+ }
@@ -1,20 +1,27 @@
1
1
  import ContextNode from '../core/ContextNode.js';
2
2
  import Node from '../core/Node.js';
3
- import { ShaderNode, ShaderNodeObject } from '../shadernode/ShaderNode.js';
4
-
5
- export interface LightingModelNode {
6
- indirectDiffuse?: ShaderNode;
7
- indirectSpecular?: ShaderNode;
8
- ambientOcclusion?: ShaderNode;
9
- }
3
+ import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
4
+ import LightingModel, { LightingModelIndirectInput } from '../core/LightingModel.js';
10
5
 
11
6
  export default class LightingContextNode extends ContextNode {
12
- lightingModelNode: LightingModelNode | null;
7
+ lightingModelNode: LightingModel | null;
8
+ backdropNode: Node | null;
9
+ backdropAlphaNode: Node | null;
10
+
11
+ constructor(
12
+ node: Node,
13
+ lightingModel?: LightingModel | null,
14
+ backdropNode?: Node | null,
15
+ backdropAlphaNode?: Node | null,
16
+ );
13
17
 
14
- constructor(node: Node, lightingModelNode?: LightingModelNode | null);
18
+ getContext(): LightingModelIndirectInput;
15
19
  }
16
20
 
17
- export const lightingContext: (
18
- node: Node,
19
- lightingModelNode?: LightingModelNode,
20
- ) => ShaderNodeObject<LightingContextNode>;
21
+ export const lightingContext: (node: Node, lightingModelNode?: LightingModel) => ShaderNodeObject<LightingContextNode>;
22
+
23
+ declare module '../shadernode/ShaderNode.js' {
24
+ interface NodeElements {
25
+ lightingContext: typeof lightingContext;
26
+ }
27
+ }
@@ -2,8 +2,7 @@ import NodeMaterial from './NodeMaterial.js';
2
2
  import { ShaderMaterialParameters } from '../../../../src/Three.js';
3
3
 
4
4
  export default class LineBasicNodeMaterial extends NodeMaterial {
5
- isLineBasicNodeMaterial: true;
5
+ readonly isLineBasicNodeMaterial: true;
6
6
 
7
7
  constructor(parameters?: ShaderMaterialParameters);
8
- copy(source: LineBasicNodeMaterial): this;
9
8
  }
@@ -1,17 +1,9 @@
1
- import NodeMaterial from './NodeMaterial.js';
2
- import LineBasicNodeMaterial from './LineBasicNodeMaterial.js';
3
- import MeshBasicNodeMaterial from './MeshBasicNodeMaterial.js';
4
- import MeshStandardNodeMaterial from './MeshStandardNodeMaterial.js';
5
- import PointsNodeMaterial from './PointsNodeMaterial.js';
6
- import SpriteNodeMaterial from './SpriteNodeMaterial.js';
7
- import MeshPhysicalNodeMaterial from './MeshPhysicalNodeMaterial.js';
8
-
9
- export {
10
- NodeMaterial,
11
- LineBasicNodeMaterial,
12
- MeshBasicNodeMaterial,
13
- MeshPhysicalNodeMaterial,
14
- MeshStandardNodeMaterial,
15
- PointsNodeMaterial,
16
- SpriteNodeMaterial,
17
- };
1
+ export { default as NodeMaterial } from './NodeMaterial.js';
2
+ export { default as LineBasicNodeMaterial } from './LineBasicNodeMaterial.js';
3
+ export { default as MeshBasicNodeMaterial } from './MeshBasicNodeMaterial.js';
4
+ export { default as MeshPhongNodeMaterial } from './MeshPhongNodeMaterial.js';
5
+ export { default as MeshStandardNodeMaterial } from './MeshStandardNodeMaterial.js';
6
+ export { default as MeshPhysicalNodeMaterial } from './MeshPhysicalNodeMaterial.js';
7
+ export { default as MeshSSSPhysicalNodeMaterial } from './MeshSSSNodeMaterial.js';
8
+ export { default as PointsNodeMaterial } from './PointsNodeMaterial.js';
9
+ export { default as SpriteNodeMaterial } from './SpriteNodeMaterial.js';
@@ -2,9 +2,7 @@ import NodeMaterial from './NodeMaterial.js';
2
2
  import { ShaderMaterialParameters } from '../../../../src/Three.js';
3
3
 
4
4
  export default class MeshBasicNodeMaterial extends NodeMaterial {
5
- isMeshBasicNodeMaterial: true;
6
- lights: true;
5
+ readonly isMeshBasicNodeMaterial: true;
7
6
 
8
- constructor(paramters?: ShaderMaterialParameters);
9
- copy(source: MeshBasicNodeMaterial): this;
7
+ constructor(parameters?: ShaderMaterialParameters);
10
8
  }
@@ -0,0 +1,12 @@
1
+ import { ShaderMaterialParameters } from '../../../../src/Three.js';
2
+ import NodeMaterial from './NodeMaterial.js';
3
+ import Node from '../core/Node.js';
4
+
5
+ export default class MeshPhongNodeMaterial extends NodeMaterial {
6
+ readonly isMeshPhongNodeMaterial: true;
7
+
8
+ shininessNode: Node | null;
9
+ specularNode: Node | null;
10
+
11
+ constructor(parameters?: ShaderMaterialParameters);
12
+ }
@@ -2,8 +2,6 @@ import { ShaderMaterialParameters } from '../../../../src/Three.js';
2
2
 
3
3
  import MeshStandardNodeMaterial from './MeshStandardNodeMaterial.js';
4
4
  import Node from '../core/Node.js';
5
- import CheckerNode from '../procedural/CheckerNode.js';
6
- import { ShaderNodeObject } from '../shadernode/ShaderNode.js';
7
5
 
8
6
  export default class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
9
7
  readonly isMeshPhysicalNodeMaterial: true;
@@ -15,9 +13,9 @@ export default class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
15
13
  sheenNode: Node | null;
16
14
  sheenRoughnessNode: Node | null;
17
15
 
18
- iridescenceNode: null | ShaderNodeObject<CheckerNode>;
19
- iridescenceIORNode: null | ShaderNodeObject<Node>;
20
- iridescenceThicknessNode: null | ShaderNodeObject<Node>;
16
+ iridescenceNode: Node | null;
17
+ iridescenceIORNode: Node | null;
18
+ iridescenceThicknessNode: Node | null;
21
19
 
22
20
  iorNode?: Node | null;
23
21
 
@@ -30,6 +28,4 @@ export default class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
30
28
  attenuationColorNode: Node | null;
31
29
 
32
30
  constructor(parameters?: ShaderMaterialParameters);
33
-
34
- copy(source: MeshPhysicalNodeMaterial): this;
35
31
  }
@@ -0,0 +1,17 @@
1
+ import { ShaderMaterialParameters } from '../../../../src/Three.js';
2
+ import Node from '../core/Node.js';
3
+ import ConstNode from '../core/ConstNode.js';
4
+ import MeshPhysicalNodeMaterial from './MeshPhysicalNodeMaterial.js';
5
+
6
+ export default class MeshSSSNodeMaterial extends MeshPhysicalNodeMaterial {
7
+ thicknessColorNode: Node | null;
8
+ thicknessDistortionNode: ConstNode<number>;
9
+ thicknessAmbientNode: ConstNode<number>;
10
+ thicknessAttenuationNode: ConstNode<number>;
11
+ thicknessPowerNode: ConstNode<number>;
12
+ thicknessScaleNode: ConstNode<number>;
13
+
14
+ constructor(parameters?: ShaderMaterialParameters);
15
+
16
+ get useSSS(): boolean;
17
+ }
@@ -3,7 +3,7 @@ import Node from '../core/Node.js';
3
3
  import NodeMaterial from './NodeMaterial.js';
4
4
 
5
5
  export default class MeshStandardNodeMaterial extends NodeMaterial {
6
- isMeshStandardNodeMaterial: true;
6
+ readonly isMeshStandardNodeMaterial: true;
7
7
 
8
8
  emissiveNode: Node | null;
9
9
 
@@ -11,5 +11,4 @@ export default class MeshStandardNodeMaterial extends NodeMaterial {
11
11
  roughnessNode: Node | null;
12
12
 
13
13
  constructor(paramters?: ShaderMaterialParameters);
14
- copy(source: MeshStandardNodeMaterial): this;
15
14
  }