@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,134 +1,173 @@
1
1
  import { Combine } 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 { Texture } from "../textures/Texture.js";
5
- import { Material, MaterialParameters } from "./Material.js";
6
-
7
- /**
8
- * parameters is an object with one or more properties defining the material's appearance.
9
- */
10
- export interface MeshBasicMaterialParameters extends MaterialParameters {
11
- color?: ColorRepresentation | undefined;
12
- opacity?: number | undefined;
13
- map?: Texture | null | undefined;
14
- lightMap?: Texture | null;
15
- lightMapIntensity?: number | undefined;
16
- aoMap?: Texture | null | undefined;
17
- aoMapIntensity?: number | undefined;
18
- specularMap?: Texture | null | undefined;
19
- alphaMap?: Texture | null | undefined;
20
- fog?: boolean | undefined;
21
- envMap?: Texture | null | undefined;
22
- envMapRotation?: Euler | undefined;
23
- combine?: Combine | undefined;
24
- reflectivity?: number | undefined;
25
- refractionRatio?: number | undefined;
26
- wireframe?: boolean | undefined;
27
- wireframeLinewidth?: number | undefined;
28
- wireframeLinecap?: string | undefined;
29
- wireframeLinejoin?: string | undefined;
30
- }
31
-
32
- export class MeshBasicMaterial extends Material {
33
- constructor(parameters?: MeshBasicMaterialParameters);
34
-
35
- /**
36
- * Read-only flag to check if a given object is of type {@link MeshBasicMaterial}.
37
- * @remarks This is a _constant_ value
38
- * @defaultValue `true`
39
- */
40
- readonly isMeshBasicMaterial: true;
5
+ import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js";
41
6
 
7
+ export interface MeshBasicMaterialProperties extends MaterialProperties {
42
8
  /**
43
- * @default new THREE.Color( 0xffffff )
9
+ * Color of the material.
10
+ *
11
+ * @default (1,1,1)
44
12
  */
45
13
  color: Color;
46
-
47
14
  /**
15
+ * The color map. May optionally include an alpha channel, typically combined
16
+ * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map
17
+ * color is modulated by the diffuse `color`.
18
+ *
48
19
  * @default null
49
20
  */
50
21
  map: Texture | null;
51
-
52
22
  /**
23
+ * The light map. Requires a second set of UVs.
24
+ *
53
25
  * @default null
54
26
  */
55
27
  lightMap: Texture | null;
56
-
57
28
  /**
29
+ * Intensity of the baked light.
30
+ *
58
31
  * @default 1
59
32
  */
60
33
  lightMapIntensity: number;
61
-
62
34
  /**
35
+ * The red channel of this texture is used as the ambient occlusion map.
36
+ * Requires a second set of UVs.
37
+ *
63
38
  * @default null
64
39
  */
65
40
  aoMap: Texture | null;
66
-
67
41
  /**
42
+ * Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`
43
+ * disables ambient occlusion. Where intensity is `1` and the AO map's
44
+ * red channel is also `1`, ambient light is fully occluded on a surface.
45
+ *
68
46
  * @default 1
69
47
  */
70
48
  aoMapIntensity: number;
71
-
72
49
  /**
50
+ * Specular map used by the material.
51
+ *
73
52
  * @default null
74
53
  */
75
54
  specularMap: Texture | null;
76
-
77
55
  /**
56
+ * The alpha map is a grayscale texture that controls the opacity across the
57
+ * surface (black: fully transparent; white: fully opaque).
58
+ *
59
+ * Only the color of the texture is used, ignoring the alpha channel if one
60
+ * exists. For RGB and RGBA textures, the renderer will use the green channel
61
+ * when sampling this texture due to the extra bit of precision provided for
62
+ * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
63
+ * luminance/alpha textures will also still work as expected.
64
+ *
78
65
  * @default null
79
66
  */
80
67
  alphaMap: Texture | null;
81
-
82
68
  /**
69
+ * The environment map.
70
+ *
83
71
  * @default null
84
72
  */
85
73
  envMap: Texture | null;
86
-
87
74
  /**
88
- * The rotation of the environment map in radians. Default is `(0,0,0)`.
75
+ * The rotation of the environment map in radians.
76
+ *
77
+ * @default (0,0,0)
89
78
  */
90
79
  envMapRotation: Euler;
91
-
92
80
  /**
93
- * @default THREE.MultiplyOperation
81
+ * How to combine the result of the surface's color with the environment map, if any.
82
+ *
83
+ * When set to `MixOperation`, the {@link MeshBasicMaterial#reflectivity} is used to
84
+ * blend between the two colors.
85
+ *
86
+ * @default MultiplyOperation
94
87
  */
95
88
  combine: Combine;
96
-
97
89
  /**
90
+ * How much the environment map affects the surface.
91
+ * The valid range is between `0` (no reflections) and `1` (full reflections).
92
+ *
98
93
  * @default 1
99
94
  */
100
95
  reflectivity: number;
101
-
102
96
  /**
97
+ * The index of refraction (IOR) of air (approximately 1) divided by the
98
+ * index of refraction of the material. It is used with environment mapping
99
+ * modes {@link CubeRefractionMapping} and {@link EquirectangularRefractionMapping}.
100
+ * The refraction ratio should not exceed `1`.
101
+ *
103
102
  * @default 0.98
104
103
  */
105
104
  refractionRatio: number;
106
-
107
105
  /**
106
+ * Renders the geometry as a wireframe.
107
+ *
108
108
  * @default false
109
109
  */
110
110
  wireframe: boolean;
111
-
112
111
  /**
112
+ * Controls the thickness of the wireframe.
113
+ *
114
+ * Can only be used with {@link SVGRenderer}.
115
+ *
113
116
  * @default 1
114
117
  */
115
118
  wireframeLinewidth: number;
116
-
117
119
  /**
120
+ * Defines appearance of wireframe ends.
121
+ *
122
+ * Can only be used with {@link SVGRenderer}.
123
+ *
118
124
  * @default 'round'
119
125
  */
120
- wireframeLinecap: string;
121
-
126
+ wireframeLinecap: "round" | "bevel" | "miter";
122
127
  /**
128
+ * Defines appearance of wireframe joints.
129
+ *
130
+ * Can only be used with {@link SVGRenderer}.
131
+ *
123
132
  * @default 'round'
124
133
  */
125
- wireframeLinejoin: string;
126
-
134
+ wireframeLinejoin: "round" | "bevel" | "miter";
127
135
  /**
128
- * Whether the material is affected by fog. Default is true.
129
- * @default fog
136
+ * Whether the material is affected by fog or not.
137
+ *
138
+ * @default true
130
139
  */
131
140
  fog: boolean;
141
+ }
142
+
143
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
144
+ export interface MeshBasicMaterialParameters
145
+ extends Partial<MapColorPropertiesToColorRepresentations<MeshBasicMaterialProperties>>
146
+ {}
132
147
 
133
- setValues(parameters: MeshBasicMaterialParameters): void;
148
+ /**
149
+ * A material for drawing geometries in a simple shaded (flat or wireframe) way.
150
+ *
151
+ * This material is not affected by lights.
152
+ */
153
+ export class MeshBasicMaterial extends Material {
154
+ /**
155
+ * Constructs a new mesh basic material.
156
+ *
157
+ * @param {Object} [parameters] - An object with one or more properties
158
+ * defining the material's appearance. Any property of the material
159
+ * (including any property from inherited materials) can be passed
160
+ * in here. Color values can be passed any type of value accepted
161
+ * by {@link Color#set}.
162
+ */
163
+ constructor(parameters?: MeshBasicMaterialParameters);
164
+ /**
165
+ * This flag can be used for type testing.
166
+ *
167
+ * @default true
168
+ */
169
+ readonly isMeshBasicMaterial: boolean;
134
170
  }
171
+
172
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
173
+ export interface MeshBasicMaterial extends MeshBasicMaterialProperties {}
@@ -1,66 +1,105 @@
1
1
  import { DepthPackingStrategies } from "../constants.js";
2
2
  import { Texture } from "../textures/Texture.js";
3
- import { Material, MaterialParameters } from "./Material.js";
3
+ import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js";
4
4
 
5
- export interface MeshDepthMaterialParameters extends MaterialParameters {
6
- map?: Texture | null | undefined;
7
- alphaMap?: Texture | null | undefined;
8
- depthPacking?: DepthPackingStrategies | undefined;
9
- displacementMap?: Texture | null | undefined;
10
- displacementScale?: number | undefined;
11
- displacementBias?: number | undefined;
12
- wireframe?: boolean | undefined;
13
- wireframeLinewidth?: number | undefined;
14
- }
15
-
16
- export class MeshDepthMaterial extends Material {
17
- constructor(parameters?: MeshDepthMaterialParameters);
5
+ export interface MeshDepthMaterialProperties extends MaterialProperties {
18
6
  /**
19
- * Read-only flag to check if a given object is of type {@link MeshDepthMaterial}.
20
- * @remarks This is a _constant_ value
21
- * @defaultValue `true`
7
+ * Type for depth packing.
8
+ *
9
+ * @default BasicDepthPacking
22
10
  */
23
- readonly isMeshDepthMaterial: true;
24
-
11
+ depthPacking: DepthPackingStrategies;
25
12
  /**
13
+ * The color map. May optionally include an alpha channel, typically combined
14
+ * with {@link Material#transparent} or {@link Material#alphaTest}.
15
+ *
26
16
  * @default null
27
17
  */
28
18
  map: Texture | null;
29
-
30
19
  /**
20
+ * The alpha map is a grayscale texture that controls the opacity across the
21
+ * surface (black: fully transparent; white: fully opaque).
22
+ *
23
+ * Only the color of the texture is used, ignoring the alpha channel if one
24
+ * exists. For RGB and RGBA textures, the renderer will use the green channel
25
+ * when sampling this texture due to the extra bit of precision provided for
26
+ * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
27
+ * luminance/alpha textures will also still work as expected.
28
+ *
31
29
  * @default null
32
30
  */
33
31
  alphaMap: Texture | null;
34
-
35
- /**
36
- * @default THREE.BasicDepthPacking
37
- */
38
- depthPacking: DepthPackingStrategies;
39
-
40
32
  /**
33
+ * The displacement map affects the position of the mesh's vertices. Unlike
34
+ * other maps which only affect the light and shade of the material the
35
+ * displaced vertices can cast shadows, block other objects, and otherwise
36
+ * act as real geometry. The displacement texture is an image where the value
37
+ * of each pixel (white being the highest) is mapped against, and
38
+ * repositions, the vertices of the mesh.
39
+ *
41
40
  * @default null
42
41
  */
43
42
  displacementMap: Texture | null;
44
-
45
43
  /**
46
- * @default 1
44
+ * How much the displacement map affects the mesh (where black is no
45
+ * displacement, and white is maximum displacement). Without a displacement
46
+ * map set, this value is not applied.
47
+ *
48
+ * @default 0
47
49
  */
48
50
  displacementScale: number;
49
-
50
51
  /**
52
+ * The offset of the displacement map's values on the mesh's vertices.
53
+ * The bias is added to the scaled sample of the displacement map.
54
+ * Without a displacement map set, this value is not applied.
55
+ *
51
56
  * @default 0
52
57
  */
53
58
  displacementBias: number;
54
-
55
59
  /**
60
+ * Renders the geometry as a wireframe.
61
+ *
56
62
  * @default false
57
63
  */
58
64
  wireframe: boolean;
59
-
60
65
  /**
66
+ * Controls the thickness of the wireframe.
67
+ *
68
+ * WebGL and WebGPU ignore this property and always render
69
+ * 1 pixel wide lines.
70
+ *
61
71
  * @default 1
62
72
  */
63
73
  wireframeLinewidth: number;
74
+ }
75
+
76
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
77
+ export interface MeshDepthMaterialParameters
78
+ extends Partial<MapColorPropertiesToColorRepresentations<MeshDepthMaterialProperties>>
79
+ {}
64
80
 
65
- setValues(parameters: MeshDepthMaterialParameters): void;
81
+ /**
82
+ * A material for drawing geometry by depth. Depth is based off of the camera
83
+ * near and far plane. White is nearest, black is farthest.
84
+ */
85
+ export class MeshDepthMaterial extends Material {
86
+ /**
87
+ * Constructs a new mesh depth material.
88
+ *
89
+ * @param {Object} [parameters] - An object with one or more properties
90
+ * defining the material's appearance. Any property of the material
91
+ * (including any property from inherited materials) can be passed
92
+ * in here. Color values can be passed any type of value accepted
93
+ * by {@link Color#set}.
94
+ */
95
+ constructor(parameters?: MeshDepthMaterialParameters);
96
+ /**
97
+ * This flag can be used for type testing.
98
+ *
99
+ * @default true
100
+ */
101
+ readonly isMeshDepthMaterial: boolean;
66
102
  }
103
+
104
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
105
+ export interface MeshDepthMaterial extends MeshDepthMaterialProperties {}
@@ -1,52 +1,88 @@
1
- import { Vector3 } from "../math/Vector3.js";
2
1
  import { Texture } from "../textures/Texture.js";
3
- import { Material, MaterialParameters } from "./Material.js";
4
-
5
- export interface MeshDistanceMaterialParameters extends MaterialParameters {
6
- map?: Texture | null | undefined;
7
- alphaMap?: Texture | null | undefined;
8
- displacementMap?: Texture | null | undefined;
9
- displacementScale?: number | undefined;
10
- displacementBias?: number | undefined;
11
- farDistance?: number | undefined;
12
- nearDistance?: number | undefined;
13
- referencePosition?: Vector3 | undefined;
14
- }
15
-
16
- export class MeshDistanceMaterial extends Material {
17
- constructor(parameters?: MeshDistanceMaterialParameters);
18
-
19
- /**
20
- * Read-only flag to check if a given object is of type {@link MeshDistanceMaterial}.
21
- * @remarks This is a _constant_ value
22
- * @defaultValue `true`
23
- */
24
- readonly isMeshDistanceMaterial: true;
2
+ import { MapColorPropertiesToColorRepresentations, Material, MaterialProperties } from "./Material.js";
25
3
 
4
+ export interface MeshDistanceMaterialProperties extends MaterialProperties {
26
5
  /**
6
+ * The color map. May optionally include an alpha channel, typically combined
7
+ * with {@link Material#transparent} or {@link Material#alphaTest}.
8
+ *
27
9
  * @default null
28
10
  */
29
11
  map: Texture | null;
30
-
31
12
  /**
13
+ * The alpha map is a grayscale texture that controls the opacity across the
14
+ * surface (black: fully transparent; white: fully opaque).
15
+ *
16
+ * Only the color of the texture is used, ignoring the alpha channel if one
17
+ * exists. For RGB and RGBA textures, the renderer will use the green channel
18
+ * when sampling this texture due to the extra bit of precision provided for
19
+ * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
20
+ * luminance/alpha textures will also still work as expected.
21
+ *
32
22
  * @default null
33
23
  */
34
24
  alphaMap: Texture | null;
35
-
36
25
  /**
26
+ * The displacement map affects the position of the mesh's vertices. Unlike
27
+ * other maps which only affect the light and shade of the material the
28
+ * displaced vertices can cast shadows, block other objects, and otherwise
29
+ * act as real geometry. The displacement texture is an image where the value
30
+ * of each pixel (white being the highest) is mapped against, and
31
+ * repositions, the vertices of the mesh.
32
+ *
37
33
  * @default null
38
34
  */
39
35
  displacementMap: Texture | null;
40
-
41
36
  /**
42
- * @default 1
37
+ * How much the displacement map affects the mesh (where black is no
38
+ * displacement, and white is maximum displacement). Without a displacement
39
+ * map set, this value is not applied.
40
+ *
41
+ * @default 0
43
42
  */
44
43
  displacementScale: number;
45
-
46
44
  /**
45
+ * The offset of the displacement map's values on the mesh's vertices.
46
+ * The bias is added to the scaled sample of the displacement map.
47
+ * Without a displacement map set, this value is not applied.
48
+ *
47
49
  * @default 0
48
50
  */
49
51
  displacementBias: number;
52
+ }
50
53
 
51
- setValues(parameters: MeshDistanceMaterialParameters): void;
54
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
55
+ export interface MeshDistanceMaterialParameters
56
+ extends Partial<MapColorPropertiesToColorRepresentations<MeshDistanceMaterialProperties>>
57
+ {}
58
+
59
+ /**
60
+ * A material used internally for implementing shadow mapping with
61
+ * point lights.
62
+ *
63
+ * Can also be used to customize the shadow casting of an object by assigning
64
+ * an instance of `MeshDistanceMaterial` to {@link Object3D#customDistanceMaterial}.
65
+ * The following examples demonstrates this approach in order to ensure
66
+ * transparent parts of objects do no cast shadows.
67
+ */
68
+ export class MeshDistanceMaterial extends Material {
69
+ /**
70
+ * Constructs a new mesh distance material.
71
+ *
72
+ * @param {Object} [parameters] - An object with one or more properties
73
+ * defining the material's appearance. Any property of the material
74
+ * (including any property from inherited materials) can be passed
75
+ * in here. Color values can be passed any type of value accepted
76
+ * by {@link Color#set}.
77
+ */
78
+ constructor(parameters?: MeshDistanceMaterialParameters);
79
+ /**
80
+ * This flag can be used for type testing.
81
+ *
82
+ * @default true
83
+ */
84
+ readonly isMeshDistanceMaterial: boolean;
52
85
  }
86
+
87
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
88
+ export interface MeshDistanceMaterial extends MeshDistanceMaterialProperties {}