@awesome-flow/noise 0.9.5 → 0.11.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.
- package/dist/abstract/index.cjs +7 -11
- package/dist/abstract/index.d.cts +4 -140
- package/dist/abstract/index.d.mts +4 -0
- package/dist/abstract/index.mjs +3 -0
- package/dist/abstract-3knbwDkz.cjs +1768 -0
- package/dist/abstract-3knbwDkz.cjs.map +1 -0
- package/dist/{abstract-Dhf_tSuO.js → abstract-DNmiw2MC.mjs} +562 -234
- package/dist/abstract-DNmiw2MC.mjs.map +1 -0
- package/dist/generators-BF_0y3pd.cjs +337 -0
- package/dist/generators-BF_0y3pd.cjs.map +1 -0
- package/dist/{generators-BzkwG_6g.js → generators-DSwgPqW2.mjs} +35 -110
- package/dist/generators-DSwgPqW2.mjs.map +1 -0
- package/dist/groups-BiuJL0DE.mjs +13 -0
- package/dist/groups-BiuJL0DE.mjs.map +1 -0
- package/dist/groups-DF2FTSBC.cjs +18 -0
- package/dist/groups-DF2FTSBC.cjs.map +1 -0
- package/dist/index-B09XEo3I.d.cts +496 -0
- package/dist/index-B09XEo3I.d.cts.map +1 -0
- package/dist/index-BGF1mgi8.d.mts +98 -0
- package/dist/index-BGF1mgi8.d.mts.map +1 -0
- package/dist/{modules/index.d.ts → index-BbHM1kxc.d.cts} +2 -4
- package/dist/index-BbHM1kxc.d.cts.map +1 -0
- package/dist/index-BgWB8f25.d.cts +53 -0
- package/dist/index-BgWB8f25.d.cts.map +1 -0
- package/dist/index-BhJiS2YS.d.mts +496 -0
- package/dist/index-BhJiS2YS.d.mts.map +1 -0
- package/dist/index-BwLhWefF.d.cts +43 -0
- package/dist/index-BwLhWefF.d.cts.map +1 -0
- package/dist/index-Bxg8IB-v.d.cts +26 -0
- package/dist/index-Bxg8IB-v.d.cts.map +1 -0
- package/dist/index-C0hF9uhX.d.mts +12 -0
- package/dist/index-C0hF9uhX.d.mts.map +1 -0
- package/dist/{index-C7MZeUpC.d.cts → index-CBvjQM3o.d.cts} +4 -2
- package/dist/index-CBvjQM3o.d.cts.map +1 -0
- package/dist/index-CDJdO0Cl.d.mts +11 -0
- package/dist/index-CDJdO0Cl.d.mts.map +1 -0
- package/dist/index-CiHIo5l6.d.cts +89 -0
- package/dist/index-CiHIo5l6.d.cts.map +1 -0
- package/dist/index-CkAu8Jje.d.mts +43 -0
- package/dist/index-CkAu8Jje.d.mts.map +1 -0
- package/dist/index-DQ5-4LVA.d.mts +26 -0
- package/dist/index-DQ5-4LVA.d.mts.map +1 -0
- package/dist/index-NvNXQIOG.d.mts +89 -0
- package/dist/index-NvNXQIOG.d.mts.map +1 -0
- package/dist/index-Rk69VHHb.d.cts +98 -0
- package/dist/index-Rk69VHHb.d.cts.map +1 -0
- package/dist/index-aAcFA6x8.d.mts +53 -0
- package/dist/index-aAcFA6x8.d.mts.map +1 -0
- package/dist/modifiers-BLV074OG.cjs +406 -0
- package/dist/modifiers-BLV074OG.cjs.map +1 -0
- package/dist/{modifiers-MSA4z6Gq.js → modifiers-I7YC0m3o.mjs} +72 -198
- package/dist/modifiers-I7YC0m3o.mjs.map +1 -0
- package/dist/module-group-template-CE4b0J24.d.cts +42 -0
- package/dist/module-group-template-CE4b0J24.d.cts.map +1 -0
- package/dist/module-group-template-D5doDEoa.d.mts +42 -0
- package/dist/module-group-template-D5doDEoa.d.mts.map +1 -0
- package/dist/modules/index.cjs +20 -2
- package/dist/modules/index.cjs.map +1 -0
- package/dist/modules/index.d.cts +2 -14
- package/dist/modules/index.d.mts +2 -0
- package/dist/{normalize-noise-module-CTxqByn9.js → modules/index.mjs} +1 -1
- package/dist/modules/index.mjs.map +1 -0
- package/dist/{node-props-CkXCceW9.d.ts → node-props-CoXzPLD6.d.cts} +11 -10
- package/dist/node-props-CoXzPLD6.d.cts.map +1 -0
- package/dist/{node-props-wMYPlIzZ.d.cts → node-props-GcUBDDY0.d.mts} +11 -10
- package/dist/node-props-GcUBDDY0.d.mts.map +1 -0
- package/dist/nodes/generators/index.cjs +2 -1
- package/dist/nodes/generators/index.d.cts +2 -3
- package/dist/nodes/generators/index.d.mts +2 -0
- package/dist/nodes/generators/{index.js → index.mjs} +1 -1
- package/dist/nodes/groups/index.cjs +2 -1
- package/dist/nodes/groups/index.d.cts +2 -2
- package/dist/nodes/groups/index.d.mts +2 -0
- package/dist/nodes/groups/index.mjs +3 -0
- package/dist/nodes/index.cjs +10 -9
- package/dist/nodes/index.d.cts +7 -9
- package/dist/nodes/index.d.mts +7 -0
- package/dist/nodes/index.mjs +8 -0
- package/dist/nodes/modifiers/index.cjs +2 -2
- package/dist/nodes/modifiers/index.d.cts +2 -3
- package/dist/nodes/modifiers/index.d.mts +2 -0
- package/dist/nodes/modifiers/index.mjs +3 -0
- package/dist/nodes/output/index.cjs +3 -7
- package/dist/nodes/output/index.d.cts +2 -2
- package/dist/nodes/output/index.d.mts +2 -0
- package/dist/nodes/output/index.mjs +3 -0
- package/dist/nodes/selectors/index.cjs +4 -8
- package/dist/nodes/selectors/index.d.cts +2 -3
- package/dist/nodes/selectors/index.d.mts +2 -0
- package/dist/nodes/selectors/index.mjs +3 -0
- package/dist/nodes/transformers/index.cjs +2 -1
- package/dist/nodes/transformers/index.d.cts +2 -3
- package/dist/nodes/transformers/index.d.mts +2 -0
- package/dist/nodes/transformers/index.mjs +3 -0
- package/dist/position-grid-template-Da_-z-NN.d.cts +79 -0
- package/dist/position-grid-template-Da_-z-NN.d.cts.map +1 -0
- package/dist/position-grid-template-FY_7BJcV.d.mts +79 -0
- package/dist/position-grid-template-FY_7BJcV.d.mts.map +1 -0
- package/dist/selectors-35pwVJ7Z.cjs +92 -0
- package/dist/selectors-35pwVJ7Z.cjs.map +1 -0
- package/dist/selectors-BHPJTidb.mjs +81 -0
- package/dist/selectors-BHPJTidb.mjs.map +1 -0
- package/dist/templates/generators/index.cjs +2 -7
- package/dist/templates/generators/index.d.cts +2 -4
- package/dist/templates/generators/index.d.mts +2 -0
- package/dist/templates/generators/index.mjs +3 -0
- package/dist/templates/groups/index.cjs +2 -7
- package/dist/templates/groups/index.d.cts +2 -3
- package/dist/templates/groups/index.d.mts +2 -0
- package/dist/templates/groups/index.mjs +3 -0
- package/dist/templates/index.cjs +9 -13
- package/dist/templates/index.d.cts +4 -14
- package/dist/templates/index.d.mts +4 -0
- package/dist/templates/index.mjs +9 -0
- package/dist/templates/modifiers/index.cjs +2 -7
- package/dist/templates/modifiers/index.d.cts +2 -4
- package/dist/templates/modifiers/index.d.mts +2 -0
- package/dist/templates/modifiers/index.mjs +3 -0
- package/dist/templates/output/index.cjs +3 -8
- package/dist/templates/output/index.d.cts +2 -3
- package/dist/templates/output/index.d.mts +2 -0
- package/dist/templates/output/index.mjs +3 -0
- package/dist/templates/selectors/index.cjs +2 -7
- package/dist/templates/selectors/index.d.cts +2 -4
- package/dist/templates/selectors/index.d.mts +2 -0
- package/dist/templates/selectors/index.mjs +3 -0
- package/dist/templates/transformers/index.cjs +2 -7
- package/dist/templates/transformers/index.d.cts +2 -4
- package/dist/templates/transformers/index.d.mts +2 -0
- package/dist/templates/transformers/index.mjs +3 -0
- package/dist/{transformers-Cpxm1ER8.js → transformers-D9B9IjR_.mjs} +11 -90
- package/dist/transformers-D9B9IjR_.mjs.map +1 -0
- package/dist/transformers-D9SfPky8.cjs +226 -0
- package/dist/transformers-D9SfPky8.cjs.map +1 -0
- package/package.json +26 -24
- package/dist/abstract/index.d.cts.map +0 -1
- package/dist/abstract/index.d.ts +0 -140
- package/dist/abstract/index.d.ts.map +0 -1
- package/dist/abstract/index.js +0 -8
- package/dist/abstract-Db8fFoLp.cjs +0 -1423
- package/dist/abstract-Db8fFoLp.cjs.map +0 -1
- package/dist/abstract-Dhf_tSuO.js.map +0 -1
- package/dist/chunk-CUT6urMc.cjs +0 -30
- package/dist/generators-BzkwG_6g.js.map +0 -1
- package/dist/generators-CEKtVh81.cjs +0 -0
- package/dist/generators-D3RjZdMN.cjs +0 -413
- package/dist/generators-D3RjZdMN.cjs.map +0 -1
- package/dist/generators-DUbGjGwn.js +0 -0
- package/dist/groups-7QhtZ7S3.js +0 -0
- package/dist/groups-BIS2AF5M.cjs +0 -32
- package/dist/groups-BIS2AF5M.cjs.map +0 -1
- package/dist/groups-CH_lk8Aw.js +0 -26
- package/dist/groups-CH_lk8Aw.js.map +0 -1
- package/dist/groups-_x04PMtP.cjs +0 -0
- package/dist/index-0fK2DhR9.d.ts +0 -96
- package/dist/index-0fK2DhR9.d.ts.map +0 -1
- package/dist/index-B5F3AfVc.d.ts +0 -1
- package/dist/index-BAvw94zl.d.ts +0 -9
- package/dist/index-BAvw94zl.d.ts.map +0 -1
- package/dist/index-BLREDRDJ.d.cts +0 -1
- package/dist/index-BQGb02a-.d.cts +0 -1
- package/dist/index-BQbubdsk.d.ts +0 -89
- package/dist/index-BQbubdsk.d.ts.map +0 -1
- package/dist/index-Be7jjS77.d.ts +0 -1
- package/dist/index-BlgxGbc0.d.cts +0 -89
- package/dist/index-BlgxGbc0.d.cts.map +0 -1
- package/dist/index-C7MZeUpC.d.cts.map +0 -1
- package/dist/index-CLcwj8U0.d.ts +0 -1
- package/dist/index-CUPkUUOR.d.ts +0 -1
- package/dist/index-CnAUb7AL.d.cts +0 -24
- package/dist/index-CnAUb7AL.d.cts.map +0 -1
- package/dist/index-CtCMUyZA.d.cts +0 -1
- package/dist/index-DAwMsCZ3.d.ts +0 -1
- package/dist/index-DHdW2oFJ.d.ts +0 -51
- package/dist/index-DHdW2oFJ.d.ts.map +0 -1
- package/dist/index-DOvrmvAP.d.cts +0 -1
- package/dist/index-Dh6J9gb5.d.cts +0 -1
- package/dist/index-DiHZ0kDx.d.ts +0 -41
- package/dist/index-DiHZ0kDx.d.ts.map +0 -1
- package/dist/index-DjNzlSLZ.d.cts +0 -41
- package/dist/index-DjNzlSLZ.d.cts.map +0 -1
- package/dist/index-Dpmi5zcN.d.cts +0 -1
- package/dist/index-DtihvA2Y.d.cts +0 -96
- package/dist/index-DtihvA2Y.d.cts.map +0 -1
- package/dist/index-I2m6W13H.d.ts +0 -1
- package/dist/index-QAtBiMxG.d.cts +0 -1
- package/dist/index-kr8Wk7v5.d.ts +0 -1
- package/dist/index-nJ2Hzacu.d.ts +0 -24
- package/dist/index-nJ2Hzacu.d.ts.map +0 -1
- package/dist/index-p2iXZqXH.d.cts +0 -51
- package/dist/index-p2iXZqXH.d.cts.map +0 -1
- package/dist/modifiers-BFuezug6.js +0 -0
- package/dist/modifiers-BPTSn-15.cjs +0 -0
- package/dist/modifiers-DU7AkD-K.cjs +0 -545
- package/dist/modifiers-DU7AkD-K.cjs.map +0 -1
- package/dist/modifiers-MSA4z6Gq.js.map +0 -1
- package/dist/module-group-template-8oC4dg0a.d.ts +0 -11
- package/dist/module-group-template-8oC4dg0a.d.ts.map +0 -1
- package/dist/module-group-template-CBWW-oGM.d.cts +0 -11
- package/dist/module-group-template-CBWW-oGM.d.cts.map +0 -1
- package/dist/modules/index.d.cts.map +0 -1
- package/dist/modules/index.d.ts.map +0 -1
- package/dist/modules/index.js +0 -3
- package/dist/node-props-CkXCceW9.d.ts.map +0 -1
- package/dist/node-props-wMYPlIzZ.d.cts.map +0 -1
- package/dist/nodes/generators/index.d.ts +0 -3
- package/dist/nodes/groups/index.d.ts +0 -2
- package/dist/nodes/groups/index.js +0 -3
- package/dist/nodes/index.d.ts +0 -9
- package/dist/nodes/index.js +0 -8
- package/dist/nodes/modifiers/index.d.ts +0 -3
- package/dist/nodes/modifiers/index.js +0 -4
- package/dist/nodes/output/index.d.ts +0 -2
- package/dist/nodes/output/index.js +0 -8
- package/dist/nodes/selectors/index.d.ts +0 -3
- package/dist/nodes/selectors/index.js +0 -8
- package/dist/nodes/transformers/index.d.ts +0 -3
- package/dist/nodes/transformers/index.js +0 -3
- package/dist/noise-select-template-DySK_9N4.d.ts +0 -18
- package/dist/noise-select-template-DySK_9N4.d.ts.map +0 -1
- package/dist/noise-select-template-NyFIrMMB.d.cts +0 -18
- package/dist/noise-select-template-NyFIrMMB.d.cts.map +0 -1
- package/dist/noise-terrace-template-00K3BKMq.d.ts +0 -60
- package/dist/noise-terrace-template-00K3BKMq.d.ts.map +0 -1
- package/dist/noise-terrace-template-9_PoAyoY.d.cts +0 -60
- package/dist/noise-terrace-template-9_PoAyoY.d.cts.map +0 -1
- package/dist/noise-turbulence-template-CMhGn5Ja.d.cts +0 -63
- package/dist/noise-turbulence-template-CMhGn5Ja.d.cts.map +0 -1
- package/dist/noise-turbulence-template-Xv-hmmfh.d.ts +0 -63
- package/dist/noise-turbulence-template-Xv-hmmfh.d.ts.map +0 -1
- package/dist/normalize-noise-module-CTxqByn9.js.map +0 -1
- package/dist/normalize-noise-module-U3fMmZRj.cjs +0 -26
- package/dist/normalize-noise-module-U3fMmZRj.cjs.map +0 -1
- package/dist/output-CsgQ-PfN.js +0 -0
- package/dist/output-DhHW36T8.cjs +0 -0
- package/dist/position-grid-template-2Acjbquv.d.ts +0 -66
- package/dist/position-grid-template-2Acjbquv.d.ts.map +0 -1
- package/dist/position-grid-template-DWH5cUR0.d.cts +0 -66
- package/dist/position-grid-template-DWH5cUR0.d.cts.map +0 -1
- package/dist/position-logger-template-CvH32Xjm.d.ts +0 -29
- package/dist/position-logger-template-CvH32Xjm.d.ts.map +0 -1
- package/dist/position-logger-template-DPBhlahQ.d.cts +0 -29
- package/dist/position-logger-template-DPBhlahQ.d.cts.map +0 -1
- package/dist/selectors-DOtoPc8O.cjs +0 -0
- package/dist/selectors-DPitHA56.js +0 -0
- package/dist/templates/generators/index.d.ts +0 -4
- package/dist/templates/generators/index.js +0 -9
- package/dist/templates/groups/index.d.ts +0 -3
- package/dist/templates/groups/index.js +0 -9
- package/dist/templates/index.d.ts +0 -14
- package/dist/templates/index.js +0 -14
- package/dist/templates/modifiers/index.d.ts +0 -4
- package/dist/templates/modifiers/index.js +0 -9
- package/dist/templates/output/index.d.ts +0 -3
- package/dist/templates/output/index.js +0 -9
- package/dist/templates/selectors/index.d.ts +0 -4
- package/dist/templates/selectors/index.js +0 -9
- package/dist/templates/transformers/index.d.ts +0 -4
- package/dist/templates/transformers/index.js +0 -9
- package/dist/transformers-C-NV_u9j.cjs +0 -324
- package/dist/transformers-C-NV_u9j.cjs.map +0 -1
- package/dist/transformers-CbfR4wDy.js +0 -0
- package/dist/transformers-Cpxm1ER8.js.map +0 -1
- package/dist/transformers-iRDXBonP.cjs +0 -0
|
@@ -1,22 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { a as noise_ridgedmulti_node_default, c as noise_const_node_default, i as noise_spheres_node_default, l as noise_checkerboard_node_default, n as position_const_node_default, o as noise_perlin_node_default, r as noise_voronoi_node_default, s as noise_cylinders_node_default, t as position_grid_node_default, u as noise_billow_node_default } from "./generators-DSwgPqW2.mjs";
|
|
2
|
+
import { t as module_group_node_default } from "./groups-BiuJL0DE.mjs";
|
|
3
|
+
import { a as noise_exponent_node_default, c as noise_clamp_node_default, i as noise_invert_node_default, l as noise_abs_node_default, n as noise_scale_bias_node_default, o as noise_curve_node_default, r as noise_normalize_node_default, s as noise_combine_node_default, t as noise_terrace_node_default } from "./modifiers-I7YC0m3o.mjs";
|
|
4
|
+
import { n as noise_blend_node_default, t as noise_select_node_default } from "./selectors-BHPJTidb.mjs";
|
|
5
|
+
import { a as noise_displace_node_default, i as noise_rotate_point_node_default, n as noise_translate_point_node_default, r as noise_scale_point_node_default, t as noise_turbulence_node_default } from "./transformers-D9B9IjR_.mjs";
|
|
6
|
+
import { NormalizeNoiseModule } from "./modules/index.mjs";
|
|
5
7
|
import { HandlesIncomingDataStatus } from "@awesome-flow/core/components";
|
|
6
|
-
import { useIncomingComputedData, useUpdateNodeComputedData, useUpdateNodeData } from "@awesome-flow/core/hooks";
|
|
7
8
|
import { NodeContainer } from "@awesome-flow/core/layout";
|
|
8
|
-
import {
|
|
9
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
9
|
+
import { memo } from "react";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
-
import {
|
|
11
|
+
import { useNodeContext } from "@awesome-flow/core/hooks";
|
|
12
|
+
import { Divider, Group, Stack, Text } from "@mantine/core";
|
|
12
13
|
import { CoreHandleType, CoreTemplateGroup } from "@awesome-flow/core/abstract";
|
|
14
|
+
import { PipelineFactory } from "@awesome-flow/core/factories";
|
|
13
15
|
import { IDGenerator } from "@awesome-flow/core/utils";
|
|
14
16
|
import { Position } from "@xyflow/system";
|
|
17
|
+
import { Abs, Add, Billow, Blend, Checkerboard, Clamp, Const, Curve, Cylinders, Displace, Exponent, Invert, Max, Min, Multiply, Perlin, Power, RidgedMulti, RotatePoint, ScaleBias, ScalePoint, Select, Spheres, Terrace, TranslatePoint, Tuple, Turbulence, Voronoi } from "libnoise-simplex-ts";
|
|
15
18
|
|
|
19
|
+
//#region src/abstract/handle-types.ts
|
|
20
|
+
let NoiseHandleType = /* @__PURE__ */ function(NoiseHandleType) {
|
|
21
|
+
NoiseHandleType["textureData"] = "texture-data";
|
|
22
|
+
NoiseHandleType["noise"] = "noise";
|
|
23
|
+
NoiseHandleType["position"] = "position";
|
|
24
|
+
NoiseHandleType["module"] = "module";
|
|
25
|
+
return NoiseHandleType;
|
|
26
|
+
}({});
|
|
27
|
+
let DisplacementHandle = /* @__PURE__ */ function(DisplacementHandle) {
|
|
28
|
+
DisplacementHandle["sourceModule"] = "source";
|
|
29
|
+
DisplacementHandle["xModule"] = "x-module";
|
|
30
|
+
DisplacementHandle["yModule"] = "y-module";
|
|
31
|
+
DisplacementHandle["zModule"] = "z-module";
|
|
32
|
+
DisplacementHandle["output"] = "output";
|
|
33
|
+
return DisplacementHandle;
|
|
34
|
+
}({});
|
|
35
|
+
let NoiseSourceControlHandle = /* @__PURE__ */ function(NoiseSourceControlHandle) {
|
|
36
|
+
NoiseSourceControlHandle["source"] = "source";
|
|
37
|
+
NoiseSourceControlHandle["control"] = "control";
|
|
38
|
+
NoiseSourceControlHandle["output"] = "output";
|
|
39
|
+
return NoiseSourceControlHandle;
|
|
40
|
+
}({});
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
16
43
|
//#region src/nodes/output/noise-logger-node.tsx
|
|
17
44
|
function NoiseLoggerNode({ id, selected, data, type }) {
|
|
18
|
-
const
|
|
19
|
-
const noise = useMemo(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
45
|
+
const noise = (useNodeContext(id)?.incoming?.[NoiseHandleType.noise])?.filter((c) => c.computed?.noise).flatMap((c) => c.computed.noise) || [];
|
|
20
46
|
return /* @__PURE__ */ jsxs(NodeContainer, {
|
|
21
47
|
id,
|
|
22
48
|
selected,
|
|
@@ -37,33 +63,12 @@ function NoiseLoggerNode({ id, selected, data, type }) {
|
|
|
37
63
|
]
|
|
38
64
|
});
|
|
39
65
|
}
|
|
40
|
-
var noise_logger_node_default = NoiseLoggerNode;
|
|
66
|
+
var noise_logger_node_default = memo(NoiseLoggerNode);
|
|
41
67
|
|
|
42
68
|
//#endregion
|
|
43
69
|
//#region src/nodes/output/noise-output-node.tsx
|
|
44
70
|
function NoiseOutputNode({ id, selected, data, type }) {
|
|
45
|
-
const
|
|
46
|
-
const updateComputedData = useUpdateNodeComputedData();
|
|
47
|
-
const onDataUpdated = useCallback((handleData) => {
|
|
48
|
-
const incomingPositions = handleData[NoiseHandleType.position];
|
|
49
|
-
const incomingModule = handleData[NoiseHandleType.module];
|
|
50
|
-
if (incomingPositions?.length && incomingModule?.length && incomingModule[0]?.module) {
|
|
51
|
-
const { module } = incomingModule[0];
|
|
52
|
-
const noise = [];
|
|
53
|
-
for (const input of incomingPositions) for (const position of input.positions) {
|
|
54
|
-
const value = module.getValue(position.x, position.y, position.z);
|
|
55
|
-
noise.push({
|
|
56
|
-
position,
|
|
57
|
-
value
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
updateComputedData(id, {
|
|
61
|
-
noise,
|
|
62
|
-
module
|
|
63
|
-
});
|
|
64
|
-
setSize(noise.length);
|
|
65
|
-
}
|
|
66
|
-
}, [updateComputedData, id]);
|
|
71
|
+
const context = useNodeContext(id);
|
|
67
72
|
return /* @__PURE__ */ jsxs(NodeContainer, {
|
|
68
73
|
id,
|
|
69
74
|
selected,
|
|
@@ -71,51 +76,19 @@ function NoiseOutputNode({ id, selected, data, type }) {
|
|
|
71
76
|
type,
|
|
72
77
|
children: [/* @__PURE__ */ jsx(HandlesIncomingDataStatus, {
|
|
73
78
|
nodeId: id,
|
|
74
|
-
handles: data.handles
|
|
75
|
-
groupBy: "dataType",
|
|
76
|
-
onDataUpdated,
|
|
77
|
-
type: "target",
|
|
78
|
-
resetComputedData: true
|
|
79
|
+
handles: data.handles
|
|
79
80
|
}), /* @__PURE__ */ jsxs(Text, {
|
|
80
81
|
mt: 5,
|
|
81
|
-
children: ["Noise points: ",
|
|
82
|
+
children: ["Noise points: ", context?.computed?.noise?.length || 0]
|
|
82
83
|
})]
|
|
83
84
|
});
|
|
84
85
|
}
|
|
85
|
-
var noise_output_node_default = NoiseOutputNode;
|
|
86
|
+
var noise_output_node_default = memo(NoiseOutputNode);
|
|
86
87
|
|
|
87
88
|
//#endregion
|
|
88
|
-
//#region src/nodes/output/noise-
|
|
89
|
-
function
|
|
90
|
-
const
|
|
91
|
-
const [dataLength, setDataLength] = useState(0);
|
|
92
|
-
const [resolution, setResolution] = useState(0);
|
|
93
|
-
const incoming = useIncomingComputedData(id);
|
|
94
|
-
const noise = useMemo(() => incoming?.map((p) => p.noise).flat(), [incoming]);
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
if (noise?.length) {
|
|
97
|
-
const size = Math.ceil(Math.sqrt(noise.length));
|
|
98
|
-
const colors = noise.map((n) => [
|
|
99
|
-
n.value * 255,
|
|
100
|
-
n.value * 255,
|
|
101
|
-
n.value * 255,
|
|
102
|
-
255
|
|
103
|
-
]).flat();
|
|
104
|
-
const dataArray = new Uint8Array(size * size * 4);
|
|
105
|
-
dataArray.set(colors);
|
|
106
|
-
setResolution(size);
|
|
107
|
-
setDataLength(dataArray.length);
|
|
108
|
-
updateComputedData(id, {
|
|
109
|
-
textureData: dataArray,
|
|
110
|
-
textureResolutionX: size,
|
|
111
|
-
textureResolutionY: size
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
}, [
|
|
115
|
-
noise,
|
|
116
|
-
updateComputedData,
|
|
117
|
-
id
|
|
118
|
-
]);
|
|
89
|
+
//#region src/nodes/output/noise-texture-data-node.tsx
|
|
90
|
+
function NoiseTextureDataNode({ id, selected, data, type }) {
|
|
91
|
+
const context = useNodeContext(id)?.computed;
|
|
119
92
|
return /* @__PURE__ */ jsx(NodeContainer, {
|
|
120
93
|
id,
|
|
121
94
|
selected,
|
|
@@ -124,31 +97,28 @@ function NoiseRawTextureNode({ id, selected, data, type }) {
|
|
|
124
97
|
children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
125
98
|
/* @__PURE__ */ jsxs(Group, { children: [
|
|
126
99
|
"Resolution: ",
|
|
127
|
-
|
|
100
|
+
context?.textureResolutionX,
|
|
128
101
|
"x",
|
|
129
|
-
|
|
102
|
+
context?.textureResolutionY
|
|
130
103
|
] }),
|
|
131
|
-
/* @__PURE__ */ jsxs(Group, { children: ["Input Length: ",
|
|
104
|
+
/* @__PURE__ */ jsxs(Group, { children: ["Input Length: ", context?.textureData?.length || 0] }),
|
|
132
105
|
/* @__PURE__ */ jsxs(Group, { children: [
|
|
133
106
|
"Output Length (",
|
|
134
|
-
|
|
107
|
+
context?.textureResolutionX,
|
|
135
108
|
"*",
|
|
136
|
-
|
|
109
|
+
context?.textureResolutionY,
|
|
137
110
|
"*4): ",
|
|
138
|
-
|
|
111
|
+
context?.textureData?.length || 0
|
|
139
112
|
] })
|
|
140
113
|
] })
|
|
141
114
|
});
|
|
142
115
|
}
|
|
143
|
-
var
|
|
116
|
+
var noise_texture_data_node_default = memo(NoiseTextureDataNode);
|
|
144
117
|
|
|
145
118
|
//#endregion
|
|
146
119
|
//#region src/nodes/output/positions-logger-node.tsx
|
|
147
120
|
function PositionsLoggerNode({ id, selected, data, type }) {
|
|
148
|
-
const
|
|
149
|
-
const positions = useMemo(() => {
|
|
150
|
-
return incoming?.map((p) => p.positions).flat();
|
|
151
|
-
}, [incoming]);
|
|
121
|
+
const positions = (useNodeContext(id)?.incoming[NoiseHandleType.position])?.filter((p) => !!p.computed?.positions?.length).flatMap((p) => p.computed.positions);
|
|
152
122
|
return /* @__PURE__ */ jsxs(NodeContainer, {
|
|
153
123
|
id,
|
|
154
124
|
selected,
|
|
@@ -167,123 +137,33 @@ function PositionsLoggerNode({ id, selected, data, type }) {
|
|
|
167
137
|
]
|
|
168
138
|
});
|
|
169
139
|
}
|
|
170
|
-
var positions_logger_node_default = PositionsLoggerNode;
|
|
140
|
+
var positions_logger_node_default = memo(PositionsLoggerNode);
|
|
171
141
|
|
|
172
142
|
//#endregion
|
|
173
|
-
//#region src/
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}, [id, updateComputedData]);
|
|
184
|
-
return /* @__PURE__ */ jsx(NodeContainer, {
|
|
185
|
-
id,
|
|
186
|
-
selected,
|
|
187
|
-
data,
|
|
188
|
-
type,
|
|
189
|
-
children: /* @__PURE__ */ jsx(HandlesIncomingDataStatus, {
|
|
190
|
-
nodeId: id,
|
|
191
|
-
handles: data.handles,
|
|
192
|
-
groupBy: "dataId",
|
|
193
|
-
onDataUpdated,
|
|
194
|
-
type: "target",
|
|
195
|
-
resetComputedData: true
|
|
196
|
-
})
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
var noise_blend_node_default = NoiseBlendNode;
|
|
143
|
+
//#region src/abstract/templates.ts
|
|
144
|
+
let NoiseTemplateGroup = /* @__PURE__ */ function(NoiseTemplateGroup) {
|
|
145
|
+
NoiseTemplateGroup["positions"] = "Positions";
|
|
146
|
+
NoiseTemplateGroup["output"] = "Output";
|
|
147
|
+
NoiseTemplateGroup["noiseGenerators"] = "Noise Generators";
|
|
148
|
+
NoiseTemplateGroup["noiseModifiers"] = "Noise Modifiers";
|
|
149
|
+
NoiseTemplateGroup["noiseSelectors"] = "Noise Selectors";
|
|
150
|
+
NoiseTemplateGroup["noiseTransformers"] = "Noise Transformers";
|
|
151
|
+
return NoiseTemplateGroup;
|
|
152
|
+
}({});
|
|
200
153
|
|
|
201
154
|
//#endregion
|
|
202
|
-
//#region src/
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
updateNodeData(id, {
|
|
211
|
-
edgeFalloff,
|
|
212
|
-
lowerBound,
|
|
213
|
-
upperBound
|
|
214
|
-
});
|
|
215
|
-
}, [
|
|
216
|
-
edgeFalloff,
|
|
217
|
-
lowerBound,
|
|
218
|
-
upperBound,
|
|
219
|
-
id,
|
|
220
|
-
updateNodeData
|
|
221
|
-
]);
|
|
222
|
-
const onDataUpdated = useCallback((incomingData) => {
|
|
223
|
-
const incomingSources = incomingData[NoiseSourceControlHandle.source];
|
|
224
|
-
const incomingControl = incomingData[NoiseSourceControlHandle.control];
|
|
225
|
-
if (incomingSources?.length >= 2 && incomingControl?.length) {
|
|
226
|
-
const module = new Select(incomingSources[0].module, incomingSources[1].module, incomingControl[0].module, edgeFalloff, lowerBound, upperBound);
|
|
227
|
-
updateComputedData(id, { module });
|
|
155
|
+
//#region src/middleware/incoming-property-value.ts
|
|
156
|
+
var IncomingPropertyValueMiddleware = class {
|
|
157
|
+
action(context) {
|
|
158
|
+
const incoming = context.incoming?.[CoreHandleType.variableProperty] ?? [];
|
|
159
|
+
const properties = { ...context.data };
|
|
160
|
+
for (const connection of incoming) {
|
|
161
|
+
const overwrite = connection.computed;
|
|
162
|
+
if (overwrite) Object.assign(properties, { [overwrite.property]: overwrite.value });
|
|
228
163
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
edgeFalloff,
|
|
233
|
-
lowerBound,
|
|
234
|
-
upperBound
|
|
235
|
-
]);
|
|
236
|
-
return /* @__PURE__ */ jsx(NodeContainer, {
|
|
237
|
-
id,
|
|
238
|
-
selected,
|
|
239
|
-
data,
|
|
240
|
-
type,
|
|
241
|
-
children: /* @__PURE__ */ jsxs(Stack, { children: [
|
|
242
|
-
/* @__PURE__ */ jsxs(Group, { children: ["Edge Falloff:", /* @__PURE__ */ jsx(NumberInput, {
|
|
243
|
-
size: "xs",
|
|
244
|
-
w: 100,
|
|
245
|
-
value: edgeFalloff,
|
|
246
|
-
onChange: (e) => setEdgeFalloff(Number(e)),
|
|
247
|
-
step: .1
|
|
248
|
-
})] }),
|
|
249
|
-
/* @__PURE__ */ jsxs(Group, { children: ["Lower Bound:", /* @__PURE__ */ jsx(NumberInput, {
|
|
250
|
-
size: "xs",
|
|
251
|
-
w: 100,
|
|
252
|
-
value: lowerBound,
|
|
253
|
-
onChange: (e) => setLowerBound(Number(e)),
|
|
254
|
-
step: .1
|
|
255
|
-
})] }),
|
|
256
|
-
/* @__PURE__ */ jsxs(Group, { children: ["Upper Bound:", /* @__PURE__ */ jsx(NumberInput, {
|
|
257
|
-
size: "xs",
|
|
258
|
-
w: 100,
|
|
259
|
-
value: upperBound,
|
|
260
|
-
onChange: (e) => setUpperBound(Number(e)),
|
|
261
|
-
step: .1
|
|
262
|
-
})] }),
|
|
263
|
-
/* @__PURE__ */ jsx(HandlesIncomingDataStatus, {
|
|
264
|
-
nodeId: id,
|
|
265
|
-
handles: data.handles,
|
|
266
|
-
groupBy: "dataId",
|
|
267
|
-
onDataUpdated,
|
|
268
|
-
type: "target",
|
|
269
|
-
resetComputedData: true
|
|
270
|
-
})
|
|
271
|
-
] })
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
var noise_select_node_default = NoiseSelectNode;
|
|
275
|
-
|
|
276
|
-
//#endregion
|
|
277
|
-
//#region src/abstract/templates.ts
|
|
278
|
-
let NoiseTemplateGroup = /* @__PURE__ */ function(NoiseTemplateGroup$1) {
|
|
279
|
-
NoiseTemplateGroup$1["positions"] = "Positions";
|
|
280
|
-
NoiseTemplateGroup$1["output"] = "Output";
|
|
281
|
-
NoiseTemplateGroup$1["noiseGenerators"] = "Noise Generators";
|
|
282
|
-
NoiseTemplateGroup$1["noiseModifiers"] = "Noise Modifiers";
|
|
283
|
-
NoiseTemplateGroup$1["noiseSelectors"] = "Noise Selectors";
|
|
284
|
-
NoiseTemplateGroup$1["noiseTransformers"] = "Noise Transformers";
|
|
285
|
-
return NoiseTemplateGroup$1;
|
|
286
|
-
}({});
|
|
164
|
+
context.properties = properties;
|
|
165
|
+
}
|
|
166
|
+
};
|
|
287
167
|
|
|
288
168
|
//#endregion
|
|
289
169
|
//#region src/templates/generators/noise-billow-template.ts
|
|
@@ -310,6 +190,15 @@ var NoiseBillowNodeTemplateFactory = class {
|
|
|
310
190
|
connection: "source"
|
|
311
191
|
}]
|
|
312
192
|
};
|
|
193
|
+
pipeline = PipelineFactory.create(new IncomingPropertyValueMiddleware(), {
|
|
194
|
+
action: (context) => {
|
|
195
|
+
const { properties } = context;
|
|
196
|
+
context.computed = { module: new Billow(properties.frequency, properties.lacunarity, properties.octaves, properties.persistence, properties.seed) };
|
|
197
|
+
},
|
|
198
|
+
cleanup: (context) => {
|
|
199
|
+
context.computed = null;
|
|
200
|
+
}
|
|
201
|
+
});
|
|
313
202
|
};
|
|
314
203
|
|
|
315
204
|
//#endregion
|
|
@@ -325,6 +214,14 @@ var NoiseCheckerboardNodeTemplateFactory = class {
|
|
|
325
214
|
connection: "source"
|
|
326
215
|
}]
|
|
327
216
|
};
|
|
217
|
+
pipeline = PipelineFactory.create({
|
|
218
|
+
action: (context) => {
|
|
219
|
+
context.computed = { module: new Checkerboard() };
|
|
220
|
+
},
|
|
221
|
+
cleanup: (context) => {
|
|
222
|
+
context.computed = null;
|
|
223
|
+
}
|
|
224
|
+
});
|
|
328
225
|
};
|
|
329
226
|
|
|
330
227
|
//#endregion
|
|
@@ -345,6 +242,17 @@ var NoiseConstNodeTemplateFactory = class {
|
|
|
345
242
|
connection: "source"
|
|
346
243
|
}]
|
|
347
244
|
};
|
|
245
|
+
pipeline = PipelineFactory.create({
|
|
246
|
+
shouldRun(context) {
|
|
247
|
+
return context.data.noise !== void 0 && context.data.noise !== null;
|
|
248
|
+
},
|
|
249
|
+
action(context) {
|
|
250
|
+
context.computed = { module: new Const(context.data.noise) };
|
|
251
|
+
},
|
|
252
|
+
cleanup(context) {
|
|
253
|
+
context.computed = null;
|
|
254
|
+
}
|
|
255
|
+
});
|
|
348
256
|
};
|
|
349
257
|
|
|
350
258
|
//#endregion
|
|
@@ -367,6 +275,15 @@ var NoiseCylindersNodeTemplateFactory = class {
|
|
|
367
275
|
connection: "source"
|
|
368
276
|
}]
|
|
369
277
|
};
|
|
278
|
+
pipeline = PipelineFactory.create(new IncomingPropertyValueMiddleware(), {
|
|
279
|
+
action: (context) => {
|
|
280
|
+
const { properties } = context;
|
|
281
|
+
context.computed = { module: new Cylinders(properties.frequency) };
|
|
282
|
+
},
|
|
283
|
+
cleanup: (context) => {
|
|
284
|
+
context.computed = null;
|
|
285
|
+
}
|
|
286
|
+
});
|
|
370
287
|
};
|
|
371
288
|
|
|
372
289
|
//#endregion
|
|
@@ -393,6 +310,15 @@ var NoisePerlinNodeTemplateFactory = class {
|
|
|
393
310
|
connection: "source"
|
|
394
311
|
}]
|
|
395
312
|
};
|
|
313
|
+
pipeline = PipelineFactory.create(new IncomingPropertyValueMiddleware(), {
|
|
314
|
+
action: (context) => {
|
|
315
|
+
const { properties } = context;
|
|
316
|
+
context.computed = { module: new Perlin(properties.frequency, properties.lacunarity, properties.octaves, properties.persistence, properties.seed) };
|
|
317
|
+
},
|
|
318
|
+
cleanup: (context) => {
|
|
319
|
+
context.computed = null;
|
|
320
|
+
}
|
|
321
|
+
});
|
|
396
322
|
};
|
|
397
323
|
|
|
398
324
|
//#endregion
|
|
@@ -420,6 +346,15 @@ var NoiseRidgedMultiNodeTemplateFactory = class {
|
|
|
420
346
|
connection: "source"
|
|
421
347
|
}]
|
|
422
348
|
};
|
|
349
|
+
pipeline = PipelineFactory.create(new IncomingPropertyValueMiddleware(), {
|
|
350
|
+
action: (context) => {
|
|
351
|
+
const { properties } = context;
|
|
352
|
+
context.computed = { module: new RidgedMulti(properties.frequency, properties.lacunarity, properties.octaves, properties.offset, properties.gain, properties.seed) };
|
|
353
|
+
},
|
|
354
|
+
cleanup: (context) => {
|
|
355
|
+
context.computed = null;
|
|
356
|
+
}
|
|
357
|
+
});
|
|
423
358
|
};
|
|
424
359
|
|
|
425
360
|
//#endregion
|
|
@@ -442,6 +377,15 @@ var NoiseSpheresNodeTemplateFactory = class {
|
|
|
442
377
|
connection: "source"
|
|
443
378
|
}]
|
|
444
379
|
};
|
|
380
|
+
pipeline = PipelineFactory.create(new IncomingPropertyValueMiddleware(), {
|
|
381
|
+
action: (context) => {
|
|
382
|
+
const { properties } = context;
|
|
383
|
+
context.computed = { module: new Spheres(properties.frequency) };
|
|
384
|
+
},
|
|
385
|
+
cleanup: (context) => {
|
|
386
|
+
context.computed = null;
|
|
387
|
+
}
|
|
388
|
+
});
|
|
445
389
|
};
|
|
446
390
|
|
|
447
391
|
//#endregion
|
|
@@ -467,6 +411,15 @@ var NoiseVoronoiNodeTemplateFactory = class {
|
|
|
467
411
|
connection: "source"
|
|
468
412
|
}]
|
|
469
413
|
};
|
|
414
|
+
pipeline = PipelineFactory.create(new IncomingPropertyValueMiddleware(), {
|
|
415
|
+
action: (context) => {
|
|
416
|
+
const { properties } = context;
|
|
417
|
+
context.computed = { module: new Voronoi(properties.frequency, properties.displacement, properties.distance, properties.seed) };
|
|
418
|
+
},
|
|
419
|
+
cleanup: (context) => {
|
|
420
|
+
context.computed = null;
|
|
421
|
+
}
|
|
422
|
+
});
|
|
470
423
|
};
|
|
471
424
|
|
|
472
425
|
//#endregion
|
|
@@ -489,6 +442,18 @@ var PositionConstNodeTemplateFactory = class {
|
|
|
489
442
|
connection: "source"
|
|
490
443
|
}]
|
|
491
444
|
};
|
|
445
|
+
pipeline = PipelineFactory.create({
|
|
446
|
+
shouldRun(context) {
|
|
447
|
+
return context.data.position !== void 0 && context.data.position !== null;
|
|
448
|
+
},
|
|
449
|
+
action(context) {
|
|
450
|
+
const { data } = context;
|
|
451
|
+
context.computed = { positions: [data.position] };
|
|
452
|
+
},
|
|
453
|
+
cleanup(context) {
|
|
454
|
+
context.computed = null;
|
|
455
|
+
}
|
|
456
|
+
});
|
|
492
457
|
};
|
|
493
458
|
|
|
494
459
|
//#endregion
|
|
@@ -512,6 +477,26 @@ var PositionGridNodeTemplateFactory = class {
|
|
|
512
477
|
connection: "source"
|
|
513
478
|
}]
|
|
514
479
|
};
|
|
480
|
+
pipeline = PipelineFactory.create({
|
|
481
|
+
shouldRun(context) {
|
|
482
|
+
const { center, radius } = context.data;
|
|
483
|
+
return center !== void 0 && radius !== void 0;
|
|
484
|
+
},
|
|
485
|
+
action(context) {
|
|
486
|
+
const { data } = context;
|
|
487
|
+
const { center, radius } = data;
|
|
488
|
+
const positions = [];
|
|
489
|
+
for (let i = -radius; i < radius; i++) for (let j = -radius; j < radius; j++) positions.push({
|
|
490
|
+
x: center.x + i,
|
|
491
|
+
y: center.y + j,
|
|
492
|
+
z: center.z
|
|
493
|
+
});
|
|
494
|
+
context.computed = { positions };
|
|
495
|
+
},
|
|
496
|
+
cleanup(context) {
|
|
497
|
+
context.computed = null;
|
|
498
|
+
}
|
|
499
|
+
});
|
|
515
500
|
};
|
|
516
501
|
|
|
517
502
|
//#endregion
|
|
@@ -545,6 +530,17 @@ var ModuleGroupNodeTemplateFactory = class {
|
|
|
545
530
|
connection: "source"
|
|
546
531
|
}]
|
|
547
532
|
};
|
|
533
|
+
pipeline = PipelineFactory.create({
|
|
534
|
+
shouldRun(context) {
|
|
535
|
+
return !!context.incoming[NoiseHandleType.module];
|
|
536
|
+
},
|
|
537
|
+
action: (context) => {
|
|
538
|
+
context.computed = { module: context.incoming[NoiseHandleType.module].computed?.module };
|
|
539
|
+
},
|
|
540
|
+
cleanup: (context) => {
|
|
541
|
+
context.computed = null;
|
|
542
|
+
}
|
|
543
|
+
});
|
|
548
544
|
};
|
|
549
545
|
|
|
550
546
|
//#endregion
|
|
@@ -565,6 +561,19 @@ var NoiseAbsNodeTemplateFactory = class {
|
|
|
565
561
|
connection: "source"
|
|
566
562
|
}]
|
|
567
563
|
};
|
|
564
|
+
pipeline = PipelineFactory.create({
|
|
565
|
+
shouldRun(context) {
|
|
566
|
+
return !!context.incoming[NoiseHandleType.module];
|
|
567
|
+
},
|
|
568
|
+
action(context) {
|
|
569
|
+
const module = context.incoming[NoiseHandleType.module].computed?.module;
|
|
570
|
+
if (module) if (context.computed?.module) context.computed.module.sourceModule = module;
|
|
571
|
+
else context.computed = { module: new Abs(module) };
|
|
572
|
+
},
|
|
573
|
+
cleanup(context) {
|
|
574
|
+
context.computed = null;
|
|
575
|
+
}
|
|
576
|
+
});
|
|
568
577
|
};
|
|
569
578
|
|
|
570
579
|
//#endregion
|
|
@@ -589,6 +598,43 @@ var NoiseClampNodeTemplateFactory = class {
|
|
|
589
598
|
connection: "source"
|
|
590
599
|
}]
|
|
591
600
|
};
|
|
601
|
+
pipeline = PipelineFactory.create({
|
|
602
|
+
shouldRun(context) {
|
|
603
|
+
return !!context.incoming[NoiseHandleType.module];
|
|
604
|
+
},
|
|
605
|
+
action(context) {
|
|
606
|
+
const module = context.incoming[NoiseHandleType.module].computed?.module;
|
|
607
|
+
if (module) {
|
|
608
|
+
const clampModule = context.computed?.module;
|
|
609
|
+
if (clampModule) {
|
|
610
|
+
clampModule.sourceModule = module;
|
|
611
|
+
clampModule.lowerBound = context.data.lowerBound;
|
|
612
|
+
clampModule.upperBound = context.data.upperBound;
|
|
613
|
+
} else context.computed = { module: new Clamp(module, context.data.lowerBound, context.data.upperBound) };
|
|
614
|
+
}
|
|
615
|
+
},
|
|
616
|
+
cleanup(context) {
|
|
617
|
+
context.computed = null;
|
|
618
|
+
}
|
|
619
|
+
});
|
|
620
|
+
};
|
|
621
|
+
|
|
622
|
+
//#endregion
|
|
623
|
+
//#region src/abstract/operations.ts
|
|
624
|
+
let NoiseCombineType = /* @__PURE__ */ function(NoiseCombineType) {
|
|
625
|
+
NoiseCombineType["add"] = "add";
|
|
626
|
+
NoiseCombineType["max"] = "max";
|
|
627
|
+
NoiseCombineType["min"] = "min";
|
|
628
|
+
NoiseCombineType["multiply"] = "multiply";
|
|
629
|
+
NoiseCombineType["power"] = "power";
|
|
630
|
+
return NoiseCombineType;
|
|
631
|
+
}({});
|
|
632
|
+
const noiseCombineModuleMap = {
|
|
633
|
+
[NoiseCombineType.add]: Add,
|
|
634
|
+
[NoiseCombineType.max]: Max,
|
|
635
|
+
[NoiseCombineType.min]: Min,
|
|
636
|
+
[NoiseCombineType.multiply]: Multiply,
|
|
637
|
+
[NoiseCombineType.power]: Power
|
|
592
638
|
};
|
|
593
639
|
|
|
594
640
|
//#endregion
|
|
@@ -605,6 +651,7 @@ var NoiseCombineNodeTemplateFactory = class {
|
|
|
605
651
|
position: Position.Left,
|
|
606
652
|
dataType: NoiseHandleType.module,
|
|
607
653
|
connection: "target",
|
|
654
|
+
minConnections: 2,
|
|
608
655
|
maxConnections: 2
|
|
609
656
|
}, {
|
|
610
657
|
position: Position.Right,
|
|
@@ -612,6 +659,19 @@ var NoiseCombineNodeTemplateFactory = class {
|
|
|
612
659
|
connection: "source"
|
|
613
660
|
}]
|
|
614
661
|
};
|
|
662
|
+
pipeline = PipelineFactory.create({
|
|
663
|
+
shouldRun(context) {
|
|
664
|
+
return context.incoming[NoiseHandleType.module]?.length === 2;
|
|
665
|
+
},
|
|
666
|
+
action(context) {
|
|
667
|
+
const incoming = context.incoming[NoiseHandleType.module];
|
|
668
|
+
const ModuleFactory = noiseCombineModuleMap[context.data.operation];
|
|
669
|
+
context.computed = { module: new ModuleFactory(incoming[0].computed?.module, incoming[1].computed?.module) };
|
|
670
|
+
},
|
|
671
|
+
cleanup(context) {
|
|
672
|
+
context.computed = null;
|
|
673
|
+
}
|
|
674
|
+
});
|
|
615
675
|
};
|
|
616
676
|
|
|
617
677
|
//#endregion
|
|
@@ -635,6 +695,18 @@ var NoiseCurveNodeTemplateFactory = class {
|
|
|
635
695
|
connection: "source"
|
|
636
696
|
}]
|
|
637
697
|
};
|
|
698
|
+
pipeline = PipelineFactory.create({
|
|
699
|
+
shouldRun(context) {
|
|
700
|
+
return !!context.incoming[NoiseHandleType.module];
|
|
701
|
+
},
|
|
702
|
+
action(context) {
|
|
703
|
+
const module = context.incoming[NoiseHandleType.module].computed?.module;
|
|
704
|
+
if (module) context.computed = { module: new Curve(module, context.data.points.map((p) => new Tuple(p.input, p.output))) };
|
|
705
|
+
},
|
|
706
|
+
cleanup(context) {
|
|
707
|
+
context.computed = null;
|
|
708
|
+
}
|
|
709
|
+
});
|
|
638
710
|
};
|
|
639
711
|
|
|
640
712
|
//#endregion
|
|
@@ -658,6 +730,19 @@ var NoiseExponentNodeTemplateFactory = class {
|
|
|
658
730
|
connection: "source"
|
|
659
731
|
}]
|
|
660
732
|
};
|
|
733
|
+
pipeline = PipelineFactory.create({
|
|
734
|
+
shouldRun(context) {
|
|
735
|
+
return !!context.incoming[NoiseHandleType.module];
|
|
736
|
+
},
|
|
737
|
+
action(context) {
|
|
738
|
+
const module = context.incoming[NoiseHandleType.module].computed?.module;
|
|
739
|
+
if (context.computed?.module) context.computed.module.exponent = context.data.exponent;
|
|
740
|
+
else if (module) context.computed = { module: new Exponent(module, context.data.exponent) };
|
|
741
|
+
},
|
|
742
|
+
cleanup(context) {
|
|
743
|
+
context.computed = null;
|
|
744
|
+
}
|
|
745
|
+
});
|
|
661
746
|
};
|
|
662
747
|
|
|
663
748
|
//#endregion
|
|
@@ -678,6 +763,19 @@ var NoiseInvertNodeTemplateFactory = class {
|
|
|
678
763
|
connection: "source"
|
|
679
764
|
}]
|
|
680
765
|
};
|
|
766
|
+
pipeline = PipelineFactory.create({
|
|
767
|
+
shouldRun(context) {
|
|
768
|
+
return !!context.incoming[NoiseHandleType.module];
|
|
769
|
+
},
|
|
770
|
+
action(context) {
|
|
771
|
+
const module = context.incoming[NoiseHandleType.module].computed?.module;
|
|
772
|
+
if (context.computed?.module) context.computed.module.sourceModule = module;
|
|
773
|
+
else if (module) context.computed = { module: new Invert(module) };
|
|
774
|
+
},
|
|
775
|
+
cleanup(context) {
|
|
776
|
+
context.computed = null;
|
|
777
|
+
}
|
|
778
|
+
});
|
|
681
779
|
};
|
|
682
780
|
|
|
683
781
|
//#endregion
|
|
@@ -703,6 +801,18 @@ var NoiseNormalizeNodeTemplateFactory = class {
|
|
|
703
801
|
connection: "source"
|
|
704
802
|
}]
|
|
705
803
|
};
|
|
804
|
+
pipeline = PipelineFactory.create({
|
|
805
|
+
shouldRun(context) {
|
|
806
|
+
return !!context.incoming[NoiseHandleType.module];
|
|
807
|
+
},
|
|
808
|
+
action(context) {
|
|
809
|
+
const module = context.incoming[NoiseHandleType.module].computed?.module;
|
|
810
|
+
if (module) context.computed = { module: new NormalizeNoiseModule(module, context.data.intervalStart, context.data.intervalEnd) };
|
|
811
|
+
},
|
|
812
|
+
cleanup(context) {
|
|
813
|
+
context.computed = null;
|
|
814
|
+
}
|
|
815
|
+
});
|
|
706
816
|
};
|
|
707
817
|
|
|
708
818
|
//#endregion
|
|
@@ -727,6 +837,22 @@ var NoiseScaleBiasNodeTemplateFactory = class {
|
|
|
727
837
|
connection: "source"
|
|
728
838
|
}]
|
|
729
839
|
};
|
|
840
|
+
pipeline = PipelineFactory.create({
|
|
841
|
+
shouldRun(context) {
|
|
842
|
+
return !!context.incoming[NoiseHandleType.module];
|
|
843
|
+
},
|
|
844
|
+
action(context) {
|
|
845
|
+
const module = context.incoming[NoiseHandleType.module].computed?.module;
|
|
846
|
+
if (context.computed?.module) {
|
|
847
|
+
context.computed.module.sourceModule = module;
|
|
848
|
+
context.computed.module.scale = context.data.scale;
|
|
849
|
+
context.computed.module.bias = context.data.bias;
|
|
850
|
+
} else if (module) context.computed = { module: new ScaleBias(module, context.data.scale, context.data.bias) };
|
|
851
|
+
},
|
|
852
|
+
cleanup(context) {
|
|
853
|
+
context.computed = null;
|
|
854
|
+
}
|
|
855
|
+
});
|
|
730
856
|
};
|
|
731
857
|
|
|
732
858
|
//#endregion
|
|
@@ -750,6 +876,18 @@ var NoiseTerraceNodeTemplateFactory = class {
|
|
|
750
876
|
connection: "source"
|
|
751
877
|
}]
|
|
752
878
|
};
|
|
879
|
+
pipeline = PipelineFactory.create({
|
|
880
|
+
shouldRun(context) {
|
|
881
|
+
return !!context.incoming[NoiseHandleType.module];
|
|
882
|
+
},
|
|
883
|
+
action(context) {
|
|
884
|
+
const module = context.incoming[NoiseHandleType.module].computed?.module;
|
|
885
|
+
if (module) context.computed = { module: new Terrace(module, context.data.points) };
|
|
886
|
+
},
|
|
887
|
+
cleanup(context) {
|
|
888
|
+
context.computed = null;
|
|
889
|
+
}
|
|
890
|
+
});
|
|
753
891
|
};
|
|
754
892
|
|
|
755
893
|
//#endregion
|
|
@@ -793,11 +931,35 @@ var NoiseOutputNodeTemplateFactory = class {
|
|
|
793
931
|
}
|
|
794
932
|
]
|
|
795
933
|
};
|
|
934
|
+
pipeline = PipelineFactory.create({
|
|
935
|
+
action: (context) => {
|
|
936
|
+
const incomingPositions = context.incoming[NoiseHandleType.position];
|
|
937
|
+
const incomingModule = context.incoming[NoiseHandleType.module];
|
|
938
|
+
if (incomingPositions?.length && incomingModule?.computed?.module) {
|
|
939
|
+
const { module } = incomingModule.computed;
|
|
940
|
+
const noise = [];
|
|
941
|
+
for (const input of incomingPositions) {
|
|
942
|
+
const { positions } = input.computed;
|
|
943
|
+
for (const position of positions) {
|
|
944
|
+
const value = module.getValue(position.x, position.y, position.z);
|
|
945
|
+
noise.push({
|
|
946
|
+
position,
|
|
947
|
+
value
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
context.computed = { noise };
|
|
952
|
+
}
|
|
953
|
+
},
|
|
954
|
+
cleanup: (context) => {
|
|
955
|
+
context.computed = null;
|
|
956
|
+
}
|
|
957
|
+
});
|
|
796
958
|
};
|
|
797
959
|
|
|
798
960
|
//#endregion
|
|
799
|
-
//#region src/templates/output/noise-
|
|
800
|
-
var
|
|
961
|
+
//#region src/templates/output/noise-texture-data-template.ts
|
|
962
|
+
var NoiseTextureDataTemplateFactory = class {
|
|
801
963
|
template = {
|
|
802
964
|
type: NoiseNodeType.textureData,
|
|
803
965
|
group: NoiseTemplateGroup.output,
|
|
@@ -809,10 +971,35 @@ var NoiseRawTextureTemplateFactory = class {
|
|
|
809
971
|
maxConnections: 1
|
|
810
972
|
}, {
|
|
811
973
|
position: Position.Right,
|
|
812
|
-
dataType: NoiseHandleType.
|
|
974
|
+
dataType: NoiseHandleType.textureData,
|
|
813
975
|
connection: "source"
|
|
814
976
|
}]
|
|
815
977
|
};
|
|
978
|
+
pipeline = PipelineFactory.create({
|
|
979
|
+
shouldRun: (context) => {
|
|
980
|
+
return !!context.incoming[NoiseHandleType.noise]?.computed?.noise.length;
|
|
981
|
+
},
|
|
982
|
+
action: (context) => {
|
|
983
|
+
const noise = context.incoming[NoiseHandleType.noise]?.computed?.noise;
|
|
984
|
+
const size = Math.ceil(Math.sqrt(noise.length));
|
|
985
|
+
const colors = noise.flatMap((n) => [
|
|
986
|
+
n.value * 255,
|
|
987
|
+
n.value * 255,
|
|
988
|
+
n.value * 255,
|
|
989
|
+
255
|
|
990
|
+
]);
|
|
991
|
+
const dataArray = new Uint8Array(size * size * 4);
|
|
992
|
+
dataArray.set(colors);
|
|
993
|
+
context.computed = {
|
|
994
|
+
textureData: dataArray,
|
|
995
|
+
textureResolutionX: size,
|
|
996
|
+
textureResolutionY: size
|
|
997
|
+
};
|
|
998
|
+
},
|
|
999
|
+
cleanup: (context) => {
|
|
1000
|
+
context.computed = null;
|
|
1001
|
+
}
|
|
1002
|
+
});
|
|
816
1003
|
};
|
|
817
1004
|
|
|
818
1005
|
//#endregion
|
|
@@ -844,6 +1031,7 @@ var NoiseBlendNodeTemplateFactory = class {
|
|
|
844
1031
|
connection: "target",
|
|
845
1032
|
label: "Source Modules",
|
|
846
1033
|
dataId: NoiseSourceControlHandle.source,
|
|
1034
|
+
groupBy: "dataId",
|
|
847
1035
|
maxConnections: 2,
|
|
848
1036
|
minConnections: 2
|
|
849
1037
|
},
|
|
@@ -851,6 +1039,7 @@ var NoiseBlendNodeTemplateFactory = class {
|
|
|
851
1039
|
position: Position.Left,
|
|
852
1040
|
dataType: NoiseHandleType.module,
|
|
853
1041
|
dataId: NoiseSourceControlHandle.control,
|
|
1042
|
+
groupBy: "dataId",
|
|
854
1043
|
connection: "target",
|
|
855
1044
|
label: "Control Module",
|
|
856
1045
|
maxConnections: 1
|
|
@@ -863,6 +1052,23 @@ var NoiseBlendNodeTemplateFactory = class {
|
|
|
863
1052
|
}
|
|
864
1053
|
]
|
|
865
1054
|
};
|
|
1055
|
+
pipeline = PipelineFactory.create({
|
|
1056
|
+
shouldRun: (context) => {
|
|
1057
|
+
return context.incoming[NoiseSourceControlHandle.source]?.length === 2 && !!context.incoming[NoiseSourceControlHandle.control];
|
|
1058
|
+
},
|
|
1059
|
+
action: (context) => {
|
|
1060
|
+
const incomingSources = context.incoming[NoiseSourceControlHandle.source];
|
|
1061
|
+
const incomingControl = context.incoming[NoiseSourceControlHandle.control];
|
|
1062
|
+
if (context.computed?.module) {
|
|
1063
|
+
context.computed.module.controlModule = incomingControl.computed.module;
|
|
1064
|
+
context.computed.module.sourceModuleA = incomingSources[0].computed.module;
|
|
1065
|
+
context.computed.module.sourceModuleB = incomingSources[1].computed.module;
|
|
1066
|
+
} else context.computed = { module: new Blend(incomingSources[0].computed.module, incomingSources[1].computed.module, incomingControl.computed.module) };
|
|
1067
|
+
},
|
|
1068
|
+
cleanup: (context) => {
|
|
1069
|
+
context.computed = null;
|
|
1070
|
+
}
|
|
1071
|
+
});
|
|
866
1072
|
};
|
|
867
1073
|
|
|
868
1074
|
//#endregion
|
|
@@ -882,6 +1088,7 @@ var NoiseSelectNodeTemplateFactory = class {
|
|
|
882
1088
|
position: Position.Left,
|
|
883
1089
|
dataType: NoiseHandleType.module,
|
|
884
1090
|
dataId: NoiseSourceControlHandle.source,
|
|
1091
|
+
groupBy: "dataId",
|
|
885
1092
|
connection: "target",
|
|
886
1093
|
label: "Source Modules",
|
|
887
1094
|
maxConnections: 2,
|
|
@@ -891,6 +1098,7 @@ var NoiseSelectNodeTemplateFactory = class {
|
|
|
891
1098
|
position: Position.Left,
|
|
892
1099
|
dataType: NoiseHandleType.module,
|
|
893
1100
|
dataId: NoiseSourceControlHandle.control,
|
|
1101
|
+
groupBy: "dataId",
|
|
894
1102
|
connection: "target",
|
|
895
1103
|
label: "Control Module",
|
|
896
1104
|
maxConnections: 1
|
|
@@ -903,6 +1111,26 @@ var NoiseSelectNodeTemplateFactory = class {
|
|
|
903
1111
|
}
|
|
904
1112
|
]
|
|
905
1113
|
};
|
|
1114
|
+
pipeline = PipelineFactory.create({
|
|
1115
|
+
shouldRun: (context) => {
|
|
1116
|
+
return context.incoming[NoiseSourceControlHandle.source]?.length === 2 && !!context.incoming[NoiseSourceControlHandle.control];
|
|
1117
|
+
},
|
|
1118
|
+
action: (context) => {
|
|
1119
|
+
const incomingSources = context.incoming[NoiseSourceControlHandle.source];
|
|
1120
|
+
const incomingControl = context.incoming[NoiseSourceControlHandle.control];
|
|
1121
|
+
if (context.computed?.module) {
|
|
1122
|
+
context.computed.module.controlModule = incomingControl.computed.module;
|
|
1123
|
+
context.computed.module.sourceModuleA = incomingSources[0].computed.module;
|
|
1124
|
+
context.computed.module.sourceModuleB = incomingSources[1].computed.module;
|
|
1125
|
+
context.computed.module.edgeFalloff = context.data.edgeFalloff;
|
|
1126
|
+
context.computed.module.lowerBound = context.data.lowerBound;
|
|
1127
|
+
context.computed.module.upperBound = context.data.upperBound;
|
|
1128
|
+
} else context.computed = { module: new Select(incomingSources[0].computed.module, incomingSources[1].computed.module, incomingControl.computed.module, context.data.edgeFalloff, context.data.lowerBound, context.data.upperBound) };
|
|
1129
|
+
},
|
|
1130
|
+
cleanup: (context) => {
|
|
1131
|
+
context.computed = null;
|
|
1132
|
+
}
|
|
1133
|
+
});
|
|
906
1134
|
};
|
|
907
1135
|
|
|
908
1136
|
//#endregion
|
|
@@ -919,6 +1147,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
919
1147
|
label: "Source Module",
|
|
920
1148
|
dataType: NoiseHandleType.module,
|
|
921
1149
|
dataId: DisplacementHandle.sourceModule,
|
|
1150
|
+
groupBy: "dataId",
|
|
922
1151
|
maxConnections: 1
|
|
923
1152
|
},
|
|
924
1153
|
{
|
|
@@ -927,6 +1156,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
927
1156
|
label: "X Module",
|
|
928
1157
|
dataType: NoiseHandleType.module,
|
|
929
1158
|
dataId: DisplacementHandle.xModule,
|
|
1159
|
+
groupBy: "dataId",
|
|
930
1160
|
maxConnections: 1
|
|
931
1161
|
},
|
|
932
1162
|
{
|
|
@@ -935,6 +1165,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
935
1165
|
label: "Y Module",
|
|
936
1166
|
dataType: NoiseHandleType.module,
|
|
937
1167
|
dataId: DisplacementHandle.yModule,
|
|
1168
|
+
groupBy: "dataId",
|
|
938
1169
|
maxConnections: 1
|
|
939
1170
|
},
|
|
940
1171
|
{
|
|
@@ -943,6 +1174,7 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
943
1174
|
label: "Z Module",
|
|
944
1175
|
dataType: NoiseHandleType.module,
|
|
945
1176
|
dataId: DisplacementHandle.zModule,
|
|
1177
|
+
groupBy: "dataId",
|
|
946
1178
|
maxConnections: 1
|
|
947
1179
|
},
|
|
948
1180
|
{
|
|
@@ -953,6 +1185,29 @@ var NoiseDisplaceNodeTemplateFactory = class {
|
|
|
953
1185
|
}
|
|
954
1186
|
]
|
|
955
1187
|
};
|
|
1188
|
+
pipeline = PipelineFactory.create({
|
|
1189
|
+
shouldRun: (context) => {
|
|
1190
|
+
return !!context.incoming[DisplacementHandle.sourceModule]?.computed?.module && !!context.incoming[DisplacementHandle.xModule]?.computed?.module && !!context.incoming[DisplacementHandle.yModule]?.computed?.module && !!context.incoming[DisplacementHandle.zModule]?.computed?.module;
|
|
1191
|
+
},
|
|
1192
|
+
action: (context) => {
|
|
1193
|
+
const sourceModule = context.incoming[DisplacementHandle.sourceModule].computed.module;
|
|
1194
|
+
const xModule = context.incoming[DisplacementHandle.xModule].computed.module;
|
|
1195
|
+
const yModule = context.incoming[DisplacementHandle.yModule].computed.module;
|
|
1196
|
+
const zModule = context.incoming[DisplacementHandle.zModule].computed.module;
|
|
1197
|
+
const hasModules = !!sourceModule && !!xModule && !!yModule && !!zModule;
|
|
1198
|
+
if (context.computed?.module) {
|
|
1199
|
+
if (hasModules) {
|
|
1200
|
+
context.computed.module.sourceModule = sourceModule;
|
|
1201
|
+
context.computed.module.xModule = xModule;
|
|
1202
|
+
context.computed.module.yModule = yModule;
|
|
1203
|
+
context.computed.module.zModule = zModule;
|
|
1204
|
+
}
|
|
1205
|
+
} else context.computed = { module: new Displace(sourceModule, xModule, yModule, zModule) };
|
|
1206
|
+
},
|
|
1207
|
+
cleanup: (context) => {
|
|
1208
|
+
context.computed = null;
|
|
1209
|
+
}
|
|
1210
|
+
});
|
|
956
1211
|
};
|
|
957
1212
|
|
|
958
1213
|
//#endregion
|
|
@@ -979,6 +1234,24 @@ var NoiseRotatePointNodeTemplateFactory = class {
|
|
|
979
1234
|
connection: "source"
|
|
980
1235
|
}]
|
|
981
1236
|
};
|
|
1237
|
+
pipeline = PipelineFactory.create({
|
|
1238
|
+
shouldRun: (context) => {
|
|
1239
|
+
return !!context.incoming[NoiseHandleType.module]?.computed?.module;
|
|
1240
|
+
},
|
|
1241
|
+
action: (context) => {
|
|
1242
|
+
const sourceModule = context.incoming[NoiseHandleType.module].computed.module;
|
|
1243
|
+
const { xAngle, yAngle, zAngle } = context.data;
|
|
1244
|
+
if (context.computed?.module) {
|
|
1245
|
+
context.computed.module.sourceModule = sourceModule;
|
|
1246
|
+
context.computed.module.xAngle = xAngle;
|
|
1247
|
+
context.computed.module.yAngle = yAngle;
|
|
1248
|
+
context.computed.module.zAngle = zAngle;
|
|
1249
|
+
} else context.computed = { module: new RotatePoint(sourceModule, xAngle, yAngle, zAngle) };
|
|
1250
|
+
},
|
|
1251
|
+
cleanup: (context) => {
|
|
1252
|
+
context.computed = null;
|
|
1253
|
+
}
|
|
1254
|
+
});
|
|
982
1255
|
};
|
|
983
1256
|
|
|
984
1257
|
//#endregion
|
|
@@ -1005,6 +1278,24 @@ var NoiseScalePointNodeTemplateFactory = class {
|
|
|
1005
1278
|
connection: "source"
|
|
1006
1279
|
}]
|
|
1007
1280
|
};
|
|
1281
|
+
pipeline = PipelineFactory.create({
|
|
1282
|
+
shouldRun: (context) => {
|
|
1283
|
+
return !!context.incoming[NoiseHandleType.module]?.computed?.module;
|
|
1284
|
+
},
|
|
1285
|
+
action: (context) => {
|
|
1286
|
+
const sourceModule = context.incoming[NoiseHandleType.module].computed.module;
|
|
1287
|
+
const { xScale, yScale, zScale } = context.data;
|
|
1288
|
+
if (context.computed?.module) {
|
|
1289
|
+
context.computed.module.sourceModule = sourceModule;
|
|
1290
|
+
context.computed.module.xScale = xScale;
|
|
1291
|
+
context.computed.module.yScale = yScale;
|
|
1292
|
+
context.computed.module.zScale = zScale;
|
|
1293
|
+
} else context.computed = { module: new ScalePoint(sourceModule, xScale, yScale, zScale) };
|
|
1294
|
+
},
|
|
1295
|
+
cleanup: (context) => {
|
|
1296
|
+
context.computed = null;
|
|
1297
|
+
}
|
|
1298
|
+
});
|
|
1008
1299
|
};
|
|
1009
1300
|
|
|
1010
1301
|
//#endregion
|
|
@@ -1031,6 +1322,24 @@ var NoiseTranslatePointNodeTemplateFactory = class {
|
|
|
1031
1322
|
connection: "source"
|
|
1032
1323
|
}]
|
|
1033
1324
|
};
|
|
1325
|
+
pipeline = PipelineFactory.create({
|
|
1326
|
+
shouldRun: (context) => {
|
|
1327
|
+
return !!context.incoming[NoiseHandleType.module]?.computed?.module;
|
|
1328
|
+
},
|
|
1329
|
+
action: (context) => {
|
|
1330
|
+
const sourceModule = context.incoming[NoiseHandleType.module].computed.module;
|
|
1331
|
+
const { translateX, translateY, translateZ } = context.data;
|
|
1332
|
+
if (context.computed?.module) {
|
|
1333
|
+
context.computed.module.sourceModule = sourceModule;
|
|
1334
|
+
context.computed.module.translateX = translateX;
|
|
1335
|
+
context.computed.module.translateY = translateY;
|
|
1336
|
+
context.computed.module.translateZ = translateZ;
|
|
1337
|
+
} else context.computed = { module: new TranslatePoint(sourceModule, translateX, translateY, translateZ) };
|
|
1338
|
+
},
|
|
1339
|
+
cleanup: (context) => {
|
|
1340
|
+
context.computed = null;
|
|
1341
|
+
}
|
|
1342
|
+
});
|
|
1034
1343
|
};
|
|
1035
1344
|
|
|
1036
1345
|
//#endregion
|
|
@@ -1067,50 +1376,69 @@ var NoiseTurbulenceNodeTemplateFactory = class {
|
|
|
1067
1376
|
}
|
|
1068
1377
|
]
|
|
1069
1378
|
};
|
|
1379
|
+
pipeline = PipelineFactory.create(new IncomingPropertyValueMiddleware(), {
|
|
1380
|
+
shouldRun: (context) => {
|
|
1381
|
+
return !!context.incoming[NoiseHandleType.module]?.computed?.module;
|
|
1382
|
+
},
|
|
1383
|
+
action: (context) => {
|
|
1384
|
+
const { properties } = context;
|
|
1385
|
+
const incoming = context.incoming[NoiseHandleType.module].computed.module;
|
|
1386
|
+
if (context.computed?.module) {
|
|
1387
|
+
context.computed.module.sourceModule = incoming;
|
|
1388
|
+
context.computed.module.frequency = properties.frequency;
|
|
1389
|
+
context.computed.module.power = properties.power;
|
|
1390
|
+
context.computed.module.roughness = properties.roughness;
|
|
1391
|
+
context.computed.module.seed = properties.seed;
|
|
1392
|
+
} else context.computed = { module: new Turbulence(incoming, properties.frequency, properties.power, properties.roughness, properties.seed) };
|
|
1393
|
+
},
|
|
1394
|
+
cleanup: (context) => {
|
|
1395
|
+
context.computed = null;
|
|
1396
|
+
}
|
|
1397
|
+
});
|
|
1070
1398
|
};
|
|
1071
1399
|
|
|
1072
1400
|
//#endregion
|
|
1073
1401
|
//#region src/abstract/node-types.ts
|
|
1074
|
-
let NoiseNodeType = /* @__PURE__ */ function(NoiseNodeType
|
|
1075
|
-
NoiseNodeType
|
|
1076
|
-
NoiseNodeType
|
|
1077
|
-
NoiseNodeType
|
|
1078
|
-
NoiseNodeType
|
|
1079
|
-
NoiseNodeType
|
|
1080
|
-
NoiseNodeType
|
|
1081
|
-
NoiseNodeType
|
|
1082
|
-
NoiseNodeType
|
|
1083
|
-
NoiseNodeType
|
|
1084
|
-
NoiseNodeType
|
|
1085
|
-
NoiseNodeType
|
|
1086
|
-
NoiseNodeType
|
|
1087
|
-
NoiseNodeType
|
|
1088
|
-
NoiseNodeType
|
|
1089
|
-
NoiseNodeType
|
|
1090
|
-
NoiseNodeType
|
|
1091
|
-
NoiseNodeType
|
|
1092
|
-
NoiseNodeType
|
|
1093
|
-
NoiseNodeType
|
|
1094
|
-
NoiseNodeType
|
|
1095
|
-
NoiseNodeType
|
|
1096
|
-
NoiseNodeType
|
|
1097
|
-
NoiseNodeType
|
|
1098
|
-
NoiseNodeType
|
|
1099
|
-
NoiseNodeType
|
|
1100
|
-
NoiseNodeType
|
|
1101
|
-
NoiseNodeType
|
|
1102
|
-
NoiseNodeType
|
|
1103
|
-
NoiseNodeType
|
|
1104
|
-
NoiseNodeType
|
|
1105
|
-
NoiseNodeType
|
|
1106
|
-
return NoiseNodeType
|
|
1402
|
+
let NoiseNodeType = /* @__PURE__ */ function(NoiseNodeType) {
|
|
1403
|
+
NoiseNodeType["position"] = "position";
|
|
1404
|
+
NoiseNodeType["grid"] = "grid";
|
|
1405
|
+
NoiseNodeType["textureData"] = "texture-data";
|
|
1406
|
+
NoiseNodeType["groupModule"] = "group-module";
|
|
1407
|
+
NoiseNodeType["positionLogger"] = "position-logger";
|
|
1408
|
+
NoiseNodeType["noiseLogger"] = "noise-logger";
|
|
1409
|
+
NoiseNodeType["noiseOutput"] = "noise-output";
|
|
1410
|
+
NoiseNodeType["noiseConst"] = "noise-constant";
|
|
1411
|
+
NoiseNodeType["noiseBillow"] = "noise-billow";
|
|
1412
|
+
NoiseNodeType["noiseCheckerboard"] = "noise-checkerboard";
|
|
1413
|
+
NoiseNodeType["noiseNormalize"] = "noise-normalize";
|
|
1414
|
+
NoiseNodeType["noiseCylinders"] = "noise-cylinders";
|
|
1415
|
+
NoiseNodeType["noisePerlin"] = "noise-perlin";
|
|
1416
|
+
NoiseNodeType["noiseRidgedMulti"] = "noise-ridged-multi";
|
|
1417
|
+
NoiseNodeType["noiseSpheres"] = "noise-spheres";
|
|
1418
|
+
NoiseNodeType["noiseVoronoi"] = "noise-voronoi";
|
|
1419
|
+
NoiseNodeType["noiseCombine"] = "noise-combiner";
|
|
1420
|
+
NoiseNodeType["noiseClamp"] = "noise-clamp";
|
|
1421
|
+
NoiseNodeType["noiseAbs"] = "noise-abs";
|
|
1422
|
+
NoiseNodeType["noiseCurve"] = "noise-curve";
|
|
1423
|
+
NoiseNodeType["noiseExponent"] = "noise-exponent";
|
|
1424
|
+
NoiseNodeType["noiseInvert"] = "noise-invert";
|
|
1425
|
+
NoiseNodeType["noiseScaleBias"] = "noise-scale-bias";
|
|
1426
|
+
NoiseNodeType["noiseTerrace"] = "noise-terrace";
|
|
1427
|
+
NoiseNodeType["noiseBlend"] = "noise-blend";
|
|
1428
|
+
NoiseNodeType["noiseSelect"] = "noise-select";
|
|
1429
|
+
NoiseNodeType["noiseDisplace"] = "noise-displace";
|
|
1430
|
+
NoiseNodeType["noiseRotatePoint"] = "noise-rotate-point";
|
|
1431
|
+
NoiseNodeType["noiseScalePoint"] = "noise-scale-point";
|
|
1432
|
+
NoiseNodeType["noiseTranslatePoint"] = "noise-translate-point";
|
|
1433
|
+
NoiseNodeType["noiseTurbulence"] = "noise-turbulence";
|
|
1434
|
+
return NoiseNodeType;
|
|
1107
1435
|
}({});
|
|
1108
1436
|
const noiseNodeTypes = {
|
|
1109
1437
|
[NoiseNodeType.groupModule]: module_group_node_default,
|
|
1110
1438
|
[NoiseNodeType.position]: position_const_node_default,
|
|
1111
1439
|
[NoiseNodeType.grid]: position_grid_node_default,
|
|
1112
1440
|
[NoiseNodeType.noiseOutput]: noise_output_node_default,
|
|
1113
|
-
[NoiseNodeType.textureData]:
|
|
1441
|
+
[NoiseNodeType.textureData]: noise_texture_data_node_default,
|
|
1114
1442
|
[NoiseNodeType.noiseLogger]: noise_logger_node_default,
|
|
1115
1443
|
[NoiseNodeType.positionLogger]: positions_logger_node_default,
|
|
1116
1444
|
[NoiseNodeType.noiseConst]: noise_const_node_default,
|
|
@@ -1148,7 +1476,7 @@ const noiseNodeTemplates = {
|
|
|
1148
1476
|
[NoiseNodeType.position]: new PositionConstNodeTemplateFactory(),
|
|
1149
1477
|
[NoiseNodeType.positionLogger]: new PositionLoggerNodeTemplateFactory(),
|
|
1150
1478
|
[NoiseNodeType.grid]: new PositionGridNodeTemplateFactory(),
|
|
1151
|
-
[NoiseNodeType.textureData]: new
|
|
1479
|
+
[NoiseNodeType.textureData]: new NoiseTextureDataTemplateFactory(),
|
|
1152
1480
|
[NoiseNodeType.noiseCylinders]: new NoiseCylindersNodeTemplateFactory(),
|
|
1153
1481
|
[NoiseNodeType.noisePerlin]: new NoisePerlinNodeTemplateFactory(),
|
|
1154
1482
|
[NoiseNodeType.noiseRidgedMulti]: new NoiseRidgedMultiNodeTemplateFactory(),
|
|
@@ -1173,5 +1501,5 @@ const noiseNodeTemplates = {
|
|
|
1173
1501
|
};
|
|
1174
1502
|
|
|
1175
1503
|
//#endregion
|
|
1176
|
-
export {
|
|
1177
|
-
//# sourceMappingURL=abstract-
|
|
1504
|
+
export { NoiseSpheresNodeTemplateFactory as A, noise_output_node_default as B, noiseCombineModuleMap as C, PositionGridNodeTemplateFactory as D, ModuleGroupNodeTemplateFactory as E, NoiseCheckerboardNodeTemplateFactory as F, DisplacementHandle as H, NoiseBillowNodeTemplateFactory as I, NoiseTemplateGroup as L, NoisePerlinNodeTemplateFactory as M, NoiseCylindersNodeTemplateFactory as N, PositionConstNodeTemplateFactory as O, NoiseConstNodeTemplateFactory as P, positions_logger_node_default as R, NoiseCombineType as S, NoiseAbsNodeTemplateFactory as T, NoiseHandleType as U, noise_logger_node_default as V, NoiseSourceControlHandle as W, NoiseNormalizeNodeTemplateFactory as _, NoiseTranslatePointNodeTemplateFactory as a, NoiseCurveNodeTemplateFactory as b, NoiseDisplaceNodeTemplateFactory as c, PositionLoggerNodeTemplateFactory as d, NoiseTextureDataTemplateFactory as f, NoiseScaleBiasNodeTemplateFactory as g, NoiseTerraceNodeTemplateFactory as h, NoiseTurbulenceNodeTemplateFactory as i, NoiseRidgedMultiNodeTemplateFactory as j, NoiseVoronoiNodeTemplateFactory as k, NoiseSelectNodeTemplateFactory as l, NoiseLoggerNodeTemplateFactory as m, noiseNodeTemplates as n, NoiseScalePointNodeTemplateFactory as o, NoiseOutputNodeTemplateFactory as p, noiseNodeTypes as r, NoiseRotatePointNodeTemplateFactory as s, NoiseNodeType as t, NoiseBlendNodeTemplateFactory as u, NoiseInvertNodeTemplateFactory as v, NoiseClampNodeTemplateFactory as w, NoiseCombineNodeTemplateFactory as x, NoiseExponentNodeTemplateFactory as y, noise_texture_data_node_default as z };
|
|
1505
|
+
//# sourceMappingURL=abstract-DNmiw2MC.mjs.map
|