@types/three 0.183.1 → 0.184.1
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 +2 -2
- three/examples/jsm/Addons.d.ts +11 -0
- three/examples/jsm/controls/FirstPersonControls.d.ts +5 -10
- three/examples/jsm/controls/TransformControls.d.ts +24 -0
- three/examples/jsm/geometries/TextGeometry.d.ts +43 -71
- three/examples/jsm/helpers/LightProbeGridHelper.d.ts +12 -0
- three/examples/jsm/inspector/Extension.d.ts +9 -0
- three/examples/jsm/inspector/Inspector.d.ts +21 -2
- three/examples/jsm/inspector/RendererInspector.d.ts +7 -2
- three/examples/jsm/inspector/extensions/tsl-graph/TSLGraphEditor.d.ts +20 -0
- three/examples/jsm/inspector/extensions/tsl-graph/TSLGraphLoader.d.ts +11 -0
- three/examples/jsm/inspector/tabs/Parameters.d.ts +22 -1
- three/examples/jsm/inspector/ui/Tab.d.ts +5 -1
- three/examples/jsm/inspector/ui/Values.d.ts +23 -3
- three/examples/jsm/interaction/InteractionManager.d.ts +18 -0
- three/examples/jsm/lighting/DynamicLighting.d.ts +16 -0
- three/examples/jsm/lighting/LightProbeGrid.d.ts +34 -0
- three/examples/jsm/loaders/ColladaLoader.d.ts +1 -0
- three/examples/jsm/loaders/EXRLoader.d.ts +2 -0
- three/examples/jsm/loaders/LDrawLoader.d.ts +1 -1
- three/examples/jsm/loaders/VTKLoader.d.ts +6 -0
- three/examples/jsm/objects/Reflector.d.ts +1 -2
- three/examples/jsm/objects/SkyMesh.d.ts +1 -0
- three/examples/jsm/tsl/WebGLNodesHandler.d.ts +14 -0
- three/examples/jsm/tsl/display/FSR1Node.d.ts +17 -0
- three/examples/jsm/tsl/display/SharpenNode.d.ts +22 -0
- three/examples/jsm/tsl/display/TAAUNode.d.ts +31 -0
- three/examples/jsm/tsl/lighting/DynamicLightsNode.d.ts +21 -0
- three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +1 -1
- three/examples/jsm/tsl/lighting/data/AmbientLightDataNode.d.ts +9 -0
- three/examples/jsm/tsl/lighting/data/DirectionalLightDataNode.d.ts +9 -0
- three/examples/jsm/tsl/lighting/data/HemisphereLightDataNode.d.ts +9 -0
- three/examples/jsm/tsl/lighting/data/PointLightDataNode.d.ts +9 -0
- three/examples/jsm/tsl/lighting/data/SpotLightDataNode.d.ts +9 -0
- three/examples/jsm/utils/ColorUtils.d.ts +5 -0
- three/examples/jsm/utils/SceneOptimizer.d.ts +18 -0
- three/examples/jsm/webxr/XRHandMeshModel.d.ts +1 -0
- three/package.json +4 -5
- three/src/Three.Core.d.ts +13 -1
- three/src/Three.TSL.d.ts +7 -1
- three/src/Three.WebGPU.Nodes.d.ts +8 -4
- three/src/Three.WebGPU.d.ts +11 -4
- three/src/Three.d.ts +0 -11
- three/src/animation/AnimationMixer.d.ts +3 -1
- three/src/audio/AudioContext.d.ts +2 -2
- three/src/core/BufferAttribute.d.ts +13 -1
- three/src/core/RenderTarget.d.ts +8 -1
- three/src/core/UniformsGroup.d.ts +7 -1
- three/src/extras/Controls.d.ts +5 -1
- three/src/geometries/ExtrudeGeometry.d.ts +39 -53
- three/src/loaders/FileLoader.d.ts +2 -2
- three/src/materials/Material.d.ts +5 -1
- three/src/materials/MeshToonMaterial.d.ts +1 -1
- three/src/materials/nodes/Line2NodeMaterial.d.ts +7 -0
- three/src/materials/nodes/VolumeNodeMaterial.d.ts +1 -1
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +11 -1
- three/src/math/ColorManagement.d.ts +1 -1
- three/src/math/Plane.d.ts +1 -1
- three/src/nodes/Nodes.d.ts +0 -1
- three/src/nodes/TSL.d.ts +1 -1
- three/src/nodes/accessors/BufferAttributeNode.d.ts +1 -1
- three/src/nodes/core/Node.d.ts +37 -9
- three/src/nodes/core/StackNode.d.ts +1 -1
- three/src/nodes/core/StructTypeNode.d.ts +0 -4
- three/src/nodes/core/UniformGroupNode.d.ts +4 -3
- three/src/nodes/core/UniformNode.d.ts +3 -0
- three/src/nodes/core/VarNode.d.ts +16 -10
- three/src/nodes/display/ViewportDepthTextureNode.d.ts +1 -3
- three/src/nodes/display/ViewportTextureNode.d.ts +5 -5
- three/src/nodes/functions/ShadowMaskModel.d.ts +2 -2
- three/src/nodes/gpgpu/BarrierNode.d.ts +2 -0
- three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +16 -7
- three/src/nodes/gpgpu/ComputeNode.d.ts +6 -2
- three/src/nodes/materialx/lib/mx_noise.d.ts +4 -5
- three/src/nodes/math/MathNode.d.ts +64 -6
- three/src/nodes/tsl/TSLBase.d.ts +1 -1
- three/src/nodes/tsl/TSLCore.d.ts +568 -160
- three/src/nodes/utils/ConvertNode.d.ts +9 -2
- three/src/nodes/utils/EventNode.d.ts +6 -0
- three/src/nodes/utils/JoinNode.d.ts +9 -5
- three/src/nodes/utils/LoopNode.d.ts +1 -2
- three/src/nodes/utils/{RemapNode.d.ts → Remap.d.ts} +6 -22
- three/src/objects/BatchedMesh.d.ts +2 -0
- three/src/objects/InstancedMesh.d.ts +6 -6
- three/src/objects/SkinnedMesh.d.ts +3 -0
- three/src/renderers/WebGLRenderer.d.ts +10 -1
- three/src/renderers/common/Animation.d.ts +2 -2
- three/src/renderers/common/Attributes.d.ts +9 -1
- three/src/renderers/common/Backend.d.ts +4 -0
- three/src/renderers/common/Background.d.ts +2 -2
- three/src/renderers/common/BindGroup.d.ts +0 -6
- three/src/renderers/common/Bindings.d.ts +2 -2
- three/src/renderers/common/CanvasTarget.d.ts +3 -1
- three/src/renderers/common/ComputePipeline.d.ts +1 -1
- three/src/renderers/common/Info.d.ts +132 -1
- three/src/renderers/common/InspectorBase.d.ts +7 -1
- three/src/renderers/common/Pipelines.d.ts +19 -3
- three/src/renderers/common/ReadbackBuffer.d.ts +63 -0
- three/src/renderers/common/RenderBundle.d.ts +4 -1
- three/src/renderers/common/RenderBundles.d.ts +3 -1
- three/src/renderers/common/RenderObject.d.ts +2 -2
- three/src/renderers/common/RenderObjects.d.ts +3 -3
- three/src/renderers/common/Renderer.d.ts +29 -16
- three/src/renderers/common/XRManager.d.ts +1 -7
- three/src/renderers/common/nodes/NodeManager.d.ts +51 -11
- three/src/renderers/shaders/ShaderChunk.d.ts +1 -0
- three/src/renderers/shaders/UniformsLib.d.ts +5 -1
- three/src/renderers/webgl/WebGLBufferRenderer.d.ts +0 -6
- three/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +0 -6
- three/src/renderers/webgl/WebGLPrograms.d.ts +5 -0
- three/src/renderers/webgl-fallback/WebGLBackend.d.ts +2 -0
- three/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts +19 -0
- three/src/renderers/webgl-fallback/utils/WebGLCapabilities.d.ts +51 -0
- three/src/renderers/webgpu/WebGPUBackend.d.ts +9 -4
- three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +6 -0
- three/src/renderers/webxr/WebXRController.d.ts +5 -1
- three/src/renderers/webxr/WebXRManager.d.ts +3 -1
- three/src/scenes/Scene.d.ts +2 -2
- three/src/textures/ExternalTexture.d.ts +3 -2
- three/src/textures/HTMLTexture.d.ts +27 -0
- three/src/textures/Texture.d.ts +16 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { EventDispatcher } from "../../core/EventDispatcher.js";
|
|
2
|
+
|
|
3
|
+
export interface ReadbackBufferEventMap {
|
|
4
|
+
release: {};
|
|
5
|
+
dispose: {};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A readback buffer is used to transfer data from the GPU to the CPU.
|
|
10
|
+
* It is primarily used to read back compute shader results.
|
|
11
|
+
*
|
|
12
|
+
* @augments EventDispatcher
|
|
13
|
+
*/
|
|
14
|
+
declare class ReadbackBuffer<TEventMap extends ReadbackBufferEventMap = ReadbackBufferEventMap>
|
|
15
|
+
extends EventDispatcher<TEventMap>
|
|
16
|
+
{
|
|
17
|
+
/**
|
|
18
|
+
* Constructs a new readback buffer.
|
|
19
|
+
*
|
|
20
|
+
* @param {number} maxByteLength - The maximum size of the buffer to be read back.
|
|
21
|
+
*/
|
|
22
|
+
constructor(maxByteLength: number);
|
|
23
|
+
/**
|
|
24
|
+
* Name used for debugging purposes.
|
|
25
|
+
*
|
|
26
|
+
* @type {string}
|
|
27
|
+
*/
|
|
28
|
+
name: string;
|
|
29
|
+
/**
|
|
30
|
+
* The mapped, read back array buffer.
|
|
31
|
+
*
|
|
32
|
+
* @type {ArrayBuffer|null}
|
|
33
|
+
*/
|
|
34
|
+
buffer: ArrayBuffer | null;
|
|
35
|
+
/**
|
|
36
|
+
* The maximum size of the buffer to be read back.
|
|
37
|
+
*
|
|
38
|
+
* @type {number}
|
|
39
|
+
*/
|
|
40
|
+
maxByteLength: number;
|
|
41
|
+
/**
|
|
42
|
+
* This flag can be used for type testing.
|
|
43
|
+
*
|
|
44
|
+
* @type {boolean}
|
|
45
|
+
* @readonly
|
|
46
|
+
* @default true
|
|
47
|
+
*/
|
|
48
|
+
readonly isReadbackBuffer: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Releases the mapped buffer data so the GPU buffer can be
|
|
51
|
+
* used by the GPU again.
|
|
52
|
+
*
|
|
53
|
+
* Note: Any `ArrayBuffer` data associated with this readback buffer
|
|
54
|
+
* are removed and no longer accessible after calling this method.
|
|
55
|
+
*/
|
|
56
|
+
release(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Frees internal resources.
|
|
59
|
+
*/
|
|
60
|
+
dispose(): void;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export default ReadbackBuffer;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Camera } from "../../cameras/Camera.js";
|
|
2
2
|
import BundleGroup from "./BundleGroup.js";
|
|
3
|
+
import RenderContext from "./RenderContext.js";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* This module is used to represent render bundles inside the renderer
|
|
@@ -13,10 +14,12 @@ declare class RenderBundle {
|
|
|
13
14
|
*
|
|
14
15
|
* @param {BundleGroup} bundleGroup - The bundle group.
|
|
15
16
|
* @param {Camera} camera - The camera the bundle group is rendered with.
|
|
17
|
+
* @param {RenderContext} renderContext - The render context the bundle is rendered with.
|
|
16
18
|
*/
|
|
17
|
-
constructor(bundleGroup: BundleGroup, camera: Camera);
|
|
19
|
+
constructor(bundleGroup: BundleGroup, camera: Camera, renderContext: RenderContext);
|
|
18
20
|
bundleGroup: BundleGroup;
|
|
19
21
|
camera: Camera;
|
|
22
|
+
renderContext: RenderContext;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
export default RenderBundle;
|
|
@@ -2,6 +2,7 @@ import { Camera } from "../../cameras/Camera.js";
|
|
|
2
2
|
import BundleGroup from "./BundleGroup.js";
|
|
3
3
|
import ChainMap from "./ChainMap.js";
|
|
4
4
|
import RenderBundle from "./RenderBundle.js";
|
|
5
|
+
import RenderContext from "./RenderContext.js";
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* This renderer module manages render bundles.
|
|
@@ -20,9 +21,10 @@ declare class RenderBundles {
|
|
|
20
21
|
*
|
|
21
22
|
* @param {BundleGroup} bundleGroup - The bundle group.
|
|
22
23
|
* @param {Camera} camera - The camera the bundle group is rendered with.
|
|
24
|
+
* @param {RenderContext} renderContext - The render context the bundle is rendered with.
|
|
23
25
|
* @return {RenderBundle} The render bundle.
|
|
24
26
|
*/
|
|
25
|
-
get(bundleGroup: BundleGroup, camera: Camera): RenderBundle;
|
|
27
|
+
get(bundleGroup: BundleGroup, camera: Camera, renderContext: RenderContext): RenderBundle;
|
|
26
28
|
/**
|
|
27
29
|
* Frees all internal resources.
|
|
28
30
|
*/
|
|
@@ -39,7 +39,7 @@ declare class RenderObject {
|
|
|
39
39
|
/**
|
|
40
40
|
* Constructs a new render object.
|
|
41
41
|
*
|
|
42
|
-
* @param {
|
|
42
|
+
* @param {NodeManager} nodes - Renderer component for managing nodes related logic.
|
|
43
43
|
* @param {Geometries} geometries - Renderer component for managing geometries.
|
|
44
44
|
* @param {Renderer} renderer - The renderer.
|
|
45
45
|
* @param {Object3D} object - The 3D object.
|
|
@@ -66,7 +66,7 @@ declare class RenderObject {
|
|
|
66
66
|
/**
|
|
67
67
|
* Renderer component for managing nodes related logic.
|
|
68
68
|
*
|
|
69
|
-
* @type {
|
|
69
|
+
* @type {NodeManager}
|
|
70
70
|
* @private
|
|
71
71
|
*/
|
|
72
72
|
private _nodes;
|
|
@@ -24,7 +24,7 @@ declare class RenderObjects {
|
|
|
24
24
|
* Constructs a new render object management component.
|
|
25
25
|
*
|
|
26
26
|
* @param {Renderer} renderer - The renderer.
|
|
27
|
-
* @param {
|
|
27
|
+
* @param {NodeManager} nodes - Renderer component for managing nodes related logic.
|
|
28
28
|
* @param {Geometries} geometries - Renderer component for managing geometries.
|
|
29
29
|
* @param {Pipelines} pipelines - Renderer component for managing pipelines.
|
|
30
30
|
* @param {Bindings} bindings - Renderer component for managing bindings.
|
|
@@ -47,7 +47,7 @@ declare class RenderObjects {
|
|
|
47
47
|
/**
|
|
48
48
|
* Renderer component for managing nodes related logic.
|
|
49
49
|
*
|
|
50
|
-
* @type {
|
|
50
|
+
* @type {NodeManager}
|
|
51
51
|
*/
|
|
52
52
|
nodes: NodeManager;
|
|
53
53
|
/**
|
|
@@ -120,7 +120,7 @@ declare class RenderObjects {
|
|
|
120
120
|
/**
|
|
121
121
|
* Factory method for creating render objects with the given list of parameters.
|
|
122
122
|
*
|
|
123
|
-
* @param {
|
|
123
|
+
* @param {NodeManager} nodes - Renderer component for managing nodes related logic.
|
|
124
124
|
* @param {Geometries} geometries - Renderer component for managing geometries.
|
|
125
125
|
* @param {Renderer} renderer - The renderer.
|
|
126
126
|
* @param {Object3D} object - The 3D object.
|
|
@@ -27,8 +27,8 @@ import Info from "./Info.js";
|
|
|
27
27
|
import InspectorBase from "./InspectorBase.js";
|
|
28
28
|
import Lighting from "./Lighting.js";
|
|
29
29
|
import NodeLibrary from "./nodes/NodeLibrary.js";
|
|
30
|
+
import ReadbackBuffer from "./ReadbackBuffer.js";
|
|
30
31
|
import { RenderItem } from "./RenderList.js";
|
|
31
|
-
import StorageBufferAttribute from "./StorageBufferAttribute.js";
|
|
32
32
|
import XRManager from "./XRManager.js";
|
|
33
33
|
|
|
34
34
|
interface DeviceLostInfo {
|
|
@@ -359,13 +359,14 @@ declare class Renderer {
|
|
|
359
359
|
*/
|
|
360
360
|
private _background;
|
|
361
361
|
/**
|
|
362
|
+
* Cache for the fullscreen quad.
|
|
362
363
|
* This fullscreen quad is used for internal render passes
|
|
363
364
|
* like the tone mapping and color space output pass.
|
|
364
365
|
*
|
|
365
366
|
* @private
|
|
366
|
-
* @type {QuadMesh}
|
|
367
|
+
* @type {Map<Texture,QuadMesh>}
|
|
367
368
|
*/
|
|
368
|
-
private
|
|
369
|
+
private _quadCache;
|
|
369
370
|
/**
|
|
370
371
|
* A reference to the current render context.
|
|
371
372
|
*
|
|
@@ -391,13 +392,12 @@ declare class Renderer {
|
|
|
391
392
|
*/
|
|
392
393
|
private _transparentSort;
|
|
393
394
|
/**
|
|
394
|
-
*
|
|
395
|
+
* Cache of framebuffer targets per canvas target.
|
|
395
396
|
*
|
|
396
397
|
* @private
|
|
397
|
-
* @type {
|
|
398
|
-
* @default null
|
|
398
|
+
* @type {Map<CanvasTarget, RenderTarget>}
|
|
399
399
|
*/
|
|
400
|
-
private
|
|
400
|
+
private _frameBufferTargets;
|
|
401
401
|
/**
|
|
402
402
|
* The clear color value.
|
|
403
403
|
*
|
|
@@ -865,10 +865,24 @@ declare class Renderer {
|
|
|
865
865
|
* from the GPU to the CPU in context of compute shaders.
|
|
866
866
|
*
|
|
867
867
|
* @async
|
|
868
|
-
* @param {
|
|
869
|
-
* @
|
|
870
|
-
|
|
871
|
-
|
|
868
|
+
* @param {BufferAttribute} attribute - The storage buffer attribute to read frm.
|
|
869
|
+
* @param {ReadbackBuffer|ArrayBuffer} target - The storage buffer attribute.
|
|
870
|
+
* @param {number} offset - The storage buffer attribute.
|
|
871
|
+
* @param {number} count - The offset from which to start reading the
|
|
872
|
+
* @return {Promise<ArrayBuffer|ReadbackBuffer>} A promise that resolves with the buffer data when the data are ready.
|
|
873
|
+
*/
|
|
874
|
+
getArrayBufferAsync(
|
|
875
|
+
attribute: BufferAttribute,
|
|
876
|
+
target?: null,
|
|
877
|
+
offset?: number,
|
|
878
|
+
count?: number,
|
|
879
|
+
): Promise<ArrayBuffer>;
|
|
880
|
+
getArrayBufferAsync<TTarget extends ReadbackBuffer | ArrayBuffer>(
|
|
881
|
+
attribute: BufferAttribute,
|
|
882
|
+
target: TTarget,
|
|
883
|
+
offset?: number,
|
|
884
|
+
count?: number,
|
|
885
|
+
): Promise<TTarget>;
|
|
872
886
|
/**
|
|
873
887
|
* Returns the rendering context.
|
|
874
888
|
*
|
|
@@ -984,7 +998,7 @@ declare class Renderer {
|
|
|
984
998
|
* Defines the viewport.
|
|
985
999
|
*
|
|
986
1000
|
* @param {number} x - The horizontal coordinate for the upper left corner of the viewport origin in logical pixel unit.
|
|
987
|
-
* @param {number} y - The vertical coordinate for the upper left corner of the viewport origin
|
|
1001
|
+
* @param {number} y - The vertical coordinate for the upper left corner of the viewport origin in logical pixel unit.
|
|
988
1002
|
* @param {number} width - The width of the viewport in logical pixel unit.
|
|
989
1003
|
* @param {number} height - The height of the viewport in logical pixel unit.
|
|
990
1004
|
* @param {number} minDepth - The minimum depth value of the viewport. WebGPU only.
|
|
@@ -1171,9 +1185,9 @@ declare class Renderer {
|
|
|
1171
1185
|
/**
|
|
1172
1186
|
* Sets the output render target for the renderer.
|
|
1173
1187
|
*
|
|
1174
|
-
* @param {
|
|
1188
|
+
* @param {?RenderTarget} renderTarget - The render target to set as the output target.
|
|
1175
1189
|
*/
|
|
1176
|
-
setOutputRenderTarget(renderTarget: RenderTarget): void;
|
|
1190
|
+
setOutputRenderTarget(renderTarget: RenderTarget | null): void;
|
|
1177
1191
|
/**
|
|
1178
1192
|
* Returns the current output target.
|
|
1179
1193
|
*
|
|
@@ -1461,8 +1475,7 @@ declare class Renderer {
|
|
|
1461
1475
|
passId?: string | null,
|
|
1462
1476
|
): void;
|
|
1463
1477
|
/**
|
|
1464
|
-
* Checks if the given compatibility is supported by the selected backend.
|
|
1465
|
-
* renderer has not been initialized, this method always returns `false`.
|
|
1478
|
+
* Checks if the given compatibility is supported by the selected backend.
|
|
1466
1479
|
*
|
|
1467
1480
|
* @param {string} name - The compatibility's name.
|
|
1468
1481
|
* @return {boolean} Whether the compatibility is supported or not.
|
|
@@ -33,7 +33,7 @@ export interface LayerAttributes {
|
|
|
33
33
|
*
|
|
34
34
|
* @augments EventDispatcher
|
|
35
35
|
*/
|
|
36
|
-
declare class XRManager extends EventDispatcher<
|
|
36
|
+
declare class XRManager<TEventMap extends XRManagerEventMap = XRManagerEventMap> extends EventDispatcher<TEventMap> {
|
|
37
37
|
/**
|
|
38
38
|
* Constructs a new XR manager.
|
|
39
39
|
*
|
|
@@ -162,12 +162,6 @@ declare class XRManager extends EventDispatcher<XRManagerEventMap> {
|
|
|
162
162
|
* @readonly
|
|
163
163
|
*/
|
|
164
164
|
private readonly _supportsGlBinding;
|
|
165
|
-
_frameBufferTargets:
|
|
166
|
-
| WeakMap<XRRenderTarget, {
|
|
167
|
-
frameBufferTarget: RenderTarget | null;
|
|
168
|
-
quad: QuadMesh;
|
|
169
|
-
}>
|
|
170
|
-
| null;
|
|
171
165
|
/**
|
|
172
166
|
* Helper function to create native WebXR Layer.
|
|
173
167
|
*
|
|
@@ -74,6 +74,20 @@ declare class NodeManager extends DataMap {
|
|
|
74
74
|
* @type {ChainMap}
|
|
75
75
|
*/
|
|
76
76
|
groupsData: ChainMap;
|
|
77
|
+
/**
|
|
78
|
+
* Queue for pending async builds to limit concurrent compilation.
|
|
79
|
+
*
|
|
80
|
+
* @private
|
|
81
|
+
* @type {Array<Function>}
|
|
82
|
+
*/
|
|
83
|
+
private _buildQueue;
|
|
84
|
+
/**
|
|
85
|
+
* Whether an async build is currently in progress.
|
|
86
|
+
*
|
|
87
|
+
* @private
|
|
88
|
+
* @type {boolean}
|
|
89
|
+
*/
|
|
90
|
+
private _buildInProgress;
|
|
77
91
|
/**
|
|
78
92
|
* A cache for managing node objects of
|
|
79
93
|
* scene properties like fog or environments.
|
|
@@ -97,13 +111,47 @@ declare class NodeManager extends DataMap {
|
|
|
97
111
|
* @return {number} The cache key.
|
|
98
112
|
*/
|
|
99
113
|
getForRenderCacheKey(renderObject: RenderObject): number;
|
|
114
|
+
/**
|
|
115
|
+
* Creates a node builder configured for the given render object and material.
|
|
116
|
+
*
|
|
117
|
+
* @private
|
|
118
|
+
* @param {RenderObject} renderObject - The render object.
|
|
119
|
+
* @param {Material} material - The material to use.
|
|
120
|
+
* @return {NodeBuilder} The configured node builder.
|
|
121
|
+
*/
|
|
122
|
+
private _createNodeBuilder;
|
|
100
123
|
/**
|
|
101
124
|
* Returns a node builder state for the given render object.
|
|
102
125
|
*
|
|
103
126
|
* @param {RenderObject} renderObject - The render object.
|
|
104
|
-
* @
|
|
127
|
+
* @param {boolean} [useAsync=false] - Whether to use async build with yielding.
|
|
128
|
+
* @return {NodeBuilderState|Promise<NodeBuilderState>} The node builder state (or Promise if async).
|
|
105
129
|
*/
|
|
106
|
-
getForRender(renderObject: RenderObject): NodeBuilderState
|
|
130
|
+
getForRender(renderObject: RenderObject, useAsync?: boolean): NodeBuilderState | Promise<NodeBuilderState>;
|
|
131
|
+
/**
|
|
132
|
+
* Async version of getForRender() that yields to main thread during build.
|
|
133
|
+
* Use this in compileAsync() to prevent blocking the main thread.
|
|
134
|
+
*
|
|
135
|
+
* @param {RenderObject} renderObject - The render object.
|
|
136
|
+
* @return {Promise<NodeBuilderState>} A promise that resolves to the node builder state.
|
|
137
|
+
*/
|
|
138
|
+
getForRenderAsync(renderObject: RenderObject): Promise<NodeBuilderState>;
|
|
139
|
+
/**
|
|
140
|
+
* Returns nodeBuilderState if ready, null if pending async build.
|
|
141
|
+
* Queues async build on first call for cache miss.
|
|
142
|
+
* Use this in render() path to enable non-blocking compilation.
|
|
143
|
+
*
|
|
144
|
+
* @param {RenderObject} renderObject - The render object.
|
|
145
|
+
* @return {?NodeBuilderState} The node builder state, or null if still building.
|
|
146
|
+
*/
|
|
147
|
+
getForRenderDeferred(renderObject: RenderObject): NodeBuilderState | null;
|
|
148
|
+
/**
|
|
149
|
+
* Processes the build queue one item at a time.
|
|
150
|
+
* This ensures builds don't all run simultaneously and freeze the main thread.
|
|
151
|
+
*
|
|
152
|
+
* @private
|
|
153
|
+
*/
|
|
154
|
+
private _processBuildQueue;
|
|
107
155
|
/**
|
|
108
156
|
* Deletes the given object from the internal data map
|
|
109
157
|
*
|
|
@@ -213,14 +261,6 @@ declare class NodeManager extends DataMap {
|
|
|
213
261
|
* @return {string} The output cache key.
|
|
214
262
|
*/
|
|
215
263
|
getOutputCacheKey(): string;
|
|
216
|
-
/**
|
|
217
|
-
* Checks if the output configuration (tone mapping and color space) for
|
|
218
|
-
* the given target has changed.
|
|
219
|
-
*
|
|
220
|
-
* @param {Texture} outputTarget - The output target.
|
|
221
|
-
* @return {boolean} Whether the output configuration has changed or not.
|
|
222
|
-
*/
|
|
223
|
-
hasOutputChange(outputTarget: Texture): boolean;
|
|
224
264
|
/**
|
|
225
265
|
* Returns a node that represents the output configuration (tone mapping and
|
|
226
266
|
* color space) for the current target.
|
|
@@ -252,7 +292,7 @@ declare class NodeManager extends DataMap {
|
|
|
252
292
|
updateForCompute(computeNode: ComputeNode): void;
|
|
253
293
|
/**
|
|
254
294
|
* Triggers the call of `update()` methods
|
|
255
|
-
* for all nodes of the given
|
|
295
|
+
* for all nodes of the given render object.
|
|
256
296
|
*
|
|
257
297
|
* @param {RenderObject} renderObject - The render object.
|
|
258
298
|
*/
|
|
@@ -55,6 +55,7 @@ export const ShaderChunk: {
|
|
|
55
55
|
lights_fragment_begin: string;
|
|
56
56
|
lights_fragment_maps: string;
|
|
57
57
|
lights_fragment_end: string;
|
|
58
|
+
lightprobes_pars_fragment: string;
|
|
58
59
|
logdepthbuf_fragment: string;
|
|
59
60
|
logdepthbuf_pars_fragment: string;
|
|
60
61
|
logdepthbuf_pars_vertex: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Color } from "../../math/Color.js";
|
|
2
2
|
import { Matrix3 } from "../../math/Matrix3.js";
|
|
3
3
|
import { Vector2 } from "../../math/Vector2.js";
|
|
4
|
+
import { Vector3 } from "../../math/Vector3.js";
|
|
4
5
|
|
|
5
6
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
6
7
|
export interface IUniform<TValue = any> {
|
|
@@ -24,7 +25,6 @@ export const UniformsLib: {
|
|
|
24
25
|
envmap: {
|
|
25
26
|
envMap: IUniform<unknown>;
|
|
26
27
|
envMapRotation: IUniform<Matrix3>;
|
|
27
|
-
flipEnvMap: IUniform<number>;
|
|
28
28
|
reflectivity: IUniform<number>;
|
|
29
29
|
ior: IUniform<number>;
|
|
30
30
|
refractRatio: IUniform<number>;
|
|
@@ -162,6 +162,10 @@ export const UniformsLib: {
|
|
|
162
162
|
};
|
|
163
163
|
ltc_1: IUniform<unknown>;
|
|
164
164
|
ltc_2: IUniform<unknown>;
|
|
165
|
+
probesSH: IUniform<unknown>;
|
|
166
|
+
probesMin: IUniform<Vector3>;
|
|
167
|
+
probesMax: IUniform<Vector3>;
|
|
168
|
+
probesResolution: IUniform<Vector3>;
|
|
165
169
|
};
|
|
166
170
|
points: {
|
|
167
171
|
diffuse: IUniform<Color>;
|
|
@@ -12,10 +12,4 @@ export class WebGLBufferRenderer {
|
|
|
12
12
|
render: (start: any, count: number) => void;
|
|
13
13
|
renderInstances: (start: any, count: number, primcount: number) => void;
|
|
14
14
|
renderMultiDraw: (starts: Int32Array, counts: Int32Array, drawCount: number) => void;
|
|
15
|
-
renderMultiDrawInstances: (
|
|
16
|
-
starts: Int32Array,
|
|
17
|
-
counts: Int32Array,
|
|
18
|
-
drawCount: number,
|
|
19
|
-
primcount: Int32Array,
|
|
20
|
-
) => void;
|
|
21
15
|
}
|
|
@@ -10,10 +10,4 @@ export class WebGLIndexedBufferRenderer {
|
|
|
10
10
|
render: (start: number, count: number) => void;
|
|
11
11
|
renderInstances: (start: number, count: number, primcount: number) => void;
|
|
12
12
|
renderMultiDraw: (starts: Int32Array, counts: Int32Array, drawCount: number) => void;
|
|
13
|
-
renderMultiDrawInstances: (
|
|
14
|
-
starts: Int32Array,
|
|
15
|
-
counts: Int32Array,
|
|
16
|
-
drawCount: number,
|
|
17
|
-
primcount: Int32Array,
|
|
18
|
-
) => void;
|
|
19
13
|
}
|
|
@@ -53,6 +53,7 @@ export interface WebGLProgramParameters {
|
|
|
53
53
|
|
|
54
54
|
normalMapObjectSpace: boolean;
|
|
55
55
|
normalMapTangentSpace: boolean;
|
|
56
|
+
packedNormalMap: boolean;
|
|
56
57
|
|
|
57
58
|
metalnessMap: boolean;
|
|
58
59
|
roughnessMap: boolean;
|
|
@@ -130,6 +131,7 @@ export interface WebGLProgramParameters {
|
|
|
130
131
|
//
|
|
131
132
|
|
|
132
133
|
vertexTangents: boolean;
|
|
134
|
+
vertexNormals: boolean;
|
|
133
135
|
vertexColors: boolean;
|
|
134
136
|
vertexAlphas: boolean;
|
|
135
137
|
vertexUv1s: boolean;
|
|
@@ -170,6 +172,8 @@ export interface WebGLProgramParameters {
|
|
|
170
172
|
|
|
171
173
|
numLightProbes: number;
|
|
172
174
|
|
|
175
|
+
numLightProbeGrids: number;
|
|
176
|
+
|
|
173
177
|
numClippingPlanes: number;
|
|
174
178
|
numClipIntersection: number;
|
|
175
179
|
|
|
@@ -223,6 +227,7 @@ export class WebGLPrograms {
|
|
|
223
227
|
shadows: Light[],
|
|
224
228
|
scene: Scene,
|
|
225
229
|
object: Object3D,
|
|
230
|
+
lightProbeGrids: unknown[],
|
|
226
231
|
): WebGLProgramParameters;
|
|
227
232
|
|
|
228
233
|
getProgramCacheKey(parameters: WebGLProgramParameters): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Object3D } from "../../../core/Object3D.js";
|
|
2
|
+
import { NodeShaderStage } from "../../../nodes/core/constants.js";
|
|
3
|
+
import NodeBuilder from "../../../nodes/core/NodeBuilder.js";
|
|
4
|
+
import Renderer from "../../common/Renderer.js";
|
|
5
|
+
|
|
6
|
+
declare class GLSLNodeBuilder extends NodeBuilder {
|
|
7
|
+
constructor(object: Object3D, renderer: Renderer);
|
|
8
|
+
|
|
9
|
+
getUniforms(shaderStage: NodeShaderStage): string;
|
|
10
|
+
getAttributes(shaderStage: NodeShaderStage): string;
|
|
11
|
+
getVaryings(shaderStage: NodeShaderStage): string;
|
|
12
|
+
getInstanceIndex(): string;
|
|
13
|
+
getDrawIndex(): string | null;
|
|
14
|
+
getFrontFacing(): string;
|
|
15
|
+
getFragCoord(): string;
|
|
16
|
+
buildCode(): void;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default GLSLNodeBuilder;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import WebGLBackend from "../WebGLBackend.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A WebGL 2 backend utility module for managing the device's capabilities.
|
|
5
|
+
*
|
|
6
|
+
* @private
|
|
7
|
+
*/
|
|
8
|
+
declare class WebGLCapabilities {
|
|
9
|
+
/**
|
|
10
|
+
* Constructs a new utility object.
|
|
11
|
+
*
|
|
12
|
+
* @param {WebGLBackend} backend - The WebGL 2 backend.
|
|
13
|
+
*/
|
|
14
|
+
constructor(backend: WebGLBackend);
|
|
15
|
+
/**
|
|
16
|
+
* A reference to the WebGL 2 backend.
|
|
17
|
+
*
|
|
18
|
+
* @type {WebGLBackend}
|
|
19
|
+
*/
|
|
20
|
+
backend: WebGLBackend;
|
|
21
|
+
/**
|
|
22
|
+
* This value holds the cached max anisotropy value.
|
|
23
|
+
*
|
|
24
|
+
* @type {?number}
|
|
25
|
+
* @default null
|
|
26
|
+
*/
|
|
27
|
+
maxAnisotropy: number | null;
|
|
28
|
+
/**
|
|
29
|
+
* This value holds the cached max uniform block size value.
|
|
30
|
+
*
|
|
31
|
+
* @type {?number}
|
|
32
|
+
* @default null
|
|
33
|
+
*/
|
|
34
|
+
maxUniformBlockSize: number | null;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the maximum anisotropy texture filtering value. This value
|
|
37
|
+
* depends on the device and is reported by the `EXT_texture_filter_anisotropic`
|
|
38
|
+
* WebGL extension.
|
|
39
|
+
*
|
|
40
|
+
* @return {number} The maximum anisotropy texture filtering value.
|
|
41
|
+
*/
|
|
42
|
+
getMaxAnisotropy(): number;
|
|
43
|
+
/**
|
|
44
|
+
* Returns the maximum number of bytes available for uniform buffers.
|
|
45
|
+
*
|
|
46
|
+
* @return {number} The maximum number of bytes available for uniform buffers.
|
|
47
|
+
*/
|
|
48
|
+
getUniformBufferLimit(): number;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default WebGLCapabilities;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
/// <reference types="@webgpu/types" />
|
|
2
|
-
|
|
3
1
|
import { CoordinateSystem, HalfFloatType, UnsignedByteType } from "../../constants.js";
|
|
4
2
|
import Backend, { BackendParameters } from "../common/Backend.js";
|
|
5
3
|
|
|
4
|
+
interface GPUDevice {}
|
|
5
|
+
|
|
6
|
+
interface GPUCanvasContext {}
|
|
7
|
+
|
|
6
8
|
export interface WebGPUBackendParameters extends BackendParameters {
|
|
7
9
|
alpha?: boolean | undefined;
|
|
8
|
-
requiredLimits?: Record<string,
|
|
10
|
+
requiredLimits?: Record<string, number> | undefined;
|
|
9
11
|
trackTimestamp?: boolean | undefined;
|
|
10
12
|
device?: GPUDevice | undefined;
|
|
11
|
-
powerPreference?:
|
|
13
|
+
powerPreference?:
|
|
14
|
+
| "low-power"
|
|
15
|
+
| "high-performance"
|
|
16
|
+
| undefined;
|
|
12
17
|
context?: GPUCanvasContext | undefined;
|
|
13
18
|
outputType?: typeof UnsignedByteType | typeof HalfFloatType | undefined;
|
|
14
19
|
}
|
|
@@ -93,6 +93,8 @@ export enum GPUTextureFormat {
|
|
|
93
93
|
RG8Snorm = "rg8snorm",
|
|
94
94
|
RG8Uint = "rg8uint",
|
|
95
95
|
RG8Sint = "rg8sint",
|
|
96
|
+
R16Unorm = "r16unorm",
|
|
97
|
+
R16Snorm = "r16snorm",
|
|
96
98
|
|
|
97
99
|
// 32-bit formats
|
|
98
100
|
|
|
@@ -109,6 +111,8 @@ export enum GPUTextureFormat {
|
|
|
109
111
|
RGBA8Sint = "rgba8sint",
|
|
110
112
|
BGRA8Unorm = "bgra8unorm",
|
|
111
113
|
BGRA8UnormSRGB = "bgra8unorm-srgb",
|
|
114
|
+
RG16Unorm = "rg16unorm",
|
|
115
|
+
RG16Snorm = "rg16snorm",
|
|
112
116
|
// Packed 32-bit formats
|
|
113
117
|
RGB9E5UFloat = "rgb9e5ufloat",
|
|
114
118
|
RGB10A2Unorm = "rgb10a2unorm",
|
|
@@ -122,6 +126,8 @@ export enum GPUTextureFormat {
|
|
|
122
126
|
RGBA16Uint = "rgba16uint",
|
|
123
127
|
RGBA16Sint = "rgba16sint",
|
|
124
128
|
RGBA16Float = "rgba16float",
|
|
129
|
+
RGBA16Unorm = "rgba16unorm",
|
|
130
|
+
RGBA16Snorm = "rgba16snorm",
|
|
125
131
|
|
|
126
132
|
// 128-bit formats
|
|
127
133
|
|
|
@@ -43,7 +43,11 @@ export class XRTargetRaySpace extends Group<WebXRSpaceEventMap> {
|
|
|
43
43
|
readonly angularVelocity: Vector3;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
export
|
|
46
|
+
export interface WebXRGripSpaceEventMap extends WebXRSpaceEventMap {
|
|
47
|
+
gripUpdated: { data: XRInputSource; target: WebXRController }; // This Event break the THREE.EventDispatcher contract, replacing the target to the wrong instance.
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export class XRGripSpace extends Group<WebXRGripSpaceEventMap> {
|
|
47
51
|
hasLinearVelocity: boolean;
|
|
48
52
|
readonly linearVelocity: Vector3;
|
|
49
53
|
hasAngularVelocity: boolean;
|
|
@@ -21,7 +21,9 @@ export interface WebXRManagerEventMap {
|
|
|
21
21
|
planesdetected: { data: XRPlaneSet };
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export class WebXRManager extends
|
|
24
|
+
export class WebXRManager<TEventMap extends WebXRManagerEventMap = WebXRManagerEventMap>
|
|
25
|
+
extends EventDispatcher<TEventMap>
|
|
26
|
+
{
|
|
25
27
|
/**
|
|
26
28
|
* @default true
|
|
27
29
|
*/
|
three/src/scenes/Scene.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSONMeta, Object3D, Object3DJSON, Object3DJSONObject } from "../core/Object3D.js";
|
|
1
|
+
import { JSONMeta, Object3D, Object3DEventMap, Object3DJSON, Object3DJSONObject } from "../core/Object3D.js";
|
|
2
2
|
import { Material } from "../materials/Material.js";
|
|
3
3
|
import { Color } from "../math/Color.js";
|
|
4
4
|
import { Euler, EulerTuple } from "../math/Euler.js";
|
|
@@ -25,7 +25,7 @@ export interface SceneJSON extends Object3DJSON {
|
|
|
25
25
|
* Scenes allow you to set up what is to be rendered and where by three.js.
|
|
26
26
|
* This is where you place 3D objects like meshes, lines or lights.
|
|
27
27
|
*/
|
|
28
|
-
export class Scene extends Object3D {
|
|
28
|
+
export class Scene<TEventMap extends Object3DEventMap = Object3DEventMap> extends Object3D<TEventMap> {
|
|
29
29
|
/**
|
|
30
30
|
* This flag can be used for type testing.
|
|
31
31
|
*
|