@types/three 0.177.0 → 0.178.1

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 +171 -111
  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,61 +1,90 @@
1
- import { Color, ColorRepresentation } from "../math/Color.js";
1
+ import { Color } from "../math/Color.js";
2
2
  import { Texture } from "../textures/Texture.js";
3
- import { Material, MaterialParameters } from "./Material.js";
4
-
5
- export interface SpriteMaterialParameters extends MaterialParameters {
6
- color?: ColorRepresentation | undefined;
7
- map?: Texture | null | undefined;
8
- alphaMap?: Texture | null | undefined;
9
- rotation?: number | undefined;
10
- sizeAttenuation?: boolean | undefined;
11
- fog?: boolean | undefined;
12
- }
13
-
14
- export class SpriteMaterial extends Material {
15
- constructor(parameters?: SpriteMaterialParameters);
16
- /**
17
- * Read-only flag to check if a given object is of type {@link SpriteMaterial}.
18
- * @remarks This is a _constant_ value
19
- * @defaultValue `true`
20
- */
21
- readonly isSpriteMaterial: true;
3
+ import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js";
22
4
 
5
+ export interface SpriteMaterialProperties extends MaterialProperties {
23
6
  /**
24
- * @default new THREE.Color( 0xffffff )
7
+ * Color of the material.
8
+ *
9
+ * @default (1,1,1)
25
10
  */
26
11
  color: Color;
27
-
28
12
  /**
13
+ * The color map. May optionally include an alpha channel, typically combined
14
+ * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map
15
+ * color is modulated by the diffuse `color`.
16
+ *
29
17
  * @default null
30
18
  */
31
19
  map: Texture | null;
32
-
33
20
  /**
21
+ * The alpha map is a grayscale texture that controls the opacity across the
22
+ * surface (black: fully transparent; white: fully opaque).
23
+ *
24
+ * Only the color of the texture is used, ignoring the alpha channel if one
25
+ * exists. For RGB and RGBA textures, the renderer will use the green channel
26
+ * when sampling this texture due to the extra bit of precision provided for
27
+ * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
28
+ * luminance/alpha textures will also still work as expected.
29
+ *
34
30
  * @default null
35
31
  */
36
32
  alphaMap: Texture | null;
37
-
38
33
  /**
34
+ * The rotation of the sprite in radians.
35
+ *
39
36
  * @default 0
40
37
  */
41
38
  rotation: number;
42
-
43
39
  /**
40
+ * Specifies whether size of the sprite is attenuated by the camera depth (perspective camera only).
41
+ *
44
42
  * @default true
45
43
  */
46
44
  sizeAttenuation: boolean;
47
-
48
45
  /**
46
+ * Whether the material is affected by fog or not.
47
+ *
49
48
  * @default true
50
49
  */
51
- transparent: boolean;
50
+ fog: boolean;
51
+ }
52
+
53
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
54
+ export interface SpriteMaterialParameters
55
+ extends Partial<MapColorPropertiesToColorRepresentations<SpriteMaterialProperties>>
56
+ {}
52
57
 
58
+ /**
59
+ * A material for rendering instances of {@link Sprite}.
60
+ *
61
+ * ```js
62
+ * const map = new THREE.TextureLoader().load( 'textures/sprite.png' );
63
+ * const material = new THREE.SpriteMaterial( { map: map, color: 0xffffff } );
64
+ *
65
+ * const sprite = new THREE.Sprite( material );
66
+ * sprite.scale.set(200, 200, 1)
67
+ * scene.add( sprite );
68
+ * ```
69
+ */
70
+ export class SpriteMaterial extends Material {
53
71
  /**
54
- * Whether the material is affected by fog. Default is true.
55
- * @default fog
72
+ * Constructs a new sprite material.
73
+ *
74
+ * @param {Object} [parameters] - An object with one or more properties
75
+ * defining the material's appearance. Any property of the material
76
+ * (including any property from inherited materials) can be passed
77
+ * in here. Color values can be passed any type of value accepted
78
+ * by {@link Color#set}.
56
79
  */
57
- fog: boolean;
58
-
59
- setValues(parameters: SpriteMaterialParameters): void;
60
- copy(source: SpriteMaterial): this;
80
+ constructor(parameters?: SpriteMaterialParameters);
81
+ /**
82
+ * This flag can be used for type testing.
83
+ *
84
+ * @default true
85
+ */
86
+ readonly isSpriteMaterial: boolean;
61
87
  }
88
+
89
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
90
+ export interface SpriteMaterial extends SpriteMaterialProperties {}
@@ -1,54 +1,101 @@
1
- import { Color } from "../../math/Color.js";
2
1
  import Node from "../../nodes/core/Node.js";
3
- import { Texture } from "../../textures/Texture.js";
4
- import { LineDashedMaterialParameters } from "../LineDashedMaterial.js";
5
- import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
2
+ import { LineDashedMaterialParameters, LineDashedMaterialProperties } from "../LineDashedMaterial.js";
3
+ import { MapColorPropertiesToColorRepresentations } from "../Material.js";
4
+ import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js";
6
5
 
7
- export interface Line2NodeMaterialParameters extends NodeMaterialParameters, LineDashedMaterialParameters {
8
- worldUnits?: boolean | undefined;
9
- dashed?: boolean | undefined;
10
- }
11
-
12
- export default class Line2NodeMaterial extends NodeMaterial {
13
- lights: boolean;
14
-
15
- // Properties from LineDashedMaterial
16
- readonly isLineDashedMaterial: true;
17
- scale: number;
18
- dashSize: number;
19
- gapSize: number;
20
-
21
- // Properties from LineBasicMaterial
22
- readonly isLineBasicMaterial: true;
23
- color: Color;
24
- fog: boolean;
25
- linewidth: number;
26
- linecap: string;
27
- linejoin: string;
28
- map: Texture | null;
29
-
30
- useAlphaToCoverage: boolean;
6
+ export interface Line2NodeMaterialNodeProperties extends NodeMaterialNodeProperties {
7
+ /**
8
+ * Whether vertex colors should be used or not.
9
+ *
10
+ * @default false
11
+ */
31
12
  useColor: boolean;
32
- useDash: boolean;
33
- useWorldUnits: boolean;
34
-
13
+ /**
14
+ * The dash offset.
15
+ *
16
+ * @default 0
17
+ */
35
18
  dashOffset: number;
19
+ /**
20
+ * The line width.
21
+ *
22
+ * @default 0
23
+ */
36
24
  lineWidth: number;
37
-
25
+ /**
26
+ * Defines the lines color.
27
+ *
28
+ * @default null
29
+ */
38
30
  lineColorNode: Node | null;
39
-
31
+ /**
32
+ * Defines the offset.
33
+ *
34
+ * @default null
35
+ */
40
36
  offsetNode: Node | null;
37
+ /**
38
+ * Defines the dash scale.
39
+ *
40
+ * @default null
41
+ */
41
42
  dashScaleNode: Node | null;
43
+ /**
44
+ * Defines the dash size.
45
+ *
46
+ * @default null
47
+ */
42
48
  dashSizeNode: Node | null;
49
+ /**
50
+ * Defines the gap size.
51
+ *
52
+ * @default null
53
+ */
43
54
  gapSizeNode: Node | null;
55
+ set worldUnits(value: boolean);
56
+ /**
57
+ * Whether the lines should sized in world units or not.
58
+ * When set to `false` the unit is pixel.
59
+ *
60
+ * @default false
61
+ */
62
+ get worldUnits(): boolean;
63
+ set dashed(value: boolean);
64
+ /**
65
+ * Whether the lines should be dashed or not.
66
+ *
67
+ * @default false
68
+ */
69
+ get dashed(): boolean;
70
+ }
44
71
 
45
- constructor(parameters?: Line2NodeMaterialParameters);
72
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
73
+ export interface Line2NodeMaterialParameters
74
+ extends
75
+ Partial<MapColorPropertiesToColorRepresentations<Line2NodeMaterialNodeProperties>>,
76
+ LineDashedMaterialParameters
77
+ {}
46
78
 
47
- setupShaders(): void;
79
+ /**
80
+ * This node material can be used to render lines with a size larger than one
81
+ * by representing them as instanced meshes.
82
+ */
83
+ declare class Line2NodeMaterial extends NodeMaterial {
84
+ /**
85
+ * Constructs a new node material for wide line rendering.
86
+ *
87
+ * @param {Object} [parameters={}] - The configuration parameter.
88
+ */
89
+ constructor(parameters?: Line2NodeMaterialParameters);
90
+ /**
91
+ * This flag can be used for type testing.
92
+ *
93
+ * @default true
94
+ */
95
+ readonly isLine2NodeMaterial: boolean;
96
+ }
48
97
 
49
- get worldUnits(): boolean;
50
- set worldUnits(value: boolean);
98
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
99
+ interface Line2NodeMaterial extends Line2NodeMaterialNodeProperties, LineDashedMaterialProperties {}
51
100
 
52
- get dashed(): boolean;
53
- set dashed(value: boolean);
54
- }
101
+ export default Line2NodeMaterial;
@@ -1,22 +1,41 @@
1
- import { Color } from "../../math/Color.js";
2
- import { Texture } from "../../textures/Texture.js";
3
- import { LineBasicMaterialParameters } from "../LineBasicMaterial.js";
4
- import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
1
+ import { LineBasicMaterialParameters, LineBasicMaterialProperties } from "../LineBasicMaterial.js";
2
+ import { MapColorPropertiesToColorRepresentations } from "../Material.js";
3
+ import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js";
5
4
 
6
- export interface LineBasicNodeMaterialParameters extends NodeMaterialParameters, LineBasicMaterialParameters {
5
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
6
+ export interface LineBasicNodeMaterialNodeProperties extends NodeMaterialNodeProperties {
7
7
  }
8
8
 
9
- export default class LineBasicNodeMaterial extends NodeMaterial {
10
- readonly isLineBasicNodeMaterial: true;
11
-
12
- // Properties from LineBasicMaterial
13
- readonly isLineBasicMaterial: true;
14
- color: Color;
15
- fog: boolean;
16
- linewidth: number;
17
- linecap: string;
18
- linejoin: string;
19
- map: Texture | null;
9
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
10
+ export interface LineBasicNodeMaterialParameters
11
+ extends
12
+ Partial<MapColorPropertiesToColorRepresentations<LineBasicNodeMaterialNodeProperties>>,
13
+ LineBasicMaterialParameters
14
+ {}
20
15
 
16
+ /**
17
+ * Node material version of {@link LineBasicMaterial}.
18
+ *
19
+ * @augments NodeMaterial
20
+ */
21
+ declare class LineBasicNodeMaterial extends NodeMaterial {
22
+ /**
23
+ * Constructs a new line basic node material.
24
+ *
25
+ * @param {Object} [parameters] - The configuration parameter.
26
+ */
21
27
  constructor(parameters?: LineBasicNodeMaterialParameters);
28
+ /**
29
+ * This flag can be used for type testing.
30
+ *
31
+ * @type {boolean}
32
+ * @readonly
33
+ * @default true
34
+ */
35
+ readonly isLineBasicNodeMaterial: boolean;
22
36
  }
37
+
38
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
39
+ interface LineBasicNodeMaterial extends LineBasicNodeMaterialNodeProperties, LineBasicMaterialProperties {}
40
+
41
+ export default LineBasicNodeMaterial;
@@ -1,32 +1,87 @@
1
1
  import Node from "../../nodes/core/Node.js";
2
- import { LineDashedMaterialParameters } from "../LineDashedMaterial.js";
3
- import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
4
-
5
- export interface LineDashedNodeMaterialParameters extends NodeMaterialParameters, LineDashedMaterialParameters {
6
- dashOffset?: number | undefined;
7
- offsetNode?: Node | null | undefined;
8
- dashScaleNode?: Node | null | undefined;
9
- dashSizeNode?: Node | null | undefined;
10
- gapSizeNode?: Node | null | undefined;
11
- }
12
-
13
- declare class LineDashedNodeMaterial extends NodeMaterial {
14
- readonly isLineDashedNodeMaterial: true;
2
+ import { LineDashedMaterialParameters, LineDashedMaterialProperties } from "../LineDashedMaterial.js";
3
+ import { MapColorPropertiesToColorRepresentations } from "../Material.js";
4
+ import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js";
15
5
 
6
+ export interface LineDashedNodeMaterialNodeProperties extends NodeMaterialNodeProperties {
7
+ /**
8
+ * The dash offset.
9
+ *
10
+ * @default 0
11
+ */
16
12
  dashOffset: number;
17
-
13
+ /**
14
+ * The offset of dash materials is by default inferred from the `dashOffset`
15
+ * property. This node property allows to overwrite the default
16
+ * and define the offset with a node instead.
17
+ *
18
+ * If you don't want to overwrite the offset but modify the existing
19
+ * value instead, use {@link materialLineDashOffset}.
20
+ *
21
+ * @default null
22
+ */
18
23
  offsetNode: Node | null;
24
+ /**
25
+ * The scale of dash materials is by default inferred from the `scale`
26
+ * property. This node property allows to overwrite the default
27
+ * and define the scale with a node instead.
28
+ *
29
+ * If you don't want to overwrite the scale but modify the existing
30
+ * value instead, use {@link materialLineScale}.
31
+ *
32
+ * @default null
33
+ */
19
34
  dashScaleNode: Node | null;
35
+ /**
36
+ * The dash size of dash materials is by default inferred from the `dashSize`
37
+ * property. This node property allows to overwrite the default
38
+ * and define the dash size with a node instead.
39
+ *
40
+ * If you don't want to overwrite the dash size but modify the existing
41
+ * value instead, use {@link materialLineDashSize}.
42
+ *
43
+ * @default null
44
+ */
20
45
  dashSizeNode: Node | null;
46
+ /**
47
+ * The gap size of dash materials is by default inferred from the `gapSize`
48
+ * property. This node property allows to overwrite the default
49
+ * and define the gap size with a node instead.
50
+ *
51
+ * If you don't want to overwrite the gap size but modify the existing
52
+ * value instead, use {@link materialLineGapSize}.
53
+ *
54
+ * @default null
55
+ */
21
56
  gapSizeNode: Node | null;
57
+ }
22
58
 
23
- // Properties from LineDashedMaterial
24
- readonly isLineDashedMaterial: true;
25
- scale: number;
26
- dashSize: number;
27
- gapSize: number;
59
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
60
+ export interface LineDashedNodeMaterialParameters
61
+ extends
62
+ Partial<MapColorPropertiesToColorRepresentations<LineDashedNodeMaterialNodeProperties>>,
63
+ LineDashedMaterialParameters
64
+ {}
28
65
 
29
- constructor(parameters?: LineDashedMaterialParameters);
66
+ /**
67
+ * Node material version of {@link LineDashedMaterial}.
68
+ */
69
+ declare class LineDashedNodeMaterial extends NodeMaterial {
70
+ /**
71
+ * Constructs a new line dashed node material.
72
+ *
73
+ * @param {Object} [parameters] - The configuration parameter.
74
+ */
75
+ constructor(parameters?: LineDashedNodeMaterialParameters);
76
+ /**
77
+ * This flag can be used for type testing.
78
+ *
79
+ * @default true
80
+ */
81
+ readonly isLineDashedNodeMaterial: boolean;
30
82
  }
31
83
 
84
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
85
+ interface LineDashedNodeMaterial extends LineDashedNodeMaterialNodeProperties, LineDashedMaterialProperties {}
86
+
32
87
  export default LineDashedNodeMaterial;
@@ -1,36 +1,55 @@
1
- import { Combine } from "../../constants.js";
2
- import { Color } from "../../math/Color.js";
3
- import { Euler } from "../../math/Euler.js";
4
- import { Texture } from "../../textures/Texture.js";
5
- import { MeshBasicMaterialParameters } from "../MeshBasicMaterial.js";
6
- import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
1
+ import NodeBuilder from "../../nodes/core/NodeBuilder.js";
2
+ import BasicLightingModel from "../../nodes/functions/BasicLightingModel.js";
3
+ import BasicEnvironmentNode from "../../nodes/lighting/BasicEnvironmentNode.js";
4
+ import { MapColorPropertiesToColorRepresentations } from "../Material.js";
5
+ import { MeshBasicMaterialParameters, MeshBasicMaterialProperties } from "../MeshBasicMaterial.js";
6
+ import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js";
7
7
 
8
- export interface MeshBasicNodeMaterialParameters extends NodeMaterialParameters, MeshBasicMaterialParameters {
8
+ export interface MeshBasicNodeMaterialNodeProperties extends NodeMaterialNodeProperties {
9
9
  }
10
10
 
11
- export default class MeshBasicNodeMaterial extends NodeMaterial {
12
- readonly isMeshBasicNodeMaterial: true;
13
-
14
- // Properties from MeshBasicMaterial
15
- readonly isMeshBasicMaterial: true;
16
- color: Color;
17
- map: Texture | null;
18
- lightMap: Texture | null;
19
- lightMapIntensity: number;
20
- aoMap: Texture | null;
21
- aoMapIntensity: number;
22
- specularMap: Texture | null;
23
- alphaMap: Texture | null;
24
- envMap: Texture | null;
25
- envMapRotation: Euler;
26
- combine: Combine;
27
- reflectivity: number;
28
- refractionRatio: number;
29
- wireframe: boolean;
30
- wireframeLinewidth: number;
31
- wireframeLinecap: string;
32
- wireframeLinejoin: string;
33
- fog: boolean;
11
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
12
+ export interface MeshBasicNodeMaterialParameters
13
+ extends
14
+ Partial<MapColorPropertiesToColorRepresentations<MeshBasicNodeMaterialNodeProperties>>,
15
+ MeshBasicMaterialParameters
16
+ {}
34
17
 
18
+ /**
19
+ * Node material version of {@link MeshBasicMaterial}.
20
+ */
21
+ declare class MeshBasicNodeMaterial extends NodeMaterial {
22
+ /**
23
+ * Constructs a new mesh basic node material.
24
+ *
25
+ * @param {Object} [parameters] - The configuration parameter.
26
+ */
35
27
  constructor(parameters?: MeshBasicNodeMaterialParameters);
28
+ /**
29
+ * This flag can be used for type testing.
30
+ *
31
+ * @type {boolean}
32
+ * @readonly
33
+ * @default true
34
+ */
35
+ readonly isMeshBasicNodeMaterial: boolean;
36
+ /**
37
+ * Overwritten since this type of material uses {@link BasicEnvironmentNode}
38
+ * to implement the default environment mapping.
39
+ *
40
+ * @param {NodeBuilder} builder - The current node builder.
41
+ * @return {?BasicEnvironmentNode<vec3>} The environment node.
42
+ */
43
+ setupEnvironment(builder: NodeBuilder): BasicEnvironmentNode | null;
44
+ /**
45
+ * Setups the lighting model.
46
+ *
47
+ * @return {BasicLightingModel} The lighting model.
48
+ */
49
+ setupLightingModel(): BasicLightingModel;
36
50
  }
51
+
52
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
53
+ interface MeshBasicNodeMaterial extends MeshBasicNodeMaterialNodeProperties, MeshBasicMaterialProperties {}
54
+
55
+ export default MeshBasicNodeMaterial;
@@ -1,49 +1,56 @@
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
- import { Texture } from "../../textures/Texture.js";
6
- import { MeshLambertMaterialParameters } from "../MeshLambertMaterial.js";
7
- import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
1
+ import NodeBuilder from "../../nodes/core/NodeBuilder.js";
2
+ import PhongLightingModel from "../../nodes/functions/PhongLightingModel.js";
3
+ import BasicEnvironmentNode from "../../nodes/lighting/BasicEnvironmentNode.js";
4
+ import { MapColorPropertiesToColorRepresentations } from "../Material.js";
5
+ import { MeshLambertMaterialParameters, MeshLambertMaterialProperties } from "../MeshLambertMaterial.js";
6
+ import NodeMaterial, { NodeMaterialNodeProperties } from "./NodeMaterial.js";
8
7
 
9
- export interface MeshLambertNodeMaterialParameters extends NodeMaterialParameters, MeshLambertMaterialParameters {}
10
-
11
- declare class MeshLambertNodeMaterial extends NodeMaterial {
12
- readonly isMeshLambertNodeMaterial: true;
8
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
9
+ export interface MeshLambertNodeMaterialNodeProperties extends NodeMaterialNodeProperties {
10
+ }
13
11
 
14
- // Properties from MeshLambertMaterial
15
- readonly isMeshLambertMaterial: true;
16
- color: Color;
17
- bumpMap: Texture | null;
18
- bumpScale: number;
19
- displacementMap: Texture | null;
20
- displacementScale: number;
21
- displacementBias: number;
22
- emissive: Color;
23
- emissiveIntensity: number;
24
- emissiveMap: Texture | null;
25
- flatShading: boolean;
26
- map: Texture | null;
27
- lightMap: Texture | null;
28
- lightMapIntensity: number;
29
- normalMap: Texture | null;
30
- normalMapType: NormalMapTypes;
31
- normalScale: Vector2;
32
- aoMap: Texture | null;
33
- aoMapIntensity: number;
34
- specularMap: Texture | null;
35
- alphaMap: Texture | null;
36
- envMap: Texture | null;
37
- envMapRotation: Euler;
38
- combine: Combine;
39
- reflectivity: number;
40
- refractionRatio: number;
41
- wireframe: boolean;
42
- wireframeLinewidth: number;
43
- wireframeLinecap: string;
44
- wireframeLinejoin: string;
12
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
13
+ export interface MeshLambertNodeMaterialParameters
14
+ extends
15
+ Partial<MapColorPropertiesToColorRepresentations<MeshLambertNodeMaterialNodeProperties>>,
16
+ MeshLambertMaterialParameters
17
+ {}
45
18
 
19
+ /**
20
+ * Node material version of {@link MeshLambertMaterial}.
21
+ */
22
+ declare class MeshLambertNodeMaterial extends NodeMaterial {
23
+ /**
24
+ * Constructs a new mesh lambert node material.
25
+ *
26
+ * @param {Object} [parameters] - The configuration parameter.
27
+ */
46
28
  constructor(parameters?: MeshLambertNodeMaterialParameters);
29
+ /**
30
+ * This flag can be used for type testing.
31
+ *
32
+ * @type {boolean}
33
+ * @readonly
34
+ * @default true
35
+ */
36
+ readonly isMeshLambertNodeMaterial: boolean;
37
+ /**
38
+ * Overwritten since this type of material uses {@link BasicEnvironmentNode}
39
+ * to implement the default environment mapping.
40
+ *
41
+ * @param {NodeBuilder} builder - The current node builder.
42
+ * @return {?BasicEnvironmentNode<vec3>} The environment node.
43
+ */
44
+ setupEnvironment(builder: NodeBuilder): BasicEnvironmentNode | null;
45
+ /**
46
+ * Setups the lighting model.
47
+ *
48
+ * @return {PhongLightingModel} The lighting model.
49
+ */
50
+ setupLightingModel(): PhongLightingModel;
47
51
  }
48
52
 
53
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
54
+ interface MeshLambertNodeMaterial extends MeshLambertNodeMaterialNodeProperties, MeshLambertMaterialProperties {}
55
+
49
56
  export default MeshLambertNodeMaterial;