@types/three 0.158.3 → 0.160.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 (230) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +2 -1
  3. three/examples/jsm/cameras/CinematicCamera.d.ts +1 -1
  4. three/examples/jsm/helpers/TextureHelper.d.ts +10 -0
  5. three/examples/jsm/lines/LineMaterial.d.ts +2 -2
  6. three/examples/jsm/loaders/ColladaLoader.d.ts +1 -3
  7. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -1
  8. three/examples/jsm/loaders/KTX2Loader.d.ts +2 -8
  9. three/examples/jsm/loaders/MaterialXLoader.d.ts +6 -0
  10. three/examples/jsm/loaders/SVGLoader.d.ts +1 -5
  11. three/examples/jsm/math/Octree.d.ts +7 -3
  12. three/examples/jsm/misc/ProgressiveLightMap.d.ts +1 -1
  13. three/examples/jsm/misc/Timer.d.ts +80 -0
  14. three/examples/jsm/nodes/Nodes.d.ts +238 -60
  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 +7 -0
  18. three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +9 -2
  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 +7 -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/PointUVNode.d.ts +3 -0
  26. three/examples/jsm/nodes/accessors/PositionNode.d.ts +8 -0
  27. three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +4 -1
  28. three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +3 -0
  29. three/examples/jsm/nodes/accessors/SkinningNode.d.ts +3 -0
  30. three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +8 -1
  31. three/examples/jsm/nodes/accessors/TangentNode.d.ts +9 -0
  32. three/examples/jsm/nodes/accessors/TextureNode.d.ts +10 -2
  33. three/examples/jsm/nodes/accessors/UVNode.d.ts +3 -0
  34. three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
  35. three/examples/jsm/nodes/code/CodeNode.d.ts +4 -0
  36. three/examples/jsm/nodes/code/ExpressionNode.d.ts +3 -0
  37. three/examples/jsm/nodes/code/FunctionCallNode.d.ts +7 -1
  38. three/examples/jsm/nodes/code/FunctionNode.d.ts +17 -0
  39. three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +1 -1
  40. three/examples/jsm/nodes/core/AttributeNode.d.ts +3 -0
  41. three/examples/jsm/nodes/core/BypassNode.d.ts +3 -0
  42. three/examples/jsm/nodes/core/CacheNode.d.ts +3 -0
  43. three/examples/jsm/nodes/core/ConstNode.d.ts +3 -3
  44. three/examples/jsm/nodes/core/ContextNode.d.ts +3 -0
  45. three/examples/jsm/nodes/core/InputNode.d.ts +4 -4
  46. three/examples/jsm/nodes/core/NodeBuilder.d.ts +6 -3
  47. three/examples/jsm/nodes/core/NodeUniform.d.ts +12 -8
  48. three/examples/jsm/nodes/core/NodeUtils.d.ts +6 -3
  49. three/examples/jsm/nodes/core/PropertyNode.d.ts +9 -0
  50. three/examples/jsm/nodes/core/UniformNode.d.ts +12 -4
  51. three/examples/jsm/nodes/core/VarNode.d.ts +4 -0
  52. three/examples/jsm/nodes/core/VaryingNode.d.ts +3 -0
  53. three/examples/jsm/nodes/core/constants.d.ts +10 -8
  54. three/examples/jsm/nodes/display/BlendModeNode.d.ts +7 -2
  55. three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +18 -1
  56. three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +4 -0
  57. three/examples/jsm/nodes/display/FrontFacingNode.d.ts +4 -0
  58. three/examples/jsm/nodes/display/NormalMapNode.d.ts +7 -1
  59. three/examples/jsm/nodes/display/PosterizeNode.d.ts +6 -0
  60. three/examples/jsm/nodes/display/ToneMappingNode.d.ts +8 -1
  61. three/examples/jsm/nodes/display/ViewportNode.d.ts +8 -0
  62. three/examples/jsm/nodes/fog/FogExp2Node.d.ts +3 -0
  63. three/examples/jsm/nodes/fog/FogNode.d.ts +3 -0
  64. three/examples/jsm/nodes/fog/FogRangeNode.d.ts +3 -0
  65. three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +1 -1
  66. three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +1 -1
  67. three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +1 -1
  68. three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +1 -1
  69. three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +1 -1
  70. three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +1 -1
  71. three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +1 -1
  72. three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +1 -1
  73. three/examples/jsm/nodes/functions/material/getRoughness.d.ts +1 -1
  74. three/examples/jsm/nodes/geometry/RangeNode.d.ts +3 -0
  75. three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +7 -0
  76. three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +6 -1
  77. three/examples/jsm/nodes/lighting/LightsNode.d.ts +3 -0
  78. three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +18 -5
  79. three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +0 -3
  80. three/examples/jsm/nodes/materials/NodeMaterial.d.ts +25 -2
  81. three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +43 -34
  82. three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +5 -3
  83. three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +7 -5
  84. three/examples/jsm/nodes/math/CondNode.d.ts +7 -0
  85. three/examples/jsm/nodes/math/MathNode.d.ts +134 -1
  86. three/examples/jsm/nodes/math/OperatorNode.d.ts +51 -0
  87. three/examples/jsm/nodes/procedural/CheckerNode.d.ts +3 -0
  88. three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +75 -33
  89. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +4 -2
  90. three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +3 -0
  91. three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +6 -3
  92. three/examples/jsm/nodes/utils/OscNode.d.ts +6 -0
  93. three/examples/jsm/nodes/utils/RemapNode.d.ts +4 -0
  94. three/examples/jsm/nodes/utils/RotateUVNode.d.ts +3 -0
  95. three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +5 -1
  96. three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +7 -0
  97. three/examples/jsm/nodes/utils/TimerNode.d.ts +7 -1
  98. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +22 -7
  99. three/examples/jsm/objects/QuadMesh.d.ts +13 -0
  100. three/examples/jsm/postprocessing/GTAOPass.d.ts +118 -0
  101. three/examples/jsm/renderers/common/Info.d.ts +7 -2
  102. three/examples/jsm/renderers/common/Renderer.d.ts +2 -2
  103. three/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.d.ts +3 -0
  104. three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +1 -0
  105. three/examples/jsm/shaders/GTAOShader.d.ts +59 -0
  106. three/examples/jsm/shaders/PoissonDenoiseShader.d.ts +28 -0
  107. three/examples/jsm/utils/SortUtils.d.ts +7 -0
  108. three/package.json +3 -3
  109. three/src/Three.d.ts +2 -0
  110. three/src/animation/AnimationClip.d.ts +2 -2
  111. three/src/animation/AnimationMixer.d.ts +1 -1
  112. three/src/animation/KeyframeTrack.d.ts +3 -3
  113. three/src/animation/tracks/BooleanKeyframeTrack.d.ts +1 -1
  114. three/src/animation/tracks/ColorKeyframeTrack.d.ts +1 -1
  115. three/src/animation/tracks/NumberKeyframeTrack.d.ts +1 -1
  116. three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +1 -1
  117. three/src/animation/tracks/StringKeyframeTrack.d.ts +1 -1
  118. three/src/animation/tracks/VectorKeyframeTrack.d.ts +1 -1
  119. three/src/audio/Audio.d.ts +1 -1
  120. three/src/audio/AudioListener.d.ts +1 -1
  121. three/src/constants.d.ts +3 -1
  122. three/src/core/BufferAttribute.d.ts +27 -0
  123. three/src/core/BufferGeometry.d.ts +1 -1
  124. three/src/core/InterleavedBuffer.d.ts +27 -0
  125. three/src/core/InterleavedBufferAttribute.d.ts +2 -2
  126. three/src/core/Object3D.d.ts +48 -14
  127. three/src/core/Raycaster.d.ts +1 -0
  128. three/src/core/UniformsGroup.d.ts +3 -3
  129. three/src/extras/core/Curve.d.ts +2 -2
  130. three/src/extras/core/Path.d.ts +1 -1
  131. three/src/extras/core/Shape.d.ts +1 -1
  132. three/src/extras/core/ShapePath.d.ts +1 -1
  133. three/src/extras/curves/CatmullRomCurve3.d.ts +2 -2
  134. three/src/extras/curves/CubicBezierCurve.d.ts +2 -2
  135. three/src/extras/curves/CubicBezierCurve3.d.ts +2 -2
  136. three/src/extras/curves/EllipseCurve.d.ts +1 -1
  137. three/src/extras/curves/LineCurve.d.ts +2 -2
  138. three/src/extras/curves/LineCurve3.d.ts +2 -2
  139. three/src/extras/curves/QuadraticBezierCurve.d.ts +2 -2
  140. three/src/extras/curves/QuadraticBezierCurve3.d.ts +2 -2
  141. three/src/extras/curves/SplineCurve.d.ts +2 -2
  142. three/src/geometries/ExtrudeGeometry.d.ts +5 -5
  143. three/src/geometries/LatheGeometry.d.ts +2 -2
  144. three/src/geometries/PlaneGeometry.d.ts +1 -1
  145. three/src/geometries/PolyhedronGeometry.d.ts +1 -1
  146. three/src/geometries/RingGeometry.d.ts +1 -1
  147. three/src/geometries/ShapeGeometry.d.ts +2 -2
  148. three/src/geometries/SphereGeometry.d.ts +1 -1
  149. three/src/geometries/TorusGeometry.d.ts +1 -1
  150. three/src/geometries/TorusKnotGeometry.d.ts +1 -1
  151. three/src/geometries/TubeGeometry.d.ts +3 -3
  152. three/src/geometries/WireframeGeometry.d.ts +1 -1
  153. three/src/helpers/ArrowHelper.d.ts +4 -4
  154. three/src/helpers/AxesHelper.d.ts +1 -1
  155. three/src/helpers/Box3Helper.d.ts +3 -3
  156. three/src/helpers/CameraHelper.d.ts +2 -2
  157. three/src/helpers/DirectionalLightHelper.d.ts +6 -4
  158. three/src/helpers/GridHelper.d.ts +1 -1
  159. three/src/helpers/HemisphereLightHelper.d.ts +4 -4
  160. three/src/helpers/PlaneHelper.d.ts +2 -2
  161. three/src/helpers/PointLightHelper.d.ts +3 -3
  162. three/src/helpers/SkeletonHelper.d.ts +4 -4
  163. three/src/helpers/SpotLightHelper.d.ts +3 -3
  164. three/src/lights/DirectionalLight.d.ts +1 -1
  165. three/src/lights/DirectionalLightShadow.d.ts +1 -1
  166. three/src/lights/HemisphereLight.d.ts +1 -1
  167. three/src/lights/LightProbe.d.ts +1 -1
  168. three/src/lights/LightShadow.d.ts +5 -5
  169. three/src/lights/PointLight.d.ts +7 -0
  170. three/src/lights/PointLightShadow.d.ts +1 -1
  171. three/src/lights/SpotLight.d.ts +1 -1
  172. three/src/lights/SpotLightShadow.d.ts +1 -1
  173. three/src/loaders/MaterialLoader.d.ts +6 -3
  174. three/src/materials/LineBasicMaterial.d.ts +7 -0
  175. three/src/materials/LineDashedMaterial.d.ts +7 -1
  176. three/src/materials/Material.d.ts +16 -16
  177. three/src/materials/MeshBasicMaterial.d.ts +9 -2
  178. three/src/materials/MeshDepthMaterial.d.ts +7 -1
  179. three/src/materials/MeshDistanceMaterial.d.ts +9 -2
  180. three/src/materials/MeshLambertMaterial.d.ts +9 -2
  181. three/src/materials/MeshMatcapMaterial.d.ts +10 -3
  182. three/src/materials/MeshNormalMaterial.d.ts +9 -2
  183. three/src/materials/MeshPhongMaterial.d.ts +10 -3
  184. three/src/materials/MeshPhysicalMaterial.d.ts +6 -1
  185. three/src/materials/MeshStandardMaterial.d.ts +10 -5
  186. three/src/materials/MeshToonMaterial.d.ts +10 -3
  187. three/src/materials/PointsMaterial.d.ts +9 -2
  188. three/src/materials/RawShaderMaterial.d.ts +9 -0
  189. three/src/materials/ShaderMaterial.d.ts +9 -3
  190. three/src/materials/ShadowMaterial.d.ts +8 -1
  191. three/src/materials/SpriteMaterial.d.ts +9 -4
  192. three/src/math/Box3.d.ts +2 -2
  193. three/src/math/Frustum.d.ts +2 -2
  194. three/src/math/Matrix4.d.ts +30 -30
  195. three/src/math/Sphere.d.ts +5 -0
  196. three/src/math/Triangle.d.ts +8 -8
  197. three/src/math/Vector2.d.ts +1 -1
  198. three/src/math/Vector4.d.ts +1 -1
  199. three/src/objects/BatchedMesh.d.ts +169 -0
  200. three/src/objects/Bone.d.ts +1 -1
  201. three/src/objects/LOD.d.ts +2 -4
  202. three/src/objects/Line.d.ts +2 -4
  203. three/src/objects/LineLoop.d.ts +1 -1
  204. three/src/objects/LineSegments.d.ts +1 -1
  205. three/src/objects/Skeleton.d.ts +2 -8
  206. three/src/objects/SkinnedMesh.d.ts +1 -2
  207. three/src/renderers/WebGL3DRenderTarget.d.ts +7 -5
  208. three/src/renderers/WebGLArrayRenderTarget.d.ts +7 -5
  209. three/src/renderers/WebGLCubeRenderTarget.d.ts +2 -2
  210. three/src/renderers/WebGLRenderTarget.d.ts +1 -1
  211. three/src/renderers/shaders/ShaderChunk.d.ts +1 -0
  212. three/src/renderers/shaders/ShaderLib.d.ts +18 -18
  213. three/src/renderers/shaders/UniformsUtils.d.ts +3 -2
  214. three/src/renderers/webgl/WebGLAttributes.d.ts +1 -0
  215. three/src/renderers/webgl/WebGLBindingStates.d.ts +4 -4
  216. three/src/renderers/webgl/WebGLBufferRenderer.d.ts +4 -3
  217. three/src/renderers/webgl/WebGLClipping.d.ts +2 -2
  218. three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +5 -4
  219. three/src/renderers/webgl/WebGLLights.d.ts +39 -37
  220. three/src/renderers/webgl/WebGLPrograms.d.ts +225 -10
  221. three/src/renderers/webgl/WebGLRenderLists.d.ts +5 -5
  222. three/src/renderers/webgl/WebGLShadowMap.d.ts +2 -2
  223. three/src/scenes/Fog.d.ts +1 -1
  224. three/src/scenes/FogExp2.d.ts +1 -1
  225. three/src/textures/CompressedCubeTexture.d.ts +13 -0
  226. three/src/textures/Texture.d.ts +1 -1
  227. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +0 -310
  228. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +0 -166
  229. three/examples/jsm/objects/BatchedMesh.d.ts +0 -57
  230. three/examples/jsm/renderers/common/Animation.d.ts +0 -16
