@types/three 0.177.0 → 0.178.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/capabilities/WebGL.d.ts +0 -11
- three/examples/jsm/controls/TransformControls.d.ts +16 -1
- three/examples/jsm/helpers/TextureHelper.d.ts +2 -2
- three/examples/jsm/helpers/TextureHelperGPU.d.ts +2 -2
- three/examples/jsm/loaders/SVGLoader.d.ts +1 -1
- three/examples/jsm/physics/RapierPhysics.d.ts +1 -0
- three/examples/jsm/transpiler/AST.d.ts +77 -26
- three/examples/jsm/transpiler/TSLEncoder.d.ts +9 -3
- three/examples/jsm/tsl/display/AnamorphicNode.d.ts +4 -4
- three/examples/jsm/tsl/display/BleachBypass.d.ts +2 -2
- three/examples/jsm/tsl/display/BloomNode.d.ts +2 -2
- three/examples/jsm/tsl/display/ChromaticAberrationNode.d.ts +20 -0
- three/examples/jsm/tsl/display/DenoiseNode.d.ts +4 -4
- three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +6 -6
- three/examples/jsm/tsl/display/DotScreenNode.d.ts +2 -2
- three/examples/jsm/tsl/display/FXAANode.d.ts +3 -3
- three/examples/jsm/tsl/display/FilmNode.d.ts +4 -4
- three/examples/jsm/tsl/display/GTAONode.d.ts +3 -3
- three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +5 -5
- three/examples/jsm/tsl/display/LensflareNode.d.ts +8 -8
- three/examples/jsm/tsl/display/Lut3DNode.d.ts +4 -4
- three/examples/jsm/tsl/display/MotionBlur.d.ts +4 -4
- three/examples/jsm/tsl/display/OutlineNode.d.ts +3 -3
- three/examples/jsm/tsl/display/RGBShiftNode.d.ts +3 -3
- three/examples/jsm/tsl/display/SMAANode.d.ts +3 -3
- three/examples/jsm/tsl/display/SSRNode.d.ts +5 -5
- three/examples/jsm/tsl/display/Sepia.d.ts +2 -2
- three/examples/jsm/tsl/display/SobelOperatorNode.d.ts +3 -3
- three/examples/jsm/tsl/display/TransitionNode.d.ts +4 -4
- three/examples/jsm/tsl/display/hashBlur.d.ts +5 -5
- three/examples/jsm/tsl/lighting/TiledLightsNode.d.ts +5 -5
- three/package.json +2 -2
- three/src/Three.TSL.d.ts +9 -16
- three/src/Three.WebGPU.d.ts +2 -0
- three/src/constants.d.ts +13 -5
- three/src/core/BufferGeometry.d.ts +6 -1
- three/src/core/GLBufferAttribute.d.ts +18 -1
- three/src/helpers/AxesHelper.d.ts +3 -1
- three/src/materials/LineBasicMaterial.d.ts +66 -34
- three/src/materials/LineDashedMaterial.d.ts +41 -21
- three/src/materials/Material.d.ts +408 -398
- three/src/materials/MeshBasicMaterial.d.ts +101 -62
- three/src/materials/MeshDepthMaterial.d.ts +71 -32
- three/src/materials/MeshDistanceMaterial.d.ts +65 -29
- three/src/materials/MeshLambertMaterial.d.ts +179 -103
- three/src/materials/MeshMatcapMaterial.d.ts +97 -55
- three/src/materials/MeshNormalMaterial.d.ts +76 -41
- three/src/materials/MeshPhongMaterial.d.ts +164 -100
- three/src/materials/MeshPhysicalMaterial.d.ts +164 -116
- three/src/materials/MeshStandardMaterial.d.ts +178 -91
- three/src/materials/MeshToonMaterial.d.ts +130 -81
- three/src/materials/PointsMaterial.d.ts +77 -30
- three/src/materials/RawShaderMaterial.d.ts +12 -7
- three/src/materials/ShaderMaterial.d.ts +186 -98
- three/src/materials/ShadowMaterial.d.ts +49 -23
- three/src/materials/SpriteMaterial.d.ts +62 -33
- three/src/materials/nodes/Line2NodeMaterial.d.ts +87 -40
- three/src/materials/nodes/LineBasicNodeMaterial.d.ts +35 -16
- three/src/materials/nodes/LineDashedNodeMaterial.d.ts +75 -20
- three/src/materials/nodes/MeshBasicNodeMaterial.d.ts +49 -30
- three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +49 -42
- three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts +38 -26
- three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +36 -22
- three/src/materials/nodes/MeshPhongNodeMaterial.d.ts +68 -48
- three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts +240 -65
- three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +99 -3
- three/src/materials/nodes/MeshStandardNodeMaterial.d.ts +83 -47
- three/src/materials/nodes/MeshToonNodeMaterial.d.ts +42 -36
- three/src/materials/nodes/NodeMaterial.d.ts +417 -56
- three/src/materials/nodes/NodeMaterials.d.ts +3 -2
- three/src/materials/nodes/PointsNodeMaterial.d.ts +31 -7
- three/src/materials/nodes/ShadowNodeMaterial.d.ts +38 -11
- three/src/materials/nodes/SpriteNodeMaterial.d.ts +68 -20
- three/src/materials/nodes/VolumeNodeMaterial.d.ts +50 -14
- three/src/math/Color.d.ts +1 -1
- three/src/nodes/Nodes.d.ts +1 -3
- three/src/nodes/TSL.d.ts +4 -3
- three/src/nodes/accessors/AccessorsUtils.d.ts +3 -3
- three/src/nodes/accessors/Bitangent.d.ts +0 -2
- three/src/nodes/accessors/CubeTextureNode.d.ts +7 -7
- three/src/nodes/accessors/Normal.d.ts +19 -5
- three/src/nodes/accessors/ReferenceBaseNode.d.ts +1 -1
- three/src/nodes/accessors/StorageBufferNode.d.ts +3 -2
- three/src/nodes/accessors/StorageTextureNode.d.ts +5 -5
- three/src/nodes/accessors/Tangent.d.ts +0 -2
- three/src/nodes/accessors/TangentUtils.d.ts +22 -0
- three/src/nodes/accessors/Texture3DNode.d.ts +5 -4
- three/src/nodes/accessors/TextureBicubic.d.ts +4 -2
- three/src/nodes/accessors/TextureNode.d.ts +16 -16
- three/src/nodes/accessors/TextureSizeNode.d.ts +3 -3
- three/src/nodes/accessors/UniformArrayNode.d.ts +2 -7
- three/src/nodes/code/FunctionCallNode.d.ts +3 -1
- three/src/nodes/code/FunctionNode.d.ts +2 -2
- three/src/nodes/code/ScriptableNode.d.ts +2 -2
- three/src/nodes/core/AssignNode.d.ts +2 -2
- three/src/nodes/core/AttributeNode.d.ts +1 -1
- three/src/nodes/core/BypassNode.d.ts +2 -2
- three/src/nodes/core/CacheNode.d.ts +0 -2
- three/src/nodes/core/ContextNode.d.ts +3 -3
- three/src/nodes/core/StackNode.d.ts +3 -13
- three/src/nodes/core/SubBuildNode.d.ts +15 -0
- three/src/nodes/core/VarNode.d.ts +4 -4
- three/src/nodes/core/VaryingNode.d.ts +3 -3
- three/src/nodes/display/BlendModes.d.ts +12 -12
- three/src/nodes/display/BumpMapNode.d.ts +4 -3
- three/src/nodes/display/ColorAdjustment.d.ts +17 -17
- three/src/nodes/display/ColorSpaceFunctions.d.ts +3 -3
- three/src/nodes/display/ColorSpaceNode.d.ts +4 -4
- three/src/nodes/display/FrontFacingNode.d.ts +1 -0
- three/src/nodes/display/PosterizeNode.d.ts +3 -3
- three/src/nodes/display/RenderOutputNode.d.ts +2 -2
- three/src/nodes/display/ScreenNode.d.ts +0 -10
- three/src/nodes/display/ToneMappingFunctions.d.ts +7 -7
- three/src/nodes/display/ToneMappingNode.d.ts +6 -6
- three/src/nodes/display/ViewportDepthTextureNode.d.ts +3 -3
- three/src/nodes/fog/Fog.d.ts +10 -10
- three/src/nodes/functions/BSDF/Schlick_to_F0.d.ts +4 -4
- three/src/nodes/functions/material/getAlphaHashThreshold.d.ts +2 -2
- three/src/nodes/functions/material/getParallaxCorrectNormal.d.ts +4 -4
- three/src/nodes/geometry/RangeNode.d.ts +9 -2
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +20 -20
- three/src/nodes/gpgpu/ComputeNode.d.ts +2 -2
- three/src/nodes/lighting/PointShadowNode.d.ts +11 -11
- three/src/nodes/lighting/ShadowFilterNode.d.ts +11 -11
- three/src/nodes/materialx/MaterialXNodes.d.ts +59 -59
- three/src/nodes/materialx/lib/mx_hsv.d.ts +3 -3
- three/src/nodes/materialx/lib/mx_noise.d.ts +206 -206
- three/src/nodes/materialx/lib/mx_transform_color.d.ts +2 -2
- three/src/nodes/math/ConditionalNode.d.ts +4 -19
- three/src/nodes/math/Hash.d.ts +2 -2
- three/src/nodes/math/MathNode.d.ts +21 -17
- three/src/nodes/math/OperatorNode.d.ts +41 -52
- three/src/nodes/math/TriNoise3D.d.ts +6 -6
- three/src/nodes/pmrem/PMREMNode.d.ts +3 -3
- three/src/nodes/pmrem/PMREMUtils.d.ts +20 -20
- three/src/nodes/procedural/Checker.d.ts +2 -2
- three/src/nodes/shapes/Shapes.d.ts +2 -2
- three/src/nodes/tsl/TSLBase.d.ts +1 -0
- three/src/nodes/tsl/TSLCore.d.ts +176 -76
- three/src/nodes/utils/CubeMapNode.d.ts +2 -2
- three/src/nodes/utils/DebugNode.d.ts +2 -2
- three/src/nodes/utils/Discard.d.ts +2 -2
- three/src/nodes/utils/EquirectUV.d.ts +4 -0
- three/src/nodes/utils/LoopNode.d.ts +2 -7
- three/src/nodes/utils/MatcapUV.d.ts +4 -0
- three/src/nodes/utils/Oscillators.d.ts +5 -5
- three/src/nodes/utils/Packing.d.ts +3 -3
- three/src/nodes/utils/PostProcessingUtils.d.ts +9 -9
- three/src/nodes/utils/RTTNode.d.ts +3 -3
- three/src/nodes/utils/RemapNode.d.ts +9 -9
- three/src/nodes/utils/RotateNode.d.ts +3 -3
- three/src/nodes/utils/SampleNode.d.ts +16 -0
- three/src/nodes/utils/SpriteSheetUVNode.d.ts +4 -4
- three/src/nodes/utils/SpriteUtils.d.ts +2 -2
- three/src/nodes/utils/StorageArrayElementNode.d.ts +4 -3
- three/src/nodes/utils/TriplanarTextures.d.ts +20 -0
- three/src/nodes/utils/UVUtils.d.ts +8 -7
- three/src/nodes/utils/ViewportUtils.d.ts +2 -2
- three/src/objects/LOD.d.ts +1 -1
- three/src/renderers/WebGLRenderer.d.ts +1 -1
- three/src/renderers/common/Backend.d.ts +3 -3
- three/src/renderers/common/RenderObject.d.ts +10 -2
- three/src/renderers/common/Renderer.d.ts +5 -5
- three/src/renderers/common/Storage3DTexture.d.ts +40 -0
- three/src/renderers/common/StorageArrayTexture.d.ts +29 -0
- three/src/renderers/common/Textures.d.ts +2 -2
- three/src/renderers/common/XRRenderTarget.d.ts +3 -2
- three/src/renderers/common/nodes/NodeLibrary.d.ts +4 -9
- three/src/renderers/common/nodes/NodeSampledTexture.d.ts +1 -1
- three/src/renderers/common/nodes/Nodes.d.ts +1 -1
- three/src/renderers/webgpu/WebGPURenderer.d.ts +3 -0
- three/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +65 -0
- three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +9 -0
- three/src/nodes/utils/EquirectUVNode.d.ts +0 -8
- three/src/nodes/utils/MatcapUVNode.d.ts +0 -8
- three/src/nodes/utils/TriplanarTexturesNode.d.ts +0 -36
- three/src/renderers/common/nodes/StandardNodeLibrary.d.ts +0 -5
three/README.md
CHANGED
|
@@ -8,7 +8,7 @@ This package contains type definitions for three (https://threejs.org/).
|
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three.
|
|
9
9
|
|
|
10
10
|
### Additional Details
|
|
11
|
-
* Last updated:
|
|
11
|
+
* Last updated: Tue, 01 Jul 2025 17:03:03 GMT
|
|
12
12
|
* Dependencies: [@dimforge/rapier3d-compat](https://npmjs.com/package/@dimforge/rapier3d-compat), [@tweenjs/tween.js](https://npmjs.com/package/@tweenjs/tween.js), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr), [@webgpu/types](https://npmjs.com/package/@webgpu/types), [fflate](https://npmjs.com/package/fflate), [meshoptimizer](https://npmjs.com/package/meshoptimizer)
|
|
13
13
|
|
|
14
14
|
# Credits
|
|
@@ -3,15 +3,4 @@ export default class WebGL {
|
|
|
3
3
|
static isColorSpaceAvailable(colorSpace: PredefinedColorSpace): boolean;
|
|
4
4
|
static getWebGL2ErrorMessage(): HTMLElement;
|
|
5
5
|
static getErrorMessage(version: number): HTMLElement;
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated isWebGLAvailable() has been deprecated and will be removed in r178. Use isWebGL2Available() instead.
|
|
9
|
-
*/
|
|
10
|
-
static isWebGLAvailable(): boolean;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated getWebGLErrorMessage() has been deprecated and will be removed in r178. Use getWebGL2ErrorMessage()
|
|
14
|
-
* instead.
|
|
15
|
-
*/
|
|
16
|
-
static getWebGLErrorMessage(): HTMLElement;
|
|
17
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Camera, Controls, Mesh, Object3D, Quaternion, Raycaster, Vector3 } from "three";
|
|
1
|
+
import { Camera, ColorRepresentation, Controls, Mesh, Object3D, Quaternion, Raycaster, Vector3 } from "three";
|
|
2
2
|
|
|
3
3
|
export type TransformControlsMode = "translate" | "rotate" | "scale";
|
|
4
4
|
|
|
@@ -240,6 +240,21 @@ declare class TransformControls extends Controls<TransformControlsEventMap> {
|
|
|
240
240
|
* @param space The coordinate space in which transformations are applied.
|
|
241
241
|
*/
|
|
242
242
|
setSpace(space: "world" | "local"): void;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Sets the colors of the control's gizmo.
|
|
246
|
+
*
|
|
247
|
+
* @param {number|Color|string} xAxis - The x-axis color.
|
|
248
|
+
* @param {number|Color|string} yAxis - The y-axis color.
|
|
249
|
+
* @param {number|Color|string} zAxis - The z-axis color.
|
|
250
|
+
* @param {number|Color|string} active - The color for active elements.
|
|
251
|
+
*/
|
|
252
|
+
setColors(
|
|
253
|
+
xAxis: ColorRepresentation,
|
|
254
|
+
yAxis: ColorRepresentation,
|
|
255
|
+
zAxis: ColorRepresentation,
|
|
256
|
+
active: ColorRepresentation,
|
|
257
|
+
): void;
|
|
243
258
|
}
|
|
244
259
|
|
|
245
260
|
declare class TransformControlsRoot extends Object3D {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Mesh, Texture } from "three";
|
|
1
|
+
import { BufferGeometry, Mesh, ShaderMaterial, Texture } from "three";
|
|
2
2
|
|
|
3
|
-
export class TextureHelper extends Mesh {
|
|
3
|
+
export class TextureHelper extends Mesh<BufferGeometry, ShaderMaterial> {
|
|
4
4
|
texture: Texture;
|
|
5
5
|
type: "TextureHelper";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Mesh, Texture } from "three";
|
|
1
|
+
import { BufferGeometry, Mesh, NodeMaterial, Texture } from "three/webgpu";
|
|
2
2
|
|
|
3
|
-
export class TextureHelper extends Mesh {
|
|
3
|
+
export class TextureHelper extends Mesh<BufferGeometry, NodeMaterial> {
|
|
4
4
|
texture: Texture;
|
|
5
5
|
type: "TextureHelper";
|
|
6
6
|
|
|
@@ -34,7 +34,7 @@ export class SVGLoader extends Loader<SVGResult> {
|
|
|
34
34
|
): StrokeStyle;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Generates a stroke with some
|
|
37
|
+
* Generates a stroke with some width around the given path.
|
|
38
38
|
* @remarks The path can be open or closed (last point equals to first point)
|
|
39
39
|
* @param points Array of Vector2D (the path). Minimum 2 points.
|
|
40
40
|
* @param style Object with SVG properties as returned by SVGLoader.getStrokeStyle(), or SVGLoader.parse() in the path.userData.style object
|
|
@@ -8,6 +8,7 @@ export interface RapierPhysicsObject {
|
|
|
8
8
|
world: RAPIER.World;
|
|
9
9
|
addScene: (scene: Object3D) => void;
|
|
10
10
|
addMesh: (mesh: Mesh, mass?: number, restitution?: number) => void;
|
|
11
|
+
removeMesh: (mesh: Mesh) => void;
|
|
11
12
|
setMeshPosition: (mesh: Mesh, position: Vector, index?: number) => void;
|
|
12
13
|
setMeshVelocity: (mesh: Mesh, velocity: Vector, index?: number) => void;
|
|
13
14
|
addHeightfield: (
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
+
export class Comment {
|
|
2
|
+
constructor(comment: string);
|
|
3
|
+
|
|
4
|
+
comment: string;
|
|
5
|
+
|
|
6
|
+
readonly isComment: true;
|
|
7
|
+
}
|
|
8
|
+
|
|
1
9
|
export class Program {
|
|
2
|
-
constructor();
|
|
10
|
+
constructor(body?: Statement[]);
|
|
3
11
|
|
|
4
12
|
body: Statement[];
|
|
5
13
|
|
|
6
|
-
isProgram: true;
|
|
14
|
+
readonly isProgram: true;
|
|
7
15
|
}
|
|
8
16
|
|
|
9
17
|
// Boolean seems to be handled as a Unary
|
|
@@ -23,11 +31,16 @@ export type Statement =
|
|
|
23
31
|
| FunctionCall
|
|
24
32
|
| Return
|
|
25
33
|
| Discard
|
|
34
|
+
| Continue
|
|
35
|
+
| Break
|
|
26
36
|
| Accessor
|
|
27
37
|
| StaticElement
|
|
28
38
|
| DynamicElement
|
|
29
39
|
| AccessorElements
|
|
30
40
|
| For
|
|
41
|
+
| While
|
|
42
|
+
| Switch
|
|
43
|
+
| SwitchCase
|
|
31
44
|
| null;
|
|
32
45
|
|
|
33
46
|
export class VariableDeclaration {
|
|
@@ -46,7 +59,7 @@ export class VariableDeclaration {
|
|
|
46
59
|
|
|
47
60
|
immutable: boolean;
|
|
48
61
|
|
|
49
|
-
isVariableDeclaration: true;
|
|
62
|
+
readonly isVariableDeclaration: true;
|
|
50
63
|
}
|
|
51
64
|
|
|
52
65
|
export class Uniform {
|
|
@@ -55,7 +68,7 @@ export class Uniform {
|
|
|
55
68
|
type: string;
|
|
56
69
|
name: string;
|
|
57
70
|
|
|
58
|
-
isUniform: true;
|
|
71
|
+
readonly isUniform: true;
|
|
59
72
|
}
|
|
60
73
|
|
|
61
74
|
export class Varying {
|
|
@@ -64,7 +77,7 @@ export class Varying {
|
|
|
64
77
|
type: string;
|
|
65
78
|
name: string;
|
|
66
79
|
|
|
67
|
-
isVarying: true;
|
|
80
|
+
readonly isVarying: true;
|
|
68
81
|
}
|
|
69
82
|
|
|
70
83
|
export class FunctionParameter {
|
|
@@ -75,18 +88,18 @@ export class FunctionParameter {
|
|
|
75
88
|
qualifier: string | null;
|
|
76
89
|
immutable: boolean;
|
|
77
90
|
|
|
78
|
-
isFunctionParameter: true;
|
|
91
|
+
readonly isFunctionParameter: true;
|
|
79
92
|
}
|
|
80
93
|
|
|
81
94
|
export class FunctionDeclaration {
|
|
82
|
-
constructor(type: string, name: string, params?: FunctionParameter[]);
|
|
95
|
+
constructor(type: string, name: string, params?: FunctionParameter[], body?: Statement[]);
|
|
83
96
|
|
|
84
97
|
type: string;
|
|
85
98
|
name: string;
|
|
86
99
|
params: FunctionParameter[];
|
|
87
100
|
body: Statement[];
|
|
88
101
|
|
|
89
|
-
isFunctionDeclaration: true;
|
|
102
|
+
readonly isFunctionDeclaration: true;
|
|
90
103
|
}
|
|
91
104
|
|
|
92
105
|
export class Expression {
|
|
@@ -94,7 +107,7 @@ export class Expression {
|
|
|
94
107
|
|
|
95
108
|
expression: string;
|
|
96
109
|
|
|
97
|
-
isExpression: true;
|
|
110
|
+
readonly isExpression: true;
|
|
98
111
|
}
|
|
99
112
|
|
|
100
113
|
export class Ternary {
|
|
@@ -104,7 +117,7 @@ export class Ternary {
|
|
|
104
117
|
left: Statement;
|
|
105
118
|
right: Statement;
|
|
106
119
|
|
|
107
|
-
isTernary: true;
|
|
120
|
+
readonly isTernary: true;
|
|
108
121
|
}
|
|
109
122
|
|
|
110
123
|
export class Operator {
|
|
@@ -114,7 +127,7 @@ export class Operator {
|
|
|
114
127
|
left: Statement;
|
|
115
128
|
right: Statement;
|
|
116
129
|
|
|
117
|
-
isOperator: true;
|
|
130
|
+
readonly isOperator: true;
|
|
118
131
|
}
|
|
119
132
|
|
|
120
133
|
export class Unary {
|
|
@@ -124,7 +137,7 @@ export class Unary {
|
|
|
124
137
|
expression: Statement;
|
|
125
138
|
after: boolean;
|
|
126
139
|
|
|
127
|
-
isUnary: true;
|
|
140
|
+
readonly isUnary: true;
|
|
128
141
|
}
|
|
129
142
|
|
|
130
143
|
export class Number {
|
|
@@ -133,7 +146,7 @@ export class Number {
|
|
|
133
146
|
type: string;
|
|
134
147
|
value: string;
|
|
135
148
|
|
|
136
|
-
isNumber: true;
|
|
149
|
+
readonly isNumber: true;
|
|
137
150
|
}
|
|
138
151
|
|
|
139
152
|
export class String {
|
|
@@ -141,18 +154,17 @@ export class String {
|
|
|
141
154
|
|
|
142
155
|
value: string;
|
|
143
156
|
|
|
144
|
-
isString: true;
|
|
157
|
+
readonly isString: true;
|
|
145
158
|
}
|
|
146
159
|
|
|
147
160
|
export class Conditional {
|
|
148
|
-
constructor(cond?: Conditional | null);
|
|
161
|
+
constructor(cond?: Conditional | null, body?: Statement[]);
|
|
149
162
|
|
|
150
163
|
cond: Conditional | null;
|
|
151
|
-
|
|
152
164
|
body: Statement[];
|
|
153
165
|
elseConditional: Conditional | null;
|
|
154
166
|
|
|
155
|
-
isConditional: true;
|
|
167
|
+
readonly isConditional: true;
|
|
156
168
|
}
|
|
157
169
|
|
|
158
170
|
export class FunctionCall {
|
|
@@ -161,7 +173,7 @@ export class FunctionCall {
|
|
|
161
173
|
name: string;
|
|
162
174
|
params: Statement[];
|
|
163
175
|
|
|
164
|
-
isFunctionCall: true;
|
|
176
|
+
readonly isFunctionCall: true;
|
|
165
177
|
}
|
|
166
178
|
|
|
167
179
|
export class Return {
|
|
@@ -169,13 +181,25 @@ export class Return {
|
|
|
169
181
|
|
|
170
182
|
value: Statement;
|
|
171
183
|
|
|
172
|
-
isReturn: true;
|
|
184
|
+
readonly isReturn: true;
|
|
173
185
|
}
|
|
174
186
|
|
|
175
187
|
export class Discard {
|
|
176
188
|
constructor();
|
|
177
189
|
|
|
178
|
-
isDiscard: true;
|
|
190
|
+
readonly isDiscard: true;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export class Continue {
|
|
194
|
+
constructor();
|
|
195
|
+
|
|
196
|
+
readonly isContinue: true;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export class Break {
|
|
200
|
+
constructor();
|
|
201
|
+
|
|
202
|
+
readonly isBreak: true;
|
|
179
203
|
}
|
|
180
204
|
|
|
181
205
|
export class Accessor {
|
|
@@ -183,7 +207,7 @@ export class Accessor {
|
|
|
183
207
|
|
|
184
208
|
property: string;
|
|
185
209
|
|
|
186
|
-
isAccessor: true;
|
|
210
|
+
readonly isAccessor: true;
|
|
187
211
|
}
|
|
188
212
|
|
|
189
213
|
export class StaticElement {
|
|
@@ -191,7 +215,7 @@ export class StaticElement {
|
|
|
191
215
|
|
|
192
216
|
value: Statement;
|
|
193
217
|
|
|
194
|
-
isStaticElement: true;
|
|
218
|
+
readonly isStaticElement: true;
|
|
195
219
|
}
|
|
196
220
|
|
|
197
221
|
export class DynamicElement {
|
|
@@ -199,7 +223,7 @@ export class DynamicElement {
|
|
|
199
223
|
|
|
200
224
|
value: Statement;
|
|
201
225
|
|
|
202
|
-
isDynamicElement: true;
|
|
226
|
+
readonly isDynamicElement: true;
|
|
203
227
|
}
|
|
204
228
|
|
|
205
229
|
export class AccessorElements {
|
|
@@ -208,17 +232,44 @@ export class AccessorElements {
|
|
|
208
232
|
object: FunctionCall | Accessor;
|
|
209
233
|
elements: (StaticElement | DynamicElement)[];
|
|
210
234
|
|
|
211
|
-
isAccessorElements: true;
|
|
235
|
+
readonly isAccessorElements: true;
|
|
212
236
|
}
|
|
213
237
|
|
|
214
238
|
export class For {
|
|
215
|
-
constructor(initialization: Statement, condition: Statement, afterthought: Statement);
|
|
239
|
+
constructor(initialization: Statement, condition: Statement, afterthought: Statement, body?: Statement[]);
|
|
216
240
|
|
|
217
241
|
initialization: Statement;
|
|
218
242
|
condition: Statement;
|
|
219
243
|
afterthought: Statement;
|
|
244
|
+
body: Statement[];
|
|
245
|
+
|
|
246
|
+
readonly isFor: true;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
export class While {
|
|
250
|
+
constructor(condition: Statement, body?: Statement[]);
|
|
251
|
+
|
|
252
|
+
condition: Statement;
|
|
253
|
+
body: Statement[];
|
|
254
|
+
|
|
255
|
+
readonly isWhile: true;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
export class Switch {
|
|
259
|
+
constructor(discriminant: Statement, cases: Statement[]);
|
|
260
|
+
|
|
261
|
+
discriminant: Statement;
|
|
262
|
+
cases: Statement[];
|
|
263
|
+
|
|
264
|
+
readonly isSwitch: true;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
export class SwitchCase {
|
|
268
|
+
constructor(body: Statement, conditions?: Statement[] | null);
|
|
220
269
|
|
|
221
270
|
body: Statement[];
|
|
271
|
+
conditions: Statement[];
|
|
222
272
|
|
|
223
|
-
|
|
273
|
+
isDefault: boolean;
|
|
274
|
+
readonly isSwitchCase: true;
|
|
224
275
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
|
+
Comment,
|
|
2
3
|
Conditional,
|
|
3
4
|
Expression,
|
|
4
5
|
For,
|
|
5
6
|
FunctionDeclaration,
|
|
6
7
|
Program,
|
|
7
8
|
Statement,
|
|
9
|
+
Switch,
|
|
8
10
|
Ternary,
|
|
9
11
|
Uniform,
|
|
10
12
|
VariableDeclaration,
|
|
11
13
|
Varying,
|
|
14
|
+
While,
|
|
12
15
|
} from "./AST.js";
|
|
13
16
|
|
|
14
17
|
export default class TSLEncoder {
|
|
@@ -19,23 +22,26 @@ export default class TSLEncoder {
|
|
|
19
22
|
global: Set<string>;
|
|
20
23
|
overloadings: Map<string, string>;
|
|
21
24
|
iife: boolean;
|
|
22
|
-
uniqueNames: boolean;
|
|
23
25
|
reference: boolean;
|
|
26
|
+
block: Statement | null;
|
|
24
27
|
|
|
25
28
|
addImport(name: string): void;
|
|
26
29
|
emitUniform(node: Uniform): string;
|
|
27
|
-
emitExpression(node: Expression): string;
|
|
30
|
+
emitExpression(node: Expression, output?: string | null): string;
|
|
28
31
|
emitBody(body: Statement[]): string;
|
|
29
32
|
emitTernary(node: Ternary): string;
|
|
30
33
|
emitConditional(node: Conditional): string;
|
|
31
34
|
emitLoop(node: For): string;
|
|
35
|
+
emitSwitch(switchNode: Switch): string;
|
|
32
36
|
emitFor(node: For): string;
|
|
33
37
|
emitForWhile(node: For): string;
|
|
38
|
+
emitWhile(node: While): string;
|
|
34
39
|
emitVariables(node: VariableDeclaration, isRoot?: boolean): string;
|
|
35
40
|
emitVarying(node: Varying): string;
|
|
36
41
|
emitOverloadingFunction(nodes: FunctionDeclaration[]): string;
|
|
37
42
|
emitFunction(node: FunctionDeclaration): string;
|
|
38
43
|
setLastStatement(statement: Statement | null): void;
|
|
39
|
-
|
|
44
|
+
emitComment(statement: Comment, body: Statement[]): string;
|
|
45
|
+
emitExtraLine(statement: Statement, body: Statement[]): string;
|
|
40
46
|
emit(ast: Program): string;
|
|
41
47
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
2
|
import { Node, TempNode, Vector2 } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
export default class AnamorphicNode extends TempNode {
|
|
@@ -17,7 +17,7 @@ export default class AnamorphicNode extends TempNode {
|
|
|
17
17
|
|
|
18
18
|
export const anamorphic: (
|
|
19
19
|
node: Node,
|
|
20
|
-
threshold?:
|
|
21
|
-
scale?:
|
|
22
|
-
samples?:
|
|
20
|
+
threshold?: Node,
|
|
21
|
+
scale?: Node,
|
|
22
|
+
samples?: Node | number,
|
|
23
23
|
) => ShaderNodeObject<AnamorphicNode>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
2
|
import { Node } from "three/webgpu";
|
|
3
3
|
|
|
4
|
-
export const bleach: (color:
|
|
4
|
+
export const bleach: (color: Node, opacity?: number) => ShaderNodeObject<Node>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
2
|
import { Node, TempNode, TextureNode, UniformNode } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
declare class BloomNode extends TempNode {
|
|
@@ -17,7 +17,7 @@ declare class BloomNode extends TempNode {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export const bloom: (
|
|
20
|
-
node:
|
|
20
|
+
node: Node,
|
|
21
21
|
strength?: number,
|
|
22
22
|
radius?: number,
|
|
23
23
|
threshold?: number,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
|
+
import { Node, TempNode, Vector2 } from "three/webgpu";
|
|
3
|
+
|
|
4
|
+
declare class ChromaticAberrationNode extends TempNode {
|
|
5
|
+
textureNode: Node;
|
|
6
|
+
strengthNode: Node;
|
|
7
|
+
centerNode: Node;
|
|
8
|
+
scaleNode: Node;
|
|
9
|
+
|
|
10
|
+
constructor(textureNode: Node, strengthNode: Node, centerNode: Node, scaleNode: Node);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default ChromaticAberrationNode;
|
|
14
|
+
|
|
15
|
+
export const chromaticAberration: (
|
|
16
|
+
node: Node,
|
|
17
|
+
strength?: Node,
|
|
18
|
+
center?: Node | Vector2 | null,
|
|
19
|
+
scale?: Node,
|
|
20
|
+
) => ShaderNodeObject<ChromaticAberrationNode>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
2
|
import { Camera, Node, TempNode, UniformNode } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
declare class DenoiseNode extends TempNode {
|
|
@@ -20,8 +20,8 @@ declare class DenoiseNode extends TempNode {
|
|
|
20
20
|
export default DenoiseNode;
|
|
21
21
|
|
|
22
22
|
export const denoise: (
|
|
23
|
-
node:
|
|
24
|
-
depthNode:
|
|
25
|
-
normalNode:
|
|
23
|
+
node: Node,
|
|
24
|
+
depthNode: Node,
|
|
25
|
+
normalNode: Node,
|
|
26
26
|
camera: Camera,
|
|
27
27
|
) => ShaderNodeObject<DenoiseNode>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
2
|
import { Node, TempNode, TextureNode, UniformNode } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
declare class DepthOfFieldNode extends TempNode {
|
|
@@ -15,9 +15,9 @@ declare class DepthOfFieldNode extends TempNode {
|
|
|
15
15
|
export default DepthOfFieldNode;
|
|
16
16
|
|
|
17
17
|
export const dof: (
|
|
18
|
-
node:
|
|
19
|
-
viewZNode:
|
|
20
|
-
focus?:
|
|
21
|
-
aperture?:
|
|
22
|
-
maxblur?:
|
|
18
|
+
node: Node,
|
|
19
|
+
viewZNode: Node,
|
|
20
|
+
focus?: Node,
|
|
21
|
+
aperture?: Node,
|
|
22
|
+
maxblur?: Node,
|
|
23
23
|
) => ShaderNodeObject<DepthOfFieldNode>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
2
|
import { Node, TempNode, UniformNode, Vector2 } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
declare class DotScreenNode extends TempNode {
|
|
@@ -13,7 +13,7 @@ declare class DotScreenNode extends TempNode {
|
|
|
13
13
|
export default DotScreenNode;
|
|
14
14
|
|
|
15
15
|
export const dotScreen: (
|
|
16
|
-
node:
|
|
16
|
+
node: Node,
|
|
17
17
|
center?: Vector2,
|
|
18
18
|
angle?: number,
|
|
19
19
|
scale?: number,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TempNode, TextureNode } from "three/webgpu";
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
|
+
import { Node, TempNode, TextureNode } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
declare class FXAANode extends TempNode {
|
|
5
5
|
textureNode: TextureNode;
|
|
@@ -9,4 +9,4 @@ declare class FXAANode extends TempNode {
|
|
|
9
9
|
|
|
10
10
|
export default FXAANode;
|
|
11
11
|
|
|
12
|
-
export const fxaa: (node:
|
|
12
|
+
export const fxaa: (node: Node) => ShaderNodeObject<FXAANode>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
2
|
import { Node, TempNode } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
declare class FilmNode extends TempNode {
|
|
@@ -12,7 +12,7 @@ declare class FilmNode extends TempNode {
|
|
|
12
12
|
export default FilmNode;
|
|
13
13
|
|
|
14
14
|
export const film: (
|
|
15
|
-
inputNode:
|
|
16
|
-
intensityNode?:
|
|
17
|
-
uvNode?:
|
|
15
|
+
inputNode: Node,
|
|
16
|
+
intensityNode?: Node | null,
|
|
17
|
+
uvNode?: Node | null,
|
|
18
18
|
) => ShaderNodeObject<FilmNode>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
2
|
import { Camera, Node, TempNode, TextureNode, UniformNode, Vector2 } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
declare class GTAONode extends TempNode {
|
|
@@ -25,7 +25,7 @@ declare class GTAONode extends TempNode {
|
|
|
25
25
|
export default GTAONode;
|
|
26
26
|
|
|
27
27
|
export const ao: (
|
|
28
|
-
depthNode:
|
|
29
|
-
normalNode:
|
|
28
|
+
depthNode: Node,
|
|
29
|
+
normalNode: Node,
|
|
30
30
|
camera: Camera,
|
|
31
31
|
) => ShaderNodeObject<GTAONode>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
2
|
import { Node, TempNode, TextureNode, Vector2 } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
declare class GaussianBlurNode extends TempNode {
|
|
@@ -24,12 +24,12 @@ declare class GaussianBlurNode extends TempNode {
|
|
|
24
24
|
export default GaussianBlurNode;
|
|
25
25
|
|
|
26
26
|
export const gaussianBlur: (
|
|
27
|
-
node:
|
|
28
|
-
directionNode?:
|
|
27
|
+
node: Node,
|
|
28
|
+
directionNode?: Node | number | null,
|
|
29
29
|
sigma?: number,
|
|
30
30
|
) => ShaderNodeObject<GaussianBlurNode>;
|
|
31
31
|
export const premultipliedGaussianBlur: (
|
|
32
|
-
node:
|
|
33
|
-
directionNode?:
|
|
32
|
+
node: Node,
|
|
33
|
+
directionNode?: Node | number | null,
|
|
34
34
|
sigma?: number,
|
|
35
35
|
) => ShaderNodeObject<GaussianBlurNode>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TempNode, TextureNode, UniformNode, Vector3 } from "three/webgpu";
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
|
+
import { Node, TempNode, TextureNode, UniformNode, Vector3 } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
interface LensflareNodeParams {
|
|
5
|
-
ghostTint?:
|
|
6
|
-
threshold?:
|
|
7
|
-
ghostSamples?:
|
|
8
|
-
ghostSpacing?:
|
|
9
|
-
ghostAttenuationFactor?:
|
|
5
|
+
ghostTint?: Node | undefined;
|
|
6
|
+
threshold?: Node | undefined;
|
|
7
|
+
ghostSamples?: Node | undefined;
|
|
8
|
+
ghostSpacing?: Node | undefined;
|
|
9
|
+
ghostAttenuationFactor?: Node | undefined;
|
|
10
10
|
downSampleRatio?: number | undefined;
|
|
11
11
|
}
|
|
12
12
|
|
|
@@ -30,6 +30,6 @@ declare class LensflareNode extends TempNode {
|
|
|
30
30
|
export default LensflareNode;
|
|
31
31
|
|
|
32
32
|
export const lensflare: (
|
|
33
|
-
inputNode:
|
|
33
|
+
inputNode: Node,
|
|
34
34
|
params?: LensflareNodeParams,
|
|
35
35
|
) => ShaderNodeObject<LensflareNode>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
2
|
import { Data3DTexture, Node, TempNode, Texture3DNode, UniformNode } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
declare class Lut3DNode extends TempNode {
|
|
@@ -13,8 +13,8 @@ declare class Lut3DNode extends TempNode {
|
|
|
13
13
|
export default Lut3DNode;
|
|
14
14
|
|
|
15
15
|
export const lut3D: (
|
|
16
|
-
node:
|
|
17
|
-
lut:
|
|
16
|
+
node: Node,
|
|
17
|
+
lut: Node,
|
|
18
18
|
size: number,
|
|
19
|
-
intensity:
|
|
19
|
+
intensity: Node,
|
|
20
20
|
) => ShaderNodeObject<Lut3DNode>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
2
|
import { Node } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
export const motionBlur: (
|
|
5
|
-
inputNode:
|
|
6
|
-
velocity:
|
|
7
|
-
numSamples?:
|
|
5
|
+
inputNode: Node,
|
|
6
|
+
velocity: Node,
|
|
7
|
+
numSamples?: Node,
|
|
8
8
|
) => ShaderNodeObject<Node>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ShaderNodeObject } from "three/tsl";
|
|
2
2
|
import { Camera, Node, Object3D, Scene, TempNode, TextureNode, UniformNode } from "three/webgpu";
|
|
3
3
|
|
|
4
4
|
export interface OutlineNodeParams {
|
|
5
5
|
selectedObjects?: Object3D[] | undefined;
|
|
6
|
-
edgeThickness?:
|
|
7
|
-
edgeGlow?:
|
|
6
|
+
edgeThickness?: Node | undefined;
|
|
7
|
+
edgeGlow?: Node | undefined;
|
|
8
8
|
downSampleRatio?: number | undefined;
|
|
9
9
|
}
|
|
10
10
|
|