@types/three 0.136.1 → 0.139.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 (143) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/{WebGL.d.ts → capabilities/WebGL.d.ts} +3 -1
  3. three/examples/jsm/controls/OrbitControls.d.ts +4 -1
  4. three/examples/jsm/curves/CurveExtras.d.ts +52 -54
  5. three/examples/jsm/exporters/EXRExporter.d.ts +21 -0
  6. three/examples/jsm/geometries/ConvexGeometry.d.ts +1 -1
  7. three/examples/jsm/helpers/OctreeHelper.d.ts +14 -0
  8. three/examples/jsm/interactive/HTMLMesh.d.ts +1 -0
  9. three/examples/jsm/loaders/GLTFLoader.d.ts +2 -9
  10. three/examples/jsm/loaders/LDrawLoader.d.ts +6 -0
  11. three/examples/jsm/loaders/LUT3dlLoader.d.ts +2 -2
  12. three/examples/jsm/loaders/LUTCubeLoader.d.ts +2 -2
  13. three/examples/jsm/loaders/VOXLoader.d.ts +2 -2
  14. three/examples/jsm/objects/Reflector.d.ts +1 -0
  15. three/examples/jsm/objects/Refractor.d.ts +1 -0
  16. three/examples/jsm/postprocessing/LUTPass.d.ts +3 -3
  17. three/examples/jsm/postprocessing/SSAARenderPass.d.ts +1 -1
  18. three/examples/jsm/utils/BufferGeometryUtils.d.ts +2 -0
  19. three/examples/jsm/utils/LDrawUtils.d.ts +5 -0
  20. three/examples/jsm/utils/PackedPhongMaterial.d.ts +10 -0
  21. three/examples/jsm/utils/SceneUtils.d.ts +13 -13
  22. three/index.d.ts +1 -1
  23. three/package.json +3 -3
  24. three/src/Three.d.ts +6 -0
  25. three/src/animation/AnimationUtils.d.ts +1 -1
  26. three/src/constants.d.ts +9 -19
  27. three/src/core/BufferGeometry.d.ts +0 -2
  28. three/src/core/InstancedBufferGeometry.d.ts +0 -4
  29. three/src/core/Raycaster.d.ts +3 -2
  30. three/src/core/Uniform.d.ts +0 -1
  31. three/src/extras/DataUtils.d.ts +1 -0
  32. three/src/extras/ImageUtils.d.ts +2 -0
  33. three/src/extras/PMREMGenerator.d.ts +2 -2
  34. three/src/geometries/CapsuleGeometry.d.ts +27 -0
  35. three/src/geometries/Geometries.d.ts +1 -0
  36. three/src/materials/Material.d.ts +0 -6
  37. three/src/materials/MeshStandardMaterial.d.ts +0 -6
  38. three/src/math/Box3.d.ts +2 -2
  39. three/src/math/Color.d.ts +21 -9
  40. three/src/math/ColorManagement.d.ts +18 -0
  41. three/src/math/Euler.d.ts +0 -1
  42. three/src/math/Plane.d.ts +0 -1
  43. three/src/math/Vector3.d.ts +5 -0
  44. three/src/renderers/WebGL3DRenderTarget.d.ts +28 -0
  45. three/src/renderers/WebGLArrayRenderTarget.d.ts +28 -0
  46. three/src/renderers/WebGLMultipleRenderTargets.d.ts +9 -1
  47. three/src/renderers/WebGLMultisampleRenderTarget.d.ts +5 -12
  48. three/src/renderers/WebGLRenderTarget.d.ts +7 -2
  49. three/src/renderers/WebGLRenderer.d.ts +4 -5
  50. three/src/renderers/webgl/WebGLUtils.d.ts +3 -1
  51. three/src/renderers/webxr/WebXRManager.d.ts +1 -1
  52. three/src/scenes/Scene.d.ts +0 -15
  53. three/src/textures/CompressedTexture.d.ts +2 -1
  54. three/src/textures/CubeTexture.d.ts +1 -1
  55. three/src/textures/Data3DTexture.d.ts +33 -0
  56. three/src/textures/DataArrayTexture.d.ts +33 -0
  57. three/src/textures/DataTexture.d.ts +2 -1
  58. three/src/textures/DataTexture2DArray.d.ts +5 -32
  59. three/src/textures/DataTexture3D.d.ts +5 -32
  60. three/src/textures/DepthTexture.d.ts +2 -1
  61. three/src/textures/Source.d.ts +39 -0
  62. three/src/textures/Texture.d.ts +30 -3
  63. three/src/textures/VideoTexture.d.ts +1 -1
  64. three/examples/jsm/loaders/VRMLoader.d.ts +0 -19
  65. three/examples/jsm/nodes/Nodes.d.ts +0 -106
  66. three/examples/jsm/nodes/accessors/CameraNode.d.ts +0 -29
  67. three/examples/jsm/nodes/accessors/ColorsNode.d.ts +0 -10
  68. three/examples/jsm/nodes/accessors/LightNode.d.ts +0 -12
  69. three/examples/jsm/nodes/accessors/NormalNode.d.ts +0 -13
  70. three/examples/jsm/nodes/accessors/PositionNode.d.ts +0 -15
  71. three/examples/jsm/nodes/accessors/ReflectNode.d.ts +0 -12
  72. three/examples/jsm/nodes/accessors/ResolutionNode.d.ts +0 -14
  73. three/examples/jsm/nodes/accessors/ScreenUVNode.d.ts +0 -11
  74. three/examples/jsm/nodes/accessors/UVNode.d.ts +0 -10
  75. three/examples/jsm/nodes/core/AttributeNode.d.ts +0 -13
  76. three/examples/jsm/nodes/core/ConstNode.d.ts +0 -22
  77. three/examples/jsm/nodes/core/ExpressionNode.d.ts +0 -5
  78. three/examples/jsm/nodes/core/FunctionCallNode.d.ts +0 -17
  79. three/examples/jsm/nodes/core/FunctionNode.d.ts +0 -28
  80. three/examples/jsm/nodes/core/InputNode.d.ts +0 -12
  81. three/examples/jsm/nodes/core/Node.d.ts +0 -34
  82. three/examples/jsm/nodes/core/NodeBuilder.d.ts +0 -149
  83. three/examples/jsm/nodes/core/NodeFrame.d.ts +0 -17
  84. three/examples/jsm/nodes/core/NodeLib.d.ts +0 -22
  85. three/examples/jsm/nodes/core/NodeUniform.d.ts +0 -17
  86. three/examples/jsm/nodes/core/NodeUtils.d.ts +0 -7
  87. three/examples/jsm/nodes/core/StructNode.d.ts +0 -19
  88. three/examples/jsm/nodes/core/TempNode.d.ts +0 -23
  89. three/examples/jsm/nodes/core/VarNode.d.ts +0 -12
  90. three/examples/jsm/nodes/effects/BlurNode.d.ts +0 -31
  91. three/examples/jsm/nodes/effects/ColorAdjustmentNode.d.ts +0 -27
  92. three/examples/jsm/nodes/effects/LuminanceNode.d.ts +0 -18
  93. three/examples/jsm/nodes/inputs/BoolNode.d.ts +0 -19
  94. three/examples/jsm/nodes/inputs/ColorNode.d.ts +0 -21
  95. three/examples/jsm/nodes/inputs/CubeTextureNode.d.ts +0 -17
  96. three/examples/jsm/nodes/inputs/FloatNode.d.ts +0 -19
  97. three/examples/jsm/nodes/inputs/IntNode.d.ts +0 -19
  98. three/examples/jsm/nodes/inputs/Matrix3Node.d.ts +0 -22
  99. three/examples/jsm/nodes/inputs/Matrix4Node.d.ts +0 -22
  100. three/examples/jsm/nodes/inputs/PropertyNode.d.ts +0 -10
  101. three/examples/jsm/nodes/inputs/RTTNode.d.ts +0 -27
  102. three/examples/jsm/nodes/inputs/ReflectorNode.d.ts +0 -21
  103. three/examples/jsm/nodes/inputs/ScreenNode.d.ts +0 -11
  104. three/examples/jsm/nodes/inputs/TextureNode.d.ts +0 -20
  105. three/examples/jsm/nodes/inputs/Vector2Node.d.ts +0 -21
  106. three/examples/jsm/nodes/inputs/Vector3Node.d.ts +0 -21
  107. three/examples/jsm/nodes/inputs/Vector4Node.d.ts +0 -21
  108. three/examples/jsm/nodes/materials/BasicNodeMaterial.d.ts +0 -11
  109. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +0 -21
  110. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +0 -28
  111. three/examples/jsm/nodes/materials/PhongNodeMaterial.d.ts +0 -21
  112. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +0 -12
  113. three/examples/jsm/nodes/materials/StandardNodeMaterial.d.ts +0 -25
  114. three/examples/jsm/nodes/materials/nodes/BasicNode.d.ts +0 -15
  115. three/examples/jsm/nodes/materials/nodes/MeshStandardNode.d.ts +0 -25
  116. three/examples/jsm/nodes/materials/nodes/PhongNode.d.ts +0 -14
  117. three/examples/jsm/nodes/materials/nodes/RawNode.d.ts +0 -10
  118. three/examples/jsm/nodes/materials/nodes/SpriteNode.d.ts +0 -13
  119. three/examples/jsm/nodes/materials/nodes/StandardNode.d.ts +0 -15
  120. three/examples/jsm/nodes/math/CondNode.d.ts +0 -26
  121. three/examples/jsm/nodes/math/MathNode.d.ts +0 -57
  122. three/examples/jsm/nodes/math/OperatorNode.d.ts +0 -17
  123. three/examples/jsm/nodes/misc/BumpMapNode.d.ts +0 -21
  124. three/examples/jsm/nodes/misc/NormalMapNode.d.ts +0 -19
  125. three/examples/jsm/nodes/misc/TextureCubeNode.d.ts +0 -21
  126. three/examples/jsm/nodes/misc/TextureCubeUVNode.d.ts +0 -18
  127. three/examples/jsm/nodes/postprocessing/NodePass.d.ts +0 -15
  128. three/examples/jsm/nodes/postprocessing/NodePostProcessing.d.ts +0 -26
  129. three/examples/jsm/nodes/procedural/CheckerNode.d.ts +0 -17
  130. three/examples/jsm/nodes/procedural/NoiseNode.d.ts +0 -17
  131. three/examples/jsm/nodes/utils/BypassNode.d.ts +0 -11
  132. three/examples/jsm/nodes/utils/ColorSpaceNode.d.ts +0 -55
  133. three/examples/jsm/nodes/utils/JoinNode.d.ts +0 -15
  134. three/examples/jsm/nodes/utils/MaxMIPLevelNode.d.ts +0 -11
  135. three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +0 -17
  136. three/examples/jsm/nodes/utils/SubSlot.d.ts +0 -9
  137. three/examples/jsm/nodes/utils/SwitchNode.d.ts +0 -11
  138. three/examples/jsm/nodes/utils/TimerNode.d.ts +0 -19
  139. three/examples/jsm/nodes/utils/UVTransformNode.d.ts +0 -15
  140. three/examples/jsm/nodes/utils/VelocityNode.d.ts +0 -28
  141. three/examples/jsm/objects/ReflectorRTT.d.ts +0 -6
  142. three/examples/jsm/postprocessing/SSRrPass.d.ts +0 -121
  143. three/examples/jsm/utils/RoughnessMipmapper.d.ts +0 -7