@@ -0,0 +1,118 @@
1
+ import {
2
+ Box3,
3
+ Camera,
4
+ Color,
5
+ ColorRepresentation,
6
+ DataTexture,
7
+ DepthTexture,
8
+ MeshNormalMaterial,
9
+ Scene,
10
+ ShaderMaterial,
11
+ Texture,
12
+ WebGLRenderer,
13
+ WebGLRenderTarget,
14
+ } from '../../../src/Three.js';
15
+
16
+ import { FullScreenQuad, Pass } from './Pass.js';
17
+
18
+ export class GTAOPass extends Pass {
19
+ width: number;
20
+ height: number;
21
+ clear: boolean;
22
+ camera: Camera;
23
+ scene: Scene;
24
+ output: number;
25
+ blendIntensity: number;
26
+
27
+ pdRings: number;
28
+ pdRadiusExponent: number;
29
+ pdSamples: number;
30
+
31
+ gtaoNoiseTexture: DataTexture;
32
+ pdNoiseTexture: DataTexture;
33
+
34
+ gtaoRenderTarget: WebGLRenderTarget;
35
+ pdRenderTarget: WebGLRenderTarget;
36
+
37
+ gtaoMaterial: ShaderMaterial;
38
+
39
+ normalMaterial: MeshNormalMaterial;
40
+
41
+ pdMaterial: ShaderMaterial;
42
+
43
+ depthRenderMaterial: ShaderMaterial;
44
+
45
+ copyMaterial: ShaderMaterial;
46
+
47
+ blendMaterial: ShaderMaterial;
48
+
49
+ fsQuad: FullScreenQuad;
50
+
51
+ originalClearColor: Color;
52
+
53
+ depthTexture: DepthTexture;
54
+ normalTexture: Texture;
55
+
56
+ constructor(
57
+ scene: Scene,
58
+ camera: Camera,
59
+ width?: number | undefined,
60
+ height?: number | undefined,
61
+ parameters?: { depthTexture?: DepthTexture | undefined; normalTexture?: Texture | undefined } | undefined,
62
+ );
63
+
64
+ setGBuffer(depthTexture?: DepthTexture | undefined, normalTexture?: Texture | undefined): void;
65
+
66
+ setSceneClipBox(box: Box3): void;
67
+
68
+ updateGtaoMaterial(parameters: {
69
+ radius?: number | undefined;
70
+ distanceExponent?: number | undefined;
71
+ thickness?: number | undefined;
72
+ distanceFallOff?: number | undefined;
73
+ scale?: number | undefined;
74
+ samples?: number | undefined;
75
+ screenSpaceRadius?: boolean | undefined;
76
+ }): void;
77
+
78
+ updatePdMaterial(parameters: {
79
+ lumaPhi?: number | undefined;
80
+ depthPhi?: number | undefined;
81
+ normalPhi?: number | undefined;
82
+ radius?: number | undefined;
83
+ radiusExponent?: number | undefined;
84
+ rings?: number | undefined;
85
+ samples?: number | undefined;
86
+ }): void;
87
+
88
+ renderPass(
89
+ renderer: WebGLRenderer,
90
+ passMaterial: ShaderMaterial,
91
+ renderTarget: WebGLRenderTarget | null,
92
+ clearColor?: ColorRepresentation | undefined,
93
+ clearAlpha?: number | undefined,
94
+ ): void;
95
+
96
+ renderOverride(
97
+ renderer: WebGLRenderer,
98
+ overrideMaterial: MeshNormalMaterial,
99
+ renderTarget: WebGLRenderTarget | null,
100
+ clearColor?: ColorRepresentation | undefined,
101
+ clearAlpha?: number | undefined,
102
+ ): void;
103
+
104
+ overrideVisibility(): void;
105
+
106
+ restoreVisibility(): void;
107
+
108
+ generateNoise(size?: number): DataTexture;
109
+
110
+ static OUTPUT: {
111
+ Default: 0;
112
+ Diffuse: 1;
113
+ Depth: 2;
114
+ Normal: 3;
115
+ AO: 4;
116
+ Denoise: 5;
117
+ };
118
+ }
@@ -1,9 +1,14 @@
1
1
  import { Object3D } from '../../../../src/Three.js';
