@types/three 0.173.0 → 0.174.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- three/README.md +1 -1
- three/examples/jsm/animation/CCDIKSolver.d.ts +3 -2
- three/examples/jsm/loaders/MTLLoader.d.ts +2 -1
- three/examples/jsm/misc/Timer.d.ts +13 -2
- three/examples/jsm/objects/Reflector.d.ts +1 -0
- three/examples/jsm/tsl/math/Bayer.d.ts +4 -0
- three/examples/jsm/tsl/utils/Raymarching.d.ts +9 -0
- three/package.json +2 -2
- three/src/Three.TSL.d.ts +4 -0
- three/src/Three.d.ts +6 -1
- three/src/core/Raycaster.d.ts +4 -0
- three/src/extras/PMREMGenerator.d.ts +15 -2
- three/src/geometries/TorusGeometry.d.ts +5 -6
- three/src/materials/nodes/NodeMaterial.d.ts +2 -1
- three/src/materials/nodes/VolumeNodeMaterial.d.ts +14 -2
- three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +4 -4
- three/src/nodes/Nodes.d.ts +1 -2
- three/src/nodes/TSL.d.ts +1 -0
- three/src/nodes/accessors/BufferAttributeNode.d.ts +25 -22
- three/src/nodes/accessors/Lights.d.ts +1 -1
- three/src/nodes/accessors/MaterialProperties.d.ts +5 -0
- three/src/nodes/accessors/ModelNode.d.ts +1 -0
- three/src/nodes/accessors/Object3DNode.d.ts +7 -5
- three/src/nodes/accessors/Texture3DNode.d.ts +2 -2
- three/src/nodes/core/LightingModel.d.ts +13 -28
- three/src/nodes/core/Node.d.ts +24 -24
- three/src/nodes/core/NodeAttribute.d.ts +3 -3
- three/src/nodes/core/NodeCache.d.ts +2 -2
- three/src/nodes/core/NodeParser.d.ts +1 -1
- three/src/nodes/core/NodeUniform.d.ts +4 -4
- three/src/nodes/core/NodeVar.d.ts +4 -4
- three/src/nodes/core/NodeVarying.d.ts +2 -2
- three/src/nodes/core/StructTypeNode.d.ts +2 -2
- three/src/nodes/core/UniformNode.d.ts +7 -7
- three/src/nodes/core/constants.d.ts +0 -1
- three/src/nodes/display/PassNode.d.ts +10 -1
- three/src/nodes/functions/BSDF/LTC.d.ts +5 -1
- three/src/nodes/functions/VolumetricLightingModel.d.ts +6 -0
- three/src/nodes/lighting/AnalyticLightNode.d.ts +13 -1
- three/src/nodes/lighting/LightingContextNode.d.ts +18 -4
- three/src/nodes/lighting/LightsNode.d.ts +24 -0
- three/src/nodes/lighting/PointLightNode.d.ts +8 -7
- three/src/nodes/lighting/ShadowBaseNode.d.ts +3 -0
- three/src/nodes/tsl/TSLCore.d.ts +3 -0
- three/src/nodes/utils/ReflectorNode.d.ts +1 -0
- three/src/objects/LOD.d.ts +4 -3
- three/src/renderers/common/Animation.d.ts +4 -4
- three/src/renderers/common/Attributes.d.ts +1 -1
- three/src/renderers/common/BindGroup.d.ts +2 -2
- three/src/renderers/common/Binding.d.ts +2 -2
- three/src/renderers/common/Buffer.d.ts +3 -3
- three/src/renderers/common/BufferUtils.d.ts +7 -8
- three/src/renderers/common/BundleGroup.d.ts +2 -2
- three/src/renderers/common/ChainMap.d.ts +3 -3
- three/src/renderers/common/ClippingContext.d.ts +3 -3
- three/src/renderers/common/Color4.d.ts +8 -8
- three/src/renderers/common/ComputePipeline.d.ts +1 -1
- three/src/renderers/common/DataMap.d.ts +2 -2
- three/src/renderers/common/Geometries.d.ts +4 -4
- three/src/renderers/common/Info.d.ts +2 -2
- three/src/renderers/common/Pipeline.d.ts +1 -1
- three/src/renderers/common/Pipelines.d.ts +9 -9
- three/src/renderers/common/ProgrammableStage.d.ts +4 -4
- three/src/renderers/common/RenderContext.d.ts +2 -2
- three/src/renderers/common/RenderContexts.d.ts +3 -3
- three/src/renderers/common/RenderList.d.ts +11 -11
- three/src/renderers/common/RenderObject.d.ts +13 -13
- three/src/renderers/common/RenderObjects.d.ts +3 -3
- three/src/renderers/common/RenderPipeline.d.ts +1 -1
- three/src/renderers/common/Renderer.d.ts +117 -91
- three/src/renderers/common/Textures.d.ts +6 -6
- three/src/renderers/common/TimestampQueryPool.d.ts +13 -1
- three/src/renderers/common/Uniform.d.ts +13 -13
- three/src/renderers/common/UniformBuffer.d.ts +1 -1
- three/src/renderers/common/UniformsGroup.d.ts +13 -13
- three/src/renderers/common/XRManager.d.ts +13 -15
- three/src/renderers/common/XRRenderTarget.d.ts +4 -4
- three/src/renderers/common/extras/PMREMGenerator.d.ts +9 -2
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -3
- three/src/renderers/common/nodes/NodeLibrary.d.ts +11 -11
- three/src/renderers/common/nodes/NodeUniform.d.ts +9 -9
- three/src/renderers/common/nodes/NodeUniformsGroup.d.ts +1 -1
- three/src/renderers/common/nodes/Nodes.d.ts +11 -11
- three/src/renderers/webgl/WebGLState.d.ts +7 -6
three/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Thu, 27 Feb 2025 18:02:49 GMT
|
|
12
12
|
* Dependencies: [@tweenjs/tween.js](https://npmjs.com/package/@tweenjs/tween.js), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [@webgpu/types](https://npmjs.com/package/@webgpu/types), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -14,6 +14,7 @@ export interface IK {
|
|
|
14
14
|
minAngle?: number | undefined;
|
|
15
15
|
maxAngle?: number | undefined;
|
|
16
16
|
target: number;
|
|
17
|
+
blendFactor?: number | undefined;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export class CCDIKSolver {
|
|
@@ -22,8 +23,8 @@ export class CCDIKSolver {
|
|
|
22
23
|
|
|
23
24
|
constructor(mesh: SkinnedMesh, iks?: IK[]);
|
|
24
25
|
|
|
25
|
-
update(): this;
|
|
26
|
-
updateOne(ik: IK): this;
|
|
26
|
+
update(globalBlendFactor?: number): this;
|
|
27
|
+
updateOne(ik: IK, overrideBlend?: number): this;
|
|
27
28
|
createHelper(sphereSize?: number): CCDIKHelper;
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -38,8 +38,8 @@ export class MTLLoader extends Loader<MTLLoader.MaterialCreator> {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
export interface MaterialInfo {
|
|
41
|
-
ks?: number[] | undefined;
|
|
42
41
|
kd?: number[] | undefined;
|
|
42
|
+
ks?: number[] | undefined;
|
|
43
43
|
ke?: number[] | undefined;
|
|
44
44
|
map_kd?: string | undefined;
|
|
45
45
|
map_ks?: string | undefined;
|
|
@@ -47,6 +47,7 @@ export interface MaterialInfo {
|
|
|
47
47
|
norm?: string | undefined;
|
|
48
48
|
map_bump?: string | undefined;
|
|
49
49
|
bump?: string | undefined;
|
|
50
|
+
disp?: string | undefined;
|
|
50
51
|
map_d?: string | undefined;
|
|
51
52
|
ns?: number | undefined;
|
|
52
53
|
d?: number | undefined;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* - {@link Timer} has an {@link .update()} method that updates its internal state. That makes it possible to call
|
|
6
6
|
* {@link .getDelta()} and {@link .getElapsed()} multiple times per simulation step without getting different values.
|
|
7
|
-
* - The class
|
|
8
|
-
* or browser hidden).
|
|
7
|
+
* - The class can make use of the Page Visibility API to avoid large time delta values when the app is inactive (e.g.
|
|
8
|
+
* tab switched or browser hidden).
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* const timer = new Timer();
|
|
@@ -24,6 +24,17 @@
|
|
|
24
24
|
export class Timer {
|
|
25
25
|
constructor();
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Connects the timer to the given document. Calling this method is not mandatory to use the timer but enables the
|
|
29
|
+
* usage of the Page Visibility API to avoid large time delta values.
|
|
30
|
+
*/
|
|
31
|
+
connect(document: Document): void;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Disconnects the timer from the DOM and also disables the usage of the Page Visibility API.
|
|
35
|
+
*/
|
|
36
|
+
disconnect(): void;
|
|
37
|
+
|
|
27
38
|
/**
|
|
28
39
|
* Returns the time delta in seconds.
|
|
29
40
|
*/
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
|
+
import { FunctionNode, Node } from "three/webgpu";
|
|
3
|
+
|
|
4
|
+
export const RaymarchingBox: (
|
|
5
|
+
steps: number | Node,
|
|
6
|
+
callback:
|
|
7
|
+
| ((params: { positionRay: ShaderNodeObject<Node> }) => void)
|
|
8
|
+
| FunctionNode<{ positionRay: ShaderNodeObject<Node> }>,
|
|
9
|
+
) => void;
|
three/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/three",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.174.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": "~0.18.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {},
|
|
51
|
-
"typesPublisherContentHash": "
|
|
51
|
+
"typesPublisherContentHash": "42b773a4ca2b467bb5f631194fbba7e91c3510c11d419d1c442487b3e4c90b2e",
|
|
52
52
|
"typeScriptVersion": "5.0"
|
|
53
53
|
}
|
three/src/Three.TSL.d.ts
CHANGED
|
@@ -285,6 +285,7 @@ export const modInt: typeof TSL.modInt;
|
|
|
285
285
|
export const modelDirection: typeof TSL.modelDirection;
|
|
286
286
|
export const modelNormalMatrix: typeof TSL.modelNormalMatrix;
|
|
287
287
|
export const modelPosition: typeof TSL.modelPosition;
|
|
288
|
+
export const modelRadius: typeof TSL.modelRadius;
|
|
288
289
|
export const modelScale: typeof TSL.modelScale;
|
|
289
290
|
export const modelViewMatrix: typeof TSL.modelViewMatrix;
|
|
290
291
|
export const modelViewPosition: typeof TSL.modelViewPosition;
|
|
@@ -336,6 +337,7 @@ export const numWorkgroups: typeof TSL.numWorkgroups;
|
|
|
336
337
|
export const objectDirection: typeof TSL.objectDirection;
|
|
337
338
|
export const objectGroup: typeof TSL.objectGroup;
|
|
338
339
|
export const objectPosition: typeof TSL.objectPosition;
|
|
340
|
+
export const objectRadius: typeof TSL.objectRadius;
|
|
339
341
|
export const objectScale: typeof TSL.objectScale;
|
|
340
342
|
export const objectViewPosition: typeof TSL.objectViewPosition;
|
|
341
343
|
export const objectWorldMatrix: typeof TSL.objectWorldMatrix;
|
|
@@ -380,6 +382,7 @@ export const range: typeof TSL.range;
|
|
|
380
382
|
export const rangeFog: typeof TSL.rangeFog;
|
|
381
383
|
export const rangeFogFactor: typeof TSL.rangeFogFactor;
|
|
382
384
|
export const reciprocal: typeof TSL.reciprocal;
|
|
385
|
+
export const lightProjectionUV: typeof TSL.lightProjectionUV;
|
|
383
386
|
export const reference: typeof TSL.reference;
|
|
384
387
|
export const referenceBuffer: typeof TSL.referenceBuffer;
|
|
385
388
|
export const reflect: typeof TSL.reflect;
|
|
@@ -416,6 +419,7 @@ export const select: typeof TSL.select;
|
|
|
416
419
|
export const setCurrentStack: typeof TSL.setCurrentStack;
|
|
417
420
|
export const shaderStages: typeof TSL.shaderStages;
|
|
418
421
|
export const shadow: typeof TSL.shadow;
|
|
422
|
+
export const pointShadow: typeof TSL.pointShadow;
|
|
419
423
|
export const shadowPositionWorld: typeof TSL.shadowPositionWorld;
|
|
420
424
|
export const sharedUniformGroup: typeof TSL.sharedUniformGroup;
|
|
421
425
|
export const shapeCircle: typeof TSL.shapeCircle;
|
three/src/Three.d.ts
CHANGED
|
@@ -28,7 +28,12 @@ export type { WebGLProperties } from "./renderers/webgl/WebGLProperties.js";
|
|
|
28
28
|
export type { RenderItem, WebGLRenderList, WebGLRenderLists } from "./renderers/webgl/WebGLRenderLists.js";
|
|
29
29
|
export type { WebGLShader } from "./renderers/webgl/WebGLShader.js";
|
|
30
30
|
export type { WebGLShadowMap } from "./renderers/webgl/WebGLShadowMap.js";
|
|
31
|
-
export type {
|
|
31
|
+
export type {
|
|
32
|
+
WebGLColorBuffer,
|
|
33
|
+
WebGLDepthBuffer,
|
|
34
|
+
WebGLState,
|
|
35
|
+
WebGLStencilBuffer,
|
|
36
|
+
} from "./renderers/webgl/WebGLState.js";
|
|
32
37
|
export type { WebGLTextures } from "./renderers/webgl/WebGLTextures.js";
|
|
33
38
|
export type { WebGLUniforms } from "./renderers/webgl/WebGLUniforms.js";
|
|
34
39
|
export * from "./renderers/webgl/WebGLUtils.js";
|
three/src/core/Raycaster.d.ts
CHANGED
|
@@ -17,6 +17,10 @@ export interface Face {
|
|
|
17
17
|
export interface Intersection<TIntersected extends Object3D = Object3D> {
|
|
18
18
|
/** Distance between the origin of the ray and the intersection */
|
|
19
19
|
distance: number;
|
|
20
|
+
/**
|
|
21
|
+
* Some objects (f.e. {@link Points}) provide the distance of the intersection to the nearest point on the ray. For
|
|
22
|
+
* other objects it will be `undefined`
|
|
23
|
+
*/
|
|
20
24
|
distanceToRay?: number | undefined;
|
|
21
25
|
/** Point of intersection, in world coordinates */
|
|
22
26
|
point: Vector3;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
import { Vector3 } from "../math/Vector3.js";
|
|
1
2
|
import { WebGLRenderer } from "../renderers/WebGLRenderer.js";
|
|
2
3
|
import { WebGLRenderTarget } from "../renderers/WebGLRenderTarget.js";
|
|
3
4
|
import { Scene } from "../scenes/Scene.js";
|
|
4
5
|
import { CubeTexture } from "../textures/CubeTexture.js";
|
|
5
6
|
import { Texture } from "../textures/Texture.js";
|
|
6
7
|
|
|
8
|
+
export interface PMREMGeneratorOptions {
|
|
9
|
+
size?: number | undefined;
|
|
10
|
+
position?: Vector3 | undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
7
13
|
/**
|
|
8
14
|
* This class generates a Prefiltered, Mipmapped Radiance Environment Map (PMREM) from a cubeMap environment texture.
|
|
9
15
|
* @remarks
|
|
@@ -38,13 +44,20 @@ export class PMREMGenerator {
|
|
|
38
44
|
/**
|
|
39
45
|
* Generates a PMREM from a supplied Scene, which can be faster than using an image if networking bandwidth is low
|
|
40
46
|
* @remarks
|
|
41
|
-
* Optional near and far planes ensure the scene is rendered in its entirety
|
|
47
|
+
* Optional near and far planes ensure the scene is rendered in its entirety.
|
|
42
48
|
* @param scene The given scene.
|
|
43
49
|
* @param sigma Specifies a blur radius in radians to be applied to the scene before PMREM generation. Default `0`.
|
|
44
50
|
* @param near The near plane value. Default `0.1`.
|
|
45
51
|
* @param far The far plane value. Default `100`.
|
|
52
|
+
* @param {?Object} [options={}]
|
|
46
53
|
*/
|
|
47
|
-
fromScene(
|
|
54
|
+
fromScene(
|
|
55
|
+
scene: Scene,
|
|
56
|
+
sigma?: number,
|
|
57
|
+
near?: number,
|
|
58
|
+
far?: number,
|
|
59
|
+
options?: PMREMGeneratorOptions,
|
|
60
|
+
): WebGLRenderTarget;
|
|
48
61
|
|
|
49
62
|
/**
|
|
50
63
|
* Generates a PMREM from an equirectangular texture, which can be either LDR or HDR. The ideal input image size is
|
|
@@ -16,12 +16,11 @@ import { BufferGeometry } from "../core/BufferGeometry.js";
|
|
|
16
16
|
*/
|
|
17
17
|
export class TorusGeometry extends BufferGeometry {
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @param arc Central angle. Expects a `Float`. Default `Math.PI * 2`
|
|
19
|
+
* @param radius Radius of the torus, from the center of the torus to the center of the tube. Default `1`.
|
|
20
|
+
* @param tube Radius of the tube. Must be smaller than `radius`. Default is `0.4`.
|
|
21
|
+
* @param radialSegments Default is `12`.
|
|
22
|
+
* @param tubularSegments Default is `48`.
|
|
23
|
+
* @param arc Central angle. Default is Math.PI * 2.
|
|
25
24
|
*/
|
|
26
25
|
constructor(radius?: number, tube?: number, radialSegments?: number, tubularSegments?: number, arc?: number);
|
|
27
26
|
|
|
@@ -60,7 +60,7 @@ declare class NodeMaterial extends Material {
|
|
|
60
60
|
|
|
61
61
|
depthNode: Node | null;
|
|
62
62
|
shadowPositionNode: Node | null;
|
|
63
|
-
receivedShadowNode: Node | null;
|
|
63
|
+
receivedShadowNode: (() => Node) | null;
|
|
64
64
|
castShadowNode: Node | null;
|
|
65
65
|
|
|
66
66
|
outputNode: Node | null;
|
|
@@ -89,6 +89,7 @@ declare class NodeMaterial extends Material {
|
|
|
89
89
|
setupOutgoingLight(): Node;
|
|
90
90
|
setupLightingModel(builder: NodeBuilder): LightingModel;
|
|
91
91
|
setupLighting(builder: NodeBuilder): Node;
|
|
92
|
+
setupFog(builder: NodeBuilder, outputNode: Node): Node;
|
|
92
93
|
setupOutput(builder: NodeBuilder, outputNode: Node): Node;
|
|
93
94
|
|
|
94
95
|
setDefaultValues(material: Material): void;
|
|
@@ -1,10 +1,22 @@
|
|
|
1
|
+
import FunctionNode from "../../nodes/code/FunctionNode.js";
|
|
1
2
|
import Node from "../../nodes/core/Node.js";
|
|
3
|
+
import { ShaderNodeObject } from "../../nodes/tsl/TSLCore.js";
|
|
2
4
|
import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
|
|
3
5
|
|
|
6
|
+
export interface VolumeNodeMaterialParameters extends NodeMaterialParameters {
|
|
7
|
+
steps?: number | undefined;
|
|
8
|
+
|
|
9
|
+
scatteringNode?: Node | null | undefined;
|
|
10
|
+
}
|
|
11
|
+
|
|
4
12
|
export default class VolumeNodeMaterial extends NodeMaterial {
|
|
5
|
-
lights: boolean;
|
|
6
13
|
readonly isVolumeNodeMaterial: true;
|
|
7
|
-
|
|
14
|
+
|
|
15
|
+
steps: number;
|
|
16
|
+
|
|
17
|
+
scatteringNode: (params: { positionRay: ShaderNodeObject<Node> }) => Node | null;
|
|
18
|
+
|
|
19
|
+
offsetNode?: Node | undefined;
|
|
8
20
|
|
|
9
21
|
constructor(parameters?: NodeMaterialParameters);
|
|
10
22
|
}
|
|
@@ -100,7 +100,7 @@ declare class NodeMaterialObserver {
|
|
|
100
100
|
* Returns `true` if the given render object is verified for the first time of this observer.
|
|
101
101
|
*
|
|
102
102
|
* @param {RenderObject} renderObject - The render object.
|
|
103
|
-
* @return {
|
|
103
|
+
* @return {boolean} Whether the given render object is verified for the first time of this observer.
|
|
104
104
|
*/
|
|
105
105
|
firstInitialization(renderObject: RenderObject): boolean;
|
|
106
106
|
/**
|
|
@@ -123,7 +123,7 @@ declare class NodeMaterialObserver {
|
|
|
123
123
|
* node properties.
|
|
124
124
|
*
|
|
125
125
|
* @param {NodeBuilder} builder - The current node builder.
|
|
126
|
-
* @return {
|
|
126
|
+
* @return {boolean} Whether the node builder's material uses node properties or not.
|
|
127
127
|
*/
|
|
128
128
|
containsNode(builder: NodeBuilder): boolean;
|
|
129
129
|
/**
|
|
@@ -138,7 +138,7 @@ declare class NodeMaterialObserver {
|
|
|
138
138
|
* Returns `true` if the given render object has not changed its state.
|
|
139
139
|
*
|
|
140
140
|
* @param {RenderObject} renderObject - The render object.
|
|
141
|
-
* @return {
|
|
141
|
+
* @return {boolean} Whether the given render object has changed its state or not.
|
|
142
142
|
*/
|
|
143
143
|
equals(renderObject: RenderObject): boolean;
|
|
144
144
|
/**
|
|
@@ -146,7 +146,7 @@ declare class NodeMaterialObserver {
|
|
|
146
146
|
*
|
|
147
147
|
* @param {RenderObject} renderObject - The render object.
|
|
148
148
|
* @param {NodeFrame} nodeFrame - The current node frame.
|
|
149
|
-
* @return {
|
|
149
|
+
* @return {boolean} Whether the given render object requires a refresh or not.
|
|
150
150
|
*/
|
|
151
151
|
needsRefresh(renderObject: RenderObject, nodeFrame: NodeFrame): boolean;
|
|
152
152
|
}
|
three/src/nodes/Nodes.d.ts
CHANGED
|
@@ -14,7 +14,6 @@ export {
|
|
|
14
14
|
default as LightingModel,
|
|
15
15
|
LightingModelDirectInput,
|
|
16
16
|
LightingModelDirectRectAreaInput,
|
|
17
|
-
LightingModelIndirectInput,
|
|
18
17
|
LightingModelReflectedLight,
|
|
19
18
|
} from "./core/LightingModel.js";
|
|
20
19
|
export { default as MRTNode } from "./core/MRTNode.js";
|
|
@@ -134,7 +133,7 @@ export { default as EnvironmentNode } from "./lighting/EnvironmentNode.js";
|
|
|
134
133
|
export { default as HemisphereLightNode } from "./lighting/HemisphereLightNode.js";
|
|
135
134
|
export { default as IESSpotLightNode } from "./lighting/IESSpotLightNode.js";
|
|
136
135
|
export { default as IrradianceNode } from "./lighting/IrradianceNode.js";
|
|
137
|
-
export { default as LightingContextNode } from "./lighting/LightingContextNode.js";
|
|
136
|
+
export { default as LightingContextNode, LightingContext } from "./lighting/LightingContextNode.js";
|
|
138
137
|
export { default as LightingNode } from "./lighting/LightingNode.js";
|
|
139
138
|
export { default as LightProbeNode } from "./lighting/LightProbeNode.js";
|
|
140
139
|
export { default as LightsNode } from "./lighting/LightsNode.js";
|
three/src/nodes/TSL.d.ts
CHANGED
|
@@ -133,6 +133,7 @@ export * from "./accessors/Lights.js";
|
|
|
133
133
|
export * from "./lighting/LightingContextNode.js";
|
|
134
134
|
export * from "./lighting/LightsNode.js";
|
|
135
135
|
export * from "./lighting/PointLightNode.js";
|
|
136
|
+
export * from "./lighting/PointShadowNode.js";
|
|
136
137
|
export * from "./lighting/ShadowBaseNode.js";
|
|
137
138
|
export * from "./lighting/ShadowNode.js";
|
|
138
139
|
|
|
@@ -4,7 +4,6 @@ import { InterleavedBuffer } from "../../core/InterleavedBuffer.js";
|
|
|
4
4
|
import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute.js";
|
|
5
5
|
import InputNode from "../core/InputNode.js";
|
|
6
6
|
import NodeBuilder from "../core/NodeBuilder.js";
|
|
7
|
-
/** @module BufferAttributeNode **/
|
|
8
7
|
/**
|
|
9
8
|
* In earlier `three.js` versions it was only possible to define attribute data
|
|
10
9
|
* on geometry level. With `BufferAttributeNode`, it is also possible to do this
|
|
@@ -40,9 +39,9 @@ declare class BufferAttributeNode extends InputNode<TypedArray | InterleavedBuff
|
|
|
40
39
|
* Constructs a new buffer attribute node.
|
|
41
40
|
*
|
|
42
41
|
* @param {BufferAttribute|InterleavedBuffer|TypedArray} value - The attribute data.
|
|
43
|
-
* @param {
|
|
44
|
-
* @param {
|
|
45
|
-
* @param {
|
|
42
|
+
* @param {?string} [bufferType=null] - The buffer type (e.g. `'vec3'`).
|
|
43
|
+
* @param {number} [bufferStride=0] - The buffer stride.
|
|
44
|
+
* @param {number} [bufferOffset=0] - The buffer offset.
|
|
46
45
|
*/
|
|
47
46
|
constructor(
|
|
48
47
|
value: TypedArray | InterleavedBuffer | BufferAttribute,
|
|
@@ -55,7 +54,7 @@ declare class BufferAttributeNode extends InputNode<TypedArray | InterleavedBuff
|
|
|
55
54
|
* and thus the hash should be shared as well.
|
|
56
55
|
*
|
|
57
56
|
* @param {NodeBuilder} builder - The current node builder.
|
|
58
|
-
* @return {
|
|
57
|
+
* @return {string} The hash.
|
|
59
58
|
*/
|
|
60
59
|
getHash(builder: NodeBuilder): string;
|
|
61
60
|
/**
|
|
@@ -63,7 +62,7 @@ declare class BufferAttributeNode extends InputNode<TypedArray | InterleavedBuff
|
|
|
63
62
|
* the buffer attribute.
|
|
64
63
|
*
|
|
65
64
|
* @param {NodeBuilder} builder - The current node builder.
|
|
66
|
-
* @return {
|
|
65
|
+
* @return {string} The node type.
|
|
67
66
|
*/
|
|
68
67
|
getNodeType(builder: NodeBuilder): string | null;
|
|
69
68
|
/**
|
|
@@ -78,27 +77,27 @@ declare class BufferAttributeNode extends InputNode<TypedArray | InterleavedBuff
|
|
|
78
77
|
* Generates the code snippet of the buffer attribute node.
|
|
79
78
|
*
|
|
80
79
|
* @param {NodeBuilder} builder - The current node builder.
|
|
81
|
-
* @return {
|
|
80
|
+
* @return {string} The generated code snippet.
|
|
82
81
|
*/
|
|
83
82
|
generate(builder: NodeBuilder): string | null | undefined;
|
|
84
83
|
/**
|
|
85
84
|
* Overwrites the default implementation to return a fixed value `'bufferAttribute'`.
|
|
86
85
|
*
|
|
87
86
|
* @param {NodeBuilder} builder - The current node builder.
|
|
88
|
-
* @return {
|
|
87
|
+
* @return {string} The input type.
|
|
89
88
|
*/
|
|
90
89
|
getInputType(): string;
|
|
91
90
|
/**
|
|
92
91
|
* Sets the `usage` property to the given value.
|
|
93
92
|
*
|
|
94
|
-
* @param {
|
|
93
|
+
* @param {number} value - The usage to set.
|
|
95
94
|
* @return {BufferAttributeNode} A reference to this node.
|
|
96
95
|
*/
|
|
97
96
|
setUsage(value: Usage): this;
|
|
98
97
|
/**
|
|
99
98
|
* Sets the `instanced` property to the given value.
|
|
100
99
|
*
|
|
101
|
-
* @param {
|
|
100
|
+
* @param {boolean} value - The value to set.
|
|
102
101
|
* @return {BufferAttributeNode} A reference to this node.
|
|
103
102
|
*/
|
|
104
103
|
setInstanced(value: boolean): this;
|
|
@@ -107,11 +106,12 @@ export default BufferAttributeNode;
|
|
|
107
106
|
/**
|
|
108
107
|
* TSL function for creating a buffer attribute node.
|
|
109
108
|
*
|
|
109
|
+
* @tsl
|
|
110
110
|
* @function
|
|
111
111
|
* @param {BufferAttribute|InterleavedBuffer|TypedArray} array - The attribute data.
|
|
112
|
-
* @param {
|
|
113
|
-
* @param {
|
|
114
|
-
* @param {
|
|
112
|
+
* @param {?string} [type=null] - The buffer type (e.g. `'vec3'`).
|
|
113
|
+
* @param {number} [stride=0] - The buffer stride.
|
|
114
|
+
* @param {number} [offset=0] - The buffer offset.
|
|
115
115
|
* @returns {BufferAttributeNode}
|
|
116
116
|
*/
|
|
117
117
|
export declare const bufferAttribute: (
|
|
@@ -124,11 +124,12 @@ export declare const bufferAttribute: (
|
|
|
124
124
|
* TSL function for creating a buffer attribute node but with dynamic draw usage.
|
|
125
125
|
* Use this function if attribute data are updated per frame.
|
|
126
126
|
*
|
|
127
|
+
* @tsl
|
|
127
128
|
* @function
|
|
128
129
|
* @param {BufferAttribute|InterleavedBuffer|TypedArray} array - The attribute data.
|
|
129
|
-
* @param {
|
|
130
|
-
* @param {
|
|
131
|
-
* @param {
|
|
130
|
+
* @param {?string} [type=null] - The buffer type (e.g. `'vec3'`).
|
|
131
|
+
* @param {number} [stride=0] - The buffer stride.
|
|
132
|
+
* @param {number} [offset=0] - The buffer offset.
|
|
132
133
|
* @returns {BufferAttributeNode}
|
|
133
134
|
*/
|
|
134
135
|
export declare const dynamicBufferAttribute: (
|
|
@@ -140,11 +141,12 @@ export declare const dynamicBufferAttribute: (
|
|
|
140
141
|
/**
|
|
141
142
|
* TSL function for creating a buffer attribute node but with enabled instancing
|
|
142
143
|
*
|
|
144
|
+
* @tsl
|
|
143
145
|
* @function
|
|
144
146
|
* @param {BufferAttribute|InterleavedBuffer|TypedArray} array - The attribute data.
|
|
145
|
-
* @param {
|
|
146
|
-
* @param {
|
|
147
|
-
* @param {
|
|
147
|
+
* @param {?string} [type=null] - The buffer type (e.g. `'vec3'`).
|
|
148
|
+
* @param {number} [stride=0] - The buffer stride.
|
|
149
|
+
* @param {number} [offset=0] - The buffer offset.
|
|
148
150
|
* @returns {BufferAttributeNode}
|
|
149
151
|
*/
|
|
150
152
|
export declare const instancedBufferAttribute: (
|
|
@@ -156,11 +158,12 @@ export declare const instancedBufferAttribute: (
|
|
|
156
158
|
/**
|
|
157
159
|
* TSL function for creating a buffer attribute node but with dynamic draw usage and enabled instancing
|
|
158
160
|
*
|
|
161
|
+
* @tsl
|
|
159
162
|
* @function
|
|
160
163
|
* @param {BufferAttribute|InterleavedBuffer|TypedArray} array - The attribute data.
|
|
161
|
-
* @param {
|
|
162
|
-
* @param {
|
|
163
|
-
* @param {
|
|
164
|
+
* @param {?string} [type=null] - The buffer type (e.g. `'vec3'`).
|
|
165
|
+
* @param {number} [stride=0] - The buffer stride.
|
|
166
|
+
* @param {number} [offset=0] - The buffer offset.
|
|
164
167
|
* @returns {BufferAttributeNode}
|
|
165
168
|
*/
|
|
166
169
|
export declare const instancedDynamicBufferAttribute: (
|
|
@@ -4,7 +4,7 @@ import { ShaderNodeObject } from "../tsl/TSLCore.js";
|
|
|
4
4
|
|
|
5
5
|
export function lightShadowMatrix(light: Light): ShaderNodeObject<Node>;
|
|
6
6
|
|
|
7
|
-
export function lightProjectionUV(light: Light): ShaderNodeObject<Node>;
|
|
7
|
+
export function lightProjectionUV(light: Light, position?: Node): ShaderNodeObject<Node>;
|
|
8
8
|
|
|
9
9
|
export function lightPosition(light: Light): ShaderNodeObject<Node>;
|
|
10
10
|
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { Matrix4 } from "../../math/Matrix4.js";
|
|
1
2
|
import UniformNode from "../core/UniformNode.js";
|
|
2
3
|
import { ShaderNodeObject } from "../tsl/TSLCore.js";
|
|
3
4
|
|
|
4
5
|
export const materialRefractionRatio: ShaderNodeObject<UniformNode<number>>;
|
|
6
|
+
|
|
7
|
+
export const materialEnvIntensity: ShaderNodeObject<UniformNode<number>>;
|
|
8
|
+
|
|
9
|
+
export const materialEnvRotation: ShaderNodeObject<UniformNode<Matrix4>>;
|
|
@@ -16,6 +16,7 @@ export const modelWorldMatrix: ShaderNodeObject<ModelNode>;
|
|
|
16
16
|
export const modelPosition: ShaderNodeObject<ModelNode>;
|
|
17
17
|
export const modelScale: ShaderNodeObject<ModelNode>;
|
|
18
18
|
export const modelViewPosition: ShaderNodeObject<ModelNode>;
|
|
19
|
+
export const modelRadius: ShaderNodeObject<ModelNode>;
|
|
19
20
|
export const modelNormalMatrix: ShaderNodeObject<Node>;
|
|
20
21
|
export const modelWorldMatrixInverse: ShaderNodeObject<UniformNode<Matrix4>>;
|
|
21
22
|
|
|
@@ -13,10 +13,12 @@ export default class Object3DNode extends Node {
|
|
|
13
13
|
static SCALE: "scale";
|
|
14
14
|
static VIEW_POSITION: "viewPosition";
|
|
15
15
|
static DIRECTION: "direction";
|
|
16
|
+
static RADIUS: "radius";
|
|
16
17
|
}
|
|
17
18
|
|
|
18
|
-
export const objectDirection: (object3d
|
|
19
|
-
export const objectWorldMatrix: (object3d
|
|
20
|
-
export const objectPosition: (object3d
|
|
21
|
-
export const objectScale: (object3d
|
|
22
|
-
export const objectViewPosition: (object3d
|
|
19
|
+
export const objectDirection: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
|
|
20
|
+
export const objectWorldMatrix: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
|
|
21
|
+
export const objectPosition: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
|
|
22
|
+
export const objectScale: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
|
|
23
|
+
export const objectViewPosition: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
|
|
24
|
+
export const objectRadius: (object3d?: Object3D | null) => ShaderNodeObject<Object3DNode>;
|
|
@@ -12,6 +12,6 @@ export default class Texture3DNode extends TextureNode {
|
|
|
12
12
|
|
|
13
13
|
export const texture3D: (
|
|
14
14
|
value: Texture,
|
|
15
|
-
uvNode?: NodeRepresentation,
|
|
16
|
-
levelNode?: NodeRepresentation,
|
|
15
|
+
uvNode?: NodeRepresentation | null,
|
|
16
|
+
levelNode?: NodeRepresentation | null,
|
|
17
17
|
) => ShaderNodeObject<Texture3DNode>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { DirectLightData, DirectRectAreaLightData } from "../lighting/LightsNode.js";
|
|
1
2
|
import Node from "./Node.js";
|
|
2
3
|
import NodeBuilder from "./NodeBuilder.js";
|
|
3
|
-
import StackNode from "./StackNode.js";
|
|
4
4
|
|
|
5
5
|
export interface LightingModelReflectedLight {
|
|
6
6
|
directDiffuse: Node;
|
|
@@ -9,38 +9,23 @@ export interface LightingModelReflectedLight {
|
|
|
9
9
|
indirectSpecular: Node;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
export interface LightingModelDirectInput {
|
|
13
|
-
|
|
14
|
-
lightColor: Node;
|
|
12
|
+
export interface LightingModelDirectInput extends DirectLightData {
|
|
13
|
+
lightNode: Node;
|
|
15
14
|
reflectedLight: LightingModelReflectedLight;
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
export interface LightingModelDirectRectAreaInput {
|
|
19
|
-
|
|
20
|
-
lightPosition: Node;
|
|
21
|
-
halfWidth: Node;
|
|
22
|
-
halfHeight: Node;
|
|
17
|
+
export interface LightingModelDirectRectAreaInput extends DirectRectAreaLightData {
|
|
18
|
+
lightNode: Node;
|
|
23
19
|
reflectedLight: LightingModelReflectedLight;
|
|
24
|
-
ltc_1: Node;
|
|
25
|
-
ltc_2: Node;
|
|
26
20
|
}
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
backdropAlpha: Node;
|
|
36
|
-
outgoingLight: Node;
|
|
22
|
+
declare class LightingModel {
|
|
23
|
+
start(builder: NodeBuilder): void;
|
|
24
|
+
finish(builder: NodeBuilder): void;
|
|
25
|
+
direct(lightData: LightingModelDirectInput, builder: NodeBuilder): void;
|
|
26
|
+
directRectArea(lightData: LightingModelDirectRectAreaInput, builder: NodeBuilder): void;
|
|
27
|
+
indirect(builder: NodeBuilder): void;
|
|
28
|
+
ambientOcclusion(builder: NodeBuilder): void;
|
|
37
29
|
}
|
|
38
30
|
|
|
39
|
-
export default
|
|
40
|
-
start(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void;
|
|
41
|
-
finish(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void;
|
|
42
|
-
direct(input: LightingModelDirectInput, stack: StackNode, builder: NodeBuilder): void;
|
|
43
|
-
directRectArea(input: LightingModelDirectRectAreaInput, stack: StackNode, builder: NodeBuilder): void;
|
|
44
|
-
indirect(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void;
|
|
45
|
-
ambientOcclusion(input: LightingModelIndirectInput, stack: StackNode, builder: NodeBuilder): void;
|
|
46
|
-
}
|
|
31
|
+
export default LightingModel;
|