UNPKG

37 kBTypeScriptView Raw
1export const REVISION: string;
2
3// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent.button
4export enum MOUSE {
5 LEFT = 0,
6 MIDDLE = 1,
7 RIGHT = 2,
8 ROTATE = 0,
9 DOLLY = 1,
10 PAN = 2,
11}
12
13export enum TOUCH {
14 ROTATE = 0,
15 PAN = 1,
16 DOLLY_PAN = 2,
17 DOLLY_ROTATE = 3,
18}
19
20// GL STATE CONSTANTS
21export const CullFaceNone: 0;
22export const CullFaceBack: 1;
23export const CullFaceFront: 2;
24export const CullFaceFrontBack: 3;
25export type CullFace = typeof CullFaceNone | typeof CullFaceBack | typeof CullFaceFront | typeof CullFaceFrontBack;
26
27// Shadowing Type
28export const BasicShadowMap: 0;
29export const PCFShadowMap: 1;
30export const PCFSoftShadowMap: 2;
31export const VSMShadowMap: 3;
32export type ShadowMapType = typeof BasicShadowMap | typeof PCFShadowMap | typeof PCFSoftShadowMap | typeof VSMShadowMap;
33
34// MATERIAL CONSTANTS
35
36// side
37export const FrontSide: 0;
38export const BackSide: 1;
39export const DoubleSide: 2;
40/**
41 * Defines which side of faces will be rendered - front, back or both.
42 * Default is {@link FrontSide}.
43 */
44export type Side = typeof FrontSide | typeof BackSide | typeof DoubleSide;
45
46// blending modes
47export const NoBlending: 0;
48export const NormalBlending: 1;
49export const AdditiveBlending: 2;
50export const SubtractiveBlending: 3;
51export const MultiplyBlending: 4;
52export const CustomBlending: 5;
53export type Blending =
54 | typeof NoBlending
55 | typeof NormalBlending
56 | typeof AdditiveBlending
57 | typeof SubtractiveBlending
58 | typeof MultiplyBlending
59 | typeof CustomBlending;
60
61// custom blending equations
62// (numbers start from 100 not to clash with other
63// mappings to OpenGL constants defined in Texture.js)
64export const AddEquation: 100;
65export const SubtractEquation: 101;
66export const ReverseSubtractEquation: 102;
67export const MinEquation: 103;
68export const MaxEquation: 104;
69export type BlendingEquation =
70 | typeof AddEquation
71 | typeof SubtractEquation
72 | typeof ReverseSubtractEquation
73 | typeof MinEquation
74 | typeof MaxEquation;
75
76// custom blending factors
77export const ZeroFactor: 200;
78export const OneFactor: 201;
79export const SrcColorFactor: 202;
80export const OneMinusSrcColorFactor: 203;
81export const SrcAlphaFactor: 204;
82export const OneMinusSrcAlphaFactor: 205;
83export const DstAlphaFactor: 206;
84export const OneMinusDstAlphaFactor: 207;
85export const DstColorFactor: 208;
86export const OneMinusDstColorFactor: 209;
87export const SrcAlphaSaturateFactor: 210;
88export const ConstantColorFactor: 211;
89export const OneMinusConstantColorFactor: 212;
90export const ConstantAlphaFactor: 213;
91export const OneMinusConstantAlphaFactor: 214;
92export type BlendingDstFactor =
93 | typeof ZeroFactor
94 | typeof OneFactor
95 | typeof SrcColorFactor
96 | typeof OneMinusSrcColorFactor
97 | typeof SrcAlphaFactor
98 | typeof OneMinusSrcAlphaFactor
99 | typeof DstAlphaFactor
100 | typeof OneMinusDstAlphaFactor
101 | typeof DstColorFactor
102 | typeof OneMinusDstColorFactor
103 | typeof ConstantColorFactor
104 | typeof OneMinusConstantColorFactor
105 | typeof ConstantAlphaFactor
106 | typeof OneMinusConstantAlphaFactor;
107export type BlendingSrcFactor = BlendingDstFactor | typeof SrcAlphaSaturateFactor;
108
109// depth modes
110export const NeverDepth: 0;
111export const AlwaysDepth: 1;
112export const LessDepth: 2;
113export const LessEqualDepth: 3;
114export const EqualDepth: 4;
115export const GreaterEqualDepth: 5;
116export const GreaterDepth: 6;
117export const NotEqualDepth: 7;
118export type DepthModes =
119 | typeof NeverDepth
120 | typeof AlwaysDepth
121 | typeof LessDepth
122 | typeof LessEqualDepth
123 | typeof EqualDepth
124 | typeof GreaterEqualDepth
125 | typeof GreaterDepth
126 | typeof NotEqualDepth;
127
128// TEXTURE CONSTANTS
129// Operations
130export const MultiplyOperation: 0;
131export const MixOperation: 1;
132export const AddOperation: 2;
133export type Combine = typeof MultiplyOperation | typeof MixOperation | typeof AddOperation;
134
135// Tone Mapping modes
136export const NoToneMapping: 0;
137export const LinearToneMapping: 1;
138export const ReinhardToneMapping: 2;
139export const CineonToneMapping: 3;
140export const ACESFilmicToneMapping: 4;
141export const CustomToneMapping: 5;
142export const AgXToneMapping: 6;
143export const NeutralToneMapping: 7;
144export type ToneMapping =
145 | typeof NoToneMapping
146 | typeof LinearToneMapping
147 | typeof ReinhardToneMapping
148 | typeof CineonToneMapping
149 | typeof ACESFilmicToneMapping
150 | typeof CustomToneMapping
151 | typeof AgXToneMapping
152 | typeof NeutralToneMapping;
153
154// Bind modes
155export const AttachedBindMode: "attached";
156export const DetachedBindMode: "detached";
157export type BindMode = typeof AttachedBindMode | typeof DetachedBindMode;
158
159///////////////////////////////////////////////////////////////////////////////
160///////////////////////////////////////////////////////////////////////////////
161///////////////////////////////////////////////////////////////////////////////
162// Mapping modes
163
164/**
165 * Maps the texture using the mesh's UV coordinates.
166 * @remarks This is the _default_ value and behaver for Texture Mapping.
167 */
168export const UVMapping: 300;
169
170/**
171 * @remarks This is the _default_ value and behaver for Cube Texture Mapping.
172 */
173export const CubeReflectionMapping: 301;
174export const CubeRefractionMapping: 302;
175export const CubeUVReflectionMapping: 306;
176
177export const EquirectangularReflectionMapping: 303;
178export const EquirectangularRefractionMapping: 304;
179
180/**
181 * Texture Mapping Modes for non-cube Textures
182 * @remarks {@link UVMapping} is the _default_ value and behaver for Texture Mapping.
183 * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
184 */
185export type Mapping =
186 | typeof UVMapping
187 | typeof EquirectangularReflectionMapping
188 | typeof EquirectangularRefractionMapping;
189
190/**
191 * Texture Mapping Modes for cube Textures
192 * @remarks {@link CubeReflectionMapping} is the _default_ value and behaver for Cube Texture Mapping.
193 * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
194 */
195export type CubeTextureMapping =
196 | typeof CubeReflectionMapping
197 | typeof CubeRefractionMapping
198 | typeof CubeUVReflectionMapping;
199
200/**
201 * Texture Mapping Modes for any type of Textures
202 * @see {@link Mapping} and {@link CubeTextureMapping}
203 * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
204 */
205export type AnyMapping = Mapping | CubeTextureMapping;
206
207///////////////////////////////////////////////////////////////////////////////
208// Wrapping modes
209
210/** With {@link RepeatWrapping} the texture will simply repeat to infinity. */
211export const RepeatWrapping: 1000;
212/**
213 * With {@link ClampToEdgeWrapping} the last pixel of the texture stretches to the edge of the mesh.
214 * @remarks This is the _default_ value and behaver for Wrapping Mapping.
215 */
216export const ClampToEdgeWrapping: 1001;
217/** With {@link MirroredRepeatWrapping} the texture will repeats to infinity, mirroring on each repeat. */
218export const MirroredRepeatWrapping: 1002;
219
220/**
221 * Texture Wrapping Modes
222 * @remarks {@link ClampToEdgeWrapping} is the _default_ value and behaver for Wrapping Mapping.
223 * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
224 */
225export type Wrapping = typeof RepeatWrapping | typeof ClampToEdgeWrapping | typeof MirroredRepeatWrapping;
226
227///////////////////////////////////////////////////////////////////////////////
228// Filters
229
230/** {@link NearestFilter} returns the value of the texture element that is nearest (in Manhattan distance) to the specified texture coordinates. */
231export const NearestFilter: 1003;
232
233/**
234 * {@link NearestMipmapNearestFilter} chooses the mipmap that most closely matches the size of the pixel being textured
235 * and uses the {@link NearestFilter} criterion (the texel nearest to the center of the pixel) to produce a texture value.
236 */
237export const NearestMipmapNearestFilter: 1004;
238/**
239 * {@link NearestMipmapNearestFilter} chooses the mipmap that most closely matches the size of the pixel being textured
240 * and uses the {@link NearestFilter} criterion (the texel nearest to the center of the pixel) to produce a texture value.
241 */
242export const NearestMipMapNearestFilter: 1004;
243
244/**
245 * {@link NearestMipmapLinearFilter} chooses the two mipmaps that most closely match the size of the pixel being textured
246 * and uses the {@link NearestFilter} criterion to produce a texture value from each mipmap.
247 * The final texture value is a weighted average of those two values.
248 */
249export const NearestMipmapLinearFilter: 1005;
250/**
251 * {@link NearestMipMapLinearFilter} chooses the two mipmaps that most closely match the size of the pixel being textured
252 * and uses the {@link NearestFilter} criterion to produce a texture value from each mipmap.
253 * The final texture value is a weighted average of those two values.
254 */
255export const NearestMipMapLinearFilter: 1005;
256
257/**
258 * {@link LinearFilter} returns the weighted average of the four texture elements that are closest to the specified texture coordinates,
259 * and can include items wrapped or repeated from other parts of a texture,
260 * depending on the values of {@link THREE.Texture.wrapS | wrapS} and {@link THREE.Texture.wrapT | wrapT}, and on the exact mapping.
261 */
262export const LinearFilter: 1006;
263
264/**
265 * {@link LinearMipmapNearestFilter} chooses the mipmap that most closely matches the size of the pixel being textured and
266 * 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.
267 */
268export const LinearMipmapNearestFilter: 1007;
269/**
270 * {@link LinearMipMapNearestFilter} chooses the mipmap that most closely matches the size of the pixel being textured and
271 * 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.
272 */
273export const LinearMipMapNearestFilter: 1007;
274
275/**
276 * {@link LinearMipmapLinearFilter} is the default and chooses the two mipmaps that most closely match the size of the pixel being textured and
277 * uses the {@link LinearFilter} criterion to produce a texture value from each mipmap.
278 * The final texture value is a weighted average of those two values.
279 */
280export const LinearMipmapLinearFilter: 1008;
281
282/**
283 * {@link LinearMipMapLinearFilter} is the default and chooses the two mipmaps that most closely match the size of the pixel being textured and
284 * uses the {@link LinearFilter} criterion to produce a texture value from each mipmap.
285 * The final texture value is a weighted average of those two values.
286 */
287export const LinearMipMapLinearFilter: 1008;
288
289/**
290 * Texture Magnification Filter Modes.
291 * For use with a texture's {@link THREE.Texture.magFilter | magFilter} property,
292 * 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).
293 * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
294 * @see {@link https://sbcode.net/threejs/mipmaps/ | Texture Mipmaps (non-official)}
295 */
296export type MagnificationTextureFilter = typeof NearestFilter | typeof LinearFilter;
297
298/**
299 * Texture Minification Filter Modes.
300 * For use with a texture's {@link THREE.Texture.minFilter | minFilter} property,
301 * these define the texture minifying function that is used whenever the pixel being textured maps to an area greater than one texture element (texel).
302 * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
303 * @see {@link https://sbcode.net/threejs/mipmaps/ | Texture Mipmaps (non-official)}
304 */
305export type MinificationTextureFilter =
306 | typeof NearestFilter
307 | typeof NearestMipmapNearestFilter
308 | typeof NearestMipMapNearestFilter
309 | typeof NearestMipmapLinearFilter
310 | typeof NearestMipMapLinearFilter
311 | typeof LinearFilter
312 | typeof LinearMipmapNearestFilter
313 | typeof LinearMipMapNearestFilter
314 | typeof LinearMipmapLinearFilter
315 | typeof LinearMipMapLinearFilter;
316
317/**
318 * Texture all Magnification and Minification Filter Modes.
319 * @see {@link MagnificationTextureFilter} and {@link MinificationTextureFilter}
320 * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
321 * @see {@link https://sbcode.net/threejs/mipmaps/ | Texture Mipmaps (non-official)}
322 */
323export type TextureFilter = MagnificationTextureFilter | MinificationTextureFilter;
324
325///////////////////////////////////////////////////////////////////////////////
326// Data types
327
328export const UnsignedByteType: 1009;
329export const ByteType: 1010;
330export const ShortType: 1011;
331export const UnsignedShortType: 1012;
332export const IntType: 1013;
333export const UnsignedIntType: 1014;
334export const FloatType: 1015;
335export const HalfFloatType: 1016;
336export const UnsignedShort4444Type: 1017;
337export const UnsignedShort5551Type: 1018;
338export const UnsignedInt248Type: 1020;
339export const UnsignedInt5999Type: 35902;
340
341export type AttributeGPUType = typeof FloatType | typeof IntType;
342
343/**
344 * Texture Types.
345 * @remarks Must correspond to the correct {@link PixelFormat | format}.
346 * @see {@link THREE.Texture.type}
347 * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
348 */
349export type TextureDataType =
350 | typeof UnsignedByteType
351 | typeof ByteType
352 | typeof ShortType
353 | typeof UnsignedShortType
354 | typeof IntType
355 | typeof UnsignedIntType
356 | typeof FloatType
357 | typeof HalfFloatType
358 | typeof UnsignedShort4444Type
359 | typeof UnsignedShort5551Type
360 | typeof UnsignedInt248Type
361 | typeof UnsignedInt5999Type;
362
363///////////////////////////////////////////////////////////////////////////////
364// Pixel formats
365
366/** {@link AlphaFormat} discards the red, green and blue components and reads just the alpha component. */
367export const AlphaFormat: 1021;
368
369export const RGBFormat: 1022;
370
371/** {@link RGBAFormat} is the default and reads the red, green, blue and alpha components. */
372export const RGBAFormat: 1023;
373
374/**
375 * {@link LuminanceFormat} reads each element as a single luminance component.
376 * This is then converted to a floating point, clamped to the range `[0,1]`, and then assembled into an RGBA element by
377 * placing the luminance value in the red, green and blue channels, and attaching `1.0` to the alpha channel.
378 */
379export const LuminanceFormat: 1024;
380
381/**
382 * {@link LuminanceAlphaFormat} reads each element as a luminance/alpha double.
383 * The same process occurs as for the {@link LuminanceFormat}, except that the alpha channel may have values other than `1.0`.
384 */
385export const LuminanceAlphaFormat: 1025;
386
387/**
388 * {@link DepthFormat} reads each element as a single depth value, converts it to floating point, and clamps to the range `[0,1]`.
389 * @remarks This is the default for {@link THREE.DepthTexture}.
390 */
391export const DepthFormat: 1026;
392
393/**
394 * {@link DepthStencilFormat} reads each element is a pair of depth and stencil values.
395 * The depth component of the pair is interpreted as in {@link DepthFormat}.
396 * The stencil component is interpreted based on the depth + stencil internal format.
397 */
398export const DepthStencilFormat: 1027;
399
400/**
401 * {@link RedFormat} discards the green and blue components and reads just the red component.
402 */
403export const RedFormat: 1028;
404
405/**
406 * {@link RedIntegerFormat} discards the green and blue components and reads just the red component.
407 * The texels are read as integers instead of floating point.
408 */
409export const RedIntegerFormat: 1029;
410
411/**
412 * {@link RGFormat} discards the alpha, and blue components and reads the red, and green components.
413 */
414export const RGFormat: 1030;
415
416/**
417 * {@link RGIntegerFormat} discards the alpha, and blue components and reads the red, and green components.
418 * The texels are read as integers instead of floating point.
419 */
420export const RGIntegerFormat: 1031;
421
422/**
423 * {@link RGBIntegerFormat} discrads the alpha components and reads the red, green, and blue components.
424 */
425export const RGBIntegerFormat: 1032;
426
427/**
428 * {@link RGBAIntegerFormat} reads the red, green, blue and alpha component
429 * @remarks This is the default for {@link THREE.Texture}.
430 */
431export const RGBAIntegerFormat: 1033;
432
433/**
434 * All Texture Pixel Formats Modes.
435 * @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
436 * @see {@link WebGLRenderingContext.texImage2D} for details.
437 * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
438 */
439export type PixelFormat =
440 | typeof AlphaFormat
441 | typeof RGBFormat
442 | typeof RGBAFormat
443 | typeof LuminanceFormat
444 | typeof LuminanceAlphaFormat
445 | typeof DepthFormat
446 | typeof DepthStencilFormat
447 | typeof RedFormat
448 | typeof RedIntegerFormat
449 | typeof RGFormat
450 | typeof RGIntegerFormat
451 | typeof RGBIntegerFormat
452 | typeof RGBAIntegerFormat;
453
454/**
455 * All Texture Pixel Formats Modes for {@link THREE.DepthTexture}.
456 * @see {@link WebGLRenderingContext.texImage2D} for details.
457 * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
458 */
459export type DepthTexturePixelFormat = typeof DepthFormat | typeof DepthStencilFormat;
460
461///////////////////////////////////////////////////////////////////////////////
462// Compressed texture formats
463// DDS / ST3C Compressed texture formats
464
465/**
466 * A DXT1-compressed image in an RGB image format.
467 * @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
468 */
469export const RGB_S3TC_DXT1_Format: 33776;
470/**
471 * A DXT1-compressed image in an RGB image format with a simple on/off alpha value.
472 * @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
473 */
474export const RGBA_S3TC_DXT1_Format: 33777;
475/**
476 * A DXT3-compressed image in an RGBA image format. Compared to a 32-bit RGBA texture, it offers 4:1 compression.
477 * @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
478 */
479export const RGBA_S3TC_DXT3_Format: 33778;
480/**
481 * 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.
482 * @remarks Require support for the _WEBGL_compressed_texture_s3tc_ WebGL extension.
483 */
484export const RGBA_S3TC_DXT5_Format: 33779;
485
486// PVRTC compressed './texture formats
487
488/**
489 * RGB compression in 4-bit mode. One block for each 4×4 pixels.
490 * @remarks Require support for the _WEBGL_compressed_texture_pvrtc_ WebGL extension.
491 */
492export const RGB_PVRTC_4BPPV1_Format: 35840;
493/**
494 * RGB compression in 2-bit mode. One block for each 8×4 pixels.
495 * @remarks Require support for the _WEBGL_compressed_texture_pvrtc_ WebGL extension.
496 */
497export const RGB_PVRTC_2BPPV1_Format: 35841;
498/**
499 * RGBA compression in 4-bit mode. One block for each 4×4 pixels.
500 * @remarks Require support for the _WEBGL_compressed_texture_pvrtc_ WebGL extension.
501 */
502export const RGBA_PVRTC_4BPPV1_Format: 35842;
503/**
504 * RGBA compression in 2-bit mode. One block for each 8×4 pixels.
505 * @remarks Require support for the _WEBGL_compressed_texture_pvrtc_ WebGL extension.
506 */
507export const RGBA_PVRTC_2BPPV1_Format: 35843;
508
509// ETC compressed texture formats
510
511/**
512 * @remarks Require support for the _WEBGL_compressed_texture_etc1_ (ETC1) or _WEBGL_compressed_texture_etc_ (ETC2) WebGL extension.
513 */
514export const RGB_ETC1_Format: 36196;
515/**
516 * @remarks Require support for the _WEBGL_compressed_texture_etc1_ (ETC1) or _WEBGL_compressed_texture_etc_ (ETC2) WebGL extension.
517 */
518export const RGB_ETC2_Format: 37492;
519/**
520 * @remarks Require support for the _WEBGL_compressed_texture_etc1_ (ETC1) or _WEBGL_compressed_texture_etc_ (ETC2) WebGL extension.
521 */
522export const RGBA_ETC2_EAC_Format: 37496;
523
524// ASTC compressed texture formats
525
526/**
527 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
528 */
529export const RGBA_ASTC_4x4_Format: 37808;
530/**
531 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
532 */
533export const RGBA_ASTC_5x4_Format: 37809;
534/**
535 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
536 */
537export const RGBA_ASTC_5x5_Format: 37810;
538/**
539 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
540 */
541export const RGBA_ASTC_6x5_Format: 37811;
542/**
543 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
544 */
545export const RGBA_ASTC_6x6_Format: 37812;
546/**
547 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
548 */
549export const RGBA_ASTC_8x5_Format: 37813;
550/**
551 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
552 */
553export const RGBA_ASTC_8x6_Format: 37814;
554/**
555 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
556 */
557export const RGBA_ASTC_8x8_Format: 37815;
558/**
559 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
560 */
561export const RGBA_ASTC_10x5_Format: 37816;
562/**
563 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
564 */
565export const RGBA_ASTC_10x6_Format: 37817;
566/**
567 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
568 */
569export const RGBA_ASTC_10x8_Format: 37818;
570/**
571 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
572 */
573export const RGBA_ASTC_10x10_Format: 37819;
574/**
575 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
576 */
577export const RGBA_ASTC_12x10_Format: 37820;
578/**
579 * @remarks Require support for the _WEBGL_compressed_texture_astc_ WebGL extension.
580 */
581export const RGBA_ASTC_12x12_Format: 37821;
582
583// BPTC compressed texture formats
584
585/**
586 * @remarks Require support for the _EXT_texture_compression_bptc_ WebGL extension.
587 */
588export const RGBA_BPTC_Format: 36492;
589export const RGB_BPTC_SIGNED_Format = 36494;
590export const RGB_BPTC_UNSIGNED_Format = 36495;
591
592// RGTC compressed texture formats
593export const RED_RGTC1_Format: 36283;
594export const SIGNED_RED_RGTC1_Format: 36284;
595export const RED_GREEN_RGTC2_Format: 36285;
596export const SIGNED_RED_GREEN_RGTC2_Format: 36286;
597
598/**
599 * For use with a {@link THREE.CompressedTexture}'s {@link THREE.CompressedTexture.format | .format} property.
600 * @remarks Compressed Require support for correct WebGL extension.
601 */
602export type CompressedPixelFormat =
603 | typeof RGB_S3TC_DXT1_Format
604 | typeof RGBA_S3TC_DXT1_Format
605 | typeof RGBA_S3TC_DXT3_Format
606 | typeof RGBA_S3TC_DXT5_Format
607 | typeof RGB_PVRTC_4BPPV1_Format
608 | typeof RGB_PVRTC_2BPPV1_Format
609 | typeof RGBA_PVRTC_4BPPV1_Format
610 | typeof RGBA_PVRTC_2BPPV1_Format
611 | typeof RGB_ETC1_Format
612 | typeof RGB_ETC2_Format
613 | typeof RGBA_ETC2_EAC_Format
614 | typeof RGBA_ASTC_4x4_Format
615 | typeof RGBA_ASTC_5x4_Format
616 | typeof RGBA_ASTC_5x5_Format
617 | typeof RGBA_ASTC_6x5_Format
618 | typeof RGBA_ASTC_6x6_Format
619 | typeof RGBA_ASTC_8x5_Format
620 | typeof RGBA_ASTC_8x6_Format
621 | typeof RGBA_ASTC_8x8_Format
622 | typeof RGBA_ASTC_10x5_Format
623 | typeof RGBA_ASTC_10x6_Format
624 | typeof RGBA_ASTC_10x8_Format
625 | typeof RGBA_ASTC_10x10_Format
626 | typeof RGBA_ASTC_12x10_Format
627 | typeof RGBA_ASTC_12x12_Format
628 | typeof RGBA_BPTC_Format
629 | typeof RGB_BPTC_SIGNED_Format
630 | typeof RGB_BPTC_UNSIGNED_Format
631 | typeof RED_RGTC1_Format
632 | typeof SIGNED_RED_RGTC1_Format
633 | typeof RED_GREEN_RGTC2_Format
634 | typeof SIGNED_RED_GREEN_RGTC2_Format;
635
636///////////////////////////////////////////////////////////////////////////////
637
638/**
639 * All Possible Texture Pixel Formats Modes. For any Type or SubType of Textures.
640 * @remarks Note that the texture must have the correct {@link THREE.Texture.type} set, as described in {@link TextureDataType}.
641 * @see {@link WebGLRenderingContext.texImage2D} for details.
642 * @see {@link PixelFormat} and {@link DepthTexturePixelFormat} and {@link CompressedPixelFormat}
643 * @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
644 */
645export type AnyPixelFormat = PixelFormat | DepthTexturePixelFormat | CompressedPixelFormat;
646
647///////////////////////////////////////////////////////////////////////////////
648// Loop styles for AnimationAction
649export const LoopOnce: 2200;
650export const LoopRepeat: 2201;
651export const LoopPingPong: 2202;
652export type AnimationActionLoopStyles = typeof LoopOnce | typeof LoopRepeat | typeof LoopPingPong;
653
654// Interpolation
655export const InterpolateDiscrete: 2300;
656export const InterpolateLinear: 2301;
657export const InterpolateSmooth: 2302;
658export type InterpolationModes = typeof InterpolateDiscrete | typeof InterpolateLinear | typeof InterpolateSmooth;
659
660// Interpolant ending modes
661export const ZeroCurvatureEnding: 2400;
662export const ZeroSlopeEnding: 2401;
663export const WrapAroundEnding: 2402;
664export type InterpolationEndingModes = typeof ZeroCurvatureEnding | typeof ZeroSlopeEnding | typeof WrapAroundEnding;
665
666// Animation blending modes
667export const NormalAnimationBlendMode: 2500;
668export const AdditiveAnimationBlendMode: 2501;
669export type AnimationBlendMode = typeof NormalAnimationBlendMode | typeof AdditiveAnimationBlendMode;
670
671// Triangle Draw modes
672export const TrianglesDrawMode: 0;
673export const TriangleStripDrawMode: 1;
674export const TriangleFanDrawMode: 2;
675export type TrianglesDrawModes = typeof TrianglesDrawMode | typeof TriangleStripDrawMode | typeof TriangleFanDrawMode;
676
677///////////////////////////////////////////////////////////////////////////////
678// Depth packing strategies
679
680export const BasicDepthPacking: 3200;
681export const RGBADepthPacking: 3201;
682export const RGBDepthPacking: 3202;
683export const RGDepthPacking: 3203;
684export type DepthPackingStrategies =
685 | typeof BasicDepthPacking
686 | typeof RGBADepthPacking
687 | typeof RGBDepthPacking
688 | typeof RGDepthPacking;
689
690///////////////////////////////////////////////////////////////////////////////
691// Normal Map types
692
693export const TangentSpaceNormalMap: 0;
694export const ObjectSpaceNormalMap: 1;
695export type NormalMapTypes = typeof TangentSpaceNormalMap | typeof ObjectSpaceNormalMap;
696
697export const NoColorSpace: "";
698export const SRGBColorSpace: "srgb";
699export const LinearSRGBColorSpace: "srgb-linear";
700export type ColorSpace =
701 | typeof NoColorSpace
702 | typeof SRGBColorSpace
703 | typeof LinearSRGBColorSpace;
704
705export const LinearTransfer: "linear";
706export const SRGBTransfer: "srgb";
707export type ColorSpaceTransfer = typeof LinearTransfer | typeof SRGBTransfer;
708
709// Stencil Op types
710export const ZeroStencilOp: 0;
711export const KeepStencilOp: 7680;
712export const ReplaceStencilOp: 7681;
713export const IncrementStencilOp: 7682;
714export const DecrementStencilOp: 7283;
715export const IncrementWrapStencilOp: 34055;
716export const DecrementWrapStencilOp: 34056;
717export const InvertStencilOp: 5386;
718export type StencilOp =
719 | typeof ZeroStencilOp
720 | typeof KeepStencilOp
721 | typeof ReplaceStencilOp
722 | typeof IncrementStencilOp
723 | typeof DecrementStencilOp
724 | typeof IncrementWrapStencilOp
725 | typeof DecrementWrapStencilOp
726 | typeof InvertStencilOp;
727
728// Stencil Func types
729export const NeverStencilFunc: 512;
730export const LessStencilFunc: 513;
731export const EqualStencilFunc: 514;
732export const LessEqualStencilFunc: 515;
733export const GreaterStencilFunc: 516;
734export const NotEqualStencilFunc: 517;
735export const GreaterEqualStencilFunc: 518;
736export const AlwaysStencilFunc: 519;
737export type StencilFunc =
738 | typeof NeverStencilFunc
739 | typeof LessStencilFunc
740 | typeof EqualStencilFunc
741 | typeof LessEqualStencilFunc
742 | typeof GreaterStencilFunc
743 | typeof NotEqualStencilFunc
744 | typeof GreaterEqualStencilFunc
745 | typeof AlwaysStencilFunc;
746
747export const NeverCompare: 512;
748export const LessCompare: 513;
749export const EqualCompare: 514;
750export const LessEqualCompare: 515;
751export const GreaterCompare: 516;
752export const NotEqualCompare: 517;
753export const GreaterEqualCompare: 518;
754export const AlwaysCompare: 519;
755export type TextureComparisonFunction =
756 | typeof NeverCompare
757 | typeof LessCompare
758 | typeof EqualCompare
759 | typeof LessEqualCompare
760 | typeof GreaterCompare
761 | typeof NotEqualCompare
762 | typeof GreaterEqualCompare
763 | typeof AlwaysCompare;
764
765// usage types
766export const StaticDrawUsage: 35044;
767export const DynamicDrawUsage: 35048;
768export const StreamDrawUsage: 35040;
769export const StaticReadUsage: 35045;
770export const DynamicReadUsage: 35049;
771export const StreamReadUsage: 35041;
772export const StaticCopyUsage: 35046;
773export const DynamicCopyUsage: 35050;
774export const StreamCopyUsage: 35042;
775export type Usage =
776 | typeof StaticDrawUsage
777 | typeof DynamicDrawUsage
778 | typeof StreamDrawUsage
779 | typeof StaticReadUsage
780 | typeof DynamicReadUsage
781 | typeof StreamReadUsage
782 | typeof StaticCopyUsage
783 | typeof DynamicCopyUsage
784 | typeof StreamCopyUsage;
785
786export const GLSL1: "100";
787export const GLSL3: "300 es";
788export type GLSLVersion = typeof GLSL1 | typeof GLSL3;
789
790export const WebGLCoordinateSystem: 2000;
791export const WebGPUCoordinateSystem: 2001;
792export type CoordinateSystem = typeof WebGLCoordinateSystem | typeof WebGPUCoordinateSystem;
793
794///////////////////////////////////////////////////////////////////////////////
795// Texture - Internal Pixel Formats
796
797/**
798 * 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.
799 * - `R8` stores the red component on 8 bits.
800 * - `R8_SNORM` stores the red component on 8 bits. The component is stored as normalized.
801 * - `R8I` stores the red component on 8 bits. The component is stored as an integer.
802 * - `R8UI` stores the red component on 8 bits. The component is stored as an unsigned integer.
803 * - `R16I` stores the red component on 16 bits. The component is stored as an integer.
804 * - `R16UI` stores the red component on 16 bits. The component is stored as an unsigned integer.
805 * - `R16F` stores the red component on 16 bits. The component is stored as floating point.
806 * - `R32I` stores the red component on 32 bits. The component is stored as an integer.
807 * - `R32UI` stores the red component on 32 bits. The component is stored as an unsigned integer.
808 * - `R32F` stores the red component on 32 bits. The component is stored as floating point.
809 * - `RG8` stores the red and green components on 8 bits each.
810 * - `RG8_SNORM` stores the red and green components on 8 bits each. Every component is stored as normalized.
811 * - `RG8I` stores the red and green components on 8 bits each. Every component is stored as an integer.
812 * - `RG8UI` stores the red and green components on 8 bits each. Every component is stored as an unsigned integer.
813 * - `RG16I` stores the red and green components on 16 bits each. Every component is stored as an integer.
814 * - `RG16UI` stores the red and green components on 16 bits each. Every component is stored as an unsigned integer.
815 * - `RG16F` stores the red and green components on 16 bits each. Every component is stored as floating point.
816 * - `RG32I` stores the red and green components on 32 bits each. Every component is stored as an integer.
817 * - `RG32UI` stores the red and green components on 32 bits. Every component is stored as an unsigned integer.
818 * - `RG32F` stores the red and green components on 32 bits. Every component is stored as floating point.
819 * - `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.
820 * - `RGB8I` stores the red, green, and blue components on 8 bits each. Every component is stored as an integer.
821 * - `RGB8UI` stores the red, green, and blue components on 8 bits each. Every component is stored as an unsigned integer.
822 * - `RGB16I` stores the red, green, and blue components on 16 bits each. Every component is stored as an integer.
823 * - `RGB16UI` stores the red, green, and blue components on 16 bits each. Every component is stored as an unsigned integer.
824 * - `RGB16F` stores the red, green, and blue components on 16 bits each. Every component is stored as floating point
825 * - `RGB32I` stores the red, green, and blue components on 32 bits each. Every component is stored as an integer.
826 * - `RGB32UI` stores the red, green, and blue components on 32 bits each. Every component is stored as an unsigned integer.
827 * - `RGB32F` stores the red, green, and blue components on 32 bits each. Every component is stored as floating point
828 * - `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.
829 * - `RGB565` stores the red, green, and blue components respectively on 5 bits, 6 bits, and 5 bits.
830 * - `RGB9_E5` stores the red, green, and blue components on 9 bits each.
831 * - `RGBA8` stores the red, green, blue, and alpha components on 8 bits each.
832 * - `RGBA8_SNORM` stores the red, green, blue, and alpha components on 8 bits. Every component is stored as normalized.
833 * - `RGBA8I` stores the red, green, blue, and alpha components on 8 bits each. Every component is stored as an integer.
834 * - `RGBA8UI` stores the red, green, blue, and alpha components on 8 bits. Every component is stored as an unsigned integer.
835 * - `RGBA16I` stores the red, green, blue, and alpha components on 16 bits. Every component is stored as an integer.
836 * - `RGBA16UI` stores the red, green, blue, and alpha components on 16 bits. Every component is stored as an unsigned integer.
837 * - `RGBA16F` stores the red, green, blue, and alpha components on 16 bits. Every component is stored as floating point.
838 * - `RGBA32I` stores the red, green, blue, and alpha components on 32 bits. Every component is stored as an integer.
839 * - `RGBA32UI` stores the red, green, blue, and alpha components on 32 bits. Every component is stored as an unsigned integer.
840 * - `RGBA32F` stores the red, green, blue, and alpha components on 32 bits. Every component is stored as floating point.
841 * - `RGB5_A1` stores the red, green, blue, and alpha components respectively on 5 bits, 5 bits, 5 bits, and 1 bit.
842 * - `RGB10_A2` stores the red, green, blue, and alpha components respectively on 10 bits, 10 bits, 10 bits and 2 bits.
843 * - `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.
844 * - `SRGB8` stores the red, green, and blue components on 8 bits each.
845 * - `SRGB8_ALPHA8` stores the red, green, blue, and alpha components on 8 bits each.
846 * - `DEPTH_COMPONENT16` stores the depth component on 16bits.
847 * - `DEPTH_COMPONENT24` stores the depth component on 24bits.
848 * - `DEPTH_COMPONENT32F` stores the depth component on 32bits. The component is stored as floating point.
849 * - `DEPTH24_STENCIL8` stores the depth, and stencil components respectively on 24 bits and 8 bits. The stencil component is stored as an unsigned integer.
850 * - `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.
851 * @remark Note that the texture must have the correct {@link THREE.Texture.type} set, as well as the correct {@link THREE.Texture.format}.
852 * @see {@link WebGLRenderingContext.texImage2D} and {@link WebGLRenderingContext.texImage3D} for more details regarding the possible combination
853 * of {@link THREE.Texture.format}, {@link THREE.Texture.internalFormat}, and {@link THREE.Texture.type}.
854 * @see {@link https://registry.khronos.org/webgl/specs/latest/2.0/ | WebGL2 Specification} and
855 * {@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.
856 */
857export type PixelFormatGPU =
858 | "ALPHA"
859 | "RGB"
860 | "RGBA"
861 | "LUMINANCE"
862 | "LUMINANCE_ALPHA"
863 | "RED_INTEGER"
864 | "R8"
865 | "R8_SNORM"
866 | "R8I"
867 | "R8UI"
868 | "R16I"
869 | "R16UI"
870 | "R16F"
871 | "R32I"
872 | "R32UI"
873 | "R32F"
874 | "RG8"
875 | "RG8_SNORM"
876 | "RG8I"
877 | "RG8UI"
878 | "RG16I"
879 | "RG16UI"
880 | "RG16F"
881 | "RG32I"
882 | "RG32UI"
883 | "RG32F"
884 | "RGB565"
885 | "RGB8"
886 | "RGB8_SNORM"
887 | "RGB8I"
888 | "RGB8UI"
889 | "RGB16I"
890 | "RGB16UI"
891 | "RGB16F"
892 | "RGB32I"
893 | "RGB32UI"
894 | "RGB32F"
895 | "RGB9_E5"
896 | "SRGB8"
897 | "R11F_G11F_B10F"
898 | "RGBA4"
899 | "RGBA8"
900 | "RGBA8_SNORM"
901 | "RGBA8I"
902 | "RGBA8UI"
903 | "RGBA16I"
904 | "RGBA16UI"
905 | "RGBA16F"
906 | "RGBA32I"
907 | "RGBA32UI"
908 | "RGBA32F"
909 | "RGB5_A1"
910 | "RGB10_A2"
911 | "RGB10_A2UI"
912 | "SRGB8_ALPHA8"
913 | "SRGB8"
914 | "DEPTH_COMPONENT16"
915 | "DEPTH_COMPONENT24"
916 | "DEPTH_COMPONENT32F"
917 | "DEPTH24_STENCIL8"
918 | "DEPTH32F_STENCIL8";