2
2
 
3
3
  export default class Info {
4
- autoRest: boolean;
4
+ autoReset: boolean;
5
5
 
6
- render: { frame: number; drawCalls: number; triangles: number; points: number; lines: number };
6
+ frame: number;
7
+ calls: number;
8
+
9
+ render: { calls: number; drawCalls: number; triangles: number; points: number; lines: number };
10
+
11
+ compute: { calls: number };
7
12
 
8
13
  memory: { geometries: number; textures: number };
9
14
 
@@ -26,7 +26,7 @@ export default class Renderer {
26
26
 
27
27
  info: Info;
28
28
 
29
- constructor(backend: Backend);
29
+ constructor(backend: Backend, parameters?: { logarithmicDepthBuffer?: boolean | undefined });
30
30
 
31
31
  init(): Promise<void>;
32
32
 
@@ -34,7 +34,7 @@ export default class Renderer {
34
34
 
35
35
  render(scene: Scene, camera: Camera): Promise<void>;
36
36
 
37
- setAnimationLoop(callback: ((time: DOMHighResTimeStamp) => void) | null): void;
37
+ setAnimationLoop(callback: ((time: DOMHighResTimeStamp) => void) | null): Promise<void>;
38
38
 
39
39
  setPixelRatio(value?: number): void;
40
40
 
@@ -0,0 +1,3 @@
1
+ import { NodeFrame } from '../../../nodes/Nodes.js';
2
+
3
+ export const nodeFrame: NodeFrame;
@@ -5,5 +5,6 @@ export default class WebGPURenderer extends Renderer {
5
5
  canvas?: HTMLCanvasElement | undefined;
6
6
  antialias?: boolean | undefined;
7
7
  sampleCount?: number | undefined;
8
+ logarithmicDepthBuffer?: boolean | undefined;
8
9
  });
9
10
  }
@@ -0,0 +1,59 @@
1
+ import { DataTexture, IUniform, Matrix4, Vector2, Vector3 } from '../../../src/Three.js';
2
+
3
+ export const GTAOShader: {
4
+ name: string;
5
+ defines: {
6
+ PERSPECTIVE_CAMERA: number;
7
+ SAMPLES: number;
8
+ NORMAL_VECTOR_TYPE: number;
9
+ DEPTH_SWIZZLING: string;
10
+ SCREEN_SPACE_RADIUS: number;
11
+ SCREEN_SPACE_RADIUS_SCALE: number;
12
+ SCENE_CLIP_BOX: number;
13
+ };
14
+ uniforms: {
15
+ tNormal: IUniform;
16
+ tDepth: IUniform;
17
+ tNoise: IUniform;
18
+ resolution: IUniform<Vector2>;
19
+ cameraNear: IUniform;
20
+ cameraFar: IUniform;
21
+ cameraProjectionMatrix: IUniform<Matrix4>;
22
+ cameraProjectionMatrixInverse: IUniform<Matrix4>;
23
+ radius: IUniform<number>;
24
+ distanceExponent: IUniform<number>;
25
+ thickness: IUniform<number>;
26
+ distanceFallOff: IUniform<number>;
27
+ scale: IUniform<number>;
28
+ sceneBoxMin: IUniform<Vector3>;
29
+ sceneBoxMax: IUniform<Vector3>;
30
+ };
31
+ vertexShader: string;
32
+ fragmentShader: string;
33
+ };
34
+
35
+ export const GTAODepthShader: {
36
+ name: string;
37
+ defines: {
38
+ PERSPECTIVE_CAMERA: number;
39
+ };
40
+ uniforms: {
41
+ tDepth: IUniform;
42
+ cameraNear: IUniform;
43
+ cameraFar: IUniform;
44
+ };
45
+ vertexShader: string;
46
+ fragmentShader: string;
47
+ };
48
+
49
+ export const GTAOBlendShader: {
50
+ name: string;
51
+ uniforms: {
52
+ tDiffuse: IUniform;
53
+ intensity: IUniform<number>;
54
+ };
55
+ vertexShader: string;
56
+ fragmentShader: string;
57
+ };
58
+
59
+ export function generateMagicSquareNoise(samples?: number): DataTexture;
@@ -0,0 +1,28 @@
1
+ import { IUniform, Matrix4, Vector2 } from '../../../src/Three.js';
2
+
3
+ export const PoissonDenoiseShader: {
4
+ name: string;
5
+ defines: {
6
+ SAMPLES: number;
7
+ SAMPLE_VECTORS: string;
8
+ NORMAL_VECTOR_TYPE: number;
9
+ DEPTH_VALUE_SOURCE: number;
10
+ };
11
+ uniforms: {
12
+ tDiffuse: IUniform;
13
+ tNormal: IUniform;
14
+ tDepth: IUniform;
15
+ tNoise: IUniform;
16
+ resolution: IUniform<Vector2>;
17
+ cameraProjectionMatrixInverse: IUniform<Matrix4>;
18
+ lumaPhi: IUniform<number>;
19
+ depthPhi: IUniform<number>;
20
+ normalPhi: IUniform<number>;
21
+ radius: IUniform<number>;
22
+ index: IUniform<number>;
23
+ };
24
+ vertexShader: string;
25
+ fragmentShader: string;
26
+ };
27
+
28
+ export function generatePdSamplePointInitializer(samples: number, rings: number, radiusExponent: number): string;
@@ -0,0 +1,7 @@
1
+ export interface RadixSortOptions<T> {
2
+ aux?: T[] | undefined;
3
+ get?: ((el: T) => number) | undefined;
4
+ reversed?: boolean | undefined;
5
+ }
6
+
7
+ export const radixSort: <T = number>(arr: T[], opt?: RadixSortOptions<T>) => void;
three/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/three",
3
- "version": "0.158.3",
3
+ "version": "0.160.0",
4
4
  "description": "TypeScript definitions for three",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
6
6
  "license": "MIT",
@@ -44,6 +44,6 @@
44
44
  "fflate": "~0.6.10",
45
45
  "meshoptimizer": "~0.18.1"
46
46
  },
