@types/three 0.169.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 (147) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/Addons.d.ts +3 -3
  3. three/examples/jsm/animation/MMDAnimationHelper.d.ts +4 -0
  4. three/examples/jsm/animation/MMDPhysics.d.ts +4 -0
  5. three/examples/jsm/controls/ArcballControls.d.ts +1 -1
  6. three/examples/jsm/controls/TransformControls.d.ts +44 -0
  7. three/examples/jsm/csm/CSMFrustum.d.ts +8 -2
  8. three/examples/jsm/csm/CSMHelper.d.ts +2 -1
  9. three/examples/jsm/csm/CSMShadowNode.d.ts +46 -0
  10. three/examples/jsm/curves/NURBSCurve.d.ts +12 -1
  11. three/examples/jsm/exporters/GLTFExporter.d.ts +20 -3
  12. three/examples/jsm/exporters/MMDExporter.d.ts +4 -0
  13. three/examples/jsm/exporters/USDZExporter.d.ts +4 -0
  14. three/examples/jsm/geometries/DecalGeometry.d.ts +9 -3
  15. three/examples/jsm/geometries/TeapotGeometry.d.ts +2 -2
  16. three/examples/jsm/helpers/TextureHelperGPU.d.ts +10 -0
  17. three/examples/jsm/lighting/TiledLighting.d.ts +10 -0
  18. three/examples/jsm/lines/Wireframe.d.ts +5 -2
  19. three/examples/jsm/lines/WireframeGeometry2.d.ts +1 -1
  20. three/examples/jsm/lines/webgpu/Wireframe.d.ts +13 -0
  21. three/examples/jsm/loaders/EXRLoader.d.ts +2 -2
  22. three/examples/jsm/loaders/GLTFLoader.d.ts +1 -2
  23. three/examples/jsm/loaders/KTX2Loader.d.ts +1 -0
  24. three/examples/jsm/loaders/LDrawLoader.d.ts +10 -0
  25. three/examples/jsm/loaders/MMDLoader.d.ts +4 -0
  26. three/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts +9 -0
  27. three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts +9 -0
  28. three/examples/jsm/materials/MeshGouraudMaterial.d.ts +0 -1
  29. three/examples/jsm/math/ColorSpaces.d.ts +11 -0
  30. three/examples/jsm/misc/ProgressiveLightMap.d.ts +8 -10
  31. three/examples/jsm/misc/ProgressiveLightMapGPU.d.ts +27 -0
  32. three/examples/jsm/renderers/SVGRenderer.d.ts +2 -2
  33. three/{src/nodes → examples/jsm/tsl}/display/AfterImageNode.d.ts +1 -5
  34. three/{src/nodes → examples/jsm/tsl}/display/AnaglyphPassNode.d.ts +2 -3
  35. three/{src/nodes → examples/jsm/tsl}/display/AnamorphicNode.d.ts +2 -4
  36. three/examples/jsm/tsl/display/BleachBypass.d.ts +3 -0
  37. three/{src/nodes → examples/jsm/tsl}/display/BloomNode.d.ts +1 -5
  38. three/{src/nodes → examples/jsm/tsl}/display/DenoiseNode.d.ts +2 -6
  39. three/{src/nodes → examples/jsm/tsl}/display/DepthOfFieldNode.d.ts +1 -5
  40. three/{src/nodes → examples/jsm/tsl}/display/DotScreenNode.d.ts +2 -5
  41. three/{src/nodes → examples/jsm/tsl}/display/FXAANode.d.ts +1 -3
  42. three/{src/nodes → examples/jsm/tsl}/display/FilmNode.d.ts +1 -3
  43. three/{src/nodes → examples/jsm/tsl}/display/GTAONode.d.ts +2 -8
  44. three/{src/nodes → examples/jsm/tsl}/display/GaussianBlurNode.d.ts +13 -5
  45. three/examples/jsm/tsl/display/LensflareNode.d.ts +35 -0
  46. three/{src/nodes → examples/jsm/tsl}/display/Lut3DNode.d.ts +2 -6
  47. three/{src/nodes → examples/jsm/tsl}/display/MotionBlur.d.ts +1 -2
  48. three/examples/jsm/tsl/display/OutlineNode.d.ts +32 -0
  49. three/{src/nodes → examples/jsm/tsl}/display/ParallaxBarrierPassNode.d.ts +2 -3
  50. three/{src/nodes → examples/jsm/tsl}/display/PixelationPassNode.d.ts +2 -5
  51. three/{src/nodes → examples/jsm/tsl}/display/RGBShiftNode.d.ts +1 -4
  52. three/examples/jsm/tsl/display/SMAANode.d.ts +17 -0
  53. three/{src/nodes → examples/jsm/tsl}/display/SSAAPassNode.d.ts +2 -7
  54. three/examples/jsm/tsl/display/SSRNode.d.ts +38 -0
  55. three/examples/jsm/tsl/display/Sepia.d.ts +3 -0
  56. three/{src/nodes → examples/jsm/tsl}/display/SobelOperatorNode.d.ts +1 -3
  57. three/{src/nodes → examples/jsm/tsl}/display/StereoCompositePassNode.d.ts +2 -5
  58. three/{src/nodes → examples/jsm/tsl}/display/StereoPassNode.d.ts +2 -5
  59. three/examples/jsm/tsl/display/TRAAPassNode.d.ts +15 -0
  60. three/{src/nodes → examples/jsm/tsl}/display/TransitionNode.d.ts +1 -5
  61. three/examples/jsm/tsl/display/hashBlur.d.ts +7 -0
  62. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +22 -0
  63. three/package.json +4 -3
  64. three/src/Three.WebGPU.Nodes.d.ts +5 -1
  65. three/src/Three.WebGPU.d.ts +5 -1
  66. three/src/Three.d.ts +2 -7
  67. three/src/constants.d.ts +1 -9
  68. three/src/core/BufferGeometry.d.ts +13 -2
  69. three/src/core/RenderTarget.d.ts +1 -2
  70. three/src/loaders/FileLoader.d.ts +3 -3
  71. three/src/materials/LineBasicMaterial.d.ts +0 -5
  72. three/src/materials/LineDashedMaterial.d.ts +0 -5
  73. three/src/materials/Material.d.ts +4 -6
  74. three/src/materials/MeshBasicMaterial.d.ts +0 -5
  75. three/src/materials/MeshDepthMaterial.d.ts +0 -5
  76. three/src/materials/MeshDistanceMaterial.d.ts +0 -5
  77. three/src/materials/MeshLambertMaterial.d.ts +0 -5
  78. three/src/materials/MeshMatcapMaterial.d.ts +0 -5
  79. three/src/materials/MeshNormalMaterial.d.ts +0 -5
  80. three/src/materials/MeshPhongMaterial.d.ts +0 -5
  81. three/src/materials/MeshPhysicalMaterial.d.ts +0 -5
  82. three/src/materials/MeshStandardMaterial.d.ts +0 -5
  83. three/src/materials/MeshToonMaterial.d.ts +0 -5
  84. three/src/materials/PointsMaterial.d.ts +0 -5
  85. three/src/materials/RawShaderMaterial.d.ts +0 -2
  86. three/src/materials/ShaderMaterial.d.ts +0 -5
  87. three/src/materials/ShadowMaterial.d.ts +0 -5
  88. three/src/materials/SpriteMaterial.d.ts +0 -5
  89. three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +2 -2
  90. three/src/materials/nodes/NodeMaterial.d.ts +2 -0
  91. three/src/materials/nodes/NodeMaterials.d.ts +19 -16
  92. three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +15 -0
  93. three/src/math/Color.d.ts +39 -22
  94. three/src/math/ColorManagement.d.ts +24 -24
  95. three/src/math/Vector4.d.ts +2 -0
  96. three/src/nodes/Nodes.d.ts +1 -21
  97. three/src/nodes/TSL.d.ts +6 -24
  98. three/src/nodes/accessors/Camera.d.ts +0 -1
  99. three/src/nodes/accessors/SceneNode.d.ts +2 -0
  100. three/src/nodes/accessors/UniformArrayNode.d.ts +2 -2
  101. three/src/nodes/accessors/VelocityNode.d.ts +4 -0
  102. three/src/nodes/code/ScriptableNode.d.ts +1 -1
  103. three/src/nodes/core/StackNode.d.ts +4 -4
  104. three/src/nodes/core/VarNode.d.ts +12 -1
  105. three/src/nodes/display/ColorAdjustment.d.ts +29 -0
  106. three/src/nodes/display/ColorSpaceFunctions.d.ts +2 -2
  107. three/src/nodes/display/ColorSpaceNode.d.ts +14 -8
  108. three/src/nodes/display/RenderOutputNode.d.ts +4 -4
  109. three/src/nodes/display/ViewportDepthNode.d.ts +2 -0
  110. three/src/nodes/functions/material/getAlphaHashThreshold.d.ts +6 -0
  111. three/src/nodes/functions/material/getParallaxCorrectNormal.d.ts +10 -0
  112. three/src/nodes/gpgpu/ComputeNode.d.ts +5 -0
  113. three/src/nodes/lighting/LightsNode.d.ts +7 -2
  114. three/src/nodes/lighting/PointLightNode.d.ts +11 -1
  115. three/src/nodes/lighting/ShadowNode.d.ts +12 -0
  116. three/src/nodes/utils/Discard.d.ts +1 -1
  117. three/src/nodes/utils/Oscillators.d.ts +7 -0
  118. three/src/nodes/utils/PostProcessingUtils.d.ts +45 -0
  119. three/src/nodes/utils/ReflectorNode.d.ts +17 -4
  120. three/src/nodes/utils/Timer.d.ts +21 -0
  121. three/src/objects/BatchedMesh.d.ts +47 -2
  122. three/src/renderers/WebGLRenderer.d.ts +22 -11
  123. three/src/renderers/common/Constants.d.ts +2 -1
  124. three/src/renderers/common/Geometries.d.ts +1 -0
  125. three/src/renderers/common/IndirectStorageBufferAttribute.d.ts +10 -0
  126. three/src/renderers/common/Lighting.d.ts +15 -0
  127. three/src/renderers/common/PostProcessingUtils.d.ts +66 -0
  128. three/src/renderers/common/RenderList.d.ts +5 -2
  129. three/src/renderers/common/RenderLists.d.ts +3 -1
  130. three/src/renderers/common/RenderObject.d.ts +1 -0
  131. three/src/renderers/common/Renderer.d.ts +35 -9
  132. three/src/renderers/common/extras/PMREMGenerator.d.ts +5 -1
  133. three/src/renderers/common/nodes/NodeLibrary.d.ts +0 -7
  134. three/src/renderers/webgl/WebGLPrograms.d.ts +3 -10
  135. three/src/renderers/webgl/WebGLState.d.ts +13 -10
  136. three/src/renderers/webgl/WebGLUtils.d.ts +2 -2
  137. three/src/textures/CompressedTexture.d.ts +1 -2
  138. three/src/textures/CubeTexture.d.ts +1 -2
  139. three/src/textures/DataTexture.d.ts +1 -2
  140. three/src/textures/Texture.d.ts +3 -4
  141. three/examples/jsm/cameras/CinematicCamera.d.ts +0 -34
  142. three/src/nodes/display/BleachBypass.d.ts +0 -4
  143. three/src/nodes/display/Sepia.d.ts +0 -4
  144. three/src/nodes/utils/OscNode.d.ts +0 -25
  145. three/src/nodes/utils/TimerNode.d.ts +0 -25
  146. /three/examples/jsm/utils/{TextureUtils.d.ts → WebGLTextureUtils.d.ts} +0 -0
  147. /three/examples/jsm/utils/{TextureUtilsGPU.d.ts → WebGPUTextureUtils.d.ts} +0 -0
