@types/three 0.181.0 → 0.182.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/controls/ArcballControls.d.ts +1 -1
- three/examples/jsm/controls/DragControls.d.ts +1 -1
- three/examples/jsm/controls/FirstPersonControls.d.ts +1 -1
- three/examples/jsm/controls/FlyControls.d.ts +1 -1
- three/examples/jsm/controls/OrbitControls.d.ts +1 -1
- three/examples/jsm/controls/PointerLockControls.d.ts +1 -1
- three/examples/jsm/controls/TrackballControls.d.ts +1 -1
- three/examples/jsm/controls/TransformControls.d.ts +1 -1
- three/examples/jsm/loaders/UltraHDRLoader.d.ts +7 -0
- three/examples/jsm/loaders/VOXLoader.d.ts +22 -5
- three/examples/jsm/math/Octree.d.ts +36 -14
- three/examples/jsm/objects/SkyMesh.d.ts +5 -0
- three/examples/jsm/physics/AmmoPhysics.d.ts +1 -1
- three/examples/jsm/postprocessing/OutputPass.d.ts +10 -6
- three/examples/jsm/postprocessing/RenderPass.d.ts +15 -10
- three/examples/jsm/transpiler/AST.d.ts +17 -0
- three/examples/jsm/transpiler/TSLEncoder.d.ts +2 -0
- three/examples/jsm/tsl/display/BleachBypass.d.ts +1 -1
- three/examples/jsm/tsl/display/SSSNode.d.ts +2 -0
- three/examples/jsm/tsl/display/TRAANode.d.ts +5 -0
- three/examples/jsm/tsl/display/radialBlur.d.ts +12 -0
- three/package.json +3 -3
- three/src/Three.TSL.d.ts +14 -2
- three/src/animation/AnimationMixer.d.ts +42 -0
- three/src/animation/AnimationUtils.d.ts +3 -8
- three/src/constants.d.ts +14 -0
- three/src/core/BufferGeometry.d.ts +3 -1
- three/src/extras/Controls.d.ts +3 -3
- three/src/lights/DirectionalLight.d.ts +10 -2
- three/src/lights/HemisphereLight.d.ts +8 -1
- three/src/lights/Light.d.ts +8 -12
- three/src/lights/LightProbe.d.ts +7 -3
- three/src/lights/PointLight.d.ts +12 -1
- three/src/lights/PointLightShadow.d.ts +1 -8
- three/src/lights/SpotLight.d.ts +17 -2
- three/src/materials/Material.d.ts +1 -0
- three/src/materials/ShaderMaterial.d.ts +18 -3
- three/src/materials/nodes/NodeMaterial.d.ts +7 -0
- three/src/nodes/TSL.d.ts +4 -1
- three/src/nodes/accessors/BufferAttributeNode.d.ts +13 -12
- three/src/nodes/accessors/InstanceNode.d.ts +7 -6
- three/src/nodes/accessors/Texture3DNode.d.ts +12 -0
- three/src/nodes/core/ContextNode.d.ts +19 -3
- three/src/nodes/core/NodeUtils.d.ts +1 -1
- three/src/nodes/core/PropertyNode.d.ts +2 -0
- three/src/nodes/display/NormalMapNode.d.ts +3 -1
- three/src/nodes/display/PassNode.d.ts +8 -0
- three/src/nodes/functions/BSDF/DFGLUT.d.ts +12 -0
- three/src/nodes/functions/PhysicalLightingModel.d.ts +8 -1
- three/src/nodes/lighting/AnalyticLightNode.d.ts +2 -0
- three/src/nodes/lighting/PointShadowNode.d.ts +11 -15
- three/src/nodes/lighting/ShadowFilterNode.d.ts +2 -0
- three/src/nodes/math/BitcountNode.d.ts +21 -0
- three/src/nodes/math/PackFloatNode.d.ts +19 -0
- three/src/nodes/math/UnpackFloatNode.d.ts +18 -0
- three/src/nodes/tsl/TSLCore.d.ts +18 -18
- three/src/nodes/utils/Packing.d.ts +1 -0
- three/src/nodes/utils/PostProcessingUtils.d.ts +2 -0
- three/src/nodes/utils/UVUtils.d.ts +3 -0
- three/src/objects/LOD.d.ts +1 -1
- three/src/objects/Skeleton.d.ts +4 -2
- three/src/renderers/WebGLRenderer.d.ts +22 -4
- three/src/renderers/common/Binding.d.ts +6 -0
- three/src/renderers/common/Buffer.d.ts +24 -0
- three/src/renderers/common/ChainMap.d.ts +8 -1
- three/src/renderers/common/Geometries.d.ts +7 -0
- three/src/renderers/common/RenderContexts.d.ts +3 -1
- three/src/renderers/common/RenderObject.d.ts +6 -0
- three/src/renderers/common/Renderer.d.ts +24 -13
- three/src/renderers/common/UniformsGroup.d.ts +1 -0
- three/src/renderers/shaders/ShaderLib.d.ts +1 -1
- three/src/renderers/webgl/WebGLCapabilities.d.ts +2 -2
- three/src/renderers/webgl/WebGLPrograms.d.ts +0 -1
- three/src/textures/CubeDepthTexture.d.ts +41 -0
- three/src/textures/CubeTexture.d.ts +4 -4
- three/src/utils.d.ts +13 -1
- three/src/nodes/functions/BSDF/DFGApprox.d.ts +0 -10
|
@@ -1,8 +1,14 @@
|
|
|
1
|
-
import { Object3D } from "../core/Object3D.js";
|
|
1
|
+
import { JSONMeta, Object3D } from "../core/Object3D.js";
|
|
2
2
|
import { ColorRepresentation } from "../math/Color.js";
|
|
3
3
|
import { Vector3 } from "../math/Vector3.js";
|
|
4
4
|
import { DirectionalLightShadow } from "./DirectionalLightShadow.js";
|
|
5
|
-
import { Light } from "./Light.js";
|
|
5
|
+
import { Light, LightJSON } from "./Light.js";
|
|
6
|
+
import { LightShadowJSON } from "./LightShadow.js";
|
|
7
|
+
|
|
8
|
+
export interface DirectionalLightJSON extends LightJSON {
|
|
9
|
+
shadow: LightShadowJSON;
|
|
10
|
+
target: string;
|
|
11
|
+
}
|
|
6
12
|
|
|
7
13
|
/**
|
|
8
14
|
* A light that gets emitted in a specific direction
|
|
@@ -99,4 +105,6 @@ export class DirectionalLight extends Light<DirectionalLightShadow> {
|
|
|
99
105
|
* Call this method whenever this instance is no longer used in your app.
|
|
100
106
|
*/
|
|
101
107
|
dispose(): void;
|
|
108
|
+
|
|
109
|
+
toJSON(meta?: JSONMeta): DirectionalLightJSON;
|
|
102
110
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { JSONMeta } from "../core/Object3D.js";
|
|
1
2
|
import { Color, ColorRepresentation } from "../math/Color.js";
|
|
2
3
|
import { Vector3 } from "../math/Vector3.js";
|
|
3
|
-
import { Light } from "./Light.js";
|
|
4
|
+
import { Light, LightJSON } from "./Light.js";
|
|
5
|
+
|
|
6
|
+
export interface HemisphereLightJSON extends LightJSON {
|
|
7
|
+
groundColor: number;
|
|
8
|
+
}
|
|
4
9
|
|
|
5
10
|
/**
|
|
6
11
|
* A light source positioned directly above the scene, with color fading from the sky color to the ground color.
|
|
@@ -58,4 +63,6 @@ export class HemisphereLight extends Light<undefined> {
|
|
|
58
63
|
* @defaultValue `new THREE.Color()` set to white _(0xffffff)_.
|
|
59
64
|
*/
|
|
60
65
|
groundColor: Color;
|
|
66
|
+
|
|
67
|
+
toJSON(meta?: JSONMeta): HemisphereLightJSON;
|
|
61
68
|
}
|
three/src/lights/Light.d.ts
CHANGED
|
@@ -1,27 +1,23 @@
|
|
|
1
|
-
import { JSONMeta, Object3D, Object3DJSON } from "../core/Object3D.js";
|
|
1
|
+
import { JSONMeta, Object3D, Object3DEventMap, Object3DJSON } from "../core/Object3D.js";
|
|
2
2
|
import { Color, ColorRepresentation } from "../math/Color.js";
|
|
3
|
-
import { LightShadow
|
|
3
|
+
import { LightShadow } from "./LightShadow.js";
|
|
4
4
|
|
|
5
5
|
export interface LightJSON extends Object3DJSON {
|
|
6
6
|
color: number;
|
|
7
7
|
intensity: number;
|
|
8
|
+
}
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
distance?: number;
|
|
12
|
-
angle?: number;
|
|
13
|
-
decay?: number;
|
|
14
|
-
penumbra?: number;
|
|
15
|
-
|
|
16
|
-
shadow?: LightShadowJSON;
|
|
17
|
-
target?: string;
|
|
10
|
+
export interface LightEventMap extends Object3DEventMap {
|
|
11
|
+
dispose: {};
|
|
18
12
|
}
|
|
19
13
|
|
|
20
14
|
/**
|
|
21
15
|
* Abstract base class for lights.
|
|
22
16
|
* @remarks All other light types inherit the properties and methods described here.
|
|
23
17
|
*/
|
|
24
|
-
export abstract class Light<TShadowSupport extends LightShadow | undefined = LightShadow | undefined>
|
|
18
|
+
export abstract class Light<TShadowSupport extends LightShadow | undefined = LightShadow | undefined>
|
|
19
|
+
extends Object3D<LightEventMap>
|
|
20
|
+
{
|
|
25
21
|
/**
|
|
26
22
|
* Creates a new {@link Light}
|
|
27
23
|
* @remarks
|
three/src/lights/LightProbe.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { JSONMeta } from "../core/Object3D.js";
|
|
1
2
|
import { SphericalHarmonics3 } from "../math/SphericalHarmonics3.js";
|
|
2
|
-
import { Light } from "./Light.js";
|
|
3
|
+
import { Light, LightJSON } from "./Light.js";
|
|
4
|
+
|
|
5
|
+
export interface LightProbeJSON extends LightJSON {
|
|
6
|
+
sh: number[];
|
|
7
|
+
}
|
|
3
8
|
|
|
4
9
|
/**
|
|
5
10
|
* Light probes are an alternative way of adding light to a 3D scene.
|
|
@@ -42,6 +47,5 @@ export class LightProbe extends Light {
|
|
|
42
47
|
*/
|
|
43
48
|
sh: SphericalHarmonics3;
|
|
44
49
|
|
|
45
|
-
|
|
46
|
-
fromJSON(json: {}): LightProbe;
|
|
50
|
+
toJSON(meta?: JSONMeta): LightProbeJSON;
|
|
47
51
|
}
|
three/src/lights/PointLight.d.ts
CHANGED
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
import { JSONMeta } from "../core/Object3D.js";
|
|
1
2
|
import { ColorRepresentation } from "../math/Color.js";
|
|
2
|
-
import { Light } from "./Light.js";
|
|
3
|
+
import { Light, LightJSON } from "./Light.js";
|
|
4
|
+
import { LightShadowJSON } from "./LightShadow.js";
|
|
3
5
|
import { PointLightShadow } from "./PointLightShadow.js";
|
|
4
6
|
|
|
7
|
+
export interface PointLightJSON extends LightJSON {
|
|
8
|
+
distance: number;
|
|
9
|
+
decay: number;
|
|
10
|
+
|
|
11
|
+
shadow: LightShadowJSON;
|
|
12
|
+
}
|
|
13
|
+
|
|
5
14
|
/**
|
|
6
15
|
* A light that gets emitted from a single point in all directions
|
|
7
16
|
* @remarks
|
|
@@ -99,4 +108,6 @@ export class PointLight extends Light<PointLightShadow> {
|
|
|
99
108
|
* @remarks Expects a `Float`
|
|
100
109
|
*/
|
|
101
110
|
power: number;
|
|
111
|
+
|
|
112
|
+
toJSON(meta?: JSONMeta): PointLightJSON;
|
|
102
113
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PerspectiveCamera } from "../cameras/PerspectiveCamera.js";
|
|
2
|
-
import { Light } from "./Light.js";
|
|
3
2
|
import { LightShadow } from "./LightShadow.js";
|
|
4
3
|
|
|
5
4
|
/**
|
|
@@ -12,11 +11,5 @@ export class PointLightShadow extends LightShadow<PerspectiveCamera> {
|
|
|
12
11
|
* @remarks This is a _constant_ value
|
|
13
12
|
* @defaultValue `true`
|
|
14
13
|
*/
|
|
15
|
-
readonly isPointLightShadow
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Update the matrices for the camera and shadow, used internally by the renderer.
|
|
19
|
-
* @param light The light for which the shadow is being rendered.
|
|
20
|
-
*/
|
|
21
|
-
override updateMatrices(light: Light, viewportIndex?: number): void;
|
|
14
|
+
readonly isPointLightShadow: true;
|
|
22
15
|
}
|
three/src/lights/SpotLight.d.ts
CHANGED
|
@@ -1,10 +1,23 @@
|
|
|
1
|
-
import { Object3D } from "../core/Object3D.js";
|
|
1
|
+
import { JSONMeta, Object3D } from "../core/Object3D.js";
|
|
2
2
|
import { ColorRepresentation } from "../math/Color.js";
|
|
3
3
|
import { Vector3 } from "../math/Vector3.js";
|
|
4
4
|
import { Texture } from "../textures/Texture.js";
|
|
5
|
-
import { Light } from "./Light.js";
|
|
5
|
+
import { Light, LightJSON } from "./Light.js";
|
|
6
|
+
import { LightShadowJSON } from "./LightShadow.js";
|
|
6
7
|
import { SpotLightShadow } from "./SpotLightShadow.js";
|
|
7
8
|
|
|
9
|
+
export interface SpotLightJSON extends LightJSON {
|
|
10
|
+
distance: number;
|
|
11
|
+
angle: number;
|
|
12
|
+
decay: number;
|
|
13
|
+
penumbra: number;
|
|
14
|
+
|
|
15
|
+
target: string;
|
|
16
|
+
map?: string | undefined;
|
|
17
|
+
|
|
18
|
+
shadow: LightShadowJSON;
|
|
19
|
+
}
|
|
20
|
+
|
|
8
21
|
/**
|
|
9
22
|
* This light gets emitted from a single point in one direction, along a cone that increases in size the further from the light it gets.
|
|
10
23
|
* @example
|
|
@@ -161,4 +174,6 @@ export class SpotLight extends Light<SpotLightShadow> {
|
|
|
161
174
|
* @remarks **Warning**: {@link SpotLight.map} is disabled if {@link SpotLight.castShadow} is `false`.
|
|
162
175
|
*/
|
|
163
176
|
map: Texture | null;
|
|
177
|
+
|
|
178
|
+
toJSON(meta?: JSONMeta): SpotLightJSON;
|
|
164
179
|
}
|
|
@@ -548,6 +548,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
|
|
|
548
548
|
* @default 0
|
|
549
549
|
*/
|
|
550
550
|
readonly version: number;
|
|
551
|
+
defines?: Record<string, unknown> | undefined;
|
|
551
552
|
/**
|
|
552
553
|
* An optional callback that is executed immediately before the material is used to render a 3D object.
|
|
553
554
|
*
|
|
@@ -26,7 +26,7 @@ export interface ShaderMaterialProperties extends MaterialProperties {
|
|
|
26
26
|
* #define BAR true
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
defines:
|
|
29
|
+
defines: Record<string, unknown>;
|
|
30
30
|
/**
|
|
31
31
|
* An object of the form:
|
|
32
32
|
* ```js
|
|
@@ -85,9 +85,22 @@ export interface ShaderMaterialProperties extends MaterialProperties {
|
|
|
85
85
|
*/
|
|
86
86
|
wireframeLinewidth: number;
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* Defines whether the material color is affected by global fog settings; `true`
|
|
89
89
|
* to pass fog uniforms to the shader.
|
|
90
90
|
*
|
|
91
|
+
* Setting this property to `true` requires the definition of fog uniforms. It is
|
|
92
|
+
* recommended to use `UniformsUtils.merge()` to combine the custom shader uniforms
|
|
93
|
+
* with predefined fog uniforms.
|
|
94
|
+
*
|
|
95
|
+
* ```js
|
|
96
|
+
* const material = new ShaderMaterial( {
|
|
97
|
+
* uniforms: UniformsUtils.merge( [ UniformsLib[ 'fog' ], shaderUniforms ] );
|
|
98
|
+
* vertexShader: vertexShader,
|
|
99
|
+
* fragmentShader: fragmentShader,
|
|
100
|
+
* fog: true
|
|
101
|
+
* } );
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
91
104
|
* @default false
|
|
92
105
|
*/
|
|
93
106
|
fog: boolean;
|
|
@@ -248,4 +261,6 @@ export class ShaderMaterial extends Material {
|
|
|
248
261
|
}
|
|
249
262
|
|
|
250
263
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
251
|
-
export interface ShaderMaterial extends ShaderMaterialProperties {
|
|
264
|
+
export interface ShaderMaterial extends ShaderMaterialProperties {
|
|
265
|
+
defines: Record<string, unknown>;
|
|
266
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import ClippingNode from "../../nodes/accessors/ClippingNode.js";
|
|
2
|
+
import ContextNode from "../../nodes/core/ContextNode.js";
|
|
2
3
|
import LightingModel from "../../nodes/core/LightingModel.js";
|
|
3
4
|
import MRTNode from "../../nodes/core/MRTNode.js";
|
|
4
5
|
import Node from "../../nodes/core/Node.js";
|
|
@@ -272,6 +273,12 @@ export interface NodeMaterialNodeProperties {
|
|
|
272
273
|
* @default null
|
|
273
274
|
*/
|
|
274
275
|
vertexNode: Node | null;
|
|
276
|
+
/**
|
|
277
|
+
* This node can be used as a global context management component for this material.
|
|
278
|
+
*
|
|
279
|
+
* @default null
|
|
280
|
+
*/
|
|
281
|
+
contextNode: ContextNode | null;
|
|
275
282
|
}
|
|
276
283
|
|
|
277
284
|
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
three/src/nodes/TSL.d.ts
CHANGED
|
@@ -20,9 +20,12 @@ export * from "./core/VaryingNode.js";
|
|
|
20
20
|
|
|
21
21
|
// math
|
|
22
22
|
export * from "./math/BitcastNode.js";
|
|
23
|
+
export * from "./math/BitcountNode.js";
|
|
23
24
|
export * from "./math/Hash.js";
|
|
24
25
|
export * from "./math/MathUtils.js";
|
|
26
|
+
export * from "./math/PackFloatNode.js";
|
|
25
27
|
export * from "./math/TriNoise3D.js";
|
|
28
|
+
export * from "./math/UnpackFloatNode.js";
|
|
26
29
|
|
|
27
30
|
// utils
|
|
28
31
|
export * from "./utils/EquirectUV.js";
|
|
@@ -160,7 +163,7 @@ export * from "./materialx/MaterialXNodes.js";
|
|
|
160
163
|
export { default as BRDF_GGX } from "./functions/BSDF/BRDF_GGX.js";
|
|
161
164
|
export { default as BRDF_Lambert } from "./functions/BSDF/BRDF_Lambert.js";
|
|
162
165
|
export { default as D_GGX } from "./functions/BSDF/D_GGX.js";
|
|
163
|
-
export { default as
|
|
166
|
+
export { default as DFGLUT } from "./functions/BSDF/DFGLUT.js";
|
|
164
167
|
export { default as F_Schlick } from "./functions/BSDF/F_Schlick.js";
|
|
165
168
|
export { default as Schlick_to_F0 } from "./functions/BSDF/Schlick_to_F0.js";
|
|
166
169
|
export { default as V_GGX_SmithCorrelated } from "./functions/BSDF/V_GGX_SmithCorrelated.js";
|
|
@@ -3,6 +3,7 @@ import { BufferAttribute, TypedArray } from "../../core/BufferAttribute.js";
|
|
|
3
3
|
import { InterleavedBuffer } from "../../core/InterleavedBuffer.js";
|
|
4
4
|
import { InterleavedBufferAttribute } from "../../core/InterleavedBufferAttribute.js";
|
|
5
5
|
import InputNode from "../core/InputNode.js";
|
|
6
|
+
import Node from "../core/Node.js";
|
|
6
7
|
import NodeBuilder from "../core/NodeBuilder.js";
|
|
7
8
|
/**
|
|
8
9
|
* In earlier `three.js` versions it was only possible to define attribute data
|
|
@@ -112,14 +113,14 @@ export default BufferAttributeNode;
|
|
|
112
113
|
* @param {?string} [type=null] - The buffer type (e.g. `'vec3'`).
|
|
113
114
|
* @param {number} [stride=0] - The buffer stride.
|
|
114
115
|
* @param {number} [offset=0] - The buffer offset.
|
|
115
|
-
* @returns {BufferAttributeNode}
|
|
116
|
+
* @returns {BufferAttributeNode|Node}
|
|
116
117
|
*/
|
|
117
118
|
export declare const bufferAttribute: (
|
|
118
|
-
array:
|
|
119
|
+
array: BufferAttribute | InterleavedBuffer | TypedArray,
|
|
119
120
|
type?: string | null,
|
|
120
121
|
stride?: number,
|
|
121
122
|
offset?: number,
|
|
122
|
-
) =>
|
|
123
|
+
) => Node;
|
|
123
124
|
/**
|
|
124
125
|
* TSL function for creating a buffer attribute node but with dynamic draw usage.
|
|
125
126
|
* Use this function if attribute data are updated per frame.
|
|
@@ -130,14 +131,14 @@ export declare const bufferAttribute: (
|
|
|
130
131
|
* @param {?string} [type=null] - The buffer type (e.g. `'vec3'`).
|
|
131
132
|
* @param {number} [stride=0] - The buffer stride.
|
|
132
133
|
* @param {number} [offset=0] - The buffer offset.
|
|
133
|
-
* @returns {BufferAttributeNode}
|
|
134
|
+
* @returns {BufferAttributeNode|Node}
|
|
134
135
|
*/
|
|
135
136
|
export declare const dynamicBufferAttribute: (
|
|
136
|
-
array:
|
|
137
|
+
array: BufferAttribute | InterleavedBuffer | TypedArray,
|
|
137
138
|
type?: string | null,
|
|
138
139
|
stride?: number,
|
|
139
140
|
offset?: number,
|
|
140
|
-
) =>
|
|
141
|
+
) => Node;
|
|
141
142
|
/**
|
|
142
143
|
* TSL function for creating a buffer attribute node but with enabled instancing
|
|
143
144
|
*
|
|
@@ -147,14 +148,14 @@ export declare const dynamicBufferAttribute: (
|
|
|
147
148
|
* @param {?string} [type=null] - The buffer type (e.g. `'vec3'`).
|
|
148
149
|
* @param {number} [stride=0] - The buffer stride.
|
|
149
150
|
* @param {number} [offset=0] - The buffer offset.
|
|
150
|
-
* @returns {BufferAttributeNode}
|
|
151
|
+
* @returns {BufferAttributeNode|Node}
|
|
151
152
|
*/
|
|
152
153
|
export declare const instancedBufferAttribute: (
|
|
153
|
-
array:
|
|
154
|
+
array: BufferAttribute | InterleavedBuffer | TypedArray,
|
|
154
155
|
type?: string | null,
|
|
155
156
|
stride?: number,
|
|
156
157
|
offset?: number,
|
|
157
|
-
) =>
|
|
158
|
+
) => Node;
|
|
158
159
|
/**
|
|
159
160
|
* TSL function for creating a buffer attribute node but with dynamic draw usage and enabled instancing
|
|
160
161
|
*
|
|
@@ -164,14 +165,14 @@ export declare const instancedBufferAttribute: (
|
|
|
164
165
|
* @param {?string} [type=null] - The buffer type (e.g. `'vec3'`).
|
|
165
166
|
* @param {number} [stride=0] - The buffer stride.
|
|
166
167
|
* @param {number} [offset=0] - The buffer offset.
|
|
167
|
-
* @returns {BufferAttributeNode}
|
|
168
|
+
* @returns {BufferAttributeNode|Node}
|
|
168
169
|
*/
|
|
169
170
|
export declare const instancedDynamicBufferAttribute: (
|
|
170
|
-
array:
|
|
171
|
+
array: BufferAttribute | InterleavedBuffer | TypedArray,
|
|
171
172
|
type?: string | null,
|
|
172
173
|
stride?: number,
|
|
173
174
|
offset?: number,
|
|
174
|
-
) =>
|
|
175
|
+
) => Node;
|
|
175
176
|
declare module "../Nodes.js" {
|
|
176
177
|
interface BufferNode<TValue> {
|
|
177
178
|
toAttribute: () => BufferAttributeNode;
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { InstancedBufferAttribute } from "../../core/InstancedBufferAttribute.js";
|
|
2
|
+
import StorageInstancedBufferAttribute from "../../renderers/common/StorageInstancedBufferAttribute.js";
|
|
2
3
|
import Node from "../core/Node.js";
|
|
3
4
|
|
|
4
5
|
export default class InstanceNode extends Node {
|
|
5
6
|
count: number;
|
|
6
|
-
instanceMatrix: InstancedBufferAttribute;
|
|
7
|
-
instanceColor: InstancedBufferAttribute | null;
|
|
7
|
+
instanceMatrix: InstancedBufferAttribute | StorageInstancedBufferAttribute;
|
|
8
|
+
instanceColor: InstancedBufferAttribute | StorageInstancedBufferAttribute | null;
|
|
8
9
|
|
|
9
10
|
instanceMatrixNode: Node | null;
|
|
10
11
|
instanceColorNode: Node | null;
|
|
11
12
|
|
|
12
13
|
constructor(
|
|
13
14
|
count: number,
|
|
14
|
-
instanceMatrix: InstancedBufferAttribute,
|
|
15
|
-
instanceColor?: InstancedBufferAttribute | null,
|
|
15
|
+
instanceMatrix: InstancedBufferAttribute | StorageInstancedBufferAttribute,
|
|
16
|
+
instanceColor?: InstancedBufferAttribute | StorageInstancedBufferAttribute | null,
|
|
16
17
|
);
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
export const instance: (
|
|
20
21
|
count: number,
|
|
21
|
-
instanceMatrix: InstancedBufferAttribute,
|
|
22
|
-
instanceColor?: InstancedBufferAttribute | null,
|
|
22
|
+
instanceMatrix: InstancedBufferAttribute | StorageInstancedBufferAttribute,
|
|
23
|
+
instanceColor?: InstancedBufferAttribute | StorageInstancedBufferAttribute | null,
|
|
23
24
|
) => InstanceNode;
|
|
@@ -15,3 +15,15 @@ export const texture3D: (
|
|
|
15
15
|
uvNode?: Node | null,
|
|
16
16
|
levelNode?: Node | number | null,
|
|
17
17
|
) => Texture3DNode;
|
|
18
|
+
|
|
19
|
+
export const texture3DLoad: (
|
|
20
|
+
value: Texture,
|
|
21
|
+
uvNode?: Node | null,
|
|
22
|
+
levelNode?: Node | number | null,
|
|
23
|
+
) => Texture3DNode;
|
|
24
|
+
|
|
25
|
+
export const texture3DLevel: (
|
|
26
|
+
value: Texture,
|
|
27
|
+
uvNode?: Node | null,
|
|
28
|
+
levelNode?: Node | number | null,
|
|
29
|
+
) => Texture3DNode;
|
|
@@ -1,23 +1,33 @@
|
|
|
1
|
+
import { Light } from "../../lights/Light.js";
|
|
1
2
|
import Node from "./Node.js";
|
|
2
3
|
import { NodeBuilderContext } from "./NodeBuilder.js";
|
|
3
4
|
|
|
4
5
|
declare class ContextNode extends Node {
|
|
5
6
|
readonly isContextNode: true;
|
|
6
7
|
|
|
7
|
-
node: Node;
|
|
8
|
+
node: Node | null;
|
|
8
9
|
value: NodeBuilderContext;
|
|
9
10
|
|
|
10
|
-
constructor(node
|
|
11
|
+
constructor(node?: Node | null, value?: NodeBuilderContext);
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export default ContextNode;
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
interface ContextFunction {
|
|
17
|
+
(value?: NodeBuilderContext): ContextNode;
|
|
18
|
+
(node: Node, value?: NodeBuilderContext): ContextNode;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const context: ContextFunction;
|
|
16
22
|
|
|
17
23
|
export const uniformFlow: (node: Node) => ContextNode;
|
|
18
24
|
|
|
19
25
|
export const setName: (node: Node, label: string) => Node;
|
|
20
26
|
|
|
27
|
+
export function builtinShadowContext(shadowNode: Node, light: Light, node?: Node | null): ContextNode;
|
|
28
|
+
|
|
29
|
+
export function builtinAOContext(aoNode: Node, node?: Node | null): ContextNode;
|
|
30
|
+
|
|
21
31
|
/**
|
|
22
32
|
* @deprecated "label()" has been deprecated. Use "setName()" instead.
|
|
23
33
|
*/
|
|
@@ -42,5 +52,11 @@ declare module "../Nodes.js" {
|
|
|
42
52
|
|
|
43
53
|
setName: (label: string) => Node;
|
|
44
54
|
setNameAssign: (label: string) => this;
|
|
55
|
+
|
|
56
|
+
builtinShadowContext: (shadowNode: Node, light: Light) => ContextNode;
|
|
57
|
+
builtinShadowContextAssign: (shadowNode: Node, light: Light) => this;
|
|
58
|
+
|
|
59
|
+
builtinAOContext: (aoValue: Node) => ContextNode;
|
|
60
|
+
builtinAOContextAssign: (aoValue: Node) => this;
|
|
45
61
|
}
|
|
46
62
|
}
|
|
@@ -16,7 +16,7 @@ export function getLengthFromType(type: string): number | undefined;
|
|
|
16
16
|
|
|
17
17
|
export function getMemoryLengthFromType(type: string): number | undefined;
|
|
18
18
|
|
|
19
|
-
export function
|
|
19
|
+
export function getAlignmentFromType(type: string): number | undefined;
|
|
20
20
|
|
|
21
21
|
export function getValueType(value: unknown): string | null;
|
|
22
22
|
|
|
@@ -13,6 +13,7 @@ export const property: (type?: string | null, name?: string | null) => PropertyN
|
|
|
13
13
|
export const varyingProperty: (type?: string | null, name?: string | null) => PropertyNode;
|
|
14
14
|
|
|
15
15
|
export const diffuseColor: PropertyNode;
|
|
16
|
+
export const diffuseContribution: PropertyNode;
|
|
16
17
|
export const emissive: PropertyNode;
|
|
17
18
|
export const roughness: PropertyNode;
|
|
18
19
|
export const metalness: PropertyNode;
|
|
@@ -28,6 +29,7 @@ export const anisotropy: PropertyNode;
|
|
|
28
29
|
export const anisotropyT: PropertyNode;
|
|
29
30
|
export const anisotropyB: PropertyNode;
|
|
30
31
|
export const specularColor: PropertyNode;
|
|
32
|
+
export const specularColorBlended: PropertyNode;
|
|
31
33
|
export const specularF90: PropertyNode;
|
|
32
34
|
export const shininess: PropertyNode;
|
|
33
35
|
export const output: PropertyNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NormalMapTypes } from "../../constants.js";
|
|
1
|
+
import { NormalMapTypes, NormalPacking } from "../../constants.js";
|
|
2
2
|
import Node from "../core/Node.js";
|
|
3
3
|
import TempNode from "../core/TempNode.js";
|
|
4
4
|
|
|
@@ -8,6 +8,8 @@ declare class NormalMapNode extends TempNode {
|
|
|
8
8
|
|
|
9
9
|
normalMapType: NormalMapTypes;
|
|
10
10
|
|
|
11
|
+
unpackNormalMode: NormalPacking;
|
|
12
|
+
|
|
11
13
|
constructor(node: Node, scaleNode?: Node | null);
|
|
12
14
|
}
|
|
13
15
|
|
|
@@ -2,10 +2,12 @@ import { Camera } from "../../cameras/Camera.js";
|
|
|
2
2
|
import { Layers } from "../../core/Layers.js";
|
|
3
3
|
import { Object3D } from "../../core/Object3D.js";
|
|
4
4
|
import { RenderTarget, RenderTargetOptions } from "../../core/RenderTarget.js";
|
|
5
|
+
import { Material } from "../../materials/Material.js";
|
|
5
6
|
import { Vector4 } from "../../math/Vector4.js";
|
|
6
7
|
import Renderer from "../../renderers/common/Renderer.js";
|
|
7
8
|
import { Texture } from "../../textures/Texture.js";
|
|
8
9
|
import TextureNode from "../accessors/TextureNode.js";
|
|
10
|
+
import ContextNode from "../core/ContextNode.js";
|
|
9
11
|
import MRTNode from "../core/MRTNode.js";
|
|
10
12
|
import Node from "../core/Node.js";
|
|
11
13
|
import TempNode from "../core/TempNode.js";
|
|
@@ -32,6 +34,12 @@ declare class PassNode extends TempNode {
|
|
|
32
34
|
|
|
33
35
|
renderTarget: RenderTarget;
|
|
34
36
|
|
|
37
|
+
overrideMaterial: Material | null;
|
|
38
|
+
transparent: boolean;
|
|
39
|
+
opaque: boolean;
|
|
40
|
+
|
|
41
|
+
contextNode: ContextNode | null;
|
|
42
|
+
|
|
35
43
|
readonly isPassNode: true;
|
|
36
44
|
|
|
37
45
|
constructor(scope: PassNodeScope, scene: Object3D, camera: Camera, options?: RenderTargetOptions);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import Node from "../../core/Node.js";
|
|
2
|
+
import OperatorNode from "../../math/OperatorNode.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Precomputed DFG LUT for Image-Based Lighting
|
|
6
|
+
* Resolution: 16x16
|
|
7
|
+
* Samples: 4096 per texel
|
|
8
|
+
* Format: RG16F (2 half floats per texel: scale, bias)
|
|
9
|
+
*/
|
|
10
|
+
declare const DFGLUT: (args: { roughness: Node; dotNV: Node }) => OperatorNode;
|
|
11
|
+
|
|
12
|
+
export default DFGLUT;
|
|
@@ -16,6 +16,8 @@ export default class PhysicalLightingModel extends LightingModel {
|
|
|
16
16
|
sheenSpecularIndirect: Node | null;
|
|
17
17
|
iridescenceFresnel: Node | null;
|
|
18
18
|
iridescenceF0: Node | null;
|
|
19
|
+
iridescenceF0Dielectric: Node | null;
|
|
20
|
+
iridescenceF0Metallic: Node | null;
|
|
19
21
|
|
|
20
22
|
constructor(
|
|
21
23
|
clearcoat?: boolean,
|
|
@@ -26,5 +28,10 @@ export default class PhysicalLightingModel extends LightingModel {
|
|
|
26
28
|
dispersion?: boolean,
|
|
27
29
|
);
|
|
28
30
|
|
|
29
|
-
computeMultiscattering(
|
|
31
|
+
computeMultiscattering(
|
|
32
|
+
singleScatter: Node,
|
|
33
|
+
multiScatter: Node,
|
|
34
|
+
specularF90: Node,
|
|
35
|
+
iridescenceF0?: Node | null,
|
|
36
|
+
): void;
|
|
30
37
|
}
|
|
@@ -3,22 +3,18 @@ import { LightShadow } from "../../lights/LightShadow.js";
|
|
|
3
3
|
import Node from "../core/Node.js";
|
|
4
4
|
import ShadowNode from "./ShadowNode.js";
|
|
5
5
|
|
|
6
|
-
export const
|
|
6
|
+
export const BasicPointShadowFilter: (params: {
|
|
7
|
+
depthTexture: Node;
|
|
8
|
+
bd3D: Node;
|
|
9
|
+
dp: Node;
|
|
10
|
+
}) => Node;
|
|
7
11
|
|
|
8
|
-
export const
|
|
9
|
-
depthTexture: Node
|
|
10
|
-
bd3D: Node
|
|
11
|
-
dp: Node
|
|
12
|
-
|
|
13
|
-
) => Node;
|
|
14
|
-
|
|
15
|
-
export const PointShadowFilter: (
|
|
16
|
-
depthTexture: Node,
|
|
17
|
-
bd3D: Node,
|
|
18
|
-
dp: Node,
|
|
19
|
-
texelSize: Node,
|
|
20
|
-
shadow: Node,
|
|
21
|
-
) => Node;
|
|
12
|
+
export const PointShadowFilter: (params: {
|
|
13
|
+
depthTexture: Node;
|
|
14
|
+
bd3D: Node;
|
|
15
|
+
dp: Node;
|
|
16
|
+
shadow: Node;
|
|
17
|
+
}) => Node;
|
|
22
18
|
|
|
23
19
|
declare class PointShadowNode extends ShadowNode {
|
|
24
20
|
constructor(light: Light, shadow: LightShadow | null);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import Node from "../core/Node.js";
|
|
2
|
+
import MathNode from "./MathNode.js";
|
|
3
|
+
|
|
4
|
+
export type BitcountNodeMethod =
|
|
5
|
+
| typeof BitcountNode.COUNT_TRAILING_ZEROS
|
|
6
|
+
| typeof BitcountNode.COUNT_LEADING_ZEROS
|
|
7
|
+
| typeof BitcountNode.COUNT_ONE_BITS;
|
|
8
|
+
|
|
9
|
+
declare class BitcountNode extends MathNode {
|
|
10
|
+
readonly isBitcountNode: true;
|
|
11
|
+
|
|
12
|
+
constructor(method: BitcountNodeMethod, aNode: Node);
|
|
13
|
+
|
|
14
|
+
static COUNT_TRAILING_ZEROS: "countTrailingZeros";
|
|
15
|
+
static COUNT_LEADING_ZEROS: "countLeadingZeros";
|
|
16
|
+
static COUNT_ONE_BITS: "countOneBits";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const countTrailingZeros: (x: Node | number) => BitcountNode;
|
|
20
|
+
export const countLeadingZeros: (x: Node | number) => BitcountNode;
|
|
21
|
+
export const countOneBits: (x: Node | number) => BitcountNode;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import Node from "../core/Node.js";
|
|
2
|
+
import TempNode from "../core/TempNode.js";
|
|
3
|
+
|
|
4
|
+
export type PackFloatNodeEncoding = "snorm" | "unorm" | "float16";
|
|
5
|
+
|
|
6
|
+
declare class PackFloatNode extends TempNode {
|
|
7
|
+
vectorNode: Node;
|
|
8
|
+
encoding: PackFloatNodeEncoding;
|
|
9
|
+
|
|
10
|
+
readonly isPackFloatNode: true;
|
|
11
|
+
|
|
12
|
+
constructor(encoding: PackFloatNodeEncoding, vectorNode: Node);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default PackFloatNode;
|
|
16
|
+
|
|
17
|
+
export const packSnorm2x16: (value: Node) => PackFloatNode;
|
|
18
|
+
export const packUnorm2x16: (value: Node) => PackFloatNode;
|
|
19
|
+
export const packHalf2x16: (value: Node) => PackFloatNode;
|