@types/three 0.184.0 → 0.185.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 (208) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +2 -0
  3. three/examples/jsm/controls/FirstPersonControls.d.ts +9 -0
  4. three/examples/jsm/controls/OrbitControls.d.ts +2 -2
  5. three/examples/jsm/controls/TransformControls.d.ts +32 -1
  6. three/examples/jsm/csm/CSMFrustum.d.ts +73 -13
  7. three/examples/jsm/exporters/DRACOExporter.d.ts +1 -1
  8. three/examples/jsm/exporters/GLTFExporter.d.ts +2 -2
  9. three/examples/jsm/exporters/PLYExporter.d.ts +5 -4
  10. three/examples/jsm/exporters/USDZExporter.d.ts +5 -1
  11. three/examples/jsm/generators/CityGenerator.d.ts +75 -0
  12. three/examples/jsm/generators/ForestGenerator.d.ts +79 -0
  13. three/examples/jsm/generators/TerrainGenerator.d.ts +67 -0
  14. three/examples/jsm/generators/TreeGenerator.d.ts +97 -0
  15. three/examples/jsm/generators/city/SidewalkGenerator.d.ts +40 -0
  16. three/examples/jsm/generators/city/SkyscraperGenerator.d.ts +83 -0
  17. three/examples/jsm/geometries/LoftGeometry.d.ts +83 -0
  18. three/examples/jsm/inspector/tabs/Parameters.d.ts +5 -2
  19. three/examples/jsm/lighting/ClusteredLighting.d.ts +45 -0
  20. three/examples/jsm/lighting/LightProbeGrid.d.ts +131 -13
  21. three/examples/jsm/loaders/DRACOLoader.d.ts +20 -6
  22. three/examples/jsm/loaders/EXRLoader.d.ts +2 -12
  23. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -1
  24. three/examples/jsm/loaders/HDRLoader.d.ts +2 -12
  25. three/examples/jsm/loaders/KTX2Loader.d.ts +1 -1
  26. three/examples/jsm/loaders/LWOLoader.d.ts +6 -0
  27. three/examples/jsm/loaders/RGBELoader.d.ts +1 -7
  28. three/examples/jsm/loaders/SVGLoader.d.ts +9 -6
  29. three/examples/jsm/loaders/TGALoader.d.ts +2 -2
  30. three/examples/jsm/loaders/TIFFLoader.d.ts +2 -11
  31. three/examples/jsm/loaders/USDLoader.d.ts +6 -1
  32. three/examples/jsm/misc/TileCreasedNormalsPlugin.d.ts +49 -0
  33. three/examples/jsm/objects/MarchingCubes.d.ts +2 -2
  34. three/examples/jsm/objects/Reflector.d.ts +38 -5
  35. three/examples/jsm/objects/SkyMesh.d.ts +1 -1
  36. three/examples/jsm/physics/RapierPhysics.d.ts +1 -0
  37. three/examples/jsm/tsl/display/BloomNode.d.ts +23 -6
  38. three/examples/jsm/tsl/display/ImportanceSampledEnvironment.d.ts +84 -0
  39. three/examples/jsm/tsl/display/RecurrentDenoiseNode.d.ts +89 -0
  40. three/examples/jsm/tsl/display/SSAAPassNode.d.ts +0 -2
  41. three/examples/jsm/tsl/display/SSGINode.d.ts +4 -1
  42. three/examples/jsm/tsl/display/SSRNode.d.ts +303 -30
  43. three/examples/jsm/tsl/display/TRAANode.d.ts +1 -1
  44. three/examples/jsm/tsl/display/TemporalReprojectNode.d.ts +64 -0
  45. three/examples/jsm/tsl/lighting/ClusteredLightsNode.d.ts +54 -0
  46. three/examples/jsm/tsl/math/curlNoise.d.ts +38 -0
  47. three/examples/jsm/tsl/utils/GroundedSkybox.d.ts +17 -0
  48. three/examples/jsm/tsl/utils/RNoise.d.ts +12 -0
  49. three/examples/jsm/tsl/utils/SpecularHelpers.d.ts +20 -0
  50. three/examples/jsm/webxr/WebGLXRFallback.d.ts +14 -0
  51. three/package.json +3 -3
  52. three/src/Three.TSL.d.ts +10 -3
  53. three/src/Three.WebGPU.Nodes.d.ts +2 -2
  54. three/src/Three.WebGPU.d.ts +5 -3
  55. three/src/animation/AnimationClip.d.ts +0 -10
  56. three/src/cameras/Camera.d.ts +1 -1
  57. three/src/core/InterleavedBuffer.d.ts +1 -1
  58. three/src/core/Object3D.d.ts +8 -4
  59. three/src/core/RenderTarget.d.ts +11 -0
  60. three/src/core/Timer.d.ts +1 -1
  61. three/src/core/UniformsGroup.d.ts +1 -1
  62. three/src/extras/Controls.d.ts +6 -5
  63. three/src/extras/core/ShapePath.d.ts +61 -65
  64. three/src/loaders/DataTextureLoader.d.ts +37 -3
  65. three/src/loaders/MaterialLoader.d.ts +8 -0
  66. three/src/materials/LineBasicMaterial.d.ts +5 -0
  67. three/src/materials/Material.d.ts +9 -1
  68. three/src/materials/MeshBasicMaterial.d.ts +30 -0
  69. three/src/materials/MeshDepthMaterial.d.ts +13 -0
  70. three/src/materials/MeshDistanceMaterial.d.ts +13 -0
  71. three/src/materials/MeshLambertMaterial.d.ts +50 -1
  72. three/src/materials/MeshMatcapMaterial.d.ts +31 -1
  73. three/src/materials/MeshNormalMaterial.d.ts +11 -1
  74. three/src/materials/MeshPhongMaterial.d.ts +50 -1
  75. three/src/materials/MeshPhysicalMaterial.d.ts +50 -0
  76. three/src/materials/MeshStandardMaterial.d.ts +53 -1
  77. three/src/materials/MeshToonMaterial.d.ts +43 -1
  78. three/src/materials/PointsMaterial.d.ts +9 -0
  79. three/src/materials/ShaderMaterial.d.ts +2 -0
  80. three/src/materials/SpriteMaterial.d.ts +9 -0
  81. three/src/materials/nodes/Line2NodeMaterial.d.ts +18 -13
  82. three/src/materials/nodes/NodeMaterial.d.ts +33 -13
  83. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +0 -84
  84. three/src/math/Box2.d.ts +3 -3
  85. three/src/math/Box3.d.ts +255 -19
  86. three/src/math/Color.d.ts +10 -10
  87. three/src/math/FrustumArray.d.ts +75 -16
  88. three/src/math/Interpolant.d.ts +111 -8
  89. three/src/math/Matrix2.d.ts +1 -1
  90. three/src/math/Matrix3.d.ts +10 -1
  91. three/src/math/Matrix4.d.ts +329 -105
  92. three/src/math/Vector2.d.ts +1 -2
  93. three/src/math/Vector3.d.ts +3 -4
  94. three/src/math/Vector4.d.ts +1 -2
  95. three/src/math/interpolants/BezierInterpolant.d.ts +19 -3
  96. three/src/math/interpolants/CubicInterpolant.d.ts +18 -3
  97. three/src/math/interpolants/DiscreteInterpolant.d.ts +8 -3
  98. three/src/math/interpolants/LinearInterpolant.d.ts +7 -3
  99. three/src/math/interpolants/QuaternionLinearInterpolant.d.ts +7 -3
  100. three/src/nodes/Nodes.d.ts +4 -13
  101. three/src/nodes/TSL.d.ts +7 -5
  102. three/src/nodes/accessors/Batch.d.ts +19 -0
  103. three/src/nodes/accessors/Instance.d.ts +34 -0
  104. three/src/nodes/accessors/MaterialNode.d.ts +86 -79
  105. three/src/nodes/accessors/Morph.d.ts +11 -0
  106. three/src/nodes/accessors/Skinning.d.ts +23 -0
  107. three/src/nodes/accessors/StorageBufferNode.d.ts +22 -23
  108. three/src/nodes/accessors/StorageTexture3DNode.d.ts +17 -0
  109. three/src/nodes/accessors/StorageTextureNode.d.ts +6 -4
  110. three/src/nodes/accessors/TextureNode.d.ts +15 -10
  111. three/src/nodes/core/ArrayNode.d.ts +16 -8
  112. three/src/nodes/core/ContextNode.d.ts +5 -6
  113. three/src/nodes/core/LightingModel.d.ts +2 -0
  114. three/src/nodes/core/Node.d.ts +50 -51
  115. three/src/nodes/core/NodeBuilder.d.ts +1 -133
  116. three/src/nodes/core/OverrideContextNode.d.ts +92 -0
  117. three/src/nodes/core/PropertyNode.d.ts +13 -2
  118. three/src/nodes/core/StructNode.d.ts +0 -2
  119. three/src/nodes/core/StructTypeNode.d.ts +5 -4
  120. three/src/nodes/core/UniformNode.d.ts +48 -9
  121. three/src/nodes/display/BlendModes.d.ts +72 -11
  122. three/src/nodes/display/FrontFacingNode.d.ts +62 -3
  123. three/src/nodes/display/PassNode.d.ts +0 -2
  124. three/src/nodes/display/PremultiplyAlphaFunctions.d.ts +37 -0
  125. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +53 -45
  126. three/src/nodes/lighting/LightingContextNode.d.ts +9 -2
  127. three/src/nodes/lighting/LightsNode.d.ts +4 -4
  128. three/src/nodes/math/MathNode.d.ts +358 -304
  129. three/src/nodes/math/OperatorNode.d.ts +253 -82
  130. three/src/nodes/tsl/TSLCore.d.ts +16 -9
  131. three/src/nodes/utils/ArrayElementNode.d.ts +5 -4
  132. three/src/nodes/utils/EquirectUV.d.ts +31 -1
  133. three/src/nodes/utils/Packing.d.ts +50 -3
  134. three/src/nodes/utils/RTTNode.d.ts +7 -12
  135. three/src/nodes/utils/Remap.d.ts +216 -29
  136. three/src/nodes/utils/SampleNode.d.ts +18 -8
  137. three/src/objects/BatchedMesh.d.ts +1 -1
  138. three/src/objects/InstancedMesh.d.ts +0 -8
  139. three/src/objects/Skeleton.d.ts +0 -2
  140. three/src/renderers/common/Backend.d.ts +0 -3
  141. three/src/renderers/common/CanvasTarget.d.ts +0 -49
  142. three/src/renderers/common/ClippingContext.d.ts +6 -1
  143. three/src/renderers/common/CubeRenderTarget.d.ts +2 -1
  144. three/src/renderers/common/Info.d.ts +26 -66
  145. three/src/renderers/common/InspectorBase.d.ts +0 -7
  146. three/src/renderers/common/Lighting.d.ts +49 -5
  147. three/src/renderers/common/Renderer.d.ts +34 -458
  148. three/src/renderers/common/RendererUtils.d.ts +1 -2
  149. three/src/renderers/common/TimestampQueryPool.d.ts +1 -1
  150. three/src/renderers/common/XRManager.d.ts +32 -299
  151. three/src/renderers/common/nodes/NodeLibrary.d.ts +0 -117
  152. three/src/renderers/webgl/WebGLPrograms.d.ts +2 -0
  153. three/src/renderers/webgl/WebGLRenderLists.d.ts +5 -1
  154. three/src/renderers/webgl/WebGLState.d.ts +2 -0
  155. three/src/renderers/webgl-fallback/WebGLBackend.d.ts +1 -1
  156. three/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts +0 -10
  157. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +0 -1
  158. three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +5 -121
  159. three/src/textures/CubeDepthTexture.d.ts +2 -3
  160. three/src/textures/DataTexture.d.ts +2 -1
  161. three/src/textures/DepthTexture.d.ts +5 -5
  162. three/examples/jsm/lighting/TiledLighting.d.ts +0 -9
  163. three/examples/jsm/tsl/display/AnamorphicNode.d.ts +0 -31
  164. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +0 -22
  165. three/src/nodes/accessors/BatchNode.d.ts +0 -12
  166. three/src/nodes/accessors/InstanceNode.d.ts +0 -30
  167. three/src/nodes/accessors/InstancedMeshNode.d.ts +0 -10
  168. three/src/nodes/accessors/MorphNode.d.ts +0 -14
  169. three/src/nodes/accessors/SkinningNode.d.ts +0 -32
  170. three/src/renderers/common/Animation.d.ts +0 -102
  171. three/src/renderers/common/Attributes.d.ts +0 -59
  172. three/src/renderers/common/Background.d.ts +0 -47
  173. three/src/renderers/common/BindGroup.d.ts +0 -39
  174. three/src/renderers/common/Binding.d.ts +0 -50
  175. three/src/renderers/common/Bindings.d.ts +0 -132
  176. three/src/renderers/common/Buffer.d.ts +0 -90
  177. three/src/renderers/common/ChainMap.d.ts +0 -49
  178. three/src/renderers/common/Color4.d.ts +0 -55
  179. three/src/renderers/common/ComputePipeline.d.ts +0 -34
  180. three/src/renderers/common/DataMap.d.ts +0 -42
  181. three/src/renderers/common/Geometries.d.ts +0 -111
  182. three/src/renderers/common/Pipeline.d.ts +0 -29
  183. three/src/renderers/common/Pipelines.d.ts +0 -186
  184. three/src/renderers/common/ProgrammableStage.d.ts +0 -73
  185. three/src/renderers/common/RenderBundle.d.ts +0 -25
  186. three/src/renderers/common/RenderBundles.d.ts +0 -34
  187. three/src/renderers/common/RenderContext.d.ts +0 -235
  188. three/src/renderers/common/RenderContexts.d.ts +0 -47
  189. three/src/renderers/common/RenderList.d.ts +0 -226
  190. three/src/renderers/common/RenderLists.d.ts +0 -46
  191. three/src/renderers/common/RenderObject.d.ts +0 -448
  192. three/src/renderers/common/RenderObjectPipeline.d.ts +0 -33
  193. three/src/renderers/common/RenderObjects.d.ts +0 -151
  194. three/src/renderers/common/SampledTexture.d.ts +0 -28
  195. three/src/renderers/common/Sampler.d.ts +0 -19
  196. three/src/renderers/common/Textures.d.ts +0 -125
  197. three/src/renderers/common/Uniform.d.ts +0 -262
  198. three/src/renderers/common/UniformBuffer.d.ts +0 -20
  199. three/src/renderers/common/UniformsGroup.d.ts +0 -152
  200. three/src/renderers/common/XRRenderTarget.d.ts +0 -67
  201. three/src/renderers/common/nodes/NodeBuilderState.d.ts +0 -121
  202. three/src/renderers/common/nodes/NodeManager.d.ts +0 -309
  203. three/src/renderers/common/nodes/NodeSampledTexture.d.ts +0 -29
  204. three/src/renderers/common/nodes/NodeSampler.d.ts +0 -12
  205. three/src/renderers/common/nodes/NodeUniform.d.ts +0 -250
  206. three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +0 -41
  207. three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +0 -6
  208. three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts +0 -6
