@types/three 0.150.0 → 0.150.2

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 (104) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/controls/OrbitControls.d.ts +3 -3
  3. three/examples/jsm/controls/TrackballControls.d.ts +2 -2
  4. three/examples/jsm/controls/TransformControls.d.ts +2 -6
  5. three/examples/jsm/geometries/TextGeometry.d.ts +92 -15
  6. three/examples/jsm/loaders/EXRLoader.d.ts +3 -2
  7. three/examples/jsm/misc/GPUComputationRenderer.d.ts +4 -2
  8. three/package.json +2 -2
  9. three/src/Three.d.ts +0 -1
  10. three/src/audio/Audio.d.ts +184 -20
  11. three/src/audio/AudioAnalyser.d.ts +42 -4
  12. three/src/audio/AudioContext.d.ts +12 -1
  13. three/src/audio/AudioListener.d.ts +76 -8
  14. three/src/audio/PositionalAudio.d.ts +86 -5
  15. three/src/cameras/ArrayCamera.d.ts +23 -2
  16. three/src/cameras/Camera.d.ts +42 -13
  17. three/src/cameras/CubeCamera.d.ts +49 -1
  18. three/src/cameras/OrthographicCamera.d.ts +77 -25
  19. three/src/cameras/PerspectiveCamera.d.ts +132 -56
  20. three/src/cameras/StereoCamera.d.ts +29 -2
  21. three/src/constants.d.ts +431 -26
  22. three/src/core/BufferGeometry.d.ts +5 -3
  23. three/src/core/Object3D.d.ts +17 -13
  24. three/src/core/Raycaster.d.ts +1 -0
  25. three/src/geometries/BoxGeometry.d.ts +39 -16
  26. three/src/geometries/CapsuleGeometry.d.ts +35 -12
  27. three/src/geometries/CircleGeometry.d.ts +38 -12
  28. three/src/geometries/ConeGeometry.d.ts +45 -10
  29. three/src/geometries/CylinderGeometry.d.ts +41 -19
  30. three/src/geometries/DodecahedronGeometry.d.ts +14 -5
  31. three/src/geometries/EdgesGeometry.d.ts +30 -8
  32. three/src/geometries/ExtrudeGeometry.d.ts +93 -12
  33. three/src/geometries/IcosahedronGeometry.d.ts +15 -5
  34. three/src/geometries/LatheGeometry.d.ts +41 -12
  35. three/src/geometries/OctahedronGeometry.d.ts +14 -5
  36. three/src/geometries/PlaneGeometry.d.ts +35 -12
  37. three/src/geometries/PolyhedronGeometry.d.ts +41 -12
  38. three/src/geometries/RingGeometry.d.ts +39 -16
  39. three/src/geometries/ShapeGeometry.d.ts +44 -4
  40. three/src/geometries/SphereGeometry.d.ts +43 -21
  41. three/src/geometries/TetrahedronGeometry.d.ts +14 -5
  42. three/src/geometries/TorusGeometry.d.ts +35 -13
  43. three/src/geometries/TorusKnotGeometry.d.ts +39 -16
  44. three/src/geometries/TubeGeometry.d.ts +63 -15
  45. three/src/geometries/WireframeGeometry.d.ts +30 -4
  46. three/src/helpers/ArrowHelper.d.ts +1 -1
  47. three/src/helpers/BoxHelper.d.ts +1 -1
  48. three/src/helpers/DirectionalLightHelper.d.ts +1 -1
  49. three/src/helpers/GridHelper.d.ts +1 -1
  50. three/src/helpers/HemisphereLightHelper.d.ts +1 -2
  51. three/src/helpers/PointLightHelper.d.ts +1 -1
  52. three/src/helpers/PolarGridHelper.d.ts +1 -1
  53. three/src/helpers/SpotLightHelper.d.ts +1 -1
  54. three/src/lights/AmbientLight.d.ts +1 -1
  55. three/src/lights/AmbientLightProbe.d.ts +1 -1
  56. three/src/lights/DirectionalLight.d.ts +1 -1
  57. three/src/lights/HemisphereLight.d.ts +1 -2
  58. three/src/lights/HemisphereLightProbe.d.ts +1 -1
  59. three/src/lights/PointLight.d.ts +1 -1
  60. three/src/lights/RectAreaLight.d.ts +1 -1
  61. three/src/lights/SpotLight.d.ts +1 -2
  62. three/src/materials/LineBasicMaterial.d.ts +1 -2
  63. three/src/materials/MeshBasicMaterial.d.ts +1 -2
  64. three/src/materials/MeshLambertMaterial.d.ts +1 -2
  65. three/src/materials/MeshMatcapMaterial.d.ts +1 -2
  66. three/src/materials/MeshPhongMaterial.d.ts +1 -2
  67. three/src/materials/MeshStandardMaterial.d.ts +1 -2
  68. three/src/materials/MeshToonMaterial.d.ts +1 -2
  69. three/src/materials/PointsMaterial.d.ts +1 -2
  70. three/src/materials/ShadowMaterial.d.ts +1 -2
  71. three/src/materials/SpriteMaterial.d.ts +1 -2
  72. three/src/math/Color.d.ts +2 -3
  73. three/src/math/ColorManagement.d.ts +2 -2
  74. three/src/objects/Bone.d.ts +30 -3
  75. three/src/objects/Group.d.ts +37 -1
  76. three/src/objects/InstancedMesh.d.ts +122 -3
  77. three/src/objects/LOD.d.ts +62 -18
  78. three/src/objects/Line.d.ts +67 -4
  79. three/src/objects/LineLoop.d.ts +26 -1
  80. three/src/objects/LineSegments.d.ts +21 -9
  81. three/src/objects/Mesh.d.ts +60 -4
  82. three/src/objects/Points.d.ts +39 -8
  83. three/src/objects/Skeleton.d.ts +89 -3
  84. three/src/objects/SkinnedMesh.d.ts +122 -3
  85. three/src/objects/Sprite.d.ts +51 -4
  86. three/src/renderers/WebGLRenderTarget.d.ts +9 -3
  87. three/src/renderers/WebGLRenderer.d.ts +1 -2
  88. three/src/scenes/Fog.d.ts +60 -9
  89. three/src/scenes/FogExp2.d.ts +41 -7
  90. three/src/scenes/Scene.d.ts +45 -22
  91. three/src/textures/CanvasTexture.d.ts +35 -13
  92. three/src/textures/CompressedArrayTexture.d.ts +39 -5
  93. three/src/textures/CompressedTexture.d.ts +49 -20
  94. three/src/textures/CubeTexture.d.ts +71 -18
  95. three/src/textures/Data3DTexture.d.ts +74 -10
  96. three/src/textures/DataArrayTexture.d.ts +83 -9
  97. three/src/textures/DataTexture.d.ts +81 -26
  98. three/src/textures/DepthTexture.d.ts +71 -15
  99. three/src/textures/FramebufferTexture.d.ts +57 -2
  100. three/src/textures/Source.d.ts +23 -13
  101. three/src/textures/Texture.d.ts +289 -73
  102. three/src/textures/VideoTexture.d.ts +69 -13
  103. three/src/textures/types.d.ts +9 -0
  104. three/src/utils.d.ts +0 -6
