@types/three 0.165.0 → 0.166.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 (79) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/exporters/GLTFExporter.d.ts +6 -0
  3. three/examples/jsm/geometries/TeapotGeometry.d.ts +24 -0
  4. three/examples/jsm/helpers/ViewHelper.d.ts +8 -6
  5. three/examples/jsm/lines/LineMaterial.d.ts +2 -4
  6. three/examples/jsm/loaders/DDSLoader.d.ts +8 -2
  7. three/examples/jsm/loaders/GLTFLoader.d.ts +3 -1
  8. three/examples/jsm/loaders/KTXLoader.d.ts +8 -2
  9. three/examples/jsm/loaders/PVRLoader.d.ts +2 -2
  10. three/examples/jsm/nodes/Nodes.d.ts +10 -3
  11. three/examples/jsm/nodes/accessors/BufferAttributeNode.d.ts +1 -0
  12. three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +7 -0
  13. three/examples/jsm/nodes/accessors/StorageTextureNode.d.ts +40 -0
  14. three/examples/jsm/nodes/core/CacheNode.d.ts +4 -5
  15. three/examples/jsm/nodes/core/LightingModel.d.ts +11 -0
  16. three/examples/jsm/nodes/core/Node.d.ts +3 -0
  17. three/examples/jsm/nodes/core/NodeBuilder.d.ts +7 -3
  18. three/examples/jsm/nodes/core/NodeCache.d.ts +12 -4
  19. three/examples/jsm/nodes/core/NodeFunction.d.ts +2 -2
  20. three/examples/jsm/nodes/core/NodeUniform.d.ts +1 -1
  21. three/examples/jsm/nodes/core/UniformNode.d.ts +2 -0
  22. three/examples/jsm/nodes/core/VarNode.d.ts +2 -0
  23. three/examples/jsm/nodes/display/DepthOfFieldNode.d.ts +30 -0
  24. three/examples/jsm/nodes/display/DotScreenNode.d.ts +32 -0
  25. three/examples/jsm/nodes/display/PassNode.d.ts +1 -1
  26. three/examples/jsm/nodes/display/RGBShiftNode.d.ts +24 -0
  27. three/examples/jsm/nodes/display/SobelOperatorNode.d.ts +17 -0
  28. three/examples/jsm/nodes/display/ViewportDepthNode.d.ts +4 -6
  29. three/examples/jsm/nodes/functions/BSDF/LTC.d.ts +9 -0
  30. three/examples/jsm/nodes/lighting/RectAreaLightNode.d.ts +10 -0
  31. three/examples/jsm/nodes/materials/MeshPhongNodeMaterial.d.ts +2 -3
  32. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +17 -18
  33. three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +6 -7
  34. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +3 -4
  35. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +32 -33
  36. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +2 -3
  37. three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +1 -0
  38. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +230 -0
  39. three/examples/jsm/nodes/math/MathNode.d.ts +5 -1
  40. three/examples/jsm/nodes/utils/DiscardNode.d.ts +1 -0
  41. three/examples/jsm/renderers/common/BindGroup.d.ts +9 -0
  42. three/examples/jsm/renderers/common/Bindings.d.ts +11 -14
  43. three/examples/jsm/renderers/common/Geometries.d.ts +3 -3
  44. three/examples/jsm/renderers/common/Info.d.ts +6 -1
  45. three/examples/jsm/renderers/common/PostProcessing.d.ts +2 -0
  46. three/examples/jsm/renderers/common/RenderObject.d.ts +3 -3
  47. three/examples/jsm/renderers/common/Renderer.d.ts +11 -0
  48. three/examples/jsm/renderers/common/SampledTexture.d.ts +27 -0
  49. three/examples/jsm/renderers/common/Sampler.d.ts +11 -0
  50. three/examples/jsm/renderers/common/Uniform.d.ts +3 -3
  51. three/examples/jsm/renderers/common/UniformsGroup.d.ts +4 -2
  52. three/examples/jsm/renderers/common/nodes/NodeBuilderState.d.ts +8 -4
  53. three/examples/jsm/renderers/common/nodes/NodeSampledTexture.d.ts +29 -0
  54. three/examples/jsm/renderers/common/nodes/NodeSampler.d.ts +12 -0
  55. three/examples/jsm/renderers/common/nodes/NodeUniform.d.ts +4 -4
  56. three/examples/jsm/renderers/common/nodes/NodeUniformsGroup.d.ts +0 -1
  57. three/examples/jsm/renderers/common/nodes/Nodes.d.ts +1 -0
  58. three/examples/jsm/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +123 -0
  59. three/examples/jsm/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +6 -0
  60. three/examples/jsm/renderers/webgpu/nodes/WGSLNodeParser.d.ts +6 -0
  61. three/examples/jsm/renderers/webgpu/utils/WebGPUConstants.d.ts +328 -0
  62. three/package.json +4 -4
  63. three/src/Three.d.ts +1 -0
  64. three/src/constants.d.ts +6 -0
  65. three/src/extras/ShapeUtils.d.ts +5 -8
  66. three/src/extras/TextureUtils.d.ts +42 -0
  67. three/src/lights/LightShadow.d.ts +5 -0
  68. three/src/materials/Material.d.ts +21 -12
  69. three/src/math/Vector4.d.ts +6 -0
  70. three/src/objects/BatchedMesh.d.ts +58 -54
  71. three/src/renderers/shaders/UniformsLib.d.ts +3 -0
  72. three/src/renderers/webxr/WebXRDepthSensing.d.ts +2 -0
  73. three/src/renderers/webxr/WebXRManager.d.ts +33 -23
  74. three/src/textures/CompressedArrayTexture.d.ts +4 -4
  75. three/src/textures/CompressedTexture.d.ts +16 -8
  76. three/src/textures/Texture.d.ts +3 -1
  77. three/examples/jsm/renderers/webgl/nodes/SlotNode.d.ts +0 -17
  78. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +0 -37
  79. three/examples/jsm/renderers/webgl/nodes/WebGLNodes.d.ts +0 -3