@@ -29,12 +29,23 @@ export interface MeshPhongMaterialProperties extends MaterialProperties {
29
29
  * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map
30
30
  * color is modulated by the diffuse `color`.
31
31
  *
32
+ * `map` represents color data, and the texture must be assigned a
33
+ * {@link Texture#colorSpace}. Most `map` textures set
34
+ * `texture.colorSpace = SRGBColorSpace`.
35
+ *
36
+ * @type {?Texture}
32
37
  * @default null
33
38
  */
34
39
  map: Texture | null;
35
40
  /**
36
41
  * The light map. Requires a second set of UVs.
37
42
  *
43
+ * `lightMap` represents pre-baked illuminance data, and the texture must be assigned
44
+ * a {@link Texture#colorSpace}. Most `lightMap` textures set
45
+ * `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats
46
+ * such as `.exr` or `.hdr`.
47
+ *
48
+ * @type {?Texture}
38
49
  * @default null
39
50
  */
40
51
  lightMap: Texture | null;
@@ -48,6 +59,10 @@ export interface MeshPhongMaterialProperties extends MaterialProperties {
48
59
  * The red channel of this texture is used as the ambient occlusion map.
49
60
  * Requires a second set of UVs.
50
61
  *
62
+ * `aoMap` represents non-color data. Any texture assigned must have
63
+ * `texture.colorSpace = NoColorSpace` (default).
64
+ *
65
+ * @type {?Texture}
51
66
  * @default null
52
67
  */
53
68
  aoMap: Texture | null;
@@ -77,6 +92,11 @@ export interface MeshPhongMaterialProperties extends MaterialProperties {
77
92
  * emissive color and the emissive intensity. If you have an emissive map,
78
93
  * be sure to set the emissive color to something other than black.
79
94
  *
95
+ * `emissiveMap` represents color data, and the texture must be assigned a
96
+ * {@link Texture#colorSpace}. Most `emissiveMap` textures set
97
+ * `texture.colorSpace = SRGBColorSpace`.
98
+ *
99
+ * @type {?Texture}
80
100
  * @default null
81
101
  */
82
102
  emissiveMap: Texture | null;
@@ -86,6 +106,10 @@ export interface MeshPhongMaterialProperties extends MaterialProperties {
86
106
  * the geometry of the object, only the lighting. If a normal map is defined
87
107
  * this will be ignored.
88
108
  *
109
+ * `bumpMap` represents non-color data. Any texture assigned must have
110
+ * `texture.colorSpace = NoColorSpace` (default).
111
+ *
112
+ * @type {?Texture}
89
113
  * @default null
90
114
  */
91
115
  bumpMap: Texture | null;
@@ -103,6 +127,10 @@ export interface MeshPhongMaterialProperties extends MaterialProperties {
103
127
  * convention, the `y` component of `normalScale` should be negated to compensate
104
128
  * for the different handedness.
105
129
  *
130
+ * `normalMap` represents non-color data. Any texture assigned must have
131
+ * `texture.colorSpace = NoColorSpace` (default).
132
+ *
133
+ * @type {?Texture}
106
134
  * @default null
107
135
  */
108
136
  normalMap: Texture | null;
@@ -124,8 +152,14 @@ export interface MeshPhongMaterialProperties extends MaterialProperties {
124
152
  * displaced vertices can cast shadows, block other objects, and otherwise
125
153
  * act as real geometry. The displacement texture is an image where the value
126
154
  * of each pixel (white being the highest) is mapped against, and
127
- * repositions, the vertices of the mesh.
155
+ * repositions, the vertices of the mesh. For best results, pair a
156
+ * displacement map with a matching normal map, since the renderer can
157
+ * not recompute surface normals from the displaced vertices.
158
+ *
159
+ * `displacementMap` represents non-color data. Any texture assigned must have
160
+ * `texture.colorSpace = NoColorSpace` (default).
128
161
  *
162
+ * @type {?Texture}
129
163
  * @default null
130
164
  */
131
165
  displacementMap: Texture | null;
@@ -150,6 +184,11 @@ export interface MeshPhongMaterialProperties extends MaterialProperties {
150
184
  * highlight contributes and how much of the environment map affects the
151
185
  * surface.
152
186
  *
187
+ * `specularMap` represents color data, and the texture must be assigned a
188
+ * {@link Texture#colorSpace}. Most `specularMap` textures set
189
+ * `texture.colorSpace = SRGBColorSpace`.
190
+ *
191
+ * @type {?Texture}
153
192
  * @default null
154
193
  */
155
194
  specularMap: Texture | null;
@@ -163,12 +202,22 @@ export interface MeshPhongMaterialProperties extends MaterialProperties {
163
202
  * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
164
203
  * luminance/alpha textures will also still work as expected.
165
204
  *
205
+ * `alphaMap` represents non-color data. Any texture assigned must have
206
+ * `texture.colorSpace = NoColorSpace` (default).
207
+ *
208
+ * @type {?Texture}
166
209
  * @default null
167
210
  */
168
211
  alphaMap: Texture | null;
169
212
  /**
170
213
  * The environment map.
171
214
  *
215
+ * `envMap` represents luminance data, and the texture must be assigned
216
+ * a {@link Texture#colorSpace}. Most `envMap` textures set
217
+ * `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats
218
+ * such as `.exr` or `.hdr`.
219
+ *
220
+ * @type {?Texture}
172
221
  * @default null
173
222
  */
174
223
  envMap: Texture | null;
@@ -18,6 +18,10 @@ export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProp
18
18
  * bitangent space, to be rotated by `anisotropyRotation`. The blue channel
19
19
  * contains strength as `[0, 1]` to be multiplied by `anisotropy`.
20
20
  *
21
+ * `anisotropyMap` represents non-color data. Any texture assigned must have
22
+ * `texture.colorSpace = NoColorSpace` (default).
23
+ *
24
+ * @type {?Texture}
21
25
  * @default null
22
26
  */
23
27
  anisotropyMap: Texture | null;
@@ -25,6 +29,10 @@ export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProp
25
29
  * The red channel of this texture is multiplied against `clearcoat`,
26
30
  * for per-pixel control over a coating's intensity.
27
31
  *
32
+ * `clearcoatMap` represents non-color data. Any texture assigned must have
33
+ * `texture.colorSpace = NoColorSpace` (default).
34
+ *
35
+ * @type {?Texture}
28
36
  * @default null
29
37
  */
30
38
  clearcoatMap: Texture | null;
@@ -38,6 +46,10 @@ export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProp
38
46
  * The green channel of this texture is multiplied against
39
47
  * `clearcoatRoughness`, for per-pixel control over a coating's roughness.
40
48
  *
49
+ * `clearcoatRoughnessMap` represents non-color data. Any texture assigned must have
50
+ * `texture.colorSpace = NoColorSpace` (default).
51
+ *
52
+ * @type {?Texture}
41
53
  * @default null
42
54
  */
43
55
  clearcoatRoughnessMap: Texture | null;
@@ -51,6 +63,10 @@ export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProp
51
63
  /**
52
64
  * Can be used to enable independent normals for the clear coat layer.
53
65
  *
66
+ * `clearcoatNormalMap` represents non-color data. Any texture assigned must have
67
+ * `texture.colorSpace = NoColorSpace` (default).
68
+ *
69
+ * @type {?Texture}
54
70
  * @default null
55
71
  */
56
72
  clearcoatNormalMap: Texture | null;
@@ -76,6 +92,10 @@ export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProp
76
92
  * The red channel of this texture is multiplied against `iridescence`, for per-pixel
77
93
  * control over iridescence.
78
94
  *
95
+ * `iridescenceMap` represents non-color data. Any texture assigned must have
96
+ * `texture.colorSpace = NoColorSpace` (default).
97
+ *
98
+ * @type {?Texture}
79
99
  * @default null
80
100
  */
81
101
  iridescenceMap: Texture | null;
@@ -100,6 +120,10 @@ export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProp
100
120
  * - `1.0` in the green channel will result in thickness equal to second element of the array.
101
121
  * - Values in-between will linearly interpolate between the elements of the array.
102
122
  *
123
+ * `iridescenceThicknessMap` represents non-color data. Any texture assigned must have
124
+ * `texture.colorSpace = NoColorSpace` (default).
125
+ *
126
+ * @type {?Texture}
103
127
  * @default null
104
128
  */
105
129
  iridescenceThicknessMap: Texture | null;
@@ -113,6 +137,11 @@ export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProp
113
137
  * The RGB channels of this texture are multiplied against `sheenColor`, for per-pixel control
114
138
  * over sheen tint.
115
139
  *
140
+ * `sheenColorMap` represents color data, and the texture must be assigned a
141
+ * {@link Texture#colorSpace}. Most `sheenColorMap` textures set
142
+ * `texture.colorSpace = SRGBColorSpace`.
143
+ *
144
+ * @type {?Texture}
116
145
  * @default null
117
146
  */
118
147
  sheenColorMap: Texture | null;
@@ -126,6 +155,10 @@ export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProp
126
155
  * The alpha channel of this texture is multiplied against `sheenRoughness`, for per-pixel control
127
156
  * over sheen roughness.
128
157
  *
158
+ * `sheenRoughnessMap` represents non-color data. Any texture assigned must have
159
+ * `texture.colorSpace = NoColorSpace` (default).
160
+ *
161
+ * @type {?Texture}
129
162
  * @default null
130
163
  */
131
164
  sheenRoughnessMap: Texture | null;
@@ -133,6 +166,10 @@ export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProp
133
166
  * The red channel of this texture is multiplied against `transmission`, for per-pixel control over
134
167
  * optical transparency.
135
168
  *
169
+ * `transmissionMap` represents non-color data. Any texture assigned must have
170
+ * `texture.colorSpace = NoColorSpace` (default).
171
+ *
172
+ * @type {?Texture}
136
173
  * @default null
137
174
  */
138
175
  transmissionMap: Texture | null;
@@ -148,6 +185,10 @@ export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProp
148
185
  * A texture that defines the thickness, stored in the green channel. This will
149
186
  * be multiplied by `thickness`.
150
187
  *
188
+ * `thicknessMap` represents non-color data. Any texture assigned must have
189
+ * `texture.colorSpace = NoColorSpace` (default).
190
+ *
191
+ * @type {?Texture}
151
192
  * @default null
152
193
  */
153
194
  thicknessMap: Texture | null;
@@ -177,6 +218,10 @@ export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProp
177
218
  * The alpha channel of this texture is multiplied against `specularIntensity`,
178
219
  * for per-pixel control over specular intensity.
179
220
  *
221
+ * `specularIntensityMap` represents non-color data. Any texture assigned must have
222
+ * `texture.colorSpace = NoColorSpace` (default).
223
+ *
224
+ * @type {?Texture}
180
225
  * @default null
181
226
  */
182
227
  specularIntensityMap: Texture | null;
@@ -190,6 +235,11 @@ export interface MeshPhysicalMaterialProperties extends MeshStandardMaterialProp
190
235
  * The RGB channels of this texture are multiplied against `specularColor`,
191
236
  * for per-pixel control over specular color.
192
237
  *
238
+ * `specularColorMap` represents color data, and the texture must be assigned a
239
+ * {@link Texture#colorSpace}. Most `specularColorMap` textures set
240
+ * `texture.colorSpace = SRGBColorSpace`.
241
+ *
242
+ * @type {?Texture}
193
243
  * @default null
194
244
  */
195
245
  specularColorMap: Texture | null;
@@ -34,12 +34,23 @@ export interface MeshStandardMaterialProperties extends MaterialProperties {
34
34
  * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map
35
35
  * color is modulated by the diffuse `color`.
36
36
  *
37
+ * `map` represents color data, and the texture must be assigned a
38
+ * {@link Texture#colorSpace}. Most `map` textures set
39
+ * `texture.colorSpace = SRGBColorSpace`.
40
+ *
41
+ * @type {?Texture}
37
42
  * @default null
38
43
  */
39
44
  map: Texture | null;
40
45
  /**
41
46
  * The light map. Requires a second set of UVs.
42
47
  *
48
+ * `lightMap` represents pre-baked illuminance data, and the texture must be assigned
49
+ * a {@link Texture#colorSpace}. Most `lightMap` textures set
50
+ * `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats
51
+ * such as `.exr` or `.hdr`.
52
+ *
53
+ * @type {?Texture}
43
54
  * @default null
44
55
  */
45
56
  lightMap: Texture | null;
@@ -53,6 +64,10 @@ export interface MeshStandardMaterialProperties extends MaterialProperties {
53
64
  * The red channel of this texture is used as the ambient occlusion map.
54
65
  * Requires a second set of UVs.
55
66
  *
67
+ * `aoMap` represents non-color data. Any texture assigned must have
68
+ * `texture.colorSpace = NoColorSpace` (default).
69
+ *
70
+ * @type {?Texture}
56
71
  * @default null
57
72
  */
58
73
  aoMap: Texture | null;
@@ -82,6 +97,11 @@ export interface MeshStandardMaterialProperties extends MaterialProperties {
82
97
  * emissive color and the emissive intensity. If you have an emissive map,
83
98
  * be sure to set the emissive color to something other than black.
84
99
  *
100
+ * `emissiveMap` represents color data, and the texture must be assigned a
101
+ * {@link Texture#colorSpace}. Most `emissiveMap` textures set
102
+ * `texture.colorSpace = SRGBColorSpace`.
103
+ *
104
+ * @type {?Texture}
85
105
  * @default null
86
106
  */
87
107
  emissiveMap: Texture | null;
@@ -91,6 +111,10 @@ export interface MeshStandardMaterialProperties extends MaterialProperties {
91
111
  * the geometry of the object, only the lighting. If a normal map is defined
92
112
  * this will be ignored.
93
113
  *
114
+ * `bumpMap` represents non-color data. Any texture assigned must have
115
+ * `texture.colorSpace = NoColorSpace` (default).
116
+ *
117
+ * @type {?Texture}
94
118
  * @default null
95
119
  */
96
120
  bumpMap: Texture | null;
@@ -108,6 +132,10 @@ export interface MeshStandardMaterialProperties extends MaterialProperties {
108
132
  * convention, the `y` component of `normalScale` should be negated to compensate
109
133
  * for the different handedness.
110
134
  *
135
+ * `normalMap` represents non-color data. Any texture assigned must have
136
+ * `texture.colorSpace = NoColorSpace` (default).
137
+ *
138
+ * @type {?Texture}
111
139
  * @default null
112
140
  */
113
141
  normalMap: Texture | null;
@@ -129,8 +157,14 @@ export interface MeshStandardMaterialProperties extends MaterialProperties {
129
157
  * displaced vertices can cast shadows, block other objects, and otherwise
130
158
  * act as real geometry. The displacement texture is an image where the value
131
159
  * of each pixel (white being the highest) is mapped against, and
132
- * repositions, the vertices of the mesh.
160
+ * repositions, the vertices of the mesh. For best results, pair a
161
+ * displacement map with a matching normal map, since the renderer can
162
+ * not recompute surface normals from the displaced vertices.
133
163
  *
164
+ * `displacementMap` represents non-color data. Any texture assigned must have
165
+ * `texture.colorSpace = NoColorSpace` (default).
166
+ *
167
+ * @type {?Texture}
134
168
  * @default null
135
169
  */
136
170
  displacementMap: Texture | null;
@@ -154,6 +188,10 @@ export interface MeshStandardMaterialProperties extends MaterialProperties {
154
188
  * The green channel of this texture is used to alter the roughness of the
155
189
  * material.
156
190
  *
191
+ * `roughnessMap` represents non-color data. Any texture assigned must have
192
+ * `texture.colorSpace = NoColorSpace` (default).
193
+ *
194
+ * @type {?Texture}
157
195
  * @default null
158
196
  */
159
197
  roughnessMap: Texture | null;
@@ -161,6 +199,10 @@ export interface MeshStandardMaterialProperties extends MaterialProperties {
161
199
  * The blue channel of this texture is used to alter the metalness of the
162
200
  * material.
163
201
  *
202
+ * `metalnessMap` represents non-color data. Any texture assigned must have
203
+ * `texture.colorSpace = NoColorSpace` (default).
204
+ *
205
+ * @type {?Texture}
164
206
  * @default null
165
207
  */
166
208
  metalnessMap: Texture | null;
@@ -174,6 +216,10 @@ export interface MeshStandardMaterialProperties extends MaterialProperties {
174
216
  * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
175
217
  * luminance/alpha textures will also still work as expected.
176
218
  *
219
+ * `alphaMap` represents non-color data. Any texture assigned must have
220
+ * `texture.colorSpace = NoColorSpace` (default).
221
+ *
222
+ * @type {?Texture}
177
223
  * @default null
178
224
  */
179
225
  alphaMap: Texture | null;
@@ -181,6 +227,12 @@ export interface MeshStandardMaterialProperties extends MaterialProperties {
181
227
  * The environment map. To ensure a physically correct rendering, environment maps
182
228
  * are internally pre-processed with {@link PMREMGenerator}.
183
229
  *
230
+ * `envMap` represents luminance data, and the texture must be assigned
231
+ * a {@link Texture#colorSpace}. Most `envMap` textures set
232
+ * `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats
233
+ * such as `.exr` or `.hdr`.
234
+ *
235
+ * @type {?Texture}
184
236
  * @default null
185
237
  */
186
238
  envMap: Texture | null;
@@ -16,6 +16,11 @@ export interface MeshToonMaterialProperties extends MaterialProperties {
16
16
  * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map
17
17
  * color is modulated by the diffuse `color`.
18
18
  *
19
+ * `map` represents color data, and the texture must be assigned a
20
+ * {@link Texture#colorSpace}. Most `map` textures set
21
+ * `texture.colorSpace = SRGBColorSpace`.
22
+ *
23
+ * @type {?Texture}
19
24
  * @default null
20
25
  */
21
26
  map: Texture | null;
@@ -24,12 +29,22 @@ export interface MeshToonMaterialProperties extends MaterialProperties {
24
29
  * {@link Texture#minFilter} and {@link Texture#magFilter} to {@link NearestFilter}
25
30
  * when using this type of texture.
26
31
  *
32
+ * `gradientMap` represents non-color data. Any texture assigned must have
33
+ * `texture.colorSpace = NoColorSpace` (default).
34
+ *
35
+ * @type {?Texture}
27
36
  * @default null
28
37
  */
29
38
  gradientMap: Texture | null;
30
39
  /**
31
40
  * The light map. Requires a second set of UVs.
32
41
  *
42
+ * `lightMap` represents pre-baked illuminance data, and the texture must be assigned
43
+ * a {@link Texture#colorSpace}. Most `lightMap` textures set
44
+ * `texture.colorSpace = LinearSRGBColorSpace` and use float-type formats
45
+ * such as `.exr` or `.hdr`.
46
+ *
47
+ * @type {?Texture}
33
48
  * @default null
34
49
  */
35
50
  lightMap: Texture | null;
@@ -43,6 +58,10 @@ export interface MeshToonMaterialProperties extends MaterialProperties {
43
58
  * The red channel of this texture is used as the ambient occlusion map.
44
59
  * Requires a second set of UVs.
45
60
  *
61
+ * `aoMap` represents non-color data. Any texture assigned must have
62
+ * `texture.colorSpace = NoColorSpace` (default).
63
+ *
64
+ * @type {?Texture}
46
65
  * @default null
47
66
  */
48
67
  aoMap: Texture | null;
@@ -72,6 +91,11 @@ export interface MeshToonMaterialProperties extends MaterialProperties {
72
91
  * emissive color and the emissive intensity. If you have an emissive map,
73
92
  * be sure to set the emissive color to something other than black.
74
93
  *
94
+ * `emissiveMap` represents color data, and the texture must be assigned a
95
+ * {@link Texture#colorSpace}. Most `emissiveMap` textures set
96
+ * `texture.colorSpace = SRGBColorSpace`.
97
+ *
98
+ * @type {?Texture}
75
99
  * @default null
76
100
  */
77
101
  emissiveMap: Texture | null;
@@ -81,6 +105,10 @@ export interface MeshToonMaterialProperties extends MaterialProperties {
81
105
  * the geometry of the object, only the lighting. If a normal map is defined
82
106
  * this will be ignored.
83
107
  *
108
+ * `bumpMap` represents non-color data. Any texture assigned must have
109
+ * `texture.colorSpace = NoColorSpace` (default).
110
+ *
111
+ * @type {?Texture}
84
112
  * @default null
85
113
  */
86
114
  bumpMap: Texture | null;
@@ -98,6 +126,10 @@ export interface MeshToonMaterialProperties extends MaterialProperties {
98
126
  * convention, the `y` component of `normalScale` should be negated to compensate
99
127
  * for the different handedness.
100
128
  *
129
+ * `normalMap` represents non-color data. Any texture assigned must have
130
+ * `texture.colorSpace = NoColorSpace` (default).
131
+ *
132
+ * @type {?Texture}
101
133
  * @default null
102
134
  */
103
135
  normalMap: Texture | null;
@@ -119,8 +151,14 @@ export interface MeshToonMaterialProperties extends MaterialProperties {
119
151
  * displaced vertices can cast shadows, block other objects, and otherwise
120
152
  * act as real geometry. The displacement texture is an image where the value
121
153
  * of each pixel (white being the highest) is mapped against, and
122
- * repositions, the vertices of the mesh.
154
+ * repositions, the vertices of the mesh. For best results, pair a
155
+ * displacement map with a matching normal map, since the renderer can
156
+ * not recompute surface normals from the displaced vertices.
123
157
  *
158
+ * `displacementMap` represents non-color data. Any texture assigned must have
159
+ * `texture.colorSpace = NoColorSpace` (default).
160
+ *
161
+ * @type {?Texture}
124
162
  * @default null
125
163
  */
126
164
  displacementMap: Texture | null;
@@ -150,6 +188,10 @@ export interface MeshToonMaterialProperties extends MaterialProperties {
150
188
  * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
151
189
  * luminance/alpha textures will also still work as expected.
152
190
  *
191
+ * `alphaMap` represents non-color data. Any texture assigned must have
192
+ * `texture.colorSpace = NoColorSpace` (default).
193
+ *
194
+ * @type {?Texture}
153
195
  * @default null
154
196
  */
155
197
  alphaMap: Texture | null;
@@ -14,6 +14,11 @@ export interface PointsMaterialProperties extends MaterialProperties {
14
14
  * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map
15
15
  * color is modulated by the diffuse `color`.
16
16
  *
17
+ * `map` represents color data, and the texture must be assigned a
18
+ * {@link Texture#colorSpace}. Most `map` textures set
19
+ * `texture.colorSpace = SRGBColorSpace`.
20
+ *
21
+ * @type {?Texture}
17
22
  * @default null
18
23
  */
19
24
  map: Texture | null;
@@ -27,6 +32,10 @@ export interface PointsMaterialProperties extends MaterialProperties {
27
32
  * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
28
33
  * luminance/alpha textures will also still work as expected.
29
34
  *
35
+ * `alphaMap` represents non-color data. Any texture assigned must have
36
+ * `texture.colorSpace = NoColorSpace` (default).
37
+ *
38
+ * @type {?Texture}
30
39
  * @default null
31
40
  */
32
41
  alphaMap: Texture | null;
@@ -7,6 +7,7 @@ import { Vector2Tuple } from "../math/Vector2.js";
7
7
  import { Vector3Tuple } from "../math/Vector3.js";
8
8
  import { Vector4Tuple } from "../math/Vector4.js";
9
9
  import { IUniform } from "../renderers/shaders/UniformsLib.js";
10
+ import { Texture } from "../textures/Texture.js";
10
11
  import { MapColorPropertiesToColorRepresentations, Material, MaterialJSON, MaterialProperties } from "./Material.js";
11
12
 
12
13
  export interface ShaderMaterialProperties extends MaterialProperties {
@@ -258,6 +259,7 @@ export class ShaderMaterial extends Material {
258
259
  readonly isShaderMaterial: boolean;
259
260
  setValues(values?: ShaderMaterialParameters): void;
260
261
  toJSON(meta?: JSONMeta): ShaderMaterialJSON;
262
+ fromJSON(json: MaterialJSON, textures: Record<string, Texture>): this;
261
263
  }
262
264
 
263
265
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
@@ -14,6 +14,11 @@ export interface SpriteMaterialProperties extends MaterialProperties {
14
14
  * with {@link Material#transparent} or {@link Material#alphaTest}. The texture map
15
15
  * color is modulated by the diffuse `color`.
16
16
  *
17
+ * `map` represents color data, and the texture must be assigned a
18
+ * {@link Texture#colorSpace}. Most `map` textures set
19
+ * `texture.colorSpace = SRGBColorSpace`.
20
+ *
21
+ * @type {?Texture}
17
22
  * @default null
18
23
  */
19
24
  map: Texture | null;
@@ -27,6 +32,10 @@ export interface SpriteMaterialProperties extends MaterialProperties {
27
32
  * green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
28
33
  * luminance/alpha textures will also still work as expected.
29
34
  *
35
+ * `alphaMap` represents non-color data. Any texture assigned must have
36
+ * `texture.colorSpace = NoColorSpace` (default).
37
+ *
38
+ * @type {?Texture}
30
39
  * @default null
31
40
  */
32
41
  alphaMap: Texture | null;
@@ -7,44 +7,52 @@ export interface Line2NodeMaterialNodeProperties extends NodeMaterialNodePropert
7
7
  /**
8
8
  * The dash offset.
9
9
  *
10
+ * @type {number}
10
11
  * @default 0
11
12
  */
12
13
  dashOffset: number;
13
- /**
14
- * Defines the lines color.
15
- *
16
- * @default null
17
- */
18
- lineColorNode: Node | null;
19
14
  /**
20
15
  * Defines the offset.
21
16
  *
17
+ * @type {?Node<float>}
22
18
  * @default null
23
19
  */
24
20
  offsetNode: Node | null;
25
21
  /**
26
22
  * Defines the dash scale.
27
23
  *
24
+ * @type {?Node<float>}
28
25
  * @default null
29
26
  */
30
27
  dashScaleNode: Node | null;
31
28
  /**
32
29
  * Defines the dash size.
33
30
  *
31
+ * @type {?Node<float>}
34
32
  * @default null
35
33
  */
36
34
  dashSizeNode: Node | null;
37
35
  /**
38
36
  * Defines the gap size.
39
37
  *
38
+ * @type {?Node<float>}
40
39
  * @default null
41
40
  */
42
41
  gapSizeNode: Node | null;
42
+ set lineColorNode(value: Node | null);
43
+ /**
44
+ * Defines the lines color.
45
+ *
46
+ * @deprecated since r185. Use {@link NodeMaterial#colorNode} instead.
47
+ * @type {?Node<vec3>}
48
+ */
49
+ get lineColorNode(): Node | null;
43
50
  set worldUnits(value: boolean);
44
51
  /**
45
52
  * Whether the lines should sized in world units or not.
46
53
  * When set to `false` the unit is pixel.
47
54
  *
55
+ * @type {boolean}
48
56
  * @default false
49
57
  */
50
58
  get worldUnits(): boolean;
@@ -67,6 +75,8 @@ export interface Line2NodeMaterialParameters
67
75
  /**
68
76
  * This node material can be used to render lines with a size larger than one
69
77
  * by representing them as instanced meshes.
78
+ *
79
+ * @augments NodeMaterial
70
80
  */
71
81
  declare class Line2NodeMaterial extends NodeMaterial {
72
82
  /**
@@ -78,17 +88,12 @@ declare class Line2NodeMaterial extends NodeMaterial {
78
88
  /**
79
89
  * This flag can be used for type testing.
80
90
  *
91
+ * @type {boolean}
92
+ * @readonly
81
93
  * @default true
82
94
  */
83
95
  readonly isLine2NodeMaterial: boolean;
84
96
  setValues(values?: Line2NodeMaterialParameters): void;
85
- /**
86
- * Copies the properties of the given material to this instance.
87
- *
88
- * @param {Line2NodeMaterial} source - The material to copy.
89
- * @return {Line2NodeMaterial} A reference to this material.
90
- */
91
- copy(source: Line2NodeMaterial): this;
92
97
  }
93
98
 
94
99
  // eslint-disable-next-line @typescript-eslint/no-empty-interface