@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.
Files changed (106) hide show
  1. three/README.md +1 -1
  2. three/build/three.core.d.ts +1 -0
  3. three/build/three.core.min.d.ts +1 -0
  4. three/build/three.tsl.d.ts +1 -0
  5. three/build/three.tsl.min.d.ts +1 -0
  6. three/examples/jsm/controls/ArcballControls.d.ts +5 -0
  7. three/examples/jsm/controls/TransformControls.d.ts +1 -1
  8. three/examples/jsm/csm/CSMShadowNode.d.ts +1 -2
  9. three/examples/jsm/exporters/GLTFExporter.d.ts +23 -7
  10. three/examples/jsm/geometries/DecalGeometry.d.ts +1 -1
  11. three/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts +1 -1
  12. three/examples/jsm/objects/SkyMesh.d.ts +2 -2
  13. three/examples/jsm/objects/Water2Mesh.d.ts +13 -2
  14. three/examples/jsm/objects/WaterMesh.d.ts +11 -2
  15. three/examples/jsm/tsl/display/AfterImageNode.d.ts +2 -1
  16. three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts +1 -1
  17. three/examples/jsm/tsl/display/AnamorphicNode.d.ts +2 -2
  18. three/examples/jsm/tsl/display/BleachBypass.d.ts +2 -1
  19. three/examples/jsm/tsl/display/BloomNode.d.ts +2 -1
  20. three/examples/jsm/tsl/display/DenoiseNode.d.ts +3 -4
  21. three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +2 -1
  22. three/examples/jsm/tsl/display/DotScreenNode.d.ts +2 -2
  23. three/examples/jsm/tsl/display/FXAANode.d.ts +2 -1
  24. three/examples/jsm/tsl/display/FilmNode.d.ts +2 -1
  25. three/examples/jsm/tsl/display/GTAONode.d.ts +5 -8
  26. three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +2 -2
  27. three/examples/jsm/tsl/display/LensflareNode.d.ts +2 -2
  28. three/examples/jsm/tsl/display/Lut3DNode.d.ts +2 -2
  29. three/examples/jsm/tsl/display/MotionBlur.d.ts +2 -1
  30. three/examples/jsm/tsl/display/OutlineNode.d.ts +2 -2
  31. three/examples/jsm/tsl/display/ParallaxBarrierPassNode.d.ts +1 -1
  32. three/examples/jsm/tsl/display/PixelationPassNode.d.ts +2 -2
  33. three/examples/jsm/tsl/display/RGBShiftNode.d.ts +2 -1
  34. three/examples/jsm/tsl/display/SMAANode.d.ts +2 -1
  35. three/examples/jsm/tsl/display/SSAAPassNode.d.ts +2 -2
  36. three/examples/jsm/tsl/display/SSRNode.d.ts +2 -2
  37. three/examples/jsm/tsl/display/Sepia.d.ts +2 -1
  38. three/examples/jsm/tsl/display/SobelOperatorNode.d.ts +2 -1
  39. three/examples/jsm/tsl/display/StereoCompositePassNode.d.ts +1 -2
  40. three/examples/jsm/tsl/display/StereoPassNode.d.ts +2 -2
  41. three/examples/jsm/tsl/display/TRAAPassNode.d.ts +2 -2
  42. three/examples/jsm/tsl/display/TransitionNode.d.ts +2 -1
  43. three/examples/jsm/tsl/display/hashBlur.d.ts +2 -1
  44. three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +2 -1
  45. three/package.json +4 -4
  46. three/src/Three.Core.d.ts +158 -0
  47. three/src/Three.TSL.d.ts +528 -0
  48. three/src/Three.WebGPU.Nodes.d.ts +14 -195
  49. three/src/Three.WebGPU.d.ts +13 -195
  50. three/src/Three.d.ts +2 -158
  51. three/src/animation/AnimationClip.d.ts +3 -1
  52. three/src/core/Clock.d.ts +4 -6
  53. three/src/core/InterleavedBuffer.d.ts +12 -0
  54. three/src/materials/Material.d.ts +6 -4
  55. three/src/materials/nodes/LineDashedNodeMaterial.d.ts +3 -0
  56. three/src/materials/nodes/NodeMaterial.d.ts +4 -1
  57. three/src/nodes/Nodes.d.ts +1 -1
  58. three/src/nodes/TSL.d.ts +8 -2
  59. three/src/nodes/accessors/Arrays.d.ts +6 -0
  60. three/src/nodes/accessors/BuiltinNode.d.ts +14 -0
  61. three/src/nodes/accessors/ClippingNode.d.ts +6 -0
  62. three/src/nodes/accessors/InstanceNode.d.ts +15 -3
  63. three/src/nodes/accessors/InstancedMeshNode.d.ts +11 -0
  64. three/src/nodes/accessors/Lights.d.ts +15 -0
  65. three/src/nodes/accessors/StorageBufferNode.d.ts +20 -11
  66. three/src/nodes/accessors/StorageTextureNode.d.ts +5 -3
  67. three/src/nodes/core/IndexNode.d.ts +2 -0
  68. three/src/nodes/core/NodeUtils.d.ts +7 -0
  69. three/src/nodes/core/StackNode.d.ts +6 -1
  70. three/src/nodes/core/constants.d.ts +6 -0
  71. three/src/nodes/display/BlendModes.d.ts +32 -0
  72. three/src/nodes/display/ScreenNode.d.ts +5 -0
  73. three/src/nodes/display/ViewportDepthNode.d.ts +3 -1
  74. three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +88 -0
  75. three/src/nodes/gpgpu/BarrierNode.d.ts +12 -0
  76. three/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +13 -0
  77. three/src/nodes/gpgpu/WorkgroupInfoNode.d.ts +17 -0
  78. three/src/nodes/lighting/AnalyticLightNode.d.ts +11 -0
  79. three/src/nodes/lighting/LightsNode.d.ts +2 -2
  80. three/src/nodes/lighting/PointLightNode.d.ts +3 -0
  81. three/src/nodes/lighting/PointShadowNode.d.ts +30 -0
  82. three/src/nodes/lighting/ShadowNode.d.ts +26 -3
  83. three/src/nodes/math/OperatorNode.d.ts +3 -0
  84. three/src/nodes/tsl/TSLBase.d.ts +5 -0
  85. three/src/nodes/tsl/TSLCore.d.ts +3 -0
  86. three/src/nodes/utils/SplitNode.d.ts +1 -1
  87. three/src/objects/BatchedMesh.d.ts +4 -4
  88. three/src/objects/ClippingGroup.d.ts +41 -0
  89. three/src/renderers/WebGLRenderer.d.ts +2 -0
  90. three/src/renderers/common/Animation.d.ts +11 -4
  91. three/src/renderers/common/ClippingContext.d.ts +16 -14
  92. three/src/renderers/common/RenderList.d.ts +5 -0
  93. three/src/renderers/common/RenderObject.d.ts +8 -4
  94. three/src/renderers/common/RenderObjects.d.ts +3 -0
  95. three/src/renderers/common/Renderer.d.ts +14 -1
  96. three/src/renderers/common/UniformsGroup.d.ts +1 -0
  97. three/src/renderers/common/extras/PMREMGenerator.d.ts +15 -1
  98. three/src/renderers/common/nodes/NodeLibrary.d.ts +2 -4
  99. three/src/renderers/common/nodes/NodeUniform.d.ts +7 -0
  100. three/src/renderers/webgl/WebGLState.d.ts +1 -1
  101. three/src/textures/Data3DTexture.d.ts +4 -2
  102. three/src/textures/DataArrayTexture.d.ts +1 -1
  103. three/src/textures/DataTexture.d.ts +6 -1
  104. three/src/nodes/display/BlendMode.d.ts +0 -10
  105. three/src/nodes/lighting/LightNode.d.ts +0 -18
  106. three/src/textures/types.d.ts +0 -9
