@types/three 0.159.0 → 0.161.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 (211) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +5 -1
  3. three/examples/jsm/capabilities/WebGPU.d.ts +2 -0
  4. three/examples/jsm/curves/NURBSUtils.d.ts +136 -10
  5. three/examples/jsm/curves/NURBSVolume.d.ts +23 -0
  6. three/examples/jsm/exporters/USDZExporter.d.ts +1 -0
  7. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -0
  8. three/examples/jsm/loaders/KTX2Loader.d.ts +45 -11
  9. three/examples/jsm/loaders/LUT3dlLoader.d.ts +29 -2
  10. three/examples/jsm/loaders/LUTCubeLoader.d.ts +37 -2
  11. three/examples/jsm/loaders/MaterialXLoader.d.ts +6 -0
  12. three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts +13 -0
  13. three/examples/jsm/misc/Timer.d.ts +80 -0
  14. three/examples/jsm/nodes/Nodes.d.ts +304 -61
  15. three/examples/jsm/nodes/accessors/BitangentNode.d.ts +9 -0
  16. three/examples/jsm/nodes/accessors/BufferNode.d.ts +4 -1
  17. three/examples/jsm/nodes/accessors/CameraNode.d.ts +24 -6
  18. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +17 -4
  19. three/examples/jsm/nodes/accessors/InstanceNode.d.ts +3 -0
  20. three/examples/jsm/nodes/accessors/MaterialNode.d.ts +12 -0
  21. three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +7 -0
  22. three/examples/jsm/nodes/accessors/ModelNode.d.ts +9 -1
  23. three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +3 -0
  24. three/examples/jsm/nodes/accessors/NormalNode.d.ts +8 -0
  25. three/examples/jsm/nodes/accessors/Object3DNode.d.ts +10 -6
  26. three/examples/jsm/nodes/accessors/PointUVNode.d.ts +3 -0
  27. three/examples/jsm/nodes/accessors/PositionNode.d.ts +8 -0
  28. three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +4 -1
  29. three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +3 -0
  30. three/examples/jsm/nodes/accessors/SkinningNode.d.ts +3 -0
  31. three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +8 -1
  32. three/examples/jsm/nodes/accessors/TangentNode.d.ts +9 -0
  33. three/examples/jsm/nodes/accessors/TextureBicubicNode.d.ts +18 -0
  34. three/examples/jsm/nodes/accessors/TextureNode.d.ts +21 -5
  35. three/examples/jsm/nodes/accessors/UVNode.d.ts +3 -0
  36. three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
  37. three/examples/jsm/nodes/accessors/VertexColorNode.d.ts +12 -0
  38. three/examples/jsm/nodes/code/CodeNode.d.ts +4 -0
  39. three/examples/jsm/nodes/code/ExpressionNode.d.ts +3 -0
  40. three/examples/jsm/nodes/code/FunctionCallNode.d.ts +13 -1
  41. three/examples/jsm/nodes/code/FunctionNode.d.ts +17 -0
  42. three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +1 -1
  43. three/examples/jsm/nodes/core/AssignNode.d.ts +17 -0
  44. three/examples/jsm/nodes/core/AttributeNode.d.ts +3 -0
  45. three/examples/jsm/nodes/core/BypassNode.d.ts +9 -0
  46. three/examples/jsm/nodes/core/CacheNode.d.ts +11 -0
  47. three/examples/jsm/nodes/core/ConstNode.d.ts +3 -3
  48. three/examples/jsm/nodes/core/ContextNode.d.ts +11 -0
  49. three/examples/jsm/nodes/core/IndexNode.d.ts +18 -0
  50. three/examples/jsm/nodes/core/InputNode.d.ts +4 -4
  51. three/examples/jsm/nodes/core/LightingModel.d.ts +36 -0
  52. three/examples/jsm/nodes/core/Node.d.ts +32 -8
  53. three/examples/jsm/nodes/core/NodeBuilder.d.ts +27 -23
  54. three/examples/jsm/nodes/core/NodeFrame.d.ts +18 -6
  55. three/examples/jsm/nodes/core/NodeUniform.d.ts +12 -8
  56. three/examples/jsm/nodes/core/NodeUtils.d.ts +6 -3
  57. three/examples/jsm/nodes/core/PropertyNode.d.ts +27 -1
  58. three/examples/jsm/nodes/core/UniformNode.d.ts +12 -4
  59. three/examples/jsm/nodes/core/VarNode.d.ts +10 -0
  60. three/examples/jsm/nodes/core/VaryingNode.d.ts +9 -0
  61. three/examples/jsm/nodes/core/constants.d.ts +31 -28
  62. three/examples/jsm/nodes/display/AfterImageNode.d.ts +25 -0
  63. three/examples/jsm/nodes/display/AnamorphicNode.d.ts +32 -0
  64. three/examples/jsm/nodes/display/BlendModeNode.d.ts +21 -6
  65. three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +29 -1
  66. three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +17 -0
  67. three/examples/jsm/nodes/display/FrontFacingNode.d.ts +4 -0
  68. three/examples/jsm/nodes/display/GaussianBlurNode.d.ts +28 -0
  69. three/examples/jsm/nodes/display/NormalMapNode.d.ts +13 -1
  70. three/examples/jsm/nodes/display/PassNode.d.ts +44 -0
  71. three/examples/jsm/nodes/display/PosterizeNode.d.ts +12 -0
  72. three/examples/jsm/nodes/display/ToneMappingNode.d.ts +8 -1
  73. three/examples/jsm/nodes/display/ViewportDepthNode.d.ts +32 -0
  74. three/examples/jsm/nodes/display/ViewportNode.d.ts +8 -0
  75. three/examples/jsm/nodes/display/ViewportSharedTextureNode.d.ts +18 -0
  76. three/examples/jsm/nodes/display/ViewportTextureNode.d.ts +33 -0
  77. three/examples/jsm/nodes/fog/FogExp2Node.d.ts +9 -0
  78. three/examples/jsm/nodes/fog/FogNode.d.ts +9 -0
  79. three/examples/jsm/nodes/fog/FogRangeNode.d.ts +9 -0
  80. three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +9 -2
  81. three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +3 -2
  82. three/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.d.ts +7 -0
  83. three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +3 -2
  84. three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +3 -2
  85. three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +3 -2
  86. three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +1 -1
  87. three/examples/jsm/nodes/functions/PhongLightingModel.d.ts +7 -0
  88. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +17 -8
  89. three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +1 -1
  90. three/examples/jsm/nodes/functions/material/getRoughness.d.ts +1 -1
  91. three/examples/jsm/nodes/geometry/RangeNode.d.ts +3 -0
  92. three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +13 -0
  93. three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +20 -8
  94. three/examples/jsm/nodes/lighting/LightsNode.d.ts +3 -0
  95. three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +1 -2
  96. three/examples/jsm/nodes/materials/Materials.d.ts +9 -17
  97. three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +2 -4
  98. three/examples/jsm/nodes/materials/MeshPhongNodeMaterial.d.ts +12 -0
  99. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +16 -7
  100. three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +17 -0
  101. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +1 -5
  102. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +55 -16
  103. three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +2 -8
  104. three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +0 -10
  105. three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +43 -34
  106. three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +5 -3
  107. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +7 -5
  108. three/examples/jsm/nodes/math/CondNode.d.ts +13 -0
  109. three/examples/jsm/nodes/math/HashNode.d.ts +16 -0
  110. three/examples/jsm/nodes/math/MathNode.d.ts +140 -1
  111. three/examples/jsm/nodes/math/MathUtils.d.ts +16 -0
  112. three/examples/jsm/nodes/math/OperatorNode.d.ts +53 -1
  113. three/examples/jsm/nodes/math/TriNoise3D.d.ts +12 -0
  114. three/examples/jsm/nodes/procedural/CheckerNode.d.ts +9 -0
  115. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +124 -31
  116. three/examples/jsm/nodes/utils/DiscardNode.d.ts +16 -0
  117. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +4 -2
  118. three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +3 -0
  119. three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +6 -3
  120. three/examples/jsm/nodes/utils/OscNode.d.ts +6 -0
  121. three/examples/jsm/nodes/utils/ReflectorNode.d.ts +30 -0
  122. three/examples/jsm/nodes/utils/RemapNode.d.ts +24 -1
  123. three/examples/jsm/nodes/utils/RotateNode.d.ts +21 -0
  124. three/examples/jsm/nodes/utils/RotateUVNode.d.ts +9 -0
  125. three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +5 -1
  126. three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +7 -0
  127. three/examples/jsm/nodes/utils/TimerNode.d.ts +7 -1
  128. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +28 -7
  129. three/examples/jsm/objects/GroundedSkybox.d.ts +5 -0
  130. three/examples/jsm/objects/QuadMesh.d.ts +15 -0
  131. three/examples/jsm/postprocessing/{HBAOPass.d.ts → GTAOPass.d.ts} +25 -10
  132. three/examples/jsm/postprocessing/SSAOPass.d.ts +1 -1
  133. three/examples/jsm/renderers/common/Backend.d.ts +6 -2
  134. three/examples/jsm/renderers/common/Color4.d.ts +9 -0
  135. three/examples/jsm/renderers/common/Info.d.ts +7 -1
  136. three/examples/jsm/renderers/common/PostProcessing.d.ts +11 -0
  137. three/examples/jsm/renderers/common/Renderer.d.ts +243 -4
  138. three/examples/jsm/renderers/common/StorageTexture.d.ts +5 -0
  139. three/examples/jsm/renderers/webgl/WebGLBackend.d.ts +4 -2
  140. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +2 -2
  141. three/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.d.ts +3 -0
  142. three/examples/jsm/renderers/webgpu/WebGPUBackend.d.ts +15 -6
  143. three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +7 -7
  144. three/examples/jsm/shaders/{HBAOShader.d.ts → GTAOShader.d.ts} +23 -8
  145. three/examples/jsm/shaders/PoissonDenoiseShader.d.ts +1 -1
  146. three/examples/jsm/utils/BufferGeometryUtils.d.ts +0 -10
  147. three/examples/jsm/webxr/XRControllerModelFactory.d.ts +6 -5
  148. three/examples/jsm/webxr/XRHandMeshModel.d.ts +10 -2
  149. three/package.json +2 -2
  150. three/src/Three.d.ts +1 -0
  151. three/src/cameras/PerspectiveCamera.d.ts +13 -0
  152. three/src/constants.d.ts +4 -3
  153. three/src/core/InterleavedBufferAttribute.d.ts +12 -2
  154. three/src/core/Object3D.d.ts +13 -13
  155. three/src/core/UniformsGroup.d.ts +3 -3
  156. three/src/extras/core/Curve.d.ts +9 -9
  157. three/src/extras/core/CurvePath.d.ts +8 -7
  158. three/src/geometries/RingGeometry.d.ts +1 -1
  159. three/src/lights/PointLight.d.ts +7 -0
  160. three/src/loaders/MaterialLoader.d.ts +6 -3
  161. three/src/materials/LineBasicMaterial.d.ts +7 -0
  162. three/src/materials/LineDashedMaterial.d.ts +7 -1
  163. three/src/materials/Material.d.ts +17 -15
  164. three/src/materials/MeshBasicMaterial.d.ts +7 -0
  165. three/src/materials/MeshDepthMaterial.d.ts +6 -0
  166. three/src/materials/MeshDistanceMaterial.d.ts +7 -0
  167. three/src/materials/MeshLambertMaterial.d.ts +7 -0
  168. three/src/materials/MeshMatcapMaterial.d.ts +7 -0
  169. three/src/materials/MeshNormalMaterial.d.ts +7 -0
  170. three/src/materials/MeshPhongMaterial.d.ts +7 -0
  171. three/src/materials/MeshPhysicalMaterial.d.ts +6 -1
  172. three/src/materials/MeshStandardMaterial.d.ts +7 -2
  173. three/src/materials/MeshToonMaterial.d.ts +7 -0
  174. three/src/materials/PointsMaterial.d.ts +7 -0
  175. three/src/materials/RawShaderMaterial.d.ts +9 -0
  176. three/src/materials/ShaderMaterial.d.ts +17 -3
  177. three/src/materials/ShadowMaterial.d.ts +7 -0
  178. three/src/materials/SpriteMaterial.d.ts +7 -2
  179. three/src/math/Color.d.ts +1 -1
  180. three/src/math/Matrix4.d.ts +30 -30
  181. three/src/math/Quaternion.d.ts +27 -30
  182. three/src/math/Sphere.d.ts +5 -0
  183. three/src/math/Triangle.d.ts +8 -25
  184. three/src/math/Vector2.d.ts +24 -159
  185. three/src/math/Vector3.d.ts +46 -54
  186. three/src/math/Vector4.d.ts +25 -20
  187. three/src/objects/BatchedMesh.d.ts +2 -2
  188. three/src/objects/Bone.d.ts +2 -2
  189. three/src/objects/InstancedMesh.d.ts +2 -1
  190. three/src/objects/LOD.d.ts +2 -2
  191. three/src/objects/Line.d.ts +3 -2
  192. three/src/objects/LineLoop.d.ts +3 -1
  193. three/src/objects/LineSegments.d.ts +3 -1
  194. three/src/objects/Points.d.ts +3 -2
  195. three/src/objects/SkinnedMesh.d.ts +4 -8
  196. three/src/objects/Sprite.d.ts +2 -2
  197. three/src/renderers/shaders/ShaderLib.d.ts +18 -18
  198. three/src/renderers/shaders/UniformsUtils.d.ts +3 -2
  199. three/src/renderers/webgl/WebGLLights.d.ts +39 -37
  200. three/src/renderers/webgl/WebGLProgram.d.ts +0 -1
  201. three/src/renderers/webgl/WebGLPrograms.d.ts +226 -9
  202. three/src/renderers/webxr/WebXRDepthSensing.d.ts +27 -0
  203. three/src/renderers/webxr/WebXRManager.d.ts +2 -1
  204. three/src/textures/CompressedCubeTexture.d.ts +13 -0
  205. three/src/textures/DataArrayTexture.d.ts +1 -1
  206. three/src/textures/Source.d.ts +11 -1
  207. three/build/three.d.ts +0 -2
  208. three/build/three.min.d.ts +0 -2
  209. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +0 -310
  210. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +0 -166
  211. three/examples/jsm/objects/GroundProjectedSkybox.d.ts +0 -13