@@ -9,26 +9,36 @@ import { Mesh } from "./Mesh.js";
9
9
 
10
10
  /**
11
11
  * A special version of {@link Mesh} with multi draw batch rendering support. Use {@link BatchedMesh} if you have to
12
- * render a large number of objects with the same material but with different world transformations and geometry. The
13
- * usage of {@link BatchedMesh} will help you to reduce the number of draw calls and thus improve the overall rendering
12
+ * render a large number of objects with the same material but with different world transformations. The usage of
13
+ * {@link BatchedMesh} will help you to reduce the number of draw calls and thus improve the overall rendering
14
14
  * performance in your application.
15
15
  *
16
16
  * If the {@link https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw WEBGL_multi_draw extension} is not
17
- * supported then a less performant callback is used.
17
+ * supported then a less performant fallback is used.
18
18
  *
19
19
  * @example
20
20
  * const box = new THREE.BoxGeometry( 1, 1, 1 );
21
- * const sphere = new THREE.BoxGeometry( 1, 1, 1 );
21
+ * const sphere = new THREE.SphereGeometry( 1, 12, 12 );
22
22
  * const material = new THREE.MeshBasicMaterial( { color: 0x00ff00 } );
23
23
  *
24
24
  * // initialize and add geometries into the batched mesh
25
25
  * const batchedMesh = new BatchedMesh( 10, 5000, 10000, material );
26
- * const boxId = batchedMesh.addGeometry( box );
27
- * const sphereId = batchedMesh.addGeometry( sphere );
26
+ * const boxGeometryId = batchedMesh.addGeometry( box );
27
+ * const sphereGeometryId = batchedMesh.addGeometry( sphere );
28
+ *
29
+ * // create instances of those geometries
30
+ * const boxInstancedId1 = batchedMesh.addInstance( boxGeometryId );
31
+ * const boxInstancedId2 = batchedMesh.addInstance( boxGeometryId );
32
+ *
33
+ * const sphereInstancedId1 = batchedMesh.addInstance( sphereGeometryId );
34
+ * const sphereInstancedId2 = batchedMesh.addInstance( sphereGeometryId );
28
35
  *
29
36
  * // position the geometries
30
- * batchedMesh.setMatrixAt( boxId, boxMatrix );
31
- * batchedMesh.setMatrixAt( sphereId, sphereMatrix );
37
+ * batchedMesh.setMatrixAt( boxInstancedId1, boxMatrix1 );
38
+ * batchedMesh.setMatrixAt( boxInstancedId2, boxMatrix2 );
39
+ *
40
+ * batchedMesh.setMatrixAt( sphereInstancedId1, sphereMatrix1 );
41
+ * batchedMesh.setMatrixAt( sphereInstancedId2, sphereMatrix2 );
32
42
  *
33
43
  * scene.add( batchedMesh );
34
44
  *
@@ -68,20 +78,20 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
68
78
  /**
69
79
  * The maximum number of individual geometries that can be stored in the {@link BatchedMesh}. Read only.
70
80
  */