three/src/constants.d.ts CHANGED
@@ -1,25 +1,21 @@
1
1
  export const REVISION: string;
2
2
 
3
3
  // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
4
- export const MOUSE: {
5
- LEFT: 0;
6
- MIDDLE: 1;
7
- RIGHT: 2;
8
- ROTATE: 0;
9
- DOLLY: 1;
10
- PAN: 2;
11
- };
12
-
13
- export type MouseButton = 0 | 1 | 2;
14
-
15
- export const TOUCH: {
16
- ROTATE: 0;
17
- PAN: 1;
18
- DOLLY_PAN: 2;
19
- DOLLY_ROTATE: 3;
20
- };
21
-
22
- export type TouchCount = 0 | 1 | 2 | 3;
4
+ export enum MOUSE {
5
+ LEFT = 0,
6
+ MIDDLE = 1,
7
+ RIGHT = 2,
8
+ ROTATE = 0,
9
+ DOLLY = 1,
10
+ PAN = 2,
11
+ }
12
+
13
+ export enum TOUCH {
14
+ ROTATE = 0,
15
+ PAN = 1,
16
+ DOLLY_PAN = 2,
17
+ DOLLY_ROTATE = 3,
18
+ }
23
19
 
24
20
  // GL STATE CONSTANTS
25
21
  export const CullFaceNone: 0;
@@ -146,39 +142,153 @@ export type ToneMapping =
146
142
  | typeof ACESFilmicToneMapping
147
143
  | typeof CustomToneMapping;
148
144
 
145
+ ///////////////////////////////////////////////////////////////////////////////
146
+ ///////////////////////////////////////////////////////////////////////////////
147
+ ///////////////////////////////////////////////////////////////////////////////
149
148
  // Mapping modes
149
+
150
+ /**
151
+ * Maps the texture using the mesh's UV coordinates.
152
+ * @remarks This is the _default_ value and behaver for Texture Mapping.
153
+ */
150
154
  export const UVMapping: 300;
155
+
156
+ /**
157
+ * @remarks This is the _default_ value and behaver for Cube Texture Mapping.
158
+ */
151
159
  export const CubeReflectionMapping: 301;
152
160
  export const CubeRefractionMapping: 302;
161
+ export const CubeUVReflectionMapping: 306;
162
+
153
163
  export const EquirectangularReflectionMapping: 303;
154
164
  export const EquirectangularRefractionMapping: 304;
155
- export const CubeUVReflectionMapping: 306;
165
+
166
+ /**
167
+ * Texture Mapping Modes for non-cube Textures
168
+ * @remarks {@link UVMapping} is the _default_ value and behaver for Texture Mapping.
169
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
170
+ */
156
171
  export type Mapping =
157
172
  | typeof UVMapping
173
+ | typeof EquirectangularReflectionMapping
174
+ | typeof EquirectangularRefractionMapping;
175
+
176
+ /**
177
+ * Texture Mapping Modes for cube Textures
178
+ * @remarks {@link CubeReflectionMapping} is the _default_ value and behaver for Cube Texture Mapping.
179
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
180
+ */
181
+ export type CubeTextureMapping =
158
182
  | typeof CubeReflectionMapping