@@ -234,6 +234,10 @@ export interface MaterialJSON {
234
234
  * Materials describe the appearance of objects. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.
235
235
  */
236
236
  export class Material extends EventDispatcher<{ dispose: {} }> {
237
+ static get type(): string;
238
+
239
+ get type(): string;
240
+
237
241
  constructor();
238
242
 
239
243
  /**
@@ -509,12 +513,6 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
509
513
  */
510
514
  transparent: boolean;
511
515
 
512
- /**
513
- * Value is the string 'Material'. This shouldn't be changed, and can be used to find all objects of this type in a scene.
514
- * @default 'Material'
515
- */
516
- type: string;
517
-
518
516
  /**
519
517
  * UUID of this material instance. This gets automatically assigned, so this shouldn't be edited.
520
518
  */
@@ -39,11 +39,6 @@ export class MeshBasicMaterial extends Material {
39
39
  */
40
40
  readonly isMeshBasicMaterial: true;
41
41
 
42
- /**
43
- * @default 'MeshBasicMaterial'
44
- */
45
- type: string;
46
-
47
42
  /**
48
43
  * @default new THREE.Color( 0xffffff )
49
44
  */
@@ -22,11 +22,6 @@ export class MeshDepthMaterial extends Material {
22
22
  */
23
23
  readonly isMeshDepthMaterial: true;
24
24
 
25
- /**
26
- * @default 'MeshDepthMaterial'
27
- */
28
- type: string;
29
-
30
25
  /**
31
26
  * @default null
32
27
  */
@@ -23,11 +23,6 @@ export class MeshDistanceMaterial extends Material {
23
23
  */
24
24
  readonly isMeshDistanceMaterial: true;
25
25
 
26
- /**
27
- * @default 'MeshDistanceMaterial'
28
- */
29
- type: string;
30
-
31
26
  /**
32
27
  * @default null
33
28
  */
@@ -47,11 +47,6 @@ export class MeshLambertMaterial extends Material {
47
47
  */
48
48
  readonly isMeshLambertMaterial: true;
49
49
 
50
- /**
51
- * @default 'MeshLambertMaterial'
52
- */
53
- type: string;
54
-
55
50
  /**
56
51
  * @default new THREE.Color( 0xffffff )
57
52
  */
@@ -31,11 +31,6 @@ export class MeshMatcapMaterial extends Material {
31
31
  */
32
32
  readonly isMeshMatcapMaterial: true;
33
33
 
34
- /**
35
- * @default 'MeshMatcapMaterial'
36
- */
37
- type: string;
38
-
39
34
  /**
40
35
  * @default { 'MATCAP': '' }
41
36
  */
@@ -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;
@@ -54,6 +55,7 @@ declare class NodeMaterial extends Material {
54
55
  alphaTestNode: Node | null;
55
56
 
56
57
  positionNode: Node | null;
58
+ geometryNode: Node | null;
57
59
 
58
60
  depthNode: Node | null;
59
61
  shadowNode: Node | null;
@@ -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";
@@ -1,3 +1,4 @@
1
+ import { BufferAttribute } from "../../../core/BufferAttribute.js";
1
2
  import { Matrix4 } from "../../../math/Matrix4.js";
2
3
  import NodeBuilder from "../../../nodes/core/NodeBuilder.js";
3
4
  import NodeFrame from "../../../nodes/core/NodeFrame.js";
@@ -59,8 +60,21 @@ type RefreshUniform = (typeof refreshUniforms)[number];
59
60
  type MaterialData = {
60
61
  [K in RefreshUniform]?: unknown;
61
62
  };
63
+ interface AttributesData {
64
+ [name: string]: {
65
+ version: number;
66
+ };
67
+ }
62
68
  interface RenderObjectData {
63
69
  material: MaterialData;
70
+ geometry: {
71
+ attributes: AttributesData;
72
+ indexVersion: number | null;
73
+ drawRange: {
74
+ start: number;
75
+ count: number;
76
+ };
77
+ };
64
78
  worldMatrix: Matrix4;
65
79
  version?: number;
66
80
  }
@@ -73,6 +87,7 @@ declare class NodeMaterialObserver {
73
87
  constructor(builder: NodeBuilder);
74
88
  firstInitialization(renderObject: RenderObject): boolean;
75
89
  getRenderObjectData(renderObject: RenderObject): RenderObjectData;
90
+ getAttributesData(attributes: Record<string, BufferAttribute>): AttributesData;
76
91
  containsNode(builder: NodeBuilder): boolean;
77
92
  getMaterialData(material: Material): MaterialData;
78
93
  equals(renderObject: RenderObject): boolean;
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;
@@ -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.
@@ -55,7 +55,6 @@ export { default as JoinNode } from "./utils/JoinNode.js";
55
55
  export { default as LoopNode } from "./utils/LoopNode.js";
56
56
  export { default as MatcapUVNode } from "./utils/MatcapUVNode.js";
57
57
  export { default as MaxMipLevelNode } from "./utils/MaxMipLevelNode.js";
58
- export { default as OscNode, OscNodeMethod } from "./utils/OscNode.js";
59
58
  export { default as ReflectorNode, ReflectorNodeParameters } from "./utils/ReflectorNode.js";
60
59
  export { default as RemapNode } from "./utils/RemapNode.js";
61
60
  export { default as RotateNode } from "./utils/RotateNode.js";
@@ -64,7 +63,6 @@ export { default as SetNode } from "./utils/SetNode.js";
64
63
  export { default as SplitNode } from "./utils/SplitNode.js";
65
64
  export { default as SpriteSheetUVNode } from "./utils/SpriteSheetUVNode.js";
66
65
  export { default as StorageArrayElementNode } from "./utils/StorageArrayElementNode.js";
67
- export { default as TimerNode, TimerNodeScope } from "./utils/TimerNode.js";
68
66
  export { default as TriplanarTexturesNode } from "./utils/TriplanarTexturesNode.js";
69
67
 
70
68
  // accessors
@@ -94,34 +92,15 @@ export { default as UserDataNode, NodeUserData } from "./accessors/UserDataNode.
94
92
  export { default as VertexColorNode } from "./accessors/VertexColorNode.js";
95
93
 
96
94
  // display
97
- export { default as AfterImageNode } from "./display/AfterImageNode.js";
98
- export { default as AnaglyphPassNode } from "./display/AnaglyphPassNode.js";
99
- export { default as AnamorphicNode } from "./display/AnamorphicNode.js";
100
- export { default as BloomNode } from "./display/BloomNode.js";
101
95
  export { default as BumpMapNode } from "./display/BumpMapNode.js";
102
96
  export { default as ColorSpaceNode } from "./display/ColorSpaceNode.js";
103
- export { default as DenoiseNode } from "./display/DenoiseNode.js";
104
- export { default as DepthOfFieldNode } from "./display/DepthOfFieldNode.js";
105
- export { default as DotScreenNode } from "./display/DotScreenNode.js";
106
- export { default as FilmNode } from "./display/FilmNode.js";
107
97
  export { default as FrontFacingNode } from "./display/FrontFacingNode.js";
108
- export { default as FXAANode } from "./display/FXAANode.js";
109
- export { default as GaussianBlurNode } from "./display/GaussianBlurNode.js";
110
- export { default as GTAONode } from "./display/GTAONode.js";
111
- export { default as Lut3DNode } from "./display/Lut3DNode.js";
112
98
  export { default as NormalMapNode } from "./display/NormalMapNode.js";
113
- export { default as ParallaxBarrierPassNode } from "./display/ParallaxBarrierPassNode.js";
114
99
  export { default as PassNode, PassNodeScope } from "./display/PassNode.js";
115
- export { default as PixelationPassNode } from "./display/PixelationPassNode.js";
116
100
  export { default as PosterizeNode } from "./display/PosterizeNode.js";
117
101
  export { default as RenderOutputNode } from "./display/RenderOutputNode.js";
118
- export { default as RGBShiftNode } from "./display/RGBShiftNode.js";
119
102
  export { default as ScreenNode, ScreenNodeScope } from "./display/ScreenNode.js";
120
- export { default as SobelOperatorNode } from "./display/SobelOperatorNode.js";
121
- export { default as SSAAPassNode } from "./display/SSAAPassNode.js";
122
- export { default as StereoPassNode } from "./display/StereoPassNode.js";
123
103
  export { default as ToneMappingNode } from "./display/ToneMappingNode.js";
124
- export { default as TransitionNode } from "./display/TransitionNode.js";
125
104
  export { default as ViewportDepthNode, ViewportDepthNodeScope } from "./display/ViewportDepthNode.js";
126
105
  export { default as ViewportDepthTextureNode } from "./display/ViewportDepthTextureNode.js";
127
106
  export { default as ViewportSharedTextureNode } from "./display/ViewportSharedTextureNode.js";
@@ -163,6 +142,7 @@ export { default as LightProbeNode } from "./lighting/LightProbeNode.js";
163
142
  export { default as LightsNode } from "./lighting/LightsNode.js";
164
143
  export { default as PointLightNode } from "./lighting/PointLightNode.js";
165
144
  export { default as RectAreaLightNode, RectAreaLightTexturesLib } from "./lighting/RectAreaLightNode.js";
145
+ export { default as ShadowNode } from "./lighting/ShadowNode.js";
166
146
  export { default as SpotLightNode } from "./lighting/SpotLightNode.js";
167
147
 
168
148
  // pmrem