@types/three 0.144.0 → 0.147.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 (100) hide show
  1. three/README.md +1 -1
  2. three/examples/jsm/animation/CCDIKSolver.d.ts +9 -4
  3. three/examples/jsm/animation/MMDPhysics.d.ts +6 -1
  4. three/examples/jsm/controls/OrbitControls.d.ts +198 -2
  5. three/examples/jsm/csm/CSMHelper.d.ts +1 -0
  6. three/examples/jsm/helpers/OctreeHelper.d.ts +3 -0
  7. three/examples/jsm/helpers/VertexNormalsHelper.d.ts +2 -0
  8. three/examples/jsm/helpers/VertexTangentsHelper.d.ts +2 -0
  9. three/examples/jsm/interactive/SelectionHelper.d.ts +1 -0
  10. three/examples/jsm/loaders/PCDLoader.d.ts +1 -1
  11. three/examples/jsm/loaders/PLYLoader.d.ts +2 -0
  12. three/examples/jsm/loaders/RGBELoader.d.ts +0 -1
  13. three/examples/jsm/loaders/USDZLoader.d.ts +18 -0
  14. three/examples/jsm/nodes/Nodes.d.ts +21 -2
  15. three/examples/jsm/nodes/accessors/BitangentNode.d.ts +18 -0
  16. three/examples/jsm/nodes/accessors/NormalNode.d.ts +1 -6
  17. three/examples/jsm/nodes/accessors/PositionNode.d.ts +2 -0
  18. three/examples/jsm/nodes/accessors/TangentNode.d.ts +18 -0
  19. three/examples/jsm/nodes/core/NodeBuilder.d.ts +8 -3
  20. three/examples/jsm/nodes/core/NodeVarying.d.ts +8 -0
  21. three/examples/jsm/nodes/core/constants.d.ts +13 -13
  22. three/examples/jsm/nodes/display/BlendModeNode.d.ts +32 -0
  23. three/examples/jsm/nodes/display/PosterizeNode.d.ts +8 -0
  24. three/examples/jsm/nodes/display/ViewportNode.d.ts +23 -0
  25. three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +94 -0
  26. three/examples/jsm/nodes/materialx/{functions/lib → lib}/mx_hsv.d.ts +1 -1
  27. three/examples/jsm/nodes/materialx/{functions/lib → lib}/mx_noise.d.ts +1 -1
  28. three/examples/jsm/nodes/math/MathNode.d.ts +1 -2
  29. three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +24 -2
  30. three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +38 -0
  31. three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +6 -0
  32. three/examples/jsm/nodes/utils/RemapNode.d.ts +13 -0
  33. three/examples/jsm/nodes/utils/TimerNode.d.ts +6 -1
  34. three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +22 -0
  35. three/examples/jsm/objects/ShadowMesh.d.ts +6 -3
  36. three/examples/jsm/postprocessing/AdaptiveToneMappingPass.d.ts +2 -2
  37. three/examples/jsm/postprocessing/AfterimagePass.d.ts +3 -3
  38. three/examples/jsm/postprocessing/BloomPass.d.ts +3 -3
  39. three/examples/jsm/postprocessing/BokehPass.d.ts +2 -4
  40. three/examples/jsm/postprocessing/ClearPass.d.ts +1 -1
  41. three/examples/jsm/postprocessing/CubeTexturePass.d.ts +1 -1
  42. three/examples/jsm/postprocessing/DotScreenPass.d.ts +2 -2
  43. three/examples/jsm/postprocessing/EffectComposer.d.ts +2 -1
  44. three/examples/jsm/postprocessing/FilmPass.d.ts +2 -2
  45. three/examples/jsm/postprocessing/GlitchPass.d.ts +2 -2
  46. three/examples/jsm/postprocessing/HalftonePass.d.ts +2 -2
  47. three/examples/jsm/postprocessing/MaskPass.d.ts +1 -1
  48. three/examples/jsm/postprocessing/OutlinePass.d.ts +2 -2
  49. three/examples/jsm/postprocessing/Pass.d.ts +2 -0
  50. three/examples/jsm/postprocessing/RenderPass.d.ts +1 -1
  51. three/examples/jsm/postprocessing/RenderPixelatedPass.d.ts +28 -0
  52. three/examples/jsm/postprocessing/SAOPass.d.ts +2 -2
  53. three/examples/jsm/postprocessing/SMAAPass.d.ts +2 -2
  54. three/examples/jsm/postprocessing/SSAARenderPass.d.ts +2 -2
  55. three/examples/jsm/postprocessing/SSAOPass.d.ts +2 -2
  56. three/examples/jsm/postprocessing/SavePass.d.ts +2 -2
  57. three/examples/jsm/postprocessing/ShaderPass.d.ts +2 -2
  58. three/examples/jsm/postprocessing/TexturePass.d.ts +2 -2
  59. three/examples/jsm/postprocessing/UnrealBloomPass.d.ts +2 -2
  60. three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +5 -4
  61. three/examples/jsm/shaders/VelocityShader.d.ts +13 -0
  62. three/examples/jsm/utils/BufferGeometryUtils.d.ts +11 -0
  63. three/examples/jsm/utils/SceneUtils.d.ts +9 -1
  64. three/examples/jsm/webxr/OculusHandPointerModel.d.ts +2 -2
  65. three/index.d.ts +1 -1
  66. three/package.json +3 -3
  67. three/src/Three.d.ts +2 -0
  68. three/src/core/Object3D.d.ts +9 -1
  69. three/src/helpers/ArrowHelper.d.ts +4 -0
  70. three/src/helpers/Box3Helper.d.ts +2 -0
  71. three/src/helpers/BoxHelper.d.ts +2 -0
  72. three/src/helpers/GridHelper.d.ts +1 -4
  73. three/src/helpers/PlaneHelper.d.ts +2 -0
  74. three/src/helpers/PolarGridHelper.d.ts +2 -0
  75. three/src/helpers/SkeletonHelper.d.ts +2 -0
  76. three/src/lights/PointLight.d.ts +1 -1
  77. three/src/lights/SpotLight.d.ts +7 -1
  78. three/src/loaders/DataTextureLoader.d.ts +1 -1
  79. three/src/materials/MeshLambertMaterial.d.ts +1 -1
  80. three/src/math/ColorManagement.d.ts +11 -1
  81. three/src/math/Euler.d.ts +13 -11
  82. three/src/math/Matrix3.d.ts +46 -0
  83. three/src/math/Quaternion.d.ts +10 -1
  84. three/src/objects/LOD.d.ts +22 -2
  85. three/src/renderers/WebGL3DRenderTarget.d.ts +1 -1
  86. three/src/renderers/WebGLArrayRenderTarget.d.ts +1 -1
  87. three/src/renderers/WebGLCubeRenderTarget.d.ts +1 -1
  88. three/src/renderers/WebGLMultipleRenderTargets.d.ts +1 -1
  89. three/src/renderers/WebGLRenderTarget.d.ts +1 -1
  90. three/src/renderers/WebGLRenderer.d.ts +1 -5
  91. three/src/renderers/shaders/UniformsLib.d.ts +3 -2
  92. three/src/renderers/webgl/WebGLCapabilities.d.ts +1 -0
  93. three/src/renderers/webxr/WebXRController.d.ts +6 -1
  94. three/src/renderers/webxr/WebXRManager.d.ts +8 -0
  95. three/src/scenes/Scene.d.ts +16 -5
  96. three/src/textures/CanvasTexture.d.ts +2 -2
  97. three/src/textures/CompressedArrayTexture.d.ts +17 -0
  98. three/src/textures/Texture.d.ts +10 -2
  99. three/examples/jsm/nodes/core/NodeVary.d.ts +0 -6
  100. three/examples/jsm/shaders/PixelShader.d.ts +0 -11