159
183
  | typeof CubeRefractionMapping
160
- | typeof EquirectangularReflectionMapping
161
- | typeof EquirectangularRefractionMapping
162
184
  | typeof CubeUVReflectionMapping;
163
185
 
186
+ /**
187
+ * Texture Mapping Modes for any type of Textures
188
+ * @see {@link Mapping} and {@link CubeTextureMapping}
189
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
190
+ */
191
+ export type AnyMapping = Mapping | CubeTextureMapping;
192
+
193
+ ///////////////////////////////////////////////////////////////////////////////
164
194
  // Wrapping modes
195
+
196
+ /** With {@link RepeatWrapping} the texture will simply repeat to infinity. */
165
197
  export const RepeatWrapping: 1000;
198
+ /**
199
+ * With {@link ClampToEdgeWrapping} the last pixel of the texture stretches to the edge of the mesh.
200
+ * @remarks This is the _default_ value and behaver for Wrapping Mapping.
201
+ */
166
202
  export const ClampToEdgeWrapping: 1001;
203
+ /** With {@link MirroredRepeatWrapping} the texture will repeats to infinity, mirroring on each repeat. */
167
204
  export const MirroredRepeatWrapping: 1002;
205
+
206
+ /**
207
+ * Texture Wrapping Modes
208
+ * @remarks {@link ClampToEdgeWrapping} is the _default_ value and behaver for Wrapping Mapping.
209
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
210
+ */
168
211
  export type Wrapping = typeof RepeatWrapping | typeof ClampToEdgeWrapping | typeof MirroredRepeatWrapping;
169
212
 
213
+ ///////////////////////////////////////////////////////////////////////////////
170
214
  // Filters
215
+
216
+ /** {@link NearestFilter} returns the value of the texture element that is nearest (in Manhattan distance) to the specified texture coordinates. */
171
217
  export const NearestFilter: 1003;
218
+
219
+ /**
220
+ * {@link NearestMipmapNearestFilter} chooses the mipmap that most closely matches the size of the pixel being textured
221
+ * and uses the {@link NearestFilter} criterion (the texel nearest to the center of the pixel) to produce a texture value.
222
+ */
172
223
  export const NearestMipmapNearestFilter: 1004;
224
+ /**
225
+ * {@link NearestMipmapNearestFilter} chooses the mipmap that most closely matches the size of the pixel being textured
226
+ * and uses the {@link NearestFilter} criterion (the texel nearest to the center of the pixel) to produce a texture value.
227
+ */
173
228
  export const NearestMipMapNearestFilter: 1004;
229
+
230
+ /**
231
+ * {@link NearestMipmapLinearFilter} chooses the two mipmaps that most closely match the size of the pixel being textured
232
+ * and uses the {@link NearestFilter} criterion to produce a texture value from each mipmap.
233
+ * The final texture value is a weighted average of those two values.
234
+ */
174
235
  export const NearestMipmapLinearFilter: 1005;
236
+ /**
237
+ * {@link NearestMipMapLinearFilter} chooses the two mipmaps that most closely match the size of the pixel being textured
238
+ * and uses the {@link NearestFilter} criterion to produce a texture value from each mipmap.
239
+ * The final texture value is a weighted average of those two values.
240
+ */
175
241
  export const NearestMipMapLinearFilter: 1005;
242
+
243
+ /**
244
+ * {@link LinearFilter} returns the weighted average of the four texture elements that are closest to the specified texture coordinates,
245
+ * and can include items wrapped or repeated from other parts of a texture,
246
+ * depending on the values of {@link THREE.Texture.wrapS | wrapS} and {@link THREE.Texture.wrapT | wrapT}, and on the exact mapping.
247
+ */
176
248
  export const LinearFilter: 1006;
249
+
250
+ /**
251
+ * {@link LinearMipmapNearestFilter} chooses the mipmap that most closely matches the size of the pixel being textured and
252
+ * uses the {@link LinearFilter} criterion (a weighted average of the four texels that are closest to the center of the pixel) to produce a texture value.
253
+ */
177
254
  export const LinearMipmapNearestFilter: 1007;
255
+ /**
256
+ * {@link LinearMipMapNearestFilter} chooses the mipmap that most closely matches the size of the pixel being textured and
257
+ * uses the {@link LinearFilter} criterion (a weighted average of the four texels that are closest to the center of the pixel) to produce a texture value.
258
+ */
178
259
  export const LinearMipMapNearestFilter: 1007;
260
+
261
+ /**
262
+ * {@link LinearMipmapLinearFilter} is the default and chooses the two mipmaps that most closely match the size of the pixel being textured and
263
+ * uses the {@link LinearFilter} criterion to produce a texture value from each mipmap.
264
+ * The final texture value is a weighted average of those two values.
265
+ */
179
266
  export const LinearMipmapLinearFilter: 1008;
267
+
268
+ /**
269
+ * {@link LinearMipMapLinearFilter} is the default and chooses the two mipmaps that most closely match the size of the pixel being textured and
270
+ * uses the {@link LinearFilter} criterion to produce a texture value from each mipmap.
271
+ * The final texture value is a weighted average of those two values.
272
+ */
180
273
  export const LinearMipMapLinearFilter: 1008;
