2023-11-22 15:25:36 +01:00
|
|
|
function Node_Wavelet_Noise(_x, _y, _group = noone) : Node_Shader_Generator(_x, _y, _group) constructor {
|
|
|
|
name = "Wavelet Noise";
|
|
|
|
shader = sh_noise_wavelet;
|
|
|
|
|
2024-08-12 13:42:05 +02:00
|
|
|
inputs[1] = nodeValue_Vec2("Position", self, [ 0, 0 ])
|
2023-11-22 15:25:36 +01:00
|
|
|
.setUnitRef(function(index) { return getDimension(index); });
|
|
|
|
addShaderProp(SHADER_UNIFORM.float, "position");
|
|
|
|
|
2024-08-12 13:42:05 +02:00
|
|
|
inputs[2] = nodeValue_Vec2("Scale", self, [ 4, 4 ])
|
2023-12-23 12:59:21 +01:00
|
|
|
.setMappable(6);
|
2023-11-22 15:25:36 +01:00
|
|
|
addShaderProp(SHADER_UNIFORM.float, "scale");
|
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
inputs[3] = nodeValue_Float("Seed", self, seed_random(6))
|
|
|
|
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[3].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) });
|
2023-11-22 15:25:36 +01:00
|
|
|
addShaderProp(SHADER_UNIFORM.float, "seed");
|
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
inputs[4] = nodeValue_Float("Progress", self, 0)
|
2023-12-23 12:59:21 +01:00
|
|
|
.setMappable(7)
|
2023-11-22 15:25:36 +01:00
|
|
|
addShaderProp(SHADER_UNIFORM.float, "progress");
|
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
inputs[5] = nodeValue_Float("Detail", self, 1.24)
|
2023-12-23 12:59:21 +01:00
|
|
|
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0, 2, 0.01 ] })
|
|
|
|
.setMappable(8);
|
2023-11-22 15:25:36 +01:00
|
|
|
addShaderProp(SHADER_UNIFORM.float, "detail");
|
|
|
|
|
2023-12-23 12:59:21 +01:00
|
|
|
//////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
inputs[ 6] = nodeValueMap("Scale map", self); addShaderProp();
|
2023-12-23 12:59:21 +01:00
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
inputs[ 7] = nodeValueMap("Progress map", self); addShaderProp();
|
2023-12-23 12:59:21 +01:00
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
inputs[ 8] = nodeValueMap("Detail map", self); addShaderProp();
|
2023-12-23 12:59:21 +01:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2024-08-08 06:57:51 +02:00
|
|
|
inputs[9] = nodeValue_Rotation("Rotation", self, 0);
|
2024-03-31 05:36:11 +02:00
|
|
|
addShaderProp(SHADER_UNIFORM.float, "rotation");
|
|
|
|
|
2023-11-22 15:25:36 +01:00
|
|
|
input_display_list = [
|
|
|
|
["Output", true], 0, 3,
|
2024-03-31 05:36:11 +02:00
|
|
|
["Noise", false], 1, 9, 2, 6, 4, 7, 5, 8,
|
2023-11-22 15:25:36 +01:00
|
|
|
];
|
2023-12-23 12:59:21 +01:00
|
|
|
|
2024-03-31 05:36:11 +02:00
|
|
|
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
2024-07-02 12:18:32 +02:00
|
|
|
var _hov = false;
|
2024-08-08 06:57:51 +02:00
|
|
|
var hv = inputs[1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= hv;
|
2024-07-02 12:18:32 +02:00
|
|
|
|
|
|
|
return _hov;
|
2024-03-31 05:36:11 +02:00
|
|
|
}
|
2023-12-23 12:59:21 +01:00
|
|
|
|
|
|
|
static step = function() {
|
2024-08-08 06:57:51 +02:00
|
|
|
inputs[2].mappableStep();
|
|
|
|
inputs[4].mappableStep();
|
|
|
|
inputs[5].mappableStep();
|
2023-12-23 12:59:21 +01:00
|
|
|
}
|
2023-11-22 15:25:36 +01:00
|
|
|
}
|