@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
|
@@ -1,42 +1,281 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Camera,
|
|
3
|
+
ColorSpace,
|
|
4
|
+
CoordinateSystem,
|
|
5
|
+
Scene,
|
|
6
|
+
ToneMapping,
|
|
7
|
+
Vector2,
|
|
8
|
+
Vector4,
|
|
9
|
+
Color,
|
|
10
|
+
Object3D,
|
|
11
|
+
RenderTarget,
|
|
12
|
+
FramebufferTexture,
|
|
13
|
+
BufferGeometry,
|
|
14
|
+
Material,
|
|
15
|
+
Group,
|
|
16
|
+
} from '../../../../src/Three.js';
|
|
2
17
|
import Backend from './Backend.js';
|
|
3
18
|
import Info from './Info.js';
|
|
19
|
+
import Color4 from './../common/Color4.js';
|
|
20
|
+
import ComputeNode from '../../nodes/gpgpu/ComputeNode.js';
|
|
21
|
+
import LightsNode from '../../nodes/lighting/LightsNode.js';
|
|
4
22
|
|
|
23
|
+
export interface RendererParameters {
|
|
24
|
+
logarithmicDepthBuffer?: boolean | undefined;
|
|
25
|
+
alpha?: boolean | undefined;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Generic Renderer interface containing either a WebGL or WebGPU backend.
|
|
30
|
+
*/
|
|
5
31
|
export default class Renderer {
|
|
6
|
-
|
|
32
|
+
/**
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
35
|
+
readonly isRenderer: true;
|
|
7
36
|
|
|
8
37
|
domElement: HTMLCanvasElement;
|
|
9
38
|
|
|
39
|
+
/**
|
|
40
|
+
* The renderer backend; could be WebGLBackend or WebGPUBackend
|
|
41
|
+
*/
|
|
10
42
|
backend: Backend;
|
|
11
43
|
|
|
44
|
+
/**
|
|
45
|
+
* @default true
|
|
46
|
+
*/
|
|
12
47
|
autoClear: boolean;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* @default true
|
|
51
|
+
*/
|
|
13
52
|
autoClearColor: boolean;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
14
57
|
autoClearDepth: boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* @default true
|
|
61
|
+
*/
|
|
15
62
|
autoClearStencil: boolean;
|
|
16
63
|
|
|
64
|
+
/**
|
|
65
|
+
* @default SRGBColorSpace
|
|
66
|
+
*/
|
|
17
67
|
outputColorSpace: ColorSpace;
|
|
18
68
|
|
|
69
|
+
/**
|
|
70
|
+
* @default NoToneMapping
|
|
71
|
+
*/
|
|
19
72
|
toneMapping: ToneMapping;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @default 1.0
|
|
76
|
+
*/
|
|
20
77
|
toneMappingExposure: number;
|
|
21
78
|
|
|
79
|
+
/**
|
|
80
|
+
* @default true
|
|
81
|
+
*/
|
|
22
82
|
sortObjects: boolean;
|
|
23
83
|
|
|
84
|
+
/**
|
|
85
|
+
* @default true
|
|
86
|
+
*/
|
|
24
87
|
depth: boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* @default true
|
|
91
|
+
*/
|
|
25
92
|
stencil: boolean;
|
|
26
93
|
|
|
27
94
|
info: Info;
|
|
28
95
|
|
|
29
|
-
constructor(backend: Backend, parameters?:
|
|
96
|
+
constructor(backend: Backend, parameters?: RendererParameters);
|
|
30
97
|
|
|
31
98
|
init(): Promise<void>;
|
|
32
99
|
|
|
33
100
|
get coordinateSystem(): CoordinateSystem;
|
|
34
101
|
|
|
35
|
-
|
|
102
|
+
compileAsync(scene: Scene, camera: Camera, targetScene?: Scene | null): Promise<void>;
|
|
103
|
+
|
|
104
|
+
renderAsync(scene: Scene, camera: Camera): Promise<void>;
|
|
105
|
+
|
|
106
|
+
getMaxAnisotropy(): number;
|
|
107
|
+
|
|
108
|
+
getActiveCubeFace(): number;
|
|
109
|
+
|
|
110
|
+
getActiveMipmapLevel(): number;
|
|
36
111
|
|
|
37
112
|
setAnimationLoop(callback: ((time: DOMHighResTimeStamp) => void) | null): Promise<void>;
|
|
38
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Sets the pixel ratio of the Renderer.
|
|
116
|
+
*/
|
|
39
117
|
setPixelRatio(value?: number): void;
|
|
40
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Sets the width and height of the output canvas and optionally updates the CSS style on the DOM element.
|
|
121
|
+
*/
|
|
41
122
|
setSize(width: number, height: number, updateStyle?: boolean): void;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Gets the Rendering Context of the renderer.
|
|
126
|
+
*/
|
|
127
|
+
getContext(): RenderingContext;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Gets the current pixel ratio of the renderer.
|
|
131
|
+
*/
|
|
132
|
+
getPixelRatio(): number;
|
|
133
|
+
|
|
134
|
+
getDrawingBufferSize(target: Vector2): Vector2;
|
|
135
|
+
|
|
136
|
+
getSize(target: Vector2): Vector2;
|
|
137
|
+
|
|
138
|
+
setDrawingBufferSize(width: number, height: number, pixelRatio: number): void;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Sets the custom opaque sort function for the RenderLists. Pass null to use the default painterSortStable function.
|
|
142
|
+
*/
|
|
143
|
+
setOpaqueSort(method: (a: unknown, b: unknown) => number): void;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Sets the custom transparent sort function for the RenderLists. Pass null to use the default reversePainterSortStable function.
|
|
147
|
+
*/
|
|
148
|
+
setTransparentSort(method: (a: unknown, b: unknown) => number): void;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Copies the scissor area into target.
|
|
152
|
+
*/
|
|
153
|
+
getScissor(target: Vector4): Vector4;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Sets the scissor area from (x, y) to (x + width, y + height).
|
|
157
|
+
*/
|
|
158
|
+
setScissor(x: number, y: number, width: number, height: number): void;
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* Returns true if scissor test is enabled; returns false otherwise.
|
|
162
|
+
*/
|
|
163
|
+
getScissorTest(): boolean;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Enable the scissor test. When this is enabled, only the pixels within the defined scissor area will be affected by further renderer actions.
|
|
167
|
+
*/
|
|
168
|
+
setScissorTest(boolean: boolean): void;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Copies the viewport into target.
|
|
172
|
+
*/
|
|
173
|
+
getViewport(target: Vector4): Vector4;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Sets the viewport to render from (x, y) to (x + width, y + height).
|
|
177
|
+
* (x, y) is the lower-left corner of the region.
|
|
178
|
+
*/
|
|
179
|
+
setViewport(x: number, y: number, width: number, height: number, minDepth?: number, maxDepth?: number): void;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Returns a Color4 instance with the current clear color.
|
|
183
|
+
*/
|
|
184
|
+
getClearColor(target: Color4): Color4;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* Sets the clear color, using color for the color and alpha for the opacity.
|
|
188
|
+
*/
|
|
189
|
+
setClearColor(color: Color, alpha?: number): void;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Returns a float with the current clear alpha. Ranges from 0 to 1.
|
|
193
|
+
*/
|
|
194
|
+
getClearAlpha(): number;
|
|
195
|
+
|
|
196
|
+
setClearAlpha(alpha: number): void;
|
|
197
|
+
|
|
198
|
+
getClearDepth(): number;
|
|
199
|
+
|
|
200
|
+
setClearDepth(depth: number): void;
|
|
201
|
+
|
|
202
|
+
getClearStencil(): number;
|
|
203
|
+
|
|
204
|
+
setClearStencil(stencil: number): void;
|
|
205
|
+
|
|
206
|
+
isOccluded(object: Object3D): boolean;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Tells the renderer to clear its color, depth or stencil drawing buffer(s).
|
|
210
|
+
* Arguments default to true
|
|
211
|
+
*/
|
|
212
|
+
clearAsync(color?: boolean, depth?: boolean, stencil?: boolean): Promise<void>;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Clear the color buffer. Equivalent to calling .clear( true, false, false ).
|
|
216
|
+
*/
|
|
217
|
+
clearColorAsync(): Promise<void>;
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Clear the depth buffer. Equivalent to calling .clear( false, true, false ).
|
|
221
|
+
*/
|
|
222
|
+
clearDepthAsync(): Promise<void>;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Clear the stencil buffer. Equivalent to calling .clear( false, false, true ).
|
|
226
|
+
*/
|
|
227
|
+
clearStencilAsync(): Promise<void>;
|
|
228
|
+
|
|
229
|
+
get currentColorSpace(): ColorSpace;
|
|
230
|
+
|
|
231
|
+
dispose(): void;
|
|
232
|
+
|
|
233
|
+
setRenderTarget(renderTarget: RenderTarget, activeCubeFace?: number, activeMipmapLevel?: number): void;
|
|
234
|
+
|
|
235
|
+
getRenderTarget(): RenderTarget;
|
|
236
|
+
|
|
237
|
+
setRenderObjectFunction(renderObjectFunction: () => {}): void;
|
|
238
|
+
|
|
239
|
+
getRenderObjectFunction(): () => {};
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Runs a compute pipeline
|
|
243
|
+
*/
|
|
244
|
+
computeAsync(computeNodes: ComputeNode | ComputeNode[]): Promise<void>;
|
|
245
|
+
|
|
246
|
+
hasFeature(name: string): boolean;
|
|
247
|
+
|
|
248
|
+
copyFramebufferToTexture(framebufferTexture: FramebufferTexture): void;
|
|
249
|
+
|
|
250
|
+
readRenderTargetPixelsAsync(
|
|
251
|
+
renderTarget: RenderTarget,
|
|
252
|
+
x: number,
|
|
253
|
+
y: number,
|
|
254
|
+
width: number,
|
|
255
|
+
height: number,
|
|
256
|
+
): Promise<Float32Array | Uint16Array | Uint8Array | Int8Array | Int16Array | Uint32Array | Int32Array>;
|
|
257
|
+
|
|
258
|
+
renderObject(
|
|
259
|
+
object: Object3D,
|
|
260
|
+
scene: Scene,
|
|
261
|
+
camera: Camera,
|
|
262
|
+
geometry: BufferGeometry,
|
|
263
|
+
material: Material,
|
|
264
|
+
group: Group,
|
|
265
|
+
lightsNode: LightsNode,
|
|
266
|
+
): void;
|
|
267
|
+
|
|
268
|
+
get compute(): (computeNodes: ComputeNode | ComputeNode[]) => Promise<void>;
|
|
269
|
+
|
|
270
|
+
get compile(): (scene: Scene, camera: Camera, targetScene?: Scene | null) => Promise<void>;
|
|
271
|
+
|
|
272
|
+
get render(): (scene: Scene, camera: Camera) => Promise<void>;
|
|
273
|
+
|
|
274
|
+
get clear(): (color?: boolean, depth?: boolean, stencil?: boolean) => Promise<void>;
|
|
275
|
+
|
|
276
|
+
get clearColor(): () => Promise<void>;
|
|
277
|
+
|
|
278
|
+
get clearDepth(): () => Promise<void>;
|
|
279
|
+
|
|
280
|
+
get clearStencil(): () => Promise<void>;
|
|
42
281
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { CoordinateSystem } from '../../../../src/Three.js';
|
|
2
|
-
import Backend from '../common/Backend.js';
|
|
2
|
+
import Backend, { BackendParameters } from '../common/Backend.js';
|
|
3
3
|
|
|
4
4
|
export default class WebGLBackend extends Backend {
|
|
5
|
-
constructor(parameters?:
|
|
5
|
+
constructor(parameters?: BackendParameters);
|
|
6
6
|
|
|
7
7
|
get coordinateSystem(): CoordinateSystem;
|
|
8
|
+
|
|
9
|
+
getMaxAnisotropy(): number;
|
|
8
10
|
}
|
|
@@ -2,7 +2,7 @@ import NodeBuilder from '../../../nodes/core/NodeBuilder.js';
|
|
|
2
2
|
import { Renderer, Object3D } from '../../../../../src/Three.js';
|
|
3
3
|
import Node from '../../../nodes/core/Node.js';
|
|
4
4
|
import SlotNode from './SlotNode.js';
|
|
5
|
-
import {
|
|
5
|
+
import { NodeShaderStage } from '../../../nodes/core/constants.js';
|
|
6
6
|
|
|
7
7
|
export class WebGLNodeBuilder extends NodeBuilder {
|
|
8
8
|
constructor(
|
|
@@ -11,7 +11,7 @@ export class WebGLNodeBuilder extends NodeBuilder {
|
|
|
11
11
|
shader: { uniforms: any; vertexShader: any; fragmentShader: any },
|
|
12
12
|
);
|
|
13
13
|
|
|
14
|
-
addSlot(shaderStage:
|
|
14
|
+
addSlot(shaderStage: NodeShaderStage, slotNode: SlotNode): Node;
|
|
15
15
|
|
|
16
16
|
getUniforms(shaderStage: string): string;
|
|
17
17
|
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { CoordinateSystem } from '../../../../src/Three.js';
|
|
2
|
-
import Backend from '../common/Backend.js';
|
|
2
|
+
import Backend, { BackendParameters } from '../common/Backend.js';
|
|
3
|
+
|
|
4
|
+
export interface WebGPUBackendParameters extends BackendParameters {
|
|
5
|
+
alpha?: boolean | undefined;
|
|
6
|
+
antialias?: boolean | undefined;
|
|
7
|
+
sampleCount?: number | undefined;
|
|
8
|
+
trackTimestamp?: boolean | undefined;
|
|
9
|
+
}
|
|
3
10
|
|
|
4
11
|
export default class WebGPUBackend extends Backend {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
sampleCount?: number | undefined;
|
|
9
|
-
});
|
|
12
|
+
readonly isWebGPUBackend: true;
|
|
13
|
+
|
|
14
|
+
constructor(parameters?: WebGPUBackendParameters);
|
|
10
15
|
|
|
11
16
|
get coordinateSystem(): CoordinateSystem;
|
|
17
|
+
|
|
18
|
+
// utils public
|
|
19
|
+
|
|
20
|
+
getMaxAnisotropy(): number;
|
|
12
21
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import Renderer from '../common/Renderer.js';
|
|
1
|
+
import Renderer, { RendererParameters } from '../common/Renderer.js';
|
|
2
|
+
import { WebGPUBackendParameters } from './WebGPUBackend.js';
|
|
3
|
+
|
|
4
|
+
export interface WebGPURendererParameters extends RendererParameters, WebGPUBackendParameters {
|
|
5
|
+
forceWebGL?: boolean | undefined;
|
|
6
|
+
}
|
|
2
7
|
|
|
3
8
|
export default class WebGPURenderer extends Renderer {
|
|
4
|
-
constructor(parameters?:
|
|
5
|
-
canvas?: HTMLCanvasElement | undefined;
|
|
6
|
-
antialias?: boolean | undefined;
|
|
7
|
-
sampleCount?: number | undefined;
|
|
8
|
-
logarithmicDepthBuffer?: boolean | undefined;
|
|
9
|
-
});
|
|
9
|
+
constructor(parameters?: WebGPURendererParameters);
|
|
10
10
|
}
|
|
@@ -35,13 +35,3 @@ export function deinterleaveGeometry(geometry: BufferGeometry): void;
|
|
|
35
35
|
* @param creaseAngle The crease angle in radians.
|
|
36
36
|
*/
|
|
37
37
|
export function toCreasedNormals(geometry: BufferGeometry, creaseAngle?: number): BufferGeometry;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @deprecated Use mergeGeometries instead.
|
|
41
|
-
*/
|
|
42
|
-
export function mergeBufferGeometries(geometries: BufferGeometry[], useGroups?: boolean): BufferGeometry;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated Use mergeAttributes instead.
|
|
46
|
-
*/
|
|
47
|
-
export function mergeBufferAttributes(attributes: BufferAttribute[]): BufferAttribute;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { Group, Object3D, Texture } from '../../../src/Three.js';
|
|
2
|
-
|
|
3
|
-
import { GLTFLoader } from '../loaders/GLTFLoader.js';
|
|
1
|
+
import { Group, Loader, Object3D, Texture } from '../../../src/Three.js';
|
|
2
|
+
import { GLTF } from '../loaders/GLTFLoader.js';
|
|
4
3
|
|
|
5
4
|
export class XRControllerModel extends Object3D {
|
|
6
5
|
constructor();
|
|
@@ -13,9 +12,11 @@ export class XRControllerModel extends Object3D {
|
|
|
13
12
|
}
|
|
14
13
|
|
|
15
14
|
export class XRControllerModelFactory {
|
|
16
|
-
|
|
17
|
-
gltfLoader: GLTFLoader | null;
|
|
15
|
+
gltfLoader: Loader<GLTF> | null;
|
|
18
16
|
path: string;
|
|
17
|
+
onLoad: ((scene: Group) => void) | null;
|
|
18
|
+
|
|
19
|
+
constructor(gltfLoader?: Loader<GLTF> | null, onLoad?: ((scene: Group) => void) | null);
|
|
19
20
|
|
|
20
21
|
createControllerModel(controller: Group): XRControllerModel;
|
|
21
22
|
}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
import { Object3D } from '../../../src/Three.js';
|
|
1
|
+
import { Loader, Object3D } from '../../../src/Three.js';
|
|
2
|
+
import { GLTF } from '../loaders/GLTFLoader.js';
|
|
2
3
|
|
|
3
4
|
export class XRHandMeshModel {
|
|
4
5
|
controller: Object3D;
|
|
5
6
|
handModel: Object3D;
|
|
6
7
|
bones: Object3D[];
|
|
7
8
|
|
|
8
|
-
constructor(
|
|
9
|
+
constructor(
|
|
10
|
+
handModel: Object3D,
|
|
11
|
+
controller: Object3D,
|
|
12
|
+
path: string,
|
|
13
|
+
handedness: string,
|
|
14
|
+
loader?: Loader<GLTF> | null,
|
|
15
|
+
onLoad?: ((object: Object3D) => void) | null,
|
|
16
|
+
);
|
|
9
17
|
|
|
10
18
|
updateMesh(): void;
|
|
11
19
|
}
|
three/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.161.0",
|
|
4
4
|
"description": "TypeScript definitions for three",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
|
|
6
6
|
"license": "MIT",
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
"fflate": "~0.6.10",
|
|
45
45
|
"meshoptimizer": "~0.18.1"
|
|
46
46
|
},
|
|
47
|
-
"typesPublisherContentHash": "
|
|
47
|
+
"typesPublisherContentHash": "3aa24058634b97c18523562ed8a4194a3a400d891c67daa36884efcbc24b62ef",
|
|
48
48
|
"typeScriptVersion": "4.6"
|
|
49
49
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Camera } from './Camera.js';
|
|
2
|
+
import { Vector2 } from '../math/Vector2.js';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Camera that uses {@link https://en.wikipedia.org/wiki/Perspective_(graphical) | perspective projection}.
|
|
@@ -148,6 +149,18 @@ export class PerspectiveCamera extends Camera {
|
|
|
148
149
|
*/
|
|
149
150
|
getFilmHeight(): number;
|
|
150
151
|
|
|
152
|
+
/**
|
|
153
|
+
* Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction.
|
|
154
|
+
* Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle.
|
|
155
|
+
*/
|
|
156
|
+
getViewBounds(distance: number, minTarget: Vector2, maxTarget: Vector2): void;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.
|
|
160
|
+
* Copies the result into the target Vector2, where x is width and y is height.
|
|
161
|
+
*/
|
|
162
|
+
getViewSize(distance: number, minTarget: Vector2, maxTarget: Vector2): void;
|
|
163
|
+
|
|
151
164
|
/**
|
|
152
165
|
* Sets an offset in a larger frustum.
|
|
153
166
|
* @remarks
|
three/src/constants.d.ts
CHANGED
|
@@ -37,12 +37,11 @@ export type ShadowMapType = typeof BasicShadowMap | typeof PCFShadowMap | typeof
|
|
|
37
37
|
export const FrontSide: 0;
|
|
38
38
|
export const BackSide: 1;
|
|
39
39
|
export const DoubleSide: 2;
|
|
40
|
-
export const TwoPassDoubleSide: 2;
|
|
41
40
|
/**
|
|
42
41
|
* Defines which side of faces will be rendered - front, back or both.
|
|
43
42
|
* Default is {@link FrontSide}.
|
|
44
43
|
*/
|
|
45
|
-
export type Side = typeof FrontSide | typeof BackSide | typeof DoubleSide
|
|
44
|
+
export type Side = typeof FrontSide | typeof BackSide | typeof DoubleSide;
|
|
46
45
|
|
|
47
46
|
// blending modes
|
|
48
47
|
export const NoBlending: 0;
|
|
@@ -84,13 +84,23 @@ export class InterleavedBufferAttribute {
|
|
|
84
84
|
* Applies normal matrix {@link Matrix3 | m} to every Vector3 element of this InterleavedBufferAttribute.
|
|
85
85
|
* @param m
|
|
86
86
|
*/
|
|
87
|
-
applyNormalMatrix(
|
|
87
|
+
applyNormalMatrix(m: Matrix): this;
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
90
|
* Applies matrix {@link Matrix4 | m} to every Vector3 element of this InterleavedBufferAttribute, interpreting the elements as a direction vectors.
|
|
91
91
|
* @param m
|
|
92
92
|
*/
|
|
93
|
-
transformDirection(
|
|
93
|
+
transformDirection(m: Matrix): this;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Returns the given component of the vector at the given index.
|
|
97
|
+
*/
|
|
98
|
+
getComponent(index: number, component: number): number;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Sets the given component of the vector at the given index.
|
|
102
|
+
*/
|
|
103
|
+
setComponent(index: number, component: number, value: number): this;
|
|
94
104
|
|
|
95
105
|
/**
|
|
96
106
|
* Returns the x component of the item at the given index.
|
three/src/core/Object3D.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
42
42
|
/**
|
|
43
43
|
* Unique number for this {@link Object3D} instance.
|
|
44
44
|
* @remarks Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
|
|
45
|
-
*
|
|
45
|
+
* Expects a `Integer`
|
|
46
46
|
*/
|
|
47
47
|
readonly id: number;
|
|
48
48
|
|
|
@@ -62,7 +62,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
62
62
|
/**
|
|
63
63
|
* A Read-only _string_ to check `this` object type.
|
|
64
64
|
* @remarks This can be used to find a specific type of Object3D in a scene.
|
|
65
|
-
*
|
|
65
|
+
* Sub-classes will update this value.
|
|
66
66
|
* @defaultValue `Object3D`
|
|
67
67
|
*/
|
|
68
68
|
readonly type: string | 'Object3D';
|
|
@@ -158,7 +158,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
158
158
|
/**
|
|
159
159
|
* The layer membership of the object.
|
|
160
160
|
* @remarks The object is only visible if it has at least one layer in common with the {@link THREE.Object3DCamera | Camera} in use.
|
|
161
|
-
*
|
|
161
|
+
* This property can also be used to filter out unwanted objects in ray-intersection tests when using {@link THREE.Raycaster | Raycaster}.
|
|
162
162
|
* @defaultValue `new THREE.Layers()`
|
|
163
163
|
*/
|
|
164
164
|
layers: Layers;
|
|
@@ -192,7 +192,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
192
192
|
* This value allows the default rendering order of {@link https://en.wikipedia.org/wiki/Scene_graph | scene graph}
|
|
193
193
|
* objects to be overridden although opaque and transparent objects remain sorted independently.
|
|
194
194
|
* @remarks When this property is set for an instance of {@link Group | Group}, all descendants objects will be sorted and rendered together.
|
|
195
|
-
*
|
|
195
|
+
* Sorting is from lowest to highest renderOrder.
|
|
196
196
|
* @defaultValue `0`
|
|
197
197
|
*/
|
|
198
198
|
renderOrder: number;
|
|
@@ -213,7 +213,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
213
213
|
/**
|
|
214
214
|
* Custom depth material to be used when rendering to the depth map.
|
|
215
215
|
* @remarks Can only be used in context of meshes.
|
|
216
|
-
*
|
|
216
|
+
* When shadow-casting with a {@link THREE.DirectionalLight | DirectionalLight} or {@link THREE.SpotLight | SpotLight},
|
|
217
217
|
* if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows.
|
|
218
218
|
* @defaultValue `undefined`
|
|
219
219
|
*/
|
|
@@ -229,7 +229,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
229
229
|
* An optional callback that is executed immediately before a 3D object is rendered to a shadow map.
|
|
230
230
|
* @remarks This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry,
|
|
231
231
|
* depthMaterial, group.
|
|
232
|
-
*
|
|
232
|
+
* Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which
|
|
233
233
|
* define their visual appearance with geometries and materials like instances of {@link Mesh}, {@link Line},
|
|
234
234
|
* {@link Points} or {@link Sprite}. Instances of {@link Object3D}, {@link Group} or {@link Bone} are not renderable
|
|
235
235
|
* and thus this callback is not executed for such objects.
|
|
@@ -247,7 +247,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
247
247
|
* An optional callback that is executed immediately after a 3D object is rendered to a shadow map.
|
|
248
248
|
* @remarks This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry,
|
|
249
249
|
* depthMaterial, group.
|
|
250
|
-
*
|
|
250
|
+
* Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which
|
|
251
251
|
* define their visual appearance with geometries and materials like instances of {@link Mesh}, {@link Line},
|
|
252
252
|
* {@link Points} or {@link Sprite}. Instances of {@link Object3D}, {@link Group} or {@link Bone} are not renderable
|
|
253
253
|
* and thus this callback is not executed for such objects.
|
|
@@ -264,7 +264,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
264
264
|
/**
|
|
265
265
|
* An optional callback that is executed immediately before a 3D object is rendered.
|
|
266
266
|
* @remarks This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
|
|
267
|
-
*
|
|
267
|
+
* Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which
|
|
268
268
|
* define their visual appearance with geometries and materials like instances of {@link Mesh}, {@link Line},
|
|
269
269
|
* {@link Points} or {@link Sprite}. Instances of {@link Object3D}, {@link Group} or {@link Bone} are not renderable
|
|
270
270
|
* and thus this callback is not executed for such objects.
|
|
@@ -281,7 +281,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
281
281
|
/**
|
|
282
282
|
* An optional callback that is executed immediately after a 3D object is rendered.
|
|
283
283
|
* @remarks This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
|
|
284
|
-
*
|
|
284
|
+
* Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which
|
|
285
285
|
* define their visual appearance with geometries and materials like instances of {@link Mesh}, {@link Line},
|
|
286
286
|
* {@link Points} or {@link Sprite}. Instances of {@link Object3D}, {@link Group} or {@link Bone} are not renderable
|
|
287
287
|
* and thus this callback is not executed for such objects.
|
|
@@ -363,7 +363,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
363
363
|
/**
|
|
364
364
|
* Rotate an object along an axis in world space.
|
|
365
365
|
* @remarks The axis is assumed to be normalized
|
|
366
|
-
*
|
|
366
|
+
* Method Assumes no rotated parent.
|
|
367
367
|
* @param axis A normalized vector in world space.
|
|
368
368
|
* @param angle The angle in radians. Expects a `Float`
|
|
369
369
|
*/
|
|
@@ -443,7 +443,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
443
443
|
/**
|
|
444
444
|
* Adds another {@link Object3D} as child of this {@link Object3D}.
|
|
445
445
|
* @remarks An arbitrary number of objects may be added
|
|
446
|
-
*
|
|
446
|
+
* Any current parent on an {@link object} passed in here will be removed, since an {@link Object3D} can have at most one parent.
|
|
447
447
|
* @see {@link attach}
|
|
448
448
|
* @see {@link THREE.Group | Group} for info on manually grouping objects.
|
|
449
449
|
* @param object
|
|
@@ -487,7 +487,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
487
487
|
/**
|
|
488
488
|
* Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
|
|
489
489
|
* @remarks Note that for most objects the name is an empty string by default
|
|
490
|
-
*
|
|
490
|
+
* You will have to set it manually to make use of this method.
|
|
491
491
|
* @param name String to match to the children's Object3D.name property.
|
|
492
492
|
*/
|
|
493
493
|
getObjectByName(name: string): Object3D | undefined;
|
|
@@ -555,7 +555,7 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
555
555
|
/**
|
|
556
556
|
* Like traverse, but the callback will only be executed for visible objects
|
|
557
557
|
* @remarks Descendants of invisible objects are not traversed.
|
|
558
|
-
*
|
|
558
|
+
* Note: Modifying the scene graph inside the callback is discouraged.
|
|
559
559
|
* @param callback A function with as first argument an {@link Object3D} object.
|
|
560
560
|
*/
|
|
561
561
|
traverseVisible(callback: (object: Object3D) => any): void;
|