@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,88 +1,123 @@
1
1
  import { NormalMapTypes } from "../constants.js";
2
2
  import { Vector2 } from "../math/Vector2.js";
3
3
  import { Texture } from "../textures/Texture.js";
4
- import { Material, MaterialParameters } from "./Material.js";
5
-
6
- export interface MeshNormalMaterialParameters extends MaterialParameters {
7
- bumpMap?: Texture | null | undefined;
8
- bumpScale?: number | undefined;
9
- normalMap?: Texture | null | undefined;
10
- normalMapType?: NormalMapTypes | undefined;
11
- normalScale?: Vector2 | undefined;
12
- displacementMap?: Texture | null | undefined;
13
- displacementScale?: number | undefined;
14
- displacementBias?: number | undefined;
15
- wireframe?: boolean | undefined;
16
- wireframeLinewidth?: number | undefined;
17
-
18
- flatShading?: boolean | undefined;
19
- }
20
-
21
- export class MeshNormalMaterial extends Material {
22
- constructor(parameters?: MeshNormalMaterialParameters);
23
-
24
- /**
25
- * Read-only flag to check if a given object is of type {@link MeshNormalMaterial}.
26
- * @remarks This is a _constant_ value
27
- * @defaultValue `true`
28
- */
29
- readonly isMeshNormalMaterial: true;
4
+ import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js";
30
5
 
6
+ export interface MeshNormalMaterialProperties extends MaterialProperties {
31
7
  /**
8
+ * The texture to create a bump map. The black and white values map to the
9
+ * perceived depth in relation to the lights. Bump doesn't actually affect
10
+ * the geometry of the object, only the lighting. If a normal map is defined
11
+ * this will be ignored.
12
+ *
32
13
  * @default null
33
14
  */
34
15
  bumpMap: Texture | null;
35
-
36
16
  /**
17
+ * How much the bump map affects the material. Typical range is `[0,1]`.
18
+ *
37
19
  * @default 1
38
20
  */
39
21
  bumpScale: number;
40
-
41
22
  /**
23
+ * The texture to create a normal map. The RGB values affect the surface
24
+ * normal for each pixel fragment and change the way the color is lit. Normal
25
+ * maps do not change the actual shape of the surface, only the lighting. In
26
+ * case the material has a normal map authored using the left handed
27
+ * convention, the `y` component of `normalScale` should be negated to compensate
28
+ * for the different handedness.
29
+ *
42
30
  * @default null
43
31
  */
44
32
  normalMap: Texture | null;
45
-
46
33
  /**
47
- * @default THREE.TangentSpaceNormalMap
34
+ * The type of normal map.
35
+ *
36
+ * @default TangentSpaceNormalMap
48
37
  */
49
38
  normalMapType: NormalMapTypes;
50
-
51
39
  /**
52
- * @default new THREE.Vector2( 1, 1 )
40
+ * How much the normal map affects the material. Typical value range is `[0,1]`.
41
+ *
42
+ * @default (1,1)
53
43
  */
54
44
  normalScale: Vector2;
55
-
56
45
  /**
46
+ * The displacement map affects the position of the mesh's vertices. Unlike
47
+ * other maps which only affect the light and shade of the material the
48
+ * displaced vertices can cast shadows, block other objects, and otherwise
49
+ * act as real geometry. The displacement texture is an image where the value
50
+ * of each pixel (white being the highest) is mapped against, and
51
+ * repositions, the vertices of the mesh.
52
+ *
57
53
  * @default null
58
54
  */
59
55
  displacementMap: Texture | null;
60
-
61
56
  /**
62
- * @default 1
57
+ * How much the displacement map affects the mesh (where black is no
58
+ * displacement, and white is maximum displacement). Without a displacement
59
+ * map set, this value is not applied.
60
+ *
61
+ * @default 0
63
62
  */
64
63
  displacementScale: number;
65
-
66
64
  /**
65
+ * The offset of the displacement map's values on the mesh's vertices.
66
+ * The bias is added to the scaled sample of the displacement map.
67
+ * Without a displacement map set, this value is not applied.
68
+ *
67
69
  * @default 0
68
70
  */
69
71
  displacementBias: number;
70
-
71
72
  /**
73
+ * Renders the geometry as a wireframe.
74
+ *
72
75
  * @default false
73
76
  */
74
77
  wireframe: boolean;
75
-
76
78
  /**
79
+ * Controls the thickness of the wireframe.
80
+ *
81
+ * WebGL and WebGPU ignore this property and always render
82
+ * 1 pixel wide lines.
83
+ *
77
84
  * @default 1
78
85
  */
79
86
  wireframeLinewidth: number;
80
-
81
87
  /**
82
- * Define whether the material is rendered with flat shading. Default is false.
88
+ * Whether the material is rendered with flat shading or not.
89
+ *
83
90
  * @default false
84
91
  */
85
92
  flatShading: boolean;
93
+ }
94
+
95
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
96
+ export interface MeshNormalMaterialParameters
97
+ extends Partial<MapColorPropertiesToColorRepresentations<MeshNormalMaterialProperties>>
98
+ {}
86
99
 
87
- setValues(parameters: MeshNormalMaterialParameters): void;
100
+ /**
101
+ * A material that maps the normal vectors to RGB colors.
102
+ */
103
+ export class MeshNormalMaterial extends Material {
104
+ /**
105
+ * Constructs a new mesh normal material.
106
+ *
107
+ * @param {Object} [parameters] - An object with one or more properties
108
+ * defining the material's appearance. Any property of the material
109
+ * (including any property from inherited materials) can be passed
110
+ * in here. Color values can be passed any type of value accepted
111
+ * by {@link Color#set}.
112
+ */
113
+ constructor(parameters?: MeshNormalMaterialParameters);
114
+ /**
115
+ * This flag can be used for type testing.
116
+ *
117
+ * @default true
118
+ */
119
+ readonly isMeshNormalMaterial: boolean;
88
120
  }
121
+
122
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
123
+ export interface MeshNormalMaterial extends MeshNormalMaterialProperties {}
@@ -1,223 +1,287 @@
1
1
  import { Combine, NormalMapTypes } from "../constants.js";
2
- import { Color, ColorRepresentation } from "../math/Color.js";
2
+ import { Color } from "../math/Color.js";
3
3
  import { Euler } from "../math/Euler.js";
4
4
  import { Vector2 } from "../math/Vector2.js";
5
5
  import { Texture } from "../textures/Texture.js";
6
- import { Material, MaterialParameters } from "./Material.js";
7
-
8
- export interface MeshPhongMaterialParameters extends MaterialParameters {
9
- /** geometry color in hexadecimal. Default is 0xffffff. */
10
- color?: ColorRepresentation | undefined;
11
- specular?: ColorRepresentation | undefined;
12
- shininess?: number | undefined;
13
- opacity?: number | undefined;
14
- map?: Texture | null | undefined;
15
- lightMap?: Texture | null | undefined;
16
- lightMapIntensity?: number | undefined;
17
- aoMap?: Texture | null | undefined;
18
- aoMapIntensity?: number | undefined;
19
- emissive?: ColorRepresentation | undefined;
20
- emissiveIntensity?: number | undefined;
21
- emissiveMap?: Texture | null | undefined;
22
- bumpMap?: Texture | null | undefined;
23
- bumpScale?: number | undefined;
24
- normalMap?: Texture | null | undefined;
25
- normalMapType?: NormalMapTypes | undefined;
26
- normalScale?: Vector2 | undefined;
27
- displacementMap?: Texture | null | undefined;
28
- displacementScale?: number | undefined;
29
- displacementBias?: number | undefined;
30
- specularMap?: Texture | null | undefined;
31
- alphaMap?: Texture | null | undefined;
32
- envMap?: Texture | null | undefined;
33
- envMapRotation?: Euler | undefined;
34
- combine?: Combine | undefined;
35
- reflectivity?: number | undefined;
36
- refractionRatio?: number | undefined;
37
- wireframe?: boolean | undefined;
38
- wireframeLinewidth?: number | undefined;
39
- wireframeLinecap?: string | undefined;
40
- wireframeLinejoin?: string | undefined;
41
- fog?: boolean | undefined;
42
- flatShading?: boolean | undefined;
43
- }
44
-
45
- export class MeshPhongMaterial extends Material {
46
- constructor(parameters?: MeshPhongMaterialParameters);
47
-
48
- /**
49
- * Read-only flag to check if a given object is of type {@link MeshPhongMaterial}.
50
- * @remarks This is a _constant_ value
51
- * @defaultValue `true`
52
- */
53
- readonly isMeshPhongMaterial: true;
6
+ import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js";
54
7
 
8
+ export interface MeshPhongMaterialProperties extends MaterialProperties {
55
9
  /**
56
- * @default new THREE.Color( 0xffffff )
10
+ * Color of the material.
11
+ *
12
+ * @default (1,1,1)
57
13
  */
58
14
  color: Color;
59
-
60
15
  /**
61
- * @default new THREE.Color( 0x111111 )
16
+ * Specular color of the material. The default color is set to `0x111111` (very dark grey)
17
+ *
18
+ * This defines how shiny the material is and the color of its shine.
62
19
  */
63
20
  specular: Color;
64
-
65
21
  /**
22
+ * How shiny the specular highlight is; a higher value gives a sharper highlight.
23
+ *
66
24
  * @default 30
67
25
  */
68
26
  shininess: number;
69
-
70
27
  /**
28
+ * The color map. May optionally include an alpha channel, typically combined
29
+ * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map
30
+ * color is modulated by the diffuse `color`.
31
+ *
71
32
  * @default null
72
33
  */
73
34
  map: Texture | null;
74
-
75
35
  /**
36
+ * The light map. Requires a second set of UVs.
37
+ *
76
38
  * @default null
77
39
  */
78
40
  lightMap: Texture | null;
79
-
80
41
  /**
81
- * @default null
42
+ * Intensity of the baked light.
43
+ *
44
+ * @default 1
82
45
  */
83
46
  lightMapIntensity: number;
84
-
85
47
  /**
48
+ * The red channel of this texture is used as the ambient occlusion map.
49
+ * Requires a second set of UVs.
50
+ *
86
51
  * @default null
87
52
  */
88
53
  aoMap: Texture | null;
89
-
90
54
  /**
91
- * @default null
55
+ * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`
56
+ * disables ambient occlusion. Where intensity is `1` and the AO map's
57
+ * red channel is also `1`, ambient light is fully occluded on a surface.
58
+ *
59
+ * @default 1
92
60
  */
93
61
  aoMapIntensity: number;
94
-
95
62
  /**
96
- * @default new THREE.Color( 0x000000 )
63
+ * Emissive (light) color of the material, essentially a solid color
64
+ * unaffected by other lighting.
65
+ *
66
+ * @default (0,0,0)
97
67
  */
98
68
  emissive: Color;
99
-
100
69
  /**
70
+ * Intensity of the emissive light. Modulates the emissive color.
71
+ *
101
72
  * @default 1
102
73
  */
103
74
  emissiveIntensity: number;
104
-
105
75
  /**
76
+ * Set emissive (glow) map. The emissive map color is modulated by the
77
+ * emissive color and the emissive intensity. If you have an emissive map,
78
+ * be sure to set the emissive color to something other than black.
79
+ *
106
80
  * @default null
107
81
  */
108
82
  emissiveMap: Texture | null;
109
-
110
83
  /**
84
+ * The texture to create a bump map. The black and white values map to the
85
+ * perceived depth in relation to the lights. Bump doesn't actually affect
86
+ * the geometry of the object, only the lighting. If a normal map is defined
87
+ * this will be ignored.
88
+ *
111
89
  * @default null
112
90
  */
113
91
  bumpMap: Texture | null;
114
-
115
92
  /**
93
+ * How much the bump map affects the material. Typical range is `[0,1]`.
94
+ *
116
95
  * @default 1
117
96
  */
118
97
  bumpScale: number;
119
-
120
98
  /**
99
+ * The texture to create a normal map. The RGB values affect the surface
100
+ * normal for each pixel fragment and change the way the color is lit. Normal
101
+ * maps do not change the actual shape of the surface, only the lighting. In
102
+ * case the material has a normal map authored using the left handed
103
+ * convention, the `y` component of `normalScale` should be negated to compensate
104
+ * for the different handedness.
105
+ *
121
106
  * @default null
122
107
  */
123
108
  normalMap: Texture | null;
124
-
125
109
  /**
126
- * @default THREE.TangentSpaceNormalMap
110
+ * The type of normal map.
111
+ *
112
+ * @default TangentSpaceNormalMap
127
113
  */
128
114
  normalMapType: NormalMapTypes;
129
-
130
115
  /**
131
- * @default new Vector2( 1, 1 )
116
+ * How much the normal map affects the material. Typical value range is `[0,1]`.
117
+ *
118
+ * @default (1,1)
132
119
  */
133
120
  normalScale: Vector2;
134
-
135
121
  /**
122
+ * The displacement map affects the position of the mesh's vertices. Unlike
123
+ * other maps which only affect the light and shade of the material the
124
+ * displaced vertices can cast shadows, block other objects, and otherwise
125
+ * act as real geometry. The displacement texture is an image where the value
126
+ * of each pixel (white being the highest) is mapped against, and
127
+ * repositions, the vertices of the mesh.
128
+ *
136
129
  * @default null
137
130
  */
138
131
  displacementMap: Texture | null;
139
-
140
132
  /**
141
- * @default 1
133
+ * How much the displacement map affects the mesh (where black is no
134
+ * displacement, and white is maximum displacement). Without a displacement
135
+ * map set, this value is not applied.
136
+ *
137
+ * @default 0
142
138
  */
143
139
  displacementScale: number;
144
-
145
140
  /**
141
+ * The offset of the displacement map's values on the mesh's vertices.
142
+ * The bias is added to the scaled sample of the displacement map.
143
+ * Without a displacement map set, this value is not applied.
144
+ *
146
145
  * @default 0
147
146
  */
148
147
  displacementBias: number;
149
-
150
148
  /**
149
+ * The specular map value affects both how much the specular surface
150
+ * highlight contributes and how much of the environment map affects the
151
+ * surface.
152
+ *
151
153
  * @default null
152
154
  */
153
155
  specularMap: Texture | null;
154
-
155
156
  /**
157
+ * The alpha map is a grayscale texture that controls the opacity across the
158
+ * surface (black: fully transparent; white: fully opaque).
159
+ *
160
+ * Only the color of the texture is used, ignoring the alpha channel if one
161
+ * exists. For RGB and RGBA textures, the renderer will use the green channel
162
+ * when sampling this texture due to the extra bit of precision provided for
163
+ * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
164
+ * luminance/alpha textures will also still work as expected.
165
+ *
156
166
  * @default null
157
167
  */
158
168
  alphaMap: Texture | null;
159
-
160
169
  /**
170
+ * The environment map.
171
+ *
161
172
  * @default null
162
173
  */
163
174
  envMap: Texture | null;
164
-
165
175
  /**
166
- * The rotation of the environment map in radians. Default is `(0,0,0)`.
176
+ * The rotation of the environment map in radians.
177
+ *
178
+ * @default (0,0,0)
167
179
  */
168
180
  envMapRotation: Euler;
169
-
170
181
  /**
171
- * @default THREE.MultiplyOperation
182
+ * How to combine the result of the surface's color with the environment map, if any.
183
+ *
184
+ * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to
185
+ * blend between the two colors.
186
+ *
187
+ * @default MultiplyOperation
172
188
  */
173
189
  combine: Combine;
174
-
175
190
  /**
191
+ * How much the environment map affects the surface.
192
+ * The valid range is between `0` (no reflections) and `1` (full reflections).
193
+ *
176
194
  * @default 1
177
195
  */
178
196
  reflectivity: number;
179
-
180
197
  /**
198
+ * The index of refraction (IOR) of air (approximately 1) divided by the
199
+ * index of refraction of the material. It is used with environment mapping
200
+ * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}.
201
+ * The refraction ratio should not exceed `1`.
202
+ *
181
203
  * @default 0.98
182
204
  */
183
205
  refractionRatio: number;
184
-
185
206
  /**
207
+ * Renders the geometry as a wireframe.
208
+ *
186
209
  * @default false
187
210
  */
188
211
  wireframe: boolean;
189
-
190
212
  /**
213
+ * Controls the thickness of the wireframe.
214
+ *
215
+ * Can only be used with {@link SVGRenderer}.
216
+ *
191
217
  * @default 1
192
218
  */
193
219
  wireframeLinewidth: number;
194
-
195
220
  /**
221
+ * Defines appearance of wireframe ends.
222
+ *
223
+ * Can only be used with {@link SVGRenderer}.
224
+ *
196
225
  * @default 'round'
197
226
  */
198
- wireframeLinecap: string;
199
-
227
+ wireframeLinecap: "round" | "bevel" | "miter";
200
228
  /**
229
+ * Defines appearance of wireframe joints.
230
+ *
231
+ * Can only be used with {@link SVGRenderer}.
232
+ *
201
233
  * @default 'round'
202
234
  */
203
- wireframeLinejoin: string;
204
-
235
+ wireframeLinejoin: "round" | "bevel" | "miter";
205
236
  /**
206
- * Define whether the material is rendered with flat shading. Default is false.
237
+ * Whether the material is rendered with flat shading or not.
238
+ *
207
239
  * @default false
208
240
  */
209
241
  flatShading: boolean;
210
-
211
242
  /**
212
- * @deprecated Use {@link MeshStandardMaterial THREE.MeshStandardMaterial} instead.
243
+ * Whether the material is affected by fog or not.
244
+ *
245
+ * @default true
213
246
  */
214
- metal: boolean;
247
+ fog: boolean;
248
+ }
215
249
 
250
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
251
+ export interface MeshPhongMaterialParameters
252
+ extends Partial<MapColorPropertiesToColorRepresentations<MeshPhongMaterialProperties>>
253
+ {}
254
+
255
+ /**
256
+ * A material for shiny surfaces with specular highlights.
257
+ *
258
+ * The material uses a non-physically based [Blinn-Phong]{@link https://en.wikipedia.org/wiki/Blinn-Phong_shading_model}
259
+ * model for calculating reflectance. Unlike the Lambertian model used in the
260
+ * {@link MeshLambertMaterial} this can simulate shiny surfaces with specular
261
+ * highlights (such as varnished wood). `MeshPhongMaterial` uses per-fragment shading.
262
+ *
263
+ * Performance will generally be greater when using this material over the
264
+ * {@link MeshStandardMaterial} or {@link MeshPhysicalMaterial}, at the cost of
265
+ * some graphical accuracy.
266
+ */
267
+ export class MeshPhongMaterial extends Material {
216
268
  /**
217
- * Whether the material is affected by fog. Default is true.
218
- * @default fog
269
+ * Constructs a new mesh phong material.
270
+ *
271
+ * @param {Object} [parameters] - An object with one or more properties
272
+ * defining the material's appearance. Any property of the material
273
+ * (including any property from inherited materials) can be passed
274
+ * in here. Color values can be passed any type of value accepted
275
+ * by {@link Color#set}.
219
276
  */
220
- fog: boolean;
221
-
222
- setValues(parameters: MeshPhongMaterialParameters): void;
277
+ constructor(parameters?: MeshPhongMaterialParameters);
278
+ /**
279
+ * This flag can be used for type testing.
280
+ *
281
+ * @default true
282
+ */
283
+ readonly isMeshPhongMaterial: boolean;
223
284
  }
285
+
286
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
287
+ export interface MeshPhongMaterial extends MeshPhongMaterialProperties {}