@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.
- three/README.md +1 -1
- three/examples/jsm/animation/CCDIKSolver.d.ts +9 -4
- three/examples/jsm/animation/MMDPhysics.d.ts +6 -1
- three/examples/jsm/controls/OrbitControls.d.ts +198 -2
- three/examples/jsm/csm/CSMHelper.d.ts +1 -0
- three/examples/jsm/helpers/OctreeHelper.d.ts +3 -0
- three/examples/jsm/helpers/VertexNormalsHelper.d.ts +2 -0
- three/examples/jsm/helpers/VertexTangentsHelper.d.ts +2 -0
- three/examples/jsm/interactive/SelectionHelper.d.ts +1 -0
- three/examples/jsm/loaders/PCDLoader.d.ts +1 -1
- three/examples/jsm/loaders/PLYLoader.d.ts +2 -0
- three/examples/jsm/loaders/RGBELoader.d.ts +0 -1
- three/examples/jsm/loaders/USDZLoader.d.ts +18 -0
- three/examples/jsm/nodes/Nodes.d.ts +21 -2
- three/examples/jsm/nodes/accessors/BitangentNode.d.ts +18 -0
- three/examples/jsm/nodes/accessors/NormalNode.d.ts +1 -6
- three/examples/jsm/nodes/accessors/PositionNode.d.ts +2 -0
- three/examples/jsm/nodes/accessors/TangentNode.d.ts +18 -0
- three/examples/jsm/nodes/core/NodeBuilder.d.ts +8 -3
- three/examples/jsm/nodes/core/NodeVarying.d.ts +8 -0
- three/examples/jsm/nodes/core/constants.d.ts +13 -13
- three/examples/jsm/nodes/display/BlendModeNode.d.ts +32 -0
- three/examples/jsm/nodes/display/PosterizeNode.d.ts +8 -0
- three/examples/jsm/nodes/display/ViewportNode.d.ts +23 -0
- three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +94 -0
- three/examples/jsm/nodes/materialx/{functions/lib → lib}/mx_hsv.d.ts +1 -1
- three/examples/jsm/nodes/materialx/{functions/lib → lib}/mx_noise.d.ts +1 -1
- three/examples/jsm/nodes/math/MathNode.d.ts +1 -2
- three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +24 -2
- three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +38 -0
- three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +6 -0
- three/examples/jsm/nodes/utils/RemapNode.d.ts +13 -0
- three/examples/jsm/nodes/utils/TimerNode.d.ts +6 -1
- three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +22 -0
- three/examples/jsm/objects/ShadowMesh.d.ts +6 -3
- three/examples/jsm/postprocessing/AdaptiveToneMappingPass.d.ts +2 -2
- three/examples/jsm/postprocessing/AfterimagePass.d.ts +3 -3
- three/examples/jsm/postprocessing/BloomPass.d.ts +3 -3
- three/examples/jsm/postprocessing/BokehPass.d.ts +2 -4
- three/examples/jsm/postprocessing/ClearPass.d.ts +1 -1
- three/examples/jsm/postprocessing/CubeTexturePass.d.ts +1 -1
- three/examples/jsm/postprocessing/DotScreenPass.d.ts +2 -2
- three/examples/jsm/postprocessing/EffectComposer.d.ts +2 -1
- three/examples/jsm/postprocessing/FilmPass.d.ts +2 -2
- three/examples/jsm/postprocessing/GlitchPass.d.ts +2 -2
- three/examples/jsm/postprocessing/HalftonePass.d.ts +2 -2
- three/examples/jsm/postprocessing/MaskPass.d.ts +1 -1
- three/examples/jsm/postprocessing/OutlinePass.d.ts +2 -2
- three/examples/jsm/postprocessing/Pass.d.ts +2 -0
- three/examples/jsm/postprocessing/RenderPass.d.ts +1 -1
- three/examples/jsm/postprocessing/RenderPixelatedPass.d.ts +28 -0
- three/examples/jsm/postprocessing/SAOPass.d.ts +2 -2
- three/examples/jsm/postprocessing/SMAAPass.d.ts +2 -2
- three/examples/jsm/postprocessing/SSAARenderPass.d.ts +2 -2
- three/examples/jsm/postprocessing/SSAOPass.d.ts +2 -2
- three/examples/jsm/postprocessing/SavePass.d.ts +2 -2
- three/examples/jsm/postprocessing/ShaderPass.d.ts +2 -2
- three/examples/jsm/postprocessing/TexturePass.d.ts +2 -2
- three/examples/jsm/postprocessing/UnrealBloomPass.d.ts +2 -2
- three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +5 -4
- three/examples/jsm/shaders/VelocityShader.d.ts +13 -0
- three/examples/jsm/utils/BufferGeometryUtils.d.ts +11 -0
- three/examples/jsm/utils/SceneUtils.d.ts +9 -1
- three/examples/jsm/webxr/OculusHandPointerModel.d.ts +2 -2
- three/index.d.ts +1 -1
- three/package.json +3 -3
- three/src/Three.d.ts +2 -0
- three/src/core/Object3D.d.ts +9 -1
- three/src/helpers/ArrowHelper.d.ts +4 -0
- three/src/helpers/Box3Helper.d.ts +2 -0
- three/src/helpers/BoxHelper.d.ts +2 -0
- three/src/helpers/GridHelper.d.ts +1 -4
- three/src/helpers/PlaneHelper.d.ts +2 -0
- three/src/helpers/PolarGridHelper.d.ts +2 -0
- three/src/helpers/SkeletonHelper.d.ts +2 -0
- three/src/lights/PointLight.d.ts +1 -1
- three/src/lights/SpotLight.d.ts +7 -1
- three/src/loaders/DataTextureLoader.d.ts +1 -1
- three/src/materials/MeshLambertMaterial.d.ts +1 -1
- three/src/math/ColorManagement.d.ts +11 -1
- three/src/math/Euler.d.ts +13 -11
- three/src/math/Matrix3.d.ts +46 -0
- three/src/math/Quaternion.d.ts +10 -1
- three/src/objects/LOD.d.ts +22 -2
- three/src/renderers/WebGL3DRenderTarget.d.ts +1 -1
- three/src/renderers/WebGLArrayRenderTarget.d.ts +1 -1
- three/src/renderers/WebGLCubeRenderTarget.d.ts +1 -1
- three/src/renderers/WebGLMultipleRenderTargets.d.ts +1 -1
- three/src/renderers/WebGLRenderTarget.d.ts +1 -1
- three/src/renderers/WebGLRenderer.d.ts +1 -5
- three/src/renderers/shaders/UniformsLib.d.ts +3 -2
- three/src/renderers/webgl/WebGLCapabilities.d.ts +1 -0
- three/src/renderers/webxr/WebXRController.d.ts +6 -1
- three/src/renderers/webxr/WebXRManager.d.ts +8 -0
- three/src/scenes/Scene.d.ts +16 -5
- three/src/textures/CanvasTexture.d.ts +2 -2
- three/src/textures/CompressedArrayTexture.d.ts +17 -0
- three/src/textures/Texture.d.ts +10 -2
- three/examples/jsm/nodes/core/NodeVary.d.ts +0 -6
- three/examples/jsm/shaders/PixelShader.d.ts +0 -11
three/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Thu, 29 Dec 2022 19:32:53 GMT
|
|
12
12
|
* Dependencies: [@types/webxr](https://npmjs.com/package/@types/webxr)
|
|
13
13
|
* Global values: `THREE`
|
|
14
14
|
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { Object3D, SkinnedMesh } from '../../../src/Three';
|
|
1
|
+
import { Object3D, SkinnedMesh, Vector3 } from '../../../src/Three';
|
|
2
2
|
|
|
3
3
|
// tslint:disable-next-line:interface-name
|
|
4
4
|
export interface IKS {
|
|
5
5
|
effector: number;
|
|
6
6
|
iteration: number;
|
|
7
|
-
links: {
|
|
7
|
+
links: Array<{
|
|
8
8
|
enabled: boolean;
|
|
9
9
|
index: number;
|
|
10
|
-
|
|
10
|
+
limitation?: Vector3;
|
|
11
|
+
rotationMin?: Vector3;
|
|
12
|
+
rotationMax?: Vector3;
|
|
13
|
+
}>;
|
|
14
|
+
minAngle: number;
|
|
11
15
|
maxAngle: number;
|
|
12
16
|
target: number;
|
|
13
17
|
}
|
|
@@ -21,5 +25,6 @@ export class CCDIKSolver {
|
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
export class CCDIKHelper extends Object3D {
|
|
24
|
-
constructor(mesh: SkinnedMesh, iks
|
|
28
|
+
constructor(mesh: SkinnedMesh, iks?: IKS[], sphereSize?: number);
|
|
29
|
+
dispose(): void;
|
|
25
30
|
}
|
|
@@ -115,5 +115,10 @@ export class Constraint {
|
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
export class MMDPhysicsHelper extends Object3D {
|
|
118
|
-
|
|
118
|
+
mesh: THREE.SkinnedMesh;
|
|
119
|
+
physics: MMDPhysics;
|
|
120
|
+
materials: [THREE.MeshBasicMaterial, THREE.MeshBasicMaterial, THREE.MeshBasicMaterial];
|
|
121
|
+
|
|
122
|
+
constructor(mesh: THREE.SkinnedMesh, physics: MMDPhysics);
|
|
123
|
+
dispose(): void;
|
|
119
124
|
}
|
|
@@ -1,69 +1,265 @@
|
|
|
1
1
|
import { Camera, MOUSE, TOUCH, Vector3 } from '../../../src/Three';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Orbit controls allow the camera to orbit around a target.
|
|
5
|
+
* @param object - The camera to be controlled. The camera must not
|
|
6
|
+
* be a child of another object, unless that object is the scene itself.
|
|
7
|
+
* @param domElement - The HTML element used for
|
|
8
|
+
* event listeners.
|
|
9
|
+
*/
|
|
3
10
|
export class OrbitControls {
|
|
4
11
|
constructor(object: Camera, domElement?: HTMLElement);
|
|
5
12
|
|
|
13
|
+
/**
|
|
14
|
+
* The camera being controlled.
|
|
15
|
+
*/
|
|
6
16
|
object: Camera;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The HTMLElement used to listen for mouse / touch events.
|
|
20
|
+
* This must be passed in the constructor;
|
|
21
|
+
* changing it here will not set up new event listeners.
|
|
22
|
+
*/
|
|
7
23
|
domElement: HTMLElement | Document;
|
|
8
24
|
|
|
9
|
-
|
|
25
|
+
/**
|
|
26
|
+
* When set to `false`, the controls will not respond to user input.
|
|
27
|
+
* @default true
|
|
28
|
+
*/
|
|
10
29
|
enabled: boolean;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The focus point of the controls, the .object orbits around this.
|
|
33
|
+
* It can be updated manually at any point to change the focus
|
|
34
|
+
* of the controls.
|
|
35
|
+
*/
|
|
11
36
|
target: Vector3;
|
|
12
37
|
|
|
13
|
-
|
|
38
|
+
/** @deprecated */
|
|
14
39
|
center: Vector3;
|
|
15
40
|
|
|
41
|
+
/**
|
|
42
|
+
* How far you can dolly in ( PerspectiveCamera only ).
|
|
43
|
+
* @default 0
|
|
44
|
+
*/
|
|
16
45
|
minDistance: number;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* How far you can dolly out ( PerspectiveCamera only ).
|
|
49
|
+
* @default Infinity
|
|
50
|
+
*/
|
|
17
51
|
maxDistance: number;
|
|
18
52
|
|
|
53
|
+
/**
|
|
54
|
+
* How far you can zoom in ( OrthographicCamera only ).
|
|
55
|
+
* @default 0
|
|
56
|
+
*/
|
|
19
57
|
minZoom: number;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* How far you can zoom out ( OrthographicCamera only ).
|
|
61
|
+
* @default Infinity
|
|
62
|
+
*/
|
|
20
63
|
maxZoom: number;
|
|
21
64
|
|
|
65
|
+
/**
|
|
66
|
+
* How far you can orbit vertically, lower limit.
|
|
67
|
+
* Range is 0 to Math.PI radians.
|
|
68
|
+
* @default 0
|
|
69
|
+
*/
|
|
22
70
|
minPolarAngle: number;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* How far you can orbit vertically, upper limit.
|
|
74
|
+
* Range is 0 to Math.PI radians.
|
|
75
|
+
* @default Math.PI.
|
|
76
|
+
*/
|
|
23
77
|
maxPolarAngle: number;
|
|
24
78
|
|
|
79
|
+
/**
|
|
80
|
+
* How far you can orbit horizontally, lower limit.
|
|
81
|
+
* If set, the interval [ min, max ]
|
|
82
|
+
* must be a sub-interval of [ - 2 PI, 2 PI ],
|
|
83
|
+
* with ( max - min < 2 PI ).
|
|
84
|
+
* @default Infinity
|
|
85
|
+
*/
|
|
25
86
|
minAzimuthAngle: number;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* How far you can orbit horizontally, upper limit.
|
|
90
|
+
* If set, the interval [ min, max ] must be a sub-interval
|
|
91
|
+
* of [ - 2 PI, 2 PI ], with ( max - min < 2 PI ).
|
|
92
|
+
* @default Infinity
|
|
93
|
+
*/
|
|
26
94
|
maxAzimuthAngle: number;
|
|
27
95
|
|
|
96
|
+
/**
|
|
97
|
+
* Set to true to enable damping (inertia), which can
|
|
98
|
+
* be used to give a sense of weight to the controls.
|
|
99
|
+
* Note that if this is enabled, you must call
|
|
100
|
+
* .update () in your animation loop.
|
|
101
|
+
* @default false
|
|
102
|
+
*/
|
|
28
103
|
enableDamping: boolean;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* The damping inertia used if .enableDamping is set to true.
|
|
107
|
+
* Note that for this to work,
|
|
108
|
+
* you must call .update () in your animation loop.
|
|
109
|
+
* @default 0.05
|
|
110
|
+
*/
|
|
29
111
|
dampingFactor: number;
|
|
30
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Enable or disable zooming (dollying) of the camera.
|
|
115
|
+
* @default true
|
|
116
|
+
*/
|
|
31
117
|
enableZoom: boolean;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Speed of zooming / dollying.
|
|
121
|
+
* @default 1
|
|
122
|
+
*/
|
|
32
123
|
zoomSpeed: number;
|
|
33
124
|
|
|
125
|
+
/**
|
|
126
|
+
* Enable or disable horizontal and
|
|
127
|
+
* vertical rotation of the camera.
|
|
128
|
+
* Note that it is possible to disable a single axis
|
|
129
|
+
* by setting the min and max of the polar angle or
|
|
130
|
+
* azimuth angle to the same value, which will cause
|
|
131
|
+
* the vertical or horizontal rotation to be fixed at that value.
|
|
132
|
+
* @default true
|
|
133
|
+
*/
|
|
34
134
|
enableRotate: boolean;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Speed of rotation.
|
|
138
|
+
* @default 1
|
|
139
|
+
*/
|
|
35
140
|
rotateSpeed: number;
|
|
36
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Enable or disable camera panning.
|
|
144
|
+
* @default true
|
|
145
|
+
*/
|
|
37
146
|
enablePan: boolean;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Speed of panning.
|
|
150
|
+
* @default 1
|
|
151
|
+
*/
|
|
38
152
|
panSpeed: number;
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Defines how the camera's position is translated when panning.
|
|
156
|
+
* If true, the camera pans in screen space. Otherwise,
|
|
157
|
+
* the camera pans in the plane orthogonal to the camera's
|
|
158
|
+
* up direction. Default is true for OrbitControls; false for MapControls.
|
|
159
|
+
* @default true
|
|
160
|
+
*/
|
|
39
161
|
screenSpacePanning: boolean;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* How fast to pan the camera when the keyboard is used.
|
|
165
|
+
* Default is 7.0 pixels per keypress.
|
|
166
|
+
* @default 7
|
|
167
|
+
*/
|
|
40
168
|
keyPanSpeed: number;
|
|
41
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Set to true to automatically rotate around the target.
|
|
172
|
+
* Note that if this is enabled, you must call
|
|
173
|
+
* .update () in your animation loop.
|
|
174
|
+
*/
|
|
42
175
|
autoRotate: boolean;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* How fast to rotate around the target if .autoRotate is true.
|
|
179
|
+
* Default is 2.0, which equates to 30 seconds per orbit at 60fps.
|
|
180
|
+
* Note that if .autoRotate is enabled, you must call
|
|
181
|
+
* .update () in your animation loop.
|
|
182
|
+
* @default 2
|
|
183
|
+
*/
|
|
43
184
|
autoRotateSpeed: number;
|
|
44
185
|
|
|
186
|
+
/**
|
|
187
|
+
* This object contains references to the keycodes for controlling
|
|
188
|
+
* camera panning. Default is the 4 arrow keys.
|
|
189
|
+
*/
|
|
45
190
|
keys: { LEFT: string; UP: string; RIGHT: string; BOTTOM: string };
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* This object contains references to the mouse actions used
|
|
194
|
+
* by the controls.
|
|
195
|
+
*/
|
|
46
196
|
mouseButtons: Partial<{ LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE }>;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* This object contains references to the touch actions used by
|
|
200
|
+
* the controls.
|
|
201
|
+
*/
|
|
47
202
|
touches: Partial<{ ONE: TOUCH; TWO: TOUCH }>;
|
|
48
203
|
|
|
204
|
+
/**
|
|
205
|
+
* Used internally by the .saveState and .reset methods.
|
|
206
|
+
*/
|
|
49
207
|
target0: Vector3;
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Used internally by the .saveState and .reset methods.
|
|
211
|
+
*/
|
|
50
212
|
position0: Vector3;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Used internally by the .saveState and .reset methods.
|
|
216
|
+
*/
|
|
51
217
|
zoomO: number;
|
|
52
218
|
|
|
219
|
+
/**
|
|
220
|
+
* Update the controls. Must be called after any manual changes
|
|
221
|
+
* to the camera's transform, or in the update loop if .autoRotate
|
|
222
|
+
* or .enableDamping are set.
|
|
223
|
+
*/
|
|
53
224
|
update(): boolean;
|
|
54
225
|
|
|
226
|
+
/**
|
|
227
|
+
* Adds key event listeners to the given DOM element. `window`
|
|
228
|
+
* is a recommended argument for using this method.
|
|
229
|
+
* @param domElement
|
|
230
|
+
*/
|
|
55
231
|
listenToKeyEvents(domElement: HTMLElement | Window): void;
|
|
56
232
|
|
|
233
|
+
/**
|
|
234
|
+
* Save the current state of the controls. This can later be
|
|
235
|
+
* recovered with .reset.
|
|
236
|
+
*/
|
|
57
237
|
saveState(): void;
|
|
58
238
|
|
|
239
|
+
/**
|
|
240
|
+
* Reset the controls to their state from either the last time
|
|
241
|
+
* the .saveState was called, or the initial state.
|
|
242
|
+
*/
|
|
59
243
|
reset(): void;
|
|
60
244
|
|
|
245
|
+
/**
|
|
246
|
+
* Remove all the event listeners.
|
|
247
|
+
*/
|
|
61
248
|
dispose(): void;
|
|
62
249
|
|
|
250
|
+
/**
|
|
251
|
+
* Get the current vertical rotation, in radians.
|
|
252
|
+
*/
|
|
63
253
|
getPolarAngle(): number;
|
|
64
254
|
|
|
255
|
+
/**
|
|
256
|
+
* Get the current horizontal rotation, in radians.
|
|
257
|
+
*/
|
|
65
258
|
getAzimuthalAngle(): number;
|
|
66
259
|
|
|
260
|
+
/**
|
|
261
|
+
* Returns the distance from the camera to the target.
|
|
262
|
+
*/
|
|
67
263
|
getDistance(): number;
|
|
68
264
|
|
|
69
265
|
// EventDispatcher mixins
|
|
@@ -11,5 +11,5 @@ export class PCDLoader extends Loader {
|
|
|
11
11
|
onError?: (event: ErrorEvent) => void,
|
|
12
12
|
): void;
|
|
13
13
|
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<Points>;
|
|
14
|
-
parse(data: ArrayBuffer | string
|
|
14
|
+
parse(data: ArrayBuffer | string): Points;
|
|
15
15
|
}
|
|
@@ -3,6 +3,7 @@ import { BufferGeometry, Loader, LoadingManager } from '../../../src/Three';
|
|
|
3
3
|
export class PLYLoader extends Loader {
|
|
4
4
|
constructor(manager?: LoadingManager);
|
|
5
5
|
propertyNameMapping: object;
|
|
6
|
+
customPropertyMapping: Record<string, any>;
|
|
6
7
|
|
|
7
8
|
load(
|
|
8
9
|
url: string,
|
|
@@ -12,5 +13,6 @@ export class PLYLoader extends Loader {
|
|
|
12
13
|
): void;
|
|
13
14
|
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<BufferGeometry>;
|
|
14
15
|
setPropertyNameMapping(mapping: object): void;
|
|
16
|
+
setCustomPropertyNameMapping(mapping: Record<string, any>): void;
|
|
15
17
|
parse(data: ArrayBuffer | string): BufferGeometry;
|
|
16
18
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Loader, LoadingManager, Mesh } from '../../../src/Three';
|
|
2
|
+
|
|
3
|
+
export class USDAParser {
|
|
4
|
+
parse(text: string): object;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export class USDZLoader extends Loader {
|
|
8
|
+
constructor(manager?: LoadingManager);
|
|
9
|
+
|
|
10
|
+
load(
|
|
11
|
+
url: string,
|
|
12
|
+
onLoad: (usdz: Mesh) => void,
|
|
13
|
+
onProgress?: (event: ProgressEvent) => void,
|
|
14
|
+
onError?: (event: ErrorEvent) => void,
|
|
15
|
+
): void;
|
|
16
|
+
|
|
17
|
+
parse(buffer: ArrayBuffer | string): THREE.Group;
|
|
18
|
+
}
|
|
@@ -18,7 +18,7 @@ import NodeFunctionInput from './core/NodeFunctionInput';
|
|
|
18
18
|
import NodeKeywords from './core/NodeKeywords';
|
|
19
19
|
import NodeUniform from './core/NodeUniform';
|
|
20
20
|
import NodeVar from './core/NodeVar';
|
|
21
|
-
import
|
|
21
|
+
import NodeVarying from './core/NodeVarying';
|
|
22
22
|
import PropertyNode from './core/PropertyNode';
|
|
23
23
|
import TempNode from './core/TempNode';
|
|
24
24
|
import UniformNode from './core/UniformNode';
|
|
@@ -26,6 +26,7 @@ import VarNode from './core/VarNode';
|
|
|
26
26
|
import VaryNode from './core/VaryNode';
|
|
27
27
|
|
|
28
28
|
// accessors
|
|
29
|
+
import BitangentNode, { BitangentNodeScope } from './accessors/BitangentNode';
|
|
29
30
|
import BufferNode from './accessors/BufferNode';
|
|
30
31
|
import CameraNode, { CameraNodeScope } from './accessors/CameraNode';
|
|
31
32
|
import CubeTextureNode from './accessors/CubeTextureNode';
|
|
@@ -41,6 +42,7 @@ import PositionNode, { PositionNodeScope } from './accessors/PositionNode';
|
|
|
41
42
|
import ReferenceNode from './accessors/ReferenceNode';
|
|
42
43
|
import ReflectVectorNode from './accessors/ReflectVectorNode';
|
|
43
44
|
import SkinningNode from './accessors/SkinningNode';
|
|
45
|
+
import TangentNode, { TangentNodeScope } from './accessors/TangentNode';
|
|
44
46
|
import TextureNode from './accessors/TextureNode';
|
|
45
47
|
import UVNode from './accessors/UVNode';
|
|
46
48
|
import UserDataNode from './accessors/UserDataNode';
|
|
@@ -52,11 +54,14 @@ import RangeNode, { RangeModeBound } from './geometry/RangeNode';
|
|
|
52
54
|
import ComputeNode from './gpgpu/ComputeNode';
|
|
53
55
|
|
|
54
56
|
// display
|
|
57
|
+
import BlendModeNode, { BlendMode } from './display/BlendModeNode';
|
|
55
58
|
import ColorAdjustmentNode, { ColorAdjustmentMethod } from './display/ColorAdjustmentNode';
|
|
56
59
|
import ColorSpaceNode, { ColorSpaceNodeMethod } from './display/ColorSpaceNode';
|
|
57
60
|
import FrontFacingNode from './display/FrontFacingNode';
|
|
58
61
|
import NormalMapNode from './display/NormalMapNode';
|
|
62
|
+
import PosterizeNode from './display/PosterizeNode';
|
|
59
63
|
import ToneMappingNode from './display/ToneMappingNode';
|
|
64
|
+
import ViewportNode from './display/ViewportNode';
|
|
60
65
|
|
|
61
66
|
// math
|
|
62
67
|
import MathNode, { MathNodeMethod1, MathNodeMethod2, MathNodeMethod3, MathNodeMethod } from './math/MathNode';
|
|
@@ -77,14 +82,17 @@ import AnalyticLightNode from './lighting/AnalyticLightNode';
|
|
|
77
82
|
|
|
78
83
|
import ArrayElementNode from './utils/ArrayElementNode';
|
|
79
84
|
import ConvertNode from './utils/ConvertNode';
|
|
85
|
+
import EquirectUVNode from './utils/EquirectUVNode';
|
|
80
86
|
import JoinNode from './utils/JoinNode';
|
|
81
87
|
import MatcapUVNode from './utils/MatcapUVNode';
|
|
82
88
|
import MaxMipLevelNode from './utils/MaxMipLevelNode';
|
|
83
89
|
import OscNode, { OscNodeMethod } from './utils/OscNode';
|
|
90
|
+
import RemapNode from './utils/RemapNode';
|
|
84
91
|
import RotateUVNode from './utils/RotateUVNode';
|
|
85
92
|
import SplitNode from './utils/SplitNode';
|
|
86
93
|
import SpriteSheetUVNode from './utils/SpriteSheetUVNode';
|
|
87
94
|
import TimerNode, { TimerNodeScope } from './utils/TimerNode';
|
|
95
|
+
import TriplanarTexturesNode from './utils/TriplanarTexturesNode';
|
|
88
96
|
|
|
89
97
|
// loaders
|
|
90
98
|
import NodeLoader from './loaders/NodeLoader';
|
|
@@ -129,7 +137,7 @@ export {
|
|
|
129
137
|
NodeKeywords,
|
|
130
138
|
NodeUniform,
|
|
131
139
|
NodeVar,
|
|
132
|
-
|
|
140
|
+
NodeVarying,
|
|
133
141
|
PropertyNode,
|
|
134
142
|
TempNode,
|
|
135
143
|
UniformNode,
|
|
@@ -141,6 +149,8 @@ export {
|
|
|
141
149
|
// gpgpu
|
|
142
150
|
ComputeNode,
|
|
143
151
|
// accessors
|
|
152
|
+
BitangentNode,
|
|
153
|
+
BitangentNodeScope,
|
|
144
154
|
BufferNode,
|
|
145
155
|
CameraNode,
|
|
146
156
|
CameraNodeScope,
|
|
@@ -161,17 +171,23 @@ export {
|
|
|
161
171
|
ReferenceNode,
|
|
162
172
|
ReflectVectorNode,
|
|
163
173
|
SkinningNode,
|
|
174
|
+
TangentNode,
|
|
175
|
+
TangentNodeScope,
|
|
164
176
|
TextureNode,
|
|
165
177
|
UVNode,
|
|
166
178
|
UserDataNode,
|
|
167
179
|
// display
|
|
180
|
+
BlendModeNode,
|
|
181
|
+
BlendMode,
|
|
168
182
|
ColorAdjustmentNode,
|
|
169
183
|
ColorAdjustmentMethod,
|
|
170
184
|
ColorSpaceNode,
|
|
171
185
|
ColorSpaceNodeMethod,
|
|
172
186
|
FrontFacingNode,
|
|
173
187
|
NormalMapNode,
|
|
188
|
+
PosterizeNode,
|
|
174
189
|
ToneMappingNode,
|
|
190
|
+
ViewportNode,
|
|
175
191
|
// math
|
|
176
192
|
MathNode,
|
|
177
193
|
MathNodeMethod1,
|
|
@@ -194,16 +210,19 @@ export {
|
|
|
194
210
|
// utils
|
|
195
211
|
ArrayElementNode,
|
|
196
212
|
ConvertNode,
|
|
213
|
+
EquirectUVNode,
|
|
197
214
|
JoinNode,
|
|
198
215
|
MatcapUVNode,
|
|
199
216
|
MaxMipLevelNode,
|
|
200
217
|
OscNode,
|
|
201
218
|
OscNodeMethod,
|
|
219
|
+
RemapNode,
|
|
202
220
|
RotateUVNode,
|
|
203
221
|
SplitNode,
|
|
204
222
|
SpriteSheetUVNode,
|
|
205
223
|
TimerNode,
|
|
206
224
|
TimerNodeScope,
|
|
225
|
+
TriplanarTexturesNode,
|
|
207
226
|
// procedural
|
|
208
227
|
CheckerNode,
|
|
209
228
|
// fog
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Node from '../core/Node';
|
|
2
|
+
|
|
3
|
+
export type BitangentNodeScope =
|
|
4
|
+
| typeof BitangentNode.LOCAL
|
|
5
|
+
| typeof BitangentNode.VIEW
|
|
6
|
+
| typeof BitangentNode.WORLD
|
|
7
|
+
| typeof BitangentNode.GEOMETRY;
|
|
8
|
+
|
|
9
|
+
export default class BitangentNode extends Node {
|
|
10
|
+
static GEOMETRY: 'geometry';
|
|
11
|
+
static LOCAL: 'local';
|
|
12
|
+
static VIEW: 'view';
|
|
13
|
+
static WORLD: 'world';
|
|
14
|
+
|
|
15
|
+
scope: BitangentNodeScope;
|
|
16
|
+
|
|
17
|
+
constructor(scope?: BitangentNodeScope);
|
|
18
|
+
}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import Node from '../core/Node';
|
|
2
2
|
|
|
3
|
-
export type NormalNodeScope =
|
|
4
|
-
| typeof NormalNode.GEOMETRY
|
|
5
|
-
| typeof NormalNode.LOCAL
|
|
6
|
-
| typeof NormalNode.WORLD
|
|
7
|
-
| typeof NormalNode.VIEW;
|
|
3
|
+
export type NormalNodeScope = typeof NormalNode.GEOMETRY | typeof NormalNode.LOCAL | typeof NormalNode.VIEW;
|
|
8
4
|
|
|
9
5
|
export default class NormalNode extends Node {
|
|
10
6
|
static GEOMETRY: 'geometry';
|
|
11
7
|
static LOCAL: 'local';
|
|
12
|
-
static WORLD: 'world';
|
|
13
8
|
static VIEW: 'view';
|
|
14
9
|
scope: NormalNodeScope;
|
|
15
10
|
|
|
@@ -4,6 +4,7 @@ export type PositionNodeScope =
|
|
|
4
4
|
| typeof PositionNode.GEOMETRY
|
|
5
5
|
| typeof PositionNode.LOCAL
|
|
6
6
|
| typeof PositionNode.WORLD
|
|
7
|
+
| typeof PositionNode.WORLD_DIRECTION
|
|
7
8
|
| typeof PositionNode.VIEW
|
|
8
9
|
| typeof PositionNode.VIEW_DIRECTION;
|
|
9
10
|
|
|
@@ -11,6 +12,7 @@ export default class PositionNode extends Node {
|
|
|
11
12
|
static GEOMETRY: 'geometry';
|
|
12
13
|
static LOCAL: 'local';
|
|
13
14
|
static WORLD: 'world';
|
|
15
|
+
static WORLD_DIRECTION: 'worldDirection';
|
|
14
16
|
static VIEW: 'view';
|
|
15
17
|
static VIEW_DIRECTION: 'viewDirection';
|
|
16
18
|
scope: PositionNodeScope;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Node from '../core/Node.js';
|
|
2
|
+
|
|
3
|
+
export type TangentNodeScope =
|
|
4
|
+
| typeof TangentNode.LOCAL
|
|
5
|
+
| typeof TangentNode.VIEW
|
|
6
|
+
| typeof TangentNode.WORLD
|
|
7
|
+
| typeof TangentNode.GEOMETRY;
|
|
8
|
+
|
|
9
|
+
export default class TangentNode extends Node {
|
|
10
|
+
static GEOMETRY: 'geometry';
|
|
11
|
+
static LOCAL: 'local';
|
|
12
|
+
static VIEW: 'view';
|
|
13
|
+
static WORLD: 'world';
|
|
14
|
+
|
|
15
|
+
scope: TangentNodeScope;
|
|
16
|
+
|
|
17
|
+
constructor(scope?: TangentNodeScope);
|
|
18
|
+
}
|
|
@@ -17,7 +17,7 @@ import NodeAttribute from './NodeAttribute';
|
|
|
17
17
|
import NodeParser from './NodeParser';
|
|
18
18
|
import NodeUniform from './NodeUniform';
|
|
19
19
|
import NodeVar from './NodeVar';
|
|
20
|
-
import
|
|
20
|
+
import NodeVarying from './NodeVarying';
|
|
21
21
|
|
|
22
22
|
export type BuildStageOption = 'construct' | 'analyze' | 'generate';
|
|
23
23
|
|
|
@@ -74,6 +74,10 @@ export default abstract class NodeBuilder {
|
|
|
74
74
|
|
|
75
75
|
abstract getFrontFacing(): string;
|
|
76
76
|
|
|
77
|
+
abstract getFragCoord(): string;
|
|
78
|
+
|
|
79
|
+
isFlipY(): boolean;
|
|
80
|
+
|
|
77
81
|
abstract getTexture(textureProperty: string, uvSnippet: string): string;
|
|
78
82
|
|
|
79
83
|
abstract getTextureLevel(textureProperty: string, uvSnippet: string, levelSnippet: string): string;
|
|
@@ -82,7 +86,7 @@ export default abstract class NodeBuilder {
|
|
|
82
86
|
abstract getCubeTextureLevel(textureProperty: string, uvSnippet: string, levelSnippet: string): string;
|
|
83
87
|
|
|
84
88
|
// @TODO: rename to .generateConst()
|
|
85
|
-
getConst(type: NodeTypeOption, value
|
|
89
|
+
getConst(type: NodeTypeOption, value?: unknown): Node;
|
|
86
90
|
getType(type: NodeTypeOption): NodeTypeOption;
|
|
87
91
|
|
|
88
92
|
generateMethod(method: string): string;
|
|
@@ -105,7 +109,7 @@ export default abstract class NodeBuilder {
|
|
|
105
109
|
getNodeProperties(node: Node, shaderStage?: NodeShaderStageOption): AnyObject;
|
|
106
110
|
getUniformFromNode(node: Node, shaderStage: NodeShaderStageOption, type: NodeTypeOption): NodeUniform;
|
|
107
111
|
getVarFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): NodeVar;
|
|
108
|
-
getVaryFromNode(node: Node, type: NodeTypeOption):
|
|
112
|
+
getVaryFromNode(node: Node, type: NodeTypeOption): NodeVarying;
|
|
109
113
|
getCodeFromNode(node: Node, type: NodeTypeOption, shaderStage?: NodeShaderStageOption): string;
|
|
110
114
|
addFlowCode(code: string): void;
|
|
111
115
|
getFlowData(node: Node, shaderStage: NodeShaderStageOption): FlowData;
|
|
@@ -117,6 +121,7 @@ export default abstract class NodeBuilder {
|
|
|
117
121
|
output?: string | null,
|
|
118
122
|
propertyName?: string,
|
|
119
123
|
): FlowData;
|
|
124
|
+
hasGeometryAttribute(name: string): boolean;
|
|
120
125
|
abstract getAttributes(shaderStage: NodeShaderStageOption): string;
|
|
121
126
|
abstract getVarys(shaderStage: NodeShaderStageOption): string;
|
|
122
127
|
getVars(shaderStage: NodeShaderStageOption): string;
|