181
- export type TextureFilter =
274
+
275
+ /**
276
+ * Texture Magnification Filter Modes.
277
+ * For use with a texture's {@link THREE.Texture.magFilter | magFilter} property,
278
+ * these define the texture magnification function to be used when the pixel being textured maps to an area less than or equal to one texture element (texel).
279
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
280
+ * @see {@link https://sbcode.net/threejs/mipmaps/ | Texture Mipmaps (non-official)}
281
+ */
282
+ export type MagnificationTextureFilter = typeof NearestFilter | typeof LinearFilter;
283
+
284
+ /**
285
+ * Texture Minification Filter Modes.
286
+ * For use with a texture's {@link THREE.Texture.minFilter | minFilter} property,
287
+ * these define the texture minifying function that is used whenever the pixel being textured maps to an area greater than one texture element (texel).
288
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
289
+ * @see {@link https://sbcode.net/threejs/mipmaps/ | Texture Mipmaps (non-official)}
290
+ */
291
+ export type MinificationTextureFilter =
182
292
  | typeof NearestFilter
183
293
  | typeof NearestMipmapNearestFilter
184
294
  | typeof NearestMipMapNearestFilter
@@ -190,7 +300,17 @@ export type TextureFilter =
190
300
  | typeof LinearMipmapLinearFilter
191
301
  | typeof LinearMipMapLinearFilter;
192
302
 
303
+ /**
304
+ * Texture all Magnification and Minification Filter Modes.
305
+ * @see {@link MagnificationTextureFilter} and {@link MinificationTextureFilter}
306
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
307
+ * @see {@link https://sbcode.net/threejs/mipmaps/ | Texture Mipmaps (non-official)}
308
+ */
309
+ export type TextureFilter = MagnificationTextureFilter | MinificationTextureFilter;
310
+
311
+ ///////////////////////////////////////////////////////////////////////////////
193
312
  // Data types
313
+
194
314
  export const UnsignedByteType: 1009;
195
315
  export const ByteType: 1010;
196
316
  export const ShortType: 1011;
@@ -202,6 +322,13 @@ export const HalfFloatType: 1016;
202
322
  export const UnsignedShort4444Type: 1017;
203
323
  export const UnsignedShort5551Type: 1018;
204
324
  export const UnsignedInt248Type: 1020;
325
+
326
+ /**
327
+ * Texture Types.
328
+ * @remarks Must correspond to the correct {@link PixelFormat | format}.
329
+ * @see {@link THREE.Texture.type}
330
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
331
+ */
205
332
  export type TextureDataType =
206
333
  | typeof UnsignedByteType
207
334
  | typeof ByteType
@@ -215,19 +342,101 @@ export type TextureDataType =
215
342
  | typeof UnsignedShort5551Type
216
343
  | typeof UnsignedInt248Type;
217
344
 
345
+ ///////////////////////////////////////////////////////////////////////////////
218
346
  // Pixel formats
347
+
348
+ /** {@link AlphaFormat} discards the red, green and blue components and reads just the alpha component. */
219
349
  export const AlphaFormat: 1021;
350
+
351
+ /** {@link RGBAFormat} discards the green and blue components and reads just the red component. (Can only be used with a WebGL 2 rendering context). */
220
352
  export const RGBAFormat: 1023;
353
+
354
+ /**
355
+ * {@link LuminanceFormat} reads each element as a single luminance component.
356
+ * This is then converted to a floating point, clamped to the range `[0,1]`, and then assembled into an RGBA element by
357
+ * placing the luminance value in the red, green and blue channels, and attaching `1.0` to the alpha channel.
358
+ */
221
359
  export const LuminanceFormat: 1024;
360
+
361
+ /**
362
+ * {@link LuminanceAlphaFormat} reads each element as a luminance/alpha double.
363
+ * The same process occurs as for the {@link LuminanceFormat}, except that the alpha channel may have values other than `1.0`.
364
+ */
222
365
  export const LuminanceAlphaFormat: 1025;
366
+
367
+ /**
368
+ * {@link DepthFormat} reads each element as a single depth value, converts it to floating point, and clamps to the range `[0,1]`.
369
+ * @remarks This is the default for {@link THREE.DepthTexture}.
370
+ */
223
371
  export const DepthFormat: 1026;
372
+
373
+ /**
374
+ * {@link DepthStencilFormat} reads each element is a pair of depth and stencil values.
375
+ * The depth component of the pair is interpreted as in {@link DepthFormat}.
376
+ * The stencil component is interpreted based on the depth + stencil internal format.
377
+ */
224
378
  export const DepthStencilFormat: 1027;
379
+
380
+ /**
381
+ * {@link RedFormat} discards the green and blue components and reads just the red component.
382
+ * @remarks Can only be used with a WebGL 2 rendering context.
383
+ */
225
384
  export const RedFormat: 1028;
385
+
386
+ /**
387
+ * {@link RedIntegerFormat} discards the green and blue components and reads just the red component.
388
+ * The texels are read as integers instead of floating point.
389
+ * @remarks Can only be used with a WebGL 2 rendering context.
390
+ */
226
391
  export const RedIntegerFormat: 1029;