@@ -0,0 +1,27 @@
1
+ import { BufferGeometry } from '../core/BufferGeometry';
2
+
3
+ export class CapsuleGeometry extends BufferGeometry {
4
+ /**
5
+ * @param [radius=1] — Radius of the capsule.
6
+ * @param [length=1] — Length of the middle section.
7
+ * @param [capSegments=4] — Number of curve segments used to build the caps.
8
+ * @param [radialSegments=8] — Number of segmented faces around the circumference of the capsule.
9
+ */
10
+ constructor(radius?: number, length?: number, capSegments?: number, radialSegments?: number);
11
+
12
+ /**
13
+ * @default 'CapsuleGeometry'
14
+ */
15
+ type: string;
16
+
17
+ parameters: {
18
+ radius: number;
19
+ length: number;
20
+ capSegments: number;
21
+ radialSegments: number;
22
+ };
23
+
24
+ static fromJSON(data: any): CapsuleGeometry;
25
+ }
26
+
27
+ export { CapsuleGeometry as CapsuleBufferGeometry };
@@ -1,4 +1,5 @@
1
1
  export * from './BoxGeometry';
2
+ export * from './CapsuleGeometry';
2
3
  export * from './CircleGeometry';
3
4
  export * from './ConeGeometry';
4
5
  export * from './CylinderGeometry';