@@ -85,6 +85,18 @@ export class InterleavedBuffer {
85
85
  */
86
86
  uuid: string;
87
87
 
88
+ /**
89
+ * A callback function that is executed after the Renderer has transferred the geometry data to the GPU.
90
+ */
91
+ onUploadCallback: () => void;
92
+
93
+ /**
94
+ * Sets the value of the {@link onUploadCallback} property.
95
+ * @see {@link onUploadCallback}
96
+ * @param callback function that is executed after the Renderer has transferred the geometry data to the GPU.
97
+ */
98
+ onUpload(callback: () => void): this;
99
+
88
100
  /**
89
101
  * Calls {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/set | TypedArray.set}( {@link value}, {@link offset} )
90
102
  * on the {@link BufferAttribute.array | array}.
@@ -234,10 +234,6 @@ export interface MaterialJSON {
234
234
  * Materials describe the appearance of objects. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.
235
235
  */
236
236
  export class Material extends EventDispatcher<{ dispose: {} }> {
237
- static get type(): string;
238
-
239
- get type(): string;
240
-
241
237
  constructor();
242
238
 
243
239
  /**
@@ -247,6 +243,12 @@ export class Material extends EventDispatcher<{ dispose: {} }> {
247
243
  */
248
244
  readonly isMaterial: true;
249
245
 
246
+ /**
247
+ * Value is the string 'Material'. This shouldn't be changed, and can be used to find all objects of this type in a
248
+ * scene.
249
+ */
250
+ type: string;
251
+
250
252
  /**
251
253
  * Enables alpha hashed transparency, an alternative to {@link .transparent} or {@link .alphaTest}. The material
252
254
  * will not be rendered if opacity is lower than a random threshold. Randomization introduces some grain or noise,
@@ -3,6 +3,7 @@ import { LineDashedMaterialParameters } from "../LineDashedMaterial.js";
3
3
  import NodeMaterial, { NodeMaterialParameters } from "./NodeMaterial.js";
4
4
 
5
5
  export interface LineDashedNodeMaterialParameters extends NodeMaterialParameters, LineDashedMaterialParameters {
6
+ dashOffset?: number | undefined;
6
7
  offsetNode?: Node | null | undefined;
7
8
  dashScaleNode?: Node | null | undefined;
8
9
  dashSizeNode?: Node | null | undefined;
@@ -12,6 +13,8 @@ export interface LineDashedNodeMaterialParameters extends NodeMaterialParameters
12
13
  declare class LineDashedNodeMaterial extends NodeMaterial {
13
14
  readonly isLineDashedNodeMaterial: true;
14
15
 
16
+ dashOffset: number;
17
+
15
18
  offsetNode: Node | null;
16
19
  dashScaleNode: Node | null;
17
20
  dashSizeNode: Node | null;
@@ -42,6 +42,7 @@ declare class NodeMaterial extends Material {
42
42
 
43
43
  fog: boolean;
44
44
  lights: boolean;
45
+ hardwareClipping: boolean;
45
46
 
46
47
  lightsNode: LightsNode | null;
47
48
  envNode: Node | null;
@@ -58,8 +59,9 @@ declare class NodeMaterial extends Material {
58
59
  geometryNode: Node | null;
59
60
 
60
61
  depthNode: Node | null;
61
- shadowNode: Node | null;
62
62
  shadowPositionNode: Node | null;
63
+ receivedShadowNode: Node | null;
64
+ castShadowNode: Node | null;
63
65
 
64
66
  outputNode: Node | null;
65
67
  mrtNode: MRTNode | null;
@@ -72,6 +74,7 @@ declare class NodeMaterial extends Material {
72
74
  build(builder: NodeBuilder): void;
73
75
  setup(builder: NodeBuilder): void;
74
76
  setupClipping(builder: NodeBuilder): ClippingNode | null;
77
+ setupHardwareClipping(builder: NodeBuilder): void;
75
78
  setupDepth(builder: NodeBuilder): void;
76
79
  setupPosition(builder: NodeBuilder): Node;
77
80
  setupDiffuseColor(builder: NodeBuilder): void;
@@ -70,6 +70,7 @@ export { default as BatchNode } from "./accessors/BatchNode.js";
70
70
  export { default as BufferAttributeNode } from "./accessors/BufferAttributeNode.js";
71
71
  export { default as BufferNode } from "./accessors/BufferNode.js";
72
72
  export { default as CubeTextureNode } from "./accessors/CubeTextureNode.js";
73
+ export { default as InstancedMeshNode } from "./accessors/InstancedMeshNode.js";
73
74
  export { default as InstanceNode } from "./accessors/InstanceNode.js";
74
75
  export { default as MaterialNode, MaterialNodeScope } from "./accessors/MaterialNode.js";
75
76
  export { default as MaterialReferenceNode } from "./accessors/MaterialReferenceNode.js";
@@ -137,7 +138,6 @@ export { default as IESSpotLightNode } from "./lighting/IESSpotLightNode.js";
137
138
  export { default as IrradianceNode } from "./lighting/IrradianceNode.js";
138
139
  export { default as LightingContextNode } from "./lighting/LightingContextNode.js";
139
140
  export { default as LightingNode } from "./lighting/LightingNode.js";
140
- export { default as LightNode, LightNodeScope } from "./lighting/LightNode.js";
141
141
  export { default as LightProbeNode } from "./lighting/LightProbeNode.js";
142
142
  export { default as LightsNode } from "./lighting/LightsNode.js";
143
143
  export { default as PointLightNode } from "./lighting/PointLightNode.js";
three/src/nodes/TSL.d.ts CHANGED
@@ -47,12 +47,14 @@ export * from "./tsl/TSLBase.js";
47
47
 
48
48
  // accessors
49
49
  export * from "./accessors/AccessorsUtils.js";
50
+ export * from "./accessors/Arrays.js";
50
51
  export * from "./accessors/BatchNode.js";
51
52
  export * from "./accessors/Bitangent.js";
52
53
  export * from "./accessors/BufferAttributeNode.js";
53
54
  export * from "./accessors/BufferNode.js";
54
55
  export * from "./accessors/Camera.js";
55
56
  export * from "./accessors/CubeTextureNode.js";
57
+ export * from "./accessors/InstancedMeshNode.js";
56
58
  export * from "./accessors/InstanceNode.js";
57
59
  export * from "./accessors/MaterialNode.js";
58
60
  export * from "./accessors/MaterialProperties.js";
@@ -83,7 +85,7 @@ export * from "./accessors/VelocityNode.js";
83
85
  export * from "./accessors/VertexColorNode.js";
84
86
 
85
87
  // display
86
- export * from "./display/BlendMode.js";
88
+ export * from "./display/BlendModes.js";
87
89
  export * from "./display/BumpMapNode.js";
88
90
  export * from "./display/ColorAdjustment.js";
89
91
  export * from "./display/ColorSpaceNode.js";
@@ -121,11 +123,15 @@ export * from "./fog/FogRangeNode.js";
121
123
  export * from "./geometry/RangeNode.js";
122
124
 
123
125
  // gpgpu
126
+ export * from "./gpgpu/AtomicFunctionNode.js";
127
+ export * from "./gpgpu/BarrierNode.js";
128
+ export * from "./gpgpu/ComputeBuiltinNode.js";
124
129
  export * from "./gpgpu/ComputeNode.js";
130
+ export * from "./gpgpu/WorkgroupInfoNode.js";
125
131
 
126
132
  // lighting
133
+ export * from "./accessors/Lights.js";
127
134
  export * from "./lighting/LightingContextNode.js";
128
- export * from "./lighting/LightNode.js";
129
135
  export * from "./lighting/LightsNode.js";
130
136
  export * from "./lighting/PointLightNode.js";
131
137
  export * from "./lighting/ShadowNode.js";
@@ -0,0 +1,6 @@
1
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
2
+ import StorageBufferNode from "./StorageBufferNode.js";
3
+
4
+ export const attributeArray: (count: number, type?: string) => ShaderNodeObject<StorageBufferNode>;
5
+
6
+ export const instancedArray: (count: number, type?: string) => ShaderNodeObject<StorageBufferNode>;
@@ -0,0 +1,14 @@
1
+ import Node from "../core/Node.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ declare class BuiltinNode extends Node {
5
+ name: string;
6
+
7
+ readonly isBuiltinNode: true;
8
+
9
+ constructor(name: string);
10
+ }
11
+
12
+ export default BuiltinNode;
13
+
14
+ export const builtin: (name: string) => ShaderNodeObject<BuiltinNode>;
@@ -1,4 +1,6 @@
1
+ import { Plane } from "../../math/Plane.js";
1
2
  import Node from "../core/Node.js";
3
+ import NodeBuilder from "../core/NodeBuilder.js";
2
4
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
5
 
4
6
  export type ClippingNodeScope = typeof ClippingNode.ALPHA_TO_COVERAGE | typeof ClippingNode.DEFAULT;
@@ -6,11 +8,15 @@ export type ClippingNodeScope = typeof ClippingNode.ALPHA_TO_COVERAGE | typeof C
6
8
  export default class ClippingNode extends Node {
7
9
  scope: ClippingNodeScope;
8
10
 
11
+ hardwareClipping?: boolean;
12
+
9
13
  constructor(scope?: ClippingNodeScope);
10
14
 
11
15
  static ALPHA_TO_COVERAGE: "alphaToCoverage";
12
16
  static DEFAULT: "default";
17
+ static HARDWARE: "hardware";
13
18
  }
14
19
 
15
20
  export const clipping: () => ShaderNodeObject<ClippingNode>;
16
21
  export const clippingAlpha: () => ShaderNodeObject<ClippingNode>;
22
+ export const hardwareClipping: () => ShaderNodeObject<ClippingNode>;
@@ -1,13 +1,25 @@
1
+ import { InstancedBufferAttribute } from "../../core/InstancedBufferAttribute.js";
1
2
  import { InstancedMesh } from "../../objects/InstancedMesh.js";
2
3
  import Node from "../core/Node.js";
3
4
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
4
5
 
5
6
  export default class InstanceNode extends Node {
6
- instanceMesh: InstancedMesh;
7
+ count: number;
8
+ instanceMatrix: InstancedBufferAttribute;
9
+ instanceColor: InstancedBufferAttribute | null;
10
+
7
11
  instanceMatrixNode: Node | null;
8
12
  instanceColorNode: Node | null;
9
13
 
10
- constructor(instanceMesh: InstancedMesh);
14
+ constructor(
15
+ count: number,
16
+ instanceMatrix: InstancedBufferAttribute,
17
+ instanceColor: InstancedBufferAttribute | null,
18
+ );
11
19
  }
12
20
 
13
- export const instance: (instanceMesh: InstancedMesh) => ShaderNodeObject<InstanceNode>;
21
+ export const instance: (
22
+ count: number,
23
+ instanceMatrix: InstancedBufferAttribute,
24
+ instanceColor: InstancedBufferAttribute | null,
25
+ ) => ShaderNodeObject<InstanceNode>;
@@ -0,0 +1,11 @@
1
+ import { InstancedMesh } from "../../objects/InstancedMesh.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
+ import InstanceNode from "./InstanceNode.js";
4
+
5
+ declare class InstancedMeshNode extends InstanceNode {
6
+ constructor(instanceMesh: InstancedMesh);
7
+ }
8
+
9
+ export default InstancedMeshNode;
10
+
11
+ export const instancedMesh: (instancedMesh: InstancedMesh) => ShaderNodeObject<InstancedMeshNode>;
@@ -0,0 +1,15 @@
1
+ import { Light } from "../../lights/Light.js";
2
+ import Node from "../core/Node.js";
3
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
4
+
5
+ export function lightShadowMatrix(light: Light): ShaderNodeObject<Node>;
6
+
7
+ export function lightProjectionUV(light: Light): ShaderNodeObject<Node>;
8
+
9
+ export function lightPosition(light: Light): ShaderNodeObject<Node>;
10
+
11
+ export function lightTargetPosition(light: Light): ShaderNodeObject<Node>;
12
+
13
+ export function lightViewPosition(light: Light): ShaderNodeObject<Node>;
14
+
15
+ export const lightTargetDirection: (light: Light) => ShaderNodeObject<Node>;
@@ -1,38 +1,47 @@
1
1
  import StorageBufferAttribute from "../../renderers/common/StorageBufferAttribute.js";
2
2
  import StorageInstancedBufferAttribute from "../../renderers/common/StorageInstancedBufferAttribute.js";
3
- import { GPUBufferBindingType } from "../../renderers/webgpu/utils/WebGPUConstants.js";
4
- import { NodeOrType, NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+ import { NodeAccess } from "../core/constants.js";
4
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
5
5
  import StorageArrayElementNode from "../utils/StorageArrayElementNode.js";
6
6
  import BufferNode from "./BufferNode.js";
7
7
 
8
8
  export default class StorageBufferNode extends BufferNode {
9
9
  readonly isStorageBufferNode: true;
10
- bufferObject: boolean;
11
10
 
12
- access: GPUBufferBindingType;
11
+ access: NodeAccess;
12
+ isAtomic: boolean;
13
+ isPBO: boolean;
14
+
15
+ bufferObject: boolean;
13
16
 
14
17
  constructor(
15
18
  value: StorageBufferAttribute | StorageInstancedBufferAttribute,
16
- bufferType: string,
19
+ bufferType?: string | null,
17
20
  bufferCount?: number,
18
21
  );
19
22
 
20
23
  element(indexNode: NodeRepresentation): ShaderNodeObject<StorageArrayElementNode>;
21
24
 
22
- setBufferObject(value: boolean): this;
25
+ setPBO(value: boolean): this;
23
26
 
24
- setAccess(value: GPUBufferBindingType): this;
27
+ getPBO(): boolean;
28
+
29
+ setAccess(value: NodeAccess): this;
25
30
 
26
31
  toReadOnly(): this;
27
32
  }
28
33
 
29
34
  export const storage: (
30
35
  value: StorageBufferAttribute | StorageInstancedBufferAttribute,
31
- nodeOrType: NodeOrType,
32
- count: number,
36
+ type?: string | null,
37
+ count?: number,
33
38
  ) => ShaderNodeObject<StorageBufferNode>;
39
+
40
+ /**
41
+ * @deprecated
42
+ */
34
43
  export const storageObject: (
35
44
  value: StorageBufferAttribute | StorageInstancedBufferAttribute,
36
- nodeOrType: NodeOrType,
37
- count: number,
45
+ type?: string | null,
46
+ count?: number,
38
47
  ) => ShaderNodeObject<StorageBufferNode>;
@@ -1,5 +1,5 @@
1
- import { GPUStorageTextureAccess } from "../../renderers/webgpu/utils/WebGPUConstants.js";
2
1
  import { Texture } from "../../textures/Texture.js";
2
+ import { NodeAccess } from "../core/constants.js";
3
3
  import Node from "../core/Node.js";
4
4
  import NodeBuilder from "../core/NodeBuilder.js";
5
5
  import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
@@ -10,7 +10,7 @@ export default class StorageTextureNode extends TextureNode {
10
10
 
11
11
  readonly isStorageTextureNode: true;
12
12
 
13
- access: GPUStorageTextureAccess;
13
+ access: NodeAccess;
14
14
 
15
15
  constructor(
16
16
  value: Texture,
@@ -18,7 +18,9 @@ export default class StorageTextureNode extends TextureNode {
18
18
  storeNode?: Node | null,
19
19
  );
20
20
 
21
- setAccess(value: GPUStorageTextureAccess): this;
21
+ setAccess(value: NodeAccess): this;
22
+
23
+ toReadWrite(): this;
22
24
 
23
25
  toReadOnly(): this;
24
26
 
@@ -24,5 +24,7 @@ export default IndexNode;
24
24
 
25
25
  export const vertexIndex: ShaderNodeObject<IndexNode>;
26
26
  export const instanceIndex: ShaderNodeObject<IndexNode>;
27
+ export const subgroupIndex: ShaderNodeObject<IndexNode>;
28
+ export const invocationSubgroupIndex: ShaderNodeObject<IndexNode>;
27
29
  export const invocationLocalIndex: ShaderNodeObject<IndexNode>;
28
30
  export const drawIndex: ShaderNodeObject<IndexNode>;
@@ -17,8 +17,15 @@ export const hashArray: (array: number[]) => number;
17
17
  export const hash: (...params: number[]) => number;
18
18
 
19
19
  export function getCacheKey(object: Node, force?: boolean): number;
20
+
20
21
  export function getNodeChildren(object: Node): Generator<NodeChild, void>;
22
+
23
+ export function getTypeFromLength(length: number): string | undefined;
24
+
25
+ export function getLengthFromType(type: string): number | undefined;
26
+
21
27
  export function getValueType(value: unknown): string | null;
28
+
22
29
  export function getValueFromType(
23
30
  type: string,
24
31
  ...params: number[]
@@ -1,6 +1,7 @@
1
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
1
2
  import Node from "./Node.js";
2
3
 
3
- export default class StackNode extends Node {
4
+ declare class StackNode extends Node {
4
5
  isStackNode: true;
5
6
  nodes: Node[];
6
7
  outputNode: Node | null;
@@ -25,3 +26,7 @@ export default class StackNode extends Node {
25
26
  */
26
27
  else(method: () => void): this;
27
28
  }
29
+
30
+ export default StackNode;
31
+
32
+ export const stack: () => ShaderNodeObject<StackNode>;
@@ -19,8 +19,14 @@ export declare const NodeType: {
19
19
  readonly MATRIX3: "mat3";
20
20
  readonly MATRIX4: "mat4";
21
21
  };
22
+ export declare const NodeAccess: {
23
+ readonly READ_ONLY: "readOnly";
24
+ readonly WRITE_ONLY: "writeOnly";
25
+ readonly READ_WRITE: "readWrite";
26
+ };
22
27
  export type NodeShaderStage = "vertex" | "fragment" | "compute";
23
28
  export type NodeUpdateType = "none" | "frame" | "render" | "object";
29
+ export type NodeAccess = "readOnly" | "writeOnly" | "readWrite";
24
30
  export declare const defaultShaderStages: NodeShaderStage[];
25
31
  export declare const defaultBuildStages: string[];
26
32
  export declare const shaderStages: NodeShaderStage[];
@@ -0,0 +1,32 @@
1
+ import Node from "../core/Node.js";
2
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ export const blendBurn: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
5
+
6
+ export const blendDodge: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
7
+
8
+ export const blendScreen: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
9
+
10
+ export const blendOverlay: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
11
+
12
+ export const blendColor: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
13
+
14
+ /**
15
+ * @deprecated
16
+ */
17
+ export const burn: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
18
+
19
+ /**
20
+ * @deprecated
21
+ */
22
+ export const dodge: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
23
+
24
+ /**
25
+ * @deprecated
26
+ */
27
+ export const screen: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
28
+
29
+ /**
30
+ * @deprecated
31
+ */
32
+ export const overlay: (base: NodeRepresentation, blend: NodeRepresentation) => ShaderNodeObject<Node>;
@@ -37,6 +37,11 @@ export const viewportUV: ShaderNodeObject<Node>;
37
37
 
38
38
  // Deprecated
39
39
 
40
+ /**
41
+ * @deprecated "viewportResolution" is deprecated. Use "screenSize" instead.
42
+ */
43
+ export const viewportResolution: ShaderNodeObject<ScreenNode>;
44
+
40
45
  /**
41
46
  * @deprecated "viewportTopLeft" is deprecated. Use "viewportUV" instead.
42
47
  */
@@ -29,7 +29,9 @@ export const viewZToPerspectiveDepth: (viewZ: Node, near: Node, far: Node) => No
29
29
 
30
30
  export const perspectiveDepthToViewZ: (depth: Node, near: Node, far: Node) => Node;
31
31
 
32
- export const perspectiveDepthToLogarithmicDepth: (perspectiveW: Node, near: Node, far: Node) => Node;
32
+ export const viewZToLogarithmicDepth: (viewZ: Node, near: Node, far: Node) => Node;
33
+
34
+ export const logarithmicDepthToViewZ: (depth: Node, near: Node, far: Node) => Node;
33
35
 
34
36
  export const depth: ShaderNodeObject<ViewportDepthNode>;
35
37
  export const linearDepth: (valueNode?: Node | null) => ShaderNodeObject<ViewportDepthNode>;
@@ -0,0 +1,88 @@
1
+ import Node from "../core/Node.js";
2
+ import TempNode from "../core/TempNode.js";
3
+ import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
+
5
+ export type AtomicMethod =
6
+ | typeof AtomicFunctionNode.ATOMIC_LOAD
7
+ | typeof AtomicFunctionNode.ATOMIC_STORE
8
+ | typeof AtomicFunctionNode.ATOMIC_ADD
9
+ | typeof AtomicFunctionNode.ATOMIC_SUB
10
+ | typeof AtomicFunctionNode.ATOMIC_MAX
11
+ | typeof AtomicFunctionNode.ATOMIC_MIN
12
+ | typeof AtomicFunctionNode.ATOMIC_AND
13
+ | typeof AtomicFunctionNode.ATOMIC_OR
14
+ | typeof AtomicFunctionNode.ATOMIC_XOR;
15
+
16
+ declare class AtomicFunctionNode extends TempNode {
17
+ method: AtomicMethod;
18
+ pointerNode: Node;
19
+ valueNode: Node;
20
+ storeNode: Node;
21
+
22
+ constructor(method: AtomicMethod, pointerNode: Node, valueNode: Node, storeNode?: Node | null);
23
+
24
+ static ATOMIC_LOAD: "atomicLoad";
25
+ static ATOMIC_STORE: "atomicStore";
26
+ static ATOMIC_ADD: "atomicAdd";
27
+ static ATOMIC_SUB: "atomicSub";
28
+ static ATOMIC_MAX: "atomicMax";
29
+ static ATOMIC_MIN: "atomicMin";
30
+ static ATOMIC_AND: "atomicAnd";
31
+ static ATOMIC_OR: "atomicOr";
32
+ static ATOMIC_XOR: "atomicXor";
33
+ }
34
+
35
+ export const atomicFunc: (
36
+ method: AtomicMethod,
37
+ pointerNode: NodeRepresentation,
38
+ valueNode: NodeRepresentation,
39
+ storeNode?: NodeRepresentation | null,
40
+ ) => ShaderNodeObject<AtomicFunctionNode>;
41
+
42
+ export const atomicStore: (
43
+ pointerNode: NodeRepresentation,
44
+ valueNode: NodeRepresentation,
45
+ storeNode?: NodeRepresentation | null,
46
+ ) => ShaderNodeObject<AtomicFunctionNode>;
47
+
48
+ export const atomicAdd: (
49
+ pointerNode: NodeRepresentation,
50
+ valueNode: NodeRepresentation,
51
+ storeNode?: NodeRepresentation | null,
52
+ ) => ShaderNodeObject<AtomicFunctionNode>;
53
+
54
+ export const atomicSub: (
55
+ pointerNode: NodeRepresentation,
56
+ valueNode: NodeRepresentation,
57
+ storeNode?: NodeRepresentation | null,
58
+ ) => ShaderNodeObject<AtomicFunctionNode>;
59
+
60
+ export const atomicMax: (
61
+ pointerNode: NodeRepresentation,
62
+ valueNode: NodeRepresentation,
63
+ storeNode?: NodeRepresentation | null,
64
+ ) => ShaderNodeObject<AtomicFunctionNode>;
65
+
66
+ export const atomicMin: (
67
+ pointerNode: NodeRepresentation,
68
+ valueNode: NodeRepresentation,
69
+ storeNode?: NodeRepresentation | null,
70
+ ) => ShaderNodeObject<AtomicFunctionNode>;
71
+
72
+ export const atomicAnd: (
73
+ pointerNode: NodeRepresentation,
74
+ valueNode: NodeRepresentation,
75
+ storeNode?: NodeRepresentation | null,
76
+ ) => ShaderNodeObject<AtomicFunctionNode>;
77
+
78
+ export const atomicOr: (
79
+ pointerNode: NodeRepresentation,
80
+ valueNode: NodeRepresentation,
81
+ storeNode?: NodeRepresentation | null,
82
+ ) => ShaderNodeObject<AtomicFunctionNode>;
83
+
84
+ export const atomicXor: (
85
+ pointerNode: NodeRepresentation,
86
+ valueNode: NodeRepresentation,
87
+ storeNode?: NodeRepresentation | null,
88
+ ) => ShaderNodeObject<AtomicFunctionNode>;
@@ -0,0 +1,12 @@
1
+ import Node from "../core/Node.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ declare class BarrierNode extends Node {
5
+ scope: string;
6
+
7
+ constructor(scope: string);
8
+ }
9
+
10
+ export const workgroupBarrier: () => ShaderNodeObject<Node>;
11
+ export const storageBarrier: () => ShaderNodeObject<Node>;
12
+ export const textureBarrier: () => ShaderNodeObject<Node>;
@@ -0,0 +1,13 @@
1
+ import Node from "../core/Node.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ declare class ComputeBuiltinNode extends Node {
5
+ constructor(builtinName: string, nodeType: string);
6
+ }
7
+
8
+ export default ComputeBuiltinNode;
9
+
10
+ export const numWorkgroups: ShaderNodeObject<ComputeBuiltinNode>;
11
+ export const workgroupId: ShaderNodeObject<ComputeBuiltinNode>;
12
+ export const localId: ShaderNodeObject<ComputeBuiltinNode>;
13
+ export const subgroupSize: ShaderNodeObject<ComputeBuiltinNode>;
@@ -0,0 +1,17 @@
1
+ import Node from "../core/Node.js";
2
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
3
+
4
+ declare class WorkgroupInfoNode extends Node {
5
+ bufferType: string;
6
+ bufferCount: number;
7
+
8
+ readonly isWorkgroupInfoNode: true;
9
+
10
+ scope: string;
11
+
12
+ constructor(scope: string, bufferType: string, bufferCount?: number);
13
+ }
14
+
15
+ export default WorkgroupInfoNode;
16
+
17
+ export const workgroupArray: (type: string, count?: number) => ShaderNodeObject<WorkgroupInfoNode>;
@@ -1,8 +1,19 @@
1
1
  import { Light } from "../../lights/Light.js";
2
+ import Node from "../core/Node.js";
3
+ import { ShaderNodeObject } from "../tsl/TSLCore.js";
2
4
  import LightingNode from "./LightingNode.js";
5
+ import ShadowNode from "./ShadowNode.js";
6
+
7
+ declare module "../../lights/LightShadow.js" {
8
+ export interface LightShadow {
9
+ shadowNode?: Node;
10
+ }
11
+ }
3
12
 
4
13
  export default class AnalyticLightNode<T extends Light> extends LightingNode {
5
14
  light: T | null;
6
15
 
7
16
  constructor(light?: T | null);
17
+
18
+ setupShadowNode(): ShaderNodeObject<ShadowNode>;
8
19
  }
@@ -2,14 +2,14 @@ import { Light } from "../../lights/Light.js";
2
2
  import Node from "../core/Node.js";
3
3
  import { NodeBuilder } from "../Nodes.js";
4
4
  import { ShaderNodeObject } from "../tsl/TSLCore.js";
5
- import LightNode from "./LightNode.js";
5
+ import LightingNode from "./LightingNode.js";
6
6
 
7
7
  declare class LightsNode extends Node {
8
8
  constructor();
9
9
 
10
10
  setupLightsNode(builder: NodeBuilder): void;
11
11
 
12
- setupLights(builder: NodeBuilder, lightNodes: LightNode[]): void;
12
+ setupLights(builder: NodeBuilder, lightNodes: LightingNode[]): void;
13
13
 
14
14
  setLights(lights: Light[]): this;
15
15
 
@@ -2,6 +2,7 @@ import { PointLight } from "../../lights/PointLight.js";
2
2
  import Node from "../core/Node.js";
3
3
  import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js";
4
4
  import AnalyticLightNode from "./AnalyticLightNode.js";
5
+ import PointShadowNode from "./PointShadowNode.js";
5
6
 
6
7
  export const directPointLight: (
7
8
  color: NodeRepresentation,
@@ -15,6 +16,8 @@ declare class PointLightNode extends AnalyticLightNode<PointLight> {
15
16
  decayExponentNode: Node;
16
17
 
17
18
  constructor(light?: PointLight | null);
19
+
20
+ setupShadowNode(): ShaderNodeObject<PointShadowNode>;
18
21
  }
19
22
 
20
23
  export default PointLightNode;