@types/three 0.163.0 → 0.164.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 (53) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/animation/CCDIKSolver.d.ts +19 -6
  3. three/examples/jsm/exporters/USDZExporter.d.ts +8 -1
  4. three/examples/jsm/interactive/SelectionBox.d.ts +1 -0
  5. three/examples/jsm/math/Octree.d.ts +2 -1
  6. three/examples/jsm/nodes/Nodes.d.ts +28 -4
  7. three/examples/jsm/nodes/accessors/AccessorsUtils.d.ts +2 -0
  8. three/examples/jsm/nodes/accessors/MaterialNode.d.ts +84 -1
  9. three/examples/jsm/nodes/accessors/TextureNode.d.ts +3 -0
  10. three/examples/jsm/nodes/code/CodeNode.d.ts +7 -2
  11. three/examples/jsm/nodes/code/FunctionNode.d.ts +10 -4
  12. three/examples/jsm/nodes/core/LightingModel.d.ts +1 -0
  13. three/examples/jsm/nodes/core/NodeBuilder.d.ts +1 -1
  14. three/examples/jsm/nodes/core/OutputStructNode.d.ts +12 -0
  15. three/examples/jsm/nodes/core/PropertyNode.d.ts +10 -0
  16. three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +3 -1
  17. three/examples/jsm/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts +10 -0
  18. three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +7 -2
  19. three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts +16 -0
  20. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +10 -2
  21. three/examples/jsm/nodes/functions/ShadowMaskModel.d.ts +9 -0
  22. three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +3 -2
  23. three/examples/jsm/nodes/functions/material/getRoughness.d.ts +3 -2
  24. three/examples/jsm/nodes/lighting/AnalyticLightNode.d.ts +0 -2
  25. three/examples/jsm/nodes/lighting/IrradianceNode.d.ts +8 -0
  26. three/examples/jsm/nodes/lighting/LightUtils.d.ts +7 -2
  27. three/examples/jsm/nodes/materials/Materials.d.ts +1 -0
  28. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +24 -14
  29. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +6 -2
  30. three/examples/jsm/nodes/materials/ShadowNodeMaterial.d.ts +15 -0
  31. three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +36 -32
  32. three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +3 -4
  33. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +127 -6
  34. three/examples/jsm/nodes/materialx/lib/mx_transform_color.d.ts +4 -0
  35. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +6 -3
  36. three/examples/jsm/physics/JoltPhysics.d.ts +10 -0
  37. three/examples/jsm/postprocessing/RenderTransitionPass.d.ts +33 -0
  38. three/examples/jsm/renderers/common/Renderer.d.ts +7 -4
  39. three/examples/jsm/utils/SceneUtils.d.ts +18 -0
  40. three/examples/jsm/webxr/OculusHandModel.d.ts +5 -2
  41. three/examples/jsm/webxr/XRHandModelFactory.d.ts +8 -2
  42. three/package.json +2 -2
  43. three/src/core/Object3D.d.ts +6 -5
  44. three/src/core/RenderTarget.d.ts +25 -10
  45. three/src/materials/MeshPhysicalMaterial.d.ts +65 -51
  46. three/src/objects/BatchedMesh.d.ts +13 -0
  47. three/src/renderers/shaders/ShaderChunk.d.ts +0 -1
  48. three/src/renderers/webgl/WebGLBufferRenderer.d.ts +6 -0
  49. three/src/renderers/webgl/WebGLCapabilities.d.ts +5 -0
  50. three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +6 -0
  51. three/src/renderers/webgl/WebGLPrograms.d.ts +2 -0
  52. three/src/textures/types.d.ts +4 -4
  53. three/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.d.ts +0 -3
three/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 29 Mar 2024 19:35:33 GMT
11
+ * Last updated: Fri, 26 Apr 2024 16:08:00 GMT
12
12
  * Dependencies: [@tweenjs/tween.js](https://npmjs.com/package/@tweenjs/tween.js), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer)
13
13
 
14
14
  # Credits
@@ -1,7 +1,7 @@
1
- import { Object3D, SkinnedMesh, Vector3 } from "three";
1
+ import { LineBasicMaterial, MeshBasicMaterial, Object3D, SkinnedMesh, SphereGeometry, Vector3 } from "three";
2
2
 
3
3
  // eslint-disable-next-line @typescript-eslint/naming-convention
4
- export interface IKS {
4
+ export interface IK {
5
5
  effector: number;
6
6
  iteration?: number | undefined;
7
7
  links: Array<{
@@ -17,14 +17,27 @@ export interface IKS {
17
17
  }
18
18
 
19
19
  export class CCDIKSolver {
20
- constructor(mesh: SkinnedMesh, iks: IKS[]);
20
+ mesh: SkinnedMesh;
21
+ iks: IK[];
22
+
23
+ constructor(mesh: SkinnedMesh, iks?: IK[]);
21
24
 
22
25
  update(): this;
23
- updateOne(iks: IKS): this;
24
- createHelper(): CCDIKHelper;
26
+ updateOne(ik: IK): this;
27
+ createHelper(sphereSize?: number): CCDIKHelper;
25
28
  }
26
29
 
27
30
  export class CCDIKHelper extends Object3D {
28
- constructor(mesh: SkinnedMesh, iks?: IKS[], sphereSize?: number);
31
+ root: SkinnedMesh;
32
+ iks: IK[];
33
+
34
+ sphereGeometry: SphereGeometry;
35
+ targetSphereMaterial: MeshBasicMaterial;
36
+ effectorSphereMaterial: MeshBasicMaterial;
37
+ linkSphereMaterial: MeshBasicMaterial;
38
+ lineMaterial: LineBasicMaterial;
39
+
40
+ constructor(mesh: SkinnedMesh, iks?: IK[], sphereSize?: number);
41
+
29
42
  dispose(): void;
30
43
  }
@@ -8,5 +8,12 @@ export interface USDZExporterOptions {
8
8
  export class USDZExporter {
9
9
  constructor();
10
10
 
11
- parse(scene: Object3D, options?: USDZExporterOptions): Promise<Uint8Array>;
11
+ parse(
12
+ scene: Object3D,
13
+ onDone: (result: Uint8Array) => void,
14
+ onError: (error: unknown) => void,
15
+ options?: USDZExporterOptions,
16
+ ): void;
17
+
18
+ parseAsync(scene: Object3D, options?: USDZExporterOptions): Promise<Uint8Array>;
12
19
  }
@@ -8,6 +8,7 @@ export class SelectionBox {
8
8
  endPoint: Vector3;
9
9
  scene: Scene;
10
10
  startPoint: Vector3;
11
+ instances: Record<string, number[]>;
11
12
 
12
13
  select(startPoint?: Vector3, endPoint?: Vector3): Mesh[];
13
14
  updateFrustum(startPoint: Vector3, endPoint: Vector3): void;
@@ -1,4 +1,4 @@
1
- import { Box3, Object3D, Ray, Sphere, Triangle } from "three";
1
+ import { Box3, Layers, Object3D, Ray, Sphere, Triangle } from "three";
2
2
 
3
3
  import { Capsule } from "./Capsule.js";
4
4
 
@@ -8,6 +8,7 @@ export class Octree {
8
8
 
9
9
  subTrees: Octree[];
10
10
  triangles: Triangle[];
11
+ layers: Layers;
11
12
 
12
13
  constructor(box?: Box3 | null);
13
14
 
@@ -26,7 +26,12 @@ export { default as NodeKeywords } from "./core/NodeKeywords.js";
26
26
  export { default as NodeUniform } from "./core/NodeUniform.js";
27
27
  export { default as NodeVar } from "./core/NodeVar.js";
28
28
  export { default as NodeVarying } from "./core/NodeVarying.js";
29
+ export { default as OutputStructNode, outputStruct } from "./core/OutputStructNode.js";
29
30
  export {
31
+ alphaT,
32
+ anisotropy,
33
+ anisotropyB,
34
+ anisotropyT,
30
35
  clearcoat,
31
36
  clearcoatRoughness,
32
37
  dashSize,
@@ -190,7 +195,7 @@ export {
190
195
  export * from "./shadernode/ShaderNode.js";
191
196
 
192
197
  // accessors
193
- export { parallaxDirection, parallaxUV, TBNViewMatrix } from "./accessors/AccessorsUtils.js";
198
+ export { parallaxDirection, parallaxUV, TBNViewMatrix, transformedBentNormalView } from "./accessors/AccessorsUtils.js";
194
199
  export { batch, default as BatchNode } from "./accessors/BatchNode.js";
195
200
  export {
196
201
  bitangentGeometry,
@@ -220,16 +225,34 @@ export { default as InstanceNode, instance } from "./accessors/InstanceNode.js";
220
225
  export {
221
226
  default as MaterialNode,
222
227
  materialAlphaTest,
228
+ materialAnisotropy,
229
+ materialAnisotropyVector,
230
+ materialClearcoat,
231
+ materialClearcoatNormal,
232
+ materialClearcoatRoughness,
223
233
  materialColor,
224
234
  materialEmissive,
235
+ materialIridescence,
236
+ materialIridescenceIOR,
237
+ materialIridescenceThickness,
238
+ materialLineDashOffset,
239
+ materialLineDashSize,
240
+ materialLineGapSize,
241
+ materialLineScale,
242
+ materialLineWidth,
225
243
  materialMetalness,
226
244
  MaterialNodeScope,
245
+ materialNormal,
227
246
  materialOpacity,
247
+ materialPointWidth,
228
248
  materialReflectivity,
229
249
  materialRotation,
230
250
  materialRoughness,
251
+ materialSheen,
252
+ materialSheenRoughness,
231
253
  materialShininess,
232
- materialSpecularColor,
254
+ materialSpecular,
255
+ materialSpecularStrength,
233
256
  } from "./accessors/MaterialNode.js";
234
257
  export { default as MaterialReferenceNode, materialReference } from "./accessors/MaterialReferenceNode.js";
235
258
  export {
@@ -349,10 +372,10 @@ export { default as ViewportTextureNode, viewportMipTexture, viewportTexture } f
349
372
  export { default as PassNode, depthPass, pass, PassNodeScope } from "./display/PassNode.js";
350
373
 
351
374
  // code
352
- export { code, CodeNodeInclude, default as CodeNode } from "./code/CodeNode.js";
375
+ export { code, CodeNodeInclude, default as CodeNode, glsl, js, wgsl } from "./code/CodeNode.js";
353
376
  export { default as ExpressionNode, expression } from "./code/ExpressionNode.js";
354
377
  export { call, default as FunctionCallNode } from "./code/FunctionCallNode.js";
355
- export { default as FunctionNode, Fn, fn, func, FunctionNodeArguments } from "./code/FunctionNode.js";
378
+ export { default as FunctionNode, Fn, FunctionNodeArguments, glslFn, wgslFn } from "./code/FunctionNode.js";
356
379
 
357
380
  // fog
358
381
  export { default as FogExp2Node, densityFog } from "./fog/FogExp2Node.js";
@@ -370,6 +393,7 @@ export { default as AnalyticLightNode } from "./lighting/AnalyticLightNode.js";
370
393
  export { default as AONode } from "./lighting/AONode.js";
371
394
  export { default as EnvironmentNode } from "./lighting/EnvironmentNode.js";
372
395
  export { default as HemisphereLightNode } from "./lighting/HemisphereLightNode.js";
396
+ export { default as IrradianceNode } from "./lighting/IrradianceNode.js";
373
397
  export { default as LightingContextNode, lightingContext } from "./lighting/LightingContextNode.js";
374
398
  export { default as LightingNode } from "./lighting/LightingNode.js";
375
399
  export { default as LightsNode, lights } from "./lighting/LightsNode.js";
@@ -5,3 +5,5 @@ export const TBNViewMatrix: ShaderNodeObject<Node>;
5
5
 
6
6
  export const parallaxDirection: ShaderNodeObject<Node>;
7
7
  export const parallaxUV: (uv: ShaderNodeObject<Node>, scale: NodeRepresentation) => ShaderNodeObject<Node>;
8
+
9
+ export const transformedBentNormalView: ShaderNodeObject<Node>;
@@ -1,23 +1,79 @@
1
+ import { Vector2 } from "three";
1
2
  import Node from "../core/Node.js";
3
+ import UniformNode from "../core/UniformNode.js";
2
4
  import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
3
5
 
4
6
  export type MaterialNodeScope =
5
7
  | typeof MaterialNode.ALPHA_TEST
6
8
  | typeof MaterialNode.COLOR
7
9
  | typeof MaterialNode.OPACITY
10
+ | typeof MaterialNode.SHININESS
11
+ | typeof MaterialNode.SPECULAR
12
+ | typeof MaterialNode.SPECULAR_STRENGTH
13
+ | typeof MaterialNode.SPECULAR_INTENSITY
14
+ | typeof MaterialNode.SPECULAR_COLOR
15
+ | typeof MaterialNode.REFLECTIVITY
8
16
  | typeof MaterialNode.ROUGHNESS
9
17
  | typeof MaterialNode.METALNESS
18
+ | typeof MaterialNode.NORMAL
19
+ | typeof MaterialNode.CLEARCOAT
20
+ | typeof MaterialNode.CLEARCOAT_ROUGHNESS
21
+ | typeof MaterialNode.CLEARCOAT_NORMAL
10
22
  | typeof MaterialNode.EMISSIVE
11
- | typeof MaterialNode.ROTATION;
23
+ | typeof MaterialNode.ROTATION
24
+ | typeof MaterialNode.SHEEN
25
+ | typeof MaterialNode.SHEEN_ROUGHNESS
26
+ | typeof MaterialNode.ANISOTROPY
27
+ | typeof MaterialNode.IRIDESCENCE
28
+ | typeof MaterialNode.IRIDESCENCE_IOR
29
+ | typeof MaterialNode.IRIDESCENCE_THICKNESS
30
+ | typeof MaterialNode.IOR
31
+ | typeof MaterialNode.TRANSMISSION
32
+ | typeof MaterialNode.THICKNESS
33
+ | typeof MaterialNode.ATTENUATION_DISTANCE
34
+ | typeof MaterialNode.ATTENUATION_COLOR
35
+ | typeof MaterialNode.LINE_SCALE
36
+ | typeof MaterialNode.LINE_DASH_SIZE
37
+ | typeof MaterialNode.LINE_GAP_SIZE
38
+ | typeof MaterialNode.LINE_WIDTH
39
+ | typeof MaterialNode.LINE_DASH_OFFSET
40
+ | typeof MaterialNode.POINT_WIDTH;
12
41
 
13
42
  export default class MaterialNode extends Node {
14
43
  static ALPHA_TEST: "alphaTest";
15
44
  static COLOR: "color";
16
45
  static OPACITY: "opacity";
46
+ static SHININESS: "shininess";
47
+ static SPECULAR: "specular";
48
+ static SPECULAR_STRENGTH: "specularStrength";
49
+ static SPECULAR_INTENSITY: "specularIntensity";
50
+ static SPECULAR_COLOR: "specularColor";
51
+ static REFLECTIVITY: "reflectivity";
17
52
  static ROUGHNESS: "roughness";
18
53
  static METALNESS: "metalness";
54
+ static NORMAL: "normal";
55
+ static CLEARCOAT: "clearcoat";
56
+ static CLEARCOAT_ROUGHNESS: "clearcoatRoughness";
57
+ static CLEARCOAT_NORMAL: "clearcoatNormal";
19
58
  static EMISSIVE: "emissive";
20
59
  static ROTATION: "rotation";
60
+ static SHEEN: "sheen";
61
+ static SHEEN_ROUGHNESS: "sheenRoughness";
62
+ static ANISOTROPY: "anisotropy";
63
+ static IRIDESCENCE: "iridescence";
64
+ static IRIDESCENCE_IOR: "iridescenceIOR";
65
+ static IRIDESCENCE_THICKNESS: "iridescenceThickness";
66
+ static IOR: "ior";
67
+ static TRANSMISSION: "transmission";
68
+ static THICKNESS: "thickness";
69
+ static ATTENUATION_DISTANCE: "attenuationDistance";
70
+ static ATTENUATION_COLOR: "attenuationColor";
71
+ static LINE_SCALE: "scale";
72
+ static LINE_DASH_SIZE: "dashSize";
73
+ static LINE_GAP_SIZE: "gapSize";
74
+ static LINE_WIDTH: "linewidth";
75
+ static LINE_DASH_OFFSET: "dashOffset";
76
+ static POINT_WIDTH: "pointWidth";
21
77
 
22
78
  scope: MaterialNodeScope;
23
79
  constructor(scope?: MaterialNodeScope);
@@ -28,8 +84,35 @@ export const materialColor: ShaderNodeObject<MaterialNode>;
28
84
  export const materialShininess: ShaderNodeObject<MaterialNode>;
29
85
  export const materialEmissive: ShaderNodeObject<MaterialNode>;
30
86
  export const materialOpacity: ShaderNodeObject<MaterialNode>;
87
+ export const materialSpecular: ShaderNodeObject<MaterialNode>;
88
+
89
+ export const materialSpecularIntensity: ShaderNodeObject<MaterialNode>;
31
90
  export const materialSpecularColor: ShaderNodeObject<MaterialNode>;
91
+
92
+ export const materialSpecularStrength: ShaderNodeObject<MaterialNode>;
32
93
  export const materialReflectivity: ShaderNodeObject<MaterialNode>;
33
94
  export const materialRoughness: ShaderNodeObject<MaterialNode>;
34
95
  export const materialMetalness: ShaderNodeObject<MaterialNode>;
96
+ export const materialNormal: ShaderNodeObject<MaterialNode>;
97
+ export const materialClearcoat: ShaderNodeObject<MaterialNode>;
98
+ export const materialClearcoatRoughness: ShaderNodeObject<MaterialNode>;
99
+ export const materialClearcoatNormal: ShaderNodeObject<MaterialNode>;
35
100
  export const materialRotation: ShaderNodeObject<MaterialNode>;
101
+ export const materialSheen: ShaderNodeObject<MaterialNode>;
102
+ export const materialSheenRoughness: ShaderNodeObject<MaterialNode>;
103
+ export const materialAnisotropy: ShaderNodeObject<MaterialNode>;
104
+ export const materialIridescence: ShaderNodeObject<MaterialNode>;
105
+ export const materialIridescenceIOR: ShaderNodeObject<MaterialNode>;
106
+ export const materialIridescenceThickness: ShaderNodeObject<MaterialNode>;
107
+ export const materialTransmission: ShaderNodeObject<MaterialNode>;
108
+ export const materialThickness: ShaderNodeObject<MaterialNode>;
109
+ export const materialIOR: ShaderNodeObject<MaterialNode>;
110
+ export const materialAttenuationDistance: ShaderNodeObject<MaterialNode>;
111
+ export const materialAttenuationColor: ShaderNodeObject<MaterialNode>;
112
+ export const materialLineScale: ShaderNodeObject<MaterialNode>;
113
+ export const materialLineDashSize: ShaderNodeObject<MaterialNode>;
114
+ export const materialLineGapSize: ShaderNodeObject<MaterialNode>;
115
+ export const materialLineWidth: ShaderNodeObject<MaterialNode>;
116
+ export const materialLineDashOffset: ShaderNodeObject<MaterialNode>;
117
+ export const materialPointWidth: ShaderNodeObject<MaterialNode>;
118
+ export const materialAnisotropyVector: ShaderNodeObject<UniformNode<Vector2>>;
@@ -10,6 +10,7 @@ export default class TextureNode extends UniformNode<Texture> {
10
10
  levelNode: ShaderNodeObject<Node> | null;
11
11
  compareNode: Node | null;
12
12
  depthNode: Node | null;
13
+ gradNode: Node | null;
13
14
 
14
15
  sampler: boolean;
15
16
  updateMatrix: boolean;
@@ -20,6 +21,8 @@ export default class TextureNode extends UniformNode<Texture> {
20
21
 
21
22
  getDefaultUV(): Node;
22
23
 
24
+ grad(gradeNodeX: NodeRepresentation, gradeNodeY: NodeRepresentation): ShaderNodeObject<Node>;
25
+
23
26
  clone(): this;
24
27
  }
25
28
 
@@ -10,10 +10,15 @@ export interface CodeNodeInclude {
10
10
  export default class CodeNode extends Node {
11
11
  isCodeNode: true;
12
12
  code: string;
13
- constructor(code?: string, includes?: CodeNodeInclude[]);
13
+ language: string;
14
+
15
+ constructor(code?: string, includes?: CodeNodeInclude[], language?: string);
14
16
 
15
17
  setIncludes(includes: CodeNodeInclude[]): this;
16
18
  getIncludes(builder: NodeBuilder): CodeNodeInclude[];
17
19
  }
18
20
 
19
- export const code: (code: string, nodeType?: NodeTypeOption) => ShaderNodeObject<CodeNode>;
21
+ export const code: (code: string, includes?: CodeNodeInclude[], language?: string) => ShaderNodeObject<CodeNode>;
22
+ export const js: (src: string, includes?: CodeNodeInclude[]) => ShaderNodeObject<CodeNode>;
23
+ export const wgsl: (src: string, includes?: CodeNodeInclude[]) => ShaderNodeObject<CodeNode>;
24
+ export const glsl: (src: string, includes?: CodeNodeInclude[]) => ShaderNodeObject<CodeNode>;
@@ -10,7 +10,7 @@ export type FunctionNodeArguments = Node[] | { [name: string]: Node };
10
10
 
11
11
  export default class FunctionNode<P extends Node[] | { [name: string]: Node }> extends CodeNode {
12
12
  keywords: { [key: string]: Node };
13
- constructor(code?: string, includes?: CodeNodeInclude[]);
13
+ constructor(code?: string, includes?: CodeNodeInclude[], language?: string);
14
14
 
15
15
  getInputs(builder: NodeBuilder): NodeFunctionInput[];
16
16
  getNodeFunction(builder: NodeBuilder): NodeFunction;
@@ -20,13 +20,19 @@ export default class FunctionNode<P extends Node[] | { [name: string]: Node }> e
20
20
  export type Fn<P extends FunctionNodeArguments> = P extends readonly [...unknown[]] ? ProxiedTuple<P>
21
21
  : readonly [ProxiedObject<P>];
22
22
 
23
- export const func: <P extends FunctionNodeArguments>(
23
+ export const nativeFn: <P extends FunctionNodeArguments>(
24
24
  code: string,
25
25
  includes?: CodeNodeInclude[],
26
+ language?: string,
26
27
  // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
27
- ) => { call: (...params: Fn<P>) => ShaderNodeObject<Node> };
28
+ ) => (...params: Fn<P>) => ShaderNodeObject<Node>;
28
29
 
29
- export const fn: <P extends FunctionNodeArguments>(
30
+ export const glslFn: <P extends FunctionNodeArguments>(
31
+ code: string,
32
+ includes?: CodeNodeInclude[],
33
+ // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
34
+ ) => (...params: Fn<P>) => ShaderNodeObject<Node>;
35
+ export const wgslFn: <P extends FunctionNodeArguments>(
30
36
  code: string,
31
37
  includes?: CodeNodeInclude[],
32
38
  // eslint-disable-next-line @definitelytyped/no-unnecessary-generics
@@ -13,6 +13,7 @@ export interface LightingModelDirectInput {
13
13
  lightDirection: Node;
14
14
  lightColor: Node;
15
15
  reflectedLight: LightingModelReflectedLight;
16
+ shadowMask: Node;
16
17
  }
17
18
 
18
19
  export interface LightingModelIndirectInput {
@@ -127,7 +127,7 @@ export default abstract class NodeBuilder {
127
127
  setBuildStage(buildStage: BuildStageOption): void;
128
128
  getBuildStage(): BuildStageOption;
129
129
  abstract buildCode(): void;
130
- build(createMaterial?: boolean): this;
130
+ build(): this;
131
131
  format(snippet: string, fromType: NodeTypeOption, toType: NodeTypeOption): string;
132
132
  getSignature(): string;
133
133
  }
@@ -0,0 +1,12 @@
1
+ import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
2
+ import Node from "./Node.js";
3
+
4
+ export default class OutputStructNode extends Node {
5
+ members: Node[];
6
+
7
+ readonly isOutputStructNode: true;
8
+
9
+ constructor(...members: Node[]);
10
+ }
11
+
12
+ export const outputStruct: (...members: Node[]) => ShaderNodeObject<OutputStructNode>;
@@ -24,9 +24,19 @@ export const sheenRoughness: ShaderNodeObject<PropertyNode>;
24
24
  export const iridescence: ShaderNodeObject<PropertyNode>;
25
25
  export const iridescenceIOR: ShaderNodeObject<PropertyNode>;
26
26
  export const iridescenceThickness: ShaderNodeObject<PropertyNode>;
27
+ export const alphaT: ShaderNodeObject<PropertyNode>;
28
+ export const anisotropy: ShaderNodeObject<PropertyNode>;
29
+ export const anisotropyT: ShaderNodeObject<PropertyNode>;
30
+ export const anisotropyB: ShaderNodeObject<PropertyNode>;
27
31
  export const specularColor: ShaderNodeObject<PropertyNode>;
32
+ export const specularF90: ShaderNodeObject<PropertyNode>;
28
33
  export const shininess: ShaderNodeObject<PropertyNode>;
29
34
  export const output: ShaderNodeObject<PropertyNode>;
30
35
  export const dashSize: ShaderNodeObject<PropertyNode>;
31
36
  export const gapSize: ShaderNodeObject<PropertyNode>;
32
37
  export const pointWidth: ShaderNodeObject<PropertyNode>;
38
+ export const ior: ShaderNodeObject<PropertyNode>;
39
+ export const transmission: ShaderNodeObject<PropertyNode>;
40
+ export const thickness: ShaderNodeObject<PropertyNode>;
41
+ export const attenuationDistance: ShaderNodeObject<PropertyNode>;
42
+ export const attenuationColor: ShaderNodeObject<PropertyNode>;
@@ -7,7 +7,9 @@ declare const BRDF_GGX: (args: {
7
7
  f0: Node;
8
8
  f90: Node;
9
9
  roughness: Node;
10
- iridescenceFresnel?: Node;
10
+ f?: Node;
11
+ USE_IRIDESCENCE?: Node;
12
+ USE_ANISOTROPY?: Node;
11
13
  }) => ShaderNodeObject<OperatorNode>;
12
14
 
13
15
  export default BRDF_GGX;
@@ -0,0 +1,10 @@
1
+ import Node from "../../core/Node.js";
2
+ import OperatorNode from "../../math/OperatorNode.js";
3
+ import { ShaderNodeObject } from "../../shadernode/ShaderNode.js";
4
+
5
+ // https://google.github.io/filament/Filament.md.html#materialsystem/anisotropicmodel/anisotropicspecularbrdf
6
+ declare const D_GGX_Anisotropic: (
7
+ args: { alphaT: Node; alphaB: Node; dotNH: Node; dotTH: Node; dotBH: Node },
8
+ ) => ShaderNodeObject<OperatorNode>;
9
+
10
+ export default D_GGX_Anisotropic;
@@ -1,6 +1,11 @@
1
1
  import Node from "../../core/Node.js";
2
- import { ShaderNode } from "../../shadernode/ShaderNode.js";
2
+ import OperatorNode from "../../math/OperatorNode.js";
3
+ import { ShaderNodeObject } from "../../shadernode/ShaderNode.js";
3
4
 
4
- declare const V_GGX_SmithCorrelated: ShaderNode<{ alpha: Node; dotNL: Node; dotNV: Node }>;
5
+ declare const V_GGX_SmithCorrelated: (inputs: {
6
+ alpha: Node;
7
+ dotNL: Node;
8
+ dotNV: Node;
9
+ }) => ShaderNodeObject<OperatorNode>;
5
10
 
6
11
  export default V_GGX_SmithCorrelated;
@@ -0,0 +1,16 @@
1
+ import Node from "../../core/Node.js";
2
+ import MathNode from "../../math/MathNode";
3
+ import { ShaderNodeObject } from "../../shadernode/ShaderNode.js";
4
+
5
+ declare const V_GGX_SmithCorrelated: (inputs: {
6
+ alphaT: Node;
7
+ alphaB: Node;
8
+ dotTV: Node;
9
+ dotBV: Node;
10
+ dotTL: Node;
11
+ dotBL: Node;
12
+ dotNV: Node;
13
+ dotNL: Node;
14
+ }) => ShaderNodeObject<MathNode>;
15
+
16
+ export default V_GGX_SmithCorrelated;
@@ -5,6 +5,8 @@ export default class PhysicalLightingModel extends LightingModel {
5
5
  clearcoat: boolean;
6
6
  sheen: boolean;
7
7
  iridescence: boolean;
8
+ anisotropy: boolean;
9
+ transmission: boolean;
8
10
 
9
11
  clearcoatRadiance: Node | null;
10
12
  clearcoatSpecularDirect: Node | null;
@@ -14,7 +16,13 @@ export default class PhysicalLightingModel extends LightingModel {
14
16
  iridescenceFresnel: Node | null;
15
17
  iridescenceF0: Node | null;
16
18
 
17
- constructor(clearcoat?: boolean, sheen?: boolean, iridescence?: boolean);
19
+ constructor(
20
+ clearcoat?: boolean,
21
+ sheen?: boolean,
22
+ iridescence?: boolean,
23
+ anisotropy?: boolean,
24
+ transmission?: boolean,
25
+ );
18
26
 
19
- computeMultiscattering(singleScatter: Node, multiScatter: Node, specularF90?: Node): void;
27
+ computeMultiscattering(singleScatter: Node, multiScatter: Node, specularF90: Node): void;
20
28
  }
@@ -0,0 +1,9 @@
1
+ import LightingModel from "../core/LightingModel.js";
2
+ import VarNode from "../core/VarNode.js";
3
+ import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
4
+
5
+ export default class ShadowMaskModel extends LightingModel {
6
+ shadowNode: ShaderNodeObject<VarNode>;
7
+
8
+ constructor();
9
+ }
@@ -1,5 +1,6 @@
1
- import { ShaderNode } from "../../shadernode/ShaderNode.js";
1
+ import MathNode from "../../math/MathNode.js";
2
+ import { ShaderNodeObject } from "../../shadernode/ShaderNode.js";
2
3
 
3
- declare const getGeometryRoughness: ShaderNode;
4
+ declare const getGeometryRoughness: () => ShaderNodeObject<MathNode>;
4
5
 
5
6
  export default getGeometryRoughness;
@@ -1,6 +1,7 @@
1
1
  import Node from "../../core/Node.js";
2
- import { ShaderNode } from "../../shadernode/ShaderNode.js";
2
+ import MathNode from "../../math/MathNode.js";
3
+ import { ShaderNodeObject } from "../../shadernode/ShaderNode.js";
3
4
 
4
- declare const getRoughness: ShaderNode<{ roughness: Node }>;
5
+ declare const getRoughness: (args: { roughness: Node }) => ShaderNodeObject<MathNode>;
5
6
 
6
7
  export default getRoughness;
@@ -1,10 +1,8 @@
1
1
  import { Light } from "three";
2
- import Node from "../core/Node.js";
3
2
  import LightingNode from "./LightingNode.js";
4
3
 
5
4
  export default class AnalyticLightNode<T extends Light> extends LightingNode {
6
5
  light: T | null;
7
- colorNode: Node;
8
6
 
9
7
  constructor(light?: T | null);
10
8
  }
@@ -0,0 +1,8 @@
1
+ import Node from "../core/Node.js";
2
+ import LightingNode from "./LightingNode.js";
3
+
4
+ export default class IrradianceNode extends LightingNode {
5
+ node: Node | null;
6
+
7
+ constructor(node?: Node | null);
8
+ }
@@ -1,4 +1,9 @@
1
1
  import Node from "../core/Node.js";
2
- import { ShaderNode } from "../shadernode/ShaderNode.js";
2
+ import CondNode from "../math/CondNode.js";
3
+ import { ShaderNodeObject } from "../shadernode/ShaderNode.js";
3
4
 
4
- export const getDistanceAttenuation: ShaderNode<{ lightDistance: Node; cutoffDistance: Node; decayExponent: Node }>;
5
+ export const getDistanceAttenuation: (args: {
6
+ lightDistance: Node;
7
+ cutoffDistance: Node;
8
+ decayExponent: Node;
9
+ }) => ShaderNodeObject<CondNode>;
@@ -7,4 +7,5 @@ export { default as MeshSSSPhysicalNodeMaterial } from "./MeshSSSNodeMaterial.js
7
7
  export { default as MeshStandardNodeMaterial } from "./MeshStandardNodeMaterial.js";
8
8
  export { default as NodeMaterial } from "./NodeMaterial.js";
9
9
  export { default as PointsNodeMaterial } from "./PointsNodeMaterial.js";
10
+ export { default as ShadowNodeMaterial } from "./ShadowNodeMaterial.js";
10
11
  export { default as SpriteNodeMaterial } from "./SpriteNodeMaterial.js";
@@ -23,7 +23,7 @@ export default class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
23
23
  iridescenceIORNode: ShaderNodeObject<Node> | null;
24
24
  iridescenceThicknessNode: ShaderNodeObject<Node> | null;
25
25
 
26
- iorNode?: ShaderNodeObject<Node> | null;
26
+ iorNode: ShaderNodeObject<Node> | null;
27
27
 
28
28
  specularIntensityNode: ShaderNodeObject<Node> | null;
29
29
  specularColorNode: ShaderNodeObject<Node> | null;
@@ -33,39 +33,49 @@ export default class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
33
33
  attenuationDistanceNode: ShaderNodeObject<Node> | null;
34
34
  attenuationColorNode: ShaderNodeObject<Node> | null;
35
35
 
36
+ anisotropyNode: ShaderNodeObject<Node> | null;
37
+
36
38
  // Properties from MeshPhysicalMaterial
37
39
  readonly isMeshPhysicalMaterial: true;
38
- clearcoat: number;
40
+ anisotropyRotation: number;
41
+ anisotropyMap: Texture | null;
39
42
  clearcoatMap: Texture | null;
40
43
  clearcoatRoughness: number;
41
44
  clearcoatRoughnessMap: Texture | null;
42
45
  clearcoatNormalScale: Vector2;
43
46
  clearcoatNormalMap: Texture | null;
44
- reflectivity: number;
45
47
  ior: number;
46
- sheen: number;
48
+ get reflectivity(): number;
49
+ set reflectivity(reflectivity: number);
50
+ iridescenceMap: Texture | null;
51
+ iridescenceIOR: number;
52
+ iridescenceThicknessRange: [number, number];
53
+ iridescenceThicknessMap: Texture | null;
47
54
  sheenColor: Color;
48
55
  sheenColorMap: Texture | null;
49
56
  sheenRoughness: number;
50
57
  sheenRoughnessMap: Texture | null;
51
- transmission: number;
52
58
  transmissionMap: Texture | null;
53
59
  thickness: number;
54
60
  thicknessMap: Texture | null;
55
61
  attenuationDistance: number;
56
62
  attenuationColor: Color;
57
63
  specularIntensity: number;
58
- specularColor: Color;
59
64
  specularIntensityMap: Texture | null;
65
+ specularColor: Color;
60
66
  specularColorMap: Texture | null;
61
- iridescenceMap: Texture | null;
62
- iridescenceIOR: number;
63
- iridescence: number;
64
- iridescenceThicknessRange: [number, number];
65
- iridescenceThicknessMap: Texture | null;
66
- anisotropy?: number;
67
- anisotropyRotation?: number;
68
- anisotropyMap?: Texture | null;
67
+ get anisotropy(): number;
68
+ set anisotropy(value: number);
69
+ get clearcoat(): number;
70
+ set clearcoat(value: number);
71
+ get iridescence(): number;
72
+ set iridescence(value: number);
73
+ get dispersion(): number;
74
+ set dispersion(value: number);
75
+ get sheen(): number;
76
+ set sheen(value: number);
77
+ get transmission(): number;
78
+ set transmission(value: number);
69
79
 
70
80
  constructor(parameters?: MeshPhysicalNodeMaterialParameters);
71
81
  }