392
+
393
+ /**
394
+ * {@link RGFormat} discards the alpha, and blue components and reads the red, and green components.
395
+ * @remarks Can only be used with a WebGL 2 rendering context.
396
+ */
227
397
  export const RGFormat: 1030;
398
+
399
+ /**
400
+ * {@link RGIntegerFormat} discards the alpha, and blue components and reads the red, and green components.
401
+ * The texels are read as integers instead of floating point.
402
+ * @remarks Can only be used with a WebGL 2 rendering context.
403
+ */
228
404
  export const RGIntegerFormat: 1031;
405
+
406
+ /**
407
+ * {@link RGBAIntegerFormat} reads the red, green, blue and alpha component
408
+ * @remarks This is the default for {@link THREE.Texture}.
409
+ */
229
410
  export const RGBAIntegerFormat: 1033;
230
- export type PixelFormat =
411
+
412
+ export const _SRGBAFormat = 1035; // fallback for WebGL 1
413
+
414
+ /**
415
+ * Texture Pixel Formats Modes. Compatible only with {@link WebGLRenderingContext | WebGL 1 Rendering Context}.
416
+ * @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
417
+ * @see {@link WebGLRenderingContext.texImage2D} for details.
418
+ * @see {@link WebGL2PixelFormat} and {@link PixelFormat}
419
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
420
+ */
421
+ export type WebGL1PixelFormat =
422
+ | typeof AlphaFormat
423
+ | typeof LuminanceFormat
424
+ | typeof LuminanceAlphaFormat
425
+ | typeof DepthFormat
426
+ | typeof DepthStencilFormat
427
+ | typeof RedFormat
428
+ | typeof RedIntegerFormat
429
+ | typeof RGFormat
430
+ | typeof _SRGBAFormat;
431
+
432
+ /**
433
+ * Texture Pixel Formats Modes. Compatible only with {@link WebGL2RenderingContext | WebGL 2 Rendering Context}.
434
+ * @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
435
+ * @see {@link WebGLRenderingContext.texImage2D} for details.
436
+ * @see {@link WebGL2PixelFormat} and {@link PixelFormat}
437
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
438
+ */
439
+ export type WebGL2PixelFormat =
231
440
  | typeof AlphaFormat
232
441
  | typeof RGBAFormat
233
442
  | typeof LuminanceFormat
@@ -241,41 +450,149 @@ export type PixelFormat =
241
450
  | typeof RGBAIntegerFormat
242
451
  | typeof _SRGBAFormat;
243
452
 
453
+ /**
454
+ * All Texture Pixel Formats Modes.
455
+ * @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
456
+ * @see {@link WebGLRenderingContext.texImage2D} for details.
457
+ * @see {@link WebGL1PixelFormat} and {@link WebGL2PixelFormat}
458
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
459
+ */
460
+ export type PixelFormat = WebGL1PixelFormat | WebGL2PixelFormat;
461
+
462
+ /**
463
+ * All Texture Pixel Formats Modes for {@link THREE.DeepTexture}.
464
+ * @see {@link WebGLRenderingContext.texImage2D} for details.
465
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
466
+ */
467
+ export type DeepTexturePixelFormat = typeof DepthFormat | typeof DepthStencilFormat;
468
+
469
+ ///////////////////////////////////////////////////////////////////////////////
244
470
  // Compressed texture formats
245
471
  // DDS / ST3C Compressed texture formats
472
+
473
+ /**
474
+ * A DXT1-compressed image in an RGB image format.
475
+ * @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
476
+ */
246
477
  export const RGB_S3TC_DXT1_Format: 33776;
478
+ /**
479
+ * A DXT1-compressed image in an RGB image format with a simple on/off alpha value.
480
+ * @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
481
+ */
247
482
  export const RGBA_S3TC_DXT1_Format: 33777;
483
+ /**
484
+ * A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.
485
+ * @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
486
+ */
248
487
  export const RGBA_S3TC_DXT3_Format: 33778;
488
+ /**
489
+ * A DXT5-compressed image in an RGBA image format. It also provides a 4:1 compression, but differs to the DXT3 compression in how the alpha compression is done.
490
+ * @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
491
+ */
249
492
  export const RGBA_S3TC_DXT5_Format: 33779;
250
493
 
251
494
  // PVRTC compressed './texture formats
495
+
496
+ /**
497
+ * RGB compression in 4-bit mode. One block for each 4×4 pixels.
498
+ * @remarks Require support for the _WEBGL_compressed_texture_pvrtc_ WebGL extension.
499
+ */
252
500
  export const RGB_PVRTC_4BPPV1_Format: 35840;
501
+ /**
502
+ * RGB compression in 2-bit mode. One block for each 8×4 pixels.
503
+ * @remarks Require support for the _WEBGL_compressed_texture_pvrtc_ WebGL extension.
504
+ */
253
505
  export const RGB_PVRTC_2BPPV1_Format: 35841;
506
+ /**
507
+ * RGBA compression in 4-bit mode. One block for each 4×4 pixels.
508
+ * @remarks Require support for the _WEBGL_compressed_texture_pvrtc_ WebGL extension.
509
+ */
254
510
  export const RGBA_PVRTC_4BPPV1_Format: 35842;
