@types/three 0.184.1 → 0.185.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 +2 -0
- three/examples/jsm/controls/FirstPersonControls.d.ts +9 -0
- three/examples/jsm/controls/OrbitControls.d.ts +2 -2
- three/examples/jsm/controls/TransformControls.d.ts +32 -1
- three/examples/jsm/csm/CSMFrustum.d.ts +73 -13
- three/examples/jsm/exporters/DRACOExporter.d.ts +1 -1
- three/examples/jsm/exporters/GLTFExporter.d.ts +2 -2
- three/examples/jsm/exporters/PLYExporter.d.ts +5 -4
- three/examples/jsm/exporters/USDZExporter.d.ts +5 -1
- three/examples/jsm/generators/CityGenerator.d.ts +75 -0
- three/examples/jsm/generators/ForestGenerator.d.ts +79 -0
- three/examples/jsm/generators/TerrainGenerator.d.ts +67 -0
- three/examples/jsm/generators/TreeGenerator.d.ts +97 -0
- three/examples/jsm/generators/city/SidewalkGenerator.d.ts +40 -0
- three/examples/jsm/generators/city/SkyscraperGenerator.d.ts +83 -0
- three/examples/jsm/geometries/LoftGeometry.d.ts +83 -0
- three/examples/jsm/inspector/tabs/Parameters.d.ts +5 -2
- three/examples/jsm/lighting/ClusteredLighting.d.ts +45 -0
- three/examples/jsm/lighting/LightProbeGrid.d.ts +131 -13
- three/examples/jsm/loaders/DRACOLoader.d.ts +20 -6
- three/examples/jsm/loaders/EXRLoader.d.ts +2 -12
- three/examples/jsm/loaders/GLTFLoader.d.ts +1 -1
- three/examples/jsm/loaders/HDRLoader.d.ts +2 -12
- three/examples/jsm/loaders/KTX2Loader.d.ts +1 -1
- three/examples/jsm/loaders/LWOLoader.d.ts +6 -0
- three/examples/jsm/loaders/RGBELoader.d.ts +1 -7
- three/examples/jsm/loaders/SVGLoader.d.ts +9 -6
- three/examples/jsm/loaders/TGALoader.d.ts +2 -2
- three/examples/jsm/loaders/TIFFLoader.d.ts +2 -11
- three/examples/jsm/loaders/USDLoader.d.ts +6 -1
- three/examples/jsm/misc/TileCreasedNormalsPlugin.d.ts +49 -0
- three/examples/jsm/objects/MarchingCubes.d.ts +2 -2
- three/examples/jsm/objects/Reflector.d.ts +38 -5
- three/examples/jsm/objects/SkyMesh.d.ts +1 -1
- three/examples/jsm/physics/RapierPhysics.d.ts +1 -0
- three/examples/jsm/tsl/display/BloomNode.d.ts +23 -6
- three/examples/jsm/tsl/display/ImportanceSampledEnvironment.d.ts +84 -0
- three/examples/jsm/tsl/display/RecurrentDenoiseNode.d.ts +89 -0
- three/examples/jsm/tsl/display/SSAAPassNode.d.ts +0 -2
- three/examples/jsm/tsl/display/SSGINode.d.ts +4 -1
- three/examples/jsm/tsl/display/SSRNode.d.ts +303 -30
- three/examples/jsm/tsl/display/TRAANode.d.ts +1 -1
- three/examples/jsm/tsl/display/TemporalReprojectNode.d.ts +64 -0
- three/examples/jsm/tsl/lighting/ClusteredLightsNode.d.ts +54 -0
- three/examples/jsm/tsl/math/curlNoise.d.ts +38 -0
- three/examples/jsm/tsl/utils/GroundedSkybox.d.ts +17 -0
- three/examples/jsm/tsl/utils/RNoise.d.ts +12 -0
- three/examples/jsm/tsl/utils/SpecularHelpers.d.ts +20 -0
- three/examples/jsm/webxr/WebGLXRFallback.d.ts +14 -0
- three/package.json +3 -3
- three/src/Three.TSL.d.ts +10 -3
- three/src/Three.WebGPU.Nodes.d.ts +2 -2
- three/src/Three.WebGPU.d.ts +5 -3
- three/src/animation/AnimationClip.d.ts +0 -10
- three/src/cameras/Camera.d.ts +1 -1
- three/src/core/InterleavedBuffer.d.ts +1 -1
- three/src/core/Object3D.d.ts +8 -4
- three/src/core/RenderTarget.d.ts +11 -0
- three/src/core/Timer.d.ts +1 -1
- three/src/core/UniformsGroup.d.ts +1 -1
- three/src/extras/Controls.d.ts +6 -5
- three/src/extras/core/ShapePath.d.ts +61 -65
- three/src/loaders/DataTextureLoader.d.ts +37 -3
- three/src/loaders/MaterialLoader.d.ts +8 -0
- three/src/materials/LineBasicMaterial.d.ts +5 -0
- three/src/materials/Material.d.ts +9 -1
- three/src/materials/MeshBasicMaterial.d.ts +30 -0
- three/src/materials/MeshDepthMaterial.d.ts +13 -0
- three/src/materials/MeshDistanceMaterial.d.ts +13 -0
- three/src/materials/MeshLambertMaterial.d.ts +50 -1
- three/src/materials/MeshMatcapMaterial.d.ts +31 -1
- three/src/materials/MeshNormalMaterial.d.ts +11 -1
- three/src/materials/MeshPhongMaterial.d.ts +50 -1
- three/src/materials/MeshPhysicalMaterial.d.ts +50 -0
- three/src/materials/MeshStandardMaterial.d.ts +53 -1
- three/src/materials/MeshToonMaterial.d.ts +43 -1
- three/src/materials/PointsMaterial.d.ts +9 -0
- three/src/materials/ShaderMaterial.d.ts +2 -0
- three/src/materials/SpriteMaterial.d.ts +9 -0
- three/src/materials/nodes/Line2NodeMaterial.d.ts +18 -13
- three/src/materials/nodes/NodeMaterial.d.ts +33 -13
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +0 -84
- three/src/math/Box2.d.ts +3 -3
- three/src/math/Box3.d.ts +255 -19
- three/src/math/Color.d.ts +10 -10
- three/src/math/FrustumArray.d.ts +75 -16
- three/src/math/Interpolant.d.ts +111 -8
- three/src/math/Matrix3.d.ts +9 -0
- three/src/math/Matrix4.d.ts +329 -105
- three/src/math/Vector3.d.ts +2 -2
- three/src/math/interpolants/BezierInterpolant.d.ts +19 -3
- three/src/math/interpolants/CubicInterpolant.d.ts +18 -3
- three/src/math/interpolants/DiscreteInterpolant.d.ts +8 -3
- three/src/math/interpolants/LinearInterpolant.d.ts +7 -3
- three/src/math/interpolants/QuaternionLinearInterpolant.d.ts +7 -3
- three/src/nodes/Nodes.d.ts +4 -13
- three/src/nodes/TSL.d.ts +7 -5
- three/src/nodes/accessors/Batch.d.ts +19 -0
- three/src/nodes/accessors/Instance.d.ts +34 -0
- three/src/nodes/accessors/MaterialNode.d.ts +86 -79
- three/src/nodes/accessors/Morph.d.ts +11 -0
- three/src/nodes/accessors/Skinning.d.ts +23 -0
- three/src/nodes/accessors/StorageBufferNode.d.ts +22 -23
- three/src/nodes/accessors/StorageTexture3DNode.d.ts +17 -0
- three/src/nodes/accessors/StorageTextureNode.d.ts +6 -4
- three/src/nodes/accessors/TextureNode.d.ts +15 -10
- three/src/nodes/core/ArrayNode.d.ts +16 -8
- three/src/nodes/core/ContextNode.d.ts +5 -6
- three/src/nodes/core/LightingModel.d.ts +2 -0
- three/src/nodes/core/Node.d.ts +50 -51
- three/src/nodes/core/NodeBuilder.d.ts +1 -133
- three/src/nodes/core/OverrideContextNode.d.ts +92 -0
- three/src/nodes/core/PropertyNode.d.ts +13 -2
- three/src/nodes/core/StructNode.d.ts +0 -2
- three/src/nodes/core/StructTypeNode.d.ts +5 -4
- three/src/nodes/core/UniformNode.d.ts +48 -9
- three/src/nodes/display/BlendModes.d.ts +72 -11
- three/src/nodes/display/FrontFacingNode.d.ts +62 -3
- three/src/nodes/display/PassNode.d.ts +0 -2
- three/src/nodes/display/PremultiplyAlphaFunctions.d.ts +37 -0
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +53 -45
- three/src/nodes/lighting/LightingContextNode.d.ts +9 -2
- three/src/nodes/lighting/LightsNode.d.ts +4 -4
- three/src/nodes/math/MathNode.d.ts +358 -304
- three/src/nodes/math/OperatorNode.d.ts +253 -82
- three/src/nodes/tsl/TSLCore.d.ts +16 -9
- three/src/nodes/utils/ArrayElementNode.d.ts +5 -4
- three/src/nodes/utils/EquirectUV.d.ts +31 -1
- three/src/nodes/utils/Packing.d.ts +50 -3
- three/src/nodes/utils/RTTNode.d.ts +7 -12
- three/src/nodes/utils/Remap.d.ts +216 -29
- three/src/nodes/utils/SampleNode.d.ts +18 -8
- three/src/objects/BatchedMesh.d.ts +1 -1
- three/src/objects/InstancedMesh.d.ts +0 -8
- three/src/objects/Skeleton.d.ts +0 -2
- three/src/renderers/common/Backend.d.ts +0 -3
- three/src/renderers/common/CanvasTarget.d.ts +0 -49
- three/src/renderers/common/ClippingContext.d.ts +6 -1
- three/src/renderers/common/CubeRenderTarget.d.ts +2 -1
- three/src/renderers/common/Info.d.ts +26 -66
- three/src/renderers/common/InspectorBase.d.ts +0 -7
- three/src/renderers/common/Lighting.d.ts +49 -5
- three/src/renderers/common/Renderer.d.ts +34 -458
- three/src/renderers/common/RendererUtils.d.ts +1 -2
- three/src/renderers/common/TimestampQueryPool.d.ts +1 -1
- three/src/renderers/common/XRManager.d.ts +32 -299
- three/src/renderers/common/nodes/NodeLibrary.d.ts +0 -117
- three/src/renderers/webgl/WebGLPrograms.d.ts +2 -0
- three/src/renderers/webgl/WebGLRenderLists.d.ts +5 -1
- three/src/renderers/webgl/WebGLState.d.ts +2 -0
- three/src/renderers/webgl-fallback/WebGLBackend.d.ts +1 -1
- three/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts +0 -10
- three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +0 -1
- three/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +5 -121
- three/src/textures/CubeDepthTexture.d.ts +2 -3
- three/src/textures/DataTexture.d.ts +2 -1
- three/src/textures/DepthTexture.d.ts +5 -5
- three/examples/jsm/lighting/TiledLighting.d.ts +0 -9
- three/examples/jsm/tsl/display/AnamorphicNode.d.ts +0 -31
- three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +0 -22
- three/src/nodes/accessors/BatchNode.d.ts +0 -12
- three/src/nodes/accessors/InstanceNode.d.ts +0 -30
- three/src/nodes/accessors/InstancedMeshNode.d.ts +0 -10
- three/src/nodes/accessors/MorphNode.d.ts +0 -14
- three/src/nodes/accessors/SkinningNode.d.ts +0 -32
- three/src/renderers/common/Animation.d.ts +0 -102
- three/src/renderers/common/Attributes.d.ts +0 -59
- three/src/renderers/common/Background.d.ts +0 -47
- three/src/renderers/common/BindGroup.d.ts +0 -39
- three/src/renderers/common/Binding.d.ts +0 -50
- three/src/renderers/common/Bindings.d.ts +0 -132
- three/src/renderers/common/Buffer.d.ts +0 -90
- three/src/renderers/common/ChainMap.d.ts +0 -49
- three/src/renderers/common/Color4.d.ts +0 -55
- three/src/renderers/common/ComputePipeline.d.ts +0 -34
- three/src/renderers/common/DataMap.d.ts +0 -42
- three/src/renderers/common/Geometries.d.ts +0 -111
- three/src/renderers/common/Pipeline.d.ts +0 -29
- three/src/renderers/common/Pipelines.d.ts +0 -186
- three/src/renderers/common/ProgrammableStage.d.ts +0 -73
- three/src/renderers/common/RenderBundle.d.ts +0 -25
- three/src/renderers/common/RenderBundles.d.ts +0 -34
- three/src/renderers/common/RenderContext.d.ts +0 -235
- three/src/renderers/common/RenderContexts.d.ts +0 -47
- three/src/renderers/common/RenderList.d.ts +0 -226
- three/src/renderers/common/RenderLists.d.ts +0 -46
- three/src/renderers/common/RenderObject.d.ts +0 -448
- three/src/renderers/common/RenderObjectPipeline.d.ts +0 -33
- three/src/renderers/common/RenderObjects.d.ts +0 -151
- three/src/renderers/common/SampledTexture.d.ts +0 -28
- three/src/renderers/common/Sampler.d.ts +0 -19
- three/src/renderers/common/Textures.d.ts +0 -125
- three/src/renderers/common/Uniform.d.ts +0 -262
- three/src/renderers/common/UniformBuffer.d.ts +0 -20
- three/src/renderers/common/UniformsGroup.d.ts +0 -152
- three/src/renderers/common/XRRenderTarget.d.ts +0 -67
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +0 -121
- three/src/renderers/common/nodes/NodeManager.d.ts +0 -309
- three/src/renderers/common/nodes/NodeSampledTexture.d.ts +0 -29
- three/src/renderers/common/nodes/NodeSampler.d.ts +0 -12
- three/src/renderers/common/nodes/NodeUniform.d.ts +0 -250
- three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +0 -41
- three/src/renderers/webgpu/nodes/WGSLNodeFunction.d.ts +0 -6
- three/src/renderers/webgpu/nodes/WGSLNodeParser.d.ts +0 -6
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Camera, Node, TempNode, Texture, TextureNode, UniformNode } from "three/webgpu";
|
|
2
|
+
|
|
3
|
+
export type TemporalReprojectMode = "diffuse" | "specular";
|
|
4
|
+
|
|
5
|
+
export interface TemporalReprojectNodeOptions {
|
|
6
|
+
mode?: TemporalReprojectMode | undefined;
|
|
7
|
+
hitPointReprojection?: boolean | undefined;
|
|
8
|
+
accumulate?: boolean | undefined;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare class TemporalReprojectNode extends TempNode<"vec4"> {
|
|
12
|
+
readonly isTemporalReprojectNode: boolean;
|
|
13
|
+
|
|
14
|
+
beautyNode: Node<"vec4">;
|
|
15
|
+
depthNode: TextureNode;
|
|
16
|
+
normalNode: TextureNode;
|
|
17
|
+
velocityNode: TextureNode;
|
|
18
|
+
camera: Camera;
|
|
19
|
+
|
|
20
|
+
mode: TemporalReprojectMode;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* When `true`, resolve output is copied into the internal history buffer each frame.
|
|
24
|
+
* When `false`, history is supplied externally via {@link TemporalReprojectNode#setHistoryTexture}.
|
|
25
|
+
*
|
|
26
|
+
* @type {boolean}
|
|
27
|
+
*/
|
|
28
|
+
accumulate: boolean;
|
|
29
|
+
|
|
30
|
+
maxVelocityLength: number;
|
|
31
|
+
|
|
32
|
+
maxFrames: UniformNode<"float", number>;
|
|
33
|
+
hitPointReprojection: UniformNode<"bool", boolean>;
|
|
34
|
+
clampIntensity: UniformNode<"float", number>;
|
|
35
|
+
flickerSuppression: UniformNode<"float", number>;
|
|
36
|
+
|
|
37
|
+
constructor(
|
|
38
|
+
beautyNode: Node<"vec4">,
|
|
39
|
+
depthNode: TextureNode,
|
|
40
|
+
normalNode: TextureNode,
|
|
41
|
+
velocityNode: TextureNode,
|
|
42
|
+
camera: Camera,
|
|
43
|
+
options?: TemporalReprojectNodeOptions,
|
|
44
|
+
);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Supplies an external history source (e.g. a {@link RecurrentDenoiseNode} or its
|
|
48
|
+
* texture). Only used when {@link TemporalReprojectNode#accumulate} is `false`.
|
|
49
|
+
*
|
|
50
|
+
* @param {?(Object|Texture)} source
|
|
51
|
+
*/
|
|
52
|
+
setHistoryTexture(source: Texture | { getRenderTarget(): { texture: Texture } }): void;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default TemporalReprojectNode;
|
|
56
|
+
|
|
57
|
+
export const temporalReproject: (
|
|
58
|
+
beautyNode: Node<"vec4">,
|
|
59
|
+
depthNode: TextureNode,
|
|
60
|
+
normalNode: TextureNode,
|
|
61
|
+
velocityNode: TextureNode,
|
|
62
|
+
camera: Camera,
|
|
63
|
+
options?: TemporalReprojectNodeOptions,
|
|
64
|
+
) => TemporalReprojectNode;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Light, LightsNode, Node } from "three/webgpu";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A custom version of `LightsNode` implementing Forward+ clustered shading:
|
|
5
|
+
* the view frustum is subdivided into a 3D grid of clusters (X × Y screen tiles
|
|
6
|
+
* times an exponentially-spaced set of Z depth slices), and each cluster holds
|
|
7
|
+
* only the point lights whose spheres intersect it. At shading time each fragment
|
|
8
|
+
* looks up its cluster and loops over just that cluster's lights. Unlike 2D tiled
|
|
9
|
+
* lighting, clustered shading culls lights that share screen pixels but lie at
|
|
10
|
+
* different depths — suitable for 3D scenes with real depth complexity.
|
|
11
|
+
*
|
|
12
|
+
* @augments LightsNode
|
|
13
|
+
*/
|
|
14
|
+
declare class ClusteredLightsNode extends LightsNode {
|
|
15
|
+
materialLights: Light[];
|
|
16
|
+
clusteredLights: Light[];
|
|
17
|
+
maxLights: number;
|
|
18
|
+
tileSize: number;
|
|
19
|
+
zSlices: number;
|
|
20
|
+
maxLightsPerCluster: number;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Constructs a new clustered lights node.
|
|
24
|
+
*
|
|
25
|
+
* @param {number} [maxLights=1024] - Maximum number of point lights.
|
|
26
|
+
* @param {number} [tileSize=32] - Screen tile size in pixels (cluster XY size).
|
|
27
|
+
* @param {number} [zSlices=24] - Number of exponential depth slices.
|
|
28
|
+
* @param {number} [maxLightsPerCluster=64] - Per-cluster light-list capacity.
|
|
29
|
+
*/
|
|
30
|
+
constructor(maxLights?: number, tileSize?: number, zSlices?: number, maxLightsPerCluster?: number);
|
|
31
|
+
|
|
32
|
+
getClusterLightCount(zSliceNode: Node<"int">): Node<"int">;
|
|
33
|
+
|
|
34
|
+
setSize(width: number, height: number): this;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* TSL function that creates a clustered lights node.
|
|
39
|
+
*
|
|
40
|
+
* @function
|
|
41
|
+
* @param {number} [maxLights=1024] - Maximum number of point lights.
|
|
42
|
+
* @param {number} [tileSize=32] - Screen tile size in pixels.
|
|
43
|
+
* @param {number} [zSlices=24] - Depth slice count.
|
|
44
|
+
* @param {number} [maxLightsPerCluster=64] - Per-cluster light-list capacity.
|
|
45
|
+
* @return {ClusteredLightsNode} The clustered lights node.
|
|
46
|
+
*/
|
|
47
|
+
export const clusteredLights: (
|
|
48
|
+
maxLights?: number,
|
|
49
|
+
tileSize?: number,
|
|
50
|
+
zSlices?: number,
|
|
51
|
+
maxLightsPerCluster?: number,
|
|
52
|
+
) => ClusteredLightsNode;
|
|
53
|
+
|
|
54
|
+
export default ClusteredLightsNode;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Node, Vector3, Vector4 } from "three/webgpu";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Permutation polynomial for noise generation.
|
|
5
|
+
*
|
|
6
|
+
* @tsl
|
|
7
|
+
* @function
|
|
8
|
+
* @param {Node<vec4>} x - Input vector.
|
|
9
|
+
* @return {Node<vec4>} Permuted vector.
|
|
10
|
+
*/
|
|
11
|
+
export const permute: (x: Node<"vec4"> | Vector4) => Node<"vec4">;
|
|
12
|
+
/**
|
|
13
|
+
* 3D Simplex noise implementation in TSL.
|
|
14
|
+
*
|
|
15
|
+
* @tsl
|
|
16
|
+
* @function
|
|
17
|
+
* @param {Node<vec3>} v - Input coordinate vector.
|
|
18
|
+
* @return {Node<float>} Simplex noise value.
|
|
19
|
+
*/
|
|
20
|
+
export const snoise: (v: Node<"vec3"> | Vector3) => Node<"float">;
|
|
21
|
+
/**
|
|
22
|
+
* 3D Simplex noise vector. Returns a vec3 containing three independent noise samples.
|
|
23
|
+
*
|
|
24
|
+
* @tsl
|
|
25
|
+
* @function
|
|
26
|
+
* @param {Node<vec3>} x - Input coordinate vector.
|
|
27
|
+
* @return {Node<vec3>} Vector of three noise values.
|
|
28
|
+
*/
|
|
29
|
+
export const snoiseVec3: (x: Node<"vec3"> | Vector3) => Node<"vec3">;
|
|
30
|
+
/**
|
|
31
|
+
* 3D Curl noise in TSL. Generates a divergence-free vector field from simplex noise.
|
|
32
|
+
*
|
|
33
|
+
* @tsl
|
|
34
|
+
* @function
|
|
35
|
+
* @param {Node<vec3>} p - Input coordinate vector.
|
|
36
|
+
* @return {Node<vec3>} Curl noise vector.
|
|
37
|
+
*/
|
|
38
|
+
export const curlNoise: (p: Node<"vec3"> | Vector3) => Node<"vec3">;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Node } from "three/webgpu";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @module GroundedSkybox
|
|
5
|
+
* @three_import import { getGroundProjectedNormal } from 'three/addons/tsl/utils/GroundedSkybox.js';
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Projects the world position onto a sphere whose bottom is clipped by a ground disk,
|
|
9
|
+
* then returns a vector usable for sampling an environment cube map.
|
|
10
|
+
*
|
|
11
|
+
* @tsl
|
|
12
|
+
* @function
|
|
13
|
+
* @param {Node<float>} radiusNode - The radius of the projection sphere. Must be large enough to ensure the scene's camera stays inside.
|
|
14
|
+
* @param {Node<float>} heightNode - The height is how far the camera that took the photo was above the ground. A larger value will magnify the downward part of the image.
|
|
15
|
+
* @return {Node<vec3>} A direction vector for sampling the environment cube map.
|
|
16
|
+
*/
|
|
17
|
+
export const getGroundProjectedNormal: (radiusNode: Node<"float">, heightNode: Node<"float">) => Node<"vec3">;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UniformNode, Vector2 } from "three/webgpu";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns a TSL function that samples texture-free analytic R² noise.
|
|
5
|
+
* Index 0 uses continuous screen pixels; other indices tile-shift with an R²
|
|
6
|
+
* sequence into a 64×64 period. Values are four independent R² dimensions
|
|
7
|
+
* hashed from the sample coordinates.
|
|
8
|
+
*
|
|
9
|
+
* @param {UniformNode<Vector2>} resolution
|
|
10
|
+
* @param {number} [seed=0] - Added to the coordinate hash so each pass gets an independent R² phase.
|
|
11
|
+
*/
|
|
12
|
+
export function bindAnalyticNoise(resolution: UniformNode<"vec2", Vector2>, seed?: number): () => void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Specular / microfacet BRDF helpers: VNDF sampling, GTR distribution, Smith geometry,
|
|
3
|
+
* Fresnel, reflection importance sampling, parallax-corrected ray-length terms, and
|
|
4
|
+
* equirectangular environment sampling / MIS helpers.
|
|
5
|
+
* Pure TSL functions of their inputs (no scene/camera state).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Sentinel ray length the SSR pass writes for environment misses (no screen-space hit), set far above
|
|
9
|
+
* any real hit distance so a single magnitude test separates misses from hits and survives `.max( 0 )`.
|
|
10
|
+
*
|
|
11
|
+
* @type {number}
|
|
12
|
+
*/
|
|
13
|
+
export const ENV_RAY_LENGTH: number;
|
|
14
|
+
/**
|
|
15
|
+
* Classification threshold for {@link ENV_RAY_LENGTH}: above this is an env miss, below a real hit.
|
|
16
|
+
* An order of magnitude under the sentinel, robust to fp16 storage and bilinear blending at borders.
|
|
17
|
+
*
|
|
18
|
+
* @type {number}
|
|
19
|
+
*/
|
|
20
|
+
export const ENV_RAY_LENGTH_THRESHOLD: number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { WebGPURenderer } from "three/webgpu";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Sets up a construction-time WebGL fallback for WebGPU XR examples.
|
|
5
|
+
*
|
|
6
|
+
* @param {WebGPURenderer} renderer - The initial renderer.
|
|
7
|
+
* @param {Function} createFallbackRenderer - A function that returns a new renderer with a WebGL backend.
|
|
8
|
+
* @param {Function} onFallback - A function that installs the new renderer in the app.
|
|
9
|
+
*/
|
|
10
|
+
export function setupWebGLXRFallback(
|
|
11
|
+
renderer: WebGPURenderer,
|
|
12
|
+
createFallbackRenderer: (renderer: WebGPURenderer) => WebGPURenderer,
|
|
13
|
+
onFallback?: (fallbackRenderer: WebGPURenderer, renderer: WebGPURenderer) => Promise<void> | void,
|
|
14
|
+
): void;
|
three/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.185.0",
|
|
4
4
|
"description": "TypeScript definitions for three",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,6 +48,6 @@
|
|
|
48
48
|
"meshoptimizer": "~1.1.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {},
|
|
51
|
-
"typesPublisherContentHash": "
|
|
52
|
-
"typeScriptVersion": "5.
|
|
51
|
+
"typesPublisherContentHash": "8fbe871a42225be87979eaf8580d12b6ea8cddd22eb100a6639a79de0771d026",
|
|
52
|
+
"typeScriptVersion": "5.6"
|
|
53
53
|
}
|
three/src/Three.TSL.d.ts
CHANGED
|
@@ -47,6 +47,7 @@ export const addNodeElement: typeof TSL.addNodeElement;
|
|
|
47
47
|
export const agxToneMapping: typeof TSL.agxToneMapping;
|
|
48
48
|
export const all: typeof TSL.all;
|
|
49
49
|
export const alphaT: typeof TSL.alphaT;
|
|
50
|
+
export const ambientOcclusion: typeof TSL.ambientOcclusion;
|
|
50
51
|
export const and: typeof TSL.and;
|
|
51
52
|
export const anisotropy: typeof TSL.anisotropy;
|
|
52
53
|
export const anisotropyB: typeof TSL.anisotropyB;
|
|
@@ -54,7 +55,6 @@ export const anisotropyT: typeof TSL.anisotropyT;
|
|
|
54
55
|
export const any: typeof TSL.any;
|
|
55
56
|
export const append: typeof TSL.append;
|
|
56
57
|
export const array: typeof TSL.array;
|
|
57
|
-
export const arrayBuffer: typeof TSL.arrayBuffer;
|
|
58
58
|
export const asin: typeof TSL.asin;
|
|
59
59
|
export const asinh: typeof TSL.asinh;
|
|
60
60
|
export const assign: typeof TSL.assign;
|
|
@@ -177,6 +177,7 @@ export const dynamicBufferAttribute: typeof TSL.dynamicBufferAttribute;
|
|
|
177
177
|
export const element: typeof TSL.element;
|
|
178
178
|
export const emissive: typeof TSL.emissive;
|
|
179
179
|
export const equal: typeof TSL.equal;
|
|
180
|
+
export const equirectDirection: typeof TSL.equirectDirection;
|
|
180
181
|
export const equirectUV: typeof TSL.equirectUV;
|
|
181
182
|
export const exp: typeof TSL.exp;
|
|
182
183
|
export const exp2: typeof TSL.exp2;
|
|
@@ -320,7 +321,6 @@ export const min: typeof TSL.min;
|
|
|
320
321
|
export const mix: typeof TSL.mix;
|
|
321
322
|
export const mixElement: typeof TSL.mixElement;
|
|
322
323
|
export const mod: typeof TSL.mod;
|
|
323
|
-
export const modInt: typeof TSL.modInt;
|
|
324
324
|
export const modelDirection: typeof TSL.modelDirection;
|
|
325
325
|
export const modelNormalMatrix: typeof TSL.modelNormalMatrix;
|
|
326
326
|
export const modelPosition: typeof TSL.modelPosition;
|
|
@@ -378,6 +378,7 @@ export const mx_worley_noise_float: typeof TSL.mx_worley_noise_float;
|
|
|
378
378
|
export const mx_worley_noise_vec2: typeof TSL.mx_worley_noise_vec2;
|
|
379
379
|
export const mx_worley_noise_vec3: typeof TSL.mx_worley_noise_vec3;
|
|
380
380
|
export const negate: typeof TSL.negate;
|
|
381
|
+
export const negateOnBackSide: typeof TSL.negateOnBackSide;
|
|
381
382
|
export const neutralToneMapping: typeof TSL.neutralToneMapping;
|
|
382
383
|
export const nodeArray: typeof TSL.nodeArray;
|
|
383
384
|
export const nodeImmutable: typeof TSL.nodeImmutable;
|
|
@@ -419,9 +420,12 @@ export const oscTriangle: typeof TSL.oscTriangle;
|
|
|
419
420
|
export const output: typeof TSL.output;
|
|
420
421
|
export const outputStruct: typeof TSL.outputStruct;
|
|
421
422
|
export const overloadingFn: typeof TSL.overloadingFn;
|
|
423
|
+
export const overrideNode: typeof TSL.overrideNode;
|
|
424
|
+
export const overrideNodes: typeof TSL.overrideNodes;
|
|
422
425
|
export const packHalf2x16: typeof TSL.packHalf2x16;
|
|
423
426
|
export const packSnorm2x16: typeof TSL.packSnorm2x16;
|
|
424
427
|
export const packUnorm2x16: typeof TSL.packUnorm2x16;
|
|
428
|
+
export const packNormalToRGB: typeof TSL.packNormalToRGB;
|
|
425
429
|
export const parabola: typeof TSL.parabola;
|
|
426
430
|
export const parallaxDirection: typeof TSL.parallaxDirection;
|
|
427
431
|
export const parallaxUV: typeof TSL.parallaxUV;
|
|
@@ -518,7 +522,7 @@ export const stepElement: typeof TSL.stepElement;
|
|
|
518
522
|
export const storage: typeof TSL.storage;
|
|
519
523
|
export const storageBarrier: typeof TSL.storageBarrier;
|
|
520
524
|
export const storageTexture: typeof TSL.storageTexture;
|
|
521
|
-
export const
|
|
525
|
+
export const storageTexture3D: typeof TSL.storageTexture3D;
|
|
522
526
|
export const struct: typeof TSL.struct;
|
|
523
527
|
export const sub: typeof TSL.sub;
|
|
524
528
|
export const subgroupAdd: typeof TSL.subgroupAdd;
|
|
@@ -568,6 +572,8 @@ export const toneMappingExposure: typeof TSL.toneMappingExposure;
|
|
|
568
572
|
export const toonOutlinePass: typeof TSL.toonOutlinePass;
|
|
569
573
|
export const transformDirection: typeof TSL.transformDirection;
|
|
570
574
|
export const transformNormal: typeof TSL.transformNormal;
|
|
575
|
+
export const transformNormalByInverseViewMatrix: typeof TSL.transformNormalByInverseViewMatrix;
|
|
576
|
+
export const transformNormalByViewMatrix: typeof TSL.transformNormalByViewMatrix;
|
|
571
577
|
export const transformNormalToView: typeof TSL.transformNormalToView;
|
|
572
578
|
export const transformedClearcoatNormalView: typeof TSL.transformedClearcoatNormalView;
|
|
573
579
|
export const transformedNormalView: typeof TSL.transformedNormalView;
|
|
@@ -589,6 +595,7 @@ export const uniformTexture: typeof TSL.uniformTexture;
|
|
|
589
595
|
export const unpackHalf2x16: typeof TSL.unpackHalf2x16;
|
|
590
596
|
export const unpackSnorm2x16: typeof TSL.unpackSnorm2x16;
|
|
591
597
|
export const unpackUnorm2x16: typeof TSL.unpackUnorm2x16;
|
|
598
|
+
export const unpackRGBToNormal: typeof TSL.unpackRGBToNormal;
|
|
592
599
|
export const unpremultiplyAlpha: typeof TSL.unpremultiplyAlpha;
|
|
593
600
|
export const userData: typeof TSL.userData;
|
|
594
601
|
export const uv: typeof TSL.uv;
|
|
@@ -8,11 +8,11 @@ export { default as Lighting } from "./renderers/common/Lighting.js";
|
|
|
8
8
|
export { default as PostProcessing } from "./renderers/common/PostProcessing.js";
|
|
9
9
|
export { default as QuadMesh } from "./renderers/common/QuadMesh.js";
|
|
10
10
|
export { default as ReadbackBuffer } from "./renderers/common/ReadbackBuffer.js";
|
|
11
|
-
export type { default as Renderer } from "./renderers/common/Renderer.js";
|
|
11
|
+
export type { default as Renderer, RendererParameters } from "./renderers/common/Renderer.js";
|
|
12
12
|
export { default as RenderPipeline } from "./renderers/common/RenderPipeline.js";
|
|
13
13
|
export { default as WebGLBackend } from "./renderers/webgl-fallback/WebGLBackend.js";
|
|
14
14
|
export { default as WebGPUBackend } from "./renderers/webgpu/WebGPUBackend.js";
|
|
15
|
-
export { default as WebGPURenderer } from "./renderers/webgpu/WebGPURenderer.Nodes.js";
|
|
15
|
+
export { default as WebGPURenderer, WebGPURendererParameters } from "./renderers/webgpu/WebGPURenderer.Nodes.js";
|
|
16
16
|
import * as RendererUtils from "./renderers/common/RendererUtils.js";
|
|
17
17
|
export { RendererUtils };
|
|
18
18
|
export { default as IESSpotLight } from "./lights/webgpu/IESSpotLight.js";
|
three/src/Three.WebGPU.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export * from "./Three.Core.js";
|
|
2
2
|
|
|
3
3
|
export * from "./materials/nodes/NodeMaterials.js";
|
|
4
|
-
export
|
|
4
|
+
export { default as Backend } from "./renderers/common/Backend.js";
|
|
5
5
|
export { default as BundleGroup } from "./renderers/common/BundleGroup.js";
|
|
6
6
|
export { default as PMREMGenerator } from "./renderers/common/extras/PMREMGenerator.js";
|
|
7
7
|
export { default as Lighting } from "./renderers/common/Lighting.js";
|
|
8
8
|
export { default as PostProcessing } from "./renderers/common/PostProcessing.js";
|
|
9
9
|
export { default as QuadMesh } from "./renderers/common/QuadMesh.js";
|
|
10
10
|
export { default as ReadbackBuffer } from "./renderers/common/ReadbackBuffer.js";
|
|
11
|
-
export
|
|
11
|
+
export { default as Renderer, RendererParameters } from "./renderers/common/Renderer.js";
|
|
12
12
|
export { default as RenderPipeline } from "./renderers/common/RenderPipeline.js";
|
|
13
13
|
export { default as WebGLCapabilities } from "./renderers/webgl-fallback/utils/WebGLCapabilities.js";
|
|
14
14
|
export { default as WebGLBackend } from "./renderers/webgl-fallback/WebGLBackend.js";
|
|
15
15
|
export { default as WebGPUBackend } from "./renderers/webgpu/WebGPUBackend.js";
|
|
16
|
-
export { default as WebGPURenderer } from "./renderers/webgpu/WebGPURenderer.js";
|
|
16
|
+
export { default as WebGPURenderer, WebGPURendererParameters } from "./renderers/webgpu/WebGPURenderer.js";
|
|
17
17
|
import * as RendererUtils from "./renderers/common/RendererUtils.js";
|
|
18
18
|
export { RendererUtils };
|
|
19
19
|
export { default as IESSpotLight } from "./lights/webgpu/IESSpotLight.js";
|
|
@@ -35,5 +35,7 @@ export { default as StorageInstancedBufferAttribute } from "./renderers/common/S
|
|
|
35
35
|
export { default as StorageTexture } from "./renderers/common/StorageTexture.js";
|
|
36
36
|
export { default as GLSLNodeBuilder } from "./renderers/webgl-fallback/nodes/GLSLNodeBuilder.js";
|
|
37
37
|
export { default as BasicNodeLibrary } from "./renderers/webgpu/nodes/BasicNodeLibrary.js";
|
|
38
|
+
export { default as StandardNodeLibrary } from "./renderers/webgpu/nodes/StandardNodeLibrary.js";
|
|
39
|
+
export { default as WGSLNodeBuilder } from "./renderers/webgpu/nodes/WGSLNodeBuilder.js";
|
|
38
40
|
import * as TSL from "./nodes/TSL.js";
|
|
39
41
|
export { TSL };
|
|
@@ -86,16 +86,6 @@ export class AnimationClip {
|
|
|
86
86
|
fps: number,
|
|
87
87
|
noLoop: boolean,
|
|
88
88
|
): Array<AnimationClip>;
|
|
89
|
-
/**
|
|
90
|
-
* Parses the `animation.hierarchy` format and returns a new animation clip.
|
|
91
|
-
*
|
|
92
|
-
* @static
|
|
93
|
-
* @deprecated since r175.
|
|
94
|
-
* @param {Object} animation - A serialized animation clip as JSON.
|
|
95
|
-
* @param {Array<Bone>} bones - An array of bones.
|
|
96
|
-
* @return {?AnimationClip} The new animation clip.
|
|
97
|
-
*/
|
|
98
|
-
static parseAnimation(animation: AnimationClipJSON, bones: Array<Bone>): AnimationClip | null;
|
|
99
89
|
/**
|
|
100
90
|
* Constructs a new animation clip.
|
|
101
91
|
*
|
three/src/cameras/Camera.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ export class InterleavedBuffer {
|
|
|
104
104
|
* @param offset index of the {@link BufferAttribute.array | array} at which to start copying. Expects a `Integer`. Default `0`.
|
|
105
105
|
* @throws `RangeError` When {@link offset} is negative or is too large.
|
|
106
106
|
*/
|
|
107
|
-
set(value: ArrayLike<number>, offset
|
|
107
|
+
set(value: ArrayLike<number>, offset?: number): this;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* Set {@link BufferAttribute.usage | usage}
|
three/src/core/Object3D.d.ts
CHANGED
|
@@ -669,11 +669,15 @@ export class Object3D<TEventMap extends Object3DEventMap = Object3DEventMap> ext
|
|
|
669
669
|
updateMatrixWorld(force?: boolean): void;
|
|
670
670
|
|
|
671
671
|
/**
|
|
672
|
-
*
|
|
673
|
-
*
|
|
674
|
-
*
|
|
672
|
+
* An alternative version of {@link Object3D#updateMatrixWorld} with more control over the
|
|
673
|
+
* update of ancestor and descendant nodes.
|
|
674
|
+
*
|
|
675
|
+
* @param {boolean} [updateParents=false] Whether ancestor nodes should be updated or not.
|
|
676
|
+
* @param {boolean} [updateChildren=false] Whether descendant nodes should be updated or not.
|
|
677
|
+
* @param {boolean} [force=false] - When set to `true`, a recomputation of world matrices is forced even
|
|
678
|
+
* when {@link Object3D#matrixWorldNeedsUpdate} is `false`.
|
|
675
679
|
*/
|
|
676
|
-
updateWorldMatrix(updateParents: boolean, updateChildren: boolean): void;
|
|
680
|
+
updateWorldMatrix(updateParents: boolean, updateChildren: boolean, force?: boolean): void;
|
|
677
681
|
|
|
678
682
|
/**
|
|
679
683
|
* Convert the object to three.js {@link https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 | JSON Object/Scene format}.
|
three/src/core/RenderTarget.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export interface RenderTargetOptions extends TextureParameters {
|
|
|
17
17
|
count?: number | undefined;
|
|
18
18
|
depth?: number | undefined;
|
|
19
19
|
multiview?: boolean | undefined;
|
|
20
|
+
useArrayDepthTexture?: boolean | undefined;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export interface RenderTargetEventMap {
|
|
@@ -77,6 +78,16 @@ export class RenderTarget<
|
|
|
77
78
|
*/
|
|
78
79
|
multiview: boolean;
|
|
79
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Whether to create the depth texture as an array texture for per-layer depth testing.
|
|
83
|
+
* This is separate from multiview so layered render targets can use array depth without
|
|
84
|
+
* the multiview extension.
|
|
85
|
+
*
|
|
86
|
+
* @type {boolean}
|
|
87
|
+
* @default false
|
|
88
|
+
*/
|
|
89
|
+
useArrayDepthTexture: boolean;
|
|
90
|
+
|
|
80
91
|
constructor(width?: number, height?: number, options?: RenderTargetOptions);
|
|
81
92
|
|
|
82
93
|
get texture(): TTexture;
|
three/src/core/Timer.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ declare class Timer {
|
|
|
63
63
|
/**
|
|
64
64
|
* Can be used to free all internal resources. Usually called when the timer instance isn't required anymore.
|
|
65
65
|
*/
|
|
66
|
-
dispose():
|
|
66
|
+
dispose(): void;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Updates the internal state of the timer. This method should be called once per simulation step and before you
|
three/src/extras/Controls.d.ts
CHANGED
|
@@ -6,13 +6,14 @@ export interface ControlsEventMap {}
|
|
|
6
6
|
/**
|
|
7
7
|
* Abstract base class for controls.
|
|
8
8
|
*/
|
|
9
|
-
declare abstract class Controls<
|
|
10
|
-
extends
|
|
11
|
-
|
|
9
|
+
declare abstract class Controls<
|
|
10
|
+
TEventMap extends ControlsEventMap = ControlsEventMap,
|
|
11
|
+
TObject extends Object3D = Object3D,
|
|
12
|
+
> extends EventDispatcher<TEventMap> {
|
|
12
13
|
/**
|
|
13
14
|
* The 3D object that is managed by the controls.
|
|
14
15
|
*/
|
|
15
|
-
object:
|
|
16
|
+
object: TObject;
|
|
16
17
|
|
|
17
18
|
/**
|
|
18
19
|
* The HTML element used for event listeners. If not provided via the constructor, {@link .connect} must be called
|
|
@@ -30,7 +31,7 @@ declare abstract class Controls<TEventMap extends ControlsEventMap = ControlsEve
|
|
|
30
31
|
* @param object The object the controls should manage (usually the camera).
|
|
31
32
|
* @param domElement The HTML element used for event listeners. (optional)
|
|
32
33
|
*/
|
|
33
|
-
constructor(object:
|
|
34
|
+
constructor(object: TObject, domElement?: HTMLElement | SVGElement | null);
|
|
34
35
|
|
|
35
36
|
/**
|
|
36
37
|
* Connects the controls to the DOM. This method has so called "side effects" since it adds the module's event
|