47
- "typesPublisherContentHash": "63e0c6a37dc1c160eecdbe61741d097ff25ba5c1e0bd8a134ae21d23bc71b38f",
48
- "typeScriptVersion": "4.5"
47
+ "typesPublisherContentHash": "7de688c4d074af1d79f7696d827bdd1236ff9e159d0b343b35e0b152202c544e",
48
+ "typeScriptVersion": "4.6"
49
49
  }
three/src/Three.d.ts CHANGED
@@ -165,6 +165,7 @@ export { MathUtils };
165
165
  export * from './objects/Sprite.js';
166
166
  export * from './objects/LOD.js';
167
167
  export * from './objects/InstancedMesh.js';
168
+ export * from './objects/BatchedMesh.js';
168
169
  export * from './objects/SkinnedMesh.js';
169
170
  export * from './objects/Skeleton.js';
170
171
  export * from './objects/Bone.js';
@@ -222,6 +223,7 @@ export * from './scenes/Scene.js';
222
223
  */
223
224
  export * from './textures/VideoTexture.js';
224
225
  export * from './textures/CompressedArrayTexture.js';
226
+ export * from './textures/CompressedCubeTexture.js';
225
227
  export * from './textures/DataTexture.js';
226
228
  export * from './textures/CompressedTexture.js';