511
+ /**
512
+ * RGBA compression in 2-bit mode. One block for each 8×4 pixels.
513
+ * @remarks Require support for the _WEBGL_compressed_texture_pvrtc_ WebGL extension.
514
+ */
255
515
  export const RGBA_PVRTC_2BPPV1_Format: 35843;
256
516
 
257
517
  // ETC compressed texture formats
518
+
519
+ /**
520
+ * @remarks Require support for the _WEBGL_compressed_texture_etc1_ (ETC1) or _WEBGL_compressed_texture_etc_ (ETC2) WebGL extension.
521
+ */
258
522
  export const RGB_ETC1_Format: 36196;
523
+ /**
524
+ * @remarks Require support for the _WEBGL_compressed_texture_etc1_ (ETC1) or _WEBGL_compressed_texture_etc_ (ETC2) WebGL extension.
525
+ */
259
526
  export const RGB_ETC2_Format: 37492;
527
+ /**
528
+ * @remarks Require support for the _WEBGL_compressed_texture_etc1_ (ETC1) or _WEBGL_compressed_texture_etc_ (ETC2) WebGL extension.
529
+ */
260
530
  export const RGBA_ETC2_EAC_Format: 37496;
261
531
 
262
532
  // ASTC compressed texture formats
533
+
534
+ /**
535
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
536
+ */
263
537
  export const RGBA_ASTC_4x4_Format: 37808;
538
+ /**
539
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
540
+ */
264
541
  export const RGBA_ASTC_5x4_Format: 37809;
542
+ /**
543
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
544
+ */
265
545
  export const RGBA_ASTC_5x5_Format: 37810;
546
+ /**
547
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
548
+ */
266
549
  export const RGBA_ASTC_6x5_Format: 37811;
550
+ /**
551
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
552
+ */
267
553
  export const RGBA_ASTC_6x6_Format: 37812;
554
+ /**
555
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
556
+ */
268
557
  export const RGBA_ASTC_8x5_Format: 37813;
558
+ /**
559
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
560
+ */
269
561
  export const RGBA_ASTC_8x6_Format: 37814;
562
+ /**
563
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
564
+ */
270
565
  export const RGBA_ASTC_8x8_Format: 37815;
566
+ /**
567
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
568
+ */
271
569
  export const RGBA_ASTC_10x5_Format: 37816;
570
+ /**
571
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
572
+ */
272
573
  export const RGBA_ASTC_10x6_Format: 37817;
574
+ /**
575
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
576
+ */
273
577
  export const RGBA_ASTC_10x8_Format: 37818;
578
+ /**
579
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
580
+ */
274
581
  export const RGBA_ASTC_10x10_Format: 37819;
582
+ /**
583
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
584
+ */
275
585
  export const RGBA_ASTC_12x10_Format: 37820;
586
+ /**
587
+ * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
588
+ */
276
589
  export const RGBA_ASTC_12x12_Format: 37821;
277
590
 
278
591
  // BPTC compressed texture formats
592
+
593
+ /**
594
+ * @remarks Require support for the _EXT_texture_compression_bptc_ WebGL extension.
595
+ */
279
596
  export const RGBA_BPTC_Format: 36492;
280
597
 
281
598
  // RGTC compressed texture formats
@@ -284,6 +601,10 @@ export const SIGNED_RED_RGTC1_Format: 36284;
284
601
  export const RED_GREEN_RGTC2_Format: 36285;
285
602
  export const SIGNED_RED_GREEN_RGTC2_Format: 36286;
286
603
 
604
+ /**
605
+ * For use with a {@link THREE.CompressedTexture}'s {@link THREE.CompressedTexture.format | .format} property.
606
+ * @remarks Compressed Require support for correct WebGL extension.
607
+ */
287
608
  export type CompressedPixelFormat =
288
609
  | typeof RGB_S3TC_DXT1_Format
289
610
  | typeof RGBA_S3TC_DXT1_Format
@@ -316,6 +637,18 @@ export type CompressedPixelFormat =
316
637
  | typeof RED_GREEN_RGTC2_Format
317
638
  | typeof SIGNED_RED_GREEN_RGTC2_Format;
318
639
 
640
+ ///////////////////////////////////////////////////////////////////////////////
641
+
642
+ /**
643
+ * All Possible Texture Pixel Formats Modes. For any Type or SubType of Textures.
644
+ * @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
645
+ * @see {@link WebGLRenderingContext.texImage2D} for details.
646
+ * @see {@link PixelFormat} and {@link DeepTexturePixelFormat} and {@link CompressedPixelFormat}
647
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
648
+ */
649
+ export type AnyPixelFormat = PixelFormat | DeepTexturePixelFormat | CompressedPixelFormat;
650
+
651
+ ///////////////////////////////////////////////////////////////////////////////
319
652
  // Loop styles for AnimationAction
320
653
  export const LoopOnce: 2200;
321
654
  export const LoopRepeat: 2201;
@@ -345,17 +678,27 @@ export const TriangleStripDrawMode: 1;
345
678
  export const TriangleFanDrawMode: 2;
346
679
  export type TrianglesDrawModes = typeof TrianglesDrawMode | typeof TriangleStripDrawMode | typeof TriangleFanDrawMode;
347
680
 
681
+ ///////////////////////////////////////////////////////////////////////////////
348
682
  // Texture Encodings
