mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 11:28:06 +01:00
1.0.3 fix
This commit is contained in:
parent
5d5e9f8f99
commit
2a5c236365
81 changed files with 1466 additions and 1283 deletions
|
@ -9,7 +9,7 @@
|
|||
{"id":{"name":"sh_perlin","path":"shaders/sh_perlin/sh_perlin.yy",},"order":1,},
|
||||
{"id":{"name":"sh_normal_light","path":"shaders/sh_normal_light/sh_normal_light.yy",},"order":0,},
|
||||
{"id":{"name":"sh_scale3x","path":"shaders/sh_scale3x/sh_scale3x.yy",},"order":33,},
|
||||
{"id":{"name":"surface_functions","path":"scripts/surface_functions/surface_functions.yy",},"order":2,},
|
||||
{"id":{"name":"surface_functions","path":"scripts/surface_functions/surface_functions.yy",},"order":5,},
|
||||
{"id":{"name":"s_node_normal","path":"sprites/s_node_normal/s_node_normal.yy",},"order":28,},
|
||||
{"id":{"name":"buffer_surface","path":"scripts/buffer_surface/buffer_surface.yy",},"order":3,},
|
||||
{"id":{"name":"node_pixel_sort","path":"scripts/node_pixel_sort/node_pixel_sort.yy",},"order":46,},
|
||||
|
@ -145,7 +145,7 @@
|
|||
{"id":{"name":"s_node_gradient_4points","path":"sprites/s_node_gradient_4points/s_node_gradient_4points.yy",},"order":2,},
|
||||
{"id":{"name":"s_node_gradient_out","path":"sprites/s_node_gradient_out/s_node_gradient_out.yy",},"order":8,},
|
||||
{"id":{"name":"s_node_vec3","path":"sprites/s_node_vec3/s_node_vec3.yy",},"order":7,},
|
||||
{"id":{"name":"surface_valid","path":"scripts/surface_valid/surface_valid.yy",},"order":3,},
|
||||
{"id":{"name":"surface_valid","path":"scripts/surface_valid/surface_valid.yy",},"order":6,},
|
||||
{"id":{"name":"sh_blur_radial","path":"shaders/sh_blur_radial/sh_blur_radial.yy",},"order":17,},
|
||||
{"id":{"name":"node_VFX_renderer","path":"scripts/node_VFX_renderer/node_VFX_renderer.yy",},"order":5,},
|
||||
{"id":{"name":"s_node_invert","path":"sprites/s_node_invert/s_node_invert.yy",},"order":25,},
|
||||
|
@ -175,6 +175,7 @@
|
|||
{"id":{"name":"node_mirror","path":"scripts/node_mirror/node_mirror.yy",},"order":3,},
|
||||
{"id":{"name":"node_corner","path":"scripts/node_corner/node_corner.yy",},"order":35,},
|
||||
{"id":{"name":"vertex_function","path":"scripts/vertex_function/vertex_function.yy",},"order":0,},
|
||||
{"id":{"name":"string_function","path":"scripts/string_function/string_function.yy",},"order":8,},
|
||||
{"id":{"name":"o_dialog_palette","path":"objects/o_dialog_palette/o_dialog_palette.yy",},"order":2,},
|
||||
{"id":{"name":"_f_p0","path":"fonts/_f_p0/_f_p0.yy",},"order":0,},
|
||||
{"id":{"name":"node_condition","path":"scripts/node_condition/node_condition.yy",},"order":0,},
|
||||
|
@ -946,12 +947,13 @@
|
|||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_single_hover.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_array_hover.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphic x2.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics x2.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_vfx.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/preview",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"anchor_arrow.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/preview",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics x2.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_noti_icon_tick.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"default.zip","CopyToMask":-1,"filePath":"datafiles/data/themes",},
|
||||
],
|
||||
"MetaData": {
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -666,6 +666,13 @@
|
|||
"bottom": 0
|
||||
}
|
||||
},
|
||||
"noti_icon_tick": {
|
||||
"path": "./icon/s_noti_icon_tick.png",
|
||||
"subimages": 1,
|
||||
"xorigin": 20,
|
||||
"yorigin": 20,
|
||||
"slice": null
|
||||
},
|
||||
"noti_icon_error": {
|
||||
"path": "./icon/s_noti_icon_error_strip2.png",
|
||||
"subimages": 2,
|
||||
|
|
File diff suppressed because it is too large
Load diff
BIN
datafiles/data/themes/default/graphics/icon/s_noti_icon_tick.png
Normal file
BIN
datafiles/data/themes/default/graphics/icon/s_noti_icon_tick.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 441 B |
|
@ -25,6 +25,7 @@ event_inherited();
|
|||
var yy = _y;
|
||||
draw_clear_alpha(COLORS.dialog_about_bg, 0);
|
||||
|
||||
BLEND_ADD
|
||||
draw_set_font(f_p2);
|
||||
draw_set_color(COLORS._main_text_sub);
|
||||
draw_text(cx, yy, "Special Thanks");
|
||||
|
@ -48,6 +49,7 @@ event_inherited();
|
|||
yy += ui(40);
|
||||
draw_text_ext(cx, yy, "Made with GameMaker Studio 2, Abode Illustrator, Aseprite", -1, sc_thank.w - ui(16));
|
||||
yy += ui(32);
|
||||
BLEND_NORMAL
|
||||
|
||||
return yy - _h + ui(32);
|
||||
})
|
||||
|
|
|
@ -83,8 +83,12 @@ if !ready exit;
|
|||
var by = dialog_y + ui(16);
|
||||
|
||||
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, sFOCUS, sHOVER, "Key blending", THEME.grad_blend) == 2) {
|
||||
if(grad_data != noone)
|
||||
grad_data[| 0] = (grad_data[| 0] + 1) % 3;
|
||||
var dia = dialogCall(o_dialog_menubox, bx + ui(32), by);
|
||||
dia.setMenu([
|
||||
[ "RGB blend", function() { grad_data[| 0] = 0; } ],
|
||||
[ "HSV blend", function() { grad_data[| 0] = 2; } ],
|
||||
[ "Hard blend", function() { grad_data[| 0] = 1; } ],
|
||||
]);
|
||||
}
|
||||
bx -= ui(32);
|
||||
#endregion
|
||||
|
|
|
@ -20,7 +20,7 @@ event_inherited();
|
|||
|
||||
var hh = 32;
|
||||
var yy = _y;
|
||||
var txw = sp_noti.w - ui(48 + 48 + 20);
|
||||
var txw = sp_noti.surface_w - ui(48 + 48 + 20);
|
||||
var amo = ds_list_size(STATUSES);
|
||||
|
||||
draw_set_font(f_p3);
|
||||
|
|
|
@ -239,7 +239,7 @@ event_inherited();
|
|||
draw_clear_alpha(COLORS.panel_bg_clear, 0);
|
||||
var hh = 0;
|
||||
var th = ui(28);
|
||||
var x1 = dialog_w - ui(208);
|
||||
var x1 = sp_colors.surface_w;
|
||||
var yy = _y + ui(8);
|
||||
var padd = ui(6);
|
||||
var ind = 0;
|
||||
|
@ -315,7 +315,7 @@ event_inherited();
|
|||
draw_clear_alpha(COLORS.panel_bg_clear, 0);
|
||||
var hh = 0;
|
||||
var th = TEXTBOX_HEIGHT;
|
||||
var x1 = dialog_w - ui(200);
|
||||
var x1 = sp_pref.surface_w;
|
||||
var yy = _y + ui(8);
|
||||
var padd = ui(6);
|
||||
var ind = 0;
|
||||
|
@ -394,7 +394,7 @@ event_inherited();
|
|||
var padd = ui(8);
|
||||
var hh = 0;
|
||||
var currGroup = -1;
|
||||
var x1 = dialog_w - ui(192);
|
||||
var x1 = sp_hotkey.surface_w;
|
||||
|
||||
for(var j = 0; j < ds_list_size(HOTKEY_CONTEXT); j++) {
|
||||
var ll = HOTKEYS[? HOTKEY_CONTEXT[| j]];
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
DIRECTORY = environment_get_variable("userprofile") + "\\AppData\\Local\\Pixels_Composer\\";
|
||||
if(!directory_exists(DIRECTORY))
|
||||
directory_create(DIRECTORY);
|
||||
if(!directory_exists(DIRECTORY + "temp"))
|
||||
directory_create(DIRECTORY + "temp");
|
||||
|
||||
log_clear();
|
||||
log_newline();
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
"resourceType": "GMWindowsOptions",
|
||||
"resourceVersion": "1.1",
|
||||
"name": "Windows",
|
||||
"option_windows_display_name": "Pixel Composer 1.0.1",
|
||||
"option_windows_executable_name": "${project_name} 1.0.1.exe",
|
||||
"option_windows_version": "1.0.1.0",
|
||||
"option_windows_display_name": "Pixel Composer 1.0.3",
|
||||
"option_windows_executable_name": "${project_name} 1.0.3.exe",
|
||||
"option_windows_version": "1.0.3.0",
|
||||
"option_windows_company_info": "MakhamDev",
|
||||
"option_windows_product_info": "Pixel Composer",
|
||||
"option_windows_copyright_info": "",
|
||||
|
|
|
@ -87,21 +87,21 @@
|
|||
vertex_add_pnt(VB, [_0, _1, _1], [0, -1, 0], [0, 1]);
|
||||
|
||||
|
||||
vertex_add_pnt(VB, [_0, _1, _0], [1, 0, 0], [1, 0]);
|
||||
vertex_add_pnt(VB, [_0, _1, _0], [1, 0, 0], [0, 1]);
|
||||
vertex_add_pnt(VB, [_0, _0, _0], [1, 0, 0], [0, 0]);
|
||||
vertex_add_pnt(VB, [_0, _1, _1], [1, 0, 0], [1, 1]);
|
||||
|
||||
vertex_add_pnt(VB, [_0, _1, _1], [1, 0, 0], [1, 1]);
|
||||
vertex_add_pnt(VB, [_0, _0, _0], [1, 0, 0], [0, 0]);
|
||||
vertex_add_pnt(VB, [_0, _0, _1], [1, 0, 0], [0, 1]);
|
||||
vertex_add_pnt(VB, [_0, _0, _1], [1, 0, 0], [1, 0]);
|
||||
|
||||
vertex_add_pnt(VB, [_1, _1, _0], [-1, 0, 0], [1, 0]);
|
||||
vertex_add_pnt(VB, [_1, _1, _0], [-1, 0, 0], [0, 1]);
|
||||
vertex_add_pnt(VB, [_1, _0, _0], [-1, 0, 0], [0, 0]);
|
||||
vertex_add_pnt(VB, [_1, _1, _1], [-1, 0, 0], [1, 1]);
|
||||
|
||||
vertex_add_pnt(VB, [_1, _1, _1], [-1, 0, 0], [1, 1]);
|
||||
vertex_add_pnt(VB, [_1, _0, _0], [-1, 0, 0], [0, 0]);
|
||||
vertex_add_pnt(VB, [_1, _0, _1], [-1, 0, 0], [0, 1]);
|
||||
vertex_add_pnt(VB, [_1, _0, _1], [-1, 0, 0], [1, 0]);
|
||||
|
||||
vertex_end(VB);
|
||||
vertex_freeze(VB);
|
||||
|
|
|
@ -7,7 +7,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = -1) : Node(_x, _y, _group) const
|
|||
inputs[| 1] = nodeValue(1, "Spawn delay", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 4);
|
||||
inputs[| 2] = nodeValue(2, "Spawn amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 2);
|
||||
inputs[| 3] = nodeValue(3, "Spawn area", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2, def_surf_size / 2, def_surf_size / 2, AREA_SHAPE.rectangle ])
|
||||
.setDisplay(VALUE_DISPLAY.area, function() { return inputs[| 1].getValue(); });
|
||||
.setDisplay(VALUE_DISPLAY.area);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Spawn distribution", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_button, [ "Area", "Border" ]);
|
||||
|
|
|
@ -59,6 +59,13 @@ function APPEND(_path) {
|
|||
printlog("Deserialize time: " + string(current_time - t));
|
||||
t = current_time;
|
||||
|
||||
try {
|
||||
for(var i = 0; i < ds_list_size(appended_list); i++)
|
||||
appended_list[| i].applyDeserialize();
|
||||
} catch(e) {
|
||||
log_warning("LOAD, apply deserialize", e.longMessage);
|
||||
}
|
||||
|
||||
try {
|
||||
for(var i = 0; i < ds_list_size(appended_list); i++)
|
||||
appended_list[| i].preConnect();
|
||||
|
@ -122,5 +129,6 @@ function APPEND(_path) {
|
|||
function GetAppendID(old_id) {
|
||||
if(ds_map_exists(APPEND_MAP, old_id))
|
||||
return APPEND_MAP[? old_id];
|
||||
print("Get append ID error: " + string(old_id));
|
||||
return -1;
|
||||
}
|
|
@ -1,3 +1,10 @@
|
|||
function array_safe_set(arr, index, value) {
|
||||
if(index < 0) return;
|
||||
if(index >= array_length(arr)) return;
|
||||
|
||||
array_set(arr, index, value);
|
||||
}
|
||||
|
||||
function array_safe_get(arr, index, def = 0) {
|
||||
if(index >= array_length(arr)) return def;
|
||||
return arr[index];
|
||||
|
|
|
@ -81,6 +81,7 @@ function colorSelector(onApply = noone) constructor {
|
|||
hue = round(color_get_hue(current_color));
|
||||
sat = round(color_get_saturation(current_color));
|
||||
val = round(color_get_value(current_color));
|
||||
onApply(current_color);
|
||||
}
|
||||
function setHSV() {
|
||||
current_color = make_color_hsv(hue, sat, val);
|
||||
|
@ -90,6 +91,7 @@ function colorSelector(onApply = noone) constructor {
|
|||
function setColor(color) {
|
||||
current_color = color;
|
||||
resetHSV();
|
||||
onApply(current_color);
|
||||
}
|
||||
|
||||
function colorPicker() {
|
||||
|
|
|
@ -20,9 +20,9 @@
|
|||
COLOR_KEYS = [];
|
||||
|
||||
globalvar VERSION, SAVEFILE_VERSION, VERSION_STRING;
|
||||
VERSION = 1010;
|
||||
VERSION = 1030;
|
||||
SAVEFILE_VERSION = 1000;
|
||||
VERSION_STRING = "1.0.1";
|
||||
VERSION_STRING = "1.0.3";
|
||||
|
||||
globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT;
|
||||
|
||||
|
|
|
@ -107,6 +107,13 @@ function LOAD_PATH(path, readonly = false) {
|
|||
log_warning("LOAD, deserialize", e.longMessage);
|
||||
}
|
||||
|
||||
try {
|
||||
for(var i = 0; i < ds_list_size(create_list); i++)
|
||||
create_list[| i].applyDeserialize();
|
||||
} catch(e) {
|
||||
log_warning("LOAD, apply deserialize", e.longMessage);
|
||||
}
|
||||
|
||||
try {
|
||||
for(var i = 0; i < ds_list_size(create_list); i++)
|
||||
create_list[| i].preConnect();
|
||||
|
|
|
@ -8,10 +8,11 @@ enum LIGHT_SHAPE_2D {
|
|||
function Node_2D_light(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "2D light";
|
||||
|
||||
uniform_colr = shader_get_uniform(sh_2d_light, "color");
|
||||
uniform_intn = shader_get_uniform(sh_2d_light, "intensity");
|
||||
uniform_band = shader_get_uniform(sh_2d_light, "band");
|
||||
uniform_attn = shader_get_uniform(sh_2d_light, "atten");
|
||||
shader = sh_2d_light;
|
||||
uniform_colr = shader_get_uniform(shader, "color");
|
||||
uniform_intn = shader_get_uniform(shader, "intensity");
|
||||
uniform_band = shader_get_uniform(shader, "band");
|
||||
uniform_attn = shader_get_uniform(shader, "atten");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Light shape", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
|
@ -127,8 +128,8 @@ function Node_2D_light(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) con
|
|||
draw_clear_alpha(c_black, 1);
|
||||
}
|
||||
|
||||
gpu_set_blendmode(bm_add);
|
||||
shader_set(sh_2d_light);
|
||||
BLEND_ADD
|
||||
shader_set(shader);
|
||||
gpu_set_colorwriteenable(1, 1, 1, 0);
|
||||
|
||||
shader_set_uniform_f(uniform_intn, _inten);
|
||||
|
@ -180,7 +181,7 @@ function Node_2D_light(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) con
|
|||
|
||||
gpu_set_colorwriteenable(1, 1, 1, 1);
|
||||
shader_reset();
|
||||
gpu_set_blendmode(bm_normal);
|
||||
BLEND_NORMAL
|
||||
surface_reset_target();
|
||||
|
||||
return _outSurf;
|
||||
|
|
|
@ -7,7 +7,7 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
uniLightInt = shader_get_uniform(sh_vertex_pnt_light, "u_LightIntensity");
|
||||
uniLightNrm = shader_get_uniform(sh_vertex_pnt_light, "useNormal");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone).rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue(1, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
@ -27,6 +27,7 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
inputs[| 6] = nodeValue(6, "Manual generate", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||
generateMesh();
|
||||
update();
|
||||
}, "Generate"] );
|
||||
|
||||
inputs[| 7] = nodeValue(7, "Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
|
@ -133,7 +134,7 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
vertex_add_pnt(VB, [i0, j0, dep], [0, 0, 1], [tx0, ty0]);
|
||||
vertex_add_pnt(VB, [i0, j1, dep], [0, 0, 1], [tx0, ty1]);
|
||||
|
||||
if((useH && dep > hei[i][j - 1]) || (j == 0 || ap[i][j - 1] == 0)) {
|
||||
if((useH && dep * 2 > hei[i][j - 1]) || (j == 0 || ap[i][j - 1] == 0)) {
|
||||
vertex_add_pnt(VB, [i0, j0, dep], [0, -1, 0], [tx1, ty0]);
|
||||
vertex_add_pnt(VB, [i0, j0, -dep], [0, -1, 0], [tx0, ty0]);
|
||||
vertex_add_pnt(VB, [i1, j0, dep], [0, -1, 0], [tx1, ty1]);
|
||||
|
@ -143,7 +144,7 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
vertex_add_pnt(VB, [i1, j0, dep], [0, -1, 0], [tx0, ty1]);
|
||||
}
|
||||
|
||||
if((useH && dep > hei[i][j + 1]) || (j == hh - 1 || ap[i][j + 1] == 0)) {
|
||||
if((useH && dep * 2 > hei[i][j + 1]) || (j == hh - 1 || ap[i][j + 1] == 0)) {
|
||||
vertex_add_pnt(VB, [i0, j1, dep], [0, 1, 0], [tx1, ty0]);
|
||||
vertex_add_pnt(VB, [i0, j1, -dep], [0, 1, 0], [tx0, ty0]);
|
||||
vertex_add_pnt(VB, [i1, j1, dep], [0, 1, 0], [tx1, ty1]);
|
||||
|
@ -153,7 +154,7 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
vertex_add_pnt(VB, [i1, j1, dep], [0, 1, 0], [tx0, ty1]);
|
||||
}
|
||||
|
||||
if((useH && dep > hei[i - 1][j]) || (i == 0 || ap[i - 1][j] == 0)) {
|
||||
if((useH && dep * 2 > hei[i - 1][j]) || (i == 0 || ap[i - 1][j] == 0)) {
|
||||
vertex_add_pnt(VB, [i0, j0, dep], [1, 0, 0], [tx1, ty0]);
|
||||
vertex_add_pnt(VB, [i0, j0, -dep], [1, 0, 0], [tx0, ty0]);
|
||||
vertex_add_pnt(VB, [i0, j1, dep], [1, 0, 0], [tx1, ty1]);
|
||||
|
@ -163,7 +164,7 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
vertex_add_pnt(VB, [i0, j1, dep], [1, 0, 0], [tx0, ty1]);
|
||||
}
|
||||
|
||||
if((useH && dep > hei[i + 1][j]) || (i == ww - 1 || ap[i + 1][j] == 0)) {
|
||||
if((useH && dep * 2 > hei[i + 1][j]) || (i == ww - 1 || ap[i + 1][j] == 0)) {
|
||||
vertex_add_pnt(VB, [i1, j0, dep], [-1, 0, 0], [tx1, ty0]);
|
||||
vertex_add_pnt(VB, [i1, j0, -dep], [-1, 0, 0], [tx0, ty0]);
|
||||
vertex_add_pnt(VB, [i1, j1, dep], [-1, 0, 0], [tx1, ty1]);
|
||||
|
@ -174,7 +175,6 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
}
|
||||
}
|
||||
vertex_end(VB);
|
||||
update();
|
||||
}
|
||||
|
||||
drag_index = -1;
|
||||
|
@ -301,6 +301,9 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
|
||||
if(!is_surface(_ins)) return _outSurf;
|
||||
|
||||
if(ANIMATOR.frame_progress)
|
||||
generateMesh();
|
||||
|
||||
var TM = matrix_build(_pos[0], _pos[1], 0, _rot[0], _rot[1], _rot[2], _dim[0] * _sca[0], _dim[1] * _sca[1], 1);
|
||||
var cam_proj = matrix_build_projection_ortho(_dim[0], _dim[1], 1, 100);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function Node_3D_Cube(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
function Node_3D_Cube(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Cube";
|
||||
|
||||
uniVertex_lightFor = shader_get_uniform(sh_vertex_pnt_light, "u_LightForward");
|
||||
|
@ -78,10 +78,10 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
var cy = _y + _pos[1] * _s;
|
||||
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line(cx - 64, cy, cx + 64, cy);
|
||||
draw_line_width(cx - 64, cy, cx + 64, cy, drag_index == 0? 3 : 1);
|
||||
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line(cx, cy - 64, cx, cy + 64);
|
||||
draw_line_width(cx, cy - 64, cx, cy + 64, drag_index == 1? 3 : 1);
|
||||
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle(cx, cy, 64, true);
|
||||
|
@ -153,38 +153,36 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
var _inSurf = inputs[| 0].getValue();
|
||||
var _dim = inputs[| 1].getValue();
|
||||
var _pos = inputs[| 2].getValue();
|
||||
var _rot = inputs[| 3].getValue();
|
||||
var _sca = inputs[| 4].getValue();
|
||||
var _lsc = inputs[| 12].getValue();
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
var _inSurf = _data[0];
|
||||
var _dim = _data[1];
|
||||
var _pos = _data[2];
|
||||
var _rot = _data[3];
|
||||
var _sca = _data[4];
|
||||
var _lsc = _data[12];
|
||||
|
||||
var _ldir = inputs[| 13].getValue();
|
||||
var _lhgt = inputs[| 14].getValue();
|
||||
var _lint = inputs[| 15].getValue();
|
||||
var _lclr = inputs[| 16].getValue();
|
||||
var _aclr = inputs[| 17].getValue();
|
||||
var _ldir = _data[13];
|
||||
var _lhgt = _data[14];
|
||||
var _lint = _data[15];
|
||||
var _lclr = _data[16];
|
||||
var _aclr = _data[17];
|
||||
|
||||
var _usetex = inputs[| 5].getValue();
|
||||
var _usetex = _data[5];
|
||||
var _ww = _usetex? _dim[0] : surface_get_width(_inSurf);
|
||||
var _hh = _usetex? _dim[1] : surface_get_height(_inSurf);
|
||||
|
||||
for(var i = 6; i <= 11; i++) inputs[| i].setVisible(_usetex);
|
||||
inputs[| 0].setVisible(true, !_usetex);
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
if(!is_surface(_outSurf)) {
|
||||
if(!is_surface(_outSurf))
|
||||
_outSurf = surface_create_valid(_dim[0], _dim[1]);
|
||||
outputs[| 0].setValue(_outSurf);
|
||||
} else
|
||||
else
|
||||
surface_size_to(_outSurf, _dim[0], _dim[1]);
|
||||
|
||||
TM = matrix_build(_pos[0], _pos[1], 0, _rot[0], _rot[1], _rot[2], _ww * _sca[0], _hh * _sca[1], 1);
|
||||
cam_proj = matrix_build_projection_ortho(_ww, _hh, 1, 100);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
camera_set_view_size(cam, _ww, _hh);
|
||||
camera_set_view_size(cam, _dim[0], _dim[1]);
|
||||
|
||||
var lightFor = [ -cos(degtorad(_ldir)), -_lhgt, -sin(degtorad(_ldir)) ];
|
||||
|
||||
|
@ -205,7 +203,7 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
|
||||
if(_usetex) {
|
||||
var face = [];
|
||||
for(var i = 0; i < 6; i++) face[i] = inputs[| 6 + i].getValue();
|
||||
for(var i = 0; i < 6; i++) face[i] = _data[6 + i];
|
||||
|
||||
matrix_stack_push(matrix_build(0, 0, 0.5, 0, 0, 0, 1, 1, 1));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function Node_3D_Cylinder(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
function Node_3D_Cylinder(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Cylinder";
|
||||
|
||||
uniVertex_lightFor = shader_get_uniform(sh_vertex_pnt_light, "u_LightForward");
|
||||
|
@ -201,9 +201,9 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
camera_set_view_mat(cam, cam_proj);
|
||||
#endregion
|
||||
|
||||
static update = function() {
|
||||
var _sides = inputs[| 0].getValue();
|
||||
var _thick = inputs[| 1].getValue();
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
var _sides = _data[0];
|
||||
var _thick = _data[1];
|
||||
|
||||
if(_sides != sides || _thick != thick) {
|
||||
sides = _sides;
|
||||
|
@ -211,26 +211,24 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
generate_vb();
|
||||
}
|
||||
|
||||
var _dim = inputs[| 2].getValue();
|
||||
var _pos = inputs[| 3].getValue();
|
||||
var _rot = inputs[| 4].getValue();
|
||||
var _sca = inputs[| 5].getValue();
|
||||
var face_top = inputs[| 6].getValue();
|
||||
var face_bot = inputs[| 7].getValue();
|
||||
var face_sid = inputs[| 8].getValue();
|
||||
var _lsc = inputs[| 9].getValue();
|
||||
var _dim = _data[2];
|
||||
var _pos = _data[3];
|
||||
var _rot = _data[4];
|
||||
var _sca = _data[5];
|
||||
var face_top = _data[6];
|
||||
var face_bot = _data[7];
|
||||
var face_sid = _data[8];
|
||||
var _lsc = _data[9];
|
||||
|
||||
var _ldir = inputs[| 10].getValue();
|
||||
var _lhgt = inputs[| 11].getValue();
|
||||
var _lint = inputs[| 12].getValue();
|
||||
var _lclr = inputs[| 13].getValue();
|
||||
var _aclr = inputs[| 14].getValue();
|
||||
var _ldir = _data[10];
|
||||
var _lhgt = _data[11];
|
||||
var _lint = _data[12];
|
||||
var _lclr = _data[13];
|
||||
var _aclr = _data[14];
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
if(!is_surface(_outSurf)) {
|
||||
if(!is_surface(_outSurf))
|
||||
_outSurf = surface_create_valid(_dim[0], _dim[1]);
|
||||
outputs[| 0].setValue(_outSurf);
|
||||
} else
|
||||
else
|
||||
surface_size_to(_outSurf, _dim[0], _dim[1]);
|
||||
|
||||
TM = matrix_build(_pos[0], _pos[1], 0, _rot[0], _rot[1], _rot[2], _dim[0] * _sca[0], _dim[1] * _sca[1], 1);
|
||||
|
|
|
@ -16,12 +16,13 @@ function Node_VFX_Renderer(_x, _y, _group = -1) : Node(_x, _y, _group) construct
|
|||
inputs[| index] = nodeValue( index, "Particles", self, JUNCTION_CONNECT.input, VALUE_TYPE.object, noone )
|
||||
.setVisible(true, true);
|
||||
}
|
||||
createNewInput();
|
||||
if(!LOADING && !APPENDING) createNewInput();
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static updateValueFrom = function(index) {
|
||||
if(index < input_index) return;
|
||||
if(LOADING || APPENDING) return;
|
||||
|
||||
var _l = ds_list_create();
|
||||
for( var i = 0; i < ds_list_size(inputs); i++ ) {
|
||||
|
|
|
@ -10,23 +10,23 @@ function Node_Array(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
inputs[| index] = nodeValue( index, "Input", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, -1 )
|
||||
.setVisible(true, true);
|
||||
}
|
||||
createNewInput();
|
||||
if(!LOADING && !APPENDING) createNewInput();
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, []);
|
||||
|
||||
static updateValueFrom = function(index) {
|
||||
if(LOADING || APPENDING) return;
|
||||
|
||||
var _l = ds_list_create();
|
||||
for( var i = 0; i < ds_list_size(inputs); i++ ) {
|
||||
if(inputs[| i].value_from) {
|
||||
if(inputs[| i].value_from)
|
||||
ds_list_add(_l, inputs[| i]);
|
||||
} else {
|
||||
else
|
||||
delete inputs[| i];
|
||||
}
|
||||
}
|
||||
|
||||
for( var i = 0; i < ds_list_size(_l); i++ ) {
|
||||
for( var i = 0; i < ds_list_size(_l); i++ )
|
||||
_l[| i].index = i;
|
||||
}
|
||||
|
||||
ds_list_destroy(inputs);
|
||||
inputs = _l;
|
||||
|
@ -48,8 +48,7 @@ function Node_Array(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
static postDeserialize = function() {
|
||||
var _inputs = load_map[? "inputs"];
|
||||
|
||||
for(var i = 0; i < ds_list_size(_inputs); i++) {
|
||||
for(var i = 0; i < ds_list_size(_inputs); i++)
|
||||
createNewInput();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,10 +1,11 @@
|
|||
function Node_Bevel(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Bevel";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_bevel, "dimension");
|
||||
uniform_shf = shader_get_uniform(sh_bevel, "shift");
|
||||
uniform_sca = shader_get_uniform(sh_bevel, "scale");
|
||||
uniform_hei = shader_get_uniform(sh_bevel, "height");
|
||||
shader = sh_bevel;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_shf = shader_get_uniform(shader, "shift");
|
||||
uniform_sca = shader_get_uniform(shader, "scale");
|
||||
uniform_hei = shader_get_uniform(shader, "height");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Height", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 4);
|
||||
|
@ -26,7 +27,7 @@ function Node_Bevel(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_bevel);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_hei, _hei);
|
||||
shader_set_uniform_f_array(uniform_shf, _shf);
|
||||
shader_set_uniform_f_array(uniform_sca, _sca);
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
function Node_Bloom(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Bloom";
|
||||
|
||||
uniform_size = shader_get_uniform(sh_bloom_pass1, "size");
|
||||
uniform_tole = shader_get_uniform(sh_bloom_pass1, "tolerance");
|
||||
shader = sh_bloom_pass1;
|
||||
uniform_size = shader_get_uniform(shader, "size");
|
||||
uniform_tole = shader_get_uniform(shader, "tolerance");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 3)
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
function Node_Blur_Contrast(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Blur contrast";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_blur_box_contrast, "dimension");
|
||||
uniform_siz = shader_get_uniform(sh_blur_box_contrast, "size");
|
||||
uniform_tes = shader_get_uniform(sh_blur_box_contrast, "treshold");
|
||||
uniform_dir = shader_get_uniform(sh_blur_box_contrast, "direction");
|
||||
shader = sh_blur_box_contrast;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_siz = shader_get_uniform(shader, "size");
|
||||
uniform_tes = shader_get_uniform(shader, "treshold");
|
||||
uniform_dir = shader_get_uniform(shader, "direction");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 3)
|
||||
|
@ -31,7 +32,7 @@ function Node_Blur_Contrast(_x, _y, _group = -1) : Node_Processor(_x, _y, _group
|
|||
surface_set_target(pass);
|
||||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
shader_set(sh_blur_box_contrast);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [ ww, hh ]);
|
||||
shader_set_uniform_f(uniform_siz, _size);
|
||||
shader_set_uniform_f(uniform_tes, _tres);
|
||||
|
@ -44,7 +45,7 @@ function Node_Blur_Contrast(_x, _y, _group = -1) : Node_Processor(_x, _y, _group
|
|||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
shader_set(sh_blur_box_contrast);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_i(uniform_dir, 1);
|
||||
draw_surface_safe(pass, 0, 0);
|
||||
shader_reset();
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
function Node_Blur_Directional(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Directional blur";
|
||||
|
||||
uniform_str = shader_get_uniform(sh_blur_directional, "strength");
|
||||
uniform_dir = shader_get_uniform(sh_blur_directional, "direction");
|
||||
shader = sh_blur_directional;
|
||||
uniform_str = shader_get_uniform(shader, "strength");
|
||||
uniform_dir = shader_get_uniform(shader, "direction");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Strength", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.2)
|
||||
|
@ -33,7 +34,7 @@ function Node_Blur_Directional(_x, _y, _group = -1) : Node_Processor(_x, _y, _gr
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_blur_directional);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_str, _str);
|
||||
shader_set_uniform_f(uniform_dir, _dir + 90);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
function Node_Blur_Radial(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Blur_Radial";
|
||||
|
||||
uniform_str = shader_get_uniform(sh_blur_radial, "strength");
|
||||
uniform_cen = shader_get_uniform(sh_blur_radial, "center");
|
||||
shader = sh_blur_radial;
|
||||
uniform_str = shader_get_uniform(shader, "strength");
|
||||
uniform_cen = shader_get_uniform(shader, "center");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Strength", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.2);
|
||||
|
@ -31,7 +32,7 @@ function Node_Blur_Radial(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_blur_radial);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_str, _str);
|
||||
shader_set_uniform_f_array(uniform_cen, _cen);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
function Node_BW(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "BW";
|
||||
|
||||
uniform_exp = shader_get_uniform(sh_bw, "brightness");
|
||||
uniform_con = shader_get_uniform(sh_bw, "contrast");
|
||||
shader = sh_bw;
|
||||
uniform_exp = shader_get_uniform(shader, "brightness");
|
||||
uniform_con = shader_get_uniform(shader, "contrast");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Brightness", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
|
@ -20,7 +21,7 @@ function Node_BW(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) construct
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_bw);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_exp, _exp);
|
||||
shader_set_uniform_f(uniform_con, _con);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
|
|
@ -77,7 +77,7 @@ function Node_Collection(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
static stepBegin = function() {
|
||||
use_cache = false;
|
||||
auto_update = true;
|
||||
cache_result[ANIMATOR.current_frame] = true;
|
||||
array_safe_set(cache_result, ANIMATOR.current_frame, true);
|
||||
|
||||
for(var i = 0; i < ds_list_size(nodes); i++) {
|
||||
var n = nodes[| i];
|
||||
|
@ -86,7 +86,8 @@ function Node_Collection(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
if(!n.use_cache) continue;
|
||||
|
||||
use_cache = true;
|
||||
cache_result[ANIMATOR.current_frame] &= n.cache_result[ANIMATOR.current_frame];
|
||||
if(!array_safe_get(n.cache_result, ANIMATOR.current_frame))
|
||||
array_safe_set(cache_result, ANIMATOR.current_frame, false);
|
||||
}
|
||||
|
||||
var out_surf = false;
|
||||
|
@ -108,12 +109,6 @@ function Node_Collection(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
doStepBegin();
|
||||
}
|
||||
|
||||
static doUpdate = function() {
|
||||
//for(var i = 0; i < ds_list_size(nodes); i++) {
|
||||
// nodes[| i].doUpdate();
|
||||
//}
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
render_time = 0;
|
||||
for(var i = 0; i < ds_list_size(nodes); i++) {
|
||||
|
@ -202,4 +197,8 @@ function Node_Collection(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
nodes[| i].resetAllRenderStatus();
|
||||
}
|
||||
}
|
||||
|
||||
static postDeserialize = function() {
|
||||
sortIO();
|
||||
}
|
||||
}
|
|
@ -1,19 +1,20 @@
|
|||
function Node_Color_adjust(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Color adjust";
|
||||
|
||||
uniform_bri = shader_get_uniform(sh_color_adjust, "brightness");
|
||||
uniform_exp = shader_get_uniform(sh_color_adjust, "exposure");
|
||||
uniform_con = shader_get_uniform(sh_color_adjust, "contrast");
|
||||
uniform_hue = shader_get_uniform(sh_color_adjust, "hue");
|
||||
uniform_sat = shader_get_uniform(sh_color_adjust, "sat");
|
||||
uniform_val = shader_get_uniform(sh_color_adjust, "val");
|
||||
uniform_alp = shader_get_uniform(sh_color_adjust, "alpha");
|
||||
shader = sh_color_adjust;
|
||||
uniform_bri = shader_get_uniform(shader, "brightness");
|
||||
uniform_exp = shader_get_uniform(shader, "exposure");
|
||||
uniform_con = shader_get_uniform(shader, "contrast");
|
||||
uniform_hue = shader_get_uniform(shader, "hue");
|
||||
uniform_sat = shader_get_uniform(shader, "sat");
|
||||
uniform_val = shader_get_uniform(shader, "val");
|
||||
uniform_alp = shader_get_uniform(shader, "alpha");
|
||||
|
||||
uniform_bl = shader_get_uniform(sh_color_adjust, "blend");
|
||||
uniform_bla = shader_get_uniform(sh_color_adjust, "blendAlpha");
|
||||
uniform_bl = shader_get_uniform(shader, "blend");
|
||||
uniform_bla = shader_get_uniform(shader, "blendAlpha");
|
||||
|
||||
uniform_mask_use = shader_get_uniform(sh_color_adjust, "use_mask");
|
||||
uniform_mask = shader_get_sampler_index(sh_color_adjust, "mask");
|
||||
uniform_mask_use = shader_get_uniform(shader, "use_mask");
|
||||
uniform_mask = shader_get_sampler_index(shader, "mask");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
|
@ -70,7 +71,7 @@ function Node_Color_adjust(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_color_adjust);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_i(uniform_mask_use, _m != DEF_SURFACE);
|
||||
texture_set_stage(uniform_mask, surface_get_texture(_m));
|
||||
|
||||
|
|
|
@ -21,18 +21,18 @@ function Node_Color_Data(_x, _y, _group = -1) : Node_Value_Processor(_x, _y, _gr
|
|||
var c = _data[0];
|
||||
|
||||
switch(index) {
|
||||
case 0 : return color_get_red(c);
|
||||
case 1 : return color_get_green(c);
|
||||
case 2 : return color_get_blue(c);
|
||||
case 0 : return color_get_red(c) / 255;
|
||||
case 1 : return color_get_green(c) / 255;
|
||||
case 2 : return color_get_blue(c) / 255;
|
||||
|
||||
case 3 : return color_get_hue(c);
|
||||
case 4 : return color_get_saturation(c);
|
||||
case 5 : return color_get_value(c);
|
||||
case 3 : return color_get_hue(c) / 255;
|
||||
case 4 : return color_get_saturation(c) / 255;
|
||||
case 5 : return color_get_value(c) / 255;
|
||||
|
||||
case 6 :
|
||||
var r = color_get_red(c);
|
||||
var g = color_get_green(c);
|
||||
var b = color_get_blue(c);
|
||||
var r = color_get_red(c) / 255;
|
||||
var g = color_get_green(c) / 255;
|
||||
var b = color_get_blue(c) / 255;
|
||||
return 0.299 * r + 0.587 * g + 0.224 * b;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
function Node_Color_Remove(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Color Remove";
|
||||
|
||||
uniform_from = shader_get_uniform(sh_color_remove, "colorFrom");
|
||||
uniform_from_count = shader_get_uniform(sh_color_remove, "colorFrom_amo");
|
||||
shader = sh_color_remove;
|
||||
uniform_from = shader_get_uniform(shader, "colorFrom");
|
||||
uniform_from_count = shader_get_uniform(shader, "colorFrom_amo");
|
||||
|
||||
uniform_ter = shader_get_uniform(sh_color_remove, "treshold");
|
||||
uniform_ter = shader_get_uniform(shader, "treshold");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Colors", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ c_black ])
|
||||
|
@ -31,7 +32,7 @@ function Node_Color_Remove(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_color_remove);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_from, _colors);
|
||||
shader_set_uniform_i(uniform_from_count, array_length(fr));
|
||||
|
||||
|
|
|
@ -1,14 +1,15 @@
|
|||
function Node_Color_replace(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Color replace";
|
||||
|
||||
uniform_from = shader_get_uniform(sh_color_replace, "colorFrom");
|
||||
uniform_from_count = shader_get_uniform(sh_color_replace, "colorFrom_amo");
|
||||
shader = sh_color_replace;
|
||||
uniform_from = shader_get_uniform(shader, "colorFrom");
|
||||
uniform_from_count = shader_get_uniform(shader, "colorFrom_amo");
|
||||
|
||||
uniform_to = shader_get_uniform(sh_color_replace, "colorTo");
|
||||
uniform_ter = shader_get_uniform(sh_color_replace, "treshold");
|
||||
uniform_alp = shader_get_uniform(sh_color_replace, "alphacmp");
|
||||
uniform_inv = shader_get_uniform(sh_color_replace, "inverted");
|
||||
uniform_hrd = shader_get_uniform(sh_color_replace, "hardReplace");
|
||||
uniform_to = shader_get_uniform(shader, "colorTo");
|
||||
uniform_ter = shader_get_uniform(shader, "treshold");
|
||||
uniform_alp = shader_get_uniform(shader, "alphacmp");
|
||||
uniform_inv = shader_get_uniform(shader, "inverted");
|
||||
uniform_hrd = shader_get_uniform(shader, "hardReplace");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Color from", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ c_black ])
|
||||
|
@ -53,7 +54,7 @@ function Node_Color_replace(_x, _y, _group = -1) : Node_Processor(_x, _y, _group
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_color_replace);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_from, _colors);
|
||||
shader_set_uniform_i(uniform_from_count, array_length(fr));
|
||||
shader_set_uniform_i(uniform_alp, alp);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function Node_Sampler(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
function Node_Sampler(_x, _y, _group = -1) : Node_Value_Processor(_x, _y, _group) constructor {
|
||||
name = "Sampler";
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
@ -6,25 +6,19 @@ function Node_Sampler(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
inputs[| 1] = nodeValue(1, "Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
outputs[| 1] = nodeValue(1, "Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, c_white);
|
||||
outputs[| 0] = nodeValue(0, "Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, c_white);
|
||||
|
||||
static getPreviewValue = function() { return inputs[| 0]; }
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
_input = -1;
|
||||
static update = function() {
|
||||
var _surf = inputs[| 0].getValue();
|
||||
if(!is_surface(_surf)) return;
|
||||
if(_input != _surf) {
|
||||
outputs[| 0].setValue(_surf);
|
||||
_input = _surf;
|
||||
}
|
||||
var _pos = inputs[| 1].getValue();
|
||||
function process_value_data(_data, index = 0) {
|
||||
var _surf = _data[0];
|
||||
var _pos = _data[1];
|
||||
if(!is_surface(_surf)) return c_black;
|
||||
|
||||
var cc = surface_getpixel(_surf, _pos[0], _pos[1]);
|
||||
|
||||
outputs[| 1].setValue(cc);
|
||||
return surface_getpixel(_surf, _pos[0], _pos[1]);
|
||||
}
|
||||
}
|
|
@ -1,11 +1,12 @@
|
|||
function Node_Colorize(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Colorize";
|
||||
|
||||
uniform_grad_blend = shader_get_uniform(sh_colorize, "gradient_blend");
|
||||
uniform_color = shader_get_uniform(sh_colorize, "gradient_color");
|
||||
uniform_time = shader_get_uniform(sh_colorize, "gradient_time");
|
||||
uniform_shift = shader_get_uniform(sh_colorize, "gradient_shift");
|
||||
uniform_key = shader_get_uniform(sh_colorize, "keys");
|
||||
shader = sh_colorize;
|
||||
uniform_grad_blend = shader_get_uniform(shader, "gradient_blend");
|
||||
uniform_color = shader_get_uniform(shader, "gradient_color");
|
||||
uniform_time = shader_get_uniform(shader, "gradient_time");
|
||||
uniform_shift = shader_get_uniform(shader, "gradient_shift");
|
||||
uniform_key = shader_get_uniform(shader, "keys");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white)
|
||||
|
@ -36,7 +37,7 @@ function Node_Colorize(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) con
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_colorize);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_i(uniform_grad_blend, ds_list_get(_gra_data, 0));
|
||||
shader_set_uniform_f_array(uniform_color, _grad_color);
|
||||
shader_set_uniform_f_array(uniform_time, _grad_time);
|
||||
|
|
|
@ -7,11 +7,12 @@ enum COMPOSE_OUTPUT_SCALING {
|
|||
function Node_Composite(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Composite";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_blend_normal_dim, "dimension");
|
||||
uniform_pos = shader_get_uniform(sh_blend_normal_dim, "position");
|
||||
uniform_sca = shader_get_uniform(sh_blend_normal_dim, "scale");
|
||||
uniform_rot = shader_get_uniform(sh_blend_normal_dim, "rotation");
|
||||
uniform_for = shader_get_sampler_index(sh_blend_normal_dim, "fore");
|
||||
shader = sh_blend_normal_dim;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_pos = shader_get_uniform(shader, "position");
|
||||
uniform_sca = shader_get_uniform(shader, "scale");
|
||||
uniform_rot = shader_get_uniform(shader, "rotation");
|
||||
uniform_for = shader_get_sampler_index(shader, "fore");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Padding", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0, 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.padding);
|
||||
|
@ -198,7 +199,7 @@ function Node_Composite(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
ds_list_add(attributes[? "layer_visible"], true);
|
||||
}
|
||||
}
|
||||
createNewSurface();
|
||||
if(!LOADING && !APPENDING) createNewSurface();
|
||||
|
||||
function addFrom(_nodeFrom) {
|
||||
inputs[| ds_list_size(inputs) - data_length].setFrom(_nodeFrom);
|
||||
|
@ -223,6 +224,8 @@ function Node_Composite(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
overlay_h = 0;
|
||||
|
||||
static updateValueFrom = function(index) {
|
||||
if(LOADING || APPENDING) return;
|
||||
|
||||
if(index + data_length >= ds_list_size(inputs))
|
||||
createNewSurface();
|
||||
}
|
||||
|
@ -396,6 +399,7 @@ function Node_Composite(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
if(array_length(_data) < 4) return _outSurf;
|
||||
var _pad = _data[0];
|
||||
var _dim_type = _data[1];
|
||||
var _dim = _data[2];
|
||||
|
@ -458,7 +462,7 @@ function Node_Composite(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
if(!_s || is_array(_s)) continue;
|
||||
|
||||
surface_set_target(temp_surf[bg]);
|
||||
shader_set(sh_blend_normal_dim);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [ surface_get_width(_s) / ww, surface_get_height(_s) / hh ]);
|
||||
shader_set_uniform_f_array(uniform_pos, [ _pos[0] / ww, _pos[1] / hh]);
|
||||
shader_set_uniform_f_array(uniform_sca, _sca)
|
||||
|
@ -485,14 +489,8 @@ function Node_Composite(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
static postDeserialize = function() {
|
||||
var _inputs = load_map[? "inputs"];
|
||||
|
||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length) {
|
||||
if(i > input_fix_len)
|
||||
for(var i = input_fix_len; i < ds_list_size(_inputs); i += data_length)
|
||||
createNewSurface();
|
||||
inputs[| i + 0].deserialize(_inputs[| i + 0]);
|
||||
inputs[| i + 1].deserialize(_inputs[| i + 1]);
|
||||
inputs[| i + 2].deserialize(_inputs[| i + 2]);
|
||||
inputs[| i + 3].deserialize(_inputs[| i + 3]);
|
||||
}
|
||||
}
|
||||
|
||||
static attributeSerialize = function() {
|
||||
|
|
|
@ -150,10 +150,14 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
static focusStep = function() {}
|
||||
|
||||
static doUpdate = function() {
|
||||
try {
|
||||
var t = get_timer();
|
||||
update();
|
||||
setRenderStatus(true);
|
||||
render_time = get_timer() - t;
|
||||
} catch(exception) {
|
||||
log_warning("RENDER", "Render error " + string(exception));
|
||||
}
|
||||
}
|
||||
|
||||
static onValueUpdate = function(index) {}
|
||||
|
@ -591,7 +595,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
cached_output[ANIMATOR.current_frame] = _os;
|
||||
}
|
||||
|
||||
cache_result[ANIMATOR.current_frame] = true;
|
||||
array_safe_set(cache_result, ANIMATOR.current_frame, true);
|
||||
}
|
||||
static cacheExist = function(frame = ANIMATOR.current_frame) {
|
||||
if(frame >= array_length(cached_output)) return false;
|
||||
|
@ -675,13 +679,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
static clone = function() {
|
||||
var _type = instanceof(self);
|
||||
var _node = nodeBuild(_type, x, y);
|
||||
var _nid = _node.node_id;
|
||||
|
||||
var _data = serialize();
|
||||
_node.deserialize(ds_map_clone(_data));
|
||||
_node.node_id = generateUUID();
|
||||
_node.applyDeserialize();
|
||||
_node.node_id = _nid;
|
||||
|
||||
NODE_MAP[? node_id] = self;
|
||||
NODE_MAP[? _node.node_id] = _node;
|
||||
NODE_MAP[? _nid] = _node;
|
||||
PANEL_ANIMATION.updatePropertyList();
|
||||
|
||||
return _node;
|
||||
}
|
||||
|
@ -725,11 +732,10 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
load_scale = scale;
|
||||
|
||||
if(!preset) {
|
||||
if(APPENDING) {
|
||||
if(APPENDING)
|
||||
APPEND_MAP[? load_map[? "id"]] = node_id;
|
||||
} else {
|
||||
else
|
||||
node_id = ds_map_try_get(load_map, "id");
|
||||
}
|
||||
|
||||
NODE_MAP[? node_id] = self;
|
||||
|
||||
|
@ -746,21 +752,20 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor {
|
|||
|
||||
if(!ds_map_exists(load_map, "inputs"))
|
||||
return;
|
||||
|
||||
var _inputs = load_map[? "inputs"];
|
||||
if(!ds_list_empty(_inputs) && !ds_list_empty(inputs)) {
|
||||
var _siz = min(ds_list_size(_inputs), ds_list_size(inputs));
|
||||
for(var i = 0; i < _siz; i++) {
|
||||
inputs[| i].deserialize(_inputs[| i], scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static attributeDeserialize = function(attr) {
|
||||
ds_map_override(attributes, attr);
|
||||
}
|
||||
|
||||
static postDeserialize = function() {}
|
||||
|
||||
static applyDeserialize = function() {
|
||||
var _inputs = load_map[? "inputs"];
|
||||
for(var i = 0; i < ds_list_size(inputs); i++)
|
||||
inputs[| i].applyDeserialize(_inputs[| i], load_scale);
|
||||
}
|
||||
|
||||
static loadGroup = function() {
|
||||
if(_group == -1) {
|
||||
var c = PANEL_GRAPH.getCurrentContext();
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
function Node_De_Corner(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "De-Corner";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_de_corner, "dimension");
|
||||
uniform_sol = shader_get_uniform(sh_de_corner, "solid");
|
||||
uniform_tol = shader_get_uniform(sh_de_corner, "tolerance");
|
||||
shader = sh_de_corner;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_sol = shader_get_uniform(shader, "solid");
|
||||
uniform_tol = shader_get_uniform(shader, "tolerance");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
|
@ -14,7 +15,7 @@ function Node_De_Corner(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_de_corner);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [ surface_get_width(_data[0]), surface_get_height(_data[0]) ]);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
shader_reset();
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
function Node_De_Stray(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "De-Stray";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_de_stray, "dimension");
|
||||
uniform_tol = shader_get_uniform(sh_de_stray, "tolerance");
|
||||
shader = sh_de_stray;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_tol = shader_get_uniform(shader, "tolerance");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Tolerance", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
|
@ -15,7 +16,7 @@ function Node_De_Stray(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) con
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_de_stray);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [ surface_get_width(_data[0]), surface_get_height(_data[0]) ]);
|
||||
shader_set_uniform_f(uniform_tol, _data[1]);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
function Node_Dilate(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Dilate";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_dilate, "dimension");
|
||||
uniform_cen = shader_get_uniform(sh_dilate, "center");
|
||||
uniform_str = shader_get_uniform(sh_dilate, "strength");
|
||||
uniform_rad = shader_get_uniform(sh_dilate, "radius");
|
||||
shader = sh_dilate;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_cen = shader_get_uniform(shader, "center");
|
||||
uniform_str = shader_get_uniform(shader, "strength");
|
||||
uniform_rad = shader_get_uniform(shader, "radius");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Center", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
|
||||
|
@ -35,7 +36,7 @@ function Node_Dilate(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
var stren = _data[2];
|
||||
var rad = _data[3];
|
||||
|
||||
shader_set(sh_dilate);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [ surface_get_width(_data[0]), surface_get_height(_data[0]) ]);
|
||||
shader_set_uniform_f_array(uniform_cen, center);
|
||||
shader_set_uniform_f(uniform_str, stren);
|
||||
|
|
|
@ -16,20 +16,21 @@ function Node_Dither(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
|
||||
name = "Dither";
|
||||
|
||||
uniform_dither_size = shader_get_uniform(sh_dither, "ditherSize");
|
||||
uniform_dither = shader_get_uniform(sh_dither, "dither");
|
||||
shader = sh_dither;
|
||||
uniform_dither_size = shader_get_uniform(shader, "ditherSize");
|
||||
uniform_dither = shader_get_uniform(shader, "dither");
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_dither, "dimension");
|
||||
uniform_color = shader_get_uniform(sh_dither, "palette");
|
||||
uniform_key = shader_get_uniform(sh_dither, "keys");
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_color = shader_get_uniform(shader, "palette");
|
||||
uniform_key = shader_get_uniform(shader, "keys");
|
||||
|
||||
uniform_constrast = shader_get_uniform(sh_dither, "contrast");
|
||||
uniform_con_map_use = shader_get_uniform(sh_dither, "useConMap");
|
||||
uniform_con_map = shader_get_sampler_index(sh_dither, "conMap");
|
||||
uniform_constrast = shader_get_uniform(shader, "contrast");
|
||||
uniform_con_map_use = shader_get_uniform(shader, "useConMap");
|
||||
uniform_con_map = shader_get_sampler_index(shader, "conMap");
|
||||
|
||||
uniform_map_use = shader_get_uniform(sh_dither, "useMap");
|
||||
uniform_map = shader_get_sampler_index(sh_dither, "map");
|
||||
uniform_map_dim = shader_get_uniform(sh_dither, "mapDimension");
|
||||
uniform_map_use = shader_get_uniform(shader, "useMap");
|
||||
uniform_map = shader_get_sampler_index(shader, "map");
|
||||
uniform_map_dim = shader_get_uniform(shader, "mapDimension");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Palette", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, [ c_white ])
|
||||
|
@ -66,7 +67,7 @@ function Node_Dither(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_dither);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [ surface_get_width(_data[0]), surface_get_height(_data[0]) ] );
|
||||
shader_set_uniform_f_array(uniform_color, _colors);
|
||||
shader_set_uniform_i(uniform_key, array_length(_pal));
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
function Node_Edge_Detect(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Edge detect";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_edge_detect, "dimension");
|
||||
uniform_filter = shader_get_uniform(sh_edge_detect, "filter");
|
||||
shader = sh_edge_detect;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_filter = shader_get_uniform(shader, "filter");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Filter", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
|
@ -17,7 +18,7 @@ function Node_Edge_Detect(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_edge_detect);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [surface_get_width(_data[0]), surface_get_height(_data[0])]);
|
||||
shader_set_uniform_i(uniform_filter, ft);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
function Node_Erode(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Erode";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_erode, "dimension");
|
||||
uniform_size = shader_get_uniform(sh_erode, "size");
|
||||
uniform_bor = shader_get_uniform(sh_erode, "border");
|
||||
uniform_alp = shader_get_uniform(sh_erode, "alpha");
|
||||
shader = sh_erode;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_size = shader_get_uniform(shader, "size");
|
||||
uniform_bor = shader_get_uniform(shader, "border");
|
||||
uniform_alp = shader_get_uniform(shader, "alpha");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Width", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1);
|
||||
|
@ -20,7 +21,7 @@ function Node_Erode(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_erode);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [surface_get_width(_data[0]), surface_get_height(_data[0])]);
|
||||
shader_set_uniform_f(uniform_size, wd);
|
||||
shader_set_uniform_i(uniform_bor, _data[2]? 1 : 0);
|
||||
|
|
|
@ -104,7 +104,11 @@ function Node_Export(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
" " + target_path;
|
||||
//show_debug_message(converter);
|
||||
//show_debug_message(shell_cmd);
|
||||
execute_shell_simple(converter, shell_cmd);
|
||||
print("call shell")
|
||||
execute_shell_simple(converter, shell_cmd,, 0);
|
||||
|
||||
log_message("EXPORT", "Export gif as " + target_path, THEME.noti_icon_tick);
|
||||
PANEL_MENU.setNotiIcon(THEME.noti_icon_tick);
|
||||
}
|
||||
|
||||
static step = function() {
|
||||
|
@ -250,6 +254,11 @@ function Node_Export(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
}
|
||||
|
||||
surface_save(_surf, p);
|
||||
|
||||
if(form != 2) {
|
||||
log_message("EXPORT", "Export image as " + p, THEME.noti_icon_tick);
|
||||
PANEL_MENU.setNotiIcon(THEME.noti_icon_tick);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(is_surface(surf)) {
|
||||
|
@ -263,6 +272,11 @@ function Node_Export(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
}
|
||||
|
||||
surface_save(surf, p);
|
||||
|
||||
if(form != 2) {
|
||||
log_message("EXPORT", "Export image as " + p, THEME.noti_icon_tick);
|
||||
PANEL_MENU.setNotiIcon(THEME.noti_icon_tick);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
function Node_Glow(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Glow";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_outline_only, "dimension");
|
||||
uniform_size = shader_get_uniform(sh_outline_only, "borderSize");
|
||||
uniform_colr = shader_get_uniform(sh_outline_only, "borderColor");
|
||||
shader = sh_outline_only;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_size = shader_get_uniform(shader, "borderSize");
|
||||
uniform_colr = shader_get_uniform(shader, "borderColor");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Border", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
|
@ -28,7 +29,7 @@ function Node_Glow(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
|
||||
surface_set_target(pass1);
|
||||
draw_clear_alpha(c_black, 1);
|
||||
shader_set(sh_outline_only);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [ surface_get_width(_outSurf), surface_get_height(_outSurf) ]);
|
||||
shader_set_uniform_f(uniform_size, _size + _border);
|
||||
shader_set_uniform_f_array(uniform_colr, [1.0, 1.0, 1.0, 1.0]);
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
function Node_Gradient(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "Gradient";
|
||||
|
||||
uniform_grad_blend = shader_get_uniform(sh_gradient, "gradient_blend");
|
||||
uniform_grad = shader_get_uniform(sh_gradient, "gradient_color");
|
||||
uniform_grad_time = shader_get_uniform(sh_gradient, "gradient_time");
|
||||
uniform_grad_key = shader_get_uniform(sh_gradient, "gradient_keys");
|
||||
uniform_grad_loop = shader_get_uniform(sh_gradient, "gradient_loop");
|
||||
shader = sh_gradient;
|
||||
uniform_grad_blend = shader_get_uniform(shader, "gradient_blend");
|
||||
uniform_grad = shader_get_uniform(shader, "gradient_color");
|
||||
uniform_grad_time = shader_get_uniform(shader, "gradient_time");
|
||||
uniform_grad_key = shader_get_uniform(shader, "gradient_keys");
|
||||
uniform_grad_loop = shader_get_uniform(shader, "gradient_loop");
|
||||
|
||||
uniform_type = shader_get_uniform(sh_gradient, "type");
|
||||
uniform_center = shader_get_uniform(sh_gradient, "center");
|
||||
uniform_type = shader_get_uniform(shader, "type");
|
||||
uniform_center = shader_get_uniform(shader, "center");
|
||||
|
||||
uniform_angle = shader_get_uniform(sh_gradient, "angle");
|
||||
uniform_radius = shader_get_uniform(sh_gradient, "radius");
|
||||
uniform_radius_shf = shader_get_uniform(sh_gradient, "shift");
|
||||
uniform_angle = shader_get_uniform(shader, "angle");
|
||||
uniform_radius = shader_get_uniform(shader, "radius");
|
||||
uniform_radius_shf = shader_get_uniform(shader, "shift");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
@ -91,7 +92,7 @@ function Node_Gradient(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
|
||||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
shader_set(sh_gradient);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_i(uniform_grad_blend, ds_list_get(_gra_data, 0));
|
||||
shader_set_uniform_f_array(uniform_grad, _grad_color);
|
||||
shader_set_uniform_f_array(uniform_grad_time, _grad_time);
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
function Node_Greyscale(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Greyscale";
|
||||
|
||||
uniform_exp = shader_get_uniform(sh_greyscale, "brightness");
|
||||
uniform_con = shader_get_uniform(sh_greyscale, "contrast");
|
||||
shader = sh_greyscale;
|
||||
uniform_exp = shader_get_uniform(shader, "brightness");
|
||||
uniform_con = shader_get_uniform(shader, "contrast");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Brightness", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
|
@ -20,7 +21,7 @@ function Node_Greyscale(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) co
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_greyscale);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_exp, _exp);
|
||||
shader_set_uniform_f(uniform_con, _con);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
|
|
|
@ -152,8 +152,7 @@ function Node_Group_Input(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
return inParent;
|
||||
}
|
||||
|
||||
if(!LOADING && !APPENDING)
|
||||
createInput();
|
||||
if(!LOADING && !APPENDING) createInput();
|
||||
|
||||
dtype = -1;
|
||||
range = 0;
|
||||
|
@ -192,6 +191,17 @@ function Node_Group_Input(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
|
||||
static postDeserialize = function() {
|
||||
createInput(false);
|
||||
var _inputs = load_map[? "inputs"];
|
||||
inputs[| 5].applyDeserialize(_inputs[| 5], load_scale);
|
||||
}
|
||||
|
||||
static applyDeserialize = function() {
|
||||
var _inputs = load_map[? "inputs"];
|
||||
for(var i = 0; i < ds_list_size(inputs); i++) {
|
||||
if(i == 5) continue;
|
||||
inputs[| i].applyDeserialize(_inputs[| i], load_scale);
|
||||
var raw_val = _inputs[| i][? "raw value"];
|
||||
}
|
||||
onValueUpdate(0);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,8 +23,9 @@ function Node_Group_Output(_x, _y, _group = -1) : Node(_x, _y, _group) construct
|
|||
}
|
||||
|
||||
static getNextNodes = function() {
|
||||
if(is_undefined(outParent)) return;
|
||||
group.setRenderStatus(true);
|
||||
printIf(global.RENDER_LOG, "Value to amount " + string(ds_list_size(outParent.value_to)));
|
||||
//printIf(global.RENDER_LOG, "Value to amount " + string(ds_list_size(outParent.value_to)));
|
||||
|
||||
for(var j = 0; j < ds_list_size(outParent.value_to); j++) {
|
||||
var _to = outParent.value_to[| j];
|
||||
|
|
|
@ -4,8 +4,7 @@ function Node_Image_Sheet(_x, _y, _group = -1) : Node(_x, _y, _group) constructo
|
|||
|
||||
surf_array = [];
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0)
|
||||
.setAcceptArray(false);
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0).rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue(1, "Sprite size", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 32, 32 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
function Node_Level(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Level";
|
||||
|
||||
uniform_black = shader_get_uniform(sh_level, "black");
|
||||
uniform_white = shader_get_uniform(sh_level, "white");
|
||||
shader = sh_level;
|
||||
uniform_black = shader_get_uniform(shader, "black");
|
||||
uniform_white = shader_get_uniform(shader, "white");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
|
@ -71,7 +72,7 @@ function Node_Level(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_level);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_black, _black);
|
||||
shader_set_uniform_f(uniform_white, _white);
|
||||
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
function Node_Level_Selector(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Level Selector";
|
||||
|
||||
uniform_middle = shader_get_uniform(sh_level_selector, "middle");
|
||||
uniform_range = shader_get_uniform(sh_level_selector, "range");
|
||||
shader = sh_level_selector;
|
||||
uniform_middle = shader_get_uniform(shader, "middle");
|
||||
uniform_range = shader_get_uniform(shader, "range");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
|
@ -74,7 +75,7 @@ function Node_Level_Selector(_x, _y, _group = -1) : Node_Processor(_x, _y, _grou
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_level_selector);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_middle, _middle);
|
||||
shader_set_uniform_f(uniform_range , _range );
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
function Node_Mirror(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Mirror";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_mirror, "dimension");
|
||||
uniform_pos = shader_get_uniform(sh_mirror, "position");
|
||||
uniform_ang = shader_get_uniform(sh_mirror, "angle");
|
||||
shader = sh_mirror;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_pos = shader_get_uniform(shader, "position");
|
||||
uniform_ang = shader_get_uniform(shader, "angle");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
|
||||
|
@ -41,7 +42,7 @@ function Node_Mirror(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_mirror);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, _dim);
|
||||
shader_set_uniform_f_array(uniform_pos, _pos);
|
||||
shader_set_uniform_f(uniform_ang, degtorad(_ang));
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
function Node_Outline(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Outline";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_outline, "dimension");
|
||||
uniform_border_size = shader_get_uniform(sh_outline, "borderSize");
|
||||
uniform_border_color = shader_get_uniform(sh_outline, "borderColor");
|
||||
shader = sh_outline;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_border_size = shader_get_uniform(shader, "borderSize");
|
||||
uniform_border_color = shader_get_uniform(shader, "borderColor");
|
||||
|
||||
uniform_blend = shader_get_uniform(sh_outline, "is_blend");
|
||||
uniform_blend_alpha = shader_get_uniform(sh_outline, "blend_alpha");
|
||||
uniform_blend = shader_get_uniform(shader, "is_blend");
|
||||
uniform_blend_alpha = shader_get_uniform(shader, "blend_alpha");
|
||||
|
||||
uniform_side = shader_get_uniform(sh_outline, "side");
|
||||
uniform_aa = shader_get_uniform(sh_outline, "is_aa");
|
||||
uniform_side = shader_get_uniform(shader, "side");
|
||||
uniform_aa = shader_get_uniform(shader, "is_aa");
|
||||
|
||||
uniform_out_only = shader_get_uniform(sh_outline, "outline_only");
|
||||
uniform_out_only = shader_get_uniform(shader, "outline_only");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Width", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0);
|
||||
|
@ -45,7 +46,7 @@ function Node_Outline(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_outline);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [ww, hh]);
|
||||
shader_set_uniform_f(uniform_border_size, wd);
|
||||
shader_set_uniform_f_array(uniform_border_color, [color_get_red(cl) / 255, color_get_green(cl) / 255, color_get_blue(cl) / 255, 1.0]);
|
||||
|
|
|
@ -403,8 +403,7 @@ function Node_Path(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
static postDeserialize = function() {
|
||||
var _inputs = load_map[? "inputs"];
|
||||
|
||||
for(var i = list_start; i < ds_list_size(_inputs); i++) {
|
||||
createAnchor(0, 0).deserialize(_inputs[| i]);
|
||||
}
|
||||
for(var i = list_start; i < ds_list_size(_inputs); i++)
|
||||
createAnchor(0, 0);
|
||||
}
|
||||
}
|
|
@ -1,19 +1,20 @@
|
|||
function Node_Pixel_Cloud(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Pixel Cloud";
|
||||
|
||||
uniform_sed = shader_get_uniform(sh_pixel_cloud, "seed");
|
||||
uniform_str = shader_get_uniform(sh_pixel_cloud, "strength");
|
||||
uniform_dis = shader_get_uniform(sh_pixel_cloud, "dist");
|
||||
shader = sh_pixel_cloud;
|
||||
uniform_sed = shader_get_uniform(shader, "seed");
|
||||
uniform_str = shader_get_uniform(shader, "strength");
|
||||
uniform_dis = shader_get_uniform(shader, "dist");
|
||||
|
||||
uniform_map_use = shader_get_uniform(sh_pixel_cloud, "useMap");
|
||||
uniform_map = shader_get_sampler_index(sh_pixel_cloud, "strengthMap");
|
||||
uniform_map_use = shader_get_uniform(shader, "useMap");
|
||||
uniform_map = shader_get_sampler_index(shader, "strengthMap");
|
||||
|
||||
uniform_grad_blend = shader_get_uniform(sh_pixel_cloud, "gradient_blend");
|
||||
uniform_grad = shader_get_uniform(sh_pixel_cloud, "gradient_color");
|
||||
uniform_grad_time = shader_get_uniform(sh_pixel_cloud, "gradient_time");
|
||||
uniform_grad_key = shader_get_uniform(sh_pixel_cloud, "gradient_keys");
|
||||
uniform_grad_blend = shader_get_uniform(shader, "gradient_blend");
|
||||
uniform_grad = shader_get_uniform(shader, "gradient_color");
|
||||
uniform_grad_time = shader_get_uniform(shader, "gradient_time");
|
||||
uniform_grad_key = shader_get_uniform(shader, "gradient_keys");
|
||||
|
||||
uniform_alpha = shader_get_uniform(sh_pixel_cloud, "alpha_curve");
|
||||
uniform_alpha = shader_get_uniform(shader, "alpha_curve");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
|
@ -65,7 +66,7 @@ function Node_Pixel_Cloud(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
shader_set(sh_pixel_cloud);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_sed, _sed);
|
||||
shader_set_uniform_f(uniform_str, _str);
|
||||
shader_set_uniform_f(uniform_dis, _dis);
|
||||
|
|
|
@ -13,8 +13,6 @@ function Node_create_Scale_Algo(_x, _y, _group = -1, _param = "") {
|
|||
function Node_Scale_Algo(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Scale Algo";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_scale2x, "dimension");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
inputs[| 1] = nodeValue(1, "Algorithm", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
|
@ -30,7 +28,7 @@ function Node_Scale_Algo(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
|
|||
var algo = _data[1];
|
||||
var ww = surface_get_width(inSurf);
|
||||
var hh = surface_get_height(inSurf);
|
||||
var shader = sh_scale2x;
|
||||
var shader;
|
||||
var sc = 2;
|
||||
|
||||
switch(algo) {
|
||||
|
@ -48,6 +46,7 @@ function Node_Scale_Algo(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
|
|||
var sh = hh * 3;
|
||||
surface_size_to(_outSurf, sw, sh);
|
||||
break;
|
||||
default: return _outSurf;
|
||||
}
|
||||
|
||||
|
||||
|
@ -55,8 +54,8 @@ function Node_Scale_Algo(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
|
|||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_tol = shader_get_uniform(shader, "tol");
|
||||
var uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
var uniform_tol = shader_get_uniform(shader, "tol");
|
||||
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [ ww, hh ]);
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
function Node_Scatter(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "Scatter";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_blend_normal_dim, "dimension");
|
||||
uniform_pos = shader_get_uniform(sh_blend_normal_dim, "position");
|
||||
uniform_sca = shader_get_uniform(sh_blend_normal_dim, "scale");
|
||||
uniform_rot = shader_get_uniform(sh_blend_normal_dim, "rotation");
|
||||
uniform_for = shader_get_sampler_index(sh_blend_normal_dim, "fore");
|
||||
shader = sh_blend_normal_dim;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_pos = shader_get_uniform(shader, "position");
|
||||
uniform_sca = shader_get_uniform(shader, "scale");
|
||||
uniform_rot = shader_get_uniform(shader, "rotation");
|
||||
uniform_for = shader_get_sampler_index(shader, "fore");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
|
@ -120,7 +121,7 @@ function Node_Scatter(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
}
|
||||
|
||||
surface_set_target(temp_surf[bg]);
|
||||
shader_set(sh_blend_normal_dim);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [ sw / ww, sh / hh ]);
|
||||
shader_set_uniform_f_array(uniform_pos, [ _x / ww, _y / hh]);
|
||||
shader_set_uniform_f_array(uniform_sca, [ _scx, _scy ])
|
||||
|
|
|
@ -2,7 +2,8 @@ function Node_Seperate_Shape(_x, _y, _group = -1) : Node(_x, _y, _group) constru
|
|||
name = "Separate shape";
|
||||
auto_update = false;
|
||||
|
||||
uniform_it_dim = shader_get_uniform(sh_seperate_shape_ite, "dimension");
|
||||
shader = sh_seperate_shape_ite;
|
||||
uniform_it_dim = shader_get_uniform(shader, "dimension");
|
||||
|
||||
is_dynamic_output = true;
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
@ -57,7 +58,7 @@ function Node_Seperate_Shape(_x, _y, _group = -1) : Node(_x, _y, _group) constru
|
|||
surface_reset_target();
|
||||
shader_reset();
|
||||
|
||||
shader_set(sh_seperate_shape_ite);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_it_dim, [ ww, hh ]);
|
||||
shader_reset();
|
||||
|
||||
|
@ -66,7 +67,7 @@ function Node_Seperate_Shape(_x, _y, _group = -1) : Node(_x, _y, _group) constru
|
|||
var bg = i % 2;
|
||||
var fg = (i + 1) % 2;
|
||||
|
||||
shader_set(sh_seperate_shape_ite);
|
||||
shader_set(shader);
|
||||
surface_set_target(temp_surf[bg]);
|
||||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
function Node_Shadow(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Shadow";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_outline_only, "dimension");
|
||||
uniform_size = shader_get_uniform(sh_outline_only, "borderSize");
|
||||
uniform_colr = shader_get_uniform(sh_outline_only, "borderColor");
|
||||
shader = sh_outline_only;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_size = shader_get_uniform(shader, "borderSize");
|
||||
uniform_colr = shader_get_uniform(shader, "borderColor");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_black);
|
||||
|
@ -47,7 +48,7 @@ function Node_Shadow(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
surface_set_target(pass1);
|
||||
draw_clear_alpha(0, 0);
|
||||
BLEND_ADD
|
||||
shader_set(sh_outline_only);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [ surface_get_width(_outSurf), surface_get_height(_outSurf) ]);
|
||||
shader_set_uniform_f(uniform_size, _border);
|
||||
shader_set_uniform_f_array(uniform_colr, [1., 1., 1., 1.0]);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
function Node_Sprite_Stack(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
function Node_Sprite_Stack(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Sprite Stack";
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Base shape", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
@ -39,24 +39,21 @@ function Node_Sprite_Stack(_x, _y, _group = -1) : Node(_x, _y, _group) construct
|
|||
inputs[| 5].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
var _in = inputs[| 0].getValue();
|
||||
var _dim = inputs[| 1].getValue();
|
||||
var _amo = inputs[| 2].getValue();
|
||||
var _shf = inputs[| 3].getValue();
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
var _in = _data[0];
|
||||
var _dim = _data[1];
|
||||
var _amo = _data[2];
|
||||
var _shf = _data[3];
|
||||
|
||||
var _pos = inputs[| 4].getValue();
|
||||
var _rot = inputs[| 5].getValue();
|
||||
var _col = inputs[| 6].getValue();
|
||||
var _alp = inputs[| 7].getValue();
|
||||
var _mov = inputs[| 8].getValue();
|
||||
var _pos = _data[4];
|
||||
var _rot = _data[5];
|
||||
var _col = _data[6];
|
||||
var _alp = _data[7];
|
||||
var _mov = _data[8];
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
|
||||
if(!is_surface(_outSurf)) {
|
||||
if(!is_surface(_outSurf))
|
||||
_outSurf = surface_create_valid(_dim[0], _dim[1]);
|
||||
outputs[| 0].setValue(_outSurf);
|
||||
} else
|
||||
else
|
||||
surface_size_to(_outSurf, _dim[0], _dim[1]);
|
||||
|
||||
if(_mov) {
|
||||
|
|
|
@ -40,11 +40,12 @@ function Node_Statistic(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
inputs[| index] = nodeValue( index, "Input", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, -1 )
|
||||
.setVisible(true, true);
|
||||
}
|
||||
createNewInput();
|
||||
if(!LOADING && !APPENDING) createNewInput();
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Statistic", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, -1);
|
||||
|
||||
static updateValueFrom = function(index) {
|
||||
if(LOADING || APPENDING) return;
|
||||
var _l = ds_list_create();
|
||||
|
||||
for( var i = 0; i < input_fix_len; i++ ) {
|
||||
|
@ -77,46 +78,74 @@ function Node_Statistic(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
case STAT_OPERATOR._sum :
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
|
||||
var val = inputs[| i].getValue();
|
||||
if(is_array(val)) {
|
||||
for( var j = 0; j < array_length(val); j++ )
|
||||
res += val[j];
|
||||
} else
|
||||
res += val;
|
||||
}
|
||||
break;
|
||||
case STAT_OPERATOR._average :
|
||||
if(ds_list_size(inputs) <= input_fix_len + 1) res = 0;
|
||||
else {
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
|
||||
var val = inputs[| i].getValue();
|
||||
res += val;
|
||||
}
|
||||
res /= ds_list_size(inputs) - 1 - input_fix_len;
|
||||
}
|
||||
break;
|
||||
case STAT_OPERATOR._median :
|
||||
var len = ds_list_size(inputs) - 1 - input_fix_len;
|
||||
if(len == 0) {
|
||||
if(ds_list_size(inputs) <= input_fix_len + 1) {
|
||||
res = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
var vals = array_create(len);
|
||||
var amo = 0;
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
|
||||
vals[i - input_fix_len] = inputs[| i].getValue();
|
||||
var val = inputs[| i].getValue();
|
||||
if(is_array(val)) {
|
||||
for( var j = 0; j < array_length(val); j++ ) {
|
||||
res += val[j];
|
||||
amo++;
|
||||
}
|
||||
} else {
|
||||
res += val;
|
||||
amo++;
|
||||
}
|
||||
}
|
||||
res /= amo;
|
||||
break;
|
||||
case STAT_OPERATOR._median :
|
||||
if(ds_list_size(inputs) - 1 - input_fix_len == 0) {
|
||||
res = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if(len == 1) {
|
||||
var vals = [];
|
||||
var amo = 0;
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
|
||||
var val = inputs[| i].getValue();
|
||||
if(is_array(val)) {
|
||||
for( var j = 0; j < array_length(val); j++ ) {
|
||||
array_push(vals, val[j]);
|
||||
amo++;
|
||||
}
|
||||
} else {
|
||||
array_push(vals, val);
|
||||
amo++;
|
||||
}
|
||||
}
|
||||
|
||||
if(amo == 1) {
|
||||
res = vals[0];
|
||||
break;
|
||||
}
|
||||
|
||||
array_sort(vals, true);
|
||||
if(len % 2 == 0)
|
||||
res = (vals[len / 2 - 1] + vals[len / 2]) / 2;
|
||||
if(amo % 2 == 0)
|
||||
res = (vals[amo / 2 - 1] + vals[amo / 2]) / 2;
|
||||
else
|
||||
res = vals[(len - 1) / 2];
|
||||
res = vals[(amo - 1) / 2];
|
||||
break;
|
||||
case STAT_OPERATOR._min :
|
||||
var _min = 9999999999;
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
|
||||
var val = inputs[| i].getValue();
|
||||
if(is_array(val)) {
|
||||
for( var j = 0; j < array_length(val); j++ )
|
||||
_min = min(_min, val[j]);
|
||||
} else
|
||||
_min = min(_min, val);
|
||||
}
|
||||
res = _min;
|
||||
|
@ -125,6 +154,10 @@ function Node_Statistic(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
var _max = -9999999999;
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
|
||||
var val = inputs[| i].getValue();
|
||||
if(is_array(val)) {
|
||||
for( var j = 0; j < array_length(val); j++ )
|
||||
_max = max(_max, val[j]);
|
||||
} else
|
||||
_max = max(_max, val);
|
||||
}
|
||||
res = _max;
|
||||
|
@ -138,10 +171,9 @@ function Node_Statistic(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
static postDeserialize = function() {
|
||||
var _inputs = load_map[? "inputs"];
|
||||
|
||||
for(var i = 0; i < ds_list_size(_inputs); i++) {
|
||||
for(var i = 0; i < ds_list_size(_inputs); i++)
|
||||
createNewInput();
|
||||
}
|
||||
}
|
||||
|
||||
function onDrawNode(xx, yy, _mx, _my, _s) {
|
||||
draw_set_text(f_h3, fa_center, fa_center, COLORS._main_text);
|
||||
|
|
|
@ -17,6 +17,6 @@ function Node_String(_x, _y, _group = -1) : Node_Value_Processor(_x, _y, _group)
|
|||
function onDrawNode(xx, yy, _mx, _my, _s) {
|
||||
draw_set_text(f_h5, fa_center, fa_center, COLORS._main_text);
|
||||
var str = inputs[| 0].getValue();
|
||||
draw_text_cut(xx + w / 2 * _s, yy + 10 + h / 2 * _s, str, w - ui(6));
|
||||
draw_text_cut(xx + w / 2 * _s, yy + 10 + h / 2 * _s, str, w - ui(6), _s);
|
||||
}
|
||||
}
|
|
@ -12,14 +12,32 @@ function Node_String_Split(_x, _y, _group = -1) : Node_Value_Processor(_x, _y, _
|
|||
outputs[| 0] = nodeValue(0, "Text", self, JUNCTION_CONNECT.output, VALUE_TYPE.text, "");
|
||||
|
||||
function process_value_data(_data) {
|
||||
if(_data[1] == "")
|
||||
return string_to_array(_data[0]);
|
||||
return string_splice(_data[0], _data[1]);
|
||||
}
|
||||
|
||||
doUpdate();
|
||||
|
||||
function onDrawNode(xx, yy, _mx, _my, _s) {
|
||||
var cx = xx + w * _s / 2;
|
||||
var cy = yy + 10 + (h - 10) * _s / 2;
|
||||
draw_sprite_uniform(s_node_text_splice, 0, cx, cy, _s);
|
||||
var str = inputs[| 1].getValue();
|
||||
var cx = xx + w / 2 * _s;
|
||||
var cy = yy + 10 + h / 2 * _s;
|
||||
|
||||
if(string_length(str) == 0) {
|
||||
draw_set_text(f_p0b, fa_center, fa_center, COLORS._main_text_sub);
|
||||
draw_text_cut(cx, cy, "None", w - ui(6), _s);
|
||||
return;
|
||||
}
|
||||
|
||||
draw_set_text(f_h5, fa_center, fa_center, COLORS._main_text);
|
||||
draw_text_cut(cx, cy, str, w - ui(6), _s);
|
||||
|
||||
var ww = (string_width(str) / 2) * _s;
|
||||
draw_set_text(f_h5, fa_right, fa_center, COLORS._main_text_sub);
|
||||
draw_text_transformed(cx - ww, cy, "|", _s, _s, 0);
|
||||
|
||||
draw_set_halign(fa_left);
|
||||
draw_text_transformed(cx + ww, cy, "|", _s, _s, 0);
|
||||
}
|
||||
}
|
|
@ -1,18 +1,19 @@
|
|||
function Node_Stripe(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "Stripe";
|
||||
|
||||
uniform_grad_use = shader_get_uniform(sh_stripe, "gradient_use");
|
||||
uniform_grad_blend = shader_get_uniform(sh_stripe, "gradient_blend");
|
||||
uniform_grad = shader_get_uniform(sh_stripe, "gradient_color");
|
||||
uniform_grad_time = shader_get_uniform(sh_stripe, "gradient_time");
|
||||
uniform_grad_key = shader_get_uniform(sh_stripe, "gradient_keys");
|
||||
shader = sh_stripe;
|
||||
uniform_grad_use = shader_get_uniform(shader, "gradient_use");
|
||||
uniform_grad_blend = shader_get_uniform(shader, "gradient_blend");
|
||||
uniform_grad = shader_get_uniform(shader, "gradient_color");
|
||||
uniform_grad_time = shader_get_uniform(shader, "gradient_time");
|
||||
uniform_grad_key = shader_get_uniform(shader, "gradient_keys");
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_stripe, "dimension");
|
||||
uniform_pos = shader_get_uniform(sh_stripe, "position");
|
||||
uniform_angle = shader_get_uniform(sh_stripe, "angle");
|
||||
uniform_amount = shader_get_uniform(sh_stripe, "amount");
|
||||
uniform_blend = shader_get_uniform(sh_stripe, "blend");
|
||||
uniform_rand = shader_get_uniform(sh_stripe, "rand");
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_pos = shader_get_uniform(shader, "position");
|
||||
uniform_angle = shader_get_uniform(shader, "angle");
|
||||
uniform_amount = shader_get_uniform(shader, "amount");
|
||||
uniform_blend = shader_get_uniform(shader, "blend");
|
||||
uniform_rand = shader_get_uniform(shader, "rand");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2 )
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
@ -79,7 +80,7 @@ function Node_Stripe(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
surface_size_to(_outSurf, _dim[0], _dim[1]);
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
shader_set(sh_stripe);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_dim, _dim[0], _dim[1]);
|
||||
shader_set_uniform_f(uniform_pos, _pos[0] / _dim[0], _pos[1] / _dim[1]);
|
||||
shader_set_uniform_f(uniform_angle, degtorad(_ang));
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
function Node_Texture_Remap(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Texture remap";
|
||||
|
||||
uniform_map = shader_get_sampler_index(sh_texture_remap, "map");
|
||||
shader = sh_texture_remap;
|
||||
uniform_map = shader_get_sampler_index(shader, "map");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "RG Map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
@ -14,7 +15,7 @@ function Node_Texture_Remap(_x, _y, _group = -1) : Node_Processor(_x, _y, _group
|
|||
BLEND_ADD
|
||||
|
||||
if(_data[1]) {
|
||||
shader_set(sh_texture_remap);
|
||||
shader_set(shader);
|
||||
texture_set_stage(uniform_map, surface_get_texture(_data[1]));
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
shader_reset();
|
||||
|
|
|
@ -2,9 +2,10 @@ function Node_Time_Remap(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
name = "Time remap";
|
||||
use_cache = true;
|
||||
|
||||
uniform_map = shader_get_sampler_index(sh_time_remap, "map");
|
||||
uniform_min = shader_get_uniform(sh_time_remap, "vMin");
|
||||
uniform_max = shader_get_uniform(sh_time_remap, "vMax");
|
||||
shader = sh_time_remap;
|
||||
uniform_map = shader_get_sampler_index(shader, "map");
|
||||
uniform_min = shader_get_uniform(shader, "vMin");
|
||||
uniform_max = shader_get_uniform(shader, "vMax");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
@ -31,7 +32,7 @@ function Node_Time_Remap(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
|
||||
surface_set_target(_surf);
|
||||
draw_clear_alpha(0, 0);
|
||||
shader_set(sh_time_remap);
|
||||
shader_set(shader);
|
||||
texture_set_stage(uniform_map, surface_get_texture(_map));
|
||||
|
||||
for(var i = 0; i <= _life; i++) {
|
||||
|
|
|
@ -1,17 +1,18 @@
|
|||
function Node_Twirl(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Twirl";
|
||||
|
||||
uniform_dim = shader_get_uniform(sh_twirl, "dimension");
|
||||
uniform_cen = shader_get_uniform(sh_twirl, "center");
|
||||
uniform_str = shader_get_uniform(sh_twirl, "strength");
|
||||
uniform_rad = shader_get_uniform(sh_twirl, "radius");
|
||||
shader = sh_twirl;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_cen = shader_get_uniform(shader, "center");
|
||||
uniform_str = shader_get_uniform(shader, "strength");
|
||||
uniform_rad = shader_get_uniform(shader, "radius");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Center", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 2] = nodeValue(2, "Strength", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 3)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [-20, 20, 0.1]);
|
||||
.setDisplay(VALUE_DISPLAY.slider, [-10, 10, 0.01]);
|
||||
|
||||
inputs[| 3] = nodeValue(3, "Radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 16);
|
||||
|
||||
|
@ -35,7 +36,7 @@ function Node_Twirl(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
|
|||
var stren = _data[2];
|
||||
var rad = _data[3];
|
||||
|
||||
shader_set(sh_twirl);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array(uniform_dim, [ surface_get_width(_data[0]), surface_get_height(_data[0]) ]);
|
||||
shader_set_uniform_f_array(uniform_cen, center);
|
||||
shader_set_uniform_f(uniform_str, stren);
|
||||
|
|
|
@ -194,9 +194,8 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
return self;
|
||||
}
|
||||
|
||||
static setAcceptArray = function(_accept_array) {
|
||||
accept_array = _accept_array;
|
||||
|
||||
static rejectArray = function() {
|
||||
accept_array = false;
|
||||
return self;
|
||||
}
|
||||
|
||||
|
@ -1157,7 +1156,8 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
|
||||
con_node = -1;
|
||||
con_index = -1;
|
||||
static deserialize = function(_map, scale = false) {
|
||||
|
||||
static applyDeserialize = function(_map, scale = false) {
|
||||
on_end = ds_map_try_get(_map, "on end", on_end);
|
||||
visible = ds_map_try_get(_map, "visible", visible);
|
||||
animator.deserialize(_map[? "raw value"], scale);
|
||||
|
@ -1176,10 +1176,18 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
return true;
|
||||
|
||||
var _node = con_node;
|
||||
if(APPENDING)
|
||||
if(APPENDING) {
|
||||
_node = GetAppendID(con_node);
|
||||
if(_node == -1)
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!ds_map_exists(NODE_MAP, _node)) {
|
||||
var txt = "Node connect error : Node ID " + string(_node) + " not found.";
|
||||
log_warning("LOAD", "[Connect] " + txt);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(ds_map_exists(NODE_MAP, _node)) {
|
||||
var _nd = NODE_MAP[? _node];
|
||||
var _ol = ds_list_size(_nd.outputs);
|
||||
|
||||
|
@ -1187,19 +1195,14 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T
|
|||
log_warning("LOAD", "[Connect] Reconnecting " + string(node.name) + " to " + _nd.name);
|
||||
|
||||
if(con_index < _ol) {
|
||||
if(setFrom(_nd.outputs[| con_index], false)) {
|
||||
if(setFrom(_nd.outputs[| con_index], false))
|
||||
return true;
|
||||
} else
|
||||
|
||||
log_warning("LOAD", "[Connect] Connection conflict " + string(node.name) + " to " + string(_nd.name) + " : Connection failed.");
|
||||
return false;
|
||||
} else {
|
||||
log_warning("LOAD", "[Connect] Connection conflict " + string(node.name) + " to " + string(_nd.name) + " : Node not exist.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var txt = "Node connect error : Node ID " + string(_node) + " not found.";
|
||||
log_warning("LOAD", "[Connect] " + txt);
|
||||
log_warning("LOAD", "[Connect] Connection conflict " + string(node.name) + " to " + string(_nd.name) + " : Node not exist.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -208,12 +208,11 @@ function Panel_Collection() : PanelContent() constructor {
|
|||
function saveCollection(_path, save_surface = true) {
|
||||
if(PANEL_INSPECTOR.inspecting == noone) return;
|
||||
|
||||
if(ds_list_empty(PANEL_GRAPH.nodes_select_list)) {
|
||||
if(ds_list_empty(PANEL_GRAPH.nodes_select_list))
|
||||
SAVE_COLLECTION(PANEL_INSPECTOR.inspecting, _path, save_surface);
|
||||
} else {
|
||||
else
|
||||
SAVE_COLLECTIONS(PANEL_GRAPH.nodes_select_list, _path, save_surface);
|
||||
}
|
||||
}
|
||||
|
||||
function drawContent(panel) {
|
||||
draw_clear_alpha(COLORS.panel_bg_clear, 0);
|
||||
|
|
|
@ -132,6 +132,9 @@ function SAVE_COLLECTIONS(_list, _path, save_surface = true) {
|
|||
ds_map_destroy(_map);
|
||||
var pane = findPanel("Panel_Collection", PANEL_MAIN, noone);
|
||||
if(pane) pane.refreshContext();
|
||||
|
||||
log_message("COLLECTION", "save collection at " + _path, THEME.noti_icon_file_save);
|
||||
PANEL_MENU.setNotiIcon(THEME.noti_icon_file_save);
|
||||
}
|
||||
|
||||
function SAVE_COLLECTION(_node, _path, save_surface = true) {
|
||||
|
@ -157,6 +160,9 @@ function SAVE_COLLECTION(_node, _path, save_surface = true) {
|
|||
ds_map_destroy(_map);
|
||||
var pane = findPanel("Panel_Collection", PANEL_MAIN, noone);
|
||||
if(pane) pane.refreshContext();
|
||||
|
||||
log_message("COLLECTION", "save collection at " + _path, THEME.noti_icon_file_save);
|
||||
PANEL_MENU.setNotiIcon(THEME.noti_icon_file_save);
|
||||
}
|
||||
|
||||
function SAVE_NODE(_list, _node, dx = 0, dy = 0, scale = false) {
|
||||
|
|
|
@ -2,8 +2,8 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) constr
|
|||
active = false;
|
||||
hover = false;
|
||||
|
||||
minn = _min;
|
||||
maxx = _max;
|
||||
minn = _min; curr_minn = _min;
|
||||
maxx = _max; curr_maxx = _max;
|
||||
step = _step;
|
||||
|
||||
onModify = _onModify;
|
||||
|
@ -34,6 +34,12 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) constr
|
|||
case fa_bottom: _y = _y - _h; break;
|
||||
}
|
||||
|
||||
var _rang = abs(maxx - minn);
|
||||
if(!dragging) {
|
||||
curr_minn = (_data >= minn)? minn : minn - ceil(abs(_data - minn) / _rang) * _rang;
|
||||
curr_maxx = (_data <= maxx)? maxx : maxx + ceil(abs(_data - maxx) / _rang) * _rang;
|
||||
}
|
||||
|
||||
var sw = _w - (tb_w + ui(16));
|
||||
|
||||
tb_value.hover = hover;
|
||||
|
@ -42,15 +48,15 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) constr
|
|||
|
||||
draw_sprite_stretched(THEME.slider, 0, _x, _y + _h / 2 - ui(4), sw, ui(8));
|
||||
|
||||
var _kx = _x + clamp((_data - minn) / (maxx - minn), 0, 1) * sw;
|
||||
var _kx = _x + clamp((_data - curr_minn) / (curr_maxx - curr_minn), 0, 1) * sw;
|
||||
draw_sprite_stretched(THEME.slider, 1, _kx - hdw / 2, _y, hdw, _h);
|
||||
|
||||
if(dragging) {
|
||||
draw_sprite_stretched(THEME.slider, 3, _kx - hdw / 2, _y, hdw, _h);
|
||||
|
||||
var val = (_m[0] - _x) / sw * (maxx - minn) + minn;
|
||||
var val = (_m[0] - _x) / sw * (curr_maxx - curr_minn) + curr_minn;
|
||||
val = round(val / step) * step;
|
||||
val = clamp(val, minn, maxx);
|
||||
val = clamp(val, curr_minn, curr_maxx);
|
||||
if(onModify != noone)
|
||||
onModify(val);
|
||||
UNDO_HOLDING = true;
|
||||
|
|
7
scripts/string_function/string_function.gml
Normal file
7
scripts/string_function/string_function.gml
Normal file
|
@ -0,0 +1,7 @@
|
|||
function string_to_array(str) {
|
||||
var amo = string_length(str);
|
||||
var arr = array_create(amo);
|
||||
for( var i = 0; i < amo; i++ )
|
||||
arr[i] = string_char_at(str, i + 1);
|
||||
return arr;
|
||||
}
|
11
scripts/string_function/string_function.yy
Normal file
11
scripts/string_function/string_function.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "string_function",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "string",
|
||||
"path": "folders/functions/string.yy",
|
||||
},
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "string",
|
||||
"path": "folders/functions/string.yy",
|
||||
"name": "surface",
|
||||
"path": "folders/functions/surface.yy",
|
||||
},
|
||||
}
|
|
@ -5,7 +5,7 @@
|
|||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "string",
|
||||
"path": "folders/functions/string.yy",
|
||||
"name": "surface",
|
||||
"path": "folders/functions/surface.yy",
|
||||
},
|
||||
}
|
|
@ -7,8 +7,8 @@ varying vec4 v_vColour;
|
|||
uniform vec2 dimension;
|
||||
|
||||
#define TAU 6.28318
|
||||
#define angle_sample 32.
|
||||
#define distance_sample 32.
|
||||
#define angle_sample 64.
|
||||
#define distance_sample 64.
|
||||
|
||||
void main() {
|
||||
vec2 pixelPosition = v_vTexcoord * dimension;
|
||||
|
|
|
@ -36,7 +36,7 @@ void main() {
|
|||
|
||||
vec2 pxs = v_vTexcoord + shf * pixelStep;
|
||||
vec4 sam = v_vColour * texture2D( gm_BaseTexture, pxs );
|
||||
if(bright(sam) < 1.) {
|
||||
if(bright(sam) < 1. || pxs.x < 0. || pxs.y < 0. || pxs.x > 1. || pxs.y > 1.) {
|
||||
float dist1 = i;
|
||||
min_distance = min(min_distance, dist1);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue