@types/three 0.177.0 → 0.178.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 (178) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/capabilities/WebGL.d.ts +0 -11
  3. three/examples/jsm/controls/TransformControls.d.ts +16 -1
  4. three/examples/jsm/helpers/TextureHelper.d.ts +2 -2
  5. three/examples/jsm/helpers/TextureHelperGPU.d.ts +2 -2
  6. three/examples/jsm/loaders/SVGLoader.d.ts +1 -1
  7. three/examples/jsm/physics/RapierPhysics.d.ts +1 -0
  8. three/examples/jsm/transpiler/AST.d.ts +77 -26
  9. three/examples/jsm/transpiler/TSLEncoder.d.ts +9 -3
  10. three/examples/jsm/tsl/display/AnamorphicNode.d.ts +4 -4
  11. three/examples/jsm/tsl/display/BleachBypass.d.ts +2 -2
  12. three/examples/jsm/tsl/display/BloomNode.d.ts +2 -2
  13. three/examples/jsm/tsl/display/ChromaticAberrationNode.d.ts +20 -0
  14. three/examples/jsm/tsl/display/DenoiseNode.d.ts +4 -4
  15. three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +6 -6
  16. three/examples/jsm/tsl/display/DotScreenNode.d.ts +2 -2
  17. three/examples/jsm/tsl/display/FXAANode.d.ts +3 -3
  18. three/examples/jsm/tsl/display/FilmNode.d.ts +4 -4
  19. three/examples/jsm/tsl/display/GTAONode.d.ts +3 -3
  20. three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +5 -5
  21. three/examples/jsm/tsl/display/LensflareNode.d.ts +8 -8
  22. three/examples/jsm/tsl/display/Lut3DNode.d.ts +4 -4
  23. three/examples/jsm/tsl/display/MotionBlur.d.ts +4 -4
  24. three/examples/jsm/tsl/display/OutlineNode.d.ts +3 -3
  25. three/examples/jsm/tsl/display/RGBShiftNode.d.ts +3 -3
  26. three/examples/jsm/tsl/display/SMAANode.d.ts +3 -3
  27. three/examples/jsm/tsl/display/SSRNode.d.ts +5 -5
  28. three/examples/jsm/tsl/display/Sepia.d.ts +2 -2
  29. three/examples/jsm/tsl/display/SobelOperatorNode.d.ts +3 -3
  30. three/examples/jsm/tsl/display/TransitionNode.d.ts +4 -4
  31. three/examples/jsm/tsl/display/hashBlur.d.ts +5 -5
  32. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +5 -5
  33. three/package.json +2 -2
  34. three/src/Three.TSL.d.ts +9 -16
  35. three/src/Three.WebGPU.d.ts +2 -0
  36. three/src/constants.d.ts +13 -5
  37. three/src/core/BufferGeometry.d.ts +6 -1
  38. three/src/core/GLBufferAttribute.d.ts +18 -1
  39. three/src/helpers/AxesHelper.d.ts +3 -1
  40. three/src/materials/LineBasicMaterial.d.ts +66 -34
  41. three/src/materials/LineDashedMaterial.d.ts +41 -21
  42. three/src/materials/Material.d.ts +408 -398
  43. three/src/materials/MeshBasicMaterial.d.ts +101 -62
  44. three/src/materials/MeshDepthMaterial.d.ts +71 -32
  45. three/src/materials/MeshDistanceMaterial.d.ts +65 -29
  46. three/src/materials/MeshLambertMaterial.d.ts +179 -103
  47. three/src/materials/MeshMatcapMaterial.d.ts +97 -55
  48. three/src/materials/MeshNormalMaterial.d.ts +76 -41
  49. three/src/materials/MeshPhongMaterial.d.ts +164 -100
  50. three/src/materials/MeshPhysicalMaterial.d.ts +164 -116
  51. three/src/materials/MeshStandardMaterial.d.ts +178 -91
  52. three/src/materials/MeshToonMaterial.d.ts +130 -81
  53. three/src/materials/PointsMaterial.d.ts +77 -30
  54. three/src/materials/RawShaderMaterial.d.ts +12 -7
  55. three/src/materials/ShaderMaterial.d.ts +186 -98
  56. three/src/materials/ShadowMaterial.d.ts +49 -23
  57. three/src/materials/SpriteMaterial.d.ts +62 -33
  58. three/src/materials/nodes/Line2NodeMaterial.d.ts +87 -40
  59. three/src/materials/nodes/LineBasicNodeMaterial.d.ts +35 -16
  60. three/src/materials/nodes/LineDashedNodeMaterial.d.ts +75 -20
  61. three/src/materials/nodes/MeshBasicNodeMaterial.d.ts +49 -30
  62. three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +49 -42
  63. three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts +38 -26
  64. three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +36 -22
  65. three/src/materials/nodes/MeshPhongNodeMaterial.d.ts +68 -48
  66. three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts +240 -65
  67. three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +99 -3
  68. three/src/materials/nodes/MeshStandardNodeMaterial.d.ts +83 -47
  69. three/src/materials/nodes/MeshToonNodeMaterial.d.ts +42 -36
  70. three/src/materials/nodes/NodeMaterial.d.ts +417 -56
  71. three/src/materials/nodes/NodeMaterials.d.ts +3 -2
  72. three/src/materials/nodes/PointsNodeMaterial.d.ts +31 -7
  73. three/src/materials/nodes/ShadowNodeMaterial.d.ts +38 -11
  74. three/src/materials/nodes/SpriteNodeMaterial.d.ts +68 -20
  75. three/src/materials/nodes/VolumeNodeMaterial.d.ts +50 -14
  76. three/src/math/Color.d.ts +1 -1
  77. three/src/nodes/Nodes.d.ts +1 -3
  78. three/src/nodes/TSL.d.ts +4 -3
  79. three/src/nodes/accessors/AccessorsUtils.d.ts +3 -3
  80. three/src/nodes/accessors/Bitangent.d.ts +0 -2
  81. three/src/nodes/accessors/CubeTextureNode.d.ts +7 -7
  82. three/src/nodes/accessors/Normal.d.ts +19 -5
  83. three/src/nodes/accessors/ReferenceBaseNode.d.ts +1 -1
  84. three/src/nodes/accessors/StorageBufferNode.d.ts +3 -2
  85. three/src/nodes/accessors/StorageTextureNode.d.ts +5 -5
  86. three/src/nodes/accessors/Tangent.d.ts +0 -2
  87. three/src/nodes/accessors/TangentUtils.d.ts +22 -0
  88. three/src/nodes/accessors/Texture3DNode.d.ts +5 -4
  89. three/src/nodes/accessors/TextureBicubic.d.ts +4 -2
  90. three/src/nodes/accessors/TextureNode.d.ts +16 -16
  91. three/src/nodes/accessors/TextureSizeNode.d.ts +3 -3
  92. three/src/nodes/accessors/UniformArrayNode.d.ts +2 -7
  93. three/src/nodes/code/FunctionCallNode.d.ts +3 -1
  94. three/src/nodes/code/FunctionNode.d.ts +2 -2
  95. three/src/nodes/code/ScriptableNode.d.ts +2 -2
  96. three/src/nodes/core/AssignNode.d.ts +2 -2
  97. three/src/nodes/core/AttributeNode.d.ts +1 -1
  98. three/src/nodes/core/BypassNode.d.ts +2 -2
  99. three/src/nodes/core/CacheNode.d.ts +0 -2
  100. three/src/nodes/core/ContextNode.d.ts +3 -3
  101. three/src/nodes/core/StackNode.d.ts +3 -13
  102. three/src/nodes/core/SubBuildNode.d.ts +15 -0
  103. three/src/nodes/core/VarNode.d.ts +4 -4
  104. three/src/nodes/core/VaryingNode.d.ts +3 -3
  105. three/src/nodes/display/BlendModes.d.ts +12 -12
  106. three/src/nodes/display/BumpMapNode.d.ts +4 -3
  107. three/src/nodes/display/ColorAdjustment.d.ts +17 -17
  108. three/src/nodes/display/ColorSpaceFunctions.d.ts +3 -3
  109. three/src/nodes/display/ColorSpaceNode.d.ts +4 -4
  110. three/src/nodes/display/FrontFacingNode.d.ts +1 -0
  111. three/src/nodes/display/PosterizeNode.d.ts +3 -3
  112. three/src/nodes/display/RenderOutputNode.d.ts +2 -2
  113. three/src/nodes/display/ScreenNode.d.ts +0 -10
  114. three/src/nodes/display/ToneMappingFunctions.d.ts +7 -7
  115. three/src/nodes/display/ToneMappingNode.d.ts +6 -6
  116. three/src/nodes/display/ViewportDepthTextureNode.d.ts +3 -3
  117. three/src/nodes/fog/Fog.d.ts +10 -10
  118. three/src/nodes/functions/BSDF/Schlick_to_F0.d.ts +4 -4
  119. three/src/nodes/functions/material/getAlphaHashThreshold.d.ts +2 -2
  120. three/src/nodes/functions/material/getParallaxCorrectNormal.d.ts +4 -4
  121. three/src/nodes/geometry/RangeNode.d.ts +9 -2
  122. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +20 -20
  123. three/src/nodes/gpgpu/ComputeNode.d.ts +2 -2
  124. three/src/nodes/lighting/PointShadowNode.d.ts +11 -11
  125. three/src/nodes/lighting/ShadowFilterNode.d.ts +11 -11
  126. three/src/nodes/materialx/MaterialXNodes.d.ts +59 -59
  127. three/src/nodes/materialx/lib/mx_hsv.d.ts +3 -3
  128. three/src/nodes/materialx/lib/mx_noise.d.ts +206 -206
  129. three/src/nodes/materialx/lib/mx_transform_color.d.ts +2 -2
  130. three/src/nodes/math/ConditionalNode.d.ts +4 -19
  131. three/src/nodes/math/Hash.d.ts +2 -2
  132. three/src/nodes/math/MathNode.d.ts +21 -17
  133. three/src/nodes/math/OperatorNode.d.ts +41 -52
  134. three/src/nodes/math/TriNoise3D.d.ts +6 -6
  135. three/src/nodes/pmrem/PMREMNode.d.ts +3 -3
  136. three/src/nodes/pmrem/PMREMUtils.d.ts +20 -20
  137. three/src/nodes/procedural/Checker.d.ts +2 -2
  138. three/src/nodes/shapes/Shapes.d.ts +2 -2
  139. three/src/nodes/tsl/TSLBase.d.ts +1 -0
  140. three/src/nodes/tsl/TSLCore.d.ts +176 -76
  141. three/src/nodes/utils/CubeMapNode.d.ts +2 -2
  142. three/src/nodes/utils/DebugNode.d.ts +2 -2
  143. three/src/nodes/utils/Discard.d.ts +2 -2
  144. three/src/nodes/utils/EquirectUV.d.ts +4 -0
  145. three/src/nodes/utils/LoopNode.d.ts +2 -7
  146. three/src/nodes/utils/MatcapUV.d.ts +4 -0
  147. three/src/nodes/utils/Oscillators.d.ts +5 -5
  148. three/src/nodes/utils/Packing.d.ts +3 -3
  149. three/src/nodes/utils/PostProcessingUtils.d.ts +9 -9
  150. three/src/nodes/utils/RTTNode.d.ts +3 -3
  151. three/src/nodes/utils/RemapNode.d.ts +9 -9
  152. three/src/nodes/utils/RotateNode.d.ts +3 -3
  153. three/src/nodes/utils/SampleNode.d.ts +16 -0
  154. three/src/nodes/utils/SpriteSheetUVNode.d.ts +4 -4
  155. three/src/nodes/utils/SpriteUtils.d.ts +2 -2
  156. three/src/nodes/utils/StorageArrayElementNode.d.ts +4 -3
  157. three/src/nodes/utils/TriplanarTextures.d.ts +20 -0
  158. three/src/nodes/utils/UVUtils.d.ts +8 -7
  159. three/src/nodes/utils/ViewportUtils.d.ts +2 -2
  160. three/src/objects/LOD.d.ts +1 -1
  161. three/src/renderers/WebGLRenderer.d.ts +1 -1
  162. three/src/renderers/common/Backend.d.ts +3 -3
  163. three/src/renderers/common/RenderObject.d.ts +10 -2
  164. three/src/renderers/common/Renderer.d.ts +5 -5
  165. three/src/renderers/common/Storage3DTexture.d.ts +40 -0
  166. three/src/renderers/common/StorageArrayTexture.d.ts +29 -0
  167. three/src/renderers/common/Textures.d.ts +2 -2
  168. three/src/renderers/common/XRRenderTarget.d.ts +3 -2
  169. three/src/renderers/common/nodes/NodeLibrary.d.ts +4 -9
  170. three/src/renderers/common/nodes/NodeSampledTexture.d.ts +1 -1
  171. three/src/renderers/common/nodes/Nodes.d.ts +1 -1
  172. three/src/renderers/webgpu/WebGPURenderer.d.ts +3 -0
  173. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +65 -0
  174. three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +9 -0
  175. three/src/nodes/utils/EquirectUVNode.d.ts +0 -8
  176. three/src/nodes/utils/MatcapUVNode.d.ts +0 -8
  177. three/src/nodes/utils/TriplanarTexturesNode.d.ts +0 -36
  178. three/src/renderers/common/nodes/StandardNodeLibrary.d.ts +0 -5
@@ -1,32 +1,44 @@
1
- import { NormalMapTypes } from "../../constants.js";
2
- import { Color } from "../../math/Color.js";
3
- import { Vector2 } from "../../math/Vector2.js";
4
- import { Texture } from "../../textures/Texture.js";
5
- import { MeshMatcapMaterialParameters } from "../MeshMatcapMaterial.js";
6
- import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
1
+ import NodeBuilder from "../../nodes/core/NodeBuilder.js";
2
+ import { MapColorPropertiesToColorRepresentations } from "../Material.js";
3
+ import { MeshMatcapMaterialParameters, MeshMatcapMaterialProperties } from "../MeshMatcapMaterial.js";
4
+ import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js";
7
5
 
8
- export interface MeshMatcapNodeMaterialParameters extends NodeMaterialParameters, MeshMatcapMaterialParameters {
6
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
7
+ export interface MeshMatcapNodeMaterialNodeProperties extends NodeMaterialNodeProperties {
9
8
  }
10
9
 
11
- export default class MeshMatcapNodeMaterial extends NodeMaterial {
12
- readonly isMeshMatcapNodeMaterial: true;
13
-
14
- // Properties from MeshMatcapMaterial
15
- readonly isMeshMatcapMaterial: true;
16
- color: Color;
17
- matcap: Texture | null;
18
- map: Texture | null;
19
- bumpMap: Texture | null;
20
- bumpScale: number;
21
- normalMap: Texture | null;
22
- normalMapType: NormalMapTypes;
23
- normalScale: Vector2;
24
- displacementMap: Texture | null;
25
- displacementScale: number;
26
- displacementBias: number;
27
- alphaMap: Texture | null;
28
- flatShading: boolean;
29
- fog: boolean;
10
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
11
+ export interface MeshMatcapNodeMaterialParameters
12
+ extends
13
+ Partial<MapColorPropertiesToColorRepresentations<MeshMatcapNodeMaterialNodeProperties>>,
14
+ MeshMatcapMaterialParameters
15
+ {}
30
16
 
17
+ /**
18
+ * Node material version of {@link MeshMatcapMaterial}.
19
+ */
20
+ declare class MeshMatcapNodeMaterial extends NodeMaterial {
21
+ /**
22
+ * Constructs a new mesh normal node material.
23
+ *
24
+ * @param {Object} [parameters] - The configuration parameter.
25
+ */
31
26
  constructor(parameters?: MeshMatcapNodeMaterialParameters);
27
+ /**
28
+ * This flag can be used for type testing.
29
+ *
30
+ * @default true
31
+ */
32
+ readonly isMeshMatcapNodeMaterial: boolean;
33
+ /**
34
+ * Setups the matcap specific node variables.
35
+ *
36
+ * @param {NodeBuilder} builder - The current node builder.
37
+ */
38
+ setupVariants(builder: NodeBuilder): void;
32
39
  }
40
+
41
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
42
+ interface MeshMatcapNodeMaterial extends MeshMatcapNodeMaterialNodeProperties, MeshMatcapMaterialProperties {}
43
+
44
+ export default MeshMatcapNodeMaterial;
@@ -1,28 +1,42 @@
1
- import { NormalMapTypes } from "../../constants.js";
2
- import { Vector2 } from "../../math/Vector2.js";
3
- import { Texture } from "../../textures/Texture.js";
4
- import { MeshNormalMaterialParameters } from "../MeshNormalMaterial.js";
5
- import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
1
+ import { MapColorPropertiesToColorRepresentations } from "../Material.js";
2
+ import { MeshNormalMaterialParameters, MeshNormalMaterialProperties } from "../MeshNormalMaterial.js";
3
+ import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js";
6
4
 
7
- export interface MeshNormalNodeMaterialParameters extends NodeMaterialParameters, MeshNormalMaterialParameters {
5
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
6
+ export interface MeshNormalNodeMaterialNodeProperties extends NodeMaterialNodeProperties {
8
7
  }
9
8
 
10
- export default class MeshNormalNodeMaterial extends NodeMaterial {
11
- readonly isMeshNormalNodeMaterial: true;
12
-
13
- // Properties from MeshNormalMaterial
14
- readonly isMeshNormalMaterial: true;
15
- bumpMap: Texture | null;
16
- bumpScale: number;
17
- normalMap: Texture | null;
18
- normalMapType: NormalMapTypes;
19
- normalScale: Vector2;
20
- displacementMap: Texture | null;
21
- displacementScale: number;
22
- displacementBias: number;
23
- wireframe: boolean;
24
- wireframeLinewidth: number;
25
- flatShading: boolean;
9
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
10
+ export interface MeshNormalNodeMaterialParameters
11
+ extends
12
+ Partial<MapColorPropertiesToColorRepresentations<MeshNormalNodeMaterialNodeProperties>>,
13
+ MeshNormalMaterialParameters
14
+ {}
26
15
 
16
+ /**
17
+ * Node material version of {@link MeshNormalMaterial}.
18
+ */
19
+ declare class MeshNormalNodeMaterial extends NodeMaterial {
20
+ /**
21
+ * Constructs a new mesh normal node material.
22
+ *
23
+ * @param {Object} [parameters] - The configuration parameter.
24
+ */
27
25
  constructor(parameters?: MeshNormalNodeMaterialParameters);
26
+ /**
27
+ * This flag can be used for type testing.
28
+ *
29
+ * @type {boolean}
30
+ */
31
+ readonly isMeshNormalNodeMaterial: boolean;
32
+ /**
33
+ * Overwrites the default implementation by computing the diffuse color
34
+ * based on the normal data.
35
+ */
36
+ setupDiffuseColor(): void;
28
37
  }
38
+
39
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
40
+ interface MeshNormalNodeMaterial extends MeshNormalNodeMaterialNodeProperties, MeshNormalMaterialProperties {}
41
+
42
+ export default MeshNormalNodeMaterial;
@@ -1,56 +1,76 @@
1
- import { Combine, NormalMapTypes } from "../../constants.js";
2
- import { Color } from "../../math/Color.js";
3
- import { Euler } from "../../math/Euler.js";
4
- import { Vector2 } from "../../math/Vector2.js";
5
1
  import Node from "../../nodes/core/Node.js";
6
- import { Texture } from "../../textures/Texture.js";
7
- import { MeshPhongMaterialParameters } from "../MeshPhongMaterial.js";
8
- import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
9
-
10
- export interface MeshPhongNodeMaterialParameters extends NodeMaterialParameters, MeshPhongMaterialParameters {
11
- }
12
-
13
- export default class MeshPhongNodeMaterial extends NodeMaterial {
14
- readonly isMeshPhongNodeMaterial: true;
2
+ import NodeBuilder from "../../nodes/core/NodeBuilder.js";
3
+ import PhongLightingModel from "../../nodes/functions/PhongLightingModel.js";
4
+ import BasicEnvironmentNode from "../../nodes/lighting/BasicEnvironmentNode.js";
5
+ import { MapColorPropertiesToColorRepresentations } from "../Material.js";
6
+ import { MeshPhongMaterialParameters, MeshPhongMaterialProperties } from "../MeshPhongMaterial.js";
7
+ import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js";
15
8
 
9
+ export interface MeshPhongNodeMaterialNodeProperties extends NodeMaterialNodeProperties {
10
+ /**
11
+ * The shininess of phong materials is by default inferred from the `shininess`
12
+ * property. This node property allows to overwrite the default
13
+ * and define the shininess with a node instead.
14
+ *
15
+ * If you don't want to overwrite the shininess but modify the existing
16
+ * value instead, use {@link materialShininess}.
17
+ *
18
+ * @default null
19
+ */
16
20
  shininessNode: Node | null;
21
+ /**
22
+ * The specular color of phong materials is by default inferred from the
23
+ * `specular` property. This node property allows to overwrite the default
24
+ * and define the specular color with a node instead.
25
+ *
26
+ * If you don't want to overwrite the specular color but modify the existing
27
+ * value instead, use {@link materialSpecular}.
28
+ *
29
+ * @default null
30
+ */
17
31
  specularNode: Node | null;
32
+ }
18
33
 
19
- // Properties from MeshPhongMaterial
20
- readonly isMeshPhongMaterial: true;
21
- color: Color;
22
- specular: Color;
23
- shininess: number;
24
- map: Texture | null;
25
- lightMap: Texture | null;
26
- lightMapIntensity: number;
27
- aoMap: Texture | null;
28
- aoMapIntensity: number;
29
- emissive: Color;
30
- emissiveIntensity: number;
31
- emissiveMap: Texture | null;
32
- bumpMap: Texture | null;
33
- bumpScale: number;
34
- normalMap: Texture | null;
35
- normalMapType: NormalMapTypes;
36
- normalScale: Vector2;
37
- displacementMap: Texture | null;
38
- displacementScale: number;
39
- displacementBias: number;
40
- specularMap: Texture | null;
41
- alphaMap: Texture | null;
42
- envMap: Texture | null;
43
- envMapRotation: Euler;
44
- combine: Combine;
45
- reflectivity: number;
46
- refractionRatio: number;
47
- wireframe: boolean;
48
- wireframeLinewidth: number;
49
- wireframeLinecap: string;
50
- wireframeLinejoin: string;
51
- flatShading: boolean;
52
- metal: boolean;
53
- fog: boolean;
34
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
35
+ export interface MeshPhongNodeMaterialParameters
36
+ extends
37
+ Partial<MapColorPropertiesToColorRepresentations<MeshPhongNodeMaterialNodeProperties>>,
38
+ MeshPhongMaterialParameters
39
+ {}
54
40
 
41
+ /**
42
+ * Node material version of {@link MeshPhongMaterial}.
43
+ */
44
+ declare class MeshPhongNodeMaterial extends NodeMaterial {
45
+ /**
46
+ * Constructs a new mesh lambert node material.
47
+ *
48
+ * @param {Object} [parameters] - The configuration parameter.
49
+ */
55
50
  constructor(parameters?: MeshPhongNodeMaterialParameters);
51
+ /**
52
+ * This flag can be used for type testing.
53
+ *
54
+ * @default true
55
+ */
56
+ readonly isMeshPhongNodeMaterial: boolean;
57
+ /**
58
+ * Overwritten since this type of material uses {@link BasicEnvironmentNode}
59
+ * to implement the default environment mapping.
60
+ *
61
+ * @param {NodeBuilder} builder - The current node builder.
62
+ * @return {?BasicEnvironmentNode<vec3>} The environment node.
63
+ */
64
+ setupEnvironment(builder: NodeBuilder): BasicEnvironmentNode | null;
65
+ /**
66
+ * Setups the lighting model.
67
+ *
68
+ * @return {PhongLightingModel} The lighting model.
69
+ */
70
+ setupLightingModel(): PhongLightingModel;
56
71
  }
72
+
73
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
74
+ interface MeshPhongNodeMaterial extends MeshPhongNodeMaterialNodeProperties, MeshPhongMaterialProperties {}
75
+
76
+ export default MeshPhongNodeMaterial;
@@ -1,93 +1,268 @@
1
- import { Color } from "../../math/Color.js";
2
- import { Vector2 } from "../../math/Vector2.js";
3
1
  import Node from "../../nodes/core/Node.js";
4
- import { ShaderNodeObject } from "../../nodes/tsl/TSLCore.js";
5
- import { Texture } from "../../textures/Texture.js";
6
- import { MeshPhysicalMaterialParameters } from "../MeshPhysicalMaterial.js";
7
- import MeshStandardNodeMaterial, { MeshStandardNodeMaterialParameters } from "./MeshStandardNodeMaterial.js";
8
-
9
- export interface MeshPhysicalNodeMaterialParameters
10
- extends MeshStandardNodeMaterialParameters, MeshPhysicalMaterialParameters
11
- {
12
- }
13
-
14
- export default class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
15
- readonly isMeshPhysicalNodeMaterial: true;
2
+ import NodeBuilder from "../../nodes/core/NodeBuilder.js";
3
+ import { MapColorPropertiesToColorRepresentations } from "../Material.js";
4
+ import { MeshPhysicalMaterialParameters, MeshPhysicalMaterialProperties } from "../MeshPhysicalMaterial.js";
5
+ import MeshStandardNodeMaterial, { MeshStandardNodeMaterialNodeProperties } from "./MeshStandardNodeMaterial.js";
16
6
 
7
+ export interface MeshPhysicalNodeMaterialNodeProperties extends MeshStandardNodeMaterialNodeProperties {
8
+ /**
9
+ * The clearcoat of physical materials is by default inferred from the `clearcoat`
10
+ * and `clearcoatMap` properties. This node property allows to overwrite the default
11
+ * and define the clearcoat with a node instead.
12
+ *
13
+ * If you don't want to overwrite the clearcoat but modify the existing
14
+ * value instead, use {@link materialClearcoat}.
15
+ *
16
+ * @default null
17
+ */
17
18
  clearcoatNode: Node | null;
19
+ /**
20
+ * The clearcoat roughness of physical materials is by default inferred from the `clearcoatRoughness`
21
+ * and `clearcoatRoughnessMap` properties. This node property allows to overwrite the default
22
+ * and define the clearcoat roughness with a node instead.
23
+ *
24
+ * If you don't want to overwrite the clearcoat roughness but modify the existing
25
+ * value instead, use {@link materialClearcoatRoughness}.
26
+ *
27
+ * @default null
28
+ */
18
29
  clearcoatRoughnessNode: Node | null;
30
+ /**
31
+ * The clearcoat normal of physical materials is by default inferred from the `clearcoatNormalMap`
32
+ * property. This node property allows to overwrite the default
33
+ * and define the clearcoat normal with a node instead.
34
+ *
35
+ * If you don't want to overwrite the clearcoat normal but modify the existing
36
+ * value instead, use {@link materialClearcoatNormal}.
37
+ *
38
+ * @default null
39
+ */
19
40
  clearcoatNormalNode: Node | null;
20
-
41
+ /**
42
+ * The sheen of physical materials is by default inferred from the `sheen`, `sheenColor`
43
+ * and `sheenColorMap` properties. This node property allows to overwrite the default
44
+ * and define the sheen with a node instead.
45
+ *
46
+ * If you don't want to overwrite the sheen but modify the existing
47
+ * value instead, use {@link materialSheen}.
48
+ *
49
+ * @default null
50
+ */
21
51
  sheenNode: Node | null;
52
+ /**
53
+ * The sheen roughness of physical materials is by default inferred from the `sheenRoughness` and
54
+ * `sheenRoughnessMap` properties. This node property allows to overwrite the default
55
+ * and define the sheen roughness with a node instead.
56
+ *
57
+ * If you don't want to overwrite the sheen roughness but modify the existing
58
+ * value instead, use {@link materialSheenRoughness}.
59
+ *
60
+ * @default null
61
+ */
22
62
  sheenRoughnessNode: Node | null;
23
-
63
+ /**
64
+ * The iridescence of physical materials is by default inferred from the `iridescence`
65
+ * property. This node property allows to overwrite the default
66
+ * and define the iridescence with a node instead.
67
+ *
68
+ * If you don't want to overwrite the iridescence but modify the existing
69
+ * value instead, use {@link materialIridescence}.
70
+ *
71
+ * @default null
72
+ */
24
73
  iridescenceNode: Node | null;
74
+ /**
75
+ * The iridescence IOR of physical materials is by default inferred from the `iridescenceIOR`
76
+ * property. This node property allows to overwrite the default
77
+ * and define the iridescence IOR with a node instead.
78
+ *
79
+ * If you don't want to overwrite the iridescence IOR but modify the existing
80
+ * value instead, use {@link materialIridescenceIOR}.
81
+ *
82
+ * @default null
83
+ */
25
84
  iridescenceIORNode: Node | null;
85
+ /**
86
+ * The iridescence thickness of physical materials is by default inferred from the `iridescenceThicknessRange`
87
+ * and `iridescenceThicknessMap` properties. This node property allows to overwrite the default
88
+ * and define the iridescence thickness with a node instead.
89
+ *
90
+ * If you don't want to overwrite the iridescence thickness but modify the existing
91
+ * value instead, use {@link materialIridescenceThickness}.
92
+ *
93
+ * @default null
94
+ */
26
95
  iridescenceThicknessNode: Node | null;
27
-
28
- iorNode: Node | null;
29
-
96
+ /**
97
+ * The specular intensity of physical materials is by default inferred from the `specularIntensity`
98
+ * and `specularIntensityMap` properties. This node property allows to overwrite the default
99
+ * and define the specular intensity with a node instead.
100
+ *
101
+ * If you don't want to overwrite the specular intensity but modify the existing
102
+ * value instead, use {@link materialSpecularIntensity}.
103
+ *
104
+ * @default null
105
+ */
30
106
  specularIntensityNode: Node | null;
107
+ /**
108
+ * The specular color of physical materials is by default inferred from the `specularColor`
109
+ * and `specularColorMap` properties. This node property allows to overwrite the default
110
+ * and define the specular color with a node instead.
111
+ *
112
+ * If you don't want to overwrite the specular color but modify the existing
113
+ * value instead, use {@link materialSpecularColor}.
114
+ *
115
+ * @default null
116
+ */
31
117
  specularColorNode: Node | null;
32
-
118
+ /**
119
+ * The ior of physical materials is by default inferred from the `ior`
120
+ * property. This node property allows to overwrite the default
121
+ * and define the ior with a node instead.
122
+ *
123
+ * If you don't want to overwrite the ior but modify the existing
124
+ * value instead, use {@link materialIOR}.
125
+ *
126
+ * @default null
127
+ */
128
+ iorNode: Node | null;
129
+ /**
130
+ * The transmission of physical materials is by default inferred from the `transmission` and
131
+ * `transmissionMap` properties. This node property allows to overwrite the default
132
+ * and define the transmission with a node instead.
133
+ *
134
+ * If you don't want to overwrite the transmission but modify the existing
135
+ * value instead, use {@link materialTransmission}.
136
+ *
137
+ * @default null
138
+ */
33
139
  transmissionNode: Node | null;
140
+ /**
141
+ * The thickness of physical materials is by default inferred from the `thickness` and
142
+ * `thicknessMap` properties. This node property allows to overwrite the default
143
+ * and define the thickness with a node instead.
144
+ *
145
+ * If you don't want to overwrite the thickness but modify the existing
146
+ * value instead, use {@link materialThickness}.
147
+ *
148
+ * @default null
149
+ */
34
150
  thicknessNode: Node | null;
151
+ /**
152
+ * The attenuation distance of physical materials is by default inferred from the
153
+ * `attenuationDistance` property. This node property allows to overwrite the default
154
+ * and define the attenuation distance with a node instead.
155
+ *
156
+ * If you don't want to overwrite the attenuation distance but modify the existing
157
+ * value instead, use {@link materialAttenuationDistance}.
158
+ *
159
+ * @default null
160
+ */
35
161
  attenuationDistanceNode: Node | null;
162
+ /**
163
+ * The attenuation color of physical materials is by default inferred from the
164
+ * `attenuationColor` property. This node property allows to overwrite the default
165
+ * and define the attenuation color with a node instead.
166
+ *
167
+ * If you don't want to overwrite the attenuation color but modify the existing
168
+ * value instead, use {@link materialAttenuationColor}.
169
+ *
170
+ * @default null
171
+ */
36
172
  attenuationColorNode: Node | null;
173
+ /**
174
+ * The dispersion of physical materials is by default inferred from the
175
+ * `dispersion` property. This node property allows to overwrite the default
176
+ * and define the dispersion with a node instead.
177
+ *
178
+ * If you don't want to overwrite the dispersion but modify the existing
179
+ * value instead, use {@link materialDispersion}.
180
+ *
181
+ * @default null
182
+ */
37
183
  dispersionNode: Node | null;
38
-
184
+ /**
185
+ * The anisotropy of physical materials is by default inferred from the
186
+ * `anisotropy` property. This node property allows to overwrite the default
187
+ * and define the anisotropy with a node instead.
188
+ *
189
+ * If you don't want to overwrite the anisotropy but modify the existing
190
+ * value instead, use {@link materialAnisotropy}.
191
+ *
192
+ * @default null
193
+ */
39
194
  anisotropyNode: Node | null;
195
+ }
40
196
 
41
- // Properties from MeshPhysicalMaterial
42
- readonly isMeshPhysicalMaterial: true;
43
- anisotropyRotation: number;
44
- anisotropyMap: Texture | null;
45
- clearcoatMap: Texture | null;
46
- clearcoatRoughness: number;
47
- clearcoatRoughnessMap: Texture | null;
48
- clearcoatNormalScale: Vector2;
49
- clearcoatNormalMap: Texture | null;
50
- ior: number;
51
- get reflectivity(): number;
52
- set reflectivity(reflectivity: number);
53
- iridescenceMap: Texture | null;
54
- iridescenceIOR: number;
55
- iridescenceThicknessRange: [number, number];
56
- iridescenceThicknessMap: Texture | null;
57
- sheenColor: Color;
58
- sheenColorMap: Texture | null;
59
- sheenRoughness: number;
60
- sheenRoughnessMap: Texture | null;
61
- transmissionMap: Texture | null;
62
- thickness: number;
63
- thicknessMap: Texture | null;
64
- attenuationDistance: number;
65
- attenuationColor: Color;
66
- specularIntensity: number;
67
- specularIntensityMap: Texture | null;
68
- specularColor: Color;
69
- specularColorMap: Texture | null;
70
- get anisotropy(): number;
71
- set anisotropy(value: number);
72
- get clearcoat(): number;
73
- set clearcoat(value: number);
74
- get iridescence(): number;
75
- set iridescence(value: number);
76
- get dispersion(): number;
77
- set dispersion(value: number);
78
- get sheen(): number;
79
- set sheen(value: number);
80
- get transmission(): number;
81
- set transmission(value: number);
197
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
198
+ export interface MeshPhysicalNodeMaterialParameters
199
+ extends
200
+ Partial<MapColorPropertiesToColorRepresentations<MeshPhysicalNodeMaterialNodeProperties>>,
201
+ MeshPhysicalMaterialParameters
202
+ {}
82
203
 
204
+ /**
205
+ * Node material version of {@link MeshPhysicalMaterial}.
206
+ */
207
+ declare class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
83
208
  constructor(parameters?: MeshPhysicalNodeMaterialParameters);
84
-
209
+ /**
210
+ * This flag can be used for type testing.
211
+ *
212
+ * @default true
213
+ */
214
+ readonly isMeshPhysicalNodeMaterial: boolean;
215
+ /**
216
+ * Whether the lighting model should use clearcoat or not.
217
+ *
218
+ * @default true
219
+ */
85
220
  get useClearcoat(): boolean;
221
+ /**
222
+ * Whether the lighting model should use iridescence or not.
223
+ *
224
+ * @default true
225
+ */
86
226
  get useIridescence(): boolean;
227
+ /**
228
+ * Whether the lighting model should use sheen or not.
229
+ *
230
+ * @default true
231
+ */
87
232
  get useSheen(): boolean;
233
+ /**
234
+ * Whether the lighting model should use anisotropy or not.
235
+ *
236
+ * @default true
237
+ */
88
238
  get useAnisotropy(): boolean;
239
+ /**
240
+ * Whether the lighting model should use transmission or not.
241
+ *
242
+ * @default true
243
+ */
89
244
  get useTransmission(): boolean;
245
+ /**
246
+ * Whether the lighting model should use dispersion or not.
247
+ *
248
+ * @default true
249
+ */
90
250
  get useDispersion(): boolean;
91
-
92
- setupClearcoatNormal(): ShaderNodeObject<Node>;
251
+ /**
252
+ * Setups the physical specific node variables.
253
+ *
254
+ * @param {NodeBuilder} builder - The current node builder.
255
+ */
256
+ setupVariants(builder: NodeBuilder): void;
257
+ /**
258
+ * Setups the clearcoat normal node.
259
+ *
260
+ * @return {Node<vec3>} The clearcoat normal.
261
+ */
262
+ setupClearcoatNormal(): Node;
93
263
  }
264
+
265
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
266
+ interface MeshPhysicalNodeMaterial extends MeshPhysicalNodeMaterialNodeProperties, MeshPhysicalMaterialProperties {}
267
+
268
+ export default MeshPhysicalNodeMaterial;