Pixel-Composer/scripts/node_noise_strand/node_noise_strand.gml

49 lines
1.9 KiB
Text
Raw Normal View History

2024-02-01 05:26:02 +01:00
function Node_Noise_Strand(_x, _y, _group = noone) : Node_Shader_Generator(_x, _y, _group) constructor {
name = "Strand Noise";
shader = sh_noise_strand;
2024-08-18 09:13:41 +02:00
newInput(1, nodeValue_Vec2("Position", self, [ 0, 0 ]))
2024-02-01 05:26:02 +01:00
.setUnitRef(function(index) { return getDimension(index); });
addShaderProp(SHADER_UNIFORM.float, "position");
2024-08-18 09:13:41 +02:00
newInput(2, nodeValue_Float("Density", self, 0.5 ))
2024-02-01 05:26:02 +01:00
.setDisplay(VALUE_DISPLAY.slider);
addShaderProp(SHADER_UNIFORM.float, "density");
2024-08-18 09:13:41 +02:00
newInput(3, nodeValue_Float("Seed", self, seed_random(6)))
2024-08-08 06:57:51 +02:00
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) });
2024-02-01 05:26:02 +01:00
addShaderProp(SHADER_UNIFORM.float, "seed");
2024-08-18 09:13:41 +02:00
newInput(4, nodeValue_Float("Slope", self, 0.5 ))
2024-02-01 05:26:02 +01:00
.setDisplay(VALUE_DISPLAY.slider);
addShaderProp(SHADER_UNIFORM.float, "slope");
2024-08-18 06:16:20 +02:00
newInput(5, nodeValue_Slider_Range("Curve", self, [ 0, 0 ] , { range: [ 0, 4, 0.01 ] }));
2024-02-01 05:26:02 +01:00
addShaderProp(SHADER_UNIFORM.float, "curve");
2024-08-18 06:16:20 +02:00
newInput(6, nodeValue_Float("Curve scale", self, 1 ));
2024-02-01 05:26:02 +01:00
addShaderProp(SHADER_UNIFORM.float, "curveDetail");
2024-08-18 09:13:41 +02:00
newInput(7, nodeValue_Float("Thickness", self, 0 ))
2024-02-01 05:26:02 +01:00
.setDisplay(VALUE_DISPLAY.slider);
addShaderProp(SHADER_UNIFORM.float, "thickness");
2024-08-18 06:16:20 +02:00
newInput(8, nodeValue_Float("Curve shift", self, 0 ));
2024-02-01 08:38:21 +01:00
addShaderProp(SHADER_UNIFORM.float, "curveShift");
2024-08-18 06:16:20 +02:00
newInput(9, nodeValue_Enum_Button("Axis", self, 0 , [ "x", "y" ] ));
2024-02-01 08:38:21 +01:00
addShaderProp(SHADER_UNIFORM.integer, "axis");
2024-08-18 06:16:20 +02:00
newInput(10, nodeValue_Enum_Button("Mode", self, 0 , [ "Line", "Area" ] ));
2024-02-01 08:38:21 +01:00
addShaderProp(SHADER_UNIFORM.integer, "mode");
2024-08-18 06:16:20 +02:00
newInput(11, nodeValue_Slider_Range("Opacity", self, [ 0., 1. ] ));
2024-02-03 13:11:50 +01:00
addShaderProp(SHADER_UNIFORM.float, "alpha");
2024-02-01 05:26:02 +01:00
input_display_list = [ 3,
["Output", true], 0,
2024-02-01 08:38:21 +01:00
["Noise", false], 9, 1, 2, 4,
["Curve", false], 5, 6, 8,
2024-02-03 13:11:50 +01:00
["Render", false], 10, 7, 11,
2024-02-01 05:26:02 +01:00
];
}