@types/three 0.168.0 → 0.170.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 (213) hide show
  1. three/README.md +1 -1
  2. three/build/three.webgpu.nodes.d.ts +1 -0
  3. three/build/three.webgpu.nodes.min.d.ts +1 -0
  4. three/examples/jsm/Addons.d.ts +3 -10
  5. three/examples/jsm/animation/MMDAnimationHelper.d.ts +4 -0
  6. three/examples/jsm/animation/MMDPhysics.d.ts +4 -0
  7. three/examples/jsm/controls/ArcballControls.d.ts +1 -1
  8. three/examples/jsm/controls/DragControls.d.ts +0 -15
  9. three/examples/jsm/controls/TransformControls.d.ts +195 -24
  10. three/examples/jsm/csm/CSMFrustum.d.ts +8 -2
  11. three/examples/jsm/csm/CSMHelper.d.ts +2 -1
  12. three/examples/jsm/csm/CSMShadowNode.d.ts +46 -0
  13. three/examples/jsm/curves/NURBSCurve.d.ts +12 -1
  14. three/examples/jsm/exporters/EXRExporter.d.ts +7 -2
  15. three/examples/jsm/exporters/GLTFExporter.d.ts +20 -3
  16. three/examples/jsm/exporters/KTX2Exporter.d.ts +3 -1
  17. three/examples/jsm/exporters/MMDExporter.d.ts +4 -0
  18. three/examples/jsm/exporters/USDZExporter.d.ts +4 -0
  19. three/examples/jsm/geometries/DecalGeometry.d.ts +9 -3
  20. three/examples/jsm/geometries/TeapotGeometry.d.ts +2 -2
  21. three/examples/jsm/helpers/LightProbeHelper.d.ts +5 -3
  22. three/examples/jsm/helpers/LightProbeHelperGPU.d.ts +12 -0
  23. three/examples/jsm/helpers/TextureHelperGPU.d.ts +10 -0
  24. three/examples/jsm/lighting/TiledLighting.d.ts +10 -0
  25. three/examples/jsm/lights/LightProbeGenerator.d.ts +5 -1
  26. three/examples/jsm/lines/Line2.d.ts +15 -1
  27. three/examples/jsm/lines/LineGeometry.d.ts +18 -1
  28. three/examples/jsm/lines/LineMaterial.d.ts +65 -12
  29. three/examples/jsm/lines/LineSegments2.d.ts +25 -2
  30. three/examples/jsm/lines/LineSegmentsGeometry.d.ts +46 -9
  31. three/examples/jsm/lines/Wireframe.d.ts +5 -2
  32. three/examples/jsm/lines/WireframeGeometry2.d.ts +1 -1
  33. three/examples/jsm/lines/webgpu/Wireframe.d.ts +13 -0
  34. three/examples/jsm/loaders/DRACOLoader.d.ts +6 -0
  35. three/examples/jsm/loaders/EXRLoader.d.ts +2 -2
  36. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -2
  37. three/examples/jsm/loaders/KTX2Loader.d.ts +1 -0
  38. three/examples/jsm/loaders/LDrawLoader.d.ts +10 -0
  39. three/examples/jsm/loaders/MMDLoader.d.ts +4 -0
  40. three/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts +9 -0
  41. three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts +9 -0
  42. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +0 -1
  43. three/examples/jsm/math/ColorSpaces.d.ts +11 -0
  44. three/examples/jsm/misc/ProgressiveLightMap.d.ts +8 -10
  45. three/examples/jsm/misc/ProgressiveLightMapGPU.d.ts +27 -0
  46. three/examples/jsm/modifiers/CurveModifier.d.ts +7 -3
  47. three/examples/jsm/modifiers/CurveModifierGPU.d.ts +31 -0
  48. three/examples/jsm/objects/Lensflare.d.ts +13 -9
  49. three/examples/jsm/objects/LensflareMesh.d.ts +21 -0
  50. three/examples/jsm/renderers/SVGRenderer.d.ts +2 -2
  51. three/{src/nodes → examples/jsm/tsl}/display/AfterImageNode.d.ts +1 -5
  52. three/{src/nodes → examples/jsm/tsl}/display/AnaglyphPassNode.d.ts +2 -3
  53. three/{src/nodes → examples/jsm/tsl}/display/AnamorphicNode.d.ts +2 -4
  54. three/examples/jsm/tsl/display/BleachBypass.d.ts +3 -0
  55. three/{src/nodes → examples/jsm/tsl}/display/BloomNode.d.ts +1 -5
  56. three/{src/nodes → examples/jsm/tsl}/display/DenoiseNode.d.ts +2 -6
  57. three/{src/nodes → examples/jsm/tsl}/display/DepthOfFieldNode.d.ts +1 -5
  58. three/{src/nodes → examples/jsm/tsl}/display/DotScreenNode.d.ts +2 -5
  59. three/{src/nodes → examples/jsm/tsl}/display/FXAANode.d.ts +1 -3
  60. three/{src/nodes → examples/jsm/tsl}/display/FilmNode.d.ts +1 -3
  61. three/{src/nodes → examples/jsm/tsl}/display/GTAONode.d.ts +2 -8
  62. three/{src/nodes → examples/jsm/tsl}/display/GaussianBlurNode.d.ts +13 -5
  63. three/examples/jsm/tsl/display/LensflareNode.d.ts +35 -0
  64. three/{src/nodes → examples/jsm/tsl}/display/Lut3DNode.d.ts +2 -6
  65. three/{src/nodes → examples/jsm/tsl}/display/MotionBlur.d.ts +1 -2
  66. three/examples/jsm/tsl/display/OutlineNode.d.ts +32 -0
  67. three/{src/nodes → examples/jsm/tsl}/display/ParallaxBarrierPassNode.d.ts +2 -3
  68. three/{src/nodes → examples/jsm/tsl}/display/PixelationPassNode.d.ts +2 -5
  69. three/{src/nodes → examples/jsm/tsl}/display/RGBShiftNode.d.ts +1 -4
  70. three/examples/jsm/tsl/display/SMAANode.d.ts +17 -0
  71. three/{src/nodes → examples/jsm/tsl}/display/SSAAPassNode.d.ts +2 -7
  72. three/examples/jsm/tsl/display/SSRNode.d.ts +38 -0
  73. three/examples/jsm/tsl/display/Sepia.d.ts +3 -0
  74. three/{src/nodes → examples/jsm/tsl}/display/SobelOperatorNode.d.ts +1 -3
  75. three/{src/nodes → examples/jsm/tsl}/display/StereoCompositePassNode.d.ts +2 -5
  76. three/{src/nodes → examples/jsm/tsl}/display/StereoPassNode.d.ts +2 -5
  77. three/examples/jsm/tsl/display/TRAAPassNode.d.ts +15 -0
  78. three/{src/nodes → examples/jsm/tsl}/display/TransitionNode.d.ts +1 -5
  79. three/examples/jsm/tsl/display/hashBlur.d.ts +7 -0
  80. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +22 -0
  81. three/examples/jsm/utils/GeometryCompressionUtils.d.ts +20 -4
  82. three/examples/jsm/utils/ShadowMapViewer.d.ts +8 -6
  83. three/examples/jsm/utils/ShadowMapViewerGPU.d.ts +26 -0
  84. three/examples/jsm/utils/SkeletonUtils.d.ts +25 -5
  85. three/examples/jsm/utils/WebGPUTextureUtils.d.ts +3 -0
  86. three/package.json +4 -3
  87. three/src/Three.WebGPU.Nodes.d.ts +205 -0
  88. three/src/Three.WebGPU.d.ts +7 -2
  89. three/src/Three.d.ts +2 -7
  90. three/src/audio/Audio.d.ts +4 -1
  91. three/src/constants.d.ts +1 -9
  92. three/src/core/BufferAttribute.d.ts +0 -15
  93. three/src/core/BufferGeometry.d.ts +13 -2
  94. three/src/core/InterleavedBuffer.d.ts +0 -12
  95. three/src/core/Object3D.d.ts +1 -1
  96. three/src/core/Raycaster.d.ts +2 -1
  97. three/src/core/RenderTarget.d.ts +1 -2
  98. three/src/extras/Controls.d.ts +3 -3
  99. three/src/loaders/FileLoader.d.ts +3 -3
  100. three/src/loaders/MaterialLoader.d.ts +2 -0
  101. three/src/loaders/nodes/NodeLoader.d.ts +5 -0
  102. three/src/loaders/nodes/NodeMaterialLoader.d.ts +3 -0
  103. three/src/loaders/nodes/NodeObjectLoader.d.ts +12 -0
  104. three/src/materials/LineBasicMaterial.d.ts +0 -5
  105. three/src/materials/LineDashedMaterial.d.ts +0 -5
  106. three/src/materials/Material.d.ts +4 -6
  107. three/src/materials/MeshBasicMaterial.d.ts +0 -5
  108. three/src/materials/MeshDepthMaterial.d.ts +0 -5
  109. three/src/materials/MeshDistanceMaterial.d.ts +0 -5
  110. three/src/materials/MeshLambertMaterial.d.ts +0 -5
  111. three/src/materials/MeshMatcapMaterial.d.ts +0 -5
  112. three/src/materials/MeshNormalMaterial.d.ts +0 -5
  113. three/src/materials/MeshPhongMaterial.d.ts +0 -5
  114. three/src/materials/MeshPhysicalMaterial.d.ts +0 -5
  115. three/src/materials/MeshStandardMaterial.d.ts +0 -5
  116. three/src/materials/MeshToonMaterial.d.ts +0 -5
  117. three/src/materials/PointsMaterial.d.ts +0 -5
  118. three/src/materials/RawShaderMaterial.d.ts +0 -2
  119. three/src/materials/ShaderMaterial.d.ts +0 -5
  120. three/src/materials/ShadowMaterial.d.ts +0 -5
  121. three/src/materials/SpriteMaterial.d.ts +0 -5
  122. three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +2 -2
  123. three/src/materials/nodes/NodeMaterial.d.ts +4 -4
  124. three/src/materials/nodes/NodeMaterials.d.ts +19 -16
  125. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +96 -0
  126. three/src/math/Color.d.ts +39 -22
  127. three/src/math/ColorManagement.d.ts +24 -24
  128. three/src/math/Quaternion.d.ts +4 -3
  129. three/src/math/Triangle.d.ts +24 -0
  130. three/src/math/Vector4.d.ts +2 -0
  131. three/src/nodes/Nodes.d.ts +3 -23
  132. three/src/nodes/TSL.d.ts +75 -187
  133. three/src/nodes/accessors/BufferAttributeNode.d.ts +1 -0
  134. three/src/nodes/accessors/Camera.d.ts +0 -1
  135. three/src/nodes/accessors/MaterialNode.d.ts +0 -1
  136. three/src/nodes/accessors/ModelNode.d.ts +7 -3
  137. three/src/nodes/accessors/Normal.d.ts +6 -0
  138. three/src/nodes/accessors/Object3DNode.d.ts +1 -5
  139. three/src/nodes/accessors/SceneNode.d.ts +2 -0
  140. three/src/nodes/accessors/UniformArrayNode.d.ts +2 -2
  141. three/src/nodes/accessors/VelocityNode.d.ts +6 -1
  142. three/src/nodes/code/ScriptableNode.d.ts +1 -1
  143. three/src/nodes/core/Node.d.ts +3 -12
  144. three/src/nodes/core/NodeUtils.d.ts +5 -1
  145. three/src/nodes/core/StackNode.d.ts +4 -4
  146. three/src/nodes/core/StructTypeNode.d.ts +1 -0
  147. three/src/nodes/core/UniformNode.d.ts +1 -0
  148. three/src/nodes/core/VarNode.d.ts +12 -1
  149. three/src/nodes/display/ColorAdjustment.d.ts +29 -0
  150. three/src/nodes/display/ColorSpaceFunctions.d.ts +2 -2
  151. three/src/nodes/display/ColorSpaceNode.d.ts +33 -8
  152. three/src/nodes/display/RenderOutputNode.d.ts +4 -4
  153. three/src/nodes/display/ScreenNode.d.ts +48 -0
  154. three/src/nodes/display/ToneMappingFunctions.d.ts +6 -6
  155. three/src/nodes/display/ToonOutlinePassNode.d.ts +24 -0
  156. three/src/nodes/display/ViewportDepthNode.d.ts +2 -0
  157. three/src/nodes/functions/material/getAlphaHashThreshold.d.ts +6 -0
  158. three/src/nodes/functions/material/getParallaxCorrectNormal.d.ts +10 -0
  159. three/src/nodes/functions/material/getShIrradianceAt.d.ts +6 -0
  160. three/src/nodes/gpgpu/ComputeNode.d.ts +5 -0
  161. three/src/nodes/lighting/LightsNode.d.ts +7 -2
  162. three/src/nodes/lighting/PointLightNode.d.ts +11 -1
  163. three/src/nodes/lighting/ShadowNode.d.ts +12 -0
  164. three/src/nodes/utils/Discard.d.ts +1 -1
  165. three/src/nodes/utils/Oscillators.d.ts +7 -0
  166. three/src/nodes/utils/PostProcessingUtils.d.ts +45 -0
  167. three/src/nodes/utils/ReflectorNode.d.ts +17 -4
  168. three/src/nodes/utils/Timer.d.ts +21 -0
  169. three/src/objects/BatchedMesh.d.ts +78 -0
  170. three/src/objects/Group.d.ts +0 -6
  171. three/src/objects/LOD.d.ts +7 -0
  172. three/src/renderers/WebGLRenderer.d.ts +24 -23
  173. three/src/renderers/common/BundleGroup.d.ts +10 -0
  174. three/src/renderers/common/ClippingContext.d.ts +1 -1
  175. three/src/renderers/common/Constants.d.ts +2 -1
  176. three/src/renderers/common/Geometries.d.ts +1 -0
  177. three/src/renderers/common/IndirectStorageBufferAttribute.d.ts +10 -0
  178. three/src/renderers/common/Lighting.d.ts +15 -0
  179. three/src/renderers/common/PostProcessingUtils.d.ts +66 -0
  180. three/src/renderers/common/RenderBundles.d.ts +3 -3
  181. three/src/renderers/common/RenderContext.d.ts +2 -2
  182. three/src/renderers/common/RenderList.d.ts +7 -3
  183. three/src/renderers/common/RenderLists.d.ts +3 -1
  184. three/src/renderers/common/RenderObject.d.ts +20 -1
  185. three/src/renderers/common/Renderer.d.ts +43 -10
  186. three/src/renderers/common/extras/PMREMGenerator.d.ts +5 -1
  187. three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -2
  188. three/src/renderers/common/nodes/NodeLibrary.d.ts +0 -7
  189. three/src/renderers/common/nodes/Nodes.d.ts +8 -0
  190. three/src/renderers/webgl/WebGLCapabilities.d.ts +13 -0
  191. three/src/renderers/webgl/WebGLPrograms.d.ts +4 -10
  192. three/src/renderers/webgl/WebGLState.d.ts +13 -10
  193. three/src/renderers/webgl/WebGLUtils.d.ts +2 -2
  194. three/src/renderers/webgpu/WebGPURenderer.Nodes.d.ts +12 -0
  195. three/src/renderers/webgpu/WebGPURenderer.d.ts +7 -3
  196. three/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +5 -0
  197. three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +5 -0
  198. three/src/textures/CompressedTexture.d.ts +1 -2
  199. three/src/textures/CubeTexture.d.ts +1 -2
  200. three/src/textures/DataTexture.d.ts +1 -2
  201. three/src/textures/Texture.d.ts +3 -4
  202. three/examples/jsm/cameras/CinematicCamera.d.ts +0 -34
  203. three/examples/jsm/geometries/SDFGeometryGenerator.d.ts +0 -16
  204. three/examples/jsm/loaders/TiltLoader.d.ts +0 -7
  205. three/examples/jsm/utils/GPUStatsPanel.d.ts +0 -12
  206. three/examples/jsm/utils/PackedPhongMaterial.d.ts +0 -10
  207. three/src/nodes/display/BleachBypass.d.ts +0 -4
  208. three/src/nodes/display/Sepia.d.ts +0 -4
  209. three/src/nodes/display/ViewportNode.d.ts +0 -38
  210. three/src/nodes/utils/OscNode.d.ts +0 -25
  211. three/src/nodes/utils/TimerNode.d.ts +0 -25
  212. three/src/renderers/common/StandardRenderer.d.ts +0 -12
  213. /three/examples/jsm/utils/{TextureUtils.d.ts → WebGLTextureUtils.d.ts} +0 -0
