@types/three 0.159.0 → 0.161.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/Addons.d.ts +5 -1
- three/examples/jsm/capabilities/WebGPU.d.ts +2 -0
- three/examples/jsm/curves/NURBSUtils.d.ts +136 -10
- three/examples/jsm/curves/NURBSVolume.d.ts +23 -0
- three/examples/jsm/exporters/USDZExporter.d.ts +1 -0
- three/examples/jsm/loaders/GLTFLoader.d.ts +1 -0
- three/examples/jsm/loaders/KTX2Loader.d.ts +45 -11
- three/examples/jsm/loaders/LUT3dlLoader.d.ts +29 -2
- three/examples/jsm/loaders/LUTCubeLoader.d.ts +37 -2
- three/examples/jsm/loaders/MaterialXLoader.d.ts +6 -0
- three/examples/jsm/materials/MeshPostProcessingMaterial.d.ts +13 -0
- three/examples/jsm/misc/Timer.d.ts +80 -0
- three/examples/jsm/nodes/Nodes.d.ts +304 -61
- three/examples/jsm/nodes/accessors/BitangentNode.d.ts +9 -0
- three/examples/jsm/nodes/accessors/BufferNode.d.ts +4 -1
- three/examples/jsm/nodes/accessors/CameraNode.d.ts +24 -6
- three/examples/jsm/nodes/accessors/CubeTextureNode.d.ts +17 -4
- three/examples/jsm/nodes/accessors/InstanceNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/MaterialNode.d.ts +12 -0
- three/examples/jsm/nodes/accessors/MaterialReferenceNode.d.ts +7 -0
- three/examples/jsm/nodes/accessors/ModelNode.d.ts +9 -1
- three/examples/jsm/nodes/accessors/ModelViewProjectionNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/NormalNode.d.ts +8 -0
- three/examples/jsm/nodes/accessors/Object3DNode.d.ts +10 -6
- three/examples/jsm/nodes/accessors/PointUVNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/PositionNode.d.ts +8 -0
- three/examples/jsm/nodes/accessors/ReferenceNode.d.ts +4 -1
- three/examples/jsm/nodes/accessors/ReflectVectorNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/SkinningNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/StorageBufferNode.d.ts +8 -1
- three/examples/jsm/nodes/accessors/TangentNode.d.ts +9 -0
- three/examples/jsm/nodes/accessors/TextureBicubicNode.d.ts +18 -0
- three/examples/jsm/nodes/accessors/TextureNode.d.ts +21 -5
- three/examples/jsm/nodes/accessors/UVNode.d.ts +3 -0
- three/examples/jsm/nodes/accessors/UserDataNode.d.ts +7 -0
- three/examples/jsm/nodes/accessors/VertexColorNode.d.ts +12 -0
- three/examples/jsm/nodes/code/CodeNode.d.ts +4 -0
- three/examples/jsm/nodes/code/ExpressionNode.d.ts +3 -0
- three/examples/jsm/nodes/code/FunctionCallNode.d.ts +13 -1
- three/examples/jsm/nodes/code/FunctionNode.d.ts +17 -0
- three/examples/jsm/nodes/core/ArrayUniformNode.d.ts +1 -1
- three/examples/jsm/nodes/core/AssignNode.d.ts +17 -0
- three/examples/jsm/nodes/core/AttributeNode.d.ts +3 -0
- three/examples/jsm/nodes/core/BypassNode.d.ts +9 -0
- three/examples/jsm/nodes/core/CacheNode.d.ts +11 -0
- three/examples/jsm/nodes/core/ConstNode.d.ts +3 -3
- three/examples/jsm/nodes/core/ContextNode.d.ts +11 -0
- three/examples/jsm/nodes/core/IndexNode.d.ts +18 -0
- three/examples/jsm/nodes/core/InputNode.d.ts +4 -4
- three/examples/jsm/nodes/core/LightingModel.d.ts +36 -0
- three/examples/jsm/nodes/core/Node.d.ts +32 -8
- three/examples/jsm/nodes/core/NodeBuilder.d.ts +27 -23
- three/examples/jsm/nodes/core/NodeFrame.d.ts +18 -6
- three/examples/jsm/nodes/core/NodeUniform.d.ts +12 -8
- three/examples/jsm/nodes/core/NodeUtils.d.ts +6 -3
- three/examples/jsm/nodes/core/PropertyNode.d.ts +27 -1
- three/examples/jsm/nodes/core/UniformNode.d.ts +12 -4
- three/examples/jsm/nodes/core/VarNode.d.ts +10 -0
- three/examples/jsm/nodes/core/VaryingNode.d.ts +9 -0
- three/examples/jsm/nodes/core/constants.d.ts +31 -28
- three/examples/jsm/nodes/display/AfterImageNode.d.ts +25 -0
- three/examples/jsm/nodes/display/AnamorphicNode.d.ts +32 -0
- three/examples/jsm/nodes/display/BlendModeNode.d.ts +21 -6
- three/examples/jsm/nodes/display/ColorAdjustmentNode.d.ts +29 -1
- three/examples/jsm/nodes/display/ColorSpaceNode.d.ts +17 -0
- three/examples/jsm/nodes/display/FrontFacingNode.d.ts +4 -0
- three/examples/jsm/nodes/display/GaussianBlurNode.d.ts +28 -0
- three/examples/jsm/nodes/display/NormalMapNode.d.ts +13 -1
- three/examples/jsm/nodes/display/PassNode.d.ts +44 -0
- three/examples/jsm/nodes/display/PosterizeNode.d.ts +12 -0
- three/examples/jsm/nodes/display/ToneMappingNode.d.ts +8 -1
- three/examples/jsm/nodes/display/ViewportDepthNode.d.ts +32 -0
- three/examples/jsm/nodes/display/ViewportNode.d.ts +8 -0
- three/examples/jsm/nodes/display/ViewportSharedTextureNode.d.ts +18 -0
- three/examples/jsm/nodes/display/ViewportTextureNode.d.ts +33 -0
- three/examples/jsm/nodes/fog/FogExp2Node.d.ts +9 -0
- three/examples/jsm/nodes/fog/FogNode.d.ts +9 -0
- three/examples/jsm/nodes/fog/FogRangeNode.d.ts +9 -0
- three/examples/jsm/nodes/functions/BSDF/BRDF_GGX.d.ts +9 -2
- three/examples/jsm/nodes/functions/BSDF/BRDF_Lambert.d.ts +3 -2
- three/examples/jsm/nodes/functions/BSDF/BRDF_Sheen.d.ts +7 -0
- three/examples/jsm/nodes/functions/BSDF/DFGApprox.d.ts +3 -2
- three/examples/jsm/nodes/functions/BSDF/D_GGX.d.ts +3 -2
- three/examples/jsm/nodes/functions/BSDF/F_Schlick.d.ts +3 -2
- three/examples/jsm/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +1 -1
- three/examples/jsm/nodes/functions/PhongLightingModel.d.ts +7 -0
- three/examples/jsm/nodes/functions/PhysicalLightingModel.d.ts +17 -8
- three/examples/jsm/nodes/functions/material/getGeometryRoughness.d.ts +1 -1
- three/examples/jsm/nodes/functions/material/getRoughness.d.ts +1 -1
- three/examples/jsm/nodes/geometry/RangeNode.d.ts +3 -0
- three/examples/jsm/nodes/gpgpu/ComputeNode.d.ts +13 -0
- three/examples/jsm/nodes/lighting/LightingContextNode.d.ts +20 -8
- three/examples/jsm/nodes/lighting/LightsNode.d.ts +3 -0
- three/examples/jsm/nodes/materials/LineBasicNodeMaterial.d.ts +1 -2
- three/examples/jsm/nodes/materials/Materials.d.ts +9 -17
- three/examples/jsm/nodes/materials/MeshBasicNodeMaterial.d.ts +2 -4
- three/examples/jsm/nodes/materials/MeshPhongNodeMaterial.d.ts +12 -0
- three/examples/jsm/nodes/materials/MeshPhysicalNodeMaterial.d.ts +16 -7
- three/examples/jsm/nodes/materials/MeshSSSNodeMaterial.d.ts +17 -0
- three/examples/jsm/nodes/materials/MeshStandardNodeMaterial.d.ts +1 -5
- three/examples/jsm/nodes/materials/NodeMaterial.d.ts +55 -16
- three/examples/jsm/nodes/materials/PointsNodeMaterial.d.ts +2 -8
- three/examples/jsm/nodes/materials/SpriteNodeMaterial.d.ts +0 -10
- three/examples/jsm/nodes/materialx/MaterialXNodes.d.ts +43 -34
- three/examples/jsm/nodes/materialx/lib/mx_hsv.d.ts +5 -3
- three/examples/jsm/nodes/materialx/lib/mx_noise.d.ts +7 -5
- three/examples/jsm/nodes/math/CondNode.d.ts +13 -0
- three/examples/jsm/nodes/math/HashNode.d.ts +16 -0
- three/examples/jsm/nodes/math/MathNode.d.ts +140 -1
- three/examples/jsm/nodes/math/MathUtils.d.ts +16 -0
- three/examples/jsm/nodes/math/OperatorNode.d.ts +53 -1
- three/examples/jsm/nodes/math/TriNoise3D.d.ts +12 -0
- three/examples/jsm/nodes/procedural/CheckerNode.d.ts +9 -0
- three/examples/jsm/nodes/shadernode/ShaderNode.d.ts +124 -31
- three/examples/jsm/nodes/utils/DiscardNode.d.ts +16 -0
- three/examples/jsm/nodes/utils/EquirectUVNode.d.ts +4 -2
- three/examples/jsm/nodes/utils/MatcapUVNode.d.ts +3 -0
- three/examples/jsm/nodes/utils/MaxMipLevelNode.d.ts +6 -3
- three/examples/jsm/nodes/utils/OscNode.d.ts +6 -0
- three/examples/jsm/nodes/utils/ReflectorNode.d.ts +30 -0
- three/examples/jsm/nodes/utils/RemapNode.d.ts +24 -1
- three/examples/jsm/nodes/utils/RotateNode.d.ts +21 -0
- three/examples/jsm/nodes/utils/RotateUVNode.d.ts +9 -0
- three/examples/jsm/nodes/utils/SpecularMIPLevelNode.d.ts +5 -1
- three/examples/jsm/nodes/utils/SpriteSheetUVNode.d.ts +7 -0
- three/examples/jsm/nodes/utils/TimerNode.d.ts +7 -1
- three/examples/jsm/nodes/utils/TriplanarTexturesNode.d.ts +28 -7
- three/examples/jsm/objects/GroundedSkybox.d.ts +5 -0
- three/examples/jsm/objects/QuadMesh.d.ts +15 -0
- three/examples/jsm/postprocessing/{HBAOPass.d.ts → GTAOPass.d.ts} +25 -10
- three/examples/jsm/postprocessing/SSAOPass.d.ts +1 -1
- three/examples/jsm/renderers/common/Backend.d.ts +6 -2
- three/examples/jsm/renderers/common/Color4.d.ts +9 -0
- three/examples/jsm/renderers/common/Info.d.ts +7 -1
- three/examples/jsm/renderers/common/PostProcessing.d.ts +11 -0
- three/examples/jsm/renderers/common/Renderer.d.ts +243 -4
- three/examples/jsm/renderers/common/StorageTexture.d.ts +5 -0
- three/examples/jsm/renderers/webgl/WebGLBackend.d.ts +4 -2
- three/examples/jsm/renderers/webgl/nodes/WebGLNodeBuilder.d.ts +2 -2
- three/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.d.ts +3 -0
- three/examples/jsm/renderers/webgpu/WebGPUBackend.d.ts +15 -6
- three/examples/jsm/renderers/webgpu/WebGPURenderer.d.ts +7 -7
- three/examples/jsm/shaders/{HBAOShader.d.ts → GTAOShader.d.ts} +23 -8
- three/examples/jsm/shaders/PoissonDenoiseShader.d.ts +1 -1
- three/examples/jsm/utils/BufferGeometryUtils.d.ts +0 -10
- three/examples/jsm/webxr/XRControllerModelFactory.d.ts +6 -5
- three/examples/jsm/webxr/XRHandMeshModel.d.ts +10 -2
- three/package.json +2 -2
- three/src/Three.d.ts +1 -0
- three/src/cameras/PerspectiveCamera.d.ts +13 -0
- three/src/constants.d.ts +4 -3
- three/src/core/InterleavedBufferAttribute.d.ts +12 -2
- three/src/core/Object3D.d.ts +13 -13
- three/src/core/UniformsGroup.d.ts +3 -3
- three/src/extras/core/Curve.d.ts +9 -9
- three/src/extras/core/CurvePath.d.ts +8 -7
- three/src/geometries/RingGeometry.d.ts +1 -1
- three/src/lights/PointLight.d.ts +7 -0
- three/src/loaders/MaterialLoader.d.ts +6 -3
- three/src/materials/LineBasicMaterial.d.ts +7 -0
- three/src/materials/LineDashedMaterial.d.ts +7 -1
- three/src/materials/Material.d.ts +17 -15
- three/src/materials/MeshBasicMaterial.d.ts +7 -0
- three/src/materials/MeshDepthMaterial.d.ts +6 -0
- three/src/materials/MeshDistanceMaterial.d.ts +7 -0
- three/src/materials/MeshLambertMaterial.d.ts +7 -0
- three/src/materials/MeshMatcapMaterial.d.ts +7 -0
- three/src/materials/MeshNormalMaterial.d.ts +7 -0
- three/src/materials/MeshPhongMaterial.d.ts +7 -0
- three/src/materials/MeshPhysicalMaterial.d.ts +6 -1
- three/src/materials/MeshStandardMaterial.d.ts +7 -2
- three/src/materials/MeshToonMaterial.d.ts +7 -0
- three/src/materials/PointsMaterial.d.ts +7 -0
- three/src/materials/RawShaderMaterial.d.ts +9 -0
- three/src/materials/ShaderMaterial.d.ts +17 -3
- three/src/materials/ShadowMaterial.d.ts +7 -0
- three/src/materials/SpriteMaterial.d.ts +7 -2
- three/src/math/Color.d.ts +1 -1
- three/src/math/Matrix4.d.ts +30 -30
- three/src/math/Quaternion.d.ts +27 -30
- three/src/math/Sphere.d.ts +5 -0
- three/src/math/Triangle.d.ts +8 -25
- three/src/math/Vector2.d.ts +24 -159
- three/src/math/Vector3.d.ts +46 -54
- three/src/math/Vector4.d.ts +25 -20
- three/src/objects/BatchedMesh.d.ts +2 -2
- three/src/objects/Bone.d.ts +2 -2
- three/src/objects/InstancedMesh.d.ts +2 -1
- three/src/objects/LOD.d.ts +2 -2
- three/src/objects/Line.d.ts +3 -2
- three/src/objects/LineLoop.d.ts +3 -1
- three/src/objects/LineSegments.d.ts +3 -1
- three/src/objects/Points.d.ts +3 -2
- three/src/objects/SkinnedMesh.d.ts +4 -8
- three/src/objects/Sprite.d.ts +2 -2
- three/src/renderers/shaders/ShaderLib.d.ts +18 -18
- three/src/renderers/shaders/UniformsUtils.d.ts +3 -2
- three/src/renderers/webgl/WebGLLights.d.ts +39 -37
- three/src/renderers/webgl/WebGLProgram.d.ts +0 -1
- three/src/renderers/webgl/WebGLPrograms.d.ts +226 -9
- three/src/renderers/webxr/WebXRDepthSensing.d.ts +27 -0
- three/src/renderers/webxr/WebXRManager.d.ts +2 -1
- three/src/textures/CompressedCubeTexture.d.ts +13 -0
- three/src/textures/DataArrayTexture.d.ts +1 -1
- three/src/textures/Source.d.ts +11 -1
- three/build/three.d.ts +0 -2
- three/build/three.min.d.ts +0 -2
- three/examples/jsm/nodes/shadernode/ShaderNodeBaseElements.d.ts +0 -310
- three/examples/jsm/nodes/shadernode/ShaderNodeElements.d.ts +0 -166
- three/examples/jsm/objects/GroundProjectedSkybox.d.ts +0 -13
|
@@ -1,94 +1,103 @@
|
|
|
1
1
|
import { mx_hsvtorgb, mx_rgbtohsv } from './lib/mx_hsv.js';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { NodeRepresentation } from '../shadernode/ShaderNode.js';
|
|
2
|
+
import Node from '../core/Node.js';
|
|
3
|
+
import MathNode from '../math/MathNode.js';
|
|
4
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
5
5
|
|
|
6
|
-
export function mx_aastep(threshold?: NodeRepresentation, value?: NodeRepresentation):
|
|
6
|
+
export function mx_aastep(threshold?: NodeRepresentation, value?: NodeRepresentation): ShaderNodeObject<MathNode>;
|
|
7
7
|
|
|
8
8
|
export function mx_ramplr(
|
|
9
9
|
valuel?: NodeRepresentation,
|
|
10
10
|
valuer?: NodeRepresentation,
|
|
11
|
-
texcoord?:
|
|
12
|
-
):
|
|
11
|
+
texcoord?: ShaderNodeObject<Node>,
|
|
12
|
+
): ShaderNodeObject<MathNode>;
|
|
13
13
|
export function mx_ramptb(
|
|
14
14
|
valuet?: NodeRepresentation,
|
|
15
15
|
valueb?: NodeRepresentation,
|
|
16
|
-
texcoord?:
|
|
17
|
-
):
|
|
16
|
+
texcoord?: ShaderNodeObject<Node>,
|
|
17
|
+
): ShaderNodeObject<MathNode>;
|
|
18
18
|
|
|
19
19
|
export function mx_splitlr(
|
|
20
20
|
valuel?: NodeRepresentation,
|
|
21
21
|
valuer?: NodeRepresentation,
|
|
22
22
|
center?: NodeRepresentation,
|
|
23
|
-
texcoord?:
|
|
24
|
-
):
|
|
23
|
+
texcoord?: ShaderNodeObject<Node>,
|
|
24
|
+
): ShaderNodeObject<MathNode>;
|
|
25
25
|
export function mx_splittb(
|
|
26
26
|
valuet?: NodeRepresentation,
|
|
27
27
|
valueb?: NodeRepresentation,
|
|
28
28
|
center?: NodeRepresentation,
|
|
29
|
-
texcoord?:
|
|
30
|
-
):
|
|
29
|
+
texcoord?: ShaderNodeObject<Node>,
|
|
30
|
+
): ShaderNodeObject<MathNode>;
|
|
31
31
|
|
|
32
32
|
export function mx_transform_uv(
|
|
33
33
|
uv_scale?: NodeRepresentation,
|
|
34
34
|
uv_offset?: NodeRepresentation,
|
|
35
|
-
uv_geo?:
|
|
36
|
-
):
|
|
35
|
+
uv_geo?: ShaderNodeObject<Node>,
|
|
36
|
+
): ShaderNodeObject<Node>;
|
|
37
37
|
|
|
38
38
|
export function mx_noise_float(
|
|
39
|
-
texcoord?:
|
|
39
|
+
texcoord?: ShaderNodeObject<Node>,
|
|
40
40
|
amplitude?: NodeRepresentation,
|
|
41
41
|
pivot?: NodeRepresentation,
|
|
42
|
-
):
|
|
42
|
+
): ShaderNodeObject<Node>;
|
|
43
43
|
export function mx_noise_vec2(
|
|
44
|
-
texcoord?:
|
|
44
|
+
texcoord?: ShaderNodeObject<Node>,
|
|
45
45
|
amplitude?: NodeRepresentation,
|
|
46
46
|
pivot?: NodeRepresentation,
|
|
47
|
-
):
|
|
47
|
+
): ShaderNodeObject<Node>;
|
|
48
48
|
export function mx_noise_vec3(
|
|
49
|
-
texcoord?:
|
|
49
|
+
texcoord?: ShaderNodeObject<Node>,
|
|
50
50
|
amplitude?: NodeRepresentation,
|
|
51
51
|
pivot?: NodeRepresentation,
|
|
52
|
-
):
|
|
52
|
+
): ShaderNodeObject<Node>;
|
|
53
53
|
export function mx_noise_vec4(
|
|
54
|
-
texcoord?:
|
|
54
|
+
texcoord?: ShaderNodeObject<Node>,
|
|
55
55
|
amplitude?: NodeRepresentation,
|
|
56
56
|
pivot?: NodeRepresentation,
|
|
57
|
-
):
|
|
57
|
+
): ShaderNodeObject<Node>;
|
|
58
58
|
|
|
59
|
-
export function mx_worley_noise_float(
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
export function mx_worley_noise_float(
|
|
60
|
+
texcoord?: ShaderNodeObject<Node>,
|
|
61
|
+
jitter?: NodeRepresentation,
|
|
62
|
+
): ShaderNodeObject<Node>;
|
|
63
|
+
export function mx_worley_noise_vec2(
|
|
64
|
+
texcoord?: ShaderNodeObject<Node>,
|
|
65
|
+
jitter?: NodeRepresentation,
|
|
66
|
+
): ShaderNodeObject<Node>;
|
|
67
|
+
export function mx_worley_noise_vec3(
|
|
68
|
+
texcoord?: ShaderNodeObject<Node>,
|
|
69
|
+
jitter?: NodeRepresentation,
|
|
70
|
+
): ShaderNodeObject<Node>;
|
|
62
71
|
|
|
63
|
-
export function mx_cell_noise_float(texcoord?:
|
|
72
|
+
export function mx_cell_noise_float(texcoord?: ShaderNodeObject<Node>): ShaderNodeObject<Node>;
|
|
64
73
|
|
|
65
74
|
export function mx_fractal_noise_float(
|
|
66
|
-
position?:
|
|
75
|
+
position?: ShaderNodeObject<Node>,
|
|
67
76
|
octaves?: NodeRepresentation,
|
|
68
77
|
lacunarity?: NodeRepresentation,
|
|
69
78
|
diminish?: NodeRepresentation,
|
|
70
79
|
amplitude?: NodeRepresentation,
|
|
71
|
-
):
|
|
80
|
+
): ShaderNodeObject<Node>;
|
|
72
81
|
export function mx_fractal_noise_vec2(
|
|
73
|
-
position?:
|
|
82
|
+
position?: ShaderNodeObject<Node>,
|
|
74
83
|
octaves?: NodeRepresentation,
|
|
75
84
|
lacunarity?: NodeRepresentation,
|
|
76
85
|
diminish?: NodeRepresentation,
|
|
77
86
|
amplitude?: NodeRepresentation,
|
|
78
|
-
):
|
|
87
|
+
): ShaderNodeObject<Node>;
|
|
79
88
|
export function mx_fractal_noise_vec3(
|
|
80
|
-
position?:
|
|
89
|
+
position?: ShaderNodeObject<Node>,
|
|
81
90
|
octaves?: NodeRepresentation,
|
|
82
91
|
lacunarity?: NodeRepresentation,
|
|
83
92
|
diminish?: NodeRepresentation,
|
|
84
93
|
amplitude?: NodeRepresentation,
|
|
85
|
-
):
|
|
94
|
+
): ShaderNodeObject<Node>;
|
|
86
95
|
export function mx_fractal_noise_vec4(
|
|
87
|
-
position?:
|
|
96
|
+
position?: ShaderNodeObject<Node>,
|
|
88
97
|
octaves?: NodeRepresentation,
|
|
89
98
|
lacunarity?: NodeRepresentation,
|
|
90
99
|
diminish?: NodeRepresentation,
|
|
91
100
|
amplitude?: NodeRepresentation,
|
|
92
|
-
):
|
|
101
|
+
): ShaderNodeObject<Node>;
|
|
93
102
|
|
|
94
103
|
export { mx_hsvtorgb, mx_rgbtohsv };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Node from '../../core/Node.js';
|
|
2
|
+
import { Fn } from '../../code/FunctionNode.js';
|
|
3
|
+
import { ShaderNodeObject } from '../../shadernode/ShaderNode.js';
|
|
2
4
|
|
|
3
|
-
export function mx_hsvtorgb(...params: Fn<[Node]>):
|
|
4
|
-
export function mx_rgbtohsv(...params: Fn<[Node]>):
|
|
5
|
+
export function mx_hsvtorgb(...params: Fn<[Node]>): ShaderNodeObject<Node>;
|
|
6
|
+
export function mx_rgbtohsv(...params: Fn<[Node]>): ShaderNodeObject<Node>;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Node from '../../core/Node.js';
|
|
2
|
+
import { Fn } from '../../code/FunctionNode.js';
|
|
3
|
+
import { ShaderNodeObject } from '../../shadernode/ShaderNode.js';
|
|
2
4
|
|
|
3
|
-
export function mx_perlin_noise_float(...params: Fn<[Node]>):
|
|
4
|
-
export function mx_cell_noise_float(...params: Fn<[Node]>):
|
|
5
|
-
export function mx_worley_noise_float(...params: Fn<[Node]>):
|
|
6
|
-
export function mx_fractal_noise_float(...params: Fn<[Node, Node, Node, Node]>):
|
|
5
|
+
export function mx_perlin_noise_float(...params: Fn<[Node]>): ShaderNodeObject<Node>;
|
|
6
|
+
export function mx_cell_noise_float(...params: Fn<[Node]>): ShaderNodeObject<Node>;
|
|
7
|
+
export function mx_worley_noise_float(...params: Fn<[Node]>): ShaderNodeObject<Node>;
|
|
8
|
+
export function mx_fractal_noise_float(...params: Fn<[Node, Node, Node, Node]>): ShaderNodeObject<Node>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Node from '../core/Node.js';
|
|
2
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
2
3
|
|
|
3
4
|
export default class CondNode extends Node {
|
|
4
5
|
condNode: Node;
|
|
@@ -7,3 +8,15 @@ export default class CondNode extends Node {
|
|
|
7
8
|
|
|
8
9
|
constructor(condNode: Node, ifNode: Node, elseNode: Node);
|
|
9
10
|
}
|
|
11
|
+
|
|
12
|
+
export function cond(
|
|
13
|
+
condNode: NodeRepresentation,
|
|
14
|
+
ifNode: NodeRepresentation,
|
|
15
|
+
elseNode: NodeRepresentation,
|
|
16
|
+
): ShaderNodeObject<Node>;
|
|
17
|
+
|
|
18
|
+
declare module '../shadernode/ShaderNode.js' {
|
|
19
|
+
interface NodeElements {
|
|
20
|
+
cond: typeof cond;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Node from '../core/Node.js';
|
|
2
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
|
+
|
|
4
|
+
export default class HashNode extends Node {
|
|
5
|
+
seedNode: Node;
|
|
6
|
+
|
|
7
|
+
constructor(seedNode: Node);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const hash: (seedNode: NodeRepresentation) => ShaderNodeObject<HashNode>;
|
|
11
|
+
|
|
12
|
+
declare module '../shadernode/ShaderNode.js' {
|
|
13
|
+
interface NodeElements {
|
|
14
|
+
hash: typeof hash;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import Node from '../core/Node.js';
|
|
2
2
|
import TempNode from '../core/TempNode.js';
|
|
3
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export type MathNodeMethod1 =
|
|
5
6
|
| typeof MathNode.RADIANS
|
|
@@ -27,7 +28,11 @@ export type MathNodeMethod1 =
|
|
|
27
28
|
| typeof MathNode.ONE_MINUS
|
|
28
29
|
| typeof MathNode.DFDX
|
|
29
30
|
| typeof MathNode.DFDY
|
|
30
|
-
| typeof MathNode.ROUND
|
|
31
|
+
| typeof MathNode.ROUND
|
|
32
|
+
| typeof MathNode.RECIPROCAL
|
|
33
|
+
| typeof MathNode.TRUNC
|
|
34
|
+
| typeof MathNode.FWIDTH
|
|
35
|
+
| typeof MathNode.BITCAST;
|
|
31
36
|
|
|
32
37
|
export type MathNodeMethod2 =
|
|
33
38
|
| typeof MathNode.ATAN2
|
|
@@ -81,6 +86,9 @@ export default class MathNode extends TempNode {
|
|
|
81
86
|
static DFDY: 'dFdy';
|
|
82
87
|
static ROUND: 'round';
|
|
83
88
|
static RECIPROCAL: 'reciprocal';
|
|
89
|
+
static TRUNC: 'trunc';
|
|
90
|
+
static FWIDTH: 'fwidth';
|
|
91
|
+
static BITCAST: 'bitcast';
|
|
84
92
|
|
|
85
93
|
// 2 inputs
|
|
86
94
|
|
|
@@ -113,3 +121,134 @@ export default class MathNode extends TempNode {
|
|
|
113
121
|
constructor(method: MathNodeMethod2, aNode: Node, bNode: Node);
|
|
114
122
|
constructor(method: MathNodeMethod3, aNode: Node, bNode: Node, cNode: Node);
|
|
115
123
|
}
|
|
124
|
+
|
|
125
|
+
export const EPSILON: ShaderNodeObject<Node>;
|
|
126
|
+
export const INFINITY: ShaderNodeObject<Node>;
|
|
127
|
+
export const PI: ShaderNodeObject<Node>;
|
|
128
|
+
export const PI2: ShaderNodeObject<Node>;
|
|
129
|
+
|
|
130
|
+
type Unary = (a: NodeRepresentation) => ShaderNodeObject<MathNode>;
|
|
131
|
+
|
|
132
|
+
export const radians: Unary;
|
|
133
|
+
export const degrees: Unary;
|
|
134
|
+
export const exp: Unary;
|
|
135
|
+
export const exp2: Unary;
|
|
136
|
+
export const log: Unary;
|
|
137
|
+
export const log2: Unary;
|
|
138
|
+
export const sqrt: Unary;
|
|
139
|
+
export const inverseSqrt: Unary;
|
|
140
|
+
export const floor: Unary;
|
|
141
|
+
export const ceil: Unary;
|
|
142
|
+
export const normalize: Unary;
|
|
143
|
+
export const fract: Unary;
|
|
144
|
+
export const sin: Unary;
|
|
145
|
+
export const cos: Unary;
|
|
146
|
+
export const tan: Unary;
|
|
147
|
+
export const asin: Unary;
|
|
148
|
+
export const acos: Unary;
|
|
149
|
+
export const atan: Unary;
|
|
150
|
+
export const abs: Unary;
|
|
151
|
+
export const sign: Unary;
|
|
152
|
+
export const length: Unary;
|
|
153
|
+
export const negate: Unary;
|
|
154
|
+
export const oneMinus: Unary;
|
|
155
|
+
export const dFdx: Unary;
|
|
156
|
+
export const dFdy: Unary;
|
|
157
|
+
export const round: Unary;
|
|
158
|
+
export const reciprocal: Unary;
|
|
159
|
+
export const trunc: Unary;
|
|
160
|
+
export const fwidth: Unary;
|
|
161
|
+
export const bitcast: Unary;
|
|
162
|
+
|
|
163
|
+
type Binary = (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject<MathNode>;
|
|
164
|
+
|
|
165
|
+
export const atan2: Binary;
|
|
166
|
+
export const min: Binary;
|
|
167
|
+
export const max: Binary;
|
|
168
|
+
export const mod: Binary;
|
|
169
|
+
export const step: Binary;
|
|
170
|
+
export const reflect: Binary;
|
|
171
|
+
export const distance: Binary;
|
|
172
|
+
export const difference: Binary;
|
|
173
|
+
export const dot: Binary;
|
|
174
|
+
export const cross: Binary;
|
|
175
|
+
export const pow: Binary;
|
|
176
|
+
export const pow2: Binary;
|
|
177
|
+
export const pow3: Binary;
|
|
178
|
+
export const pow4: Binary;
|
|
179
|
+
export const transformDirection: Binary;
|
|
180
|
+
|
|
181
|
+
type Ternary = (a: NodeRepresentation, b: NodeRepresentation, c: NodeRepresentation) => ShaderNodeObject<MathNode>;
|
|
182
|
+
|
|
183
|
+
export const cbrt: Unary;
|
|
184
|
+
export const lengthSq: Unary;
|
|
185
|
+
export const mix: Ternary;
|
|
186
|
+
export const clamp: (
|
|
187
|
+
a: NodeRepresentation,
|
|
188
|
+
b?: NodeRepresentation,
|
|
189
|
+
c?: NodeRepresentation,
|
|
190
|
+
) => ShaderNodeObject<MathNode>;
|
|
191
|
+
export const saturate: Unary;
|
|
192
|
+
export const refract: Ternary;
|
|
193
|
+
export const smoothstep: Ternary;
|
|
194
|
+
export const faceForward: Ternary;
|
|
195
|
+
|
|
196
|
+
export const mixElement: Ternary;
|
|
197
|
+
export const smoothstepElement: Ternary;
|
|
198
|
+
|
|
199
|
+
declare module '../shadernode/ShaderNode.js' {
|
|
200
|
+
interface NodeElements {
|
|
201
|
+
radians: typeof radians;
|
|
202
|
+
degrees: typeof degrees;
|
|
203
|
+
exp: typeof exp;
|
|
204
|
+
exp2: typeof exp2;
|
|
205
|
+
log: typeof log;
|
|
206
|
+
log2: typeof log2;
|
|
207
|
+
sqrt: typeof sqrt;
|
|
208
|
+
inverseSqrt: typeof inverseSqrt;
|
|
209
|
+
floor: typeof floor;
|
|
210
|
+
ceil: typeof ceil;
|
|
211
|
+
normalize: typeof normalize;
|
|
212
|
+
fract: typeof fract;
|
|
213
|
+
sin: typeof sin;
|
|
214
|
+
cos: typeof cos;
|
|
215
|
+
tan: typeof tan;
|
|
216
|
+
asin: typeof asin;
|
|
217
|
+
acos: typeof acos;
|
|
218
|
+
atan: typeof atan;
|
|
219
|
+
abs: typeof abs;
|
|
220
|
+
sign: typeof sign;
|
|
221
|
+
length: typeof length;
|
|
222
|
+
lengthSq: typeof lengthSq;
|
|
223
|
+
negate: typeof negate;
|
|
224
|
+
oneMinus: typeof oneMinus;
|
|
225
|
+
dFdx: typeof dFdx;
|
|
226
|
+
dFdy: typeof dFdy;
|
|
227
|
+
round: typeof round;
|
|
228
|
+
reciprocal: typeof reciprocal;
|
|
229
|
+
trunc: typeof trunc;
|
|
230
|
+
fwidth: typeof fwidth;
|
|
231
|
+
atan2: typeof atan2;
|
|
232
|
+
min: typeof min;
|
|
233
|
+
max: typeof max;
|
|
234
|
+
mod: typeof mod;
|
|
235
|
+
step: typeof step;
|
|
236
|
+
reflect: typeof reflect;
|
|
237
|
+
distance: typeof distance;
|
|
238
|
+
dot: typeof dot;
|
|
239
|
+
cross: typeof cross;
|
|
240
|
+
pow: typeof pow;
|
|
241
|
+
pow2: typeof pow2;
|
|
242
|
+
pow3: typeof pow3;
|
|
243
|
+
pow4: typeof pow4;
|
|
244
|
+
transformDirection: typeof transformDirection;
|
|
245
|
+
mix: typeof mixElement;
|
|
246
|
+
clamp: typeof clamp;
|
|
247
|
+
refract: typeof refract;
|
|
248
|
+
smoothstep: typeof smoothstepElement;
|
|
249
|
+
faceForward: typeof faceForward;
|
|
250
|
+
difference: typeof difference;
|
|
251
|
+
saturate: typeof saturate;
|
|
252
|
+
cbrt: typeof cbrt;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Binary, Ternary } from './MathNode.js';
|
|
2
|
+
|
|
3
|
+
// remapping functions
|
|
4
|
+
export const parabola: Binary;
|
|
5
|
+
export const gain: Binary;
|
|
6
|
+
export const pcurve: Ternary;
|
|
7
|
+
export const sinc: Binary;
|
|
8
|
+
|
|
9
|
+
declare module '../shadernode/ShaderNode.js' {
|
|
10
|
+
interface NodeElements {
|
|
11
|
+
parabola: typeof parabola;
|
|
12
|
+
gain: typeof gain;
|
|
13
|
+
pcurve: typeof pcurve;
|
|
14
|
+
sinc: typeof sinc;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import TempNode from '../core/TempNode.js';
|
|
2
2
|
import Node from '../core/Node.js';
|
|
3
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
3
4
|
|
|
4
5
|
export type OperatorNodeOp =
|
|
5
|
-
| '='
|
|
6
6
|
| '%'
|
|
7
7
|
| '&'
|
|
8
8
|
| '|'
|
|
@@ -29,3 +29,55 @@ export default class OperatorNode extends TempNode {
|
|
|
29
29
|
|
|
30
30
|
constructor(op: OperatorNodeOp, ...params: [Node, Node, ...Node[]]);
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
type Operator = (
|
|
34
|
+
a: NodeRepresentation,
|
|
35
|
+
b: NodeRepresentation,
|
|
36
|
+
...others: NodeRepresentation[]
|
|
37
|
+
) => ShaderNodeObject<OperatorNode>;
|
|
38
|
+
|
|
39
|
+
export const add: Operator;
|
|
40
|
+
export const sub: Operator;
|
|
41
|
+
export const mul: Operator;
|
|
42
|
+
export const div: Operator;
|
|
43
|
+
export const remainder: Operator;
|
|
44
|
+
export const equal: Operator;
|
|
45
|
+
export const lessThan: Operator;
|
|
46
|
+
export const greaterThan: Operator;
|
|
47
|
+
export const lessThanEqual: Operator;
|
|
48
|
+
export const greaterThanEqual: Operator;
|
|
49
|
+
export const and: Operator;
|
|
50
|
+
export const or: Operator;
|
|
51
|
+
export const not: (a: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
|
|
52
|
+
export const xor: Operator;
|
|
53
|
+
export const bitAnd: Operator;
|
|
54
|
+
export const bitNot: (a: NodeRepresentation) => ShaderNodeObject<OperatorNode>;
|
|
55
|
+
export const bitOr: Operator;
|
|
56
|
+
export const bitXor: Operator;
|
|
57
|
+
export const shiftLeft: Operator;
|
|
58
|
+
export const shiftRight: Operator;
|
|
59
|
+
|
|
60
|
+
declare module '../shadernode/ShaderNode.js' {
|
|
61
|
+
interface NodeElements {
|
|
62
|
+
add: typeof add;
|
|
63
|
+
sub: typeof sub;
|
|
64
|
+
mul: typeof mul;
|
|
65
|
+
div: typeof div;
|
|
66
|
+
remainder: typeof remainder;
|
|
67
|
+
equal: typeof equal;
|
|
68
|
+
lessThan: typeof lessThan;
|
|
69
|
+
greaterThan: typeof greaterThan;
|
|
70
|
+
lessThanEqual: typeof lessThanEqual;
|
|
71
|
+
greaterThanEqual: typeof greaterThanEqual;
|
|
72
|
+
and: typeof and;
|
|
73
|
+
or: typeof or;
|
|
74
|
+
not: typeof not;
|
|
75
|
+
xor: typeof xor;
|
|
76
|
+
bitAnd: typeof bitAnd;
|
|
77
|
+
bitNot: typeof bitNot;
|
|
78
|
+
bitOr: typeof bitOr;
|
|
79
|
+
bitXor: typeof bitXor;
|
|
80
|
+
shiftLeft: typeof shiftLeft;
|
|
81
|
+
shiftRight: typeof shiftRight;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
2
|
+
import Node from '../core/Node.js';
|
|
3
|
+
|
|
4
|
+
export const tri: (x: NodeRepresentation) => ShaderNodeObject<Node>;
|
|
5
|
+
|
|
6
|
+
export const tri3: (p: NodeRepresentation) => ShaderNodeObject<Node>;
|
|
7
|
+
|
|
8
|
+
export const triNoise3D: (
|
|
9
|
+
p_immutable: NodeRepresentation,
|
|
10
|
+
spd: NodeRepresentation,
|
|
11
|
+
time: NodeRepresentation,
|
|
12
|
+
) => ShaderNodeObject<Node>;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import TempNode from '../core/TempNode.js';
|
|
2
|
+
import { NodeRepresentation, ShaderNodeObject } from '../shadernode/ShaderNode.js';
|
|
2
3
|
|
|
3
4
|
export default class CheckerNode extends TempNode {
|
|
4
5
|
uvNode: Node;
|
|
5
6
|
constructor(uvNode?: Node);
|
|
6
7
|
}
|
|
8
|
+
|
|
9
|
+
export const checker: (uvNode?: NodeRepresentation) => ShaderNodeObject<CheckerNode>;
|
|
10
|
+
|
|
11
|
+
declare module '../shadernode/ShaderNode.js' {
|
|
12
|
+
interface NodeElements {
|
|
13
|
+
checker: typeof checker;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -1,20 +1,73 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import Node from '../core/Node.js';
|
|
2
|
+
import { AnyObject, NodeTypeOption, SwizzleOption } from '../core/constants.js';
|
|
3
|
+
import ConstNode from '../core/ConstNode.js';
|
|
4
|
+
import NodeBuilder from '../core/NodeBuilder.js';
|
|
5
|
+
|
|
6
|
+
export interface NodeElements {
|
|
7
|
+
append: typeof append;
|
|
8
|
+
|
|
9
|
+
color: typeof color;
|
|
10
|
+
float: typeof float;
|
|
11
|
+
int: typeof int;
|
|
12
|
+
uint: typeof uint;
|
|
13
|
+
bool: typeof bool;
|
|
14
|
+
vec2: typeof vec2;
|
|
15
|
+
ivec2: typeof ivec2;
|
|
16
|
+
uvec2: typeof uvec2;
|
|
17
|
+
bvec2: typeof bvec2;
|
|
18
|
+
vec3: typeof vec3;
|
|
19
|
+
ivec3: typeof ivec3;
|
|
20
|
+
uvec3: typeof uvec3;
|
|
21
|
+
bvec3: typeof bvec3;
|
|
22
|
+
vec4: typeof vec4;
|
|
23
|
+
ivec4: typeof ivec4;
|
|
24
|
+
uvec4: typeof uvec4;
|
|
25
|
+
bvec4: typeof bvec4;
|
|
26
|
+
mat2: typeof mat2;
|
|
27
|
+
imat2: typeof imat2;
|
|
28
|
+
umat2: typeof umat2;
|
|
29
|
+
bmat2: typeof bmat2;
|
|
30
|
+
mat3: typeof mat3;
|
|
31
|
+
imat3: typeof imat3;
|
|
32
|
+
umat3: typeof umat3;
|
|
33
|
+
bmat3: typeof bmat3;
|
|
34
|
+
mat4: typeof mat4;
|
|
35
|
+
imat4: typeof imat4;
|
|
36
|
+
umat4: typeof umat4;
|
|
37
|
+
bmat4: typeof bmat4;
|
|
38
|
+
string: typeof string;
|
|
39
|
+
arrayBuffer: typeof arrayBuffer;
|
|
40
|
+
|
|
41
|
+
element: typeof element;
|
|
42
|
+
convert: typeof convert;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function addNodeElement(name: string, nodeElement: unknown): void;
|
|
46
|
+
|
|
4
47
|
export type Swizzable<T extends Node = Node> = T & {
|
|
5
|
-
[key in SwizzleOption | number]:
|
|
48
|
+
[key in SwizzleOption | number]: ShaderNodeObject<Node>;
|
|
6
49
|
};
|
|
7
50
|
|
|
51
|
+
export type ShaderNodeObject<T extends Node> = T & {
|
|
52
|
+
[Key in keyof NodeElements]: NodeElements[Key] extends (node: T, ...args: infer Args) => infer R
|
|
53
|
+
? (...args: Args) => R
|
|
54
|
+
: never;
|
|
55
|
+
} & Swizzable<T>;
|
|
56
|
+
|
|
8
57
|
/** anything that can be passed to {@link nodeObject} and returns a proxy */
|
|
9
|
-
export type NodeRepresentation<T extends Node = Node> = number | boolean | Node |
|
|
58
|
+
export type NodeRepresentation<T extends Node = Node> = number | boolean | Node | ShaderNodeObject<T>;
|
|
10
59
|
|
|
11
60
|
/** anything that can be passed to {@link nodeObject} */
|
|
12
61
|
export type NodeObjectOption = NodeRepresentation | string;
|
|
13
62
|
|
|
14
|
-
// same logic as in ShaderNodeObject: number,boolean,node->
|
|
15
|
-
export type NodeObject<T> = T extends Node
|
|
63
|
+
// same logic as in ShaderNodeObject: number,boolean,node->ShaderNodeObject, otherwise do nothing
|
|
64
|
+
export type NodeObject<T> = T extends Node
|
|
65
|
+
? ShaderNodeObject<T>
|
|
66
|
+
: T extends number | boolean
|
|
67
|
+
? ShaderNodeObject<ConstNode<number | boolean>>
|
|
68
|
+
: T;
|
|
16
69
|
|
|
17
|
-
// opposite of NodeObject: node -> node|
|
|
70
|
+
// opposite of NodeObject: node -> node|ShaderNodeObject|boolean|number, otherwise do nothing
|
|
18
71
|
type Proxied<T> = T extends Node ? NodeRepresentation<T> : T;
|
|
19
72
|
// https://github.com/microsoft/TypeScript/issues/42435#issuecomment-765557874
|
|
20
73
|
export type ProxiedTuple<T extends readonly [...unknown[]]> = [...{ [index in keyof T]: Proxied<T[index]> }];
|
|
@@ -102,11 +155,7 @@ type GetConstructorsByScope<T, S> = ConstructorUnion<FilterConstructorsByScope<O
|
|
|
102
155
|
type GetConstructors<T> = ConstructorUnion<OverloadedConstructorsOf<T>>;
|
|
103
156
|
type GetPossibleScopes<T> = ExtractScopes<OverloadedConstructorsOf<T>>;
|
|
104
157
|
|
|
105
|
-
export type ConvertType = (...params: unknown[]) =>
|
|
106
|
-
|
|
107
|
-
export const ConvertType: {
|
|
108
|
-
new (type: NodeTypeOption, cacheMap?: Map<unknown, ConstNode>): ConvertType;
|
|
109
|
-
};
|
|
158
|
+
export type ConvertType = (...params: unknown[]) => ShaderNodeObject<Node>;
|
|
110
159
|
|
|
111
160
|
type NodeArray<T extends NodeObjectOption[]> = { [index in keyof T]: NodeObject<T[index]> };
|
|
112
161
|
type NodeObjects<T> = { [key in keyof T]: T[key] extends NodeObjectOption ? NodeObject<T[key]> : T[key] };
|
|
@@ -114,7 +163,16 @@ type ConstructedNode<T> = T extends new (...args: any[]) => infer R ? (R extends
|
|
|
114
163
|
|
|
115
164
|
export type NodeOrType = Node | NodeTypeOption;
|
|
116
165
|
|
|
117
|
-
export
|
|
166
|
+
export const getConstNodeType: (value: NodeOrType) => NodeTypeOption | null;
|
|
167
|
+
|
|
168
|
+
export class ShaderNode<T = {}, R extends Node = Node> {
|
|
169
|
+
constructor(jsFunc: (inputs: NodeObjects<T>, builder: NodeBuilder) => NodeRepresentation);
|
|
170
|
+
call: (
|
|
171
|
+
inputs: { [key in keyof T]: T[key] extends NodeRepresentation ? ShaderNodeObject<Node> | Node : T[key] },
|
|
172
|
+
builder?: NodeBuilder,
|
|
173
|
+
) => ShaderNodeObject<R>;
|
|
174
|
+
}
|
|
175
|
+
|
|
118
176
|
export function nodeObject<T extends NodeObjectOption>(obj: T): NodeObject<T>;
|
|
119
177
|
export function nodeObjects<T>(obj: T): NodeObjects<T>;
|
|
120
178
|
|
|
@@ -122,35 +180,70 @@ export function nodeArray<T extends NodeObjectOption[]>(obj: readonly [...T]): N
|
|
|
122
180
|
|
|
123
181
|
export function nodeProxy<T>(
|
|
124
182
|
nodeClass: T,
|
|
125
|
-
): (...params: ProxiedTuple<GetConstructors<T>>) =>
|
|
183
|
+
): (...params: ProxiedTuple<GetConstructors<T>>) => ShaderNodeObject<ConstructedNode<T>>;
|
|
126
184
|
|
|
127
185
|
export function nodeProxy<T, S extends GetPossibleScopes<T>>(
|
|
128
186
|
nodeClass: T,
|
|
129
187
|
scope: S,
|
|
130
|
-
): (...params: ProxiedTuple<RemoveTail<GetConstructorsByScope<T, S>>>) =>
|
|
188
|
+
): (...params: ProxiedTuple<RemoveTail<GetConstructorsByScope<T, S>>>) => ShaderNodeObject<ConstructedNode<T>>;
|
|
131
189
|
|
|
132
190
|
export function nodeProxy<T, S extends GetPossibleScopes<T>>(
|
|
133
191
|
nodeClass: T,
|
|
134
192
|
scope: S,
|
|
135
193
|
factor: NodeObjectOption,
|
|
136
|
-
): (...params: ProxiedTuple<RemoveHeadAndTail<GetConstructorsByScope<T, S>>>) =>
|
|
194
|
+
): (...params: ProxiedTuple<RemoveHeadAndTail<GetConstructorsByScope<T, S>>>) => ShaderNodeObject<ConstructedNode<T>>;
|
|
137
195
|
|
|
138
196
|
export function nodeImmutable<T>(
|
|
139
197
|
nodeClass: T,
|
|
140
198
|
...params: ProxiedTuple<GetConstructors<T>>
|
|
141
|
-
):
|
|
199
|
+
): ShaderNodeObject<ConstructedNode<T>>;
|
|
142
200
|
|
|
143
|
-
export
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
builder?: NodeBuilder,
|
|
148
|
-
) => Swizzable<R>;
|
|
149
|
-
}
|
|
201
|
+
export function tslFn<R extends Node = ShaderNodeObject<Node>>(jsFunc: () => R): () => R;
|
|
202
|
+
export function tslFn<T extends AnyObject, R extends Node = ShaderNodeObject<Node>>(
|
|
203
|
+
jsFunc: (args: T) => R,
|
|
204
|
+
): (args: T) => R;
|
|
150
205
|
|
|
151
|
-
export
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
206
|
+
export function append(node: Node): Node;
|
|
207
|
+
|
|
208
|
+
export const color: ConvertType;
|
|
209
|
+
|
|
210
|
+
export const float: ConvertType;
|
|
211
|
+
export const int: ConvertType;
|
|
212
|
+
export const uint: ConvertType;
|
|
213
|
+
export const bool: ConvertType;
|
|
214
|
+
|
|
215
|
+
export const vec2: ConvertType;
|
|
216
|
+
export const ivec2: ConvertType;
|
|
217
|
+
export const uvec2: ConvertType;
|
|
218
|
+
export const bvec2: ConvertType;
|
|
219
|
+
|
|
220
|
+
export const vec3: ConvertType;
|
|
221
|
+
export const ivec3: ConvertType;
|
|
222
|
+
export const uvec3: ConvertType;
|
|
223
|
+
export const bvec3: ConvertType;
|
|
224
|
+
|
|
225
|
+
export const vec4: ConvertType;
|
|
226
|
+
export const ivec4: ConvertType;
|
|
227
|
+
export const uvec4: ConvertType;
|
|
228
|
+
export const bvec4: ConvertType;
|
|
229
|
+
|
|
230
|
+
export const mat2: ConvertType;
|
|
231
|
+
export const imat2: ConvertType;
|
|
232
|
+
export const umat2: ConvertType;
|
|
233
|
+
export const bmat2: ConvertType;
|
|
234
|
+
|
|
235
|
+
export const mat3: ConvertType;
|
|
236
|
+
export const imat3: ConvertType;
|
|
237
|
+
export const umat3: ConvertType;
|
|
238
|
+
export const bmat3: ConvertType;
|
|
239
|
+
|
|
240
|
+
export const mat4: ConvertType;
|
|
241
|
+
export const imat4: ConvertType;
|
|
242
|
+
export const umat4: ConvertType;
|
|
243
|
+
export const bmat4: ConvertType;
|
|
244
|
+
|
|
245
|
+
export const string: (value?: string) => ShaderNodeObject<ConstNode<string>>;
|
|
246
|
+
export const arrayBuffer: (value: ArrayBuffer) => ShaderNodeObject<ConstNode<ArrayBuffer>>;
|
|
247
|
+
|
|
248
|
+
export const element: (node: NodeRepresentation, indexNode: NodeRepresentation) => ShaderNodeObject<Node>;
|
|
249
|
+
export const convert: (node: NodeRepresentation, types: NodeTypeOption) => ShaderNodeObject<Node>;
|