mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-11-14 06:23:55 +01:00
Timeline update, noise color
This commit is contained in:
parent
2c3a1ada1a
commit
cc86c309d8
Binary file not shown.
@ -25,10 +25,9 @@ event_inherited();
|
|||||||
#region pages
|
#region pages
|
||||||
page_current = 0;
|
page_current = 0;
|
||||||
page[0] = get_text("pref_pages_general", "General");
|
page[0] = get_text("pref_pages_general", "General");
|
||||||
page[1] = get_text("pref_pages_nodes", "Node settings");
|
page[1] = get_text("pref_pages_appearance", "Appearances");
|
||||||
page[2] = get_text("pref_pages_appearance", "Appearances");
|
page[2] = get_text("pref_pages_theme", "Theme");
|
||||||
page[3] = get_text("pref_pages_theme", "Theme");
|
page[3] = get_text("pref_pages_hotkeys", "Hotkeys");
|
||||||
page[4] = get_text("pref_pages_hotkeys", "Hotkeys");
|
|
||||||
|
|
||||||
pref_global = ds_list_create();
|
pref_global = ds_list_create();
|
||||||
|
|
||||||
@ -79,6 +78,15 @@ event_inherited();
|
|||||||
})
|
})
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
ds_list_add(pref_global, [
|
||||||
|
get_text("pref_mouse_wheel_speed", "Scroll speed"),
|
||||||
|
"mouse_wheel_speed",
|
||||||
|
new textBox(TEXTBOX_INPUT.number, function(val) {
|
||||||
|
PREF_MAP[? "mouse_wheel_speed"] = val;
|
||||||
|
PREF_SAVE();
|
||||||
|
})
|
||||||
|
]);
|
||||||
|
|
||||||
ds_list_add(pref_global, [
|
ds_list_add(pref_global, [
|
||||||
get_text("pref_keyboard_hold_start", "Keyboard hold start"),
|
get_text("pref_keyboard_hold_start", "Keyboard hold start"),
|
||||||
"keyboard_repeat_start",
|
"keyboard_repeat_start",
|
||||||
@ -201,20 +209,6 @@ event_inherited();
|
|||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region //NODE
|
|
||||||
pref_node = ds_list_create();
|
|
||||||
|
|
||||||
ds_list_add(pref_node, [
|
|
||||||
get_text("pref_gravity", "Gravity"),
|
|
||||||
"physics_gravity",
|
|
||||||
new vectorBox(2, TEXTBOX_INPUT.number, function(index, val) {
|
|
||||||
PREF_MAP[? "physics_gravity"][index] = val;
|
|
||||||
physics_world_gravity(PREF_MAP[? "physics_gravity"][0], PREF_MAP[? "physics_gravity"][1]);
|
|
||||||
PREF_SAVE();
|
|
||||||
})
|
|
||||||
]);
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region appearance
|
#region appearance
|
||||||
pref_appr = ds_list_create();
|
pref_appr = ds_list_create();
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
/// @description
|
/// @description
|
||||||
event_inherited();
|
event_inherited();
|
||||||
|
|
||||||
ds_list_destroy(pref_global);
|
ds_list_destroy(pref_global);
|
||||||
ds_list_destroy(pref_node);
|
|
@ -31,7 +31,7 @@ if !ready exit;
|
|||||||
page_current = i;
|
page_current = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_text(dialog_x + ui(padding), yl + hg / 2, page[i]);
|
draw_text(dialog_x + ui(padding + 8), yl + hg / 2, page[i]);
|
||||||
yl += hg;
|
yl += hg;
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@ -57,14 +57,10 @@ if !ready exit;
|
|||||||
sp_pref.setActiveFocus(sHOVER, sFOCUS);
|
sp_pref.setActiveFocus(sHOVER, sFOCUS);
|
||||||
sp_pref.draw(px, py);
|
sp_pref.draw(px, py);
|
||||||
} else if(page_current == 1) {
|
} else if(page_current == 1) {
|
||||||
current_list = pref_node;
|
|
||||||
sp_pref.setActiveFocus(sHOVER, sFOCUS);
|
|
||||||
sp_pref.draw(px, py);
|
|
||||||
} else if(page_current == 2) {
|
|
||||||
current_list = pref_appr;
|
current_list = pref_appr;
|
||||||
sp_pref.setActiveFocus(sHOVER, sFOCUS);
|
sp_pref.setActiveFocus(sHOVER, sFOCUS);
|
||||||
sp_pref.draw(px, py);
|
sp_pref.draw(px, py);
|
||||||
} else if(page_current == 3) {
|
} else if(page_current == 2) {
|
||||||
var _w = ui(200);
|
var _w = ui(200);
|
||||||
var _h = TEXTBOX_HEIGHT;
|
var _h = TEXTBOX_HEIGHT;
|
||||||
|
|
||||||
@ -87,7 +83,7 @@ if !ready exit;
|
|||||||
|
|
||||||
sp_colors.setActiveFocus(sHOVER, sFOCUS);
|
sp_colors.setActiveFocus(sHOVER, sFOCUS);
|
||||||
sp_colors.draw(px, py + ui(40));
|
sp_colors.draw(px, py + ui(40));
|
||||||
} else if(page_current == 4) {
|
} else if(page_current == 3) {
|
||||||
if(mouse_press(mb_left, sFOCUS))
|
if(mouse_press(mb_left, sFOCUS))
|
||||||
hk_editing = noone;
|
hk_editing = noone;
|
||||||
|
|
||||||
|
@ -35,8 +35,8 @@
|
|||||||
|
|
||||||
VERSION = 1140;
|
VERSION = 1140;
|
||||||
SAVEFILE_VERSION = 1400;
|
SAVEFILE_VERSION = 1400;
|
||||||
COLLECTION_VERSION = 1140.083;
|
COLLECTION_VERSION = 1140.090;
|
||||||
VERSION_STRING = "1.14.0pr8.3";
|
VERSION_STRING = "1.14.0pr9";
|
||||||
|
|
||||||
globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT, NODE_INSTANCES;
|
globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT, NODE_INSTANCES;
|
||||||
|
|
||||||
|
@ -12,9 +12,12 @@ function mouse_release(mouse, focus = true) {
|
|||||||
|
|
||||||
#region mouse global
|
#region mouse global
|
||||||
globalvar MOUSE_WRAP, MOUSE_WRAPPING;
|
globalvar MOUSE_WRAP, MOUSE_WRAPPING;
|
||||||
|
|
||||||
MOUSE_WRAP = false;
|
MOUSE_WRAP = false;
|
||||||
MOUSE_WRAPPING = false;
|
MOUSE_WRAPPING = false;
|
||||||
|
|
||||||
|
#macro SCROLL_SPEED PREF_MAP[? "mouse_wheel_speed"]
|
||||||
|
|
||||||
function setMouseWrap() {
|
function setMouseWrap() {
|
||||||
MOUSE_WRAP = true;
|
MOUSE_WRAP = true;
|
||||||
}
|
}
|
||||||
|
@ -279,6 +279,9 @@ function Node_ASE_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh");
|
||||||
|
insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ];
|
||||||
|
|
||||||
static onInspector1Update = function() {
|
static onInspector1Update = function() {
|
||||||
var path = inputs[| 0].getValue();
|
var path = inputs[| 0].getValue();
|
||||||
if(path == "") return;
|
if(path == "") return;
|
||||||
|
@ -90,6 +90,9 @@ function Node_CSV_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh");
|
||||||
|
insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ];
|
||||||
|
|
||||||
static onInspector1Update = function() {
|
static onInspector1Update = function() {
|
||||||
var path = inputs[| 0].getValue();
|
var path = inputs[| 0].getValue();
|
||||||
if(path == "") return;
|
if(path == "") return;
|
||||||
|
@ -476,7 +476,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||||||
draw_sprite_stretched_ext(THEME.node_bg_name, 0, xx, yy, w * _s, ui(20), color, aa);
|
draw_sprite_stretched_ext(THEME.node_bg_name, 0, xx, yy, w * _s, ui(20), color, aa);
|
||||||
|
|
||||||
var cc = COLORS._main_text;
|
var cc = COLORS._main_text;
|
||||||
if(/*PREF_MAP[? "node_show_render_status"] && */!rendered)
|
if(PREF_MAP[? "node_show_render_status"] && !rendered)
|
||||||
cc = isRenderable()? COLORS._main_value_positive : COLORS._main_value_negative;
|
cc = isRenderable()? COLORS._main_value_positive : COLORS._main_value_negative;
|
||||||
|
|
||||||
draw_set_text(f_p1, fa_left, fa_center, cc);
|
draw_set_text(f_p1, fa_left, fa_center, cc);
|
||||||
@ -1203,6 +1203,11 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||||||
ds_list_add_map(_inputs, inputs[| i].serialize(scale, preset));
|
ds_list_add_map(_inputs, inputs[| i].serialize(scale, preset));
|
||||||
ds_map_add_list(_map, "inputs", _inputs);
|
ds_map_add_list(_map, "inputs", _inputs);
|
||||||
|
|
||||||
|
var _outputs = ds_list_create();
|
||||||
|
for(var i = 0; i < ds_list_size(outputs); i++)
|
||||||
|
ds_list_add_map(_outputs, outputs[| i].serialize(scale, preset));
|
||||||
|
ds_map_add_list(_map, "outputs", _outputs);
|
||||||
|
|
||||||
var _trigger = ds_list_create();
|
var _trigger = ds_list_create();
|
||||||
ds_list_add_map(_trigger, inspectInput1.serialize(scale, preset));
|
ds_list_add_map(_trigger, inspectInput1.serialize(scale, preset));
|
||||||
ds_list_add_map(_trigger, inspectInput2.serialize(scale, preset));
|
ds_list_add_map(_trigger, inspectInput2.serialize(scale, preset));
|
||||||
@ -1271,6 +1276,14 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
|
|||||||
inputs[| i].applyDeserialize(_inputs[| i], load_scale, preset);
|
inputs[| i].applyDeserialize(_inputs[| i], load_scale, preset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(ds_map_exists(load_map, "outputs")) {
|
||||||
|
var _outputs = load_map[? "outputs"];
|
||||||
|
for(var i = 0; i < ds_list_size(outputs); i++) {
|
||||||
|
if(outputs[| i] == noone) continue;
|
||||||
|
outputs[| i].applyDeserialize(_outputs[| i], load_scale, preset);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(ds_map_exists(load_map, "inspectInputs")) {
|
if(ds_map_exists(load_map, "inspectInputs")) {
|
||||||
var insInp = load_map[? "inspectInputs"];
|
var insInp = load_map[? "inspectInputs"];
|
||||||
inspectInput1.applyDeserialize(insInp[| 0], load_scale, preset);
|
inspectInput1.applyDeserialize(insInp[| 0], load_scale, preset);
|
||||||
|
@ -79,6 +79,9 @@ function Node_Image(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh");
|
||||||
|
insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ];
|
||||||
|
|
||||||
static onInspector1Update = function() {
|
static onInspector1Update = function() {
|
||||||
var path = inputs[| 0].getValue();
|
var path = inputs[| 0].getValue();
|
||||||
if(path == "") return;
|
if(path == "") return;
|
||||||
|
@ -123,6 +123,9 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh");
|
||||||
|
insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ];
|
||||||
|
|
||||||
static onInspector1Update = function() {
|
static onInspector1Update = function() {
|
||||||
var path = inputs[| 0].getValue();
|
var path = inputs[| 0].getValue();
|
||||||
if(path == "") return;
|
if(path == "") return;
|
||||||
|
@ -61,6 +61,9 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh");
|
||||||
|
insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ];
|
||||||
|
|
||||||
static onInspector1Update = function() {
|
static onInspector1Update = function() {
|
||||||
var path = inputs[| 0].getValue();
|
var path = inputs[| 0].getValue();
|
||||||
if(path == "") return;
|
if(path == "") return;
|
||||||
|
@ -81,6 +81,9 @@ function Node_Image_Sequence(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh");
|
||||||
|
insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ];
|
||||||
|
|
||||||
static onInspector1Update = function() {
|
static onInspector1Update = function() {
|
||||||
var path = inputs[| 0].getValue();
|
var path = inputs[| 0].getValue();
|
||||||
if(path == "") return;
|
if(path == "") return;
|
||||||
|
@ -69,6 +69,9 @@ function Node_Json_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh");
|
||||||
|
insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ];
|
||||||
|
|
||||||
static onInspector1Update = function() {
|
static onInspector1Update = function() {
|
||||||
var path = inputs[| 0].getValue();
|
var path = inputs[| 0].getValue();
|
||||||
if(path == "") return;
|
if(path == "") return;
|
||||||
|
@ -1,36 +1,66 @@
|
|||||||
function Node_Noise(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Noise(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Noise";
|
name = "Noise";
|
||||||
|
|
||||||
shader = sh_noise;
|
|
||||||
uniform_sed = shader_get_uniform(shader, "seed");
|
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
|
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
|
||||||
.setDisplay(VALUE_DISPLAY.vector);
|
.setDisplay(VALUE_DISPLAY.vector);
|
||||||
|
|
||||||
inputs[| 1] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, irandom(99999));
|
inputs[| 1] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, irandom(99999));
|
||||||
|
|
||||||
|
inputs[| 2] = nodeValue("Color mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
|
.setDisplay(VALUE_DISPLAY.enum_button, [ "Greyscale", "RGB", "HSV" ]);
|
||||||
|
|
||||||
|
inputs[| 3] = nodeValue("Color R range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
|
||||||
|
|
||||||
|
inputs[| 4] = nodeValue("Color G range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
|
||||||
|
|
||||||
|
inputs[| 5] = nodeValue("Color B range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Output", false], 0,
|
["Output", false], 0,
|
||||||
["Noise", false], 1,
|
["Noise", false], 1,
|
||||||
|
["Color", false], 2, 3, 4, 5,
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
|
||||||
|
static step = function() {
|
||||||
|
var _col = inputs[| 2].getValue();
|
||||||
|
|
||||||
|
inputs[| 3].setVisible(_col != 0);
|
||||||
|
inputs[| 4].setVisible(_col != 0);
|
||||||
|
inputs[| 5].setVisible(_col != 0);
|
||||||
|
|
||||||
|
inputs[| 3].name = _col == 1? "Color R range" : "Color H range";
|
||||||
|
inputs[| 4].name = _col == 1? "Color G range" : "Color S range";
|
||||||
|
inputs[| 5].name = _col == 1? "Color B range" : "Color V range";
|
||||||
|
}
|
||||||
|
|
||||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _dim = _data[0];
|
var _dim = _data[0];
|
||||||
var _sed = _data[1];
|
var _sed = _data[1];
|
||||||
|
|
||||||
|
var _col = _data[2];
|
||||||
|
var _clr = _data[3];
|
||||||
|
var _clg = _data[4];
|
||||||
|
var _clb = _data[5];
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_shader(_outSurf, sh_noise);
|
||||||
shader_set(shader);
|
shader_set_f("seed", _sed);
|
||||||
shader_set_uniform_f(uniform_sed, _sed);
|
|
||||||
|
shader_set_i("colored", _col);
|
||||||
|
shader_set_f("colorRanR", _clr);
|
||||||
|
shader_set_f("colorRanG", _clg);
|
||||||
|
shader_set_f("colorRanB", _clb);
|
||||||
|
|
||||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
|
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
|
||||||
shader_reset();
|
surface_reset_shader();
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
return _outSurf;
|
return _outSurf;
|
||||||
}
|
}
|
||||||
|
@ -30,11 +30,13 @@ function Node_Cellular(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||||||
.setDisplay(VALUE_DISPLAY.slider, [-10., 10., 0.01])
|
.setDisplay(VALUE_DISPLAY.slider, [-10., 10., 0.01])
|
||||||
.setVisible(false);
|
.setVisible(false);
|
||||||
|
|
||||||
|
inputs[| 10] = nodeValue("Colored", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Output", false], 0,
|
["Output", false], 0,
|
||||||
["Noise", false], 4, 6, 3, 1, 2,
|
["Noise", false], 4, 6, 3, 1, 2,
|
||||||
["Radial", false], 8, 9,
|
["Radial", false], 8, 9,
|
||||||
["Rendering", false], 5, 7
|
["Rendering", false], 5, 7, 10,
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
@ -57,8 +59,11 @@ function Node_Cellular(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||||||
|
|
||||||
inputs[| 8].setVisible(_pat == 1);
|
inputs[| 8].setVisible(_pat == 1);
|
||||||
inputs[| 9].setVisible(_pat == 1);
|
inputs[| 9].setVisible(_pat == 1);
|
||||||
|
inputs[| 10].setVisible(_type == 2);
|
||||||
|
|
||||||
var _rad = _data[ 8];
|
var _rad = _data[ 8];
|
||||||
var _sht = _data[ 9];
|
var _sht = _data[ 9];
|
||||||
|
var _col = _data[10];
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
@ -81,6 +86,7 @@ function Node_Cellular(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||||||
|
|
||||||
uniform_rad = shader_get_uniform(shader, "radiusScale");
|
uniform_rad = shader_get_uniform(shader, "radiusScale");
|
||||||
uniform_sht = shader_get_uniform(shader, "radiusShatter");
|
uniform_sht = shader_get_uniform(shader, "radiusShatter");
|
||||||
|
uniform_col = shader_get_uniform(shader, "colored");
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_target(_outSurf);
|
||||||
shader_set(shader);
|
shader_set(shader);
|
||||||
@ -93,6 +99,7 @@ function Node_Cellular(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||||||
shader_set_uniform_f(uniform_rad, _rad);
|
shader_set_uniform_f(uniform_rad, _rad);
|
||||||
shader_set_uniform_f(uniform_sht, _sht);
|
shader_set_uniform_f(uniform_sht, _sht);
|
||||||
shader_set_uniform_i(uniform_pat, _pat);
|
shader_set_uniform_i(uniform_pat, _pat);
|
||||||
|
shader_set_uniform_i(uniform_col, _col);
|
||||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
|
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
|
||||||
shader_reset();
|
shader_reset();
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
@ -1,16 +1,6 @@
|
|||||||
function Node_Grid_Noise(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Grid_Noise(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Grid Noise";
|
name = "Grid Noise";
|
||||||
|
|
||||||
shader = sh_grid_noise;
|
|
||||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
|
||||||
uniform_pos = shader_get_uniform(shader, "position");
|
|
||||||
uniform_sca = shader_get_uniform(shader, "scale");
|
|
||||||
uniform_sed = shader_get_uniform(shader, "seed");
|
|
||||||
uniform_shf = shader_get_uniform(shader, "shift");
|
|
||||||
uniform_shfax = shader_get_uniform(shader, "shiftAxis");
|
|
||||||
|
|
||||||
uniform_sam = shader_get_uniform(shader, "useSampler");
|
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
|
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
|
||||||
.setDisplay(VALUE_DISPLAY.vector);
|
.setDisplay(VALUE_DISPLAY.vector);
|
||||||
|
|
||||||
@ -31,10 +21,22 @@ function Node_Grid_Noise(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||||||
inputs[| 6] = nodeValue("Shift axis", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
inputs[| 6] = nodeValue("Shift axis", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
.setDisplay(VALUE_DISPLAY.enum_button, ["x", "y"]);
|
.setDisplay(VALUE_DISPLAY.enum_button, ["x", "y"]);
|
||||||
|
|
||||||
|
inputs[| 7] = nodeValue("Color mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
|
.setDisplay(VALUE_DISPLAY.enum_button, [ "Greyscale", "RGB", "HSV" ]);
|
||||||
|
|
||||||
|
inputs[| 8] = nodeValue("Color R range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
|
||||||
|
|
||||||
|
inputs[| 9] = nodeValue("Color G range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
|
||||||
|
|
||||||
|
inputs[| 10] = nodeValue("Color B range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Output", false], 0,
|
["Output", false], 0,
|
||||||
["Noise", false], 3, 1, 2, 6, 4,
|
["Noise", false], 3, 1, 2, 6, 4,
|
||||||
["Render", false], 5,
|
["Render", false], 5, 7, 8, 9, 10,
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
@ -54,25 +56,32 @@ function Node_Grid_Noise(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||||||
var _sam = _data[5];
|
var _sam = _data[5];
|
||||||
var _shfAx = _data[6];
|
var _shfAx = _data[6];
|
||||||
|
|
||||||
|
var _col = _data[ 7];
|
||||||
|
var _clr = _data[ 8];
|
||||||
|
var _clg = _data[ 9];
|
||||||
|
var _clb = _data[10];
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_shader(_outSurf, sh_grid_noise);
|
||||||
DRAW_CLEAR
|
shader_set_f("dimension", _dim);
|
||||||
shader_set(shader);
|
shader_set_f("position", _pos);
|
||||||
shader_set_uniform_f_array_safe(uniform_dim, _dim);
|
shader_set_f("scale", _sca);
|
||||||
shader_set_uniform_f_array_safe(uniform_pos, _pos);
|
shader_set_i("useSampler", is_surface(_sam));
|
||||||
shader_set_uniform_f_array_safe(uniform_sca, _sca);
|
shader_set_f("shift", _shf);
|
||||||
shader_set_uniform_i(uniform_sam, is_surface(_sam));
|
shader_set_i("shiftAxis", _shfAx);
|
||||||
shader_set_uniform_f(uniform_shf, _shf);
|
shader_set_f("seed", _sed);
|
||||||
shader_set_uniform_i(uniform_shfax, _shfAx);
|
|
||||||
shader_set_uniform_f(uniform_sed, _sed);
|
shader_set_i("colored", _col);
|
||||||
|
shader_set_f("colorRanR", _clr);
|
||||||
|
shader_set_f("colorRanG", _clg);
|
||||||
|
shader_set_f("colorRanB", _clb);
|
||||||
|
|
||||||
if(is_surface(_sam))
|
if(is_surface(_sam))
|
||||||
draw_surface_stretched_safe(_sam, 0, 0, _dim[0], _dim[1]);
|
draw_surface_stretched_safe(_sam, 0, 0, _dim[0], _dim[1]);
|
||||||
else
|
else
|
||||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
|
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
|
||||||
shader_reset();
|
surface_reset_shader();
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
return _outSurf;
|
return _outSurf;
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,6 @@
|
|||||||
function Node_Noise_Simplex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Noise_Simplex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Simplex Noise";
|
name = "Simplex Noise";
|
||||||
|
|
||||||
shader = sh_simplex;
|
|
||||||
uniform_pos = shader_get_uniform(shader, "position");
|
|
||||||
uniform_sca = shader_get_uniform(shader, "scale");
|
|
||||||
uniform_itr = shader_get_uniform(shader, "iteration");
|
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
|
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
|
||||||
.setDisplay(VALUE_DISPLAY.vector);
|
.setDisplay(VALUE_DISPLAY.vector);
|
||||||
|
|
||||||
@ -18,32 +13,65 @@ function Node_Noise_Simplex(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||||||
inputs[| 3] = nodeValue("Iteration", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1 )
|
inputs[| 3] = nodeValue("Iteration", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1 )
|
||||||
.setDisplay(VALUE_DISPLAY.slider, [1, 16, 1]);
|
.setDisplay(VALUE_DISPLAY.slider, [1, 16, 1]);
|
||||||
|
|
||||||
|
inputs[| 4] = nodeValue("Color mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
|
.setDisplay(VALUE_DISPLAY.enum_button, [ "Greyscale", "RGB", "HSV" ]);
|
||||||
|
|
||||||
|
inputs[| 5] = nodeValue("Color R range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
|
||||||
|
|
||||||
|
inputs[| 6] = nodeValue("Color G range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
|
||||||
|
|
||||||
|
inputs[| 7] = nodeValue("Color B range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Output", false], 0,
|
["Output", false], 0,
|
||||||
["Noise", false], 1, 2, 3,
|
["Noise", false], 1, 2, 3,
|
||||||
|
["Render", false], 4, 5, 6, 7,
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
|
||||||
|
static step = function() {
|
||||||
|
var _col = inputs[| 4].getValue();
|
||||||
|
|
||||||
|
inputs[| 5].setVisible(_col != 0);
|
||||||
|
inputs[| 6].setVisible(_col != 0);
|
||||||
|
inputs[| 7].setVisible(_col != 0);
|
||||||
|
|
||||||
|
inputs[| 5].name = _col == 1? "Color R range" : "Color H range";
|
||||||
|
inputs[| 6].name = _col == 1? "Color G range" : "Color S range";
|
||||||
|
inputs[| 7].name = _col == 1? "Color B range" : "Color V range";
|
||||||
|
}
|
||||||
|
|
||||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _dim = _data[0];
|
var _dim = _data[0];
|
||||||
var _pos = _data[1];
|
var _pos = _data[1];
|
||||||
var _sca = _data[2];
|
var _sca = _data[2];
|
||||||
var _itr = _data[3];
|
var _itr = _data[3];
|
||||||
|
|
||||||
|
var _col = _data[4];
|
||||||
|
var _clr = _data[5];
|
||||||
|
var _clg = _data[6];
|
||||||
|
var _clb = _data[7];
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_shader(_outSurf, sh_simplex);
|
||||||
shader_set(shader);
|
shader_set_f("position", _pos);
|
||||||
shader_set_uniform_f_array_safe(uniform_pos, _pos);
|
shader_set_f("scale", _sca);
|
||||||
shader_set_uniform_f_array_safe(uniform_sca, _sca);
|
shader_set_i("iteration", _itr);
|
||||||
shader_set_uniform_i(uniform_itr, _itr);
|
|
||||||
|
shader_set_i("colored", _col);
|
||||||
|
shader_set_f("colorRanR", _clr);
|
||||||
|
shader_set_f("colorRanG", _clg);
|
||||||
|
shader_set_f("colorRanB", _clb);
|
||||||
|
|
||||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
|
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
|
||||||
shader_reset();
|
surface_reset_shader();
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
return _outSurf;
|
return _outSurf;
|
||||||
}
|
}
|
||||||
|
@ -1,14 +1,6 @@
|
|||||||
function Node_Perlin(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Perlin(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Perlin Noise";
|
name = "Perlin Noise";
|
||||||
|
|
||||||
shader = sh_perlin_tiled;
|
|
||||||
uniform_dim = shader_get_uniform(shader, "u_resolution");
|
|
||||||
uniform_pos = shader_get_uniform(shader, "position");
|
|
||||||
uniform_sca = shader_get_uniform(shader, "scale");
|
|
||||||
uniform_ite = shader_get_uniform(shader, "iteration");
|
|
||||||
uniform_sed = shader_get_uniform(shader, "seed");
|
|
||||||
uniform_til = shader_get_uniform(shader, "tile");
|
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
|
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
|
||||||
.setDisplay(VALUE_DISPLAY.vector);
|
.setDisplay(VALUE_DISPLAY.vector);
|
||||||
|
|
||||||
@ -25,15 +17,40 @@ function Node_Perlin(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||||||
|
|
||||||
inputs[| 5] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, irandom(99999));
|
inputs[| 5] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, irandom(99999));
|
||||||
|
|
||||||
|
inputs[| 6] = nodeValue("Color mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
|
.setDisplay(VALUE_DISPLAY.enum_button, [ "Greyscale", "RGB", "HSV" ]);
|
||||||
|
|
||||||
|
inputs[| 7] = nodeValue("Color R range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
|
||||||
|
|
||||||
|
inputs[| 8] = nodeValue("Color G range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
|
||||||
|
|
||||||
|
inputs[| 9] = nodeValue("Color B range", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range, [0, 1, .01]);
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Surface", true], 0, 5,
|
["Surface", true], 0, 5,
|
||||||
["Noise", false], 1, 2, 3, 4,
|
["Noise", false], 1, 2, 3, 4,
|
||||||
|
["Render", false], 6, 7, 8, 9,
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
|
||||||
|
static step = function() {
|
||||||
|
var _col = inputs[| 6].getValue();
|
||||||
|
|
||||||
|
inputs[| 7].setVisible(_col != 0);
|
||||||
|
inputs[| 8].setVisible(_col != 0);
|
||||||
|
inputs[| 9].setVisible(_col != 0);
|
||||||
|
|
||||||
|
inputs[| 7].name = _col == 1? "Color R range" : "Color H range";
|
||||||
|
inputs[| 8].name = _col == 1? "Color G range" : "Color S range";
|
||||||
|
inputs[| 9].name = _col == 1? "Color B range" : "Color V range";
|
||||||
|
}
|
||||||
|
|
||||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _dim = _data[0];
|
var _dim = _data[0];
|
||||||
var _pos = _data[1];
|
var _pos = _data[1];
|
||||||
@ -42,19 +59,28 @@ function Node_Perlin(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||||||
var _til = _data[4];
|
var _til = _data[4];
|
||||||
var _sed = _data[5];
|
var _sed = _data[5];
|
||||||
|
|
||||||
|
var _col = _data[6];
|
||||||
|
var _clr = _data[7];
|
||||||
|
var _clg = _data[8];
|
||||||
|
var _clb = _data[9];
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_shader(_outSurf, sh_perlin_tiled);
|
||||||
shader_set(shader);
|
shader_set_f("u_resolution", _dim);
|
||||||
shader_set_uniform_f_array_safe(uniform_dim, _dim);
|
shader_set_f("position", _pos);
|
||||||
shader_set_uniform_f_array_safe(uniform_pos, _pos);
|
shader_set_f("scale", _sca);
|
||||||
shader_set_uniform_f_array_safe(uniform_sca, _sca);
|
shader_set_f("seed", _sed);
|
||||||
shader_set_uniform_f(uniform_sed, _sed);
|
shader_set_i("tile", _til);
|
||||||
shader_set_uniform_i(uniform_til, _til);
|
shader_set_i("iteration", _ite);
|
||||||
shader_set_uniform_i(uniform_ite, _ite);
|
|
||||||
|
shader_set_i("colored", _col);
|
||||||
|
shader_set_f("colorRanR", _clr);
|
||||||
|
shader_set_f("colorRanG", _clg);
|
||||||
|
shader_set_f("colorRanB", _clb);
|
||||||
|
|
||||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
|
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
|
||||||
shader_reset();
|
surface_reset_shader();
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
return _outSurf;
|
return _outSurf;
|
||||||
}
|
}
|
||||||
|
@ -52,6 +52,9 @@ function Node_Text_File_Read(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
insp1UpdateTooltip = get_text("panel_inspector_refresh", "Refresh");
|
||||||
|
insp1UpdateIcon = [ THEME.refresh, 1, COLORS._main_value_positive ];
|
||||||
|
|
||||||
static onInspector1Update = function() {
|
static onInspector1Update = function() {
|
||||||
var path = inputs[| 0].getValue();
|
var path = inputs[| 0].getValue();
|
||||||
if(path == "") return;
|
if(path == "") return;
|
||||||
|
@ -1362,22 +1362,22 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||||||
var _angle = argument_count > 8? argument[ 8] : 0;
|
var _angle = argument_count > 8? argument[ 8] : 0;
|
||||||
var _scale = argument_count > 9? argument[ 9] : 1;
|
var _scale = argument_count > 9? argument[ 9] : 1;
|
||||||
var _spr = argument_count > 10? argument[10] : THEME.anchor_selector;
|
var _spr = argument_count > 10? argument[10] : THEME.anchor_selector;
|
||||||
return preview_overlay_scalar(value_from != noone, active, _x, _y, _s, _mx, _my, _snx, _sny, _angle, _scale, _spr);
|
return preview_overlay_scalar(value_from == noone, active, _x, _y, _s, _mx, _my, _snx, _sny, _angle, _scale, _spr);
|
||||||
|
|
||||||
case VALUE_DISPLAY.rotation :
|
case VALUE_DISPLAY.rotation :
|
||||||
var _rad = argument_count > 8? argument[ 8] : 64;
|
var _rad = argument_count > 8? argument[ 8] : 64;
|
||||||
return preview_overlay_rotation(value_from != noone, active, _x, _y, _s, _mx, _my, _snx, _sny, _rad);
|
return preview_overlay_rotation(value_from == noone, active, _x, _y, _s, _mx, _my, _snx, _sny, _rad);
|
||||||
|
|
||||||
case VALUE_DISPLAY.vector :
|
case VALUE_DISPLAY.vector :
|
||||||
var _spr = argument_count > 8? argument[8] : THEME.anchor_selector;
|
var _spr = argument_count > 8? argument[8] : THEME.anchor_selector;
|
||||||
var _sca = argument_count > 9? argument[9] : 1;
|
var _sca = argument_count > 9? argument[9] : 1;
|
||||||
return preview_overlay_vector(value_from != noone, active, _x, _y, _s, _mx, _my, _snx, _sny, _spr);
|
return preview_overlay_vector(value_from == noone, active, _x, _y, _s, _mx, _my, _snx, _sny, _spr);
|
||||||
|
|
||||||
case VALUE_DISPLAY.area :
|
case VALUE_DISPLAY.area :
|
||||||
return preview_overlay_area(value_from != noone, active, _x, _y, _s, _mx, _my, _snx, _sny, display_data);
|
return preview_overlay_area(value_from == noone, active, _x, _y, _s, _mx, _my, _snx, _sny, display_data);
|
||||||
|
|
||||||
case VALUE_DISPLAY.puppet_control :
|
case VALUE_DISPLAY.puppet_control :
|
||||||
return preview_overlay_puppet(value_from != noone, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
return preview_overlay_puppet(value_from == noone, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
@ -1528,8 +1528,12 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||||||
static serialize = function(scale = false, preset = false) {
|
static serialize = function(scale = false, preset = false) {
|
||||||
var _map = ds_map_create();
|
var _map = ds_map_create();
|
||||||
|
|
||||||
_map[? "on end"] = on_end;
|
|
||||||
_map[? "visible"] = visible;
|
_map[? "visible"] = visible;
|
||||||
|
|
||||||
|
if(connect_type == JUNCTION_CONNECT.output)
|
||||||
|
return _map;
|
||||||
|
|
||||||
|
_map[? "on end"] = on_end;
|
||||||
_map[? "unit"] = unit.mode;
|
_map[? "unit"] = unit.mode;
|
||||||
_map[? "sep_axis"] = sep_axis;
|
_map[? "sep_axis"] = sep_axis;
|
||||||
_map[? "shift x"] = draw_line_shift_x;
|
_map[? "shift x"] = draw_line_shift_x;
|
||||||
@ -1559,9 +1563,12 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||||||
if(_map == undefined) return;
|
if(_map == undefined) return;
|
||||||
if(_map == noone) return;
|
if(_map == noone) return;
|
||||||
|
|
||||||
|
visible = ds_map_try_get(_map, "visible", visible);
|
||||||
|
if(connect_type == JUNCTION_CONNECT.output)
|
||||||
|
return;
|
||||||
|
|
||||||
//printIf(TESTING, " |- Applying deserialize to junction " + name + " of node " + node.name);
|
//printIf(TESTING, " |- Applying deserialize to junction " + name + " of node " + node.name);
|
||||||
on_end = ds_map_try_get(_map, "on end", on_end);
|
on_end = ds_map_try_get(_map, "on end", on_end);
|
||||||
visible = ds_map_try_get(_map, "visible", visible);
|
|
||||||
unit.mode = ds_map_try_get(_map, "unit", VALUE_UNIT.constant);
|
unit.mode = ds_map_try_get(_map, "unit", VALUE_UNIT.constant);
|
||||||
global_use = ds_map_try_get(_map, "global_use");
|
global_use = ds_map_try_get(_map, "global_use");
|
||||||
global_key = ds_map_try_get(_map, "global_key");
|
global_key = ds_map_try_get(_map, "global_key");
|
||||||
|
@ -39,6 +39,8 @@ function Panel_Animation() : PanelContent() constructor {
|
|||||||
timeline_scubbing = false;
|
timeline_scubbing = false;
|
||||||
timeline_scub_st = 0;
|
timeline_scub_st = 0;
|
||||||
timeline_scale = 20;
|
timeline_scale = 20;
|
||||||
|
timeline_separate = 5;
|
||||||
|
timeline_sep_line = 1;
|
||||||
_scrub_frame = -1;
|
_scrub_frame = -1;
|
||||||
|
|
||||||
timeline_shift = 0;
|
timeline_shift = 0;
|
||||||
@ -415,7 +417,7 @@ function Panel_Animation() : PanelContent() constructor {
|
|||||||
draw_sprite_stretched(THEME.ui_panel_bg, 1, 0, 0, bar_w, bar_h);
|
draw_sprite_stretched(THEME.ui_panel_bg, 1, 0, 0, bar_w, bar_h);
|
||||||
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, 0, 0, bar_total_w, bar_h, COLORS.panel_animation_timeline_blend, 1);
|
draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, 0, 0, bar_total_w, bar_h, COLORS.panel_animation_timeline_blend, 1);
|
||||||
|
|
||||||
for(var i = 10; i <= ANIMATOR.frames_total; i += 10) {
|
for(var i = timeline_separate; i <= ANIMATOR.frames_total; i += timeline_separate) {
|
||||||
var bar_line_x = i * ui(timeline_scale) + timeline_shift;
|
var bar_line_x = i * ui(timeline_scale) + timeline_shift;
|
||||||
draw_set_color(COLORS.panel_animation_frame_divider);
|
draw_set_color(COLORS.panel_animation_frame_divider);
|
||||||
draw_line(bar_line_x, ui(12), bar_line_x, bar_h);
|
draw_line(bar_line_x, ui(12), bar_line_x, bar_h);
|
||||||
@ -508,14 +510,31 @@ function Panel_Animation() : PanelContent() constructor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(pHOVER && point_in_rectangle(mx, my, bar_x, 16, bar_x + bar_w, bar_y - 8)) {
|
if(pHOVER && point_in_rectangle(mx, my, bar_x, 16, bar_x + bar_w, bar_y - 8)) {
|
||||||
if(mouse_wheel_down()) {
|
var sca = timeline_scale;
|
||||||
timeline_scale = max(timeline_scale - 1, 1);
|
|
||||||
timeline_shift_to = 0;
|
if(mouse_wheel_down()) timeline_scale = max(timeline_scale - 1 * SCROLL_SPEED, 1);
|
||||||
|
if(mouse_wheel_up()) timeline_scale = min(timeline_scale + 1 * SCROLL_SPEED, 24);
|
||||||
|
|
||||||
|
timeline_separate = 5;
|
||||||
|
timeline_sep_line = 1;
|
||||||
|
|
||||||
|
if(timeline_scale <= 10) {
|
||||||
|
timeline_separate = 10;
|
||||||
|
timeline_sep_line = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mouse_wheel_up()) {
|
if(timeline_scale <= 3) {
|
||||||
timeline_scale = min(timeline_scale + 1, 24);
|
timeline_separate = 20;
|
||||||
timeline_shift_to = 0;
|
timeline_sep_line = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(sca != timeline_scale) {
|
||||||
|
var mfb = (mx - bar_x - timeline_shift) / ui(timeline_scale);
|
||||||
|
var mfa = (mx - bar_x - timeline_shift) / ui(sca);
|
||||||
|
|
||||||
|
timeline_shift_to = clamp(timeline_shift_to - (mfa - mfb) * timeline_scale,
|
||||||
|
-max(bar_total_w - bar_w + 32, 0), 0);
|
||||||
|
timeline_shift = timeline_shift_to;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mouse_press(mb_middle, pFOCUS)) {
|
if(mouse_press(mb_middle, pFOCUS)) {
|
||||||
@ -529,10 +548,8 @@ function Panel_Animation() : PanelContent() constructor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(pHOVER && point_in_rectangle(mx, my, bar_x, bar_y, bar_x + min(timeline_w, timeline_shift + bar_total_w), bar_y + bar_h)) { //preview
|
if(pHOVER && point_in_rectangle(mx, my, bar_x, bar_y, bar_x + min(timeline_w, timeline_shift + bar_total_w), bar_y + bar_h)) { //preview
|
||||||
if(mouse_wheel_down())
|
if(mouse_wheel_down()) timeline_shift_to = clamp(timeline_shift_to - 64 * SCROLL_SPEED, -max(bar_total_w - bar_w + 32, 0), 0);
|
||||||
timeline_shift_to = clamp(timeline_shift_to - 64, -max(bar_total_w - bar_w + 32, 0), 0);
|
if(mouse_wheel_up()) timeline_shift_to = clamp(timeline_shift_to + 64 * SCROLL_SPEED, -max(bar_total_w - bar_w + 32, 0), 0);
|
||||||
if(mouse_wheel_up())
|
|
||||||
timeline_shift_to = clamp(timeline_shift_to + 64, -max(bar_total_w - bar_w + 32, 0), 0);
|
|
||||||
|
|
||||||
if(mouse_press(mb_left, pFOCUS)) {
|
if(mouse_press(mb_left, pFOCUS)) {
|
||||||
timeline_scubbing = true;
|
timeline_scubbing = true;
|
||||||
@ -1119,9 +1136,9 @@ function Panel_Animation() : PanelContent() constructor {
|
|||||||
#region scroll
|
#region scroll
|
||||||
dope_sheet_y = lerp_float(dope_sheet_y, dope_sheet_y_to, 4);
|
dope_sheet_y = lerp_float(dope_sheet_y, dope_sheet_y_to, 4);
|
||||||
|
|
||||||
if(pHOVER && point_in_rectangle(mx, my, ui(8), ui(8), tool_width, ui(8) + dope_sheet_h)) {
|
if(pHOVER && point_in_rectangle(mx, my, ui(8), ui(8), bar_x, ui(8) + dope_sheet_h)) {
|
||||||
if(mouse_wheel_down()) dope_sheet_y_to = clamp(dope_sheet_y_to - ui(32), -dope_sheet_y_max, 0);
|
if(mouse_wheel_down()) dope_sheet_y_to = clamp(dope_sheet_y_to - ui(32) * SCROLL_SPEED, -dope_sheet_y_max, 0);
|
||||||
if(mouse_wheel_up()) dope_sheet_y_to = clamp(dope_sheet_y_to + ui(32), -dope_sheet_y_max, 0);
|
if(mouse_wheel_up()) dope_sheet_y_to = clamp(dope_sheet_y_to + ui(32) * SCROLL_SPEED, -dope_sheet_y_max, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
var scr_x = bar_x + dope_sheet_w + ui(4);
|
var scr_x = bar_x + dope_sheet_w + ui(4);
|
||||||
@ -1217,11 +1234,13 @@ function Panel_Animation() : PanelContent() constructor {
|
|||||||
|
|
||||||
dope_sheet_y_max = max(0, dope_sheet_y_max - dope_sheet_h + ui(48));
|
dope_sheet_y_max = max(0, dope_sheet_y_max - dope_sheet_h + ui(48));
|
||||||
|
|
||||||
for(var i = 10; i <= ANIMATOR.frames_total; i += 10) {
|
for(var i = timeline_sep_line; i <= ANIMATOR.frames_total; i += timeline_sep_line) {
|
||||||
var bar_line_x = i * ui(timeline_scale) + timeline_shift;
|
var bar_line_x = i * ui(timeline_scale) + timeline_shift;
|
||||||
draw_set_color(COLORS.panel_animation_frame_divider);
|
draw_set_color(COLORS.panel_animation_frame_divider);
|
||||||
|
draw_set_alpha(i % timeline_separate == 0? 1 : 0.1);
|
||||||
draw_line(bar_line_x, ui(16), bar_line_x, dope_sheet_h);
|
draw_line(bar_line_x, ui(16), bar_line_x, dope_sheet_h);
|
||||||
}
|
}
|
||||||
|
draw_set_alpha(1);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region stretch
|
#region stretch
|
||||||
@ -1497,7 +1516,7 @@ function Panel_Animation() : PanelContent() constructor {
|
|||||||
draw_set_color(COLORS.panel_animation_timeline_top);
|
draw_set_color(COLORS.panel_animation_timeline_top);
|
||||||
draw_rectangle(0, 0, bar_show_w, ui(16), false);
|
draw_rectangle(0, 0, bar_show_w, ui(16), false);
|
||||||
|
|
||||||
for(var i = 10; i <= ANIMATOR.frames_total; i += 10) {
|
for(var i = timeline_separate; i <= ANIMATOR.frames_total; i += timeline_separate) {
|
||||||
var bar_line_x = i * ui(timeline_scale) + timeline_shift;
|
var bar_line_x = i * ui(timeline_scale) + timeline_shift;
|
||||||
draw_set_text(f_p2, fa_right, fa_top, COLORS._main_text_sub);
|
draw_set_text(f_p2, fa_right, fa_top, COLORS._main_text_sub);
|
||||||
draw_text(bar_line_x - ui(2), 0, string(i));
|
draw_text(bar_line_x - ui(2), 0, string(i));
|
||||||
|
@ -542,8 +542,8 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
|
|||||||
|
|
||||||
tab_width = max(0, tab_width - w + ui(32));
|
tab_width = max(0, tab_width - w + ui(32));
|
||||||
if(point_in_rectangle(msx, msy, 0, 0, w, tab_height)) {
|
if(point_in_rectangle(msx, msy, 0, 0, w, tab_height)) {
|
||||||
if(mouse_wheel_up()) tab_x_to = clamp(tab_x_to + ui(64), -tab_width, 0);
|
if(mouse_wheel_up()) tab_x_to = clamp(tab_x_to + ui(64) * SCROLL_SPEED, -tab_width, 0);
|
||||||
if(mouse_wheel_down()) tab_x_to = clamp(tab_x_to - ui(64), -tab_width, 0);
|
if(mouse_wheel_down()) tab_x_to = clamp(tab_x_to - ui(64) * SCROLL_SPEED, -tab_width, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tab_holding) {
|
if(tab_holding) {
|
||||||
|
@ -524,8 +524,8 @@ function Panel_Preview() : PanelContent() constructor {
|
|||||||
if(pHOVER && my > h - toolbar_height - prev_size - ui(16) && my > toolbar_height) {
|
if(pHOVER && my > h - toolbar_height - prev_size - ui(16) && my > toolbar_height) {
|
||||||
canvas_hover = false;
|
canvas_hover = false;
|
||||||
|
|
||||||
if(mouse_wheel_down()) preview_x_to = clamp(preview_x_to - prev_size, - preview_x_max, 0);
|
if(mouse_wheel_down()) preview_x_to = clamp(preview_x_to - prev_size * SCROLL_SPEED, - preview_x_max, 0);
|
||||||
if(mouse_wheel_up()) preview_x_to = clamp(preview_x_to + prev_size, - preview_x_max, 0);
|
if(mouse_wheel_up()) preview_x_to = clamp(preview_x_to + prev_size * SCROLL_SPEED, - preview_x_max, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
preview_x_max = 0;
|
preview_x_max = 0;
|
||||||
@ -710,8 +710,8 @@ function Panel_Preview() : PanelContent() constructor {
|
|||||||
|
|
||||||
tol_max_w = max(0, tol_max_w - w);
|
tol_max_w = max(0, tol_max_w - w);
|
||||||
if(point_in_rectangle(mx, my, 0, 0, w, toolbar_height)) {
|
if(point_in_rectangle(mx, my, 0, 0, w, toolbar_height)) {
|
||||||
if(mouse_wheel_up()) tool_x_to = clamp(tool_x_to + ui(64), -tol_max_w, 0);
|
if(mouse_wheel_up()) tool_x_to = clamp(tool_x_to + ui(64) * SCROLL_SPEED, -tol_max_w, 0);
|
||||||
if(mouse_wheel_down()) tool_x_to = clamp(tool_x_to - ui(64), -tol_max_w, 0);
|
if(mouse_wheel_down()) tool_x_to = clamp(tool_x_to - ui(64) * SCROLL_SPEED, -tol_max_w, 0);
|
||||||
}
|
}
|
||||||
} else { //color sampler
|
} else { //color sampler
|
||||||
var cx = ui(10);
|
var cx = ui(10);
|
||||||
|
@ -107,14 +107,14 @@ function Panel_Workspace() : PanelContent() constructor {
|
|||||||
if(hori) {
|
if(hori) {
|
||||||
scroll_max = max(ww - w + ui(16), 0);
|
scroll_max = max(ww - w + ui(16), 0);
|
||||||
if(pHOVER) {
|
if(pHOVER) {
|
||||||
if(mouse_wheel_down()) scroll_to = clamp(scroll_to - ui(128), -scroll_max, 0);
|
if(mouse_wheel_down()) scroll_to = clamp(scroll_to - ui(128) * SCROLL_SPEED, -scroll_max, 0);
|
||||||
if(mouse_wheel_up()) scroll_to = clamp(scroll_to + ui(128), -scroll_max, 0);
|
if(mouse_wheel_up()) scroll_to = clamp(scroll_to + ui(128) * SCROLL_SPEED, -scroll_max, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
scroll_max = max(hh - h + ui(16), 0);
|
scroll_max = max(hh - h + ui(16), 0);
|
||||||
if(pHOVER) {
|
if(pHOVER) {
|
||||||
if(mouse_wheel_down()) scroll_to = clamp(scroll_to - ui(32), -scroll_max, 0);
|
if(mouse_wheel_down()) scroll_to = clamp(scroll_to - ui(32) * SCROLL_SPEED, -scroll_max, 0);
|
||||||
if(mouse_wheel_up()) scroll_to = clamp(scroll_to + ui(32), -scroll_max, 0);
|
if(mouse_wheel_up()) scroll_to = clamp(scroll_to + ui(32) * SCROLL_SPEED, -scroll_max, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,8 @@
|
|||||||
PREF_MAP[? "path_resolution"] = 32;
|
PREF_MAP[? "path_resolution"] = 32;
|
||||||
|
|
||||||
PREF_MAP[? "double_click_delay"] = 0.25;
|
PREF_MAP[? "double_click_delay"] = 0.25;
|
||||||
|
PREF_MAP[? "mouse_wheel_speed"] = 1.00;
|
||||||
|
|
||||||
PREF_MAP[? "keyboard_repeat_start"] = 0.50;
|
PREF_MAP[? "keyboard_repeat_start"] = 0.50;
|
||||||
PREF_MAP[? "keyboard_repeat_speed"] = 0.10;
|
PREF_MAP[? "keyboard_repeat_speed"] = 0.10;
|
||||||
|
|
||||||
|
@ -60,8 +60,8 @@ function scrollPane(_w, _h, ondraw) : widget() constructor {
|
|||||||
draw_surface_safe(surface, x, y);
|
draw_surface_safe(surface, x, y);
|
||||||
|
|
||||||
if(hover && !key_mod_press(SHIFT)) {
|
if(hover && !key_mod_press(SHIFT)) {
|
||||||
if(mouse_wheel_down()) scroll_y_to -= scroll_step;
|
if(mouse_wheel_down()) scroll_y_to -= scroll_step * SCROLL_SPEED;
|
||||||
if(mouse_wheel_up()) scroll_y_to += scroll_step;
|
if(mouse_wheel_up()) scroll_y_to += scroll_step * SCROLL_SPEED;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(abs(content_h) > 0) {
|
if(abs(content_h) > 0) {
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
function shellOpenExplorer(path) {
|
function shellOpenExplorer(path) {
|
||||||
var _windir = environment_get_variable("WINDIR") + "/explorer.exe";
|
var _windir = environment_get_variable("WINDIR") + "/explorer.exe";
|
||||||
|
path = string_replace_all(path, "/", "\\");
|
||||||
execute_shell(_windir, path);
|
execute_shell(_windir, path);
|
||||||
}
|
}
|
@ -531,8 +531,8 @@ function textBox(_input, _onModify, _extras = noone) : textInput(_input, _onModi
|
|||||||
if(key_mod_press(CTRL)) amo *= 10;
|
if(key_mod_press(CTRL)) amo *= 10;
|
||||||
if(key_mod_press(ALT)) amo /= 10;
|
if(key_mod_press(ALT)) amo /= 10;
|
||||||
|
|
||||||
if(mouse_wheel_down()) onModify(toNumber(_text) + amo);
|
if(mouse_wheel_down()) onModify(toNumber(_text) + amo * SCROLL_SPEED);
|
||||||
if(mouse_wheel_up()) onModify(toNumber(_text) - amo);
|
if(mouse_wheel_up()) onModify(toNumber(_text) - amo * SCROLL_SPEED);
|
||||||
}
|
}
|
||||||
} else if(!hide)
|
} else if(!hide)
|
||||||
draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, boxColor, 0.5 + 0.5 * interactable);
|
draw_sprite_stretched_ext(THEME.textbox, 0, _x, _y, _w, _h, boxColor, 0.5 + 0.5 * interactable);
|
||||||
|
@ -13,6 +13,7 @@ uniform float middle;
|
|||||||
uniform float radiusScale;
|
uniform float radiusScale;
|
||||||
uniform float radiusShatter;
|
uniform float radiusShatter;
|
||||||
uniform int pattern;
|
uniform int pattern;
|
||||||
|
uniform int colored;
|
||||||
|
|
||||||
#define TAU 6.283185307179586
|
#define TAU 6.283185307179586
|
||||||
|
|
||||||
@ -24,6 +25,13 @@ float random (in vec2 st) {
|
|||||||
return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123);
|
return fract(sin(dot(st.xy, vec2(12.9898, 78.233))) * 43758.5453123);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vec3 colorNoise(in vec2 st) {
|
||||||
|
float randR = random(st);
|
||||||
|
float randG = random(st + vec2(1.7227, 4.55529));
|
||||||
|
float randB = random(st + vec2(6.9950, 6.82063));
|
||||||
|
|
||||||
|
return vec3(randR, randG, randB);
|
||||||
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 pos = position / dimension;
|
vec2 pos = position / dimension;
|
||||||
@ -72,6 +80,10 @@ void main() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(colored == 0) {
|
||||||
float c = middle + (random(mp) - middle) * contrast;
|
float c = middle + (random(mp) - middle) * contrast;
|
||||||
gl_FragColor = vec4(vec3(c), 1.0);
|
gl_FragColor = vec4(vec3(c), 1.0);
|
||||||
|
} else if(colored == 1) {
|
||||||
|
gl_FragColor = vec4(colorNoise(mp), 1.);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,9 +10,19 @@ uniform vec2 scale;
|
|||||||
uniform float seed;
|
uniform float seed;
|
||||||
uniform float shift;
|
uniform float shift;
|
||||||
uniform int shiftAxis;
|
uniform int shiftAxis;
|
||||||
|
|
||||||
uniform int useSampler;
|
uniform int useSampler;
|
||||||
|
|
||||||
|
uniform int colored;
|
||||||
|
uniform vec2 colorRanR;
|
||||||
|
uniform vec2 colorRanG;
|
||||||
|
uniform vec2 colorRanB;
|
||||||
|
|
||||||
|
vec3 hsv2rgb(vec3 c) {
|
||||||
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||||
|
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||||
|
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||||
|
}
|
||||||
|
|
||||||
float randomSeed (in vec2 st, float _seed) {
|
float randomSeed (in vec2 st, float _seed) {
|
||||||
return fract(sin(dot(st.xy + vec2(5.0654, 9.684), vec2(12.9898, 78.233))) * (43758.5453123 + _seed));
|
return fract(sin(dot(st.xy + vec2(5.0654, 9.684), vec2(12.9898, 78.233))) * (43758.5453123 + _seed));
|
||||||
}
|
}
|
||||||
@ -36,9 +46,23 @@ void main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(useSampler == 0) {
|
if(useSampler == 0) {
|
||||||
vec2 i = floor(pos);
|
vec2 n = floor(pos);
|
||||||
float n = random(i);
|
|
||||||
gl_FragColor = vec4(vec3(n), 1.0);
|
if(colored == 0) {
|
||||||
|
gl_FragColor = vec4(vec3(random(n)), 1.0);
|
||||||
|
} else if(colored == 1) {
|
||||||
|
float randR = colorRanR[0] + random(n) * (colorRanR[1] - colorRanR[0]);
|
||||||
|
float randG = colorRanG[0] + random(n + vec2(1.7227, 4.55529)) * (colorRanG[1] - colorRanG[0]);
|
||||||
|
float randB = colorRanB[0] + random(n + vec2(6.9950, 6.82063)) * (colorRanB[1] - colorRanB[0]);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(randR, randG, randB, 1.0);
|
||||||
|
} else if(colored == 2) {
|
||||||
|
float randH = colorRanR[0] + random(n) * (colorRanR[1] - colorRanR[0]);
|
||||||
|
float randS = colorRanG[0] + random(n + vec2(1.7227, 4.55529)) * (colorRanG[1] - colorRanG[0]);
|
||||||
|
float randV = colorRanB[0] + random(n + vec2(6.9950, 6.82063)) * (colorRanB[1] - colorRanB[0]);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(hsv2rgb(vec3(randH, randS, randV)), 1.0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
vec2 samPos = floor(pos) / scale + 0.5 / scale;
|
vec2 samPos = floor(pos) / scale + 0.5 / scale;
|
||||||
gl_FragColor = texture2D( gm_BaseTexture, samPos );
|
gl_FragColor = texture2D( gm_BaseTexture, samPos );
|
||||||
|
@ -7,13 +7,41 @@ varying vec4 v_vColour;
|
|||||||
uniform vec2 dimension;
|
uniform vec2 dimension;
|
||||||
uniform float seed;
|
uniform float seed;
|
||||||
|
|
||||||
|
uniform int colored;
|
||||||
|
uniform vec2 colorRanR;
|
||||||
|
uniform vec2 colorRanG;
|
||||||
|
uniform vec2 colorRanB;
|
||||||
|
|
||||||
|
vec3 hsv2rgb(vec3 c) {
|
||||||
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||||
|
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||||
|
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||||
|
}
|
||||||
|
|
||||||
float random (in vec2 st, float seed) {
|
float random (in vec2 st, float seed) {
|
||||||
return fract(sin(dot(st.xy + seed, vec2(1892.9898, 78.23453))) * 437.54123);
|
return fract(sin(dot(st.xy + seed, vec2(1892.9898, 78.23453))) * 437.54123);
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
float frandom (in vec2 st) {
|
||||||
float n0 = random(v_vTexcoord, floor(seed) / 5000.);
|
float n0 = random(st, floor(seed) / 5000.);
|
||||||
float n1 = random(v_vTexcoord, (floor(seed) + 1.) / 5000.);
|
float n1 = random(st, (floor(seed) + 1.) / 5000.);
|
||||||
float n = mix(n0, n1, fract(seed));
|
return mix(n0, n1, fract(seed));
|
||||||
gl_FragColor = vec4(vec3(n), 1.0);
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
if(colored == 0)
|
||||||
|
gl_FragColor = vec4(vec3(frandom(v_vTexcoord)), 1.0);
|
||||||
|
else if(colored == 1) {
|
||||||
|
float randR = colorRanR[0] + frandom(v_vTexcoord) * (colorRanR[1] - colorRanR[0]);
|
||||||
|
float randG = colorRanG[0] + frandom(v_vTexcoord + vec2(1.7227, 4.55529)) * (colorRanG[1] - colorRanG[0]);
|
||||||
|
float randB = colorRanB[0] + frandom(v_vTexcoord + vec2(6.9950, 6.82063)) * (colorRanB[1] - colorRanB[0]);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(randR, randG, randB, 1.0);
|
||||||
|
} else if(colored == 2) {
|
||||||
|
float randH = colorRanR[0] + frandom(v_vTexcoord) * (colorRanR[1] - colorRanR[0]);
|
||||||
|
float randS = colorRanG[0] + frandom(v_vTexcoord + vec2(1.7227, 4.55529)) * (colorRanG[1] - colorRanG[0]);
|
||||||
|
float randV = colorRanB[0] + frandom(v_vTexcoord + vec2(6.9950, 6.82063)) * (colorRanB[1] - colorRanB[0]);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(hsv2rgb(vec3(randH, randS, randV)), 1.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,17 @@ uniform int iteration;
|
|||||||
uniform float seed;
|
uniform float seed;
|
||||||
uniform int tile;
|
uniform int tile;
|
||||||
|
|
||||||
|
uniform int colored;
|
||||||
|
uniform vec2 colorRanR;
|
||||||
|
uniform vec2 colorRanG;
|
||||||
|
uniform vec2 colorRanB;
|
||||||
|
|
||||||
|
vec3 hsv2rgb(vec3 c) {
|
||||||
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||||
|
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||||
|
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||||
|
}
|
||||||
|
|
||||||
float random (in vec2 st, float seed) {
|
float random (in vec2 st, float seed) {
|
||||||
return fract(sin(dot(st.xy + vec2(21.4564, 46.8564), vec2(12.9898, 78.233))) * (43758.5453123 + seed));
|
return fract(sin(dot(st.xy + vec2(21.4564, 46.8564), vec2(12.9898, 78.233))) * (43758.5453123 + seed));
|
||||||
}
|
}
|
||||||
@ -36,10 +47,10 @@ float noise (in vec2 st, in vec2 scale) {
|
|||||||
return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);
|
return mix(mix(a, b, u.x), mix(c, d, u.x), u.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
float perlin(in vec2 st) {
|
||||||
vec2 pos = (v_vTexcoord + position) * scale;
|
|
||||||
float amp = pow(2., float(iteration) - 1.) / (pow(2., float(iteration)) - 1.);
|
float amp = pow(2., float(iteration) - 1.) / (pow(2., float(iteration)) - 1.);
|
||||||
float n = 0.;
|
float n = 0.;
|
||||||
|
vec2 pos = st;
|
||||||
vec2 sc = scale;
|
vec2 sc = scale;
|
||||||
|
|
||||||
for(int i = 0; i < iteration; i++) {
|
for(int i = 0; i < iteration; i++) {
|
||||||
@ -50,5 +61,24 @@ void main() {
|
|||||||
pos *= 2.;
|
pos *= 2.;
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_FragColor = vec4(vec3(n), 1.0);
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
if(colored == 0) {
|
||||||
|
vec2 pos = (v_vTexcoord + position) * scale;
|
||||||
|
gl_FragColor = vec4(vec3(perlin(pos)), 1.0);
|
||||||
|
} else if(colored == 1) {
|
||||||
|
float randR = colorRanR[0] + perlin((v_vTexcoord + position) * scale) * (colorRanR[1] - colorRanR[0]);
|
||||||
|
float randG = colorRanG[0] + perlin((v_vTexcoord + position + vec2(1.7227, 4.55529)) * scale) * (colorRanG[1] - colorRanG[0]);
|
||||||
|
float randB = colorRanB[0] + perlin((v_vTexcoord + position + vec2(6.9950, 6.82063)) * scale) * (colorRanB[1] - colorRanB[0]);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(randR, randG, randB, 1.0);
|
||||||
|
} else if(colored == 2) {
|
||||||
|
float randH = colorRanR[0] + perlin((v_vTexcoord + position) * scale) * (colorRanR[1] - colorRanR[0]);
|
||||||
|
float randS = colorRanG[0] + perlin((v_vTexcoord + position + vec2(1.7227, 4.55529)) * scale) * (colorRanG[1] - colorRanG[0]);
|
||||||
|
float randV = colorRanB[0] + perlin((v_vTexcoord + position + vec2(6.9950, 6.82063)) * scale) * (colorRanB[1] - colorRanB[0]);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(hsv2rgb(vec3(randH, randS, randV)), 1.0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,17 @@ vec4 mod289(vec4 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }
|
|||||||
vec4 permute(vec4 x) { return mod289(((x * 34.0) + 10.0) * x); }
|
vec4 permute(vec4 x) { return mod289(((x * 34.0) + 10.0) * x); }
|
||||||
vec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }
|
vec4 taylorInvSqrt(vec4 r) { return 1.79284291400159 - 0.85373472095314 * r; }
|
||||||
|
|
||||||
|
uniform int colored;
|
||||||
|
uniform vec2 colorRanR;
|
||||||
|
uniform vec2 colorRanG;
|
||||||
|
uniform vec2 colorRanB;
|
||||||
|
|
||||||
|
vec3 hsv2rgb(vec3 c) {
|
||||||
|
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||||
|
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||||
|
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||||
|
}
|
||||||
|
|
||||||
float snoise(vec3 vec) {
|
float snoise(vec3 vec) {
|
||||||
vec3 v = vec * 4.;
|
vec3 v = vec * 4.;
|
||||||
|
|
||||||
@ -100,8 +111,8 @@ float snoise(vec3 vec) {
|
|||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
float simplex(in vec2 st) {
|
||||||
vec2 p = ((v_vTexcoord + position.xy) / scale) * 2.0 - 1.0;
|
vec2 p = ((st + position.xy) / scale) * 2.0 - 1.0;
|
||||||
float _z = 1. + position.z;
|
float _z = 1. + position.z;
|
||||||
vec3 xyz = vec3(p, _z);
|
vec3 xyz = vec3(p, _z);
|
||||||
|
|
||||||
@ -115,6 +126,23 @@ void main() {
|
|||||||
xyz *= 2.;
|
xyz *= 2.;
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_FragColor = vec4(vec3(n), 1.);
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
if(colored == 0) {
|
||||||
|
gl_FragColor = vec4(vec3(simplex(v_vTexcoord)), 1.0);
|
||||||
|
} else if(colored == 1) {
|
||||||
|
float randR = colorRanR[0] + simplex(v_vTexcoord) * (colorRanR[1] - colorRanR[0]);
|
||||||
|
float randG = colorRanG[0] + simplex(v_vTexcoord + vec2(1.7227, 4.55529)) * (colorRanG[1] - colorRanG[0]);
|
||||||
|
float randB = colorRanB[0] + simplex(v_vTexcoord + vec2(6.9950, 6.82063)) * (colorRanB[1] - colorRanB[0]);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(randR, randG, randB, 1.0);
|
||||||
|
} else if(colored == 2) {
|
||||||
|
float randH = colorRanR[0] + simplex(v_vTexcoord) * (colorRanR[1] - colorRanR[0]);
|
||||||
|
float randS = colorRanG[0] + simplex(v_vTexcoord + vec2(1.7227, 4.55529)) * (colorRanG[1] - colorRanG[0]);
|
||||||
|
float randV = colorRanB[0] + simplex(v_vTexcoord + vec2(6.9950, 6.82063)) * (colorRanB[1] - colorRanB[0]);
|
||||||
|
|
||||||
|
gl_FragColor = vec4(hsv2rgb(vec3(randH, randS, randV)), 1.0);
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user