@@ -28,11 +28,6 @@ export class MeshNormalMaterial extends Material {
28
28
  */
29
29
  readonly isMeshNormalMaterial: true;
30
30
 
31
- /**
32
- * @default 'MeshNormalMaterial'
33
- */
34
- type: string;
35
-
36
31
  /**
37
32
  * @default null
38
33
  */
@@ -52,11 +52,6 @@ export class MeshPhongMaterial extends Material {
52
52
  */
53
53
  readonly isMeshPhongMaterial: true;
54
54
 
55
- /**
56
- * @default 'MeshNormalMaterial'
57
- */
58
- type: string;
59
-
60
55
  /**
61
56
  * @default new THREE.Color( 0xffffff )
62
57
  */
@@ -62,11 +62,6 @@ export class MeshPhysicalMaterial extends MeshStandardMaterial {
62
62
  */
63
63
  defines: { [key: string]: any };
64
64
 
65
- /**
66
- * @default 'MeshPhysicalMaterial'
67
- */
68
- type: string;
69
-
70
65
  /**
71
66
  * @default 0
72
67
  */
@@ -47,11 +47,6 @@ export class MeshStandardMaterial extends Material {
47
47
  */
48
48
  readonly isMeshStandardMaterial: true;
49
49
 
50
- /**
51
- * @default 'MeshStandardMaterial'
52
- */
53
- type: string;
54
-
55
50
  /**
56
51
  * @default { 'STANDARD': '' }
57
52
  */
@@ -43,11 +43,6 @@ export class MeshToonMaterial extends Material {
43
43
  */
44
44
  readonly isMeshToonMaterial: true;
45
45
 
46
- /**
47
- * @default 'MeshToonMaterial'
48
- */
49
- type: string;
50
-
51
46
  /**
52
47
  * @default { 'TOON': '' }
53
48
  */
@@ -21,11 +21,6 @@ export class PointsMaterial extends Material {
21
21
  */
22
22
  readonly isPointsMaterial: true;
23
23
 
24
- /**
25
- * @default 'PointsMaterial'
26
- */
27
- type: string;
28
-
29
24
  /**
30
25
  * @default new THREE.Color( 0xffffff )
31
26
  */
@@ -9,6 +9,4 @@ export class RawShaderMaterial extends ShaderMaterial {
9
9
  * @defaultValue `true`
10
10
  */
11
11
  readonly isRawShaderMaterial: true;
12
-
13
- override readonly type: "RawShaderMaterial";
14
12
  }
@@ -79,11 +79,6 @@ export class ShaderMaterial extends Material {
79
79
  */
80
80
  readonly isShaderMaterial: true;
81
81
 
82
- /**
83
- * @default 'ShaderMaterial'
84
- */
85
- type: string;
86
-
87
82
  /**
88
83
  * @default {}
89
84
  */
@@ -16,11 +16,6 @@ export class ShadowMaterial extends Material {
16
16
  */
17
17
  readonly isShadowMaterial: true;
18
18
 
19
- /**
20
- * @default 'ShadowMaterial'
21
- */
22
- type: string;
23
-
24
19
  /**
25
20
  * @default new THREE.Color( 0x000000 )
26
21
  */
@@ -20,11 +20,6 @@ export class SpriteMaterial extends Material {
20
20
  */
21
21
  readonly isSpriteMaterial: true;
22
22
 
23
- /**
24
- * @default 'SpriteMaterial'
25
- */
26
- type: string;
27
-
28
23
  /**
29
24
  * @default new THREE.Color( 0xffffff )
30
25
  */
@@ -4,7 +4,7 @@ import { Texture } from "../../textures/Texture.js";
4
4
  import { MeshNormalMaterialParameters } from "../MeshNormalMaterial.js";
5
5
  import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
6
6
 
7
- export interface MeshBasicNodeMaterialParameters extends NodeMaterialParameters, MeshNormalMaterialParameters {
7
+ export interface MeshNormalNodeMaterialParameters extends NodeMaterialParameters, MeshNormalMaterialParameters {
8
8
  }
9
9
 
10
10
  export default class MeshNormalNodeMaterial extends NodeMaterial {
@@ -24,5 +24,5 @@ export default class MeshNormalNodeMaterial extends NodeMaterial {
24
24
  wireframeLinewidth: number;
25
25
  flatShading: boolean;
26
26
 
27
- constructor(parameters?: MeshBasicNodeMaterialParameters);
27
+ constructor(parameters?: MeshNormalNodeMaterialParameters);
28
28
  }
@@ -24,6 +24,7 @@ export interface NodeMaterialParameters extends MaterialParameters {
24
24
  alphaTestNode?: Node | null | undefined;
25
25
 
26
26
  positionNode?: Node | null | undefined;
27
+ geometryNode?: Node | null | undefined;
27
28
 
28
29
  depthNode?: Node | null | undefined;
29
30
  shadowNode?: Node | null | undefined;
@@ -35,6 +36,8 @@ export interface NodeMaterialParameters extends MaterialParameters {
35
36
  }
36
37
 
37
38
  declare class NodeMaterial extends Material {
39
+ static get type(): string;
40
+
38
41
  readonly isNodeMaterial: true;
39
42
 
40
43
  fog: boolean;
@@ -52,6 +55,7 @@ declare class NodeMaterial extends Material {
52
55
  alphaTestNode: Node | null;
53
56
 
54
57
  positionNode: Node | null;
58
+ geometryNode: Node | null;
55
59
 
56
60
  depthNode: Node | null;
57
61
  shadowNode: Node | null;
@@ -85,7 +89,3 @@ declare class NodeMaterial extends Material {
85
89
  }
86
90
 
87
91
  export default NodeMaterial;
88
-
89
- export function registerNodeMaterial(type: string, nodeMaterialClass: { new(): NodeMaterial }): string;
90
-
91
- export function createNodeMaterialFromType(type: string): NodeMaterial;
@@ -1,18 +1,21 @@
1
- export { default as InstancedPointsNodeMaterial } from "./InstancedPointsNodeMaterial.js";
2
- export { default as Line2NodeMaterial } from "./Line2NodeMaterial.js";
3
- export { default as LineBasicNodeMaterial } from "./LineBasicNodeMaterial.js";
4
- export { default as LineDashedNodeMaterial } from "./LineDashedNodeMaterial.js";
5
- export { default as MeshBasicNodeMaterial } from "./MeshBasicNodeMaterial.js";
6
- export { default as MeshLambertNodeMaterial } from "./MeshLambertNodeMaterial.js";
7
- export { default as MeshMatcapNodeMaterial } from "./MeshMatcapNodeMaterial.js";
8
- export { default as MeshNormalNodeMaterial } from "./MeshNormalNodeMaterial.js";
9
- export { default as MeshPhongNodeMaterial } from "./MeshPhongNodeMaterial.js";
10
- export { default as MeshPhysicalNodeMaterial } from "./MeshPhysicalNodeMaterial.js";
1
+ export {
2
+ default as InstancedPointsNodeMaterial,
3
+ InstancedPointsNodeMaterialParameters,
4
+ } from "./InstancedPointsNodeMaterial.js";
5
+ export { default as Line2NodeMaterial, Line2NodeMaterialParameters } from "./Line2NodeMaterial.js";
6
+ export { default as LineBasicNodeMaterial, LineBasicNodeMaterialParameters } from "./LineBasicNodeMaterial.js";
7
+ export { default as LineDashedNodeMaterial, LineDashedNodeMaterialParameters } from "./LineDashedNodeMaterial.js";
8
+ export { default as MeshBasicNodeMaterial, MeshBasicNodeMaterialParameters } from "./MeshBasicNodeMaterial.js";
9
+ export { default as MeshLambertNodeMaterial, MeshLambertNodeMaterialParameters } from "./MeshLambertNodeMaterial.js";
10
+ export { default as MeshMatcapNodeMaterial, MeshMatcapNodeMaterialParameters } from "./MeshMatcapNodeMaterial.js";
11
+ export { default as MeshNormalNodeMaterial, MeshNormalNodeMaterialParameters } from "./MeshNormalNodeMaterial.js";
12
+ export { default as MeshPhongNodeMaterial, MeshPhongNodeMaterialParameters } from "./MeshPhongNodeMaterial.js";
13
+ export { default as MeshPhysicalNodeMaterial, MeshPhysicalNodeMaterialParameters } from "./MeshPhysicalNodeMaterial.js";
11
14
  export { default as MeshSSSNodeMaterial } from "./MeshSSSNodeMaterial.js";
12
- export { default as MeshStandardNodeMaterial } from "./MeshStandardNodeMaterial.js";
13
- export { default as MeshToonNodeMaterial } from "./MeshToonNodeMaterial.js";
14
- export { default as NodeMaterial } from "./NodeMaterial.js";
15
- export { default as PointsNodeMaterial } from "./PointsNodeMaterial.js";
16
- export { default as ShadowNodeMaterial } from "./ShadowNodeMaterial.js";
17
- export { default as SpriteNodeMaterial } from "./SpriteNodeMaterial.js";
15
+ export { default as MeshStandardNodeMaterial, MeshStandardNodeMaterialParameters } from "./MeshStandardNodeMaterial.js";
16
+ export { default as MeshToonNodeMaterial, MeshToonNodeMaterialParameters } from "./MeshToonNodeMaterial.js";
17
+ export { default as NodeMaterial, NodeMaterialParameters } from "./NodeMaterial.js";
18
+ export { default as PointsNodeMaterial, PointsNodeMaterialParameters } from "./PointsNodeMaterial.js";
19
+ export { default as ShadowNodeMaterial, ShadowNodeMaterialParameters } from "./ShadowNodeMaterial.js";
20
+ export { default as SpriteNodeMaterial, SpriteNodeMaterialParameters } from "./SpriteNodeMaterial.js";
18
21
  export { default as VolumeNodeMaterial } from "./VolumeNodeMaterial.js";
@@ -0,0 +1,96 @@
1
+ import { BufferAttribute } from "../../../core/BufferAttribute.js";
2
+ import { Matrix4 } from "../../../math/Matrix4.js";
3
+ import NodeBuilder from "../../../nodes/core/NodeBuilder.js";
4
+ import NodeFrame from "../../../nodes/core/NodeFrame.js";
5
+ import RenderObject from "../../../renderers/common/RenderObject.js";
6
+ import { Material } from "../../Material.js";
7
+ declare const refreshUniforms: readonly [
8
+ "alphaMap",
9
+ "alphaTest",
10
+ "anisotropy",
11
+ "anisotropyMap",
12
+ "anisotropyRotation",
13
+ "aoMap",
14
+ "attenuationColor",
15
+ "attenuationDistance",
16
+ "bumpMap",
17
+ "clearcoat",
18
+ "clearcoatMap",
19
+ "clearcoatNormalMap",
20
+ "clearcoatNormalScale",
21
+ "clearcoatRoughness",
22
+ "color",
23
+ "dispersion",
24
+ "displacementMap",
25
+ "emissive",
26
+ "emissiveMap",
27
+ "envMap",
28
+ "gradientMap",
29
+ "ior",
30
+ "iridescence",
31
+ "iridescenceIOR",
32
+ "iridescenceMap",
33
+ "iridescenceThicknessMap",
34
+ "lightMap",
35
+ "map",
36
+ "matcap",
37
+ "metalness",
38
+ "metalnessMap",
39
+ "normalMap",
40
+ "normalScale",
41
+ "opacity",
42
+ "roughness",
43
+ "roughnessMap",
44
+ "sheen",
45
+ "sheenColor",
46
+ "sheenColorMap",
47
+ "sheenRoughnessMap",
48
+ "shininess",
49
+ "specular",
50
+ "specularColor",
51
+ "specularColorMap",
52
+ "specularIntensity",
53
+ "specularIntensityMap",
54
+ "specularMap",
55
+ "thickness",
56
+ "transmission",
57
+ "transmissionMap",
58
+ ];
59
+ type RefreshUniform = (typeof refreshUniforms)[number];
60
+ type MaterialData = {
61
+ [K in RefreshUniform]?: unknown;
62
+ };
63
+ interface AttributesData {
64
+ [name: string]: {
65
+ version: number;
66
+ };
67
+ }
68
+ interface RenderObjectData {
69
+ material: MaterialData;
70
+ geometry: {
71
+ attributes: AttributesData;
72
+ indexVersion: number | null;
73
+ drawRange: {
74
+ start: number;
75
+ count: number;
76
+ };
77
+ };
78
+ worldMatrix: Matrix4;
79
+ version?: number;
80
+ }
81
+ declare class NodeMaterialObserver {
82
+ renderObjects: WeakMap<RenderObject, RenderObjectData>;
83
+ hasNode: boolean;
84
+ hasAnimation: boolean;
85
+ refreshUniforms: readonly RefreshUniform[];
86
+ renderId: number;
87
+ constructor(builder: NodeBuilder);
88
+ firstInitialization(renderObject: RenderObject): boolean;
89
+ getRenderObjectData(renderObject: RenderObject): RenderObjectData;
90
+ getAttributesData(attributes: Record<string, BufferAttribute>): AttributesData;
91
+ containsNode(builder: NodeBuilder): boolean;
92
+ getMaterialData(material: Material): MaterialData;
93
+ equals(renderObject: RenderObject): boolean;
94
+ needsRefresh(renderObject: RenderObject, nodeFrame: NodeFrame): boolean;
95
+ }
96
+ export default NodeMaterialObserver;
three/src/math/Color.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { ColorSpace } from "../constants.js";
2
1
  import { Matrix3 } from "./Matrix3.js";
3
2
  import { Vector3 } from "./Vector3.js";
4
3
 
@@ -173,12 +172,30 @@ export interface RGB {
173
172
  }
174
173
 
175
174
  /**
176
- * Represents a color. See also {@link ColorUtils}.
175
+ * Class representing a color.
177
176
  *
178
- * see {@link https://github.com/mrdoob/three.js/blob/master/src/math/Color.js|src/math/Color.js}
177
+ * A Color instance is represented by RGB components in the linear <i>working color space</i>, which defaults to
178
+ * `LinearSRGBColorSpace`. Inputs conventionally using `SRGBColorSpace` (such as hexadecimals and CSS strings) are
179
+ * converted to the working color space automatically.
179
180
  *
180
- * @example
181
- * const color = new THREE.Color( 0xff0000 );
181
+ * ```
182
+ * // converted automatically from SRGBColorSpace to LinearSRGBColorSpace
183
+ * const color = new THREE.Color().setHex( 0x112233 );
184
+ * ```
185
+ *
186
+ * Source color spaces may be specified explicitly, to ensure correct conversions.
187
+ *
188
+ * ```
189
+ * // assumed already LinearSRGBColorSpace; no conversion
190
+ * const color = new THREE.Color().setRGB( 0.5, 0.5, 0.5 );
191
+ *
192
+ * // converted explicitly from SRGBColorSpace to LinearSRGBColorSpace
193
+ * const color = new THREE.Color().setRGB( 0.5, 0.5, 0.5, SRGBColorSpace );
194
+ * ```
195
+ *
196
+ * If THREE.ColorManagement is disabled, no conversions occur. For details, see <i>Color management</i>.
197
+ *
198
+ * Iterating through a Color instance will yield its components (r, g, b) in the corresponding order.
182
199
  */
183
200
  export class Color {
184
201
  constructor(color?: ColorRepresentation);
@@ -187,19 +204,19 @@ export class Color {
187
204
  readonly isColor: true;
188
205
 
189
206
  /**
190
- * Red channel value between 0 and 1. Default is 1.
207
+ * Red channel value between `0.0` and `1.0`. Default is `1`.
191
208
  * @default 1
192
209
  */
193
210
  r: number;
194
211
 
195
212
  /**
196
- * Green channel value between 0 and 1. Default is 1.
213
+ * Green channel value between `0.0` and `1.0`. Default is `1`.
197
214
  * @default 1
198
215
  */
199
216
  g: number;
200
217
 
201
218
  /**
202
- * Blue channel value between 0 and 1. Default is 1.
219
+ * Blue channel value between `0.0` and `1.0`. Default is `1`.
203
220
  * @default 1
204
221
  */
205
222
  b: number;
@@ -213,7 +230,7 @@ export class Color {
213
230
  setFromVector3(vector: Vector3): this;
214
231
 
215
232
  setScalar(scalar: number): Color;
216
- setHex(hex: number, colorSpace?: ColorSpace): Color;
233
+ setHex(hex: number, colorSpace?: string): Color;
217
234
 
218
235
  /**
219
236
  * Sets this color from RGB values.
@@ -221,7 +238,7 @@ export class Color {
221
238
  * @param g Green channel value between 0 and 1.
222
239
  * @param b Blue channel value between 0 and 1.
223
240
  */
224
- setRGB(r: number, g: number, b: number, colorSpace?: ColorSpace): Color;
241
+ setRGB(r: number, g: number, b: number, colorSpace?: string): Color;
225
242
 
226
243
  /**
227
244
  * Sets this color from HSL values.
@@ -231,20 +248,20 @@ export class Color {
231
248
  * @param s Saturation value channel between 0 and 1.
232
249
  * @param l Value channel value between 0 and 1.
233
250
  */
234
- setHSL(h: number, s: number, l: number, colorSpace?: ColorSpace): Color;
251
+ setHSL(h: number, s: number, l: number, colorSpace?: string): Color;
235
252
 
236
253
  /**
237
254
  * Sets this color from a CSS context style string.
238
255
  * @param contextStyle Color in CSS context style format.
239
256
  */
240
- setStyle(style: string, colorSpace?: ColorSpace): Color;
257
+ setStyle(style: string, colorSpace?: string): Color;
241
258
 
242
259
  /**
243
260
  * Sets this color from a color name.
244
261
  * Faster than {@link Color#setStyle .setStyle()} method if you don't need the other CSS-style formats.
245
262
  * @param style Color name in X11 format.
246
263
  */
247
- setColorName(style: string, colorSpace?: ColorSpace): Color;
264
+ setColorName(style: string, colorSpace?: string): Color;
248
265
 
249
266
  /**
250
267
  * Clones this color.
@@ -258,46 +275,46 @@ export class Color {
258
275
  copy(color: Color): this;
259
276
 
260
277
  /**
261
- * Copies given color making conversion from sRGB to linear space.
278
+ * Copies given color making conversion from `SRGBColorSpace` to `LinearSRGBColorSpace`.
262
279
  * @param color Color to copy.
263
280
  */
264
281
  copySRGBToLinear(color: Color): Color;
265
282
 
266
283
  /**
267
- * Copies given color making conversion from linear to sRGB space.
284
+ * Copies given color making conversion from `LinearSRGBColorSpace` to `SRGBColorSpace`.
268
285
  * @param color Color to copy.
269
286
  */
270
287
  copyLinearToSRGB(color: Color): Color;
271
288
 
272
289
  /**
273
- * Converts this color from sRGB to linear space.
290
+ * Converts this color from `SRGBColorSpace` to `LinearSRGBColorSpace`.
274
291
  */
275
292
  convertSRGBToLinear(): Color;
276
293
 
277
294
  /**
278
- * Converts this color from linear to sRGB space.
295
+ * Converts this color from `LinearSRGBColorSpace` to `SRGBColorSpace`.
279
296
  */
280
297
  convertLinearToSRGB(): Color;
281
298
 
282
299
  /**
283
300
  * Returns the hexadecimal value of this color.
284
301
  */
285
- getHex(colorSpace?: ColorSpace): number;
302
+ getHex(colorSpace?: string): number;
286
303
 
287
304
  /**
288
305
  * Returns the string formated hexadecimal value of this color.
289
306
  */
290
- getHexString(colorSpace?: ColorSpace): string;
307
+ getHexString(colorSpace?: string): string;
291
308
 
292
- getHSL(target: HSL, colorSpace?: ColorSpace): HSL;
309
+ getHSL(target: HSL, colorSpace?: string): HSL;
293
310
 
294
- getRGB(target: RGB, colorSpace?: ColorSpace): RGB;
311
+ getRGB(target: RGB, colorSpace?: string): RGB;
295
312
 
296
313
  /**
297
314
  * Returns the value of this color in CSS context style.
298
315
  * Example: rgb(r, g, b)
299
316
  */
300
- getStyle(colorSpace?: ColorSpace): string;
317
+ getStyle(colorSpace?: string): string;
301
318
 
302
319
  offsetHSL(h: number, s: number, l: number): this;
303
320
 
@@ -1,45 +1,45 @@
1
- import {
2
- ColorSpace,
3
- ColorSpacePrimaries,
4
- ColorSpaceTransfer,
5
- DisplayP3ColorSpace,
6
- LinearDisplayP3ColorSpace,
7
- LinearSRGBColorSpace,
8
- SRGBColorSpace,
9
- } from "../constants.js";
1
+ import { ColorSpaceTransfer } from "../constants.js";
10
2
  import { Color } from "./Color.js";
3
+ import { Matrix3 } from "./Matrix3.js";
11
4
  import { Vector3 } from "./Vector3.js";
12
5
 
13
- export type WorkingColorSpace = typeof LinearSRGBColorSpace | typeof LinearDisplayP3ColorSpace;
14
- export type DefinedColorSpace =
15
- | typeof LinearSRGBColorSpace
16
- | typeof SRGBColorSpace
17
- | typeof LinearDisplayP3ColorSpace
18
- | typeof DisplayP3ColorSpace;
6
+ export interface ColorSpaceDefinition {
7
+ primaries: [number, number, number, number, number, number];
8
+ whitePoint: [number, number];
9
+ transfer: ColorSpaceTransfer;
10
+ toXYZ: Matrix3;
11
+ fromXYZ: Matrix3;
12
+ luminanceCoefficients: [number, number, number];
13
+ workingColorSpaceConfig?: { unpackColorSpace: string };
14
+ outputColorSpaceConfig?: { drawingBufferColorSpace: string };
15
+ }
19
16
 
20
17
  export interface ColorManagement {
21
18
  /**
22
- * @default false
19
+ * @default true
23
20
  */
24
21
  enabled: boolean;
25
22
 
26
23
  /**
27
24
  * @default LinearSRGBColorSpace
28
25
  */
29
- get workingColorSpace(): WorkingColorSpace;
30
- set workingColorSpace(colorSpace: WorkingColorSpace);
26
+ workingColorSpace: string;
27
+
28
+ spaces: Record<string, ColorSpaceDefinition>;
29
+
30
+ convert: (color: Color, sourceColorSpace: string, targetColorSpace: string) => Color;
31
31
 
32
- convert: (color: Color, sourceColorSpace: DefinedColorSpace, targetColorSpace: DefinedColorSpace) => Color;
32
+ fromWorkingColorSpace: (color: Color, targetColorSpace: string) => Color;
33
33
 
34
- fromWorkingColorSpace: (color: Color, targetColorSpace: DefinedColorSpace) => Color;
34
+ toWorkingColorSpace: (color: Color, sourceColorSpace: string) => Color;
35
35
 
36
- toWorkingColorSpace: (color: Color, sourceColorSpace: DefinedColorSpace) => Color;
36
+ getPrimaries: (colorSpace: string) => [number, number, number, number, number, number];
37
37
 
38
- getPrimaries: (colorSpace: DefinedColorSpace) => ColorSpacePrimaries;
38
+ getTransfer: (colorSpace: string) => ColorSpaceTransfer;
39
39
 
40
- getTransfer: (colorSpace: ColorSpace) => ColorSpaceTransfer;
40
+ getLuminanceCoefficients: (target: Vector3, colorSpace?: string) => [number, number, number];
41
41
 
42
- getLuminanceCoefficients: (target: Vector3, colorSpace?: ColorSpace) => Vector3;
42
+ define: (colorSpaces: Record<string, ColorSpaceDefinition>) => void;
43
43
  }
44
44
 
45
45
  export const ColorManagement: ColorManagement;
@@ -129,7 +129,7 @@ export class Quaternion {
129
129
  * @param array the source array or array-like.
130
130
  * @param offset (optional) offset into the array. Default is 0.
131
131
  */
132
- fromArray(array: QuaternionTuple, offset?: number): this;
132
+ fromArray(array: number[] | ArrayLike<number>, offset?: number): this;
133
133
 
134
134
  /**
135
135
  * Returns an array [x, y, z, w], or copies x, y, z and w into the provided array.
@@ -137,7 +137,8 @@ export class Quaternion {
137
137
  * @param offset (optional) optional offset into the array.
138
138
  * @return The created or provided array.
139
139
  */
140
- toArray(array?: number[], offset?: number): QuaternionTuple;
140
+ toArray(array?: number[], offset?: number): number[];
141
+ toArray(array?: QuaternionTuple, offset?: 0): QuaternionTuple;
141
142
 
142
143
  /**
143
144
  * Copies x, y, z and w into the provided array-like.
@@ -145,7 +146,7 @@ export class Quaternion {
145
146
  * @param offset (optional) optional offset into the array.
146
147
  * @return The provided array-like.
147
148
  */
148
- toArray(array: ArrayLike<number>, offset?: number): QuaternionTuple;
149
+ toArray(array: ArrayLike<number>, offset?: number): ArrayLike<number>;
149
150
 
150
151
  /**
151
152
  * This method defines the serialization result of Quaternion.
@@ -82,5 +82,29 @@ export class Triangle {
82
82
  v3: Vector4,
83
83
  target: Vector4,
84
84
  ): Vector4 | null;
85
+ static getInterpolatedAttribute(
86
+ attr: BufferAttribute,
87
+ i1: number,
88
+ i2: number,
89
+ i3: number,
90
+ barycoord: Vector3,
91
+ target: Vector2,
92
+ ): Vector2;
93
+ static getInterpolatedAttribute(
94
+ attr: BufferAttribute,
95
+ i1: number,
96
+ i2: number,
97
+ i3: number,
98
+ barycoord: Vector3,
99
+ target: Vector3,
100
+ ): Vector3;
101
+ static getInterpolatedAttribute(
102
+ attr: BufferAttribute,
103
+ i1: number,
104
+ i2: number,
105
+ i3: number,
106
+ barycoord: Vector3,
107
+ target: Vector4,
108
+ ): Vector4;
85
109
  static isFrontFacing(a: Vector3, b: Vector3, c: Vector3, direction: Vector3): boolean;
86
110
  }
@@ -119,6 +119,8 @@ export class Vector4 {
119
119
 
120
120
  applyMatrix4(m: Matrix4): this;
121
121
 
122
+ divide(v: Vector4Like): this;
123
+
122
124
  /**
123
125
  * Divides this vector by scalar s.
124
126
  * Set vector to ( 0, 0, 0 ) if s == 0.