@types/three 0.160.0 → 0.161.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/Addons.d.ts +5 -1
- three/examples/jsm/capabilities/WebGPU.d.ts +2 -0
- three/examples/jsm/curves/NURBSUtils.d.ts +136 -10
- three/examples/jsm/curves/NURBSVolume.d.ts +23 -0
- three/examples/jsm/exporters/USDZExporter.d.ts +1 -0
- three/examples/jsm/loaders/GLTFLoader.d.ts +1 -0
- three/examples/jsm/loaders/KTX2Loader.d.ts +44 -4
- three/examples/jsm/loaders/LUT3dlLoader.d.ts +29 -2
- three/examples/jsm/loaders/LUTCubeLoader.d.ts +37 -2
- three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts +13 -0
- three/examples/jsm/nodes/Nodes.d.ts +75 -10
- three/examples/jsm/nodes/accessors/CameraNode.d.ts +17 -6
- three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +8 -2
- three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +1 -1
- three/examples/jsm/nodes/accessors/ModelNode.d.ts +2 -0
- three/examples/jsm/nodes/accessors/Object3DNode.d.ts +10 -6
- three/examples/jsm/nodes/accessors/TextureBicubicNode.d.ts +18 -0
- three/examples/jsm/nodes/accessors/TextureNode.d.ts +11 -3
- three/examples/jsm/nodes/accessors/VertexColorNode.d.ts +12 -0
- three/examples/jsm/nodes/code/FunctionCallNode.d.ts +6 -0
- three/examples/jsm/nodes/core/AssignNode.d.ts +17 -0
- three/examples/jsm/nodes/core/BypassNode.d.ts +6 -0
- three/examples/jsm/nodes/core/CacheNode.d.ts +8 -0
- three/examples/jsm/nodes/core/ContextNode.d.ts +8 -0
- three/examples/jsm/nodes/core/IndexNode.d.ts +18 -0
- three/examples/jsm/nodes/core/LightingModel.d.ts +36 -0
- three/examples/jsm/nodes/core/Node.d.ts +32 -8
- three/examples/jsm/nodes/core/NodeBuilder.d.ts +22 -21
- three/examples/jsm/nodes/core/NodeFrame.d.ts +18 -6
- three/examples/jsm/nodes/core/PropertyNode.d.ts +19 -2
- three/examples/jsm/nodes/core/VarNode.d.ts +8 -2
- three/examples/jsm/nodes/core/VaryingNode.d.ts +6 -0
- three/examples/jsm/nodes/core/constants.d.ts +23 -24
- three/examples/jsm/nodes/display/AfterImageNode.d.ts +25 -0
- three/examples/jsm/nodes/display/AnamorphicNode.d.ts +32 -0
- three/examples/jsm/nodes/display/BlendModeNode.d.ts +14 -4
- three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +11 -0
- three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +15 -2
- three/examples/jsm/nodes/display/GaussianBlurNode.d.ts +28 -0
- three/examples/jsm/nodes/display/NormalMapNode.d.ts +6 -0
- three/examples/jsm/nodes/display/PassNode.d.ts +44 -0
- three/examples/jsm/nodes/display/PosterizeNode.d.ts +6 -0
- three/examples/jsm/nodes/display/ViewportDepthNode.d.ts +32 -0
- three/examples/jsm/nodes/display/ViewportSharedTextureNode.d.ts +18 -0
- three/examples/jsm/nodes/display/ViewportTextureNode.d.ts +33 -0
- three/examples/jsm/nodes/fog/FogExp2Node.d.ts +6 -0
- three/examples/jsm/nodes/fog/FogNode.d.ts +6 -0
- three/examples/jsm/nodes/fog/FogRangeNode.d.ts +6 -0
- three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +9 -2
- three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +3 -2
- three/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.d.ts +7 -0
- three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +3 -2
- three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +3 -2
- three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +3 -2
- three/examples/jsm/nodes/functions/PhongLightingModel.d.ts +7 -0
- three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +17 -8
- three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +6 -0
- three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +20 -13
- three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +1 -2
- three/examples/jsm/nodes/materials/Materials.d.ts +9 -17
- three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +2 -4
- three/examples/jsm/nodes/materials/MeshPhongNodeMaterial.d.ts +12 -0
- three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +3 -7
- three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +17 -0
- three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +1 -2
- three/examples/jsm/nodes/materials/NodeMaterial.d.ts +30 -14
- three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +2 -8
- three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +0 -10
- three/examples/jsm/nodes/math/CondNode.d.ts +6 -0
- three/examples/jsm/nodes/math/HashNode.d.ts +16 -0
- three/examples/jsm/nodes/math/MathNode.d.ts +15 -9
- three/examples/jsm/nodes/math/MathUtils.d.ts +16 -0
- three/examples/jsm/nodes/math/OperatorNode.d.ts +5 -4
- three/examples/jsm/nodes/math/TriNoise3D.d.ts +12 -0
- three/examples/jsm/nodes/procedural/CheckerNode.d.ts +6 -0
- three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +55 -4
- three/examples/jsm/nodes/utils/DiscardNode.d.ts +16 -0
- three/examples/jsm/nodes/utils/ReflectorNode.d.ts +30 -0
- three/examples/jsm/nodes/utils/RemapNode.d.ts +23 -4
- three/examples/jsm/nodes/utils/RotateNode.d.ts +21 -0
- three/examples/jsm/nodes/utils/RotateUVNode.d.ts +6 -0
- three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +6 -0
- three/examples/jsm/objects/GroundedSkybox.d.ts +5 -0
- three/examples/jsm/objects/QuadMesh.d.ts +3 -1
- three/examples/jsm/postprocessing/GTAOPass.d.ts +3 -0
- three/examples/jsm/postprocessing/SSAOPass.d.ts +1 -1
- three/examples/jsm/renderers/common/Backend.d.ts +6 -2
- three/examples/jsm/renderers/common/Color4.d.ts +9 -0
- three/examples/jsm/renderers/common/Info.d.ts +7 -1
- three/examples/jsm/renderers/common/PostProcessing.d.ts +11 -0
- three/examples/jsm/renderers/common/Renderer.d.ts +243 -4
- three/examples/jsm/renderers/common/StorageTexture.d.ts +5 -0
- three/examples/jsm/renderers/webgl/WebGLBackend.d.ts +4 -2
- three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +2 -2
- three/examples/jsm/renderers/webgpu/WebGPUBackend.d.ts +15 -6
- three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +7 -7
- three/examples/jsm/utils/BufferGeometryUtils.d.ts +0 -10
- three/examples/jsm/webxr/XRControllerModelFactory.d.ts +6 -5
- three/examples/jsm/webxr/XRHandMeshModel.d.ts +10 -2
- three/package.json +2 -2
- three/src/cameras/PerspectiveCamera.d.ts +13 -0
- three/src/constants.d.ts +1 -2
- three/src/core/InterleavedBufferAttribute.d.ts +12 -2
- three/src/core/Object3D.d.ts +13 -13
- three/src/extras/core/Curve.d.ts +9 -9
- three/src/extras/core/CurvePath.d.ts +8 -7
- three/src/geometries/RingGeometry.d.ts +1 -1
- three/src/materials/Material.d.ts +3 -1
- three/src/materials/ShaderMaterial.d.ts +9 -1
- three/src/math/Color.d.ts +1 -1
- three/src/math/Quaternion.d.ts +27 -30
- three/src/math/Triangle.d.ts +0 -17
- three/src/math/Vector2.d.ts +24 -159
- three/src/math/Vector3.d.ts +46 -54
- three/src/math/Vector4.d.ts +25 -20
- three/src/objects/BatchedMesh.d.ts +2 -2
- three/src/objects/Bone.d.ts +2 -2
- three/src/objects/InstancedMesh.d.ts +2 -1
- three/src/objects/LOD.d.ts +2 -2
- three/src/objects/Line.d.ts +3 -2
- three/src/objects/LineLoop.d.ts +3 -1
- three/src/objects/LineSegments.d.ts +3 -1
- three/src/objects/Points.d.ts +3 -2
- three/src/objects/SkinnedMesh.d.ts +3 -6
- three/src/objects/Sprite.d.ts +2 -2
- three/src/renderers/webgl/WebGLProgram.d.ts +0 -1
- three/src/renderers/webgl/WebGLPrograms.d.ts +3 -1
- three/src/renderers/webxr/WebXRDepthSensing.d.ts +27 -0
- three/src/renderers/webxr/WebXRManager.d.ts +2 -1
- three/src/textures/DataArrayTexture.d.ts +1 -1
- three/src/textures/Source.d.ts +11 -1
- three/build/three.d.ts +0 -2
- three/build/three.min.d.ts +0 -2
- three/examples/jsm/objects/GroundProjectedSkybox.d.ts +0 -13
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: Wed, 31 Jan 2024 17:07:12 GMT
|
|
12
12
|
* Dependencies: [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer)
|
|
13
13
|
|
|
14
14
|
# Credits
|
three/examples/jsm/Addons.d.ts
CHANGED
|
@@ -25,6 +25,7 @@ export * from './csm/CSMShader.js';
|
|
|
25
25
|
export * as Curves from './curves/CurveExtras.js';
|
|
26
26
|
export * from './curves/NURBSCurve.js';
|
|
27
27
|
export * from './curves/NURBSSurface.js';
|
|
28
|
+
export * from './curves/NURBSVolume.js';
|
|
28
29
|
export * as NURBSUtils from './curves/NURBSUtils.js';
|
|
29
30
|
|
|
30
31
|
export * from './effects/AnaglyphEffect.js';
|
|
@@ -151,6 +152,7 @@ export * from './misc/MorphAnimMesh.js';
|
|
|
151
152
|
export * from './misc/MorphBlendMesh.js';
|
|
152
153
|
export * from './misc/ProgressiveLightMap.js';
|
|
153
154
|
export * from './misc/RollerCoaster.js';
|
|
155
|
+
export * from './misc/Timer.js';
|
|
154
156
|
export * from './misc/TubePainter.js';
|
|
155
157
|
export * from './misc/Volume.js';
|
|
156
158
|
export * from './misc/VolumeSlice.js';
|
|
@@ -160,7 +162,7 @@ export * from './modifiers/EdgeSplitModifier.js';
|
|
|
160
162
|
export * from './modifiers/SimplifyModifier.js';
|
|
161
163
|
export * from './modifiers/TessellateModifier.js';
|
|
162
164
|
|
|
163
|
-
export * from './objects/
|
|
165
|
+
export * from './objects/GroundedSkybox.js';
|
|
164
166
|
export * from './objects/Lensflare.js';
|
|
165
167
|
export * from './objects/MarchingCubes.js';
|
|
166
168
|
export * from './objects/Reflector.js';
|
|
@@ -183,6 +185,7 @@ export * from './postprocessing/DotScreenPass.js';
|
|
|
183
185
|
export * from './postprocessing/EffectComposer.js';
|
|
184
186
|
export * from './postprocessing/FilmPass.js';
|
|
185
187
|
export * from './postprocessing/GlitchPass.js';
|
|
188
|
+
export * from './postprocessing/GTAOPass.js';
|
|
186
189
|
export * from './postprocessing/HalftonePass.js';
|
|
187
190
|
export * from './postprocessing/LUTPass.js';
|
|
188
191
|
export * from './postprocessing/MaskPass.js';
|
|
@@ -230,6 +233,7 @@ export * from './shaders/FocusShader.js';
|
|
|
230
233
|
export * from './shaders/FreiChenShader.js';
|
|
231
234
|
export * from './shaders/GammaCorrectionShader.js';
|
|
232
235
|
export * from './shaders/GodRaysShader.js';
|
|
236
|
+
export * from './shaders/GTAOShader.js';
|
|
233
237
|
export * from './shaders/HalftoneShader.js';
|
|
234
238
|
export * from './shaders/HorizontalBlurShader.js';
|
|
235
239
|
export * from './shaders/HorizontalTiltShiftShader.js';
|
|
@@ -1,20 +1,146 @@
|
|
|
1
1
|
import { Vector3, Vector4 } from '../../../src/Three.js';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Finds knot vector span.
|
|
5
|
+
* @param p degree
|
|
6
|
+
* @param u parametric value
|
|
7
|
+
* @param U knot vector
|
|
8
|
+
* @returns the span
|
|
9
|
+
*/
|
|
10
|
+
export function findSpan(p: number, u: number, U: readonly number[]): number;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Calculate basis functions. See The NURBS Book, page 70, algorithm A2.2
|
|
14
|
+
* @param span span in which u lies
|
|
15
|
+
* @param u parametric point
|
|
16
|
+
* @param p degrees
|
|
17
|
+
* @param U knot vector
|
|
18
|
+
* @returns array[p+1] with basis function values
|
|
19
|
+
*/
|
|
20
|
+
export function calcBasisFunctions(span: number, u: number, p: number, U: readonly number[]): number[];
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Calculate B-Spline curve points. See The NURBS Book, page 82, algorithm A3.1.
|
|
24
|
+
* @param p degree of B-Spline
|
|
25
|
+
* @param U knot vector
|
|
26
|
+
* @param P control points (x, y, z, w)
|
|
27
|
+
* @param u parametric point
|
|
28
|
+
* @returns point for given u
|
|
29
|
+
*/
|
|
30
|
+
export function calcBSplinePoint(p: number, U: readonly number[], P: readonly Vector4[], u: number): Vector4;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Calculate basis functions derivatives. See The NURBS Book, page 72, algorithm A2.3.
|
|
34
|
+
* @param span span in which u lies
|
|
35
|
+
* @param u parametric point
|
|
36
|
+
* @param p degree
|
|
37
|
+
* @param n number of derivatives to calculate
|
|
38
|
+
* @param U knot vector
|
|
39
|
+
* @returns array[n+1][p+1] with basis functions derivatives
|
|
40
|
+
*/
|
|
41
|
+
export function calcBasisFunctionDerivatives(
|
|
42
|
+
span: number,
|
|
43
|
+
u: number,
|
|
44
|
+
p: number,
|
|
45
|
+
n: number,
|
|
46
|
+
U: readonly number[],
|
|
47
|
+
): number[][];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Calculate derivatives of a B-Spline. See The NURBS Book, page 93, algorithm A3.2.
|
|
51
|
+
* @param p degree
|
|
52
|
+
* @param U knot vector
|
|
53
|
+
* @param P control points
|
|
54
|
+
* @param u Parametric points
|
|
55
|
+
* @param nd number of derivatives
|
|
56
|
+
* @returns array[d+1] with derivatives
|
|
57
|
+
*/
|
|
58
|
+
export function calcBSplineDerivatives(
|
|
59
|
+
p: number,
|
|
60
|
+
U: readonly number[],
|
|
61
|
+
P: readonly Vector4[],
|
|
62
|
+
u: number,
|
|
63
|
+
nd: number,
|
|
64
|
+
): Vector4[];
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Calculate "K over I"
|
|
68
|
+
* @returns k!/(i!(k-i)!
|
|
69
|
+
*/
|
|
8
70
|
export function calcKoverI(k: number, i: number): number;
|
|
9
|
-
|
|
10
|
-
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Calculate derivatives (0-nd) of rational curve. See The NURBS Book, page 127, algorithm A4.2.
|
|
74
|
+
* @param Pders result of function calcBSplineDerivatives
|
|
75
|
+
* @returns array with derivatives for rational curve.
|
|
76
|
+
*/
|
|
77
|
+
export function calcRationalCurveDerivatives(Pders: readonly Vector4[]): Vector3[];
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Calculate NURBS curve derivatives. See The NURBS Book, page 127, algorithm A4.2.
|
|
81
|
+
* @param p degree
|
|
82
|
+
* @param U knot vector
|
|
83
|
+
* @param P control points in homogeneous space
|
|
84
|
+
* @param u parametric points
|
|
85
|
+
* @param nd number of derivatives
|
|
86
|
+
* @returns array with derivatives
|
|
87
|
+
*/
|
|
88
|
+
export function calcNURBSDerivatives(
|
|
89
|
+
p: number,
|
|
90
|
+
U: readonly number[],
|
|
91
|
+
P: readonly Vector4[],
|
|
92
|
+
u: number,
|
|
93
|
+
nd: number,
|
|
94
|
+
): Vector3[];
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Calculate rational B-Spline surface point. See The NURBS Book, page 134, algorithm A4.3.
|
|
98
|
+
* @param p degree of B-Spline surface
|
|
99
|
+
* @param q degree of B-Spline surface
|
|
100
|
+
* @param U knot vector
|
|
101
|
+
* @param V knot vector
|
|
102
|
+
* @param P control points (x, y, z, w)
|
|
103
|
+
* @param u parametric value
|
|
104
|
+
* @param v parametric value
|
|
105
|
+
* @param target
|
|
106
|
+
* @returns point for given (u, v)
|
|
107
|
+
*/
|
|
11
108
|
export function calcSurfacePoint(
|
|
12
109
|
p: number,
|
|
13
110
|
q: number,
|
|
14
|
-
U: number[],
|
|
15
|
-
V: number[],
|
|
16
|
-
P: Vector4[],
|
|
111
|
+
U: readonly number[],
|
|
112
|
+
V: readonly number[],
|
|
113
|
+
P: readonly (readonly Vector4[])[],
|
|
114
|
+
u: number,
|
|
115
|
+
v: number,
|
|
116
|
+
target: Vector3,
|
|
117
|
+
): Vector3;
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Calculate rational B-Spline volume point. See The NURBS Book, page 134, algorithm A4.3.
|
|
121
|
+
* @param p degree of B-Spline volume
|
|
122
|
+
* @param q degree of B-Spline volume
|
|
123
|
+
* @param r degree of B-Spline volume
|
|
124
|
+
* @param U knot vector
|
|
125
|
+
* @param V knot vector
|
|
126
|
+
* @param W knot vector
|
|
127
|
+
* @param P control points (x, y, z, w)
|
|
128
|
+
* @param u parametric value
|
|
129
|
+
* @param v parametric value
|
|
130
|
+
* @param w parametric value
|
|
131
|
+
* @param target
|
|
132
|
+
* @returns point for given (u, v, w)
|
|
133
|
+
*/
|
|
134
|
+
export function calcVolumePoint(
|
|
135
|
+
p: number,
|
|
136
|
+
q: number,
|
|
137
|
+
r: number,
|
|
138
|
+
U: readonly number[],
|
|
139
|
+
V: readonly number[],
|
|
140
|
+
W: readonly number[],
|
|
141
|
+
P: readonly (readonly (readonly Vector4[])[])[],
|
|
17
142
|
u: number,
|
|
18
143
|
v: number,
|
|
144
|
+
w: number,
|
|
19
145
|
target: Vector3,
|
|
20
146
|
): Vector3;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Vector3, Vector4 } from '../../../src/Three.js';
|
|
2
|
+
|
|
3
|
+
export class NURBSVolume {
|
|
4
|
+
degree1: number;
|
|
5
|
+
degree2: number;
|
|
6
|
+
degree3: number;
|
|
7
|
+
knots1: readonly number[];
|
|
8
|
+
knots2: readonly number[];
|
|
9
|
+
knots3: readonly number[];
|
|
10
|
+
controlPoints: Vector4[][][];
|
|
11
|
+
|
|
12
|
+
constructor(
|
|
13
|
+
degree1: number,
|
|
14
|
+
degree2: number,
|
|
15
|
+
degree3: number,
|
|
16
|
+
knots1: readonly number[],
|
|
17
|
+
knots2: readonly number[],
|
|
18
|
+
knots3: readonly number[],
|
|
19
|
+
controlPoints: Vector4[][][],
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
getPoint(t1: number, t2: number, t3: number, target: Vector3): void;
|
|
23
|
+
}
|
|
@@ -131,6 +131,7 @@ export class GLTFParser {
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
export interface GLTFLoaderPlugin {
|
|
134
|
+
readonly name: string;
|
|
134
135
|
beforeRoot?: (() => Promise<void> | null) | undefined;
|
|
135
136
|
afterRoot?: ((result: GLTF) => Promise<void> | null) | undefined;
|
|
136
137
|
loadNode?: ((nodeIndex: number) => Promise<Object3D> | null) | undefined;
|
|
@@ -1,11 +1,51 @@
|
|
|
1
1
|
import { LoadingManager, Loader, CompressedTexture, WebGLRenderer } from '../../../src/Three.js';
|
|
2
2
|
import WebGPURenderer from '../renderers/webgpu/WebGPURenderer.js';
|
|
3
|
+
import Renderer from '../renderers/common/Renderer.js';
|
|
4
|
+
import { WorkerPool } from '../utils/WorkerPool.js';
|
|
5
|
+
|
|
6
|
+
export interface KTX2LoaderWorkerConfig {
|
|
7
|
+
astcSupported: boolean;
|
|
8
|
+
etc1Supported: boolean;
|
|
9
|
+
etc2Supported: boolean;
|
|
10
|
+
dxtSupported: boolean;
|
|
11
|
+
bptcSupported: boolean;
|
|
12
|
+
pvrtcSupported: boolean;
|
|
13
|
+
}
|
|
3
14
|
|
|
4
15
|
export class KTX2Loader extends Loader<CompressedTexture> {
|
|
16
|
+
transcoderPath: string;
|
|
17
|
+
transcoderBinary: ArrayBuffer | null;
|
|
18
|
+
transcoderPending: Promise<void> | null;
|
|
19
|
+
|
|
20
|
+
workerPool: WorkerPool;
|
|
21
|
+
workerSourceURL: string;
|
|
22
|
+
workerConfig: KTX2LoaderWorkerConfig;
|
|
23
|
+
|
|
5
24
|
constructor(manager?: LoadingManager);
|
|
6
25
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
26
|
+
/**
|
|
27
|
+
* The WASM transcoder and JS wrapper are available from the examples/jsm/libs/basis directory.
|
|
28
|
+
* @param path Path to folder containing the WASM transcoder and JS wrapper.
|
|
29
|
+
*/
|
|
30
|
+
setTranscoderPath(path: string): this;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Sets the maximum number of web workers to be allocated by this instance.
|
|
34
|
+
* @param limit Maximum number of workers. Default is '4'.
|
|
35
|
+
*/
|
|
36
|
+
setWorkerLimit(limit: number): this;
|
|
37
|
+
|
|
38
|
+
detectSupportAsync(renderer: Renderer): Promise<this>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Detects hardware support for available compressed texture formats, to determine the output format for the
|
|
42
|
+
* transcoder. Must be called before loading a texture.
|
|
43
|
+
* @param renderer A renderer instance.
|
|
44
|
+
*/
|
|
45
|
+
detectSupport(renderer: WebGLRenderer | WebGPURenderer): this;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Disposes the loader object, de-allocating any Web Workers created.
|
|
49
|
+
*/
|
|
50
|
+
dispose(): this;
|
|
11
51
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Loader, LoadingManager, DataTexture, Data3DTexture } from '../../../src/Three.js';
|
|
1
|
+
import { Loader, LoadingManager, DataTexture, Data3DTexture, UnsignedByteType, FloatType } from '../../../src/Three.js';
|
|
2
2
|
|
|
3
3
|
export interface LUT3dlResult {
|
|
4
4
|
size: number;
|
|
@@ -6,8 +6,35 @@ export interface LUT3dlResult {
|
|
|
6
6
|
texture3D: Data3DTexture;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* A 3D LUT loader that supports the .3dl file format.
|
|
11
|
+
*
|
|
12
|
+
* Based on the following references:
|
|
13
|
+
*
|
|
14
|
+
* http://download.autodesk.com/us/systemdocs/help/2011/lustre/index.html?url=./files/WSc4e151a45a3b785a24c3d9a411df9298473-7ffd.htm,topicNumber=d0e9492
|
|
15
|
+
* https://community.foundry.com/discuss/topic/103636/format-spec-for-3dl?mode=Post&postID=895258
|
|
16
|
+
*/
|
|
9
17
|
export class LUT3dlLoader extends Loader<LUT3dlResult> {
|
|
18
|
+
type: typeof UnsignedByteType | typeof FloatType;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Creates a new {@link LUT3dlLoader}.
|
|
22
|
+
* @param manager The LoadingManager to use. Defaults to {@link DefaultLoadingManager}
|
|
23
|
+
*/
|
|
10
24
|
constructor(manager?: LoadingManager);
|
|
11
25
|
|
|
12
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Sets the desired texture type. Only {@link THREE.UnsignedByteType} and {@link THREE.FloatType} are supported. The
|
|
28
|
+
* default is {@link THREE.UnsignedByteType}.
|
|
29
|
+
* @param type The texture type. See the Textures texture constants page for details.
|
|
30
|
+
*/
|
|
31
|
+
setType(type: typeof UnsignedByteType | typeof FloatType): this;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Parse a 3dl data string and fire {@link onLoad} callback when complete. The argument to {@link onLoad} will be an
|
|
35
|
+
* object containing the following LUT data: {@link LUT3dlResult.size}, {@link LUT3dlResult.texture} and
|
|
36
|
+
* {@link LUT3dlResult.texture3D}.
|
|
37
|
+
* @param input The 3dl data string.
|
|
38
|
+
*/
|
|
39
|
+
parse(input: string): LUT3dlResult;
|
|
13
40
|
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Loader,
|
|
3
|
+
LoadingManager,
|
|
4
|
+
Vector3,
|
|
5
|
+
DataTexture,
|
|
6
|
+
Data3DTexture,
|
|
7
|
+
UnsignedByteType,
|
|
8
|
+
FloatType,
|
|
9
|
+
} from '../../../src/Three.js';
|
|
2
10
|
|
|
3
11
|
export interface LUTCubeResult {
|
|
4
12
|
title: string;
|
|
@@ -9,8 +17,35 @@ export interface LUTCubeResult {
|
|
|
9
17
|
texture3D: Data3DTexture;
|
|
10
18
|
}
|
|
11
19
|
|
|
20
|
+
/**
|
|
21
|
+
* A 3D LUT loader that supports the .cube file format.
|
|
22
|
+
*
|
|
23
|
+
* Based on the following reference:
|
|
24
|
+
*
|
|
25
|
+
* https://wwwimages2.adobe.com/content/dam/acom/en/products/speedgrade/cc/pdfs/cube-lut-specification-1.0.pdf
|
|
26
|
+
*/
|
|
12
27
|
export class LUTCubeLoader extends Loader<LUTCubeResult> {
|
|
28
|
+
type: typeof UnsignedByteType | typeof FloatType;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Creates a new {@link LUTCubeLoader}.
|
|
32
|
+
* @param manager The LoadingManager to use. Defaults to {@link DefaultLoadingManager}
|
|
33
|
+
*/
|
|
13
34
|
constructor(manager?: LoadingManager);
|
|
14
35
|
|
|
15
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Sets the desired texture type. Only {@link THREE.UnsignedByteType} and {@link THREE.FloatType} are supported. The
|
|
38
|
+
* default is {@link THREE.UnsignedByteType}.
|
|
39
|
+
* @param type The texture type. See the Textures texture constants page for details.
|
|
40
|
+
*/
|
|
41
|
+
setType(type: typeof UnsignedByteType | typeof FloatType): this;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Parse a cube data string and fire {@link onLoad} callback when complete. The argument to {@link onLoad} will be
|
|
45
|
+
* an object containing the following LUT data: {@link LUTCubeResult.title}, {@link LUTCubeResult.size},
|
|
46
|
+
* {@link LUTCubeResult.domainMin}, {@link LUTCubeResult.domainMax}, {@link LUTCubeResult.texture} and
|
|
47
|
+
* {@link LUTCubeResult.texture3D}.
|
|
48
|
+
* @param input The cube data string.
|
|
49
|
+
*/
|
|
50
|
+
parse(input: string): LUTCubeResult;
|
|
16
51
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MeshPhysicalMaterial, MeshPhysicalMaterialParameters, Texture } from '../../../src/Three.js';
|
|
2
|
+
|
|
3
|
+
export interface MeshPostProcessingMaterialParameters extends MeshPhysicalMaterialParameters {
|
|
4
|
+
aoPassMap?: Texture | null | undefined;
|
|
5
|
+
aoPassMapScale?: number | undefined;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export class MeshPostProcessingMaterial extends MeshPhysicalMaterial {
|
|
9
|
+
constructor(parameters: MeshPostProcessingMaterialParameters);
|
|
10
|
+
|
|
11
|
+
get aoPassMap(): Texture | null | undefined;
|
|
12
|
+
set aoPassMap(aoPassMap: Texture | null | undefined);
|
|
13
|
+
}
|
|
@@ -3,11 +3,19 @@ export * from './core/constants.js';
|
|
|
3
3
|
|
|
4
4
|
// core
|
|
5
5
|
export { default as ArrayUniformNode } from './core/ArrayUniformNode.js';
|
|
6
|
+
export { default as AssignNode, assign } from './core/AssignNode.js';
|
|
6
7
|
export { default as AttributeNode, attribute } from './core/AttributeNode.js';
|
|
7
8
|
export { default as BypassNode, bypass } from './core/BypassNode.js';
|
|
8
9
|
export { default as CacheNode, cache } from './core/CacheNode.js';
|
|
9
10
|
export { default as ConstNode } from './core/ConstNode.js';
|
|
10
|
-
export { default as ContextNode, context } from './core/ContextNode.js';
|
|
11
|
+
export { default as ContextNode, context, label } from './core/ContextNode.js';
|
|
12
|
+
export { default as IndexNode, vertexIndex, instanceIndex, IndexNodeScope } from './core/IndexNode.js';
|
|
13
|
+
export {
|
|
14
|
+
default as LightingModel,
|
|
15
|
+
LightingModelReflectedLight,
|
|
16
|
+
LightingModelDirectInput,
|
|
17
|
+
LightingModelIndirectInput,
|
|
18
|
+
} from './core/LightingModel.js';
|
|
11
19
|
export { default as Node } from './core/Node.js';
|
|
12
20
|
export { default as NodeAttribute } from './core/NodeAttribute.js';
|
|
13
21
|
export { default as NodeBuilder } from './core/NodeBuilder.js';
|
|
@@ -22,16 +30,28 @@ export { default as NodeVarying } from './core/NodeVarying.js';
|
|
|
22
30
|
export {
|
|
23
31
|
default as PropertyNode,
|
|
24
32
|
property,
|
|
33
|
+
varyingProperty,
|
|
34
|
+
output,
|
|
25
35
|
diffuseColor,
|
|
26
36
|
roughness,
|
|
27
37
|
metalness,
|
|
38
|
+
clearcoat,
|
|
39
|
+
clearcoatRoughness,
|
|
40
|
+
sheen,
|
|
41
|
+
sheenRoughness,
|
|
42
|
+
iridescence,
|
|
43
|
+
iridescenceIOR,
|
|
44
|
+
iridescenceThickness,
|
|
28
45
|
specularColor,
|
|
29
46
|
shininess,
|
|
47
|
+
dashSize,
|
|
48
|
+
gapSize,
|
|
49
|
+
pointWidth,
|
|
30
50
|
} from './core/PropertyNode.js';
|
|
31
51
|
export { default as StackNode } from './core/StackNode.js';
|
|
32
52
|
export { default as TempNode } from './core/TempNode.js';
|
|
33
53
|
export { default as UniformNode, uniform } from './core/UniformNode.js';
|
|
34
|
-
export { default as VarNode,
|
|
54
|
+
export { default as VarNode, temp } from './core/VarNode.js';
|
|
35
55
|
export { default as VaryingNode, varying } from './core/VaryingNode.js';
|
|
36
56
|
|
|
37
57
|
import * as NodeUtils from './core/NodeUtils.js';
|
|
@@ -40,6 +60,8 @@ export { NodeUtils };
|
|
|
40
60
|
// math
|
|
41
61
|
export {
|
|
42
62
|
default as MathNode,
|
|
63
|
+
PI,
|
|
64
|
+
PI2,
|
|
43
65
|
EPSILON,
|
|
44
66
|
INFINITY,
|
|
45
67
|
radians,
|
|
@@ -63,6 +85,7 @@ export {
|
|
|
63
85
|
abs,
|
|
64
86
|
sign,
|
|
65
87
|
length,
|
|
88
|
+
lengthSq,
|
|
66
89
|
negate,
|
|
67
90
|
oneMinus,
|
|
68
91
|
dFdx,
|
|
@@ -93,14 +116,13 @@ export {
|
|
|
93
116
|
refract,
|
|
94
117
|
smoothstep,
|
|
95
118
|
faceForward,
|
|
119
|
+
cbrt,
|
|
96
120
|
MathNodeMethod1,
|
|
97
121
|
MathNodeMethod2,
|
|
98
122
|
MathNodeMethod3,
|
|
99
123
|
MathNodeMethod,
|
|
100
|
-
Unary,
|
|
101
|
-
Binary,
|
|
102
|
-
Ternary,
|
|
103
124
|
} from './math/MathNode.js';
|
|
125
|
+
|
|
104
126
|
export {
|
|
105
127
|
default as OperatorNode,
|
|
106
128
|
add,
|
|
@@ -109,27 +131,33 @@ export {
|
|
|
109
131
|
div,
|
|
110
132
|
remainder,
|
|
111
133
|
equal,
|
|
112
|
-
assign,
|
|
113
134
|
lessThan,
|
|
114
135
|
greaterThan,
|
|
115
136
|
lessThanEqual,
|
|
116
137
|
greaterThanEqual,
|
|
117
138
|
and,
|
|
118
139
|
or,
|
|
140
|
+
not,
|
|
119
141
|
xor,
|
|
120
142
|
bitAnd,
|
|
143
|
+
bitNot,
|
|
121
144
|
bitOr,
|
|
122
145
|
bitXor,
|
|
123
146
|
shiftLeft,
|
|
124
147
|
shiftRight,
|
|
125
148
|
OperatorNodeOp,
|
|
126
|
-
Operator,
|
|
127
149
|
} from './math/OperatorNode.js';
|
|
128
150
|
export { default as CondNode, cond } from './math/CondNode.js';
|
|
151
|
+
export { default as HashNode, hash } from './math/HashNode.js';
|
|
152
|
+
|
|
153
|
+
// math utils
|
|
154
|
+
export { parabola, gain, pcurve, sinc } from './math/MathUtils.js';
|
|
155
|
+
export { triNoise3D } from './math/TriNoise3D.js';
|
|
129
156
|
|
|
130
157
|
// utils
|
|
131
158
|
export { default as ArrayElementNode } from './utils/ArrayElementNode.js';
|
|
132
159
|
export { default as ConvertNode } from './utils/ConvertNode.js';
|
|
160
|
+
export { default as DiscardNode, discard } from './utils/DiscardNode.js';
|
|
133
161
|
export { default as EquirectUVNode, equirectUV } from './utils/EquirectUVNode.js';
|
|
134
162
|
export { default as JoinNode } from './utils/JoinNode.js';
|
|
135
163
|
export { default as MatcapUVNode, matcapUV } from './utils/MatcapUVNode.js';
|
|
@@ -137,6 +165,7 @@ export { default as MaxMipLevelNode, maxMipLevel } from './utils/MaxMipLevelNode
|
|
|
137
165
|
export { default as OscNode, oscSine, oscSquare, oscTriangle, oscSawtooth, OscNodeMethod } from './utils/OscNode.js';
|
|
138
166
|
export { default as RemapNode, remap, remapClamp } from './utils/RemapNode.js';
|
|
139
167
|
export { default as RotateUVNode, rotateUV } from './utils/RotateUVNode.js';
|
|
168
|
+
export { default as RotateNode, rotate } from './utils/RotateNode.js';
|
|
140
169
|
export { default as SpecularMIPLevelNode, specularMIPLevel } from './utils/SpecularMIPLevelNode.js';
|
|
141
170
|
export { default as SplitNode } from './utils/SplitNode.js';
|
|
142
171
|
export { default as SpriteSheetUVNode, spritesheetUV } from './utils/SpriteSheetUVNode.js';
|
|
@@ -153,6 +182,7 @@ export {
|
|
|
153
182
|
triplanarTextures,
|
|
154
183
|
triplanarTexture,
|
|
155
184
|
} from './utils/TriplanarTexturesNode.js';
|
|
185
|
+
export { default as ReflectorNode, reflector, ReflectorNodeParameters } from './utils/ReflectorNode.js';
|
|
156
186
|
|
|
157
187
|
// shader node
|
|
158
188
|
export * from './shadernode/ShaderNode.js';
|
|
@@ -172,12 +202,17 @@ export { default as BufferNode, buffer } from './accessors/BufferNode.js';
|
|
|
172
202
|
export {
|
|
173
203
|
default as CameraNode,
|
|
174
204
|
cameraProjectionMatrix,
|
|
205
|
+
cameraProjectionMatrixInverse,
|
|
175
206
|
cameraViewMatrix,
|
|
176
207
|
cameraNormalMatrix,
|
|
177
208
|
cameraWorldMatrix,
|
|
178
209
|
cameraPosition,
|
|
210
|
+
cameraNear,
|
|
211
|
+
cameraFar,
|
|
212
|
+
cameraLogDepth,
|
|
179
213
|
CameraNodeScope,
|
|
180
214
|
} from './accessors/CameraNode.js';
|
|
215
|
+
export { default as VertexColorNode, vertexColor } from './accessors/VertexColorNode.js';
|
|
181
216
|
export { default as CubeTextureNode, cubeTexture } from './accessors/CubeTextureNode.js';
|
|
182
217
|
export { default as InstanceNode, instance } from './accessors/InstanceNode.js';
|
|
183
218
|
export {
|
|
@@ -195,13 +230,16 @@ export {
|
|
|
195
230
|
MaterialNodeScope,
|
|
196
231
|
} from './accessors/MaterialNode.js';
|
|
197
232
|
export { default as MaterialReferenceNode, materialReference } from './accessors/MaterialReferenceNode.js';
|
|
233
|
+
export { default as TextureBicubicNode, textureBicubic } from './accessors/TextureBicubicNode.js';
|
|
198
234
|
export {
|
|
199
235
|
default as ModelNode,
|
|
236
|
+
modelDirection,
|
|
200
237
|
modelViewMatrix,
|
|
201
238
|
modelNormalMatrix,
|
|
202
239
|
modelWorldMatrix,
|
|
203
240
|
modelPosition,
|
|
204
241
|
modelViewPosition,
|
|
242
|
+
modelScale,
|
|
205
243
|
} from './accessors/ModelNode.js';
|
|
206
244
|
export { default as ModelViewProjectionNode, modelViewProjection } from './accessors/ModelViewProjectionNode.js';
|
|
207
245
|
export {
|
|
@@ -252,9 +290,17 @@ export {
|
|
|
252
290
|
hue,
|
|
253
291
|
lumaCoeffs,
|
|
254
292
|
luminance,
|
|
293
|
+
threshold,
|
|
255
294
|
ColorAdjustmentMethod,
|
|
256
295
|
} from './display/ColorAdjustmentNode.js';
|
|
257
|
-
export {
|
|
296
|
+
export {
|
|
297
|
+
default as ColorSpaceNode,
|
|
298
|
+
linearToColorSpace,
|
|
299
|
+
colorSpaceToLinear,
|
|
300
|
+
linearTosRGB,
|
|
301
|
+
sRGBToLinear,
|
|
302
|
+
ColorSpaceNodeMethod,
|
|
303
|
+
} from './display/ColorSpaceNode.js';
|
|
258
304
|
export { default as FrontFacingNode, frontFacing, faceDirection } from './display/FrontFacingNode.js';
|
|
259
305
|
export { default as NormalMapNode, normalMap, TBNViewMatrix } from './display/NormalMapNode.js';
|
|
260
306
|
export { default as PosterizeNode, posterize } from './display/PosterizeNode.js';
|
|
@@ -268,6 +314,24 @@ export {
|
|
|
268
314
|
viewportTopRight,
|
|
269
315
|
viewportBottomRight,
|
|
270
316
|
} from './display/ViewportNode.js';
|
|
317
|
+
export { default as ViewportTextureNode, viewportTexture, viewportMipTexture } from './display/ViewportTextureNode.js';
|
|
318
|
+
export { default as ViewportSharedTextureNode, viewportSharedTexture } from './display/ViewportSharedTextureNode.js';
|
|
319
|
+
export {
|
|
320
|
+
default as ViewportDepthNode,
|
|
321
|
+
viewZToOrthographicDepth,
|
|
322
|
+
orthographicDepthToViewZ,
|
|
323
|
+
viewZToPerspectiveDepth,
|
|
324
|
+
perspectiveDepthToViewZ,
|
|
325
|
+
depth,
|
|
326
|
+
depthTexture,
|
|
327
|
+
depthPixel,
|
|
328
|
+
ViewportDepthNodeScope,
|
|
329
|
+
} from './display/ViewportDepthNode.js';
|
|
330
|
+
export { default as GaussianBlurNode, gaussianBlur } from './display/GaussianBlurNode.js';
|
|
331
|
+
export { default as AfterImageNode, afterImage } from './display/AfterImageNode.js';
|
|
332
|
+
export { default as AnamorphicNode, anamorphic } from './display/AnamorphicNode.js';
|
|
333
|
+
|
|
334
|
+
export { default as PassNode, pass, depthPass, PassNodeScope } from './display/PassNode.js';
|
|
271
335
|
|
|
272
336
|
// code
|
|
273
337
|
export { default as ExpressionNode, expression } from './code/ExpressionNode.js';
|
|
@@ -291,7 +355,7 @@ export { default as PointLightNode } from './lighting/PointLightNode.js';
|
|
|
291
355
|
export { default as SpotLightNode } from './lighting/SpotLightNode.js';
|
|
292
356
|
export { default as LightsNode, lights } from './lighting/LightsNode.js';
|
|
293
357
|
export { default as LightingNode } from './lighting/LightingNode.js';
|
|
294
|
-
export { default as LightingContextNode, lightingContext
|
|
358
|
+
export { default as LightingContextNode, lightingContext } from './lighting/LightingContextNode.js';
|
|
295
359
|
export { default as HemisphereLightNode } from './lighting/HemisphereLightNode.js';
|
|
296
360
|
export { default as EnvironmentNode } from './lighting/EnvironmentNode.js';
|
|
297
361
|
export { default as AONode } from './lighting/AONode.js';
|
|
@@ -324,4 +388,5 @@ export { getDistanceAttenuation } from './lighting/LightUtils.js';
|
|
|
324
388
|
export { default as getGeometryRoughness } from './functions/material/getGeometryRoughness.js';
|
|
325
389
|
export { default as getRoughness } from './functions/material/getRoughness.js';
|
|
326
390
|
|
|
327
|
-
export { default as
|
|
391
|
+
export { default as PhongLightingModel } from './functions/PhongLightingModel.js';
|
|
392
|
+
export { default as PhysicalLightingModel } from './functions/PhysicalLightingModel.js';
|