@@ -1,4 +1,4 @@
1
- import { Object3D } from '../core/Object3D.js';
1
+ import { Object3D, Object3DEventMap } from '../core/Object3D.js';
2
2
 
3
3
  /**
4
4
  * A {@link Bone} which is part of a {@link THREE.Skeleton | Skeleton}
@@ -15,7 +15,7 @@ import { Object3D } from '../core/Object3D.js';
15
15
  * @see {@link https://threejs.org/docs/index.html#api/en/objects/Bone | Official Documentation}
16
16
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/Bone.js | Source}
17
17
  */
18
- export class Bone extends Object3D {
18
+ export class Bone<TEventMap extends Object3DEventMap = Object3DEventMap> extends Object3D<TEventMap> {
19
19
  /**
20
20
  * Creates a new {@link Bone}.
21
21
  */
@@ -28,7 +28,8 @@ export interface InstancedMeshEventMap extends Object3DEventMap {
28
28
  export class InstancedMesh<
29
29
  TGeometry extends BufferGeometry = BufferGeometry,
30
30
  TMaterial extends Material | Material[] = Material | Material[],
31
- > extends Mesh<TGeometry, TMaterial, InstancedMeshEventMap> {
31
+ TEventMap extends InstancedMeshEventMap = InstancedMeshEventMap,
32
+ > extends Mesh<TGeometry, TMaterial, TEventMap> {
32
33
  /**
33
34
  * Create a new instance of {@link InstancedMesh}
34
35
  * @param geometry An instance of {@link THREE.BufferGeometry | BufferGeometry}.
@@ -1,4 +1,4 @@
1
- import { Object3D } from '../core/Object3D.js';
1
+ import { Object3D, Object3DEventMap } from '../core/Object3D.js';
2
2
  import { Camera } from '../cameras/Camera.js';
3
3
 
4
4
  /**
@@ -20,7 +20,7 @@ import { Camera } from '../cameras/Camera.js';
20
20
  * @see {@link https://threejs.org/docs/index.html#api/en/objects/LOD | Official Documentation}
21
21
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/LOD.js | Source}
22
22
  */
23
- export class LOD extends Object3D {
23
+ export class LOD<TEventMap extends Object3DEventMap = Object3DEventMap> extends Object3D<TEventMap> {
24
24
  /**
25
25
  * Creates a new {@link LOD}.
26
26
  */
@@ -1,5 +1,5 @@
1
1
  import { Material } from '../materials/Material.js';
2
- import { Object3D } from '../core/Object3D.js';
2
+ import { Object3D, Object3DEventMap } from '../core/Object3D.js';
3
3
  import { BufferGeometry } from '../core/BufferGeometry.js';
4
4
 
5
5
  /**
@@ -27,7 +27,8 @@ import { BufferGeometry } from '../core/BufferGeometry.js';
27
27
  export class Line<
28
28
  TGeometry extends BufferGeometry = BufferGeometry,
29
29
  TMaterial extends Material | Material[] = Material | Material[],
30
- > extends Object3D {
30
+ TEventMap extends Object3DEventMap = Object3DEventMap,
31
+ > extends Object3D<TEventMap> {
31
32
  /**
32
33
  * Create a new instance of {@link Line}
33
34
  * @param geometry Vertices representing the {@link Line} segment(s). Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
@@ -1,6 +1,7 @@
1
1
  import { Line } from './Line.js';
2
2
  import { Material } from '../materials/Material.js';
3
3
  import { BufferGeometry } from '../core/BufferGeometry.js';
4
+ import { Object3DEventMap } from '../core/Object3D.js';
4
5
 
5
6
  /**
6
7
  * A continuous line that connects back to the start.
@@ -15,7 +16,8 @@ import { BufferGeometry } from '../core/BufferGeometry.js';
15
16
  export class LineLoop<
16
17
  TGeometry extends BufferGeometry = BufferGeometry,
17
18
  TMaterial extends Material | Material[] = Material | Material[],
18
- > extends Line<TGeometry, TMaterial> {
19
+ TEventMap extends Object3DEventMap = Object3DEventMap,
20
+ > extends Line<TGeometry, TMaterial, TEventMap> {
19
21
  /**
20
22
  * Create a new instance of {@link LineLoop}
21
23
  * @param geometry List of vertices representing points on the line loop. Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
@@ -1,6 +1,7 @@
1
1
  import { Material } from '../materials/Material.js';
2
2
  import { Line } from './Line.js';
3
3
  import { BufferGeometry } from '../core/BufferGeometry.js';
4
+ import { Object3DEventMap } from '../core/Object3D.js';
4
5
 
5
6
  /**
6
7
  * A series of lines drawn between pairs of vertices.
@@ -14,7 +15,8 @@ import { BufferGeometry } from '../core/BufferGeometry.js';
14
15
  export class LineSegments<
15
16
  TGeometry extends BufferGeometry = BufferGeometry,
16
17
  TMaterial extends Material | Material[] = Material | Material[],
17
- > extends Line<TGeometry, TMaterial> {
18
+ TEventMap extends Object3DEventMap = Object3DEventMap,
19
+ > extends Line<TGeometry, TMaterial, TEventMap> {
18
20
  /**
19
21
  * Create a new instance of {@link LineSegments}
20
22
  * @param geometry Pair(s) of vertices representing each line segment(s). Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
@@ -1,5 +1,5 @@
1
1
  import { Material } from '../materials/Material.js';
2
- import { Object3D } from '../core/Object3D.js';
2
+ import { Object3D, Object3DEventMap } from '../core/Object3D.js';
3
3
  import { BufferGeometry, NormalOrGLBufferAttributes } from '../core/BufferGeometry.js';
4
4
  import { BufferAttribute } from '../core/BufferAttribute.js';
5
5
  import { InterleavedBufferAttribute } from '../core/InterleavedBufferAttribute.js';
@@ -15,7 +15,8 @@ import { GLBufferAttribute } from '../core/GLBufferAttribute.js';
15
15
  export class Points<
16
16
  TGeometry extends BufferGeometry<NormalOrGLBufferAttributes> = BufferGeometry,
17
17
  TMaterial extends Material | Material[] = Material | Material[],
18
- > extends Object3D {
18
+ TEventMap extends Object3DEventMap = Object3DEventMap,
19
+ > extends Object3D<TEventMap> {
19
20
  /**
20
21
  * Create a new instance of {@link Points}
21
22
  * @param geometry An instance of {@link THREE.BufferGeometry | BufferGeometry}. Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
@@ -5,14 +5,14 @@ import { Vector3 } from '../math/Vector3.js';
5
5
  import { Skeleton } from './Skeleton.js';
6
6
  import { Mesh } from './Mesh.js';
7
7
  import { BufferGeometry } from '../core/BufferGeometry.js';
8
+ import { Object3DEventMap } from '../core/Object3D.js';
8
9
  import { Sphere } from '../math/Sphere.js';
9
10
  import { BindMode } from '../constants.js';
10
11
 
11
12
  /**
12
13
  * A mesh that has a {@link THREE.Skeleton | Skeleton} with {@link Bone | bones} that can then be used to animate the vertices of the geometry.
13
14
  * @remarks
14
- * {@link SkinnedMesh} can only be used with WebGL 2 or
15
- * With WebGL 1 `OES_texture_float` and vertex textures support is required.
15
+ * {@link SkinnedMesh} can only be used with WebGL 2.
16
16
  * @example
17
17
  * ```typescript
18
18
  * const geometry = new THREE.CylinderGeometry(5, 5, 5, 5, 15, 5, 30);
@@ -51,7 +51,8 @@ import { BindMode } from '../constants.js';
51
51
  export class SkinnedMesh<
52
52
  TGeometry extends BufferGeometry = BufferGeometry,
53
53
  TMaterial extends Material | Material[] = Material | Material[],
54
- > extends Mesh<TGeometry, TMaterial> {
54
+ TEventMap extends Object3DEventMap = Object3DEventMap,
55
+ > extends Mesh<TGeometry, TMaterial, TEventMap> {
55
56
  /**
56
57
  * Create a new instance of {@link SkinnedMesh}
57
58
  * @param geometry An instance of {@link THREE.BufferGeometry | BufferGeometry}. Default {@link THREE.BufferGeometry | `new THREE.BufferGeometry()`}.
@@ -149,9 +150,4 @@ export class SkinnedMesh<
149
150
  * @param vector
150
151
  */
151
152
  applyBoneTransform(index: number, vector: Vector3): Vector3;
152
-
153
- /**
154
- * @deprecated {@link THREE.SkinnedMesh}: {@link boneTransform | .boneTransform()} was renamed to {@link applyBoneTransform | .applyBoneTransform()} in **r151**.
155
- */
156
- boneTransform(index: number, target: Vector3): Vector3;
157
153
  }
@@ -1,5 +1,5 @@
1
1
  import { Vector2 } from '../math/Vector2.js';
2
- import { Object3D } from '../core/Object3D.js';
2
+ import { Object3D, Object3DEventMap } from '../core/Object3D.js';
3
3
  import { SpriteMaterial } from '../materials/Materials.js';
4
4
  import { BufferGeometry } from '../core/BufferGeometry.js';
5
5
 
@@ -18,7 +18,7 @@ import { BufferGeometry } from '../core/BufferGeometry.js';
18
18
  * @see {@link https://threejs.org/docs/index.html#api/en/objects/Sprite | Official Documentation}
19
19
  * @see {@link https://github.com/mrdoob/three.js/blob/master/src/objects/Sprite.js | Source}
20
20
  */
21
- export class Sprite extends Object3D {
21
+ export class Sprite<TEventMap extends Object3DEventMap = Object3DEventMap> extends Object3D<TEventMap> {
22
22
  /**
23
23
  * Creates a new Sprite.
24
24
  * @param material An instance of {@link THREE.SpriteMaterial | SpriteMaterial}. Default {@link THREE.SpriteMaterial | `new SpriteMaterial()`}, _with white color_.
@@ -1,27 +1,27 @@
1
1
  import { IUniform } from './UniformsLib.js';
2
2
 
3
- export interface Shader {
3
+ export interface ShaderLibShader {
4
4
  uniforms: { [uniform: string]: IUniform };
5
5
  vertexShader: string;
6
6
  fragmentShader: string;
7
7
  }
8
8
 
9
9
  export let ShaderLib: {
10
- [name: string]: Shader;
11
- basic: Shader;
12
- lambert: Shader;
13
- phong: Shader;
14
- standard: Shader;
15
- matcap: Shader;
16
- points: Shader;
17
- dashed: Shader;
18
- depth: Shader;
19
- normal: Shader;
20
- sprite: Shader;
21
- background: Shader;
22
- cube: Shader;
23
- equirect: Shader;
24
- distanceRGBA: Shader;
25
- shadow: Shader;
26
- physical: Shader;
10
+ [name: string]: ShaderLibShader;
11
+ basic: ShaderLibShader;
12
+ lambert: ShaderLibShader;
13
+ phong: ShaderLibShader;
14
+ standard: ShaderLibShader;
15
+ matcap: ShaderLibShader;
16
+ points: ShaderLibShader;
17
+ dashed: ShaderLibShader;
18
+ depth: ShaderLibShader;
19
+ normal: ShaderLibShader;
20
+ sprite: ShaderLibShader;
21
+ background: ShaderLibShader;
22
+ cube: ShaderLibShader;
23
+ equirect: ShaderLibShader;
24
+ distanceRGBA: ShaderLibShader;
25
+ shadow: ShaderLibShader;
26
+ physical: ShaderLibShader;
27
27
  };
@@ -1,7 +1,8 @@
1
1
  import { UniformsGroup } from '../../core/UniformsGroup.js';
2
+ import { IUniform } from './UniformsLib.js';
2
3
 
3
- export function cloneUniforms(uniforms_src: any): any;
4
- export function mergeUniforms(uniforms: any): any;
4
+ export function cloneUniforms<T extends { [uniform: string]: IUniform }>(uniformsSrc: T): T;
5
+ export function mergeUniforms(uniforms: Array<{ [uniform: string]: IUniform }>): { [uniform: string]: IUniform };
5
6
 
6
7
  export function cloneUniformsGroups(src: UniformsGroup[]): UniformsGroup[];
7
8
 
@@ -1,47 +1,49 @@
1
1
  import { WebGLExtensions } from './WebGLExtensions.js';
2
2
  import { WebGLCapabilities } from './WebGLCapabilities.js';
3
3
 
4
- export class WebGLLights {
5
- constructor(extensions: WebGLExtensions, capabilities: WebGLCapabilities);
4
+ export interface WebGLLightsState {
5
+ version: number;
6
+
7
+ hash: {
8
+ directionalLength: number;
9
+ pointLength: number;
10
+ spotLength: number;
11
+ rectAreaLength: number;
12
+ hemiLength: number;
13
+
14
+ numDirectionalShadows: number;
15
+ numPointShadows: number;
16
+ numSpotShadows: number;
17
+ numSpotMaps: number;
6
18
 
7
- state: {
8
- version: number;
9
-
10
- hash: {
11
- directionalLength: number;
12
- pointLength: number;
13
- spotLength: number;
14
- rectAreaLength: number;
15
- hemiLength: number;
16
-
17
- numDirectionalShadows: number;
18
- numPointShadows: number;
19
- numSpotShadows: number;
20
- numSpotMaps: number;
21
-
22
- numLightProbes: number;
23
- };
24
-
25
- ambient: number[];
26
- probe: any[];
27
- directional: any[];
28
- directionalShadow: any[];
29
- directionalShadowMap: any[];
30
- directionalShadowMatrix: any[];
31
- spot: any[];
32
- spotShadow: any[];
33
- spotShadowMap: any[];
34
- spotShadowMatrix: any[];
35
- rectArea: any[];
36
- point: any[];
37
- pointShadow: any[];
38
- pointShadowMap: any[];
39
- pointShadowMatrix: any[];
40
- hemi: any[];
41
- numSpotLightShadowsWithMaps: number;
42
19
  numLightProbes: number;
43
20
  };
44
21
 
22
+ ambient: number[];
23
+ probe: any[];
24
+ directional: any[];
25
+ directionalShadow: any[];
26
+ directionalShadowMap: any[];
27
+ directionalShadowMatrix: any[];
28
+ spot: any[];
29
+ spotShadow: any[];
30
+ spotShadowMap: any[];
31
+ spotShadowMatrix: any[];
32
+ rectArea: any[];
33
+ point: any[];
34
+ pointShadow: any[];
35
+ pointShadowMap: any[];
36
+ pointShadowMatrix: any[];
37
+ hemi: any[];
38
+ numSpotLightShadowsWithMaps: number;
39
+ numLightProbes: number;
40
+ }
41
+
42
+ export class WebGLLights {
43
+ constructor(extensions: WebGLExtensions, capabilities: WebGLCapabilities);
44
+
45
+ state: WebGLLightsState;
46
+
45
47
  get(light: any): any;
46
48
  setup(lights: any): void;
47
49
  setupView(lights: any, camera: any): void;
@@ -1,5 +1,4 @@
1
1
  import { WebGLRenderer } from '../WebGLRenderer.js';
2
- import { WebGLShader } from './WebGLShader.js';
3
2
  import { WebGLUniforms } from './WebGLUniforms.js';
4
3
 
5
4
  export class WebGLProgram {
@@ -1,12 +1,222 @@
1
+ import { Material } from '../../materials/Material.js';
2
+ import { Object3D } from '../../core/Object3D.js';
3
+ import { Light } from '../../lights/Light.js';
4
+ import { Scene } from '../../scenes/Scene.js';
5
+ import { IUniform } from '../shaders/UniformsLib.js';
1
6
  import { WebGLRenderer } from '../WebGLRenderer.js';
2
- import { WebGLProgram } from './WebGLProgram.js';
7
+ import { WebGLBindingStates } from './WebGLBindingStates.js';
3
8
  import { WebGLCapabilities } from './WebGLCapabilities.js';
9
+ import { WebGLClipping } from './WebGLClipping.js';
4
10
  import { WebGLCubeMaps } from './WebGLCubeMaps.js';
5
11
  import { WebGLExtensions } from './WebGLExtensions.js';
6
- import { WebGLClipping } from './WebGLClipping.js';
7
- import { WebGLBindingStates } from './WebGLBindingStates.js';
8
- import { Material } from '../../materials/Material.js';
9
- import { Scene } from '../../scenes/Scene.js';
12
+ import { WebGLLightsState } from './WebGLLights.js';
13
+ import { WebGLProgram } from './WebGLProgram.js';
14
+ import {
15
+ ColorSpace,
16
+ Combine,
17
+ DepthPackingStrategies,
18
+ GLSLVersion,
19
+ Mapping,
20
+ ShadowMapType,
21
+ ToneMapping,
22
+ } from '../../constants.js';
23
+
24
+ export interface WebGLProgramParameters {
25
+ isWebGL2: boolean;
26
+
27
+ shaderID: string;
28
+ shaderType: string;
29
+ shaderName: string;
30
+
31
+ vertexShader: string;
32
+ fragmentShader: string;
33
+ defines: { [define: string]: string | number | boolean } | undefined;
34
+
35
+ customVertexShaderID: string | undefined;
36
+ customFragmentShaderID: string | undefined;
37
+
38
+ isRawShaderMaterial: boolean;
39
+ glslVersion: GLSLVersion | null | undefined;
40
+
41
+ precision: 'lowp' | 'mediump' | 'highp';
42
+
43
+ batching: boolean;
44
+ instancing: boolean;
45
+ instancingColor: boolean;
46
+
47
+ supportsVertexTextures: boolean;
48
+ outputColorSpace: ColorSpace;
49
+ alphaToCoverage: boolean;
50
+
51
+ map: boolean;
52
+ matcap: boolean;
53
+ envMap: boolean;
54
+ envMapMode: Mapping | false;
55
+ envMapCubeUVHeight: number | null;
56
+ aoMap: boolean;
57
+ lightMap: boolean;
58
+ bumpMap: boolean;
59
+ normalMap: boolean;
60
+ displacementMap: boolean;
61
+ emissiveMap: boolean;
62
+
63
+ normalMapObjectSpace: boolean;
64
+ normalMapTangentSpace: boolean;
65
+
66
+ metalnessMap: boolean;
67
+ roughnessMap: boolean;
68
+
69
+ anisotropy: boolean;
70
+ anisotropyMap: boolean;
71
+
72
+ clearcoat: boolean;
73
+ clearcoatMap: boolean;
74
+ clearcoatNormalMap: boolean;
75
+ clearcoatRoughnessMap: boolean;
76
+
77
+ iridescence: boolean;
78
+ iridescenceMap: boolean;
79
+ iridescenceThicknessMap: boolean;
80
+
81
+ sheen: boolean;
82
+ sheenColorMap: boolean;
83
+ sheenRoughnessMap: boolean;
84
+
85
+ specularMap: boolean;
86
+ specularColorMap: boolean;
87
+ specularIntensityMap: boolean;
88
+
89
+ transmission: boolean;
90
+ transmissionMap: boolean;
91
+ thicknessMap: boolean;
92
+
93
+ gradientMap: boolean;
94
+
95
+ opaque: boolean;
96
+
97
+ alphaMap: boolean;
98
+ alphaTest: boolean;
99
+ alphaHash: boolean;
100
+
101
+ combine: Combine | undefined;
102
+
103
+ //
104
+
105
+ mapUv: string | false;
106
+ aoMapUv: string | false;
107
+ lightMapUv: string | false;
108
+ bumpMapUv: string | false;
109
+ normalMapUv: string | false;
110
+ displacementMapUv: string | false;
111
+ emissiveMapUv: string | false;
112
+
113
+ metalnessMapUv: string | false;
114
+ roughnessMapUv: string | false;
115
+
116
+ anisotropyMapUv: string | false;
117
+
118
+ clearcoatMapUv: string | false;
119
+ clearcoatNormalMapUv: string | false;
120
+ clearcoatRoughnessMapUv: string | false;
121
+
122
+ iridescenceMapUv: string | false;
123
+ iridescenceThicknessMapUv: string | false;
124
+
125
+ sheenColorMapUv: string | false;
126
+ sheenRoughnessMapUv: string | false;
127
+
128
+ specularMapUv: string | false;
129
+ specularColorMapUv: string | false;
130
+ specularIntensityMapUv: string | false;
131
+
132
+ transmissionMapUv: string | false;
133
+ thicknessMapUv: string | false;
134
+
135
+ alphaMapUv: string | false;
136
+
137
+ //
138
+
139
+ vertexTangents: boolean;
140
+ vertexColors: boolean;
141
+ vertexAlphas: boolean;
142
+ vertexUv1s: boolean;
143
+ vertexUv2s: boolean;
144
+ vertexUv3s: boolean;
145
+
146
+ pointsUvs: boolean;
147
+
148
+ fog: boolean;
149
+ useFog: boolean;
150
+ fogExp2: boolean;
151
+
152
+ flatShading: boolean;
153
+
154
+ sizeAttenuation: boolean;
155
+ logarithmicDepthBuffer: boolean;
156
+
157
+ skinning: boolean;
158
+
159
+ morphTargets: boolean;
160
+ morphNormals: boolean;
161
+ morphColors: boolean;
162
+ morphTargetsCount: number;
163
+ morphTextureStride: number;
164
+
165
+ numDirLights: number;
166
+ numPointLights: number;
167
+ numSpotLights: number;
168
+ numSpotLightMaps: number;
169
+ numRectAreaLights: number;
170
+ numHemiLights: number;
171
+
172
+ numDirLightShadows: number;
173
+ numPointLightShadows: number;
174
+ numSpotLightShadows: number;
175
+ numSpotLightShadowsWithMaps: number;
176
+
177
+ numLightProbes: number;
178
+
179
+ numClippingPlanes: number;
180
+ numClipIntersection: number;
181
+
182
+ dithering: boolean;
183
+
184
+ shadowMapEnabled: boolean;
185
+ shadowMapType: ShadowMapType;
186
+
187
+ toneMapping: ToneMapping;
188
+ useLegacyLights: boolean;
189
+
190
+ decodeVideoTexture: boolean;
191
+
192
+ premultipliedAlpha: boolean;
193
+
194
+ doubleSided: boolean;
195
+ flipSided: boolean;
196
+
197
+ useDepthPacking: boolean;
198
+ depthPacking: DepthPackingStrategies | 0;
199
+
200
+ index0AttributeName: string | undefined;
201
+
202
+ extensionDerivatives: boolean;
203
+ extensionFragDepth: boolean;
204
+ extensionDrawBuffers: boolean;
205
+ extensionShaderTextureLOD: boolean;
206
+ extensionClipCullDistance: boolean;
207
+ extensionMultiDraw: boolean;
208
+
209
+ rendererExtensionFragDepth: boolean;
210
+ rendererExtensionDrawBuffers: boolean;
211
+ rendererExtensionShaderTextureLod: boolean;
212
+ rendererExtensionParallelShaderCompile: boolean;
213
+
214
+ customProgramCacheKey: string;
215
+ }
216
+
217
+ export interface WebGLProgramParametersWithUniforms extends WebGLProgramParameters {
218
+ uniforms: { [uniform: string]: IUniform };
219
+ }
10
220
 
11
221
  export class WebGLPrograms {
12
222
  constructor(
@@ -20,9 +230,16 @@ export class WebGLPrograms {
20
230
 
21
231
  programs: WebGLProgram[];
22
232
 
23
- getParameters(material: Material, lights: any, shadows: object[], scene: Scene, object: any): any;
24
- getProgramCacheKey(parameters: any): string;
25
- getUniforms(material: Material): object;
26
- acquireProgram(parameters: any, cacheKey: string): WebGLProgram;
233
+ getParameters(
234
+ material: Material,
235
+ lights: WebGLLightsState,
236
+ shadows: Light[],
237
+ scene: Scene,
238
+ object: Object3D,
239
+ ): WebGLProgramParameters;
240
+
241
+ getProgramCacheKey(parameters: WebGLProgramParameters): string;
242
+ getUniforms(material: Material): { [uniform: string]: IUniform };
243
+ acquireProgram(parameters: WebGLProgramParametersWithUniforms, cacheKey: string): WebGLProgram;
27
244
  releaseProgram(program: WebGLProgram): void;
28
245
  }
@@ -0,0 +1,27 @@
1
+ import { Texture } from '../../textures/Texture.js';
2
+ import { Mesh } from '../../objects/Mesh.js';
3
+ import { WebGLRenderer } from '../WebGLRenderer.js';
4
+ import { WebXRArrayCamera } from './WebXRManager.js';
5
+
6
+ // FIXME Replace by XRWebGLDepthInformation when typed in @types/webxr
7
+ interface XRWebGLDepthInformation {
8
+ readonly texture: WebGLTexture;
9
+ readonly depthNear: number;
10
+ readonly depthFar: number;
11
+ }
12
+
13
+ export class WebXRDepthSensing {
14
+ texture: Texture | null;
15
+ mesh: Mesh | null;
16
+
17
+ depthNear: number;
18
+ depthFar: number;
19
+
20
+ constructor();
21
+
22
+ init(renderer: WebGLRenderer, depthData: XRWebGLDepthInformation, renderState: XRRenderState): void;
23
+
24
+ render(renderer: WebGLRenderer, cameraXR: WebXRArrayCamera): void;
25
+
26
+ reset(): void;
27
+ }
@@ -7,6 +7,7 @@ import { ArrayCamera } from '../../cameras/ArrayCamera.js';
7
7
  import { PerspectiveCamera } from '../../cameras/PerspectiveCamera.js';
8
8
  import { EventDispatcher } from '../../core/EventDispatcher.js';
9
9
  import { XRTargetRaySpace, XRGripSpace, XRHandSpace } from './WebXRController.js';
10
+ import { WebGLRenderer } from '../WebGLRenderer.js';
10
11
 
11
12
  export type WebXRCamera = PerspectiveCamera & { viewport: Vector4 };
12
13
  export type WebXRArrayCamera = Omit<ArrayCamera, 'cameras'> & { cameras: [WebXRCamera, WebXRCamera] };
@@ -21,7 +22,7 @@ export interface WebXRManagerEventMap {
21
22
  }
22
23
 
23
24
  export class WebXRManager extends EventDispatcher<WebXRManagerEventMap> {
24
- constructor(renderer: any, gl: WebGLRenderingContext);
25
+ constructor(renderer: WebGLRenderer, gl: WebGLRenderingContext);
25
26
 
26
27
  /**
27
28
  * @default false
@@ -0,0 +1,13 @@
1
+ import { CompressedTexture } from './CompressedTexture.js';
2
+ import { CompressedPixelFormat, TextureDataType } from '../constants.js';
3
+
4
+ export class CompressedCubeTexture extends CompressedTexture {
5
+ readonly isCompressedCubeTexture: true;
6
+ readonly isCubeTexture: true;
7
+
8
+ constructor(
9
+ images: Array<{ width: number; height: number }>,
10
+ format?: CompressedPixelFormat,
11
+ type?: TextureDataType,
12
+ );
13
+ }
@@ -53,7 +53,7 @@ export class DataArrayTexture extends Texture {
53
53
  * @param height Height of the texture. Default `1`.
54
54
  * @param depth Depth of the texture. Default `1`.
55
55
  */
56
- constructor(data?: BufferSource, width?: number, height?: number, depth?: number);
56
+ constructor(data?: BufferSource | null, width?: number, height?: number, depth?: number);
57
57
 
58
58
  /**
59
59
  * Read-only flag to check if a given object is of type {@link DataArrayTexture}.
@@ -26,7 +26,17 @@ export class Source {
26
26
  data: any;
27
27
 
28
28
  /**
29
- * Set this to `true` to trigger a data upload to the GPU next time the {@link Source} is used.
29
+ * This property is only relevant when {@link .needsUpdate} is set to `true` and provides more control on how
30
+ * texture data should be processed.
31
+ * When `dataReady` is set to `false`, the engine performs the memory allocation (if necessary) but does not
32
+ * transfer the data into the GPU memory.
33
+ * @default true
34
+ */
35
+ dataReady: boolean;
36
+
37
+ /**
38
+ * When the property is set to `true`, the engine allocates the memory for the texture (if necessary) and triggers
39
+ * the actual texture upload to the GPU next time the source is used.
30
40
  */
31
41
  set needsUpdate(value: boolean);
32
42
 
three/build/three.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from '../src/Three.js';
2
- export as namespace THREE;
@@ -1,2 +0,0 @@
1
- export * from '../src/Three.js';
2
- export as namespace THREE;