71
- get maxGeometryCount(): number;
81
+ get maxInstanceCount(): number;
72
82
 
73
83
  /**
74
84
  * Read-only flag to check if a given object is of type {@link BatchedMesh}.
75
85
  */
76
- isBatchedMesh: true;
86
+ readonly isBatchedMesh: true;
77
87
 
78
88
  /**
79
- * @param maxGeometryCount the max number of individual geometries planned to be added.
89
+ * @param maxInstanceCount the max number of individual geometries planned to be added.
80
90
  * @param maxVertexCount the max number of vertices to be used by all geometries.
81
91
  * @param maxIndexCount the max number of indices to be used by all geometries.
82
- * @param material an instance of [page:Material]. Default is a new {@link MeshBasicMaterial}.
92
+ * @param material an instance of {@link Material}. Default is a new {@link MeshBasicMaterial}.
83
93
  */
84
- constructor(maxGeometryCount: number, maxVertexCount: number, maxIndexCount?: number, material?: Material);
94
+ constructor(maxInstanceCount: number, maxVertexCount: number, maxIndexCount?: number, material?: Material);
85
95
 
86
96
  /**
87
97
  * Computes the bounding box, updating {@link .boundingBox} attribute.
@@ -102,54 +112,55 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
102
112
  dispose(): this;
103
113
 
104
114
  /**
105
- * Takes a sort a function that is run before render. The function takes a list of items to sort and a camera. The
106
- * objects in the list include a "z" field to perform a depth-ordered sort with.
115
+ * Takes a sort a function that is run before render. The function takes a list of instances to sort and a camera.
116
+ * The objects in the list include a "z" field to perform a depth-ordered sort with.
107
117
  */
108
118
  setCustomSort(
109
- func: ((this: this, list: Array<{ start: number; count: number; z: number }>, camera: Camera) => void) | null,
119
+ sortFunction:
120
+ | ((this: this, list: Array<{ start: number; count: number; z: number }>, camera: Camera) => void)
121
+ | null,
110
122
  ): this;
111
123
 
112
124
  /**
113
125
  * Get the color of the defined geometry.
114
- * @param index The index of a geometry. Values have to be in the range [0, count].
115
- * @param color This color object will be set to the color of the defined geometry.
126
+ * @param instanceId The id of an instance to get the color of.
127
+ * @param target The target object to copy the color in to.
116
128
  */
117
- getColorAt(index: number, color: Color): void;
129
+ getColorAt(instanceId: number, target: Color): void;
118
130
 
119
131
  /**
120
132
  * Get the local transformation matrix of the defined instance.
121
- * @param index The index of an instance. Values have to be in the range [0, count].
122
- * @param matrix This 4x4 matrix will be set to the local transformation matrix of the defined instance.
133
+ * @param instanceId The id of an instance to get the matrix of.
134
+ * @param target This 4x4 matrix will be set to the local transformation matrix of the defined instance.
123
135
  */
124
- getMatrixAt(index: number, matrix: Matrix4): Matrix4;
136
+ getMatrixAt(instanceId: number, target: Matrix4): Matrix4;
125
137
 
126
138
  /**
127
139
  * Get whether the given instance is marked as "visible" or not.
128
- * @param index The index of an instance. Values have to be in the range [0, count].
140
+ * @param instanceId The id of an instance to get the visibility state of.
129
141
  */
130
- getVisibleAt(index: number): boolean;
142
+ getVisibleAt(instanceId: number): boolean;
131
143
 
132
144
  /**
133
- * Sets the given color to the defined geometry.
134
- * @param index The index of a geometry. Values have to be in the range [0, count].
135
- * @param color The color of a single geometry.
145
+ * Sets the given color to the defined geometry instance.
146
+ * @param instanceId The id of the instance to set the color of.
147
+ * @param color The color to set the instance to.
136
148
  */