683
+
349
684
  export const LinearEncoding: 3000;
350
685
  export const sRGBEncoding: 3001;
686
+ /**
687
+ * Texture Encodings.
688
+ * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
689
+ */
351
690
  export type TextureEncoding = typeof LinearEncoding | typeof sRGBEncoding;
352
691
 
692
+ ///////////////////////////////////////////////////////////////////////////////
353
693
  // Depth packing strategies
694
+
354
695
  export const BasicDepthPacking: 3200;
355
696
  export const RGBADepthPacking: 3201;
356
697
  export type DepthPackingStrategies = typeof BasicDepthPacking | typeof RGBADepthPacking;
357
698
 
699
+ ///////////////////////////////////////////////////////////////////////////////
358
700
  // Normal Map types
701
+
359
702
  export const TangentSpaceNormalMap: 0;
360
703
  export const ObjectSpaceNormalMap: 1;
361
704
  export type NormalMapTypes = typeof TangentSpaceNormalMap | typeof ObjectSpaceNormalMap;
@@ -433,9 +776,69 @@ export const GLSL1: '100';
433
776
  export const GLSL3: '300 es';
434
777
  export type GLSLVersion = typeof GLSL1 | typeof GLSL3;
435
778
 
436
- export const _SRGBAFormat = 1035; // fallback for WebGL 1
779
+ ///////////////////////////////////////////////////////////////////////////////
780
+ // Texture - Internal Pixel Formats
437
781
 
438
- // Internal Pixel Formats
782
+ /**
783
+ * For use with a texture's {@link THREE.Texture.internalFormat} property, these define how elements of a {@link THREE.Texture}, or texels, are stored on the GPU.
784
+ * - `R8` stores the red component on 8 bits.
785
+ * - `R8_SNORM` stores the red component on 8 bits. The component is stored as normalized.
786
+ * - `R8I` stores the red component on 8 bits. The component is stored as an integer.
787
+ * - `R8UI` stores the red component on 8 bits. The component is stored as an unsigned integer.
788
+ * - `R16I` stores the red component on 16 bits. The component is stored as an integer.
789
+ * - `R16UI` stores the red component on 16 bits. The component is stored as an unsigned integer.
790
+ * - `R16F` stores the red component on 16 bits. The component is stored as floating point.
791
+ * - `R32I` stores the red component on 32 bits. The component is stored as an integer.
792
+ * - `R32UI` stores the red component on 32 bits. The component is stored as an unsigned integer.
793
+ * - `R32F` stores the red component on 32 bits. The component is stored as floating point.
794
+ * - `RG8` stores the red and green components on 8 bits each.
795
+ * - `RG8_SNORM` stores the red and green components on 8 bits each. Every component is stored as normalized.
796
+ * - `RG8I` stores the red and green components on 8 bits each. Every component is stored as an integer.
797
+ * - `RG8UI` stores the red and green components on 8 bits each. Every component is stored as an unsigned integer.
798
+ * - `RG16I` stores the red and green components on 16 bits each. Every component is stored as an integer.
799
+ * - `RG16UI` stores the red and green components on 16 bits each. Every component is stored as an unsigned integer.
800
+ * - `RG16F` stores the red and green components on 16 bits each. Every component is stored as floating point.
801
+ * - `RG32I` stores the red and green components on 32 bits each. Every component is stored as an integer.
802
+ * - `RG32UI` stores the red and green components on 32 bits. Every component is stored as an unsigned integer.
803
+ * - `RG32F` stores the red and green components on 32 bits. Every component is stored as floating point.
804
+ * - `RGB8` stores the red, green, and blue components on 8 bits each. RGB8_SNORM` stores the red, green, and blue components on 8 bits each. Every component is stored as normalized.
805
+ * - `RGB8I` stores the red, green, and blue components on 8 bits each. Every component is stored as an integer.
806
+ * - `RGB8UI` stores the red, green, and blue components on 8 bits each. Every component is stored as an unsigned integer.
807
+ * - `RGB16I` stores the red, green, and blue components on 16 bits each. Every component is stored as an integer.
808
+ * - `RGB16UI` stores the red, green, and blue components on 16 bits each. Every component is stored as an unsigned integer.
809
+ * - `RGB16F` stores the red, green, and blue components on 16 bits each. Every component is stored as floating point
810
+ * - `RGB32I` stores the red, green, and blue components on 32 bits each. Every component is stored as an integer.
811
+ * - `RGB32UI` stores the red, green, and blue components on 32 bits each. Every component is stored as an unsigned integer.
812
+ * - `RGB32F` stores the red, green, and blue components on 32 bits each. Every component is stored as floating point
813
+ * - `R11F_G11F_B10F` stores the red, green, and blue components respectively on 11 bits, 11 bits, and 10bits. Every component is stored as floating point.
814
+ * - `RGB565` stores the red, green, and blue components respectively on 5 bits, 6 bits, and 5 bits.
815
+ * - `RGB9_E5` stores the red, green, and blue components on 9 bits each.
816
+ * - `RGBA8` stores the red, green, blue, and alpha components on 8 bits each.
817
+ * - `RGBA8_SNORM` stores the red, green, blue, and alpha components on 8 bits. Every component is stored as normalized.
818
+ * - `RGBA8I` stores the red, green, blue, and alpha components on 8 bits each. Every component is stored as an integer.
819
+ * - `RGBA8UI` stores the red, green, blue, and alpha components on 8 bits. Every component is stored as an unsigned integer.
820
+ * - `RGBA16I` stores the red, green, blue, and alpha components on 16 bits. Every component is stored as an integer.
821
+ * - `RGBA16UI` stores the red, green, blue, and alpha components on 16 bits. Every component is stored as an unsigned integer.
822
+ * - `RGBA16F` stores the red, green, blue, and alpha components on 16 bits. Every component is stored as floating point.
823
+ * - `RGBA32I` stores the red, green, blue, and alpha components on 32 bits. Every component is stored as an integer.
824
+ * - `RGBA32UI` stores the red, green, blue, and alpha components on 32 bits. Every component is stored as an unsigned integer.
825
+ * - `RGBA32F` stores the red, green, blue, and alpha components on 32 bits. Every component is stored as floating point.
826
+ * - `RGB5_A1` stores the red, green, blue, and alpha components respectively on 5 bits, 5 bits, 5 bits, and 1 bit.
827
+ * - `RGB10_A2` stores the red, green, blue, and alpha components respectively on 10 bits, 10 bits, 10 bits and 2 bits.
828
+ * - `RGB10_A2UI` stores the red, green, blue, and alpha components respectively on 10 bits, 10 bits, 10 bits and 2 bits. Every component is stored as an unsigned integer.
829
+ * - `SRGB8` stores the red, green, and blue components on 8 bits each.
830
+ * - `SRGB8_ALPHA8` stores the red, green, blue, and alpha components on 8 bits each.
831
+ * - `DEPTH_COMPONENT16` stores the depth component on 16bits.
832
+ * - `DEPTH_COMPONENT24` stores the depth component on 24bits.
833
+ * - `DEPTH_COMPONENT32F` stores the depth component on 32bits. The component is stored as floating point.
834
+ * - `DEPTH24_STENCIL8` stores the depth, and stencil components respectively on 24 bits and 8 bits. The stencil component is stored as an unsigned integer.
835
+ * - `DEPTH32F_STENCIL8` stores the depth, and stencil components respectively on 32 bits and 8 bits. The depth component is stored as floating point, and the stencil component as an unsigned integer.
836
+ * @remark Note that the texture must have the correct {@link THREE.Texture.type} set, as well as the correct {@link THREE.Texture.format}.
837
+ * @see {@link WebGLRenderingContext.texImage2D} and {@link WebGLRenderingContext.texImage3D} for more details regarding the possible combination
838
+ * of {@link THREE.Texture.format}, {@link THREE.Texture.internalFormat}, and {@link THREE.Texture.type}.
839
+ * @see {@link https://registry.khronos.org/webgl/specs/latest/2.0/ | WebGL2 Specification} and
840
+ * {@link https://registry.khronos.org/OpenGL/specs/es/3.0/es_spec_3.0.pdf | OpenGL ES 3.0 Specification} For more in-depth information regarding internal formats.
841
+ */
439
842
  export type PixelFormatGPU =
