@types/three 0.170.0 → 0.171.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/build/three.core.d.ts +1 -0
- three/build/three.core.min.d.ts +1 -0
- three/build/three.tsl.d.ts +1 -0
- three/build/three.tsl.min.d.ts +1 -0
- three/examples/jsm/controls/ArcballControls.d.ts +5 -0
- three/examples/jsm/controls/TransformControls.d.ts +1 -1
- three/examples/jsm/csm/CSMShadowNode.d.ts +1 -2
- three/examples/jsm/exporters/GLTFExporter.d.ts +23 -7
- three/examples/jsm/geometries/DecalGeometry.d.ts +1 -1
- three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts +1 -1
- three/examples/jsm/objects/SkyMesh.d.ts +2 -2
- three/examples/jsm/objects/Water2Mesh.d.ts +13 -2
- three/examples/jsm/objects/WaterMesh.d.ts +11 -2
- three/examples/jsm/tsl/display/AfterImageNode.d.ts +2 -1
- three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts +1 -1
- three/examples/jsm/tsl/display/AnamorphicNode.d.ts +2 -2
- three/examples/jsm/tsl/display/BleachBypass.d.ts +2 -1
- three/examples/jsm/tsl/display/BloomNode.d.ts +2 -1
- three/examples/jsm/tsl/display/DenoiseNode.d.ts +3 -4
- three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +2 -1
- three/examples/jsm/tsl/display/DotScreenNode.d.ts +2 -2
- three/examples/jsm/tsl/display/FXAANode.d.ts +2 -1
- three/examples/jsm/tsl/display/FilmNode.d.ts +2 -1
- three/examples/jsm/tsl/display/GTAONode.d.ts +5 -8
- three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +2 -2
- three/examples/jsm/tsl/display/LensflareNode.d.ts +2 -2
- three/examples/jsm/tsl/display/Lut3DNode.d.ts +2 -2
- three/examples/jsm/tsl/display/MotionBlur.d.ts +2 -1
- three/examples/jsm/tsl/display/OutlineNode.d.ts +2 -2
- three/examples/jsm/tsl/display/ParallaxBarrierPassNode.d.ts +1 -1
- three/examples/jsm/tsl/display/PixelationPassNode.d.ts +2 -2
- three/examples/jsm/tsl/display/RGBShiftNode.d.ts +2 -1
- three/examples/jsm/tsl/display/SMAANode.d.ts +2 -1
- three/examples/jsm/tsl/display/SSAAPassNode.d.ts +2 -2
- three/examples/jsm/tsl/display/SSRNode.d.ts +2 -2
- three/examples/jsm/tsl/display/Sepia.d.ts +2 -1
- three/examples/jsm/tsl/display/SobelOperatorNode.d.ts +2 -1
- three/examples/jsm/tsl/display/StereoCompositePassNode.d.ts +1 -2
- three/examples/jsm/tsl/display/StereoPassNode.d.ts +2 -2
- three/examples/jsm/tsl/display/TRAAPassNode.d.ts +2 -2
- three/examples/jsm/tsl/display/TransitionNode.d.ts +2 -1
- three/examples/jsm/tsl/display/hashBlur.d.ts +2 -1
- three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +2 -1
- three/package.json +4 -4
- three/src/Three.Core.d.ts +158 -0
- three/src/Three.TSL.d.ts +528 -0
- three/src/Three.WebGPU.Nodes.d.ts +14 -195
- three/src/Three.WebGPU.d.ts +13 -195
- three/src/Three.d.ts +2 -158
- three/src/animation/AnimationClip.d.ts +3 -1
- three/src/core/Clock.d.ts +4 -6
- three/src/core/InterleavedBuffer.d.ts +12 -0
- three/src/materials/Material.d.ts +6 -4
- three/src/materials/nodes/LineDashedNodeMaterial.d.ts +3 -0
- three/src/materials/nodes/NodeMaterial.d.ts +4 -1
- three/src/nodes/Nodes.d.ts +1 -1
- three/src/nodes/TSL.d.ts +8 -2
- three/src/nodes/accessors/Arrays.d.ts +6 -0
- three/src/nodes/accessors/BuiltinNode.d.ts +14 -0
- three/src/nodes/accessors/ClippingNode.d.ts +6 -0
- three/src/nodes/accessors/InstanceNode.d.ts +15 -3
- three/src/nodes/accessors/InstancedMeshNode.d.ts +11 -0
- three/src/nodes/accessors/Lights.d.ts +15 -0
- three/src/nodes/accessors/StorageBufferNode.d.ts +20 -11
- three/src/nodes/accessors/StorageTextureNode.d.ts +5 -3
- three/src/nodes/core/IndexNode.d.ts +2 -0
- three/src/nodes/core/NodeUtils.d.ts +7 -0
- three/src/nodes/core/StackNode.d.ts +6 -1
- three/src/nodes/core/constants.d.ts +6 -0
- three/src/nodes/display/BlendModes.d.ts +32 -0
- three/src/nodes/display/ScreenNode.d.ts +5 -0
- three/src/nodes/display/ViewportDepthNode.d.ts +3 -1
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +88 -0
- three/src/nodes/gpgpu/BarrierNode.d.ts +12 -0
- three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +13 -0
- three/src/nodes/gpgpu/WorkgroupInfoNode.d.ts +17 -0
- three/src/nodes/lighting/AnalyticLightNode.d.ts +11 -0
- three/src/nodes/lighting/LightsNode.d.ts +2 -2
- three/src/nodes/lighting/PointLightNode.d.ts +3 -0
- three/src/nodes/lighting/PointShadowNode.d.ts +30 -0
- three/src/nodes/lighting/ShadowNode.d.ts +26 -3
- three/src/nodes/math/OperatorNode.d.ts +3 -0
- three/src/nodes/tsl/TSLBase.d.ts +5 -0
- three/src/nodes/tsl/TSLCore.d.ts +3 -0
- three/src/nodes/utils/SplitNode.d.ts +1 -1
- three/src/objects/BatchedMesh.d.ts +4 -4
- three/src/objects/ClippingGroup.d.ts +41 -0
- three/src/renderers/WebGLRenderer.d.ts +2 -0
- three/src/renderers/common/Animation.d.ts +11 -4
- three/src/renderers/common/ClippingContext.d.ts +16 -14
- three/src/renderers/common/RenderList.d.ts +5 -0
- three/src/renderers/common/RenderObject.d.ts +8 -4
- three/src/renderers/common/RenderObjects.d.ts +3 -0
- three/src/renderers/common/Renderer.d.ts +14 -1
- three/src/renderers/common/UniformsGroup.d.ts +1 -0
- three/src/renderers/common/extras/PMREMGenerator.d.ts +15 -1
- three/src/renderers/common/nodes/NodeLibrary.d.ts +2 -4
- three/src/renderers/common/nodes/NodeUniform.d.ts +7 -0
- three/src/renderers/webgl/WebGLState.d.ts +1 -1
- three/src/textures/Data3DTexture.d.ts +4 -2
- three/src/textures/DataArrayTexture.d.ts +1 -1
- three/src/textures/DataTexture.d.ts +6 -1
- three/src/nodes/display/BlendMode.d.ts +0 -10
- three/src/nodes/lighting/LightNode.d.ts +0 -18
- three/src/textures/types.d.ts +0 -9
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Light } from "../../lights/Light.js";
|
|
2
|
+
import { LightShadow } from "../../lights/LightShadow.js";
|
|
3
|
+
import Node from "../core/Node.js";
|
|
4
|
+
import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
|
|
5
|
+
import ShadowNode from "./ShadowNode.js";
|
|
6
|
+
|
|
7
|
+
export const cubeToUV: (pos: NodeRepresentation, texelSizeY: NodeRepresentation) => ShaderNodeObject<Node>;
|
|
8
|
+
|
|
9
|
+
export const BasicPointShadowFilter: (
|
|
10
|
+
depthTexture: NodeRepresentation,
|
|
11
|
+
bd3D: NodeRepresentation,
|
|
12
|
+
dp: NodeRepresentation,
|
|
13
|
+
texelSize: NodeRepresentation,
|
|
14
|
+
) => ShaderNodeObject<Node>;
|
|
15
|
+
|
|
16
|
+
export const PointShadowFilter: (
|
|
17
|
+
depthTexture: NodeRepresentation,
|
|
18
|
+
bd3D: NodeRepresentation,
|
|
19
|
+
dp: NodeRepresentation,
|
|
20
|
+
texelSize: NodeRepresentation,
|
|
21
|
+
shadow: NodeRepresentation,
|
|
22
|
+
) => ShaderNodeObject<Node>;
|
|
23
|
+
|
|
24
|
+
declare class PointShadowNode extends ShadowNode {
|
|
25
|
+
constructor(light: Light, shadow: LightShadow | null);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export default PointShadowNode;
|
|
29
|
+
|
|
30
|
+
export const pointShadow: (light: Light, shadow?: LightShadow | null) => ShaderNodeObject<PointShadowNode>;
|
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
import { Light } from "../../lights/Light.js";
|
|
2
2
|
import { LightShadow } from "../../lights/LightShadow.js";
|
|
3
3
|
import Node from "../core/Node.js";
|
|
4
|
-
import { ShaderNodeObject } from "../tsl/TSLCore.js";
|
|
4
|
+
import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
|
|
5
|
+
|
|
6
|
+
export const BasicShadowFilter: (
|
|
7
|
+
depthTexture: NodeRepresentation,
|
|
8
|
+
shadowCoord: NodeRepresentation,
|
|
9
|
+
) => ShaderNodeObject<Node>;
|
|
10
|
+
|
|
11
|
+
export const PCFShadowFilter: (
|
|
12
|
+
depthTexture: NodeRepresentation,
|
|
13
|
+
shadowCoord: NodeRepresentation,
|
|
14
|
+
shadow: NodeRepresentation,
|
|
15
|
+
) => ShaderNodeObject<Node>;
|
|
16
|
+
|
|
17
|
+
export const PCFSoftShadowFilter: (
|
|
18
|
+
depthTexture: NodeRepresentation,
|
|
19
|
+
shadowCoord: NodeRepresentation,
|
|
20
|
+
shadow: NodeRepresentation,
|
|
21
|
+
) => ShaderNodeObject<Node>;
|
|
22
|
+
|
|
23
|
+
export const VSMShadowFilter: (
|
|
24
|
+
depthTexture: NodeRepresentation,
|
|
25
|
+
shadowCoord: NodeRepresentation,
|
|
26
|
+
) => ShaderNodeObject<Node>;
|
|
5
27
|
|
|
6
28
|
declare class ShadowNode extends Node {
|
|
7
|
-
constructor(light: Light, shadow: LightShadow);
|
|
29
|
+
constructor(light: Light, shadow: LightShadow | null);
|
|
8
30
|
}
|
|
9
31
|
|
|
10
32
|
export default ShadowNode;
|
|
11
33
|
|
|
12
|
-
export const shadow: (light: Light, shadow
|
|
34
|
+
export const shadow: (light: Light, shadow?: LightShadow) => ShaderNodeObject<ShadowNode>;
|
|
35
|
+
export const shadows: ShaderNodeObject<Node>;
|
|
@@ -10,6 +10,7 @@ export type OperatorNodeOp =
|
|
|
10
10
|
| ">>"
|
|
11
11
|
| "<<"
|
|
12
12
|
| "=="
|
|
13
|
+
| "!="
|
|
13
14
|
| "&&"
|
|
14
15
|
| "||"
|
|
15
16
|
| "^^"
|
|
@@ -42,6 +43,7 @@ export const mul: Operator;
|
|
|
42
43
|
export const div: Operator;
|
|
43
44
|
export const modInt: Operator;
|
|
44
45
|
export const equal: Operator;
|
|
46
|
+
export const notEqual: Operator;
|
|
45
47
|
export const lessThan: Operator;
|
|
46
48
|
export const greaterThan: Operator;
|
|
47
49
|
export const lessThanEqual: Operator;
|
|
@@ -65,6 +67,7 @@ declare module "../tsl/TSLCore.js" {
|
|
|
65
67
|
div: typeof div;
|
|
66
68
|
modInt: typeof modInt;
|
|
67
69
|
equal: typeof equal;
|
|
70
|
+
notEqual: typeof notEqual;
|
|
68
71
|
lessThan: typeof lessThan;
|
|
69
72
|
greaterThan: typeof greaterThan;
|
|
70
73
|
lessThanEqual: typeof lessThanEqual;
|
three/src/nodes/tsl/TSLBase.d.ts
CHANGED
three/src/nodes/tsl/TSLCore.d.ts
CHANGED
|
@@ -172,6 +172,8 @@ type ConstructedNode<T> = T extends new(...args: any[]) => infer R ? (R extends
|
|
|
172
172
|
|
|
173
173
|
export type NodeOrType = Node | string;
|
|
174
174
|
|
|
175
|
+
export const defined: (v: unknown) => unknown;
|
|
176
|
+
|
|
175
177
|
export const getConstNodeType: (value: NodeOrType) => string | null;
|
|
176
178
|
|
|
177
179
|
export class ShaderNode<T = {}, R extends Node = Node> {
|
|
@@ -271,3 +273,4 @@ export const arrayBuffer: (value: ArrayBuffer) => ShaderNodeObject<ConstNode<Arr
|
|
|
271
273
|
|
|
272
274
|
export const element: (node: NodeRepresentation, indexNode: NodeRepresentation) => ShaderNodeObject<Node>;
|
|
273
275
|
export const convert: (node: NodeRepresentation, types: string) => ShaderNodeObject<Node>;
|
|
276
|
+
export const split: (node: NodeRepresentation, channels?: string) => ShaderNodeObject<Node>;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import Node from "../core/Node.js";
|
|
2
2
|
import { SwizzleOption } from "../tsl/TSLCore.js";
|
|
3
3
|
|
|
4
|
-
/** swizzle node */
|
|
5
4
|
export default class SplitNode extends Node {
|
|
6
5
|
node: Node;
|
|
7
6
|
components: string;
|
|
@@ -11,5 +10,6 @@ export default class SplitNode extends Node {
|
|
|
11
10
|
* @param components swizzle like string, default = "x"
|
|
12
11
|
*/
|
|
13
12
|
constructor(node: Node, components?: SwizzleOption);
|
|
13
|
+
|
|
14
14
|
getVectorLength(): number;
|
|
15
15
|
}
|
|
@@ -19,10 +19,10 @@ export interface BatchedMeshGeometryRange {
|
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
|
-
* A special version of {@link Mesh} with multi draw batch rendering support. Use
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
22
|
+
* A special version of {@link Mesh} with multi draw batch rendering support. Use BatchedMesh if you have to render a
|
|
23
|
+
* large number of objects with the same material but with different geometries or world transformations. The usage of
|
|
24
|
+
* BatchedMesh will help you to reduce the number of draw calls and thus improve the overall rendering performance in
|
|
25
|
+
* your application.
|
|
26
26
|
*
|
|
27
27
|
* If the {@link https://developer.mozilla.org/en-US/docs/Web/API/WEBGL_multi_draw WEBGL_multi_draw extension} is not
|
|
28
28
|
* supported then a less performant fallback is used.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Plane } from "../math/Plane.js";
|
|
2
|
+
import { Group } from "./Group.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* A special version of the Group object that defines clipping planes for decendant objects. ClippingGroups can be
|
|
6
|
+
* nested, with clipping planes accumulating by type: intersection or union.
|
|
7
|
+
*/
|
|
8
|
+
declare class ClippingGroup extends Group {
|
|
9
|
+
/**
|
|
10
|
+
* Read-only flag to check if a given object is of type ClippingGroup.
|
|
11
|
+
*/
|
|
12
|
+
readonly isClippingGroup: true;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* User-defined clipping planes specified as THREE.Plane objects in world space. These planes apply to the objects
|
|
16
|
+
* that are children of this ClippingGroup. Points in space whose signed distance to the plane is negative are
|
|
17
|
+
* clipped (not rendered). See the webgpu_clipping example. Default is `[]`.
|
|
18
|
+
*/
|
|
19
|
+
clippingPlanes: Plane[];
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Determines if the clipping planes defined by this object are applied. Default is `true`.
|
|
23
|
+
*/
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Changes the behavior of clipping planes so that only their intersection is clipped, rather than their union.
|
|
28
|
+
* Default is `false`.
|
|
29
|
+
*/
|
|
30
|
+
clipIntersection: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Defines whether to clip shadows according to the clipping planes specified by this ClippingGroup. Default is
|
|
34
|
+
* `false`.
|
|
35
|
+
*/
|
|
36
|
+
clipShadows: boolean;
|
|
37
|
+
|
|
38
|
+
constructor();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { ClippingGroup };
|
|
@@ -444,6 +444,7 @@ export class WebGLRenderer implements Renderer {
|
|
|
444
444
|
* @param dstTexture Specifies the destination texture.
|
|
445
445
|
* @param srcRegion Specifies the bounds
|
|
446
446
|
* @param dstPosition Specifies the pixel offset into the dstTexture where the copy will occur.
|
|
447
|
+
* @param srcLevel Specifies the source mipmap level of the texture.
|
|
447
448
|
* @param dstLevel Specifies the destination mipmap level of the texture.
|
|
448
449
|
*/
|
|
449
450
|
copyTextureToTexture(
|
|
@@ -451,6 +452,7 @@ export class WebGLRenderer implements Renderer {
|
|
|
451
452
|
dstTexture: Texture,
|
|
452
453
|
srcRegion?: Box2 | Box3 | null,
|
|
453
454
|
dstPosition?: Vector2 | Vector3 | null,
|
|
455
|
+
srcLevel?: number,
|
|
454
456
|
dstLevel?: number,
|
|
455
457
|
): void;
|
|
456
458
|
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import Info from "./Info.js";
|
|
2
2
|
import Nodes from "./nodes/Nodes.js";
|
|
3
|
+
interface AnimationContext {
|
|
4
|
+
requestAnimationFrame(callback: FrameRequestCallback, frame?: XRFrame): number;
|
|
5
|
+
cancelAnimationFrame(handle: number): void;
|
|
6
|
+
}
|
|
3
7
|
declare class Animation {
|
|
4
8
|
nodes: Nodes;
|
|
5
9
|
info: Info;
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
_context: AnimationContext;
|
|
11
|
+
_animationLoop: ((time: DOMHighResTimeStamp, frame?: XRFrame) => void) | null;
|
|
12
|
+
_requestId: number | null;
|
|
8
13
|
constructor(nodes: Nodes, info: Info);
|
|
9
|
-
|
|
10
|
-
|
|
14
|
+
start(): void;
|
|
15
|
+
stop(): void;
|
|
11
16
|
setAnimationLoop(callback: ((time: DOMHighResTimeStamp, frame?: XRFrame) => void) | null): void;
|
|
17
|
+
setContext(context: AnimationContext): void;
|
|
18
|
+
dispose(): void;
|
|
12
19
|
}
|
|
13
20
|
export default Animation;
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { Camera } from "../../cameras/Camera.js";
|
|
2
|
-
import { Material } from "../../materials/Material.js";
|
|
3
2
|
import { Matrix3 } from "../../math/Matrix3.js";
|
|
4
3
|
import { Matrix4 } from "../../math/Matrix4.js";
|
|
5
4
|
import { Plane } from "../../math/Plane.js";
|
|
6
5
|
import { Vector4 } from "../../math/Vector4.js";
|
|
7
|
-
import
|
|
6
|
+
import { ClippingGroup } from "../../objects/ClippingGroup.js";
|
|
7
|
+
import { Scene } from "../../scenes/Scene.js";
|
|
8
8
|
declare class ClippingContext {
|
|
9
9
|
version: number;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
planes: Vector4[];
|
|
15
|
-
parentVersion: number;
|
|
10
|
+
clipIntersection: boolean | null;
|
|
11
|
+
cacheKey: string;
|
|
12
|
+
intersectionPlanes?: Plane[];
|
|
13
|
+
unionPlanes?: Plane[];
|
|
16
14
|
viewNormalMatrix: Matrix3;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
15
|
+
clippingGroupContexts: WeakMap<ClippingGroup, ClippingContext>;
|
|
16
|
+
shadowPass: boolean;
|
|
17
|
+
viewMatrix?: Matrix4;
|
|
18
|
+
parentVersion: number | null;
|
|
19
|
+
constructor(parentContext?: ClippingContext | null);
|
|
20
|
+
projectPlanes(source: readonly Plane[], destination: readonly Vector4[], offset: number): void;
|
|
21
|
+
updateGlobal(scene: Scene, camera: Camera): void;
|
|
22
|
+
update(parentContext: ClippingContext, clippingGroup: ClippingGroup): void;
|
|
23
|
+
getGroupContext(clippingGroup: ClippingGroup): ClippingContext;
|
|
24
|
+
get unionClippingCount(): number;
|
|
23
25
|
}
|
|
24
26
|
export default ClippingContext;
|
|
@@ -5,6 +5,7 @@ import { Light } from "../../lights/Light.js";
|
|
|
5
5
|
import { Material } from "../../materials/Material.js";
|
|
6
6
|
import { LightsNode } from "../../nodes/Nodes.js";
|
|
7
7
|
import BundleGroup from "./BundleGroup.js";
|
|
8
|
+
import ClippingContext from "./ClippingContext.js";
|
|
8
9
|
import Lighting from "./Lighting.js";
|
|
9
10
|
export interface Bundle {
|
|
10
11
|
bundleGroup: BundleGroup;
|
|
@@ -20,6 +21,7 @@ export interface RenderItem {
|
|
|
20
21
|
renderOrder: number | null;
|
|
21
22
|
z: number | null;
|
|
22
23
|
group: GeometryGroup | null;
|
|
24
|
+
clippingContext: ClippingContext | null;
|
|
23
25
|
}
|
|
24
26
|
declare class RenderList {
|
|
25
27
|
renderItems: RenderItem[];
|
|
@@ -42,6 +44,7 @@ declare class RenderList {
|
|
|
42
44
|
groupOrder: number,
|
|
43
45
|
z: number,
|
|
44
46
|
group: GeometryGroup | null,
|
|
47
|
+
clippingContext: ClippingContext | null,
|
|
45
48
|
): RenderItem;
|
|
46
49
|
push(
|
|
47
50
|
object: Object3D,
|
|
@@ -50,6 +53,7 @@ declare class RenderList {
|
|
|
50
53
|
groupOrder: number,
|
|
51
54
|
z: number,
|
|
52
55
|
group: GeometryGroup | null,
|
|
56
|
+
clippingContext: ClippingContext | null,
|
|
53
57
|
): void;
|
|
54
58
|
unshift(
|
|
55
59
|
object: Object3D,
|
|
@@ -58,6 +62,7 @@ declare class RenderList {
|
|
|
58
62
|
groupOrder: number,
|
|
59
63
|
z: number,
|
|
60
64
|
group: GeometryGroup | null,
|
|
65
|
+
clippingContext: ClippingContext | null,
|
|
61
66
|
): void;
|
|
62
67
|
pushBundle(group: Bundle): void;
|
|
63
68
|
pushLight(light: Light): void;
|
|
@@ -44,8 +44,8 @@ export default class RenderObject {
|
|
|
44
44
|
firstInstance: number;
|
|
45
45
|
} | null;
|
|
46
46
|
bundle: BundleGroup | null;
|
|
47
|
-
clippingContext: ClippingContext;
|
|
48
|
-
|
|
47
|
+
clippingContext: ClippingContext | null;
|
|
48
|
+
clippingContextCacheKey: string;
|
|
49
49
|
initialNodesCacheKey: string;
|
|
50
50
|
initialCacheKey: string;
|
|
51
51
|
_nodeBuilderState: NodeBuilderState | null;
|
|
@@ -64,9 +64,11 @@ export default class RenderObject {
|
|
|
64
64
|
camera: Camera,
|
|
65
65
|
lightsNode: LightsNode,
|
|
66
66
|
renderContext: RenderContext,
|
|
67
|
+
clippingContext: ClippingContext | null,
|
|
67
68
|
);
|
|
68
69
|
updateClipping(parent: ClippingContext): void;
|
|
69
70
|
get clippingNeedsUpdate(): boolean;
|
|
71
|
+
get hardwareClippingPlanes(): number;
|
|
70
72
|
getNodeBuilderState(): NodeBuilderState;
|
|
71
73
|
getMonitor(): NodeMaterialObserver;
|
|
72
74
|
getBindings(): BindGroup[];
|
|
@@ -78,8 +80,9 @@ export default class RenderObject {
|
|
|
78
80
|
RenderContext,
|
|
79
81
|
LightsNode,
|
|
80
82
|
];
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
setGeometry(geometry: BufferGeometry): void;
|
|
84
|
+
getAttributes(): (BufferAttribute | InterleavedBufferAttribute)[];
|
|
85
|
+
getVertexBuffers(): (BufferAttribute | InterleavedBuffer)[] | null;
|
|
83
86
|
getDrawParameters(): {
|
|
84
87
|
vertexCount: number;
|
|
85
88
|
firstVertex: number;
|
|
@@ -88,6 +91,7 @@ export default class RenderObject {
|
|
|
88
91
|
} | null;
|
|
89
92
|
getGeometryCacheKey(): string;
|
|
90
93
|
getMaterialCacheKey(): number;
|
|
94
|
+
get needsGeometryUpdate(): boolean;
|
|
91
95
|
get needsUpdate(): boolean;
|
|
92
96
|
getDynamicCacheKey(): string;
|
|
93
97
|
getCacheKey(): string;
|
|
@@ -5,6 +5,7 @@ import LightsNode from "../../nodes/lighting/LightsNode.js";
|
|
|
5
5
|
import { Scene } from "../../scenes/Scene.js";
|
|
6
6
|
import Bindings from "./Bindings.js";
|
|
7
7
|
import ChainMap from "./ChainMap.js";
|
|
8
|
+
import ClippingContext from "./ClippingContext.js";
|
|
8
9
|
import Geometries from "./Geometries.js";
|
|
9
10
|
import Info from "./Info.js";
|
|
10
11
|
import Nodes from "./nodes/Nodes.js";
|
|
@@ -37,6 +38,7 @@ declare class RenderObjects {
|
|
|
37
38
|
camera: Camera,
|
|
38
39
|
lightsNode: LightsNode,
|
|
39
40
|
renderContext: RenderContext,
|
|
41
|
+
clippingContext: ClippingContext | null,
|
|
40
42
|
passId?: string | undefined,
|
|
41
43
|
): RenderObject;
|
|
42
44
|
getChainMap(
|
|
@@ -56,6 +58,7 @@ declare class RenderObjects {
|
|
|
56
58
|
camera: Camera,
|
|
57
59
|
lightsNode: LightsNode,
|
|
58
60
|
renderContext: RenderContext,
|
|
61
|
+
clippingContext: ClippingContext | null,
|
|
59
62
|
passId: string | undefined,
|
|
60
63
|
): RenderObject;
|
|
61
64
|
}
|
|
@@ -21,6 +21,7 @@ import Attributes from "./Attributes.js";
|
|
|
21
21
|
import Backend from "./Backend.js";
|
|
22
22
|
import Background from "./Background.js";
|
|
23
23
|
import Bindings from "./Bindings.js";
|
|
24
|
+
import ClippingContext from "./ClippingContext.js";
|
|
24
25
|
import Color4 from "./Color4.js";
|
|
25
26
|
import Geometries from "./Geometries.js";
|
|
26
27
|
import Info from "./Info.js";
|
|
@@ -257,6 +258,9 @@ declare class Renderer {
|
|
|
257
258
|
computeAsync(computeNodes: ComputeNode | ComputeNode[]): Promise<void>;
|
|
258
259
|
hasFeatureAsync(name: string): Promise<void>;
|
|
259
260
|
hasFeature(name: string): false | void;
|
|
261
|
+
hasInitialized(): boolean;
|
|
262
|
+
initTextureAsync(texture: Texture): Promise<void>;
|
|
263
|
+
initTexture(texture: Texture): false | undefined;
|
|
260
264
|
copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?: Rectangle | null): void;
|
|
261
265
|
copyTextureToTexture(
|
|
262
266
|
srcTexture: Texture,
|
|
@@ -274,7 +278,13 @@ declare class Renderer {
|
|
|
274
278
|
index?: number,
|
|
275
279
|
faceIndex?: number,
|
|
276
280
|
): Promise<import("../../core/BufferAttribute.js").TypedArray>;
|
|
277
|
-
_projectObject(
|
|
281
|
+
_projectObject(
|
|
282
|
+
object: Object3D,
|
|
283
|
+
camera: Camera,
|
|
284
|
+
groupOrder: number,
|
|
285
|
+
renderList: RenderList,
|
|
286
|
+
clippingContext: ClippingContext | null,
|
|
287
|
+
): void;
|
|
278
288
|
_renderBundles(bundles: Bundle[], sceneRef: Scene, lightsNode: LightsNode): void;
|
|
279
289
|
_renderTransparents(
|
|
280
290
|
renderList: RenderItem[],
|
|
@@ -298,6 +308,7 @@ declare class Renderer {
|
|
|
298
308
|
material: Material,
|
|
299
309
|
group: GeometryGroup,
|
|
300
310
|
lightsNode: LightsNode,
|
|
311
|
+
clippingContext?: ClippingContext | null,
|
|
301
312
|
passId?: string | null,
|
|
302
313
|
): void;
|
|
303
314
|
_renderObjectDirect(
|
|
@@ -307,6 +318,7 @@ declare class Renderer {
|
|
|
307
318
|
camera: Camera,
|
|
308
319
|
lightsNode: LightsNode,
|
|
309
320
|
group: GeometryGroup,
|
|
321
|
+
clippingContext: ClippingContext | null,
|
|
310
322
|
passId?: string,
|
|
311
323
|
): void;
|
|
312
324
|
_createObjectPipeline(
|
|
@@ -315,6 +327,7 @@ declare class Renderer {
|
|
|
315
327
|
scene: Scene,
|
|
316
328
|
camera: Camera,
|
|
317
329
|
lightsNode: LightsNode,
|
|
330
|
+
clippingContext: ClippingContext | null,
|
|
318
331
|
passId?: string,
|
|
319
332
|
): void;
|
|
320
333
|
get compile(): (scene: Object3D, camera: Camera, targetScene?: Object3D | null) => Promise<void>;
|
|
@@ -28,5 +28,6 @@ declare class UniformsGroup extends UniformBuffer {
|
|
|
28
28
|
updateColor(uniform: ColorNodeUniform): boolean;
|
|
29
29
|
updateMatrix3(uniform: Matrix3NodeUniform): boolean;
|
|
30
30
|
updateMatrix4(uniform: Matrix4NodeUniform): boolean;
|
|
31
|
+
_getBufferForType(type: string | null): Int32Array | Uint32Array | Float32Array;
|
|
31
32
|
}
|
|
32
33
|
export default UniformsGroup;
|
|
@@ -5,7 +5,21 @@ import Renderer from "../Renderer.js";
|
|
|
5
5
|
declare class PMREMGenerator {
|
|
6
6
|
constructor(renderer: Renderer);
|
|
7
7
|
|
|
8
|
-
fromScene(
|
|
8
|
+
fromScene(
|
|
9
|
+
scene: Scene,
|
|
10
|
+
sigma?: number,
|
|
11
|
+
near?: number,
|
|
12
|
+
far?: number,
|
|
13
|
+
renderTarget?: RenderTarget | null,
|
|
14
|
+
): RenderTarget;
|
|
15
|
+
|
|
16
|
+
fromSceneAsync(
|
|
17
|
+
scene: Scene,
|
|
18
|
+
sigma?: number,
|
|
19
|
+
near?: number,
|
|
20
|
+
far?: number,
|
|
21
|
+
renderTarget?: RenderTarget | null,
|
|
22
|
+
): Promise<RenderTarget>;
|
|
9
23
|
|
|
10
24
|
dispose(): void;
|
|
11
25
|
}
|
|
@@ -19,7 +19,7 @@ declare class NodeLibrary {
|
|
|
19
19
|
(color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>
|
|
20
20
|
>;
|
|
21
21
|
constructor();
|
|
22
|
-
fromMaterial(material: Material): Material | null;
|
|
22
|
+
fromMaterial(material: Material): Material | NodeMaterial | null;
|
|
23
23
|
addToneMapping(
|
|
24
24
|
toneMappingNode: (color: NodeRepresentation, exposure: NodeRepresentation) => ShaderNodeObject<Node>,
|
|
25
25
|
toneMapping: ToneMapping,
|
|
@@ -30,9 +30,7 @@ declare class NodeLibrary {
|
|
|
30
30
|
getMaterialNodeClass(materialType: string): (new() => NodeMaterial) | null;
|
|
31
31
|
addMaterial(materialNodeClass: {
|
|
32
32
|
new(): NodeMaterial;
|
|
33
|
-
},
|
|
34
|
-
new(): Material;
|
|
35
|
-
}): void;
|
|
33
|
+
}, materialClassType: string): void;
|
|
36
34
|
getLightNodeClass(light: Light): (new(light: Light) => AnalyticLightNode<Light>) | null;
|
|
37
35
|
addLight<TLight extends Light>(lightNodeClass: {
|
|
38
36
|
new(light: TLight): AnalyticLightNode<TLight>;
|
|
@@ -18,36 +18,43 @@ declare class NumberNodeUniform extends NumberUniform {
|
|
|
18
18
|
nodeUniform: NodeUniform<number>;
|
|
19
19
|
constructor(nodeUniform: NodeUniform<number>);
|
|
20
20
|
getValue(): number;
|
|
21
|
+
getType(): string | null;
|
|
21
22
|
}
|
|
22
23
|
declare class Vector2NodeUniform extends Vector2Uniform {
|
|
23
24
|
nodeUniform: NodeUniform<Vector2>;
|
|
24
25
|
constructor(nodeUniform: NodeUniform<Vector2>);
|
|
25
26
|
getValue(): Vector2;
|
|
27
|
+
getType(): string | null;
|
|
26
28
|
}
|
|
27
29
|
declare class Vector3NodeUniform extends Vector3Uniform {
|
|
28
30
|
nodeUniform: NodeUniform<Vector3>;
|
|
29
31
|
constructor(nodeUniform: NodeUniform<Vector3>);
|
|
30
32
|
getValue(): Vector3;
|
|
33
|
+
getType(): string | null;
|
|
31
34
|
}
|
|
32
35
|
declare class Vector4NodeUniform extends Vector4Uniform {
|
|
33
36
|
nodeUniform: NodeUniform<Vector4>;
|
|
34
37
|
constructor(nodeUniform: NodeUniform<Vector4>);
|
|
35
38
|
getValue(): Vector4;
|
|
39
|
+
getType(): string | null;
|
|
36
40
|
}
|
|
37
41
|
declare class ColorNodeUniform extends ColorUniform {
|
|
38
42
|
nodeUniform: NodeUniform<Color>;
|
|
39
43
|
constructor(nodeUniform: NodeUniform<Color>);
|
|
40
44
|
getValue(): Color;
|
|
45
|
+
getType(): string | null;
|
|
41
46
|
}
|
|
42
47
|
declare class Matrix3NodeUniform extends Matrix3Uniform {
|
|
43
48
|
nodeUniform: NodeUniform<Matrix3>;
|
|
44
49
|
constructor(nodeUniform: NodeUniform<Matrix3>);
|
|
45
50
|
getValue(): Matrix3;
|
|
51
|
+
getType(): string | null;
|
|
46
52
|
}
|
|
47
53
|
declare class Matrix4NodeUniform extends Matrix4Uniform {
|
|
48
54
|
nodeUniform: NodeUniform<Matrix4>;
|
|
49
55
|
constructor(nodeUniform: NodeUniform<Matrix4>);
|
|
50
56
|
getValue(): Matrix4;
|
|
57
|
+
getType(): string | null;
|
|
51
58
|
}
|
|
52
59
|
export {
|
|
53
60
|
ColorNodeUniform,
|
|
@@ -67,7 +67,7 @@ declare class WebGLState {
|
|
|
67
67
|
blendDstAlpha?: BlendingDstFactor,
|
|
68
68
|
premultiplyAlpha?: boolean,
|
|
69
69
|
): void;
|
|
70
|
-
setMaterial(material: Material, frontFaceCW: boolean): void;
|
|
70
|
+
setMaterial(material: Material, frontFaceCW: boolean, hardwareClippingPlanes: number): void;
|
|
71
71
|
setFlipSided(flipSided: boolean): void;
|
|
72
72
|
setCullFace(cullFace: CullFace): void;
|
|
73
73
|
setLineWidth(width: number): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MagnificationTextureFilter, MinificationTextureFilter, Wrapping } from "../constants.js";
|
|
2
|
+
import { TextureImageData } from "./DataTexture.js";
|
|
2
3
|
import { Texture } from "./Texture.js";
|
|
3
|
-
import { Texture3DImageData } from "./types.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Creates a three-dimensional texture from raw data, with parameters to divide it into width, height, and depth
|
|
@@ -93,4 +93,6 @@ export class Data3DTexture extends Texture {
|
|
|
93
93
|
unpackAlignment: number;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
export {
|
|
96
|
+
export interface Texture3DImageData extends TextureImageData {
|
|
97
|
+
depth: number;
|
|
98
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MagnificationTextureFilter, MinificationTextureFilter } from "../constants.js";
|
|
2
|
+
import { Texture3DImageData } from "./Data3DTexture.js";
|
|
2
3
|
import { Texture } from "./Texture.js";
|
|
3
|
-
import { Texture3DImageData } from "./types.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Creates an array of textures directly from raw data, width and height and depth
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
Wrapping,
|
|
8
8
|
} from "../constants.js";
|
|
9
9
|
import { Texture } from "./Texture.js";
|
|
10
|
-
import { TextureImageData } from "./types.js";
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Creates a texture directly from raw data, width and height.
|
|
@@ -110,3 +109,9 @@ export class DataTexture extends Texture {
|
|
|
110
109
|
*/
|
|
111
110
|
unpackAlignment: number;
|
|
112
111
|
}
|
|
112
|
+
|
|
113
|
+
export interface TextureImageData {
|
|
114
|
+
data: Uint8Array | Uint8ClampedArray;
|
|
115
|
+
height: number;
|
|
116
|
+
width: number;
|
|
117
|
+
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import Node from "../core/Node.js";
|
|
2
|
-
import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
|
|
3
|
-
|
|
4
|
-
export const burn: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
|
|
5
|
-
|
|
6
|
-
export const dodge: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
|
|
7
|
-
|
|
8
|
-
export const screen: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
|
|
9
|
-
|
|
10
|
-
export const overlay: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Light } from "../../lights/Light.js";
|
|
2
|
-
import Node from "../core/Node.js";
|
|
3
|
-
import { ShaderNodeObject } from "../tsl/TSLCore.js";
|
|
4
|
-
|
|
5
|
-
export type LightNodeScope = typeof LightNode.TARGET_DIRECTION;
|
|
6
|
-
|
|
7
|
-
declare class LightNode extends Node {
|
|
8
|
-
scope: LightNodeScope;
|
|
9
|
-
light: Light;
|
|
10
|
-
|
|
11
|
-
constructor(scope?: LightNodeScope, light?: Light | null);
|
|
12
|
-
|
|
13
|
-
static TARGET_DIRECTION: "targetDirection";
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default LightNode;
|
|
17
|
-
|
|
18
|
-
export const lightTargetDirection: (light?: Light | null) => ShaderNodeObject<LightNode>;
|