@@ -2,14 +2,14 @@ import { Color, Matrix3, Matrix4, Vector2, Vector3, Vector4 } from '../../../../
2
2
 
3
3
  // disable automatic export, we have some private declarations
4
4
  export const NodeShaderStage: {
5
- Vertex: 'vertex';
6
- Fragment: 'fragment';
5
+ VERTEX: 'vertex';
6
+ FRAGMENT: 'fragment';
7
7
  };
8
8
 
9
9
  export const NodeUpdateType: {
10
- None: 'none';
11
- Frame: 'frame';
12
- Object: 'object';
10
+ NONE: 'none';
11
+ FRAME: 'frame';
12
+ OBJECT: 'object';
13
13
  };
14
14
 
15
15
  export type NodeValueOption = Color | Vector2 | Vector3 | Vector4 | Matrix3 | Matrix4 | boolean | number;
@@ -66,12 +66,12 @@ export interface AnyObject {
66
66
  export type AnyJson = any;
67
67
 
68
68
  export const NodeType: {
69
- Boolean: 'bool';
70
- Integer: 'int';
71
- Float: 'float';
72
- Vector2: 'vec2';
73
- Vector3: 'vec3';
74
- Vector4: 'vec4';
75
- Matrix3: 'mat3';
76
- Matrix4: 'mat4';
69
+ BOOLEAN: 'bool';
70
+ INTEGER: 'int';
71
+ FLOAT: 'float';
72
+ VECTOR2: 'vec2';
73
+ VECTOR3: 'vec3';
74
+ VECTOR4: 'vec4';
75
+ MATRIX3: 'mat3';
76
+ MATRIX4: 'mat4';
77
77
  };
@@ -0,0 +1,32 @@
1
+ import TempNode from '../core/TempNode';
2
+ import { ShaderNode } from '../shadernode/ShaderNodeBaseElements';
3
+ import { Node } from '../Nodes';
4
+
5
+ export const BurnNode: ShaderNode<{ base: Node; blendNode: Node }>;
6
+
7
+ export const DodgeNode: ShaderNode<{ base: Node; blendNode: Node }>;
8
+
9
+ export const ScreenNode: ShaderNode<{ base: Node; blendNode: Node }>;
10
+
11
+ export const OverlayNode: ShaderNode<{ base: Node; blendNode: Node }>;
12
+
13
+ export type BlendMode =
14
+ | typeof BlendModeNode.BURN
15
+ | typeof BlendModeNode.DODGE
16
+ | typeof BlendModeNode.SCREEN
17
+ | typeof BlendModeNode.OVERLAY;
18
+
19
+ export default class BlendModeNode extends TempNode {
20
+ static BURN: 'burn';
21
+ static DODGE: 'dodge';
22
+ static SCREEN: 'screen';
23
+ static OVERLAY: 'overlay';
24
+
25
+ baseNode: Node;
26
+ blendMode: BlendMode;
27
+ blendNode: Node;
28
+
29
+ constructor(blendMode: BlendMode, baseNode: Node, blendNode: Node);
30
+
31
+ construct(): Node;
32
+ }
@@ -0,0 +1,8 @@
1
+ import Node from '../core/Node';
2
+
3
+ export default class PosterizeNode extends Node {
4
+ sourceNode: Node;
5
+ stepsNode: Node;
6
+
7
+ constructor(sourceNode: Node, stepsNode: Node);
8
+ }
@@ -0,0 +1,23 @@
1
+ import Node from '../core/Node';
2
+
3
+ export type ViewportNodeScope =
4
+ | typeof ViewportNode.COORDINATE
5
+ | typeof ViewportNode.RESOLUTION
6
+ | typeof ViewportNode.TOP_LEFT
7
+ | typeof ViewportNode.BOTTOM_LEFT
8
+ | typeof ViewportNode.TOP_RIGHT
9
+ | typeof ViewportNode.BOTTOM_RIGHT;
10
+
11
+ export default class ViewportNode extends Node {
12
+ static COORDINATE: 'coordinate';
13
+ static RESOLUTION: 'resolution';
14
+ static TOP_LEFT: 'topLeft';
15
+ static BOTTOM_LEFT: 'bottomLeft';
16
+ static TOP_RIGHT: 'topRight';
17
+ static BOTTOM_RIGHT: 'bottomRight';
18
+
19
+ scope: ViewportNodeScope;
20
+ isViewportNode: true;
21
+
22
+ constructor(scope: ViewportNodeScope);
23
+ }
@@ -0,0 +1,94 @@
1
+ import { mx_hsvtorgb, mx_rgbtohsv } from './lib/mx_hsv';
2
+ import { Swizzable } from '../shadernode/ShaderNodeElements';
3
+ import { UVNode, MathNode } from '../Nodes';
4
+ import { NodeRepresentation } from '../shadernode/ShaderNode';
5
+
6
+ export function mx_aastep(threshold?: NodeRepresentation, value?: NodeRepresentation): Swizzable<MathNode>;
7
+
8
+ export function mx_ramplr(
9
+ valuel?: NodeRepresentation,
10
+ valuer?: NodeRepresentation,
11
+ texcoord?: Swizzable<UVNode>,
12
+ ): Swizzable<MathNode>;
13
+ export function mx_ramptb(
14
+ valuet?: NodeRepresentation,
15
+ valueb?: NodeRepresentation,
16
+ texcoord?: Swizzable<UVNode>,
17
+ ): Swizzable<MathNode>;
18
+
19
+ export function mx_splitlr(
20
+ valuel?: NodeRepresentation,
21
+ valuer?: NodeRepresentation,
22
+ center?: NodeRepresentation,
23
+ texcoord?: Swizzable<UVNode>,
24
+ ): Swizzable<MathNode>;
25
+ export function mx_splittb(
26
+ valuet?: NodeRepresentation,
27
+ valueb?: NodeRepresentation,
28
+ center?: NodeRepresentation,
29
+ texcoord?: Swizzable<UVNode>,
30
+ ): Swizzable<MathNode>;
31
+
32
+ export function mx_transform_uv(
33
+ uv_scale?: NodeRepresentation,
34
+ uv_offset?: NodeRepresentation,
35
+ uv_geo?: Swizzable<UVNode>,
36
+ ): Swizzable;
37
+
38
+ export function mx_noise_float(
39
+ texcoord?: Swizzable<UVNode>,
40
+ amplitude?: NodeRepresentation,
41
+ pivot?: NodeRepresentation,
42
+ ): Swizzable;
43
+ export function mx_noise_vec2(
44
+ texcoord?: Swizzable<UVNode>,
45
+ amplitude?: NodeRepresentation,
46
+ pivot?: NodeRepresentation,
47
+ ): Swizzable;
48
+ export function mx_noise_vec3(
49
+ texcoord?: Swizzable<UVNode>,
50
+ amplitude?: NodeRepresentation,
51
+ pivot?: NodeRepresentation,
52
+ ): Swizzable;
53
+ export function mx_noise_vec4(
54
+ texcoord?: Swizzable<UVNode>,
55
+ amplitude?: NodeRepresentation,
56
+ pivot?: NodeRepresentation,
57
+ ): Swizzable;
58
+
59
+ export function mx_worley_noise_float(texcoord?: Swizzable<UVNode>, jitter?: NodeRepresentation): Swizzable;
60
+ export function mx_worley_noise_vec2(texcoord?: Swizzable<UVNode>, jitter?: NodeRepresentation): Swizzable;
61
+ export function mx_worley_noise_vec3(texcoord?: Swizzable<UVNode>, jitter?: NodeRepresentation): Swizzable;
62
+
63
+ export function mx_cell_noise_float(texcoord?: Swizzable<UVNode>): Swizzable;
64
+
65
+ export function mx_fractal_noise_float(
66
+ position?: Swizzable<UVNode>,
67
+ octaves?: NodeRepresentation,
68
+ lacunarity?: NodeRepresentation,
69
+ diminish?: NodeRepresentation,
70
+ amplitude?: NodeRepresentation,
71
+ ): Swizzable;
72
+ export function mx_fractal_noise_vec2(
73
+ position?: Swizzable<UVNode>,
74
+ octaves?: NodeRepresentation,
75
+ lacunarity?: NodeRepresentation,
76
+ diminish?: NodeRepresentation,
77
+ amplitude?: NodeRepresentation,
78
+ ): Swizzable;
79
+ export function mx_fractal_noise_vec3(
80
+ position?: Swizzable<UVNode>,
81
+ octaves?: NodeRepresentation,
82
+ lacunarity?: NodeRepresentation,
83
+ diminish?: NodeRepresentation,
84
+ amplitude?: NodeRepresentation,
85
+ ): Swizzable;
86
+ export function mx_fractal_noise_vec4(
87
+ position?: Swizzable<UVNode>,
88
+ octaves?: NodeRepresentation,
89
+ lacunarity?: NodeRepresentation,
90
+ diminish?: NodeRepresentation,
91
+ amplitude?: NodeRepresentation,
92
+ ): Swizzable;
93
+
94
+ export { mx_hsvtorgb, mx_rgbtohsv };
@@ -1,4 +1,4 @@
1
- import { Fn, Node, Swizzable } from '../../../Nodes';
1
+ import { Fn, Node, Swizzable } from '../../Nodes';
2
2
 
3
3
  export function mx_hsvtorgb(...params: Fn<[Node]>): Swizzable;
4
4
  export function mx_rgbtohsv(...params: Fn<[Node]>): Swizzable;
@@ -1,4 +1,4 @@
1
- import { Fn, Node, Swizzable } from '../../../Nodes';
1
+ import { Fn, Node, Swizzable } from '../../Nodes';
2
2
 
3
3
  export function mx_perlin_noise_float(...params: Fn<[Node]>): Swizzable;
4
4
  export function mx_cell_noise_float(...params: Fn<[Node]>): Swizzable;
@@ -27,7 +27,6 @@ export type MathNodeMethod1 =
27
27
  | typeof MathNode.INVERT
28
28
  | typeof MathNode.DFDX
29
29
  | typeof MathNode.DFDY
30
- | typeof MathNode.SATURATE
31
30
  | typeof MathNode.ROUND;
32
31
 
33
32
  export type MathNodeMethod2 =
@@ -80,8 +79,8 @@ export default class MathNode extends TempNode {
80
79
  static INVERT: 'invert';
81
80
  static DFDX: 'dFdx';
82
81
  static DFDY: 'dFdy';
83
- static SATURATE: 'saturate';
84
82
  static ROUND: 'round';
83
+ static RECIPROCAL: 'reciprocal';
85
84
 
86
85
  // 2 inputs
87
86
 
@@ -20,6 +20,7 @@ import { Material, Texture } from '../../../../src/Three';
20
20
  import { NodeTypeOption, NodeUserData, NodeValueOption } from '../core/constants';
21
21
  import { NodeBuilderContext } from '../core/NodeBuilder';
22
22
  import {
23
+ BitangentNode,
23
24
  BufferNode,
24
25
  BypassNode,
25
26
  CameraNode,
@@ -43,6 +44,7 @@ import {
43
44
  PositionNode,
44
45
  PropertyNode,
45
46
  ReferenceNode,
47
+ TangentNode,
46
48
  UserDataNode,
47
49
  UVNode,
48
50
  VarNode,
@@ -91,6 +93,8 @@ export function uniform(nodeOrType: Node | Swizzable | NodeValueOption): Swizzab
91
93
  export function attribute(attributeName: string, nodeType: NodeTypeOption): Swizzable;
92
94
  export function property(name: string, nodeOrType: Node | NodeTypeOption): Swizzable;
93
95
 
96
+ export function convert(node: NodeRepresentation, types: NodeTypeOption): Swizzable;
97
+
94
98
  export function bypass(returnNode: NodeRepresentation, callNode: NodeRepresentation): Swizzable<BypassNode>;
95
99
  export function code(code: string, nodeType?: NodeTypeOption): Swizzable<CodeNode>;
96
100
  export function context(node: NodeRepresentation, context: NodeBuilderContext): Swizzable<ContextNode>;
@@ -164,6 +168,20 @@ export const normalWorld: Swizzable<NormalNode>;
164
168
  export const normalView: Swizzable<NormalNode>;
165
169
  export const transformedNormalView: Swizzable<VarNode>;
166
170
 
171
+ export const tangentGeometry: Swizzable<TangentNode>;
172
+ export const tangentLocal: Swizzable<TangentNode>;
173
+ export const tangentView: Swizzable<TangentNode>;
174
+ export const tangentWorld: Swizzable<TangentNode>;
175
+ export const transformedTangentView: Swizzable<MathNode>;
176
+ export const transformedTangentWorld: Swizzable<MathNode>;
177
+
178
+ export const bitangentGeometry: Swizzable<BitangentNode>;
179
+ export const bitangentLocal: Swizzable<BitangentNode>;
180
+ export const bitangentView: Swizzable<BitangentNode>;
181
+ export const bitangentWorld: Swizzable<BitangentNode>;
182
+ export const transformedBitangentView: Swizzable<MathNode>;
183
+ export const transformedBitangentWorld: Swizzable<MathNode>;
184
+
167
185
  export const modelViewMatrix: Swizzable<ModelNode>;
168
186
  export const modelNormalMatrix: Swizzable<ModelNode>;
169
187
  export const modelWorldMatrix: Swizzable<ModelNode>;
@@ -173,6 +191,7 @@ export const modelViewPosition: Swizzable<ModelNode>;
173
191
  export const positionGeometry: Swizzable<PositionNode>;
174
192
  export const positionLocal: Swizzable<PositionNode>;
175
193
  export const positionWorld: Swizzable<PositionNode>;
194
+ export const positionWorldDirection: Swizzable<PositionNode>;
176
195
  export const positionView: Swizzable<PositionNode>;
177
196
  export const positionViewDirection: Swizzable<PositionNode>;
178
197
 
@@ -246,8 +265,8 @@ export const negate: Unary;
246
265
  export const invert: Unary;
247
266
  export const dFdx: Unary;
248
267
  export const dFdy: Unary;
249
- export const saturate: Unary;
250
268
  export const round: Unary;
269
+ export const reciprocal: Unary;
251
270
 
252
271
  export const atan2: Binary;
253
272
  export const min: Binary;
@@ -281,5 +300,8 @@ export const faceDirection: Swizzable;
281
300
  export function element(node: NodeRepresentation, indexNode: NodeRepresentation): Swizzable;
282
301
 
283
302
  // miscellaneous
303
+ export const lumaCoeffs: Swizzable<MathNode>;
304
+ export const luminance: Binary;
305
+ export const difference: Binary;
284
306
  export const dotNV: Swizzable<MathNode>;
285
- export const transformedNormalWorld: Swizzable<MathNode>;
307
+ export const TBNViewMatrix: Swizzable<MathNode>;
@@ -12,10 +12,12 @@ import {
12
12
  } from '../../../../src/Three';
13
13
  import LightingContextNode, { LightingModelNode } from '../lighting/LightingContextNode';
14
14
  import {
15
+ BlendModeNode,
15
16
  CheckerNode,
16
17
  ColorAdjustmentNode,
17
18
  ColorSpaceNode,
18
19
  CubeTextureNode,
20
+ EquirectUVNode,
19
21
  FogNode,
20
22
  FogRangeNode,
21
23
  InstanceNode,
@@ -24,12 +26,16 @@ import {
24
26
  MaxMipLevelNode,
25
27
  NormalMapNode,
26
28
  OscNode,
29
+ PosterizeNode,
30
+ RemapNode,
27
31
  ReflectVectorNode,
28
32
  RotateUVNode,
29
33
  SkinningNode,
30
34
  SpriteSheetUVNode,
31
35
  TimerNode,
32
36
  ToneMappingNode,
37
+ TriplanarTexturesNode,
38
+ ViewportNode,
33
39
  } from '../Nodes';
34
40
 
35
41
  //
@@ -69,6 +75,11 @@ export function skinning(skinnedMesh: SkinnedMesh): Swizzable<SkinningNode>;
69
75
 
70
76
  // display
71
77
 
78
+ export function burn(baseNode: NodeRepresentation, blendNode?: NodeRepresentation): Swizzable<BlendModeNode>;
79
+ export function dodge(baseNode: NodeRepresentation, blendNode?: NodeRepresentation): Swizzable<BlendModeNode>;
80
+ export function overlay(baseNode: NodeRepresentation, blendNode?: NodeRepresentation): Swizzable<BlendModeNode>;
81
+ export function screen(baseNode: NodeRepresentation, blendNode?: NodeRepresentation): Swizzable<BlendModeNode>;
82
+
72
83
  export function saturation(
73
84
  colorNode: NodeRepresentation,
74
85
  adjustmentNode?: NodeRepresentation,
@@ -87,6 +98,15 @@ export function toneMapping(
87
98
  color: NodeRepresentation,
88
99
  ): Swizzable<ToneMappingNode>;
89
100
 
101
+ export function posterize(sourceNode: NodeRepresentation, stepsNode: NodeRepresentation): Swizzable<PosterizeNode>;
102
+
103
+ export const viewportCoordinate: Swizzable<ViewportNode>;
104
+ export const viewportResolution: Swizzable<ViewportNode>;
105
+ export const viewportTopLeft: Swizzable<ViewportNode>;
106
+ export const viewportBottomLeft: Swizzable<ViewportNode>;
107
+ export const viewportTopRight: Swizzable<ViewportNode>;
108
+ export const viewportBottomRight: Swizzable<ViewportNode>;
109
+
90
110
  // lighting
91
111
 
92
112
  export function lights(lights: Light[]): Swizzable<LightsNode>;
@@ -95,6 +115,8 @@ export function lightingContext(node: Node, lightingModelNode?: LightingModelNod
95
115
  // utils
96
116
 
97
117
  export const matcapUV: Swizzable<MatcapUVNode>;
118
+ export const equirectUV: Swizzable<EquirectUVNode>;
119
+
98
120
  export function maxMipLevel(texture: Texture): Swizzable<MaxMipLevelNode>;
99
121
 
100
122
  export function oscSine(timeNode?: NodeRepresentation): Swizzable<OscNode>;
@@ -102,6 +124,9 @@ export function oscSquare(timeNode?: NodeRepresentation): Swizzable<OscNode>;
102
124
  export function oscTriangle(timeNode?: NodeRepresentation): Swizzable<OscNode>;
103
125
  export function oscSawtooth(timeNode?: NodeRepresentation): Swizzable<OscNode>;
104
126
 
127
+ export function remap(node: Node, inLowNode: Node): Swizzable<RemapNode>;
128
+ export function remapClamp(node: Node, inLowNode: Node): Swizzable<RemapNode>;
129
+
105
130
  export function rotateUV(uvNode: Node, rotationNode: Node, centerNode?: Node): Swizzable<RotateUVNode>;
106
131
 
107
132
  export function spritesheetUV(
@@ -113,6 +138,19 @@ export function spritesheetUV(
113
138
  export function timerLocal(timeScale: number, value?: number): Swizzable<TimerNode>;
114
139
  export function timerGlobal(timeScale: number, value?: number): Swizzable<TimerNode>;
115
140
  export function timerDelta(timeScale: number, value?: number): Swizzable<TimerNode>;
141
+ export const frameId: Swizzable<TimerNode>;
142
+ export function triplanarTextures(
143
+ textureXNode: NodeRepresentation,
144
+ textureYNode?: NodeRepresentation,
145
+ textureZNode?: NodeRepresentation,
146
+ scaleNode?: NodeRepresentation,
147
+ positionNode?: NodeRepresentation,
148
+ normalNode?: NodeRepresentation,
149
+ ): Swizzable<TriplanarTexturesNode>;
150
+ export function triplanarTexture(
151
+ texture: NodeRepresentation,
152
+ ...params: NodeRepresentation[]
153
+ ): Swizzable<TriplanarTexturesNode>;
116
154
 
117
155
  // geometry
118
156
 
@@ -0,0 +1,6 @@
1
+ import { PositionNode, TempNode } from '../Nodes';
2
+ import { Swizzable } from '../shadernode/ShaderNodeElements';
3
+
4
+ export default class EquirectUVNode extends TempNode {
5
+ constructor(dirNode?: Swizzable<PositionNode>);
6
+ }
@@ -0,0 +1,13 @@
1
+ import Node from '../core/Node';
2
+
3
+ export default class RemapNode extends Node {
4
+ node: Node;
5
+ inLowNode: Node;
6
+ inHighNode: Node;
7
+ outLowNode: Node;
8
+ outHighNode: Node;
9
+
10
+ doClamp: boolean;
11
+
12
+ constructor(node: Node, inLowNode: Node, inHighNode: Node, outLowNode: Node, outHighNode: Node);
13
+ }
@@ -1,11 +1,16 @@
1
1
  import UniformNode from '../core/UniformNode';
2
2
 
3
- export type TimerNodeScope = typeof TimerNode.LOCAL | typeof TimerNode.GLOBAL | typeof TimerNode.DELTA;
3
+ export type TimerNodeScope =
4
+ | typeof TimerNode.LOCAL
5
+ | typeof TimerNode.GLOBAL
6
+ | typeof TimerNode.DELTA
7
+ | typeof TimerNode.FRAME;
4
8
 
5
9
  export default class TimerNode extends UniformNode {
6
10
  static LOCAL: 'local';
7
11
  static GLOBAL: 'global';
8
12
  static DELTA: 'delta';
13
+ static FRAME: 'frame';
9
14
 
10
15
  scope: TimerNodeScope;
11
16
  scale: number;
@@ -0,0 +1,22 @@
1
+ import Node from '../core/Node';
2
+ import { PositionNode, Swizzable, TextureNode } from '../Nodes';
3
+
4
+ export default class TriplanarTexturesNode extends Node {
5
+ textureXNode: TextureNode;
6
+ textureYNode: TextureNode | null;
7
+ textureZNode: TextureNode | null;
8
+
9
+ scaleNode: Swizzable;
10
+
11
+ positionNode: Swizzable<PositionNode>;
12
+ normalNode: Swizzable<PositionNode>;
13
+
14
+ constructor(
15
+ textureXNode: Node,
16
+ textureYNode?: TextureNode | null,
17
+ textureZNode?: TextureNode | null,
18
+ scaleNode?: Swizzable,
19
+ positionNode?: Swizzable<PositionNode>,
20
+ normalNode?: Swizzable<PositionNode>,
21
+ );
22
+ }
@@ -1,7 +1,10 @@
1
- import { Mesh, Plane, Vector4 } from '../../../src/Three';
1
+ import { Mesh, Plane, Vector4, Matrix4, MeshBasicMaterial, BufferGeometry } from '../../../src/Three';
2
2
 
3
- export class ShadowMesh extends Mesh {
4
- constructor();
3
+ export class ShadowMesh extends Mesh<BufferGeometry, MeshBasicMaterial> {
4
+ readonly isShadowMesh: true;
5
+ meshMatrix: Matrix4;
6
+
7
+ constructor(mesh: Mesh);
5
8
 
6
9
  update(plane: Plane, lightPosition4D: Vector4): void;
7
10
  }
@@ -1,6 +1,6 @@
1
1
  import { WebGLRenderTarget, ShaderMaterial } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class AdaptiveToneMappingPass extends Pass {
6
6
  constructor(adaptive?: boolean, resolution?: number);
@@ -16,7 +16,7 @@ export class AdaptiveToneMappingPass extends Pass {
16
16
  adaptLuminanceShader: object;
17
17
  materialAdaptiveLum: ShaderMaterial;
18
18
  materialToneMap: ShaderMaterial;
19
- fsQuad: object;
19
+ fsQuad: FullScreenQuad;
20
20
 
21
21
  reset(): void;
22
22
  setAdaptive(adaptive: boolean): void;
@@ -1,6 +1,6 @@
1
1
  import { WebGLRenderTarget, ShaderMaterial } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class AfterimagePass extends Pass {
6
6
  constructor(damp?: number);
@@ -9,6 +9,6 @@ export class AfterimagePass extends Pass {
9
9
  textureComp: WebGLRenderTarget;
10
10
  textureOld: WebGLRenderTarget;
11
11
  shaderMaterial: ShaderMaterial;
12
- compFsQuad: object;
13
- copyFsQuad: object;
12
+ compFsQuad: FullScreenQuad;
13
+ copyFsQuad: FullScreenQuad;
14
14
  }
@@ -1,14 +1,14 @@
1
1
  import { WebGLRenderTarget, ShaderMaterial } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class BloomPass extends Pass {
6
- constructor(strength?: number, kernelSize?: number, sigma?: number, resolution?: number);
6
+ constructor(strength?: number, kernelSize?: number, sigma?: number);
7
7
  renderTargetX: WebGLRenderTarget;
8
8
  renderTargetY: WebGLRenderTarget;
9
9
  copyUniforms: object;
10
10
  materialCopy: ShaderMaterial;
11
11
  convolutionUniforms: object;
12
12
  materialConvolution: ShaderMaterial;
13
- fsQuad: object;
13
+ fsQuad: FullScreenQuad;
14
14
  }
@@ -1,14 +1,12 @@
1
1
  import { Scene, Camera, ShaderMaterial, WebGLRenderTarget, MeshDepthMaterial, Color } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export interface BokehPassParamters {
6
6
  focus?: number;
7
7
  aspect?: number;
8
8
  aperture?: number;
9
9
  maxblur?: number;
10
- width?: number;
11
- height?: number;
12
10
  }
13
11
 
14
12
  export class BokehPass extends Pass {
@@ -20,6 +18,6 @@ export class BokehPass extends Pass {
20
18
  materialDepth: MeshDepthMaterial;
21
19
  materialBokeh: ShaderMaterial;
22
20
  uniforms: object;
23
- fsQuad: object;
21
+ fsQuad: FullScreenQuad;
24
22
  oldClearColor: Color;
25
23
  }
@@ -1,6 +1,6 @@
1
1
  import { ColorRepresentation } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class ClearPass extends Pass {
6
6
  constructor(clearColor?: ColorRepresentation, clearAlpha?: number);
@@ -1,6 +1,6 @@
1
1
  import { PerspectiveCamera, CubeTexture, Mesh, Scene } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class CubeTexturePass extends Pass {
6
6
  constructor(camera: PerspectiveCamera, envMap?: CubeTexture, opacity?: number);
@@ -1,10 +1,10 @@
1
1
  import { Vector2, ShaderMaterial } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class DotScreenPass extends Pass {
6
6
  constructor(center?: Vector2, angle?: number, scale?: number);
7
7
  uniforms: object;
8
8
  material: ShaderMaterial;
9
- fsQuad: object;
9
+ fsQuad: FullScreenQuad;
10
10
  }
@@ -1,6 +1,6 @@
1
1
  import { Clock, WebGLRenderer, WebGLRenderTarget } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
  import { ShaderPass } from './ShaderPass';
5
5
 
6
6
  export { FullScreenQuad } from './Pass';
@@ -27,4 +27,5 @@ export class EffectComposer {
27
27
  reset(renderTarget?: WebGLRenderTarget): void;
28
28
  setSize(width: number, height: number): void;
29
29
  setPixelRatio(pixelRatio: number): void;
30
+ dispose(): void;
30
31
  }
@@ -1,10 +1,10 @@
1
1
  import { ShaderMaterial } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class FilmPass extends Pass {
6
6
  constructor(noiseIntensity?: number, scanlinesIntensity?: number, scanlinesCount?: number, grayscale?: number);
7
7
  uniforms: object;
8
8
  material: ShaderMaterial;
9
- fsQuad: object;
9
+ fsQuad: FullScreenQuad;
10
10
  }
@@ -1,12 +1,12 @@
1
1
  import { ShaderMaterial, DataTexture } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class GlitchPass extends Pass {
6
6
  constructor(dt_size?: number);
7
7
  uniforms: object;
8
8
  material: ShaderMaterial;
9
- fsQuad: object;
9
+ fsQuad: FullScreenQuad;
10
10
  goWild: boolean;
11
11
  curF: number;
12
12
  randX: number;
@@ -1,6 +1,6 @@
1
1
  import { ShaderMaterial } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export interface HalftonePassParameters {
6
6
  shape?: number;
@@ -19,5 +19,5 @@ export class HalftonePass extends Pass {
19
19
  constructor(width: number, height: number, params: HalftonePassParameters);
20
20
  uniforms: object;
21
21
  material: ShaderMaterial;
22
- fsQuad: object;
22
+ fsQuad: FullScreenQuad;
23
23
  }
@@ -1,6 +1,6 @@
1
1
  import { Scene, Camera } from '../../../src/Three';
2
2
 
3
- import { Pass } from './Pass';
3
+ import { Pass, FullScreenQuad } from './Pass';
4
4
 
5
5
  export class MaskPass extends Pass {
6
6
  constructor(scene: Scene, camera: Camera);