440
843
  | 'ALPHA'
441
844
  | 'RGB'
@@ -499,6 +902,8 @@ export type PixelFormatGPU =
499
902
  | 'DEPTH24_STENCIL8'
500
903
  | 'DEPTH32F_STENCIL8';
501
904
 
905
+ ///////////////////////////////////////////////////////////////////////////////
906
+
502
907
  export type BuiltinShaderAttributeName =
503
908
  | 'position'
504
909
  | 'normal'
@@ -68,9 +68,11 @@ export class BufferGeometry extends EventDispatcher {
68
68
  name: string;
69
69
 
70
70
  /**
71
+ * A Read-only _string_ to check if `this` object type.
72
+ * @remarks Sub-classes will update this value.
71
73
  * @defaultValue `BufferGeometry`
72
74
  */
73
- type: string; // TODO Replace for "BufferGeometry" // TODO add readonly
75
+ readonly type: string | 'BufferGeometry';
74
76
 
75
77
  /**
76
78
  * Allows for vertices to be re-used across multiple triangles; this is called using "indexed triangles".
@@ -131,7 +133,7 @@ export class BufferGeometry extends EventDispatcher {
131
133
  }>;
132
134
 
133
135
  /**
134
- * Bounding box for the bufferGeometry, which can be calculated with {@link computeBoundingBox | .computeBoundingBox()}.
136
+ * Bounding box for the {@link THREE.BufferGeometry | BufferGeometry}, which can be calculated with {@link computeBoundingBox | .computeBoundingBox()}.
135
137
  * @remarks Bounding boxes aren't computed by default. They need to be explicitly computed, otherwise they are `null`.
136
138
  * @defaultValue `null`
137
139
  */
@@ -350,7 +352,7 @@ export class BufferGeometry extends EventDispatcher {
350
352
  /**
351
353
  * Creates a clone of this BufferGeometry
352
354
  */
353
- clone(): BufferGeometry;
355
+ clone(): this;
354
356
 
355
357
  /**
356
358
  * Copies another BufferGeometry to this BufferGeometry.