@@ -181,12 +181,6 @@ export class Material extends EventDispatcher {
181
181
  */
182
182
  fog: boolean;
183
183
 
184
- /**
185
- * When this property is set to THREE.RGBFormat, the material is considered to be opaque and alpha values are ignored.
186
- * @default THREE.RGBAFormat
187
- */
188
- format: PixelFormat;
189
-
190
184
  /**
191
185
  * Unique number of this material instance.
192
186
  */
@@ -30,7 +30,6 @@ export interface MeshStandardMaterialParameters extends MaterialParameters {
30
30
  alphaMap?: Texture | null | undefined;
31
31
  envMap?: Texture | null | undefined;
32
32
  envMapIntensity?: number | undefined;
33
- refractionRatio?: number | undefined;
34
33
  wireframe?: boolean | undefined;
35
34
  wireframeLinewidth?: number | undefined;
36
35
 
@@ -170,11 +169,6 @@ export class MeshStandardMaterial extends Material {
170
169
  */
171
170
  envMapIntensity: number;
172
171
 
173
- /**
174
- * @default 0.98
175
- */
176
- refractionRatio: number;
177
-
178
172
  /**
179
173
  * @default false
180
174
  */
three/src/math/Box3.d.ts CHANGED
@@ -25,7 +25,7 @@ export class Box3 {
25
25
  setFromBufferAttribute(bufferAttribute: BufferAttribute): this;
26
26
  setFromPoints(points: Vector3[]): this;
27
27
  setFromCenterAndSize(center: Vector3, size: Vector3): this;
28
- setFromObject(object: Object3D): this;
28
+ setFromObject(object: Object3D, precise?: boolean): this;
29
29
  clone(): this;
30
30
  copy(box: Box3): this;
31
31
  makeEmpty(): this;
@@ -35,7 +35,7 @@ export class Box3 {
35
35
  expandByPoint(point: Vector3): this;
36
36
  expandByVector(vector: Vector3): this;
37
37
  expandByScalar(scalar: number): this;
38
- expandByObject(object: Object3D): this;
38
+ expandByObject(object: Object3D, precise?: boolean): this;
39
39
  containsPoint(point: Vector3): boolean;
40
40
  containsBox(box: Box3): boolean;
41
41
  getParameter(point: Vector3, target: Vector3): Vector3;
three/src/math/Color.d.ts CHANGED
@@ -1,12 +1,22 @@
1
+ import { ColorSpace } from '../constants';
1
2
  import { ColorRepresentation } from '../utils';
3
+
2
4
  import { BufferAttribute } from './../core/BufferAttribute';
3
5
 
6
+ export { SRGBToLinear } from './ColorManagement';
7
+
4
8
  export interface HSL {
5
9
  h: number;
6
10
  s: number;
7
11
  l: number;
8
12
  }
9
13
 
14
+ export interface RGB {
15
+ r: number;
16
+ g: number;
17
+ b: number;
18
+ }
19
+
10
20
  /**
11
21
  * Represents a color. See also {@link ColorUtils}.
12
22
  *
@@ -41,7 +51,7 @@ export class Color {
41
51
 
42
52
  set(color: ColorRepresentation): Color;
43
53
  setScalar(scalar: number): Color;
44
- setHex(hex: number): Color;
54
+ setHex(hex: number, colorSpace?: ColorSpace): Color;
45
55
 
46
56
  /**
47
57
  * Sets this color from RGB values.
@@ -49,7 +59,7 @@ export class Color {
49
59
  * @param g Green channel value between 0 and 1.
50
60
  * @param b Blue channel value between 0 and 1.
51
61
  */
52
- setRGB(r: number, g: number, b: number): Color;
62
+ setRGB(r: number, g: number, b: number, colorSpace?: ColorSpace): Color;
53
63
 
54
64
  /**
55
65
  * Sets this color from HSL values.
@@ -59,20 +69,20 @@ export class Color {
59
69
  * @param s Saturation value channel between 0 and 1.
60
70
  * @param l Value channel value between 0 and 1.
61
71
  */
62
- setHSL(h: number, s: number, l: number): Color;
72
+ setHSL(h: number, s: number, l: number, colorSpace?: ColorSpace): Color;
63
73
 
64
74
  /**
65
75
  * Sets this color from a CSS context style string.
66
76
  * @param contextStyle Color in CSS context style format.
67
77
  */
68
- setStyle(style: string): Color;
78
+ setStyle(style: string, colorSpace?: ColorSpace): Color;
69
79
 
70
80
  /**
71
81
  * Sets this color from a color name.
72
82
  * Faster than {@link Color#setStyle .setStyle()} method if you don't need the other CSS-style formats.
73
83
  * @param style Color name in X11 format.
74
84
  */
75
- setColorName(style: string): Color;
85
+ setColorName(style: string, colorSpace?: ColorSpace): Color;
76
86
 
77
87
  /**
78
88
  * Clones this color.
@@ -110,20 +120,22 @@ export class Color {
110
120
  /**
111
121
  * Returns the hexadecimal value of this color.
112
122
  */
113
- getHex(): number;
123
+ getHex(colorSpace?: ColorSpace): number;
114
124
 
115
125
  /**
116
126
  * Returns the string formated hexadecimal value of this color.
117
127
  */
118
- getHexString(): string;
128
+ getHexString(colorSpace?: ColorSpace): string;
129
+
130
+ getHSL(target: HSL, colorSpace?: ColorSpace): HSL;
119
131
 
120
- getHSL(target: HSL): HSL;
132
+ getRGB(target: RGB, colorSpace?: ColorSpace): RGB;
121
133
 
122
134
  /**
123
135
  * Returns the value of this color in CSS context style.
124
136
  * Example: rgb(r, g, b)
125
137
  */
126
- getStyle(): string;
138
+ getStyle(colorSpace?: ColorSpace): string;
127
139
 
128
140
  offsetHSL(h: number, s: number, l: number): this;
129
141
 
@@ -0,0 +1,18 @@
1
+ import { LinearSRGBColorSpace, SRGBColorSpace } from '../constants';
2
+ import { Color } from './Color';
3
+
4
+ export function SRGBToLinear(c: number): number;
5
+
6
+ export function LinearToSRGB(c: number): number;
7
+
8
+ export namespace ColorManagement {
9
+ function convert(
10
+ color: Color,
11
+ sourceColorSpace: SRGBColorSpace | LinearSRGBColorSpace,
12
+ targetColorSpace: SRGBColorSpace | LinearSRGBColorSpace,
13
+ ): Color;
14
+
15
+ function fromWorkingColorSpace(color: Color, targetColorSpace: SRGBColorSpace | LinearSRGBColorSpace): Color;
16
+
17
+ function toWorkingColorSpace(color: Color, sourceColorSpace: SRGBColorSpace | LinearSRGBColorSpace): Color;
18
+ }
three/src/math/Euler.d.ts CHANGED
@@ -38,7 +38,6 @@ export class Euler {
38
38
  equals(euler: Euler): boolean;
39
39
  fromArray(xyzo: any[]): Euler;
40
40
  toArray(array?: number[], offset?: number): number[];
41
- toVector3(optionalResult?: Vector3): Vector3;
42
41
  _onChange(callback: () => void): this;
43
42
 
44
43
  static RotationOrders: string[];
three/src/math/Plane.d.ts CHANGED
@@ -31,7 +31,6 @@ export class Plane {
31
31
  distanceToPoint(point: Vector3): number;
32
32
  distanceToSphere(sphere: Sphere): number;
33
33
  projectPoint(point: Vector3, target: Vector3): Vector3;
34
- orthoPoint(point: Vector3, target: Vector3): Vector3;
35
34
  intersectLine(line: Line3, target: Vector3): Vector3 | null;
36
35
  intersectsLine(line: Line3): boolean;
37
36
  intersectsBox(box: Box3): boolean;
@@ -252,6 +252,11 @@ export class Vector3 implements Vector {
252
252
  setFromMatrixColumn(matrix: Matrix4, index: number): this;
253
253
  setFromMatrix3Column(matrix: Matrix3, index: number): this;
254
254
 
255
+ /**
256
+ * Sets this vector's {@link x}, {@link y} and {@link z} components from the x, y, and z components of the specified {@link Euler Euler Angle}.
257
+ */
258
+ setFromEuler(e: Euler): this;
259
+
255
260
  /**
256
261
  * Checks for strict equality of this vector and v.
257
262
  */
@@ -0,0 +1,28 @@
1
+ import { Data3DTexture } from '../textures/Data3DTexture';
2
+ import { WebGLRenderTarget } from './WebGLRenderTarget';
3
+
4
+ /**
5
+ * Represents a three-dimensional render target.
6
+ */
7
+ export class WebGL3DRenderTarget extends WebGLRenderTarget {
8
+ /**
9
+ * Creates a new WebGL3DRenderTarget.
10
+ *
11
+ * @param width the width of the render target, in pixels.
12
+ * @param height the height of the render target, in pixels.
13
+ * @param depth the depth of the render target.
14
+ */
15
+ constructor(width: number, height: number, depth: number);
16
+
17
+ /**
18
+ * The depth of the render target.
19
+ */
20
+ depth: number;
21
+
22
+ /**
23
+ * The texture property is overwritten with an instance of {@link Data3DTexture}.
24
+ */
25
+ texture: Data3DTexture;
26
+
27
+ readonly isWebGL3DRenderTarget: true;
28
+ }
@@ -0,0 +1,28 @@
1
+ import { DataArrayTexture } from '../textures/DataArrayTexture';
2
+ import { WebGLRenderTarget } from './WebGLRenderTarget';
3
+
4
+ /**
5
+ * This type of render target represents an array of textures.
6
+ */
7
+ export class WebGLArrayRenderTarget extends WebGLRenderTarget {
8
+ /**
9
+ * Creates a new WebGLArrayRenderTarget.
10
+ *
11
+ * @param width the width of the render target, in pixels.
12
+ * @param height the height of the render target, in pixels.
13
+ * @param depth the depth/layer count of the render target.
14
+ */
15
+ constructor(width: number, height: number, depth: number);
16
+
17
+ /**
18
+ * The depth of the render target.
19
+ */
20
+ depth: number;
21
+
22
+ /**
23
+ * The texture property is overwritten with an instance of {@link DataArrayTexture}.
24
+ */
25
+ texture: DataArrayTexture;
26
+
27
+ readonly isWebGLArrayRenderTarget: true;
28
+ }
@@ -1,5 +1,6 @@
1
1
  import { EventDispatcher } from '../core/EventDispatcher';
2
2
  import { Texture } from '../textures/Texture';
3
+ import { WebGLRenderTargetOptions } from './WebGLRenderTarget';
3
4
 
4
5
  /**
5
6
  * This class originall extended WebGLMultipleRenderTarget
@@ -10,7 +11,14 @@ export class WebGLMultipleRenderTargets extends EventDispatcher {
10
11
 
11
12
  readonly isWebGLMultipleRenderTargets = true;
12
13
 
13
- constructor(width: number, height: number, count: number);
14
+ /**
15
+ * @param width The width of the render target.
16
+ * @param height The height of the render target.
17
+ * @param count The number of render targets.
18
+ * @param options object that holds texture parameters for an auto-generated target texture and depthBuffer/stencilBuffer booleans.
19
+ * For an explanation of the texture parameters see {@link Texture}.
20
+ */
21
+ constructor(width: number, height: number, count: number, options?: WebGLRenderTargetOptions);
14
22
 
15
23
  setSize(width: number, height: number, depth?: number): this;
16
24
  copy(source: WebGLMultipleRenderTargets): this;
@@ -1,13 +1,6 @@
1
- import { WebGLRenderTarget, WebGLRenderTargetOptions } from './WebGLRenderTarget';
1
+ import { WebGLRenderTarget } from './WebGLRenderTarget';
2
2
 
3
- export class WebGLMultisampleRenderTarget extends WebGLRenderTarget {
4
- constructor(width: number, height: number, options?: WebGLRenderTargetOptions);
5
-
6
- readonly isWebGLMultisampleRenderTarget: true;
7
-
8
- /**
9
- * Specifies the number of samples to be used for the renderbuffer storage.However, the maximum supported size for multisampling is platform dependent and defined via gl.MAX_SAMPLES.
10
- * @default 4
11
- */
12
- samples: number;
13
- }
3
+ /**
4
+ * @deprecated THREE.WebGLMultisampleRenderTarget has been removed. Use a normal {@link WebGLRenderTarget render target} and set the "samples" property to greater 0 to enable multisampling.
5
+ */
6
+ export class WebGLMultisampleRenderTarget extends WebGLRenderTarget {}
@@ -22,7 +22,6 @@ export interface WebGLRenderTargetOptions {
22
22
  export class WebGLRenderTarget extends EventDispatcher {
23
23
  constructor(width: number, height: number, options?: WebGLRenderTargetOptions);
24
24
 
25
- uuid: string;
26
25
  width: number;
27
26
  height: number;
28
27
  depth: number;
@@ -49,6 +48,13 @@ export class WebGLRenderTarget extends EventDispatcher {
49
48
  * @default null
50
49
  */
51
50
  depthTexture: DepthTexture;
51
+
52
+ /**
53
+ * Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**.
54
+ * @default 0
55
+ */
56
+ samples: number;
57
+
52
58
  readonly isWebGLRenderTarget: true;
53
59
 
54
60
  /**
@@ -92,7 +98,6 @@ export class WebGLRenderTarget extends EventDispatcher {
92
98
  */
93
99
  generateMipmaps: any;
94
100
 
95
- setTexture(texture: Texture): void;
96
101
  setSize(width: number, height: number, depth?: number): void;
97
102
  clone(): this;
98
103
  copy(source: WebGLRenderTarget): this;
@@ -5,7 +5,6 @@ import { WebGLInfo } from './webgl/WebGLInfo';
5
5
  import { WebGLShadowMap } from './webgl/WebGLShadowMap';
6
6
  import { WebGLCapabilities } from './webgl/WebGLCapabilities';
7
7
  import { WebGLProperties } from './webgl/WebGLProperties';
8
- import { WebGLProgram } from './webgl/WebGLProgram';
9
8
  import { WebGLRenderLists } from './webgl/WebGLRenderLists';
10
9
  import { WebGLState } from './webgl/WebGLState';
11
10
  import { Vector2 } from './../math/Vector2';
@@ -19,11 +18,11 @@ import { ToneMapping, ShadowMapType, CullFace, TextureEncoding } from '../consta
19
18
  import { WebXRManager } from '../renderers/webxr/WebXRManager';
20
19
  import { BufferGeometry } from './../core/BufferGeometry';
21
20
  import { Texture } from '../textures/Texture';
22
- import { DataTexture3D } from '../textures/DataTexture3D';
21
+ import { Data3DTexture } from '../textures/Data3DTexture';
23
22
  import { XRAnimationLoopCallback } from './webxr/WebXR';
24
23
  import { Vector3 } from '../math/Vector3';
25
24
  import { Box3 } from '../math/Box3';
26
- import { DataTexture2DArray } from '../textures/DataTexture2DArray';
25
+ import { DataArrayTexture } from '../textures/DataArrayTexture';
27
26
  import { ColorRepresentation } from '../utils';
28
27
 
29
28
  export interface Renderer {
@@ -219,7 +218,7 @@ export class WebGLRenderer implements Renderer {
219
218
  /**
220
219
  * Return the WebGL context.
221
220
  */
222
- getContext(): WebGLRenderingContext;
221
+ getContext(): WebGLRenderingContext | WebGL2RenderingContext;
223
222
  getContextAttributes(): any;
224
223
  forceContextLoss(): void;
225
224
  forceContextRestore(): void;
@@ -437,7 +436,7 @@ export class WebGLRenderer implements Renderer {
437
436
  sourceBox: Box3,
438
437
  position: Vector3,
439
438
  srcTexture: Texture,
440
- dstTexture: DataTexture3D | DataTexture2DArray,
439
+ dstTexture: Data3DTexture | DataArrayTexture,
441
440
  level?: number,
442
441
  ): void;
443
442
 
@@ -1,5 +1,7 @@
1
+ import { CompressedPixelFormat, PixelFormat, TextureEncoding, TextureDataType } from '../../constants';
2
+
1
3
  export class WebGLUtils {
2
4
  constructor(gl: WebGLRenderingContext | WebGL2RenderingContext, extensions: any, capabilities: any);
3
5
 
4
- convert(p: any): void;
6
+ convert(p: PixelFormat | CompressedPixelFormat | TextureDataType, encoding?: TextureEncoding | null): number | null;
5
7
  }
@@ -25,7 +25,7 @@ export class WebXRManager extends EventDispatcher {
25
25
  getSession(): XRSession | null;
26
26
  setSession(value: XRSession): Promise<void>;
27
27
  getCamera(camera: Camera): Camera;
28
- setAnimationLoop(callback: XRFrameRequestCallback): void;
28
+ setAnimationLoop(callback: XRFrameRequestCallback | null): void;
29
29
  getFoveation(): number | undefined;
30
30
  setFoveation(foveation: number): void;
31
31
  dispose(): void;
@@ -45,20 +45,5 @@ export class Scene extends Object3D {
45
45
 
46
46
  readonly isScene: true;
47
47
 
48
- /**
49
- * Calls before rendering scene
50
- */
51
- onBeforeRender: (
52
- renderer: WebGLRenderer,
53
- scene: Scene,
54
- camera: Camera,
55
- renderTarget: any, // any required for Object3D.onBeforeRender compatibility
56
- ) => void;
57
-
58
- /**
59
- * Calls after rendering scene
60
- */
61
- onAfterRender: (renderer: WebGLRenderer, scene: Scene, camera: Camera) => void;
62
-
63
48
  toJSON(meta?: any): any;
64
49
  }
@@ -38,7 +38,8 @@ export class CompressedTexture extends Texture {
38
38
  encoding?: TextureEncoding,
39
39
  );
40
40
 
41
- image: { width: number; height: number };
41
+ get image(): { width: number; height: number };
42
+ set image(value: { width: number; height: number });
42
43
 
43
44
  mipmaps: ImageData[];
44
45
 
@@ -9,7 +9,7 @@ export class CubeTexture extends Texture {
9
9
  * @param [wrapT=THREE.ClampToEdgeWrapping]
10
10
  * @param [magFilter=THREE.LinearFilter]
11
11
  * @param [minFilter=THREE.LinearMipmapLinearFilter]
12
- * @param [format=THREE.RGBFormat]
12
+ * @param [format=THREE.RGBAFormat]
13
13
  * @param [type=THREE.UnsignedByteType]
14
14
  * @param [anisotropy=1]
15
15
  * @param [encoding=THREE.LinearEncoding]
@@ -0,0 +1,33 @@
1
+ import { Texture } from './Texture';
2
+ import { TextureFilter } from '../constants';
3
+
4
+ export class Data3DTexture extends Texture {
5
+ constructor(data: BufferSource, width: number, height: number, depth: number);
6
+
7
+ /**
8
+ * @default THREE.NearestFilter
9
+ */
10
+ magFilter: TextureFilter;
11
+
12
+ /**
13
+ * @default THREE.NearestFilter
14
+ */
15
+ minFilter: TextureFilter;
16
+
17
+ /**
18
+ * @default THREE.ClampToEdgeWrapping
19
+ */
20
+ wrapR: boolean;
21
+
22
+ /**
23
+ * @default false
24
+ */
25
+ flipY: boolean;
26
+
27
+ /**
28
+ * @default false
29
+ */
30
+ generateMipmaps: boolean;
31
+
32
+ readonly isData3DTexture: true;
33
+ }
@@ -0,0 +1,33 @@
1
+ import { Texture } from './Texture';
2
+ import { TextureFilter } from '../constants';
3
+
4
+ export class DataArrayTexture extends Texture {
5
+ constructor(data?: BufferSource, width?: number, height?: number, depth?: number);
6
+
7
+ /**
8
+ * @default THREE.NearestFilter
9
+ */
10
+ magFilter: TextureFilter;
11
+
12
+ /**
13
+ * @default THREE.NearestFilter
14
+ */
15
+ minFilter: TextureFilter;
16
+
17
+ /**
18
+ * @default THREE.ClampToEdgeWrapping
19
+ */
20
+ wrapR: boolean;
21
+
22
+ /**
23
+ * @default false
24
+ */
25
+ flipY: boolean;
26
+
27
+ /**
28
+ * @default false
29
+ */
30
+ generateMipmaps: boolean;
31
+
32
+ readonly isDataArrayTexture: true;
33
+ }
@@ -31,7 +31,8 @@ export class DataTexture extends Texture {
31
31
  encoding?: TextureEncoding,
32
32
  );
33
33
 
34
- image: ImageData;
34
+ get image(): ImageData;
35
+ set image(value: ImageData);
35
36
 
36
37
  /**
37
38
  * @default false
@@ -1,33 +1,6 @@
1
- import { Texture } from './Texture';
2
- import { TextureFilter } from '../constants';
1
+ import { DataArrayTexture } from './DataArrayTexture';
3
2
 
4
- export class DataTexture2DArray extends Texture {
5
- constructor(data?: BufferSource, width?: number, height?: number, depth?: number);
6
-
7
- /**
8
- * @default THREE.NearestFilter
9
- */
10
- magFilter: TextureFilter;
11
-
12
- /**
13
- * @default THREE.NearestFilter
14
- */
15
- minFilter: TextureFilter;
16
-
17
- /**
18
- * @default THREE.ClampToEdgeWrapping
19
- */
20
- wrapR: boolean;
21
-
22
- /**
23
- * @default false
24
- */
25
- flipY: boolean;
26
-
27
- /**
28
- * @default false
29
- */
30
- generateMipmaps: boolean;
31
-
32
- readonly isDataTexture2DArray: true;
33
- }
3
+ /**
4
+ * @deprecated THREE.DataTexture2DArray has been renamed to DataArrayTexture.
5
+ */
6
+ export class DataTexture2DArray extends DataArrayTexture {}
@@ -1,33 +1,6 @@
1
- import { Texture } from './Texture';
2
- import { TextureFilter } from '../constants';
1
+ import { Data3DTexture } from './Data3DTexture';
3
2
 
4
- export class DataTexture3D extends Texture {
5
- constructor(data: BufferSource, width: number, height: number, depth: number);
6
-
7
- /**
8
- * @default THREE.NearestFilter
9
- */
10
- magFilter: TextureFilter;
11
-
12
- /**
13
- * @default THREE.NearestFilter
14
- */
15
- minFilter: TextureFilter;
16
-
17
- /**
18
- * @default THREE.ClampToEdgeWrapping
19
- */
20
- wrapR: boolean;
21
-
22
- /**
23
- * @default false
24
- */
25
- flipY: boolean;
26
-
27
- /**
28
- * @default false
29
- */
30
- generateMipmaps: boolean;
31
-
32
- readonly isDataTexture3D: true;
33
- }
3
+ /**
4
+ * @deprecated THREE.DataTexture3D has been renamed to Data3DTexture.
5
+ */
6
+ export class DataTexture3D extends Data3DTexture {}
@@ -25,7 +25,8 @@ export class DepthTexture extends Texture {
25
25
  anisotropy?: number,
26
26
  );
27
27
 
28
- image: { width: number; height: number };
28
+ get image(): { width: number; height: number };
29
+ set image(value: { width: number; height: number });
29
30
 
30
31
  /**
31
32
  * @default false
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Represents the data source of a texture.
3
+ */
4
+ export class Source {
5
+ /**
6
+ * @param [data] The data definition of a texture. default is **null**.
7
+ */
8
+ constructor(data: any);
9
+
10
+ /**
11
+ * The actual data of a texture. The type of this property depends on the texture that uses this instance.
12
+ */
13
+ data: any;
14
+
15
+ /**
16
+ * Set this to **true** to trigger a data upload to the GPU next time the source is used.
17
+ */
18
+ set needsUpdate(value: boolean);
19
+
20
+ /**
21
+ * [UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier) of this object instance.
22
+ * This gets automatically assigned, so this shouldn't be edited.
23
+ */
24
+ uuid: string;
25
+
26
+ /**
27
+ * This starts at **0** and counts how many times [property:Boolean needsUpdate] is set to **true**.
28
+ */
29
+ version: number;
30
+
31
+ /**
32
+ * Convert the data source to three.js [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4).
33
+ *
34
+ * @param [meta] optional object containing metadata.
35
+ */
36
+ toJSON(meta: any): any;
37
+
38
+ readonly isTexture: true;
39
+ }