227
229
  export * from './textures/CubeTexture.js';
@@ -1,6 +1,6 @@
1
1
  import { KeyframeTrack } from './KeyframeTrack.js';
2
- import { Vector3 } from './../math/Vector3.js';
3
- import { Bone } from './../objects/Bone.js';
2
+ import { Vector3 } from '../math/Vector3.js';
3
+ import { Bone } from '../objects/Bone.js';
4
4
  import { AnimationBlendMode } from '../constants.js';
5
5
 
6
6
  export interface MorphTarget {
@@ -1,7 +1,7 @@
1
1
  import { AnimationClip } from './AnimationClip.js';
2
2
  import { AnimationAction } from './AnimationAction.js';
3
3
  import { AnimationBlendMode } from '../constants.js';
4
- import { EventDispatcher } from './../core/EventDispatcher.js';
4
+ import { EventDispatcher } from '../core/EventDispatcher.js';
5
5
  import { Object3D } from '../core/Object3D.js';
6
6
  import { AnimationObjectGroup } from './AnimationObjectGroup.js';
7
7
 
@@ -1,6 +1,6 @@
1
- import { DiscreteInterpolant } from './../math/interpolants/DiscreteInterpolant.js';
2
- import { LinearInterpolant } from './../math/interpolants/LinearInterpolant.js';
3
- import { CubicInterpolant } from './../math/interpolants/CubicInterpolant.js';
1
+ import { DiscreteInterpolant } from '../math/interpolants/DiscreteInterpolant.js';
2
+ import { LinearInterpolant } from '../math/interpolants/LinearInterpolant.js';
3
+ import { CubicInterpolant } from '../math/interpolants/CubicInterpolant.js';
4
4
  import { Interpolant } from '../math/Interpolant.js';
5
5
  import { InterpolationModes } from '../constants.js';
6
6
 
@@ -1,4 +1,4 @@
1
- import { KeyframeTrack } from './../KeyframeTrack.js';
1
+ import { KeyframeTrack } from '../KeyframeTrack.js';
2
2
 
3
3
  export class BooleanKeyframeTrack extends KeyframeTrack {
4
4
  constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>);
@@ -1,4 +1,4 @@
1
- import { KeyframeTrack } from './../KeyframeTrack.js';
1
+ import { KeyframeTrack } from '../KeyframeTrack.js';
2
2
  import { InterpolationModes } from '../../constants.js';
3
3
 
4
4
  export class ColorKeyframeTrack extends KeyframeTrack {
@@ -1,4 +1,4 @@
1
- import { KeyframeTrack } from './../KeyframeTrack.js';
1
+ import { KeyframeTrack } from '../KeyframeTrack.js';
2
2
  import { InterpolationModes } from '../../constants.js';
3
3
 
4
4
  export class NumberKeyframeTrack extends KeyframeTrack {
@@ -1,4 +1,4 @@
1
- import { KeyframeTrack } from './../KeyframeTrack.js';
1
+ import { KeyframeTrack } from '../KeyframeTrack.js';
2
2
  import { InterpolationModes } from '../../constants.js';
3
3
 
4
4
  export class QuaternionKeyframeTrack extends KeyframeTrack {
@@ -1,4 +1,4 @@
1
- import { KeyframeTrack } from './../KeyframeTrack.js';
1
+ import { KeyframeTrack } from '../KeyframeTrack.js';
2
2
  import { InterpolationModes } from '../../constants.js';
3
3
 
4
4
  export class StringKeyframeTrack extends KeyframeTrack {
@@ -1,4 +1,4 @@
1
- import { KeyframeTrack } from './../KeyframeTrack.js';
1
+ import { KeyframeTrack } from '../KeyframeTrack.js';
2
2
  import { InterpolationModes } from '../../constants.js';
3
3
 
4
4
  export class VectorKeyframeTrack extends KeyframeTrack {
@@ -1,4 +1,4 @@
1
- import { Object3D } from './../core/Object3D.js';
1
+ import { Object3D } from '../core/Object3D.js';
2
2
  import { AudioListener } from './AudioListener.js';
3
3
  import { AudioContext } from './AudioContext.js';
4
4
 
@@ -1,4 +1,4 @@
1
- import { Object3D } from './../core/Object3D.js';
1
+ import { Object3D } from '../core/Object3D.js';
2
2
  import { AudioContext } from './AudioContext.js';
3
3
 
4
4
  /**
three/src/constants.d.ts CHANGED
@@ -140,13 +140,15 @@ export const ReinhardToneMapping: 2;
140
140
  export const CineonToneMapping: 3;
141
141
  export const ACESFilmicToneMapping: 4;
142
142
  export const CustomToneMapping: 5;
143
+ export const AgXToneMapping: 6;
143
144
  export type ToneMapping =
144
145
  | typeof NoToneMapping
145
146
  | typeof LinearToneMapping
146
147
  | typeof ReinhardToneMapping
147
148
  | typeof CineonToneMapping
148
149
  | typeof ACESFilmicToneMapping
149
- | typeof CustomToneMapping;
150
+ | typeof CustomToneMapping
151
+ | typeof AgXToneMapping;
150
152
 
151
153
  // Bind modes
152
154
  export const AttachedBindMode: 'attached';
@@ -88,6 +88,7 @@ export class BufferAttribute {
88
88
  /**
89
89
  * This can be used to only update some components of stored vectors (for example, just the component related to color).
90
90
  * @defaultValue `{ offset: number = 0; count: number = -1 }`
91
+ * @deprecated Will be removed in r169. Use "addUpdateRange()" instead.
91
92
  */
92
93
  updateRange: {
93
94
  /**
@@ -99,6 +100,21 @@ export class BufferAttribute {
99
100
  count: number;
100
101
  };
101
102
 
103
+ /**
104
+ * This can be used to only update some components of stored vectors (for example, just the component related to
105
+ * color). Use the {@link .addUpdateRange} function to add ranges to this array.
106
+ */
107
+ updateRanges: Array<{
108
+ /**
109
+ * Position at which to start update.
110
+ */
111
+ start: number;
112
+ /**
113
+ * The number of components to update.
114
+ */
115
+ count: number;
116
+ }>;
117
+
102
118
  /**
103
119
  * A version number, incremented every time the {@link BufferAttribute.needsUpdate | needsUpdate} property is set to true.
104
120
  * @remarks Expects a `Integer`
@@ -159,6 +175,17 @@ export class BufferAttribute {
159
175
  */
160
176
  setUsage(usage: Usage): this;
161
177
 
178
+ /**
179
+ * Adds a range of data in the data array to be updated on the GPU. Adds an object describing the range to the
180
+ * {@link .updateRanges} array.
181
+ */
182
+ addUpdateRange(start: number, count: number): void;
183
+
184
+ /**
185
+ * Clears the {@link .updateRanges} array.
186
+ */
187
+ clearUpdateRanges(): void;
188
+
162
189
  /**
163
190
  * @returns a copy of this {@link BufferAttribute}.
164
191
  */
@@ -188,7 +188,7 @@ export class BufferGeometry<
188
188
  * An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned.
189
189
  * @defaultValue `{}`
190
190
  */
191
- userData: { [key: string]: any };
191
+ userData: Record<string, any>;
192
192
 
193
193
  /**
194
194
  * Read-only flag to check if a given object is of type {@link BufferGeometry}.
@@ -43,6 +43,7 @@ export class InterleavedBuffer {
43
43
  /**
44
44
  * Object containing offset and count.
45
45
  * @defaultValue `{ offset: number = 0; count: number = -1 }`
46
+ * @deprecated Will be removed in r169. Use "addUpdateRange()" instead.
46
47
  */
47
48
  updateRange: {
48
49
  /** @defaultValue `0` */
@@ -51,6 +52,21 @@ export class InterleavedBuffer {
51
52
  count: number;
52
53
  };
53
54
 
55
+ /**
56
+ * This can be used to only update some components of stored data. Use the {@link .addUpdateRange} function to add
57
+ * ranges to this array.
58
+ */
59
+ updateRanges: Array<{
60
+ /**
61
+ * Position at which to start update.
62
+ */
63
+ start: number;
64
+ /**
65
+ * The number of components to update.
66
+ */
67
+ count: number;
68
+ }>;
69
+
54
70
  /**
55
71
  * A version number, incremented every time the {@link BufferAttribute.needsUpdate | needsUpdate} property is set to true.
56
72
  * @remarks Expects a `Integer`
@@ -99,6 +115,17 @@ export class InterleavedBuffer {
99
115
  */
100
116
  setUsage(value: Usage): this;
101
117
 
118
+ /**
119
+ * Adds a range of data in the data array to be updated on the GPU. Adds an object describing the range to the
120
+ * {@link .updateRanges} array.
121
+ */
122
+ addUpdateRange(start: number, count: number): void;
123
+
124
+ /**
125
+ * Clears the {@link .updateRanges} array.
126
+ */
127
+ clearUpdateRanges(): void;
128
+
102
129
  /**
103
130
  * Copies another {@link InterleavedBuffer} to this {@link InterleavedBuffer} instance.
104
131
  * @param source
@@ -1,7 +1,7 @@
1
1
  import { BufferAttribute, TypedArray } from './BufferAttribute.js';
2
2
  import { InterleavedBuffer } from './InterleavedBuffer.js';
3
- import { Matrix4 } from './../math/Matrix4.js';
4
- import { Matrix } from './../math/Matrix3.js';
3
+ import { Matrix4 } from '../math/Matrix4.js';
4
+ import { Matrix } from '../math/Matrix3.js';
5
5
 
6
6
  /**
7
7
  * @see {@link https://threejs.org/docs/index.html#api/en/core/InterleavedBufferAttribute | Official Documentation}
@@ -208,7 +208,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
208
208
  * @remarks It should not hold references to _functions_ as these **will not** be cloned.
209
209
  * @default `{}`
210
210
  */
211
- userData: { [key: string]: any }; // TODO Replace this to a Record?
211
+ userData: Record<string, any>;
212
212
 
213
213
  /**
214
214
  * Custom depth material to be used when rendering to the depth map.
@@ -225,15 +225,49 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
225
225
  */
226
226
  customDistanceMaterial?: Material | undefined;
227
227
 
228
+ /**
229
+ * An optional callback that is executed immediately before a 3D object is rendered to a shadow map.
230
+ * @remarks This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry,
231
+ * depthMaterial, group.
232
+ * @remarks Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which
233
+ * define their visual appearance with geometries and materials like instances of {@link Mesh}, {@link Line},
234
+ * {@link Points} or {@link Sprite}. Instances of {@link Object3D}, {@link Group} or {@link Bone} are not renderable
235
+ * and thus this callback is not executed for such objects.
236
+ */
237
+ onBeforeShadow(
238
+ renderer: WebGLRenderer,
239
+ scene: Scene,
240
+ shadowCamera: Camera,
241
+ geometry: BufferGeometry,
242
+ depthMaterial: Material,
243
+ group: Group,
244
+ ): void;
245
+
246
+ /**
247
+ * An optional callback that is executed immediately after a 3D object is rendered to a shadow map.
248
+ * @remarks This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry,
249
+ * depthMaterial, group.
250
+ * @remarks Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which
251
+ * define their visual appearance with geometries and materials like instances of {@link Mesh}, {@link Line},
252
+ * {@link Points} or {@link Sprite}. Instances of {@link Object3D}, {@link Group} or {@link Bone} are not renderable
253
+ * and thus this callback is not executed for such objects.
254
+ */
255
+ onAfterShadow(
256
+ renderer: WebGLRenderer,
257
+ scene: Scene,
258
+ shadowCamera: Camera,
259
+ geometry: BufferGeometry,
260
+ depthMaterial: Material,
261
+ group: Group,
262
+ ): void;
263
+
228
264
  /**
229
265
  * An optional callback that is executed immediately before a 3D object is rendered.
230
266
  * @remarks This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
231
- * @remarks Please notice that this callback is only executed for `renderable` 3D objects.
232
- * Meaning 3D objects which define their visual appearance with geometries and materials like
233
- * instances of {@link THREE.Object3DMesh | Mesh}, {@link THREE.Object3DLine | Line}, {@link THREE.Object3DPoints | Points} or {@link THREE.Object3DSprite | Sprite}.
234
- * Instances of {@link THREE.Object3DObject3D | Object3D}, {@link THREE.Object3DGroup | Group} or {@link THREE.Object3DBone | Bone}
235
- * are not renderable and thus this callback is not executed for such objects.
236
- * @defaultValue `() => {}`
267
+ * @remarks Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which
268
+ * define their visual appearance with geometries and materials like instances of {@link Mesh}, {@link Line},
269
+ * {@link Points} or {@link Sprite}. Instances of {@link Object3D}, {@link Group} or {@link Bone} are not renderable
270
+ * and thus this callback is not executed for such objects.
237
271
  */
238
272
  onBeforeRender(
239
273
  renderer: WebGLRenderer,
@@ -247,12 +281,10 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
247
281
  /**
248
282
  * An optional callback that is executed immediately after a 3D object is rendered.
249
283
  * @remarks This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
250
- * @remarks Please notice that this callback is only executed for `renderable` 3D objects.
251
- * Meaning 3D objects which define their visual appearance with geometries and materials like
252
- * instances of {@link THREE.Object3DMesh | Mesh}, {@link THREE.Object3DLine | Line}, {@link THREE.Object3DPoints | Points} or {@link THREE.Object3DSprite | Sprite}.
253
- * Instances of {@link THREE.Object3DObject3D | Object3D}, {@link THREE.Object3DGroup | Group} or {@link THREE.Object3DBone | Bone}
254
- * are not renderable and thus this callback is not executed for such objects.
255
- * @defaultValue `() => {}`
284
+ * @remarks Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which
285
+ * define their visual appearance with geometries and materials like instances of {@link Mesh}, {@link Line},
286
+ * {@link Points} or {@link Sprite}. Instances of {@link Object3D}, {@link Group} or {@link Bone} are not renderable
287
+ * and thus this callback is not executed for such objects.
256
288
  */
257
289
  onAfterRender(
258
290
  renderer: WebGLRenderer,
@@ -474,8 +506,10 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
474
506
  * and returns the first with a property that matches the value given.
475
507
  * @param name The property name to search for.
476
508
  * @param value Value of the given property.
509
+ * @param optionalTarget target to set the result. Otherwise a new Array is instantiated. If set, you must clear
510
+ * this array prior to each call (i.e., array.length = 0;).
477
511
  */
478
- getObjectsByProperty(name: string, value: any): Object3D[];
512
+ getObjectsByProperty(name: string, value: any, optionalTarget?: Object3D[]): Object3D[];
479
513
 
480
514
  /**
481
515
  * Returns a vector representing the position of the object in world space.
@@ -32,6 +32,7 @@ export interface Intersection<TIntersected extends Object3D = Object3D> {
32
32
  /** The index number of the instance where the ray intersects the {@link THREE.InstancedMesh | InstancedMesh } */
33
33
  instanceId?: number | undefined;
34
34
  pointOnLine?: Vector3;
35
+ batchId?: number;
35
36
  }
36
37
 
37
38
  export interface RaycasterParameters {
@@ -15,11 +15,11 @@ export class UniformsGroup extends EventDispatcher<{ dispose: {} }> {
15
15
 
16
16
  usage: Usage;
17
17
 
18
- uniforms: Uniform[];
18
+ uniforms: Array<Uniform | Uniform[]>;
19
19
 
20
- add(uniform: Uniform): this;
20
+ add(uniform: Uniform | Uniform[]): this;
21
21
 
22
- remove(uniform: Uniform): this;
22
+ remove(uniform: Uniform | Uniform[]): this;
23
23
 
24
24
  setName(name: string): this;
25
25
 
@@ -1,5 +1,5 @@
1
- import { Vector } from './../../math/Vector2.js';
2
- import { Vector3 } from './../../math/Vector3.js';
1
+ import { Vector } from '../../math/Vector2.js';
2
+ import { Vector3 } from '../../math/Vector3.js';
3
3
 
4
4
  /**
5
5
  * An abstract base class for creating a {@link Curve} object that contains methods for interpolation
@@ -1,4 +1,4 @@
1
- import { Vector2 } from './../../math/Vector2.js';
1
+ import { Vector2 } from '../../math/Vector2.js';
2
2
  import { CurvePath } from './CurvePath.js';
3
3
 
4
4
  /**