137
- setColorAt(index: number, color: Color): void;
149
+ setColorAt(instanceId: number, color: Color): void;
138
150
 
139
151
  /**
140
- * Sets the given local transformation matrix to the defined instance. Make sure you set {@link .instanceMatrix}
141
- * {@link BufferAttribute.needsUpdate} to true after updating all the matrices.
142
- * @param index The index of an instance. Values have to be in the range [0, count].
152
+ * Sets the given local transformation matrix to the defined instance.
153
+ * @param instanceId The id of an instance to set the matrix of.
143
154
  * @param matrix A 4x4 matrix representing the local transformation of a single instance.
144
155
  */
145
- setMatrixAt(index: number, matrix: Matrix4): this;
156
+ setMatrixAt(instanceId: number, matrix: Matrix4): this;
146
157
 
147
158
  /**
148
- * Sets the visibility of the object at the given index.
149
- * @param index The index of an instance. Values have to be in the range [0, count].
159
+ * Sets the visibility of the instance at the given index.
160
+ * @param instanceId The id of the instance to set the visibility of.
150
161
  * @param visible A boolean value indicating the visibility state.
151
162
  */
152
- setVisibleAt(index: number, visible: boolean): this;
163
+ setVisibleAt(instanceId: number, visible: boolean): this;
153
164
 
154
165
  /**
155
166
  * Adds the given geometry to the {@link BatchedMesh} and returns the associated index referring to it.
@@ -164,30 +175,23 @@ declare class BatchedMesh extends Mesh<BufferGeometry, Material> {
164
175
  addGeometry(geometry: BufferGeometry, reservedVertexRange?: number, reservedIndexRange?: number): number;
165
176
 
166
177
  /**
167
- * Replaces the geometry at `index` with the provided geometry. Throws an error if there is not enough space
168
- * reserved for geometry at the index.
169
- * @param index Which geometry index to replace with this geometry.
170
- * @param geometry The geometry to substitute at the given geometry index.
178
+ * Adds a new instance to the {@link BatchedMesh} using the geometry of the given geometryId and returns a new id
179
+ * referring to the new instance to be used by other functions.
180
+ * @param geometryId The id of a previously added geometry via "addGeometry" to add into the {@link BatchedMesh} to
181
+ * render.
171
182
  */
172
- setGeometryAt(index: number, geometry: BufferGeometry): number;
183
+ addInstance(geometryId: number): number;
173
184
 
174
185
  /**
175
- * Gets the instance count of the geometry at `index`. Returns `null` if instance counts are not configured.
176
- * @param index The index of an instance. Values have to be in the range [0, count].
186
+ * Replaces the geometry at `geometryId` with the provided geometry. Throws an error if there is not enough space
187
+ * reserved for geometry. Calling this will change all instances that are rendering that geometry.
188
+ * @param geometryId Which geometry id to replace with this geometry.
189
+ * @param geometry The geometry to substitute at the given geometry id.
177
190
  */
178
- getInstanceCountAt(index: number): number | null;
179
-
180
- /**
181
- * Sets an instance count of the geometry at `index`.
182
- * @param index Which geometry index to configure an instance count for.
183
- * @param instanceCount The number of instances to render of the given geometry index.
184
- */
185
- setInstanceCountAt(index: number, instanceCount: number): number;
186
-
187
- deleteGeometry(index: number): this;
191
+ setGeometryAt(geometryId: number, geometry: BufferGeometry): number;
188
192
 
189
- getBoundingBoxAt(index: number, target: Box3): Box3 | null;
190
- getBoundingSphereAt(index: number, target: Sphere): Sphere | null;
193
+ getBoundingBoxAt(geometryId: number, target: Box3): Box3 | null;
194
+ getBoundingSphereAt(geometryId: number, target: Sphere): Sphere | null;
191
195
  }
192
196
 
193
197
  export { BatchedMesh };
@@ -89,6 +89,7 @@ export const UniformsLib: {
89
89
  directionalLightShadows: {
90
90
  value: unknown[];
91
91
  properties: {
92
+ shadowIntensity: number;
92
93
  shadowBias: {};
93
94
  shadowNormalBias: {};
94
95
  shadowRadius: {};
@@ -112,6 +113,7 @@ export const UniformsLib: {
112
113
  spotLightShadows: {
113
114
  value: unknown[];
114
115
  properties: {
116
+ shadowIntensity: number;
115
117
  shadowBias: {};
116
118
  shadowNormalBias: {};
117
119
  shadowRadius: {};
@@ -133,6 +135,7 @@ export const UniformsLib: {
133
135
  pointLightShadows: {
134
136
  value: unknown[];
135
137
  properties: {
138
+ shadowIntensity: number;
136
139
  shadowBias: {};
137
140
  shadowNormalBias: {};
138
141
  shadowRadius: {};
@@ -24,4 +24,6 @@ export class WebXRDepthSensing {
24
24
  getMesh(cameraXR: WebXRArrayCamera): Mesh | null;
25
25
 
26
26
  reset(): void;
27
+
28
+ getDepthTexture(): Texture | null;
27
29
  }
@@ -6,6 +6,8 @@ import { ArrayCamera } from "../../cameras/ArrayCamera.js";
6
6
  import { PerspectiveCamera } from "../../cameras/PerspectiveCamera.js";
7
7
  import { EventDispatcher } from "../../core/EventDispatcher.js";
8
8
  import { Vector4 } from "../../math/Vector4.js";
9
+ import { Mesh } from "../../objects/Mesh.js";
10
+ import { Texture } from "../../textures/Texture.js";
9
11
  import { WebGLRenderer } from "../WebGLRenderer.js";
10
12
  import { XRGripSpace, XRHandSpace, XRTargetRaySpace } from "./WebXRController.js";
11
13
 
@@ -22,7 +24,10 @@ export interface WebXRManagerEventMap {
22
24
  }
23
25
 
24
26
  export class WebXRManager extends EventDispatcher<WebXRManagerEventMap> {
25
- constructor(renderer: WebGLRenderer, gl: WebGLRenderingContext);
27
+ /**
28
+ * @default true
29
+ */
30
+ cameraAutoUpdate: boolean;
26
31
 
27
32
  /**
28
33
  * @default false
@@ -34,44 +39,49 @@ export class WebXRManager extends EventDispatcher<WebXRManagerEventMap> {
34
39
  */
35
40
  isPresenting: boolean;
36
41
 
37
- /**
38
- * @default true
39
- */
40
- cameraAutoUpdate: boolean;
42
+ constructor(renderer: WebGLRenderer, gl: WebGLRenderingContext);
43
+
44
+ getController: (index: number) => XRTargetRaySpace;
45
+
46
+ getControllerGrip: (index: number) => XRGripSpace;
47
+
48
+ getHand: (index: number) => XRHandSpace;
49
+
50
+ setFramebufferScaleFactor: (value: number) => void;
41
51
 
42
- getController(index: number): XRTargetRaySpace;
52
+ setReferenceSpaceType: (value: XRReferenceSpaceType) => void;
43
53
 
44
- getControllerGrip(index: number): XRGripSpace;
54
+ getReferenceSpace: () => XRReferenceSpace | null;
45
55
 
46
- getHand(index: number): XRHandSpace;
56
+ setReferenceSpace: (value: XRReferenceSpace) => void;
47
57
 
48
- setFramebufferScaleFactor(value: number): void;
58
+ getBaseLayer: () => XRWebGLLayer | XRProjectionLayer;
49
59
 
50
- setReferenceSpaceType(value: XRReferenceSpaceType): void;
60
+ getBinding: () => XRWebGLBinding;
51
61
 
52
- getReferenceSpace(): XRReferenceSpace | null;
62
+ getFrame: () => XRFrame;
53
63
 
54
- setReferenceSpace(value: XRReferenceSpace): void;
64
+ getSession: () => XRSession | null;
55
65
 
56
- getBaseLayer(): XRWebGLLayer | XRProjectionLayer;
66
+ setSession: (value: XRSession | null) => Promise<void>;
57
67
 
58
- getBinding(): XRWebGLBinding;
68
+ getEnvironmentBlendMode: () => XREnvironmentBlendMode | undefined;
59
69
 
60
- getFrame(): XRFrame;
70
+ getDepthTexture: () => Texture | null;
61
71
 
62
- getSession(): XRSession | null;
72
+ updateCamera: (camera: PerspectiveCamera) => void;
63
73
 
64
- setSession(value: XRSession | null): Promise<void>;
74
+ getCamera: () => WebXRArrayCamera;
65
75
 
66
- getCamera(): WebXRArrayCamera;
76
+ getFoveation: () => number | undefined;
67
77
 
68
- updateCamera(camera: PerspectiveCamera): void;
78
+ setFoveation: (value: number) => void;
69
79
 
70
- setAnimationLoop(callback: XRFrameRequestCallback | null): void;
80
+ hasDepthSensing: () => boolean;
71
81
 
72
- getFoveation(): number | undefined;
82
+ getDepthSensingMesh: () => Mesh | null;
73
83
 
74
- setFoveation(value: number): void;
84
+ setAnimationLoop: (callback: XRFrameRequestCallback | null) => void;
75
85
 
76
- dispose(): void;
86
+ dispose: () => void;
77
87
  }
@@ -1,5 +1,5 @@
1
1
  import { CompressedPixelFormat, TextureDataType, Wrapping } from "../constants.js";
2
- import { CompressedTexture } from "./CompressedTexture.js";
2
+ import { CompressedTexture, CompressedTextureMipmap } from "./CompressedTexture.js";
3
3
 
4
4
  /**
5
5
  * Creates an texture 2D array based on data in compressed form, for example from a
@@ -37,8 +37,8 @@ export class CompressedArrayTexture extends CompressedTexture {
37
37
 
38
38
  /**
39
39
  * Create a new instance of {@link CompressedArrayTexture}
40
- * @param mipmaps The mipmaps array should contain objects with data, width and height.
41
- * The mipmaps should be of the correct {@link format} and {@link type}. See {@link THREE.mipmaps}.
40
+ * @param mipmaps The mipmaps array should contain objects with data, width and height. The mipmaps should be of the
41
+ * correct format and type.
42
42
  * @param width The width of the biggest mipmap.
43
43
  * @param height The height of the biggest mipmap.
44
44
  * @param depth The number of layers of the 2D array texture
@@ -46,7 +46,7 @@ export class CompressedArrayTexture extends CompressedTexture {
46
46
  * @param type See {@link Texture.type | .type}. Default {@link THREE.UnsignedByteType}
47
47
  */
48
48
  constructor(
49
- mipmaps: ImageData[],
49
+ mipmaps: CompressedTextureMipmap[],
50
50
  width: number,
51
51
  height: number,
52
52
  depth: number,
@@ -7,8 +7,15 @@ import {
7
7
  TextureDataType,
8
8
  Wrapping,
9
9
  } from "../constants.js";
10
+ import { TypedArray } from "../core/BufferAttribute.js";
10
11
  import { Texture } from "./Texture.js";
11
12
 
13
+ export interface CompressedTextureMipmap {
14
+ data: TypedArray;
15
+ width: number;
16
+ height: number;
17
+ }
18
+
12
19
  /**
13
20
  * Creates a texture based on data in compressed form, for example from a {@link https://en.wikipedia.org/wiki/DirectDraw_Surface | DDS} file.
14
21
  * @remarks For use with the {@link THREE.CompressedTextureLoader | CompressedTextureLoader}.
@@ -18,8 +25,8 @@ import { Texture } from "./Texture.js";
18
25
  export class CompressedTexture extends Texture {
19
26
  /**
20
27
  * This creates a new {@link THREE.CompressedTexture | CompressedTexture} object.
21
- * @param mipmaps The mipmaps array should contain objects with data, width and height.
22
- * The mipmaps should be of the correct {@link format} and {@link type}. See {@link THREE.mipmaps}.
28
+ * @param mipmaps The mipmaps array should contain objects with data, width and height. The mipmaps should be of the
29
+ * correct format and type.
23
30
  * @param width The width of the biggest mipmap.
24
31
  * @param height The height of the biggest mipmap.
25
32
  * @param format The format used in the mipmaps. See {@link THREE.CompressedPixelFormat}.
@@ -33,10 +40,10 @@ export class CompressedTexture extends Texture {
33
40
  * @param colorSpace See {@link Texture.colorSpace .colorSpace}. Default {@link NoColorSpace}
34
41
  */
35
42
  constructor(
36
- mipmaps: ImageData[],
37
- width: number,
38
- height: number,
39
- format: CompressedPixelFormat,
43
+ mipmaps?: CompressedTextureMipmap[],
44
+ width?: number,
45
+ height?: number,
46
+ format?: CompressedPixelFormat,
40
47
  type?: TextureDataType,
41
48
  mapping?: Mapping,
42
49
  wrapS?: Wrapping,
@@ -62,9 +69,10 @@ export class CompressedTexture extends Texture {
62
69
  set image(value: { width: number; height: number });
63
70
 
64
71
  /**
65
- * The mipmaps array should contain objects with data, width and height. The mipmaps should be of the correct {@link format} and {@link type}.
72
+ * The mipmaps array should contain objects with data, width and height. The mipmaps should be of the correct
73
+ * format and type.
66
74
  */
67
- mipmaps: ImageData[];
75
+ mipmaps: CompressedTextureMipmap[] | undefined;
68
76
 
69
77
  /**
70
78
  * @override
@@ -13,6 +13,8 @@ import {
13
13
  import { EventDispatcher } from "../core/EventDispatcher.js";
14
14
  import { Matrix3 } from "../math/Matrix3.js";
15
15
  import { Vector2 } from "../math/Vector2.js";
16
+ import { CompressedTextureMipmap } from "./CompressedTexture.js";
17
+ import { CubeTexture } from "./CubeTexture.js";
16
18
  import { Source } from "./Source.js";
17
19
 
18
20
  /** Shim for OffscreenCanvas. */
@@ -127,7 +129,7 @@ export class Texture extends EventDispatcher<{ dispose: {} }> {
127
129
  * Array of user-specified mipmaps
128
130
  * @defaultValue `[]`
129
131
  */
130
- mipmaps: any[]; // ImageData[] for 2D textures and CubeTexture[] for cube textures;
132
+ mipmaps: CompressedTextureMipmap[] | CubeTexture[] | HTMLCanvasElement[] | undefined;
131
133
 
132
134
  /**
133
135
  * How the image is applied to the object.
@@ -1,17 +0,0 @@
1
- import Node from "../../../nodes/core/Node.js";
2
-
3
- export interface SlotNodeParameters<TNode extends Node = Node> {
4
- node?: TNode;
5
- nodeType?: string;
6
- source?: string | null;
7
- target?: string | null;
8
- }
9
-
10
- export default class SlotNode<TNode extends Node = Node> extends Node {
11
- inclusionType: "replace";
12
- node: TNode | null;
13
- source: null;
14
- target: null;
15
-
16
- constructor(params: SlotNodeParameters<TNode>);
17
- }
@@ -1,37 +0,0 @@
1
- import { Object3D, Renderer } from "three";
2
- import { NodeShaderStage } from "../../../nodes/core/constants.js";
3
- import Node from "../../../nodes/core/Node.js";
4
- import NodeBuilder from "../../../nodes/core/NodeBuilder.js";
5
- import SlotNode from "./SlotNode.js";
6
-
7
- export class WebGLNodeBuilder extends NodeBuilder {
8
- constructor(
9
- object: Object3D,
10
- renderer: Renderer,
11
- shader: { uniforms: any; vertexShader: any; fragmentShader: any },
12
- );
13
-
14
- addSlot(shaderStage: NodeShaderStage, slotNode: SlotNode): Node;
15
-
16
- getUniforms(shaderStage: string): string;
17
-
18
- getAttributes(shaderStage: string): string;
19
-
20
- getVarys(shaderStage: string): string;
21
-
22
- addCode(shaderStage: string, source: string, code: string, scope?: this): string;
23
- addCodeAfterInclude(shaderStage: string, snippet: string, code: string): string;
24
-
25
- replaceCode(shaderStage: string, source: string, target: string, scope?: this): void;
26
- parseInclude(shaderStage: string, ...includes: string[]): void;
27
-
28
- getInstanceIndex(): string;
29
- getFrontFacing(): string;
30
- getFragCoord(): "gl_FragCoord";
31
- isFlipY(): true;
32
-
33
- buildCode(): void;
34
- build(): this;
35
-
36
- getSlot(shaderStage: string, name: string): Node;
37
- }
@@ -1,3 +0,0 @@
1
- import NodeFrame from "../../../nodes/core/NodeFrame.js";
2
-
3
- export const nodeFrame: NodeFrame;