This commit is contained in:
Tanasart 2023-11-24 16:41:53 +07:00
parent 2bec138844
commit 17c7effa3d
74 changed files with 964 additions and 385 deletions

View file

@ -222,6 +222,7 @@
{"name":"region","order":34,"path":"folders/shader/generator/region.yy",},
{"name":"mask","order":10,"path":"folders/shader/mask.yy",},
{"name":"misc","order":13,"path":"folders/shader/misc.yy",},
{"name":"find boundary","order":9,"path":"folders/shader/misc/find boundary.yy",},
{"name":"morph","order":17,"path":"folders/shader/morph.yy",},
{"name":"pixel builder","order":18,"path":"folders/shader/pixel builder.yy",},
{"name":"shape seperator","order":5,"path":"folders/shader/shape seperator.yy",},
@ -241,7 +242,6 @@
{"name":"button","order":34,"path":"folders/widgets/button.yy",},
{"name":"rotator","order":35,"path":"folders/widgets/rotator.yy",},
{"name":"text","order":36,"path":"folders/widgets/text.yy",},
{"name":"find boundary","order":9,"path":"folders/shader/misc/find boundary.yy",},
],
"ResourceOrderSettings": [
{"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",},
@ -1391,6 +1391,7 @@
{"name":"node_scale_algo","order":12,"path":"scripts/node_scale_algo/node_scale_algo.yy",},
{"name":"s_node_image_replace","order":55,"path":"sprites/s_node_image_replace/s_node_image_replace.yy",},
{"name":"node_alpha_hash","order":11,"path":"scripts/node_alpha_hash/node_alpha_hash.yy",},
{"name":"sh_mask_modify","order":2,"path":"shaders/sh_mask_modify/sh_mask_modify.yy",},
{"name":"toggleGroup","order":31,"path":"scripts/toggleGroup/toggleGroup.yy",},
{"name":"mouse_input","order":1,"path":"scripts/mouse_input/mouse_input.yy",},
{"name":"string_cut","order":2,"path":"scripts/string_cut/string_cut.yy",},
@ -1518,6 +1519,7 @@
{"name":"vectorBox","order":10,"path":"scripts/vectorBox/vectorBox.yy",},
{"name":"sh_3d_extrude_corner","order":7,"path":"shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy",},
{"name":"sh_blend_normal_dim","order":10,"path":"shaders/sh_blend_normal_dim/sh_blend_normal_dim.yy",},
{"name":"sh_invert_all","order":20,"path":"shaders/sh_invert_all/sh_invert_all.yy",},
{"name":"__d3d11_cbuffer","order":1,"path":"scripts/__d3d11_cbuffer/__d3d11_cbuffer.yy",},
{"name":"node_skew","order":11,"path":"scripts/node_skew/node_skew.yy",},
{"name":"s_node_dot_product","order":13,"path":"sprites/s_node_dot_product/s_node_dot_product.yy",},

View file

@ -254,6 +254,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"region","folderPath":"folders/shader/generator/region.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"mask","folderPath":"folders/shader/mask.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"misc","folderPath":"folders/shader/misc.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"find boundary","folderPath":"folders/shader/misc/find boundary.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"morph","folderPath":"folders/shader/morph.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"pixel builder","folderPath":"folders/shader/pixel builder.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"shape seperator","folderPath":"folders/shader/shape seperator.yy",},
@ -276,7 +277,6 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"button","folderPath":"folders/widgets/button.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"rotator","folderPath":"folders/widgets/rotator.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"text","folderPath":"folders/widgets/text.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"find boundary","folderPath":"folders/shader/misc/find boundary.yy",},
],
"IncludedFiles": [
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
@ -356,6 +356,7 @@
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_bone.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_button_path_icon.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_button_path_not_found_icon.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_button_path_open.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_cache_group.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_cache.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_chat.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
@ -2118,6 +2119,7 @@
{"id":{"name":"s_node_image_replace","path":"sprites/s_node_image_replace/s_node_image_replace.yy",},},
{"id":{"name":"node_alpha_hash","path":"scripts/node_alpha_hash/node_alpha_hash.yy",},},
{"id":{"name":"node_PCX_condition","path":"scripts/node_PCX_condition/node_PCX_condition.yy",},},
{"id":{"name":"sh_mask_modify","path":"shaders/sh_mask_modify/sh_mask_modify.yy",},},
{"id":{"name":"toggleGroup","path":"scripts/toggleGroup/toggleGroup.yy",},},
{"id":{"name":"mouse_input","path":"scripts/mouse_input/mouse_input.yy",},},
{"id":{"name":"string_cut","path":"scripts/string_cut/string_cut.yy",},},
@ -2264,6 +2266,7 @@
{"id":{"name":"vectorBox","path":"scripts/vectorBox/vectorBox.yy",},},
{"id":{"name":"sh_3d_extrude_corner","path":"shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy",},},
{"id":{"name":"sh_blend_normal_dim","path":"shaders/sh_blend_normal_dim/sh_blend_normal_dim.yy",},},
{"id":{"name":"sh_invert_all","path":"shaders/sh_invert_all/sh_invert_all.yy",},},
{"id":{"name":"__d3d11_cbuffer","path":"scripts/__d3d11_cbuffer/__d3d11_cbuffer.yy",},},
{"id":{"name":"node_skew","path":"scripts/node_skew/node_skew.yy",},},
{"id":{"name":"s_node_dot_product","path":"sprites/s_node_dot_product/s_node_dot_product.yy",},},

Binary file not shown.

View file

@ -14,7 +14,7 @@
var x1 = x0 + ww;
var y1 = y0 + hh;
draw_sprite_stretched(THEME.dialog_bg, 0, x0, y0, ww, hh);
draw_sprite_stretched(THEME.dialog_bg, 0, x0 - ui(8), y0 - ui(8), ww + ui(8) * 2, hh + ui(8) * 2);
for( var i = 0, n = array_length(pal); i < n; i++ ) {
var r = floor(i / col);

View file

@ -307,14 +307,15 @@ event_inherited();
locals = [];
var f = file_find_first(DIRECTORY + "Locale/*", fa_directory);
while(f != "") {
if(directory_exists(DIRECTORY + "Locale/" + f))
array_push(locals, f);
if(directory_exists(DIRECTORY + "Locale/" + f)) {
if(f != "_extend") array_push(locals, f);
}
f = file_find_next();
}
file_find_close();
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_interface_language", "Interface Language (restart required)"),
__txtx("pref_interface_language", "Interface Language*"),
"local",
new scrollBox(locals, function(str) {
if(str < 0) return;
@ -323,6 +324,15 @@ event_inherited();
}, false)
));
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(
__txtx("pref_ui_font", "Overwrite UI font*"),
"font_overwrite",
new textBox(TEXTBOX_INPUT.text, function(txt) { PREFERENCES.font_overwrite = txt; PREF_SAVE(); })
.setSideButton(button(function() { PREFERENCES.font_overwrite = get_open_filename("Font files (.ttf, .otf)|*.ttf;*.otf", ""); PREF_SAVE(); }, THEME.button_path_icon))
.setFont(f_p2)
.setEmpty()
));
ds_list_add(pref_appr, __txt("Splash"));
ds_list_add(pref_appr, new __Panel_Linear_Setting_Item_Preference(

View file

@ -1,8 +1,32 @@
globalvar GAUSSIAN_COEFF;
GAUSSIAN_COEFF = {};
function surface_blur_init() {
__blur_hori = surface_create(1, 1);
__blur_vert = surface_create(1, 1);
}
function __gaussian_get_kernel(size) {
size = max(1, round(size));
if(struct_has(GAUSSIAN_COEFF, size)) return GAUSSIAN_COEFF[$ size];
var gau_array = array_create(size);
var we = 0;
var b = 0.3 * ((size - 1) * 0.5 - 1) + 0.8;
for(var i = 0; i < size; i++) {
var _x = i * .5;
gau_array[i] = (1 / sqrt(2 * pi * b)) * exp( -sqr(_x) / (2 * sqr(b)) );
we += i? gau_array[i] * 2 : gau_array[i];
}
for(var i = 0; i < size; i++)
gau_array[i] /= we;
GAUSSIAN_COEFF[$ size] = gau_array;
return gau_array;
}
function surface_apply_gaussian(surface, size, bg = false, bg_c = c_white, sampleMode = 0, overColor = noone) {
static uni_bor = shader_get_uniform(sh_blur_gaussian, "sampleMode");
static uni_dim = shader_get_uniform(sh_blur_gaussian, "dimension");
@ -16,21 +40,8 @@ function surface_apply_gaussian(surface, size, bg = false, bg_c = c_white, sampl
__blur_hori = surface_verify(__blur_hori, surface_get_width_safe(surface), surface_get_height_safe(surface), format);
__blur_vert = surface_verify(__blur_vert, surface_get_width_safe(surface), surface_get_height_safe(surface), format);
#region kernel generation
size = max(1, round(size));
var gau_array = array_create(size);
var we = 0;
var b = 0.3 * ((size - 1) * 0.5 - 1) + 0.8;
for(var i = 0; i < size; i++) {
var _x = i * .5;
gau_array[i] = (1 / sqrt(2 * pi * b)) * exp( -sqr(_x) / (2 * sqr(b)) );
we += i? gau_array[i] * 2 : gau_array[i];
}
for(var i = 0; i < size; i++) {
gau_array[i] /= we;
}
#endregion
size = min(size, 128);
var gau_array = __gaussian_get_kernel(size);
BLEND_OVERRIDE;
gpu_set_tex_filter(true);

View file

@ -36,7 +36,7 @@ function draw_surface_blend(background, foreground, blend = 0, alpha = 1, _pre_a
shader_set(sh);
shader_set_surface("fore", foreground);
shader_set_surface("mask", _mask);
shader_set_i("useMask", _mask != 0? 1 : 0);
shader_set_i("useMask", is_surface(_mask));
shader_set_f("dimension", surface_get_width_safe(background) / surface_get_width_safe(foreground), surface_get_height_safe(background) / surface_get_height_safe(foreground));
shader_set_f("opacity", alpha);
shader_set_i("preserveAlpha", _pre_alp);

View file

@ -1,27 +1,85 @@
function draw_text_line(_x, _y, _text, _sep, _w) {
function draw_text_line(_x, _y, _text, _sep, _w) { #region
INLINE
__draw_text_ext_transformed(_x, _y, _text, _sep, _w, 1, 1, 0);
}
} #endregion
function draw_text_add(_x, _y, _text, scale = 1) {
function draw_text_add(_x, _y, _text, scale = 1) { #region
INLINE
BLEND_ALPHA_MULP;
draw_text_transformed(_x, _y, _text, scale, scale, 0);
BLEND_NORMAL;
}
} #endregion
function draw_text_over(_x, _y, _text, scale = 1) {
function draw_text_over(_x, _y, _text, scale = 1) { #region
INLINE
BLEND_OVERRIDE;
draw_text_transformed(_x, _y, _text, scale, scale, 0);
BLEND_NORMAL;
}
} #endregion
function draw_text_ext_add(_x, _y, _text, _sep, _w, scale = 1) {
function draw_text_lang_add(_x, _y, _text, scale = 1) { #region
INLINE
BLEND_ALPHA_MULP;
var h = __draw_text_ext_transformed(_x, _y, _text, _sep, _w, scale, scale, 0);
draw_text_lang(_x, _y, _text, scale);
BLEND_NORMAL;
} #endregion
function draw_text_lang_over(_x, _y, _text, scale = 1) { #region
INLINE
BLEND_OVERRIDE;
draw_text_lang(_x, _y, _text, scale);
BLEND_NORMAL;
} #endregion
function draw_text_lang(_x, _y, _text, scale = 1) { #region
var _w = string_width(_text);
var _h = string_height(_text);
var _ha = draw_get_halign();
switch(_ha) {
case fa_left : break;
case fa_center : _x -= _w / 2; break;
case fa_right : _x -= _w; break;
}
draw_set_halign(fa_left);
var amo = string_length(_text);
var _f = draw_get_font();
var _font = _f;
var _gMap = GLYPH_MAP[$ _f];
var gly, _g , _ff;
for( var i = 1; i <= amo; i++ ) {
gly = string_char_at(_text, i);
if(struct_has(_gMap, gly)) {
_ff = _gMap[$ gly];
_g = gly;
} else {
_ff = _f;
_g = "?";
}
if(_font != _ff) draw_set_font(_ff);
_font = _ff;
draw_text_transformed(_x, _y, _g, scale, scale, 0);
_x += string_width(_g) * scale;
}
draw_set_font(_f);
draw_set_halign(_ha);
} #endregion
function draw_text_ext_add(_x, _y, _text, _sep, _w, scale = 1, forceCut = false) { #region
INLINE
BLEND_ALPHA_MULP;
var h = __draw_text_ext_transformed(_x, _y, _text, _sep, _w, scale, scale, 0, forceCut);
BLEND_NORMAL;
return h;
}
} #endregion
function draw_text_bbox(bbox, text) {
function draw_text_bbox(bbox, text) { #region
INLINE
var ss = min(bbox.w / string_width(text), bbox.h / string_height(text));
ss = max(0.5, ss);
@ -29,16 +87,19 @@ function draw_text_bbox(bbox, text) {
draw_set_valign(fa_center);
draw_text_cut(bbox.xc, bbox.yc, text, bbox.w, ss);
}
} #endregion
function draw_text_cut(x, y, str, w, scale = 1) {
function draw_text_cut(x, y, str, w, scale = 1) { #region
INLINE
BLEND_ALPHA_MULP;
draw_text_transformed(x, y, string_cut(str, w,, scale), scale, scale, 0);
BLEND_NORMAL;
}
} #endregion
function __draw_text_ext_transformed(_x, _y, _text, _sep, _w, sx, sy, rotation) {
if(!LOCALE.config.per_character_line_break) {
function __draw_text_ext_transformed(_x, _y, _text, _sep, _w, sx, sy, rotation, forceCut = false) { #region
INLINE
if(!LOCALE.config.per_character_line_break && !forceCut) {
BLEND_ALPHA_MULP;
draw_text_ext_transformed(_x, _y, _text, _sep, _w, sx, sy, rotation);
BLEND_NORMAL;
@ -105,12 +166,13 @@ function __draw_text_ext_transformed(_x, _y, _text, _sep, _w, sx, sy, rotation)
draw_set_valign(va);
return hh;
}
} #endregion
#macro _string_width_ext string_width_ext
#macro string_width_ext __string_width_ext
function __string_width_ext(text, sep, w) {
function __string_width_ext(text, sep, w) { #region
INLINE
if(!LOCALE.config.per_character_line_break)
return _string_width_ext(text, sep, w);
@ -131,12 +193,13 @@ function __string_width_ext(text, sep, w) {
mxw = max(mxw, lw);
return mxw;
}
} #endregion
#macro _string_height_ext string_height_ext
#macro string_height_ext __string_height_ext
function __string_height_ext(text, sep, w, _break = LOCALE.config.per_character_line_break) {
function __string_height_ext(text, sep, w, _break = LOCALE.config.per_character_line_break) { #region
INLINE
if(!_break)
return _string_height_ext(text, sep, w);
@ -158,4 +221,4 @@ function __string_height_ext(text, sep, w, _break = LOCALE.config.per_character_
}
return hh;
}
} #endregion

View file

@ -1,31 +1,47 @@
globalvar FONT_ISLOADED, FONT_CACHE;
globalvar FONT_ISLOADED, FONT_CACHE, GLYPH_MAP;
globalvar f_h1, f_h2, f_h3, f_h5, f_p0, f_p0b, f_p1, f_p2, f_p3, f_code, f_sdf;
FONT_CACHE = {};
FONT_ISLOADED = false;
GLYPH_MAP = {};
function _font_add(path, size, sdf = false) {
function _font_add(path, size, sdf = false) { #region
var font_cache_dir = DIRECTORY + "font_cache";
directory_verify(font_cache_dir);
var _key = $"{filename_name_only(path)}_{size}_{sdf}";
if(struct_has(FONT_CACHE, _key) && font_exists(FONT_CACHE[$ _key])) {
//print($"Add font {_key}: restore from cache");
if(struct_has(FONT_CACHE, _key) && font_exists(FONT_CACHE[$ _key]))
return FONT_CACHE[$ _key];
}
var _t = current_time;
var _f = font_add(path, size, false, false, 0, 0);
if(sdf) {
font_enable_sdf(_f, true);
}
if(sdf) font_enable_sdf(_f, true);
FONT_CACHE[$ _key] = _f;
return _f;
}
_font_extend_locale(_f, _f);
function _font_path(rel) {
return _f;
} #endregion
function _font_extend_locale(baseFont, localFont, override = false) { #region
if(!struct_exists(GLYPH_MAP, baseFont))
GLYPH_MAP[$ baseFont] = {};
var Gmap = GLYPH_MAP[$ baseFont];
var _fInfo = font_get_info(localFont);
var _gMap = _fInfo.glyphs;
var _glyphs = variable_struct_get_names(_gMap);
for( var i = 0, n = array_length(_glyphs); i < n; i++ ) {
var _g = _glyphs[i];
if(_gMap[$ _g] == undefined) continue;
if(override || !struct_has(Gmap, _g))
Gmap[$ _g] = localFont;
}
} #endregion
function _font_path(rel) { #region
rel = string_replace_all(rel, "./", "");
var defPath = $"{DIRECTORY}themes/{PREFERENCES.theme}/fonts/{rel}";
@ -38,30 +54,33 @@ function _font_path(rel) {
return overridePath;
return defPath;
}
} #endregion
function _font_load_from_struct(str, name, def) {
function _font_load_from_struct(str, name, def, over = true) { #region
if(!struct_has(str, name)) return def;
var font = str[$ name];
var path = _font_path(font.path);
var font = str[$ name];
var path = "";
if(over && file_exists(PREFERENCES.font_overwrite)) path = PREFERENCES.font_overwrite;
else {
path = _font_path(font.path);
if(!file_exists(path)) {
noti_status("Font resource " + string(path), " not found. Rollback to default font.");
noti_status($"Font resource {path} not found. Rollback to default font.");
return def;
}
var _sdf = struct_try_get(font, "sdf", false);
//print($"Font [{name}] {font} : {_sdf}")
}
font_add_enable_aa(THEME_VALUE.font_aa);
var _sdf = struct_try_get(font, "sdf", false);
var _font = _font_add(path, font.size * UI_SCALE, _sdf);
return _font;
}
} #endregion
function font_clear(font) { if(font_exists(font)) font_delete(font); }
function loadFonts() {
function loadFonts() { #region
if(FONT_ISLOADED) {
font_clear(f_h1);
font_clear(f_h2);
@ -113,8 +132,34 @@ function loadFonts() {
f_p2 = _font_load_from_struct(fontDef, "p2", _f_p2);
f_p3 = _font_load_from_struct(fontDef, "p3", _f_p3);
f_code = _font_load_from_struct(fontDef, "code", _f_code);
f_code = _font_load_from_struct(fontDef, "code", _f_code, false);
f_sdf = _font_load_from_struct(fontDef, "sdf", _f_sdf);
FONT_ISLOADED = true;
}
} #endregion
#region unused font cache
//function __fontCache() {
// var _f = font_add("LXGWWenKaiMonoLite-Bold.ttf", 16, false, false, 0, 0);
// var _fInfo = font_get_info(_f);
// var _gMap = _fInfo.glyphs;
// var _glyphs = variable_struct_get_names(_gMap);
// draw_set_text(_f, fa_left, fa_top, c_white);
// for( var i = 0, n = array_length(_glyphs); i < n; i++ ) {
// var _g = _glyphs[i];
// var _glyph = _gMap[$ _g];
// if(_glyph.w == 0 || _glyph.h == 0) continue;
// var _s = surface_create(_glyph.w, _glyph.h);
// surface_set_target(_s); DRAW_CLEAR
// draw_text(0, 0, chr(_glyph.char));
// surface_reset_target();
// surface_save(_s, $"{DIRECTORY}Locale/extend/cache/{_glyph.char}.png");
// surface_clear(_s);
// }
//} run_in(1, __fontCache);
#endregion

View file

@ -25,10 +25,10 @@
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
LATEST_VERSION = 11500;
VERSION = 11583;
VERSION = 11584;
SAVE_VERSION = 11570;
VERSION_STRING = "1.16rc3";
BUILD_NUMBER = 11583;
VERSION_STRING = "1.16rc4";
BUILD_NUMBER = 11584;
globalvar APPEND_MAP;
APPEND_MAP = ds_map_create();

View file

@ -1,28 +1,76 @@
function mask_apply(original, edited, mask, mix = 1) {
function __init_mask_modifier(_mask_index) { #region
var _ind = ds_list_size(inputs);
inputs[| _ind + 0] = nodeValue("Invert mask", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
inputs[| _ind + 1] = nodeValue("Mask feather", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 16)
.setDisplay(VALUE_DISPLAY.slider, { range: [0, 32, 1] });
__mask_index = _mask_index;
__mask_mod_index = _ind;
__mask_invert = false;
__mask_feather = 0;
} #endregion
function __step_mask_modifier() { #region
var _msk = is_surface(getSingleValue(__mask_index));
inputs[| __mask_mod_index + 0].setVisible(_msk);
inputs[| __mask_mod_index + 1].setVisible(_msk);
} #endregion
function __process_mask_modifier(data) { #region
__mask_invert = data[__mask_mod_index + 0];
__mask_feather = data[__mask_mod_index + 1];
} #endregion
function mask_modify(mask, invert = false, feather = 0) { #region
if(!is_surface(mask)) return mask;
if(!invert && feather == 0) return mask;
if(!struct_has(self, "__temp_mask")) __temp_mask = surface_create(1, 1);
__temp_mask = surface_verify(__temp_mask, surface_get_width_safe(mask), surface_get_height_safe(mask));
surface_set_shader(__temp_mask, invert? sh_invert_all : noone);
draw_surface(mask, 0, 0);
surface_reset_shader();
if(feather > 0) {
if(!struct_has(self, "__blur_hori")) surface_blur_init();
__temp_mask = surface_apply_gaussian(__temp_mask, feather, false, c_white, 1, noone);
}
return __temp_mask;
} #endregion
function mask_apply(original, edited, mask, mix = 1) { #region
if(!is_surface(mask) && mix == 1) return edited;
var _f = surface_get_format(edited);
var _s = surface_create_size(original, _f);
surface_set_target(_s);
shader_set(sh_mask);
texture_set_stage(shader_get_sampler_index(sh_mask, "original"), surface_get_texture(original));
texture_set_stage(shader_get_sampler_index(sh_mask, "edited"), surface_get_texture(edited));
if(is_surface(mask) && __mask_feather > 0) {
if(!struct_has(self, "__blur_hori")) surface_blur_init();
mask = surface_apply_gaussian(mask, __mask_feather, false, c_white, 1, noone);
}
shader_set_uniform_i(shader_get_uniform(sh_mask, "useMask"), is_surface(mask));
texture_set_stage(shader_get_sampler_index(sh_mask, "mask"), surface_get_texture(mask));
surface_set_shader(_s, sh_mask);
shader_set_surface("original", original);
shader_set_surface("edited", edited);
shader_set_surface("mask", mask);
shader_set_uniform_f(shader_get_uniform(sh_mask, "mixRatio"), mix);
shader_set_i("useMask", is_surface(mask));
shader_set_i("invMask", __mask_invert);
shader_set_f("mixRatio", mix);
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, surface_get_width_safe(original), surface_get_height_safe(original));
shader_reset();
surface_reset_target();
surface_reset_shader();
surface_free(edited);
return _s;
}
} #endregion
function channel_apply(original, edited, channel) {
function channel_apply(original, edited, channel) { #region
if(channel == 0b1111) return edited;
var _f = surface_get_format(edited);
@ -44,4 +92,4 @@ function channel_apply(original, edited, channel) {
surface_free(edited);
return _s;
}
} #endregion

View file

@ -33,7 +33,12 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
var butx = xx;
if(jun.connect_type == JUNCTION_CONNECT.input && jun.isAnimable() && !jun.expUse) { #region animation
var index = jun.hasJunctionFrom()? 2 : jun.is_anim;
draw_sprite_ui_uniform(THEME.animate_clock, index, butx, lb_y, 1, index == 2? COLORS._main_accent : c_white, 0.8);
var cc = c_white;
if(jun.is_anim) cc = COLORS._main_value_positive;
if(index == 2) cc = COLORS._main_accent;
draw_sprite_ui_uniform(THEME.animate_clock, index, butx, lb_y, 1, cc, 0.8);
if(_hover && point_in_circle(_m[0], _m[1], butx, lb_y, ui(10))) {
if(anim_hold != noone)
jun.setAnim(anim_hold);
@ -88,7 +93,12 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
cc = expValid? COLORS._main_value_positive : COLORS._main_value_negative;
}
if(global_var) if(string_pos(" ", _name)) cc = COLORS._main_value_negative;
if(global_var) {
if(string_pos(" ", _name)) cc = COLORS._main_value_negative;
} else {
if(jun.hasJunctionFrom()) cc = COLORS._main_accent;
if(jun.is_anim) cc = COLORS._main_value_positive;
}
draw_set_text(_font, fa_left, fa_center, cc);
var lb_w = string_width(_name) + ui(48);
@ -190,8 +200,15 @@ function drawWidget(xx, yy, ww, _m, jun, global_var = true, _hover = false, _foc
#region expression, pop up editor
if(jun.connect_type == JUNCTION_CONNECT.input && breakLine && !jun.is_anim && !global_var) {
var bx = xx + ww - ui(12);
var bx = xx + ww + ui(16);
var by = lb_y;
bx -= ui(28);
if(jun.is_modified && buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_reset", "Reset value"), THEME.refresh_s, 0, COLORS._main_icon) == 2) {
jun.resetValue();
}
bx -= ui(28);
var ic_b = jun.expUse? c_white : COLORS._main_icon;
if(buttonInstant(THEME.button_hide, bx - ui(12), by - ui(12), ui(24), ui(24), _m, _focus, _hover, __txtx("panel_inspector_use_expression", "Use expression"), THEME.node_use_expression, jun.expUse, ic_b) == 2) {
jun.expUse = !jun.expUse;

View file

@ -14,8 +14,10 @@ function Node_Alpha_Cutoff(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
inputs[| 4] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
active_index = 4;
__init_mask_modifier(2); // inputs 5, 6,
input_display_list = [ 4,
["Surfaces", true], 0, 2, 3,
["Surfaces", true], 0, 2, 3, 5, 6,
["Cutoff", false], 1,
]
@ -23,6 +25,10 @@ function Node_Alpha_Cutoff(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
surface_set_target(_outSurf);
DRAW_CLEAR
@ -36,6 +42,7 @@ function Node_Alpha_Cutoff(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[2], _data[3]);
return _outSurf;

View file

@ -17,8 +17,10 @@ function Node_Average(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
inputs[| 4] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(1); // inputs 5, 6,
input_display_list = [ 3, 4,
["Surfaces", false], 0, 1, 2,
["Surfaces", false], 0, 1, 2, 5, 6,
]
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
@ -29,6 +31,10 @@ function Node_Average(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
colors = [];
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var inSurf = _data[0];
if(!is_surface(inSurf)) return _outSurf;
@ -77,6 +83,7 @@ function Node_Average(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
draw_clear(cc);
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[1], _data[2]);
_outSurf = channel_apply(_data[0], _outSurf, _data[4]);
colors[_array_index] = cc;

View file

@ -32,10 +32,12 @@ function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 8] = nodeValue("Oversample mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0, "How to deal with pixel outside the surface.\n - Empty: Use empty pixel\n - Clamp: Repeat edge pixel\n - Repeat: Repeat texture.")
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Empty", "Clamp", "Repeat" ]);
__init_mask_modifier(5); // inputs 9, 10
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 7,
["Surfaces", true], 0, 5, 6,
["Surfaces", true], 0, 5, 6, 9, 10,
["Bevel", false], 4, 1,
["Transform", false], 2, 3,
];
@ -55,6 +57,10 @@ function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 2].drawOverlay(active, _x + _pw, _y + _ph, _s, _mx, _my, _snx, _sny);
}
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _hei = _data[1];
var _shf = _data[2];
@ -73,6 +79,7 @@ function Node_Bevel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
draw_surface_safe(_data[0], 0, 0);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[5], _data[6]);
return _outSurf;

View file

@ -40,10 +40,15 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 11] = nodeValue("Vertical Align", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_button, [ THEME.inspector_surface_valign, THEME.inspector_surface_valign, THEME.inspector_surface_valign]);
inputs[| 12] = nodeValue("Invert mask", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
inputs[| 13] = nodeValue("Mask feather", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 16, 1] });
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 8,
["Surfaces", true], 0, 1, 4, 6, 7,
["Surfaces", true], 0, 1, 4, 12, 13, 6, 7,
["Blend", false], 2, 3, 9,
["Transform", false], 5, 10, 11,
]
@ -67,6 +72,10 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 10].setVisible(_fill == 0 && !_atlas);
inputs[| 11].setVisible(_fill == 0 && !_atlas);
var _msk = is_surface(getSingleValue(4));
inputs[| 12].setVisible(_msk);
inputs[| 12].setVisible(_msk);
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
@ -83,6 +92,10 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
var _halign = _data[10];
var _valign = _data[11];
var _mskInv = _data[12];
var _mskFea = _data[13];
var cDep = attrDepth();
var ww = 1, hh = 1;
@ -168,6 +181,8 @@ function Node_Blend(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
else
_output = surface_verify(_outSurf, ww, hh, cDep);
_mask = mask_modify(_mask, _mskInv, _mskFea);
surface_set_shader(_output, noone);
draw_surface_blend(_backDraw, _foreDraw, _type, _opacity, _pre_alp, _mask, _fill == 2);
surface_reset_shader();

View file

@ -31,8 +31,10 @@ function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 8] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(5); // inputs 9, 10
input_display_list = [ 7, 8,
["Surfaces", true], 0, 5, 6,
["Surfaces", true], 0, 5, 6, 9, 10,
["Bloom", false], 1, 2, 3, 4,
]
@ -42,6 +44,10 @@ function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
surface_blur_init();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _size = _data[1];
var _tole = _data[2];
@ -83,6 +89,7 @@ function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[5], _data[6]);
_outSurf = channel_apply(_data[0], _outSurf, _data[8]);

View file

@ -23,10 +23,12 @@ function Node_Blur(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
inputs[| 8] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(5); // inputs 9, 10
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 7, 8,
["Surfaces", true], 0, 5, 6,
["Surfaces", true], 0, 5, 6, 9, 10,
["Blur", false], 1, 3, 4,
];
@ -34,6 +36,10 @@ function Node_Blur(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
attribute_oversample();
surface_blur_init();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _size = _data[1];
var _clamp = struct_try_get(attributes, "oversample");
@ -51,6 +57,7 @@ function Node_Blur(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _mask, _mix);
_outSurf = channel_apply(_data[0], _outSurf, _data[8]);

View file

@ -21,8 +21,10 @@ function Node_Blur_Bokeh(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
inputs[| 5] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(2); // inputs 6, 7
input_display_list = [ 4, 5,
["Surfaces", true], 0, 2, 3,
["Surfaces", true], 0, 2, 3, 6, 7,
["Blur", false], 1,
]
@ -30,6 +32,10 @@ function Node_Blur_Bokeh(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _str = _data[1];
var _mask = _data[2];
@ -48,6 +54,7 @@ function Node_Blur_Bokeh(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _mask, _mix);
_outSurf = channel_apply(_data[0], _outSurf, _data[5]);

View file

@ -1,12 +1,6 @@
function Node_Blur_Contrast(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "Contrast Blur";
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("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue("Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 3)
@ -26,8 +20,10 @@ function Node_Blur_Contrast(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
inputs[| 6] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(3); // inputs 7, 8
input_display_list = [ 5, 6,
["Surfaces", true], 0, 3, 4,
["Surfaces", true], 0, 3, 4, 7, 8,
["Blur", false], 1, 2,
]
@ -37,6 +33,10 @@ function Node_Blur_Contrast(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _surf = _data[0];
var _size = _data[1];
@ -49,29 +49,24 @@ function Node_Blur_Contrast(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
temp_surface[0] = surface_verify(temp_surface[0], ww, hh, attrDepth());
surface_set_target(temp_surface[0]);
DRAW_CLEAR
BLEND_OVERRIDE;
shader_set(shader);
shader_set_uniform_f_array_safe(uniform_dim, [ ww, hh ]);
shader_set_uniform_f(uniform_siz, _size);
shader_set_uniform_f(uniform_tes, _tres);
shader_set_uniform_i(uniform_dir, 0);
surface_set_shader(temp_surface[0], sh_blur_box_contrast);
shader_set_surface("baseSurface", _surf);
shader_set_f("dimension", [ ww, hh ]);
shader_set_f("size", _size);
shader_set_f("treshold", _tres);
shader_set_i("direction", 0);
draw_surface_safe(_surf, 0, 0);
shader_reset();
BLEND_NORMAL;
surface_reset_target();
surface_reset_shader();
surface_set_shader(_outSurf, sh_blur_box_contrast);
shader_set(sh_blur_box_contrast);
shader_set_i("direction", 1);
surface_set_target(_outSurf);
DRAW_CLEAR
BLEND_OVERRIDE;
shader_set(shader);
shader_set_uniform_i(uniform_dir, 1);
draw_surface_safe(temp_surface[0], 0, 0);
shader_reset();
BLEND_NORMAL;
surface_reset_target();
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _mask, _mix);
_outSurf = channel_apply(_data[0], _outSurf, _data[6]);

View file

@ -20,8 +20,10 @@ function Node_Blur_Directional(_x, _y, _group = noone) : Node_Processor(_x, _y,
inputs[| 6] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(3); // inputs 7, 8
input_display_list = [ 5, 6,
["Surfaces", true], 0, 3, 4,
["Surfaces", true], 0, 3, 4, 7, 8,
["Blur", false], 1, 2,
]
@ -43,6 +45,10 @@ function Node_Blur_Directional(_x, _y, _group = noone) : Node_Processor(_x, _y,
inputs[| 2].drawOverlay(active, _x + ww / 2 * _s, _y + hh / 2 * _s, _s, _mx, _my, _snx, _sny);
} #endregion
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _str = _data[1];
var _dir = _data[2];
@ -57,6 +63,7 @@ function Node_Blur_Directional(_x, _y, _group = noone) : Node_Processor(_x, _y,
draw_surface_safe(_data[0], 0, 0);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _mask, _mix);
_outSurf = channel_apply(_data[0], _outSurf, _data[6]);

View file

@ -24,10 +24,12 @@ function Node_Blur_Radial(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
inputs[| 7] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(4); // inputs 8, 9,
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 6, 7,
["Surfaces", true], 0, 4, 5,
["Surfaces", true], 0, 4, 5, 8, 9,
["Blur", false], 1, 2,
];
@ -44,6 +46,10 @@ function Node_Blur_Radial(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
} #endregion
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _str = _data[1];
var _cen = _data[2];
@ -63,6 +69,7 @@ function Node_Blur_Radial(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
draw_surface_safe(_data[0], 0, 0);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _mask, _mix);
_outSurf = channel_apply(_data[0], _outSurf, _data[7]);

View file

@ -35,8 +35,10 @@ function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
inputs[| 9] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(6); // inputs 10, 11,
input_display_list = [ 8, 9,
["Surfaces", true], 0, 6, 7,
["Surfaces", true], 0, 6, 7, 10, 11,
["Blur", false], 1, 3, 4, 5,
];
@ -45,6 +47,10 @@ function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
attribute_surface_depth();
attribute_oversample();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
if(!is_surface(_data[0])) return _outSurf;
var _size = _data[1];
@ -79,6 +85,7 @@ function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _msk, _mix);
_outSurf = channel_apply(_data[0], _outSurf, _data[9]);

View file

@ -28,10 +28,12 @@ function Node_Blur_Zoom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
inputs[| 9] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(6); // inputs 10, 11
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 8, 9,
["Surfaces", true], 0, 6, 7,
["Surfaces", true], 0, 6, 7, 10, 11,
["Blur", false], 1, 2, 4, 5
];
@ -47,6 +49,10 @@ function Node_Blur_Zoom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
} #endregion
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _str = _data[1];
var _cen = _data[2];
@ -72,6 +78,7 @@ function Node_Blur_Zoom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
draw_surface_safe(_data[0], 0, 0);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _mask, _mix);
_outSurf = channel_apply(_data[0], _outSurf, _data[9]);

View file

@ -24,8 +24,10 @@ function Node_BW(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constr
inputs[| 6] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(3); // inputs 7, 8
input_display_list = [ 5, 6,
["Surfaces", true], 0, 3, 4,
["Surfaces", true], 0, 3, 4, 7, 8,
["BW", false], 1, 2,
]
@ -33,6 +35,10 @@ function Node_BW(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constr
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _exp = _data[1];
var _con = _data[2];
@ -49,6 +55,7 @@ function Node_BW(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constr
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[3], _data[4]);
_outSurf = channel_apply(_data[0], _outSurf, _data[6]);

View file

@ -4,7 +4,7 @@ function Node_Camera(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
inputs[| 0] = nodeValue("Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
onSurfaceSize = function() { return surface_get_dimension(getInputData(0, DEF_SURF)); };
onSurfaceSize = function() { return surface_get_dimension(getInputData(0)); };
inputs[| 1] = nodeValue("Focus area", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0, 0, 16, 16, AREA_SHAPE.rectangle ])
.setDisplay(VALUE_DISPLAY.area, { onSurfaceSize });

View file

@ -47,13 +47,18 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
inputs[| 15] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
inputs[| 16] = nodeValue("Invert mask", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
inputs[| 17] = nodeValue("Mask feather", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 16, 1] });
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
outputs[| 1] = nodeValue("Color out", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, [])
.setDisplay(VALUE_DISPLAY.palette);
input_display_list = [11, 12, 15, 9,
["Surface", false], 0, 8, 13,
["Surface", false], 0, 8, 16, 17, 13,
["Brightness", false], 1, 10, 2,
["HSV", false], 3, 4, 5,
["Color blend", false], 6, 14, 7
@ -74,6 +79,10 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
outputs[| 0].setVisible(type == 0, type == 0);
outputs[| 1].setVisible(type == 1, type == 1);
var _msk = is_surface(getSingleValue(8));
inputs[| 16].setVisible(_msk);
inputs[| 17].setVisible(_msk);
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
@ -93,6 +102,9 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
var _col = _data[13];
var _blm = _data[14];
var _mskInv = _data[16];
var _mskFea = _data[17];
if(_type == 0 && _output_index != 0) return [];
if(_type == 1 && _output_index != 1) return noone;
@ -134,6 +146,8 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
return _col;
}
_m = mask_modify(_m, _mskInv, _mskFea);
surface_set_shader(_baseSurf, sh_color_adjust);
shader_set_f("brightness", _bri);
shader_set_f("exposure", _exp);

View file

@ -40,8 +40,10 @@ function Node_Color_replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
inputs[| 10] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(7); // inputs 11, 12
input_display_list = [ 9, 10,
["Surfaces", true], 0, 7, 8,
["Surfaces", true], 0, 7, 8, 11, 12,
["Palette", false], 1, 2,
["Comparison", false], 3, 5,
["Render", false], 4, 6
@ -51,6 +53,10 @@ function Node_Color_replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var fr = _data[1];
var to = _data[2];
@ -100,6 +106,7 @@ function Node_Color_replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
BLEND_NORMAL
surface_reset_target();
__process_mask_modifier(_data);
if(!in) _outSurf = mask_apply(_data[0], _outSurf, _data[7], _data[8]);
_outSurf = channel_apply(_data[0], _outSurf, _data[10]);

View file

@ -29,8 +29,10 @@ function Node_Color_Remove(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
inputs[| 7] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(3); // inputs 8, 9,
input_display_list = [ 5, 7,
["Surfaces", true], 0, 3, 4,
["Surfaces", true], 0, 3, 4, 8, 9,
["Remove", false], 1, 2, 6,
]
@ -38,6 +40,10 @@ function Node_Color_Remove(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var frm = _data[1];
var thr = _data[2];
@ -63,6 +69,7 @@ function Node_Color_Remove(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[3], _data[4]);
_outSurf = channel_apply(_data[0], _outSurf, _data[7]);

View file

@ -20,10 +20,12 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
inputs[| 6] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
active_index = 6;
__init_mask_modifier(4); // inputs 7, 8,
selecting_index = 0;
function setColor(colr) { #region
var _to = getInputData(2);
var _to = array_clone(getInputData(2));
_to[selecting_index] = colr;
inputs[| 2].setValue(_to); // Not necessary due to array reference
@ -118,7 +120,7 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
}); #endregion
input_display_list = [ 6,
["Surfaces", true], 0, 4, 5,
["Surfaces", true], 0, 4, 5, 7, 8,
["Replace", false], render_palette, 2,
["Comparison", false], 3,
];
@ -166,6 +168,10 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
inputs[| 2].setValue(palette);
} #endregion
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var fr = _data[1];
var to = _data[2];
@ -183,6 +189,7 @@ function Node_Colors_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[4], _data[5]);
return _outSurf;

View file

@ -29,8 +29,10 @@ function Node_Colorize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
inputs[| 7] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(3); // inputs 8, 9,
input_display_list = [ 5, 7,
["Surfaces", true], 0, 3, 4,
["Surfaces", true], 0, 3, 4, 8, 9,
["Colorize", false], 1, 2, 6,
]
@ -38,6 +40,10 @@ function Node_Colorize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _gra = _data[1];
var _gra_shift = _data[2];
@ -65,6 +71,7 @@ function Node_Colorize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[3], _data[4]);
_outSurf = channel_apply(_data[0], _outSurf, _data[7]);

View file

@ -25,16 +25,22 @@ function Node_Convolution(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
inputs[| 6] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(3); // inputs 7, 8,
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 5, 6,
["Surfaces", true], 0, 3, 4,
["Surfaces", true], 0, 3, 4, 7, 8,
["Kernel", false], 1,
];
attribute_surface_depth();
attribute_oversample();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _ker = _data[1];
var _sam = struct_try_get(attributes, "oversample");
@ -53,6 +59,7 @@ function Node_Convolution(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[3], _data[4]);
_outSurf = channel_apply(_data[0], _outSurf, _data[6]);

View file

@ -23,8 +23,10 @@ function Node_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
inputs[| 5] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(2); // inputs 6, 7
input_display_list = [ 4, 5,
["Surfaces", true], 0, 2, 3,
["Surfaces", true], 0, 2, 3, 6, 7,
["Corner", false], 1,
]
@ -32,6 +34,10 @@ function Node_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var wd = _data[1];
@ -65,6 +71,7 @@ function Node_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
surface_reset_target();
surface_free(temp);
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[2], _data[3]);
_outSurf = channel_apply(_data[0], _outSurf, _data[5]);

View file

@ -35,15 +35,21 @@ function Node_Curve(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 8] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(5); // inputs 9, 10
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 7, 8,
["Surfaces", true], 0, 5, 6,
["Surfaces", true], 0, 5, 6, 9, 10,
["Curve", false], 1, 2, 3, 4,
];
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _wcur = _data[1];
var _rcur = _data[2];
@ -70,6 +76,7 @@ function Node_Curve(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[5], _data[6]);
_outSurf = channel_apply(_data[0], _outSurf, _data[8]);

View file

@ -33,10 +33,12 @@ function Node_Dilate(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
inputs[| 8] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(5); // inputs 9, 10
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 7, 8,
["Surfaces", true], 0, 5, 6,
["Surfaces", true], 0, 5, 6, 9, 10,
["Dilate", false], 1, 2, 3,
];
@ -54,6 +56,10 @@ function Node_Dilate(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
inputs[| 3].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny, 0, 1, THEME.anchor_scale_hori);
} #endregion
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var center = _data[1];
var stren = _data[2];
@ -70,6 +76,7 @@ function Node_Dilate(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
draw_surface_safe(_data[0], 0, 0);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[5], _data[6]);
_outSurf = channel_apply(_data[0], _outSurf, _data[8]);

View file

@ -40,8 +40,10 @@ If set, then strength value control how many times the effect applies on itself.
inputs[| 12] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(8); // inputs 13, 14
input_display_list = [ 10, 12,
["Surfaces", true], 0, 8, 9,
["Surfaces", true], 0, 8, 9, 13, 14,
["Displace", false], 1, 3, 4,
["Color", false], 5, 2,
["Algorithm", true], 6, 11,
@ -53,6 +55,10 @@ If set, then strength value control how many times the effect applies on itself.
attribute_oversample();
attribute_interpolation();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
switch(_data[5]) {
case 0 :
@ -83,6 +89,7 @@ If set, then strength value control how many times the effect applies on itself.
draw_surface_safe(_data[0]);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[8], _data[9]);
_outSurf = channel_apply(_data[0], _outSurf, _data[12]);

View file

@ -45,16 +45,22 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
inputs[| 10] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(7); // inputs 11, 12,
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 9, 10,
["Surfaces", true], 0, 7, 8,
["Surfaces", true], 0, 7, 8, 11, 12,
["Pattern", false], 2, 3,
["Dither", false], 6, 1, 4, 5
]
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _pal = _data[1];
var _typ = _data[2];
@ -142,6 +148,7 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[7], _data[8]);
_outSurf = channel_apply(_data[0], _outSurf, _data[10]);

View file

@ -25,16 +25,22 @@ function Node_Edge_Detect(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
inputs[| 6] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(3); // inputs 7, 8
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 5, 6,
["Surfaces", true], 0, 3, 4,
["Surfaces", true], 0, 3, 4, 7, 8,
["Edge detect", false], 1,
];
attribute_surface_depth();
attribute_oversample();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var ft = _data[1];
var ov = struct_try_get(attributes, "oversample");
@ -53,6 +59,7 @@ function Node_Edge_Detect(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[3], _data[4]);
_outSurf = channel_apply(_data[0], _outSurf, _data[6]);

View file

@ -26,8 +26,10 @@ function Node_Erode(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 7] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(4); // inputs 8, 9,
input_display_list = [ 6, 7,
["Surfaces", true], 0, 4, 5,
["Surfaces", true], 0, 4, 5, 8, 9,
["Erode", false], 1, 2, 3,
]
@ -35,6 +37,10 @@ function Node_Erode(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var wd = _data[1];
@ -53,6 +59,7 @@ function Node_Erode(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[4], _data[5]);
_outSurf = channel_apply(_data[0], _outSurf, _data[7]);

View file

@ -22,10 +22,12 @@ function Node_Flood_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
inputs[| 7] = nodeValue("Diagonal", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
__init_mask_modifier(1); // inputs 8, 9
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 3,
["Surfaces", false], 0, 1, 2,
["Surfaces", false], 0, 1, 2, 8, 9,
["Fill", false], 4, 6, 5, 7,
]
@ -45,6 +47,10 @@ function Node_Flood_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
}
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var inSurf = _data[0];
if(!is_surface(inSurf)) return _outSurf;
@ -109,6 +115,7 @@ function Node_Flood_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
shader_reset();
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[1], _data[2]);
return _outSurf;
}

View file

@ -27,8 +27,10 @@ function Node_Glow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
inputs[| 7] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
active_index = 7;
__init_mask_modifier(5); // inputs 8, 9,
input_display_list = [ 7,
["Surfaces", true], 0, 5, 6,
["Surfaces", true], 0, 5, 6, 8, 9,
["Glow", false], 1, 2, 3, 4,
]
@ -37,6 +39,10 @@ function Node_Glow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
surface_blur_init();
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _border = _data[1];
var _size = _data[2];
@ -73,6 +79,7 @@ function Node_Glow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
surface_free(pass1);
surface_free(s);
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[5], _data[6]);
return _outSurf;

View file

@ -24,8 +24,10 @@ function Node_Greyscale(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
inputs[| 6] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(3); // inputs 7, 8
input_display_list = [ 5, 6,
["Surfaces", true], 0, 3, 4,
["Surfaces", true], 0, 3, 4, 7, 8,
["Greyscale", false], 1, 2,
]
@ -33,6 +35,10 @@ function Node_Greyscale(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _exp = _data[1];
var _con = _data[2];
@ -49,6 +55,7 @@ function Node_Greyscale(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[3], _data[4]);
_outSurf = channel_apply(_data[0], _outSurf, _data[6]);

View file

@ -31,17 +31,18 @@ function Node_Interpret_Number(_x, _y, _group = noone) : Node_Processor(_x, _y,
static processData = function(_outSurf, _data, _output_index, _array_index) {
static BATCH_SIZE = 1024;
var _num = _data[0];
var _val = _data[0];
var _mod = _data[1];
var _ran = _data[2];
var _grd = _data[3];
if(!is_array(_num)) _num = [ _num ];
_num = array_spread(_num);
if(is_array(_val) && array_empty(_val)) return _outSurf;
if(!is_array(_val)) _val = [ _val ];
var _num = array_spread(_val);
var _amo = array_length(_num);
_outSurf = surface_verify(_outSurf, _amo, 1, attrDepth());
if(_amo == 0) return _outSurf;
surface_set_shader(_outSurf, sh_interpret_number);
shader_set_i("mode", _mod);

View file

@ -14,14 +14,20 @@ function Node_Invert(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
inputs[| 4] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(1); // inputs 5, 6
input_display_list = [ 3, 4,
["Surfaces", true], 0, 1, 2,
["Surfaces", true], 0, 1, 2, 5, 6,
]
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
surface_set_target(_outSurf);
DRAW_CLEAR
@ -34,6 +40,7 @@ function Node_Invert(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[1], _data[2]);
_outSurf = channel_apply(_data[0], _outSurf, _data[4]);

View file

@ -41,6 +41,8 @@ function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 9] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(6); // inputs 10, 11
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
attribute_surface_depth();
@ -80,7 +82,7 @@ function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
input_display_list = [ 8, 9,
level_renderer,
["Surfaces", true], 0, 6, 7,
["Surfaces", true], 0, 6, 7, 10, 11,
["Level", false], 1,
["Channel", true], 2, 3, 4, 5
];
@ -99,6 +101,10 @@ function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
}
} #endregion
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _wmin = min(_data[1][0], _data[1][1]);
var _wmax = max(_data[1][0], _data[1][1]);
@ -133,6 +139,7 @@ function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[6], _data[7]);
_outSurf = channel_apply(_data[0], _outSurf, _data[9]);

View file

@ -24,6 +24,8 @@ function Node_Level_Selector(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
inputs[| 6] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(3); // inputs 7, 8,
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
attribute_surface_depth();
@ -65,7 +67,7 @@ function Node_Level_Selector(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
input_display_list = [ 5, 6,
level_renderer,
["Surfaces", true], 0, 3, 4,
["Surfaces", true], 0, 3, 4, 7, 8,
["Level", false], 1, 2,
];
histogramInit();
@ -83,6 +85,10 @@ function Node_Level_Selector(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
}
} #endregion
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _middle = _data[1];
var _range = _data[2];
@ -101,6 +107,7 @@ function Node_Level_Selector(_x, _y, _group = noone) : Node_Processor(_x, _y, _g
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[3], _data[4]);
_outSurf = channel_apply(_data[0], _outSurf, _data[6]);

View file

@ -33,16 +33,22 @@ function Node_Local_Analyze(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
inputs[| 8] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(5); // inputs 9, 10
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 7, 8,
["Surfaces", true], 0, 5, 6,
["Surfaces", true], 0, 5, 6, 9, 10,
["Effect", false], 1, 2, 4,
];
attribute_surface_depth();
attribute_oversample();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _alg = _data[1];
var _siz = _data[2];
@ -65,6 +71,7 @@ function Node_Local_Analyze(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
BLEND_NORMAL;
surface_reset_target();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[5], _data[6]);
_outSurf = channel_apply(_data[0], _outSurf, _data[8]);

View file

@ -30,12 +30,14 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
inputs[| 12] = nodeValue("Crop border", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
__init_mask_modifier(9); // inputs 13, 14
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
outputs[| 1] = nodeValue("Outline", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 11,
["Surfaces", true], 0, 9, 10,
["Surfaces", true], 0, 9, 10, 13, 14,
["Outline", false], 1, 5, 8, 12,
["Render", false], 2, 3, 4, 6,
];
@ -49,6 +51,8 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
inputs[| 4].setVisible(blend);
inputs[| 12].setVisible(_side == 0);
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
@ -82,6 +86,7 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
draw_surface_safe(_data[0], 0, 0);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[9], _data[10]);
return _outSurf;

View file

@ -20,8 +20,10 @@ function Node_Palette_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
inputs[| 6] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(3); // inputs 7, 8
input_display_list = [ 5, 6,
["Surfaces", true], 0, 3, 4,
["Surfaces", true], 0, 3, 4, 7, 8,
["Palette", false], 1, 2
]
@ -29,6 +31,10 @@ function Node_Palette_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _pal = _data[1];
var _shf = _data[2];
@ -48,6 +54,7 @@ function Node_Palette_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
draw_surface_safe(_data[0], 0, 0);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[3], _data[4]);
_outSurf = channel_apply(_data[0], _outSurf, _data[6]);

View file

@ -2,7 +2,7 @@ function Node_Particle(_x, _y, _group = noone) : Node_VFX_Spawner_Base(_x, _y, _
name = "Particle";
use_cache = CACHE_USE.auto;
onSurfaceSize = function() { return surface_get_dimension(getInputData(input_len, DEF_SURF)); };
onSurfaceSize = function() { return getInputData(input_len, DEF_SURF); };
inputs[| 3].setDisplay(VALUE_DISPLAY.area, { onSurfaceSize });
inputs[| 22].setDisplay(VALUE_DISPLAY.enum_scroll, [ "Random", "Order", "Animation", "Array" ]);

View file

@ -28,8 +28,10 @@ function Node_Pixel_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
inputs[| 7] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(4); // inputs 8, 9
input_display_list = [ 6, 7,
["Surfaces", true], 0, 4, 5,
["Surfaces", true], 0, 4, 5, 8, 9,
["Pixel sort", false], 1, 2, 3,
]
@ -37,6 +39,10 @@ function Node_Pixel_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
attribute_surface_depth();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _in = _data[0];
@ -89,6 +95,7 @@ function Node_Pixel_Sort(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
surface_free(pp[0]);
surface_free(pp[1]);
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[4], _data[5]);
_outSurf = channel_apply(_data[0], _outSurf, _data[7]);

View file

@ -19,16 +19,22 @@ function Node_Polar(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 6] = nodeValue("Blend", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider);
__init_mask_modifier(1); // inputs 7, 8,
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 3, 4,
["Surfaces", false], 0, 1, 2,
["Surfaces", false], 0, 1, 2, 7, 8,
["Effect", false], 5, 6,
]
attribute_surface_depth();
attribute_interpolation();
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
surface_set_shader(_outSurf, sh_polar);
shader_set_interpolation(_data[0]);
@ -38,6 +44,7 @@ function Node_Polar(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
draw_surface_safe(_data[0], 0, 0);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[1], _data[2]);
_outSurf = channel_apply(_data[0], _outSurf, _data[4]);

View file

@ -15,7 +15,7 @@ function Node_Scatter(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
inputs[| 4] = nodeValue("Angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0, 0, 0, 0, 0 ] )
.setDisplay(VALUE_DISPLAY.rotation_random);
onSurfaceSize = function() { return surface_get_dimension(getInputData(1, DEF_SURF)); };
onSurfaceSize = function() { return getInputData(1, DEF_SURF); };
inputs[| 5] = nodeValue("Area", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ DEF_SURF_W / 2, DEF_SURF_H / 2, DEF_SURF_W / 2, DEF_SURF_H / 2, AREA_SHAPE.rectangle ])
.setDisplay(VALUE_DISPLAY.area, { onSurfaceSize });

View file

@ -5,7 +5,7 @@ function Node_Scatter_Points(_x, _y, _group = noone) : Node(_x, _y, _group) cons
w = 96;
onSurfaceSize = function() { return surface_get_dimension(getInputData(7, DEF_SURF)); };
onSurfaceSize = function() { return getInputData(7, DEF_SURF); };
inputs[| 0] = nodeValue("Point area", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ DEF_SURF_W / 2, DEF_SURF_H / 2, DEF_SURF_W / 2, DEF_SURF_H / 2, AREA_SHAPE.rectangle ])
.setDisplay(VALUE_DISPLAY.area, { onSurfaceSize });

View file

@ -30,10 +30,12 @@ function Node_Shadow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
inputs[| 8] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
active_index = 8;
__init_mask_modifier(6); // inputs 9, 10
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 8,
["Surfaces", true], 0, 6, 7,
["Surfaces", true], 0, 6, 7, 9, 10,
["Shadow", false], 1, 2, 3, 4, 5,
];
@ -53,6 +55,10 @@ function Node_Shadow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
inputs[| 3].drawOverlay(active, _x + ww / 2, _y + hh / 2, _s, _mx, _my, _snx, _sny);
}
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var cl = _data[1];
var _stre = _data[2];
@ -84,6 +90,7 @@ function Node_Shadow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
surface_reset_target();
surface_free(pass1);
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[6], _data[7]);
return _outSurf;

View file

@ -20,7 +20,7 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 2] = nodeValue("Shape", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Rectangle", "Ellipse", "Regular polygon", "Star", "Arc", "Teardrop", "Cross", "Leaf" ]);
onSurfaceSize = function() { return surface_get_dimension(getInputData(0, DEF_SURF)); };
onSurfaceSize = function() { return getInputData(0, DEF_SURF); };
inputs[| 3] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ DEF_SURF_W / 2, DEF_SURF_H / 2, DEF_SURF_W / 2, DEF_SURF_H / 2, AREA_SHAPE.rectangle ])
.setDisplay(VALUE_DISPLAY.area, { onSurfaceSize });

View file

@ -29,8 +29,10 @@ function Node_Skew(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
inputs[| 9] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(6); // inputs 10, 11
input_display_list = [ 8, 9,
["Surfaces", true], 0, 6, 7,
["Surfaces", true], 0, 6, 7, 10, 11,
["Skew", false], 1, 2, 4,
]
@ -52,6 +54,10 @@ function Node_Skew(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
inputs[| 4].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
}
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _axis = _data[1];
var _amou = _data[2];
@ -69,6 +75,7 @@ function Node_Skew(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
draw_surface_safe(_data[0], 0, 0);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[6], _data[7]);
_outSurf = channel_apply(_data[0], _outSurf, _data[9]);

View file

@ -30,10 +30,12 @@ function Node_Threshold(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
inputs[| 10] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(4); // inputs 11, 12
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 6, 10,
["Surfaces", true], 0, 4, 5,
["Surfaces", true], 0, 4, 5, 11, 12,
["Threshold", false], 1, 2, 3, 7, 8, 9,
];
@ -47,6 +49,8 @@ function Node_Threshold(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
var _alpha = getInputData(7);
inputs[| 8].setVisible(_alpha);
inputs[| 9].setVisible(_alpha);
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
@ -70,6 +74,7 @@ function Node_Threshold(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
draw_surface_safe(_data[0]);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[4], _data[5]);
_outSurf = channel_apply(_data[0], _outSurf, _data[10]);

View file

@ -33,10 +33,12 @@ function Node_Twirl(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 8] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111)
.setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) });
__init_mask_modifier(5); // inputs 9, 10
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 7, 8,
["Surfaces", true], 0, 5, 6,
["Surfaces", true], 0, 5, 6, 9, 10,
["Twirl", false], 1, 2, 3,
];
@ -53,6 +55,10 @@ function Node_Twirl(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 3].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny, 0, 1, THEME.anchor_scale_hori);
} #endregion
static step = function() { #region
__step_mask_modifier();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var center = _data[1];
var stren = _data[2];
@ -69,6 +75,7 @@ function Node_Twirl(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
draw_surface_safe(_data[0], 0, 0);
surface_reset_shader();
__process_mask_modifier(_data);
_outSurf = mask_apply(_data[0], _outSurf, _data[5], _data[6]);
_outSurf = channel_apply(_data[0], _outSurf, _data[8]);

View file

@ -578,7 +578,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
dyna_depo = ds_list_create();
value_tag = "";
is_changed = true;
is_modified = false;
cache_value = [ false, false, undefined, undefined ];
cache_array = [ false, false ];
use_cache = true;
@ -694,7 +694,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
return self;
} #endregion
static resetValue = function() { setValue(def_val); }
static resetValue = function() { setValue(def_val); is_modified = false; }
static setUnitRef = function(ref, mode = VALUE_UNIT.constant) { #region
unit.reference = ref;
@ -1439,7 +1439,6 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
}
if(useCache) {
is_changed = !isEqual(cache_value[2], val);
cache_value[0] = true;
cache_value[1] = _time;
}
@ -1721,6 +1720,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
} #endregion
static setValueDirect = function(val = 0, index = noone, record = true, time = CURRENT_FRAME, _update = true) { #region
is_modified = true;
var updated = false;
var _val;
@ -2414,6 +2414,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
_map.sep_axis = sep_axis;
_map.shift_x = draw_line_shift_x;
_map.shift_y = draw_line_shift_y;
_map.is_modified= is_modified;
if(!preset && value_from) {
_map.from_node = value_from.node.node_id;
@ -2466,6 +2467,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
draw_line_shift_x = struct_try_get(_map, "shift_x");
draw_line_shift_y = struct_try_get(_map, "shift_y");
is_modified = struct_try_get(_map, "is_modified", true);
name_custom = struct_try_get(_map, "name_custom", false);
if(name_custom) name = struct_try_get(_map, "name", name);

View file

@ -3,7 +3,7 @@ function Node_Wrap_Area(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
onSurfaceSize = function() { return surface_get_dimension(getInputData(0, DEF_SURF)); };
onSurfaceSize = function() { return surface_get_dimension(getInputData(0)); };
inputs[| 1] = nodeValue("Area", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 16, 16, 4, 4, AREA_SHAPE.rectangle ])
.setDisplay(VALUE_DISPLAY.area, { onSurfaceSize });

View file

@ -30,6 +30,8 @@ function Panel_Collection() : PanelContent() constructor {
updated_prog = 0;
data_path = "";
view_tooltip = new tooltipSelector("View", [ "Grid", "List" ])
static initMenu = function() { #region
if(_menu_node == noone) return;
var meta = _menu_node.getMetadata();
@ -141,7 +143,7 @@ function Panel_Collection() : PanelContent() constructor {
contentView = 0;
contentPane = new scrollPane(content_w - ui(6), content_h, function(_y, _m) { #region
draw_clear_alpha(COLORS._main_text_inner, 0);
draw_clear_alpha(c_white, 0);
var nodes = search_string == ""? context.content : search_list;
if(mode == 0 && context == root) nodes = STEAM_COLLECTION;
@ -154,10 +156,10 @@ function Panel_Collection() : PanelContent() constructor {
var node_list = ds_list_size(nodes);
var node_count = node_list + array_length(steamNode);
var hh = 0;
var frame = current_time * PREFERENCES.collection_preview_speed / 3000;
var _cw = contentPane.surface_w;
var _hover = pHOVER && contentPane.hover;
var hh = 0;
updated_prog = lerp_linear(updated_prog, 0, 0.01);
@ -219,7 +221,7 @@ function Panel_Collection() : PanelContent() constructor {
if(sprite_exists(_node.spr)) {
var sw = sprite_get_width(_node.spr);
var sh = sprite_get_height(_node.spr);
var ss = ui(32) / max(sw, sh);
var ss = (grid_size - ui(10)) / max(sw, sh);
var xo = (sprite_get_xoffset(_node.spr) - sw / 2) * ss;
var yo = (sprite_get_yoffset(_node.spr) - sh / 2) * ss;
@ -247,8 +249,8 @@ function Panel_Collection() : PanelContent() constructor {
}
draw_set_text(f_p3, fa_center, fa_top, COLORS._main_text_inner);
name_height = max(name_height, string_height_ext(_node.name, -1, grid_width) + 8);
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + ui(4), _node.name, -1, grid_width);
var _txtH = draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + ui(4), _node.name, -1, grid_width,, true);
name_height = max(name_height, _txtH + 8);
}
var hght = grid_size + name_height + ui(8);
@ -425,11 +427,10 @@ function Panel_Collection() : PanelContent() constructor {
if(search_string == "") {
if(bx > rootx) {
var txt = contentView? __txtx("view_grid", "Grid view") : __txtx("view_list", "List view");
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.view_mode, contentView) == 2) {
view_tooltip.index = contentView;
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, view_tooltip, THEME.view_mode, contentView) == 2)
contentView = !contentView;
}
}
bx -= ui(36);
if(mode == 0 && !DEMO) {
@ -470,7 +471,7 @@ function Panel_Collection() : PanelContent() constructor {
if(bx > rootx) {
var txt = __txtx("panel_collection_open_file", "Open in file explorer");
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.folder) == 2)
if(buttonInstant(THEME.button_hide, bx, by, bs, bs, [mx, my], pFOCUS, pHOVER, txt, THEME.button_path_open) == 2)
shellOpenExplorer(context.path);
}
bx -= ui(36);

View file

@ -8,13 +8,14 @@ function Panel_Menu() : PanelContent() constructor {
noti_icon_show = 0;
noti_icon_time = 0;
vertical_break = ui(240);
version_name_copy = 0;
if(PREFERENCES.panel_menu_right_control)
action_buttons = ["exit", "maximize", "minimize", "fullscreen"];
else
action_buttons = ["exit", "minimize", "maximize", "fullscreen"];
var _right = PREFERENCES.panel_menu_right_control;
if(_right) action_buttons = ["exit", "maximize", "minimize", "fullscreen"];
else action_buttons = ["exit", "minimize", "maximize", "fullscreen"];
#region file
menu_file_nondemo = [
menuItem(__txt("New"), function() { NEW(); }, THEME.new_file, ["", "New file"]),
menuItem(__txt("Open") + "...", function() { LOAD(); }, THEME.noti_icon_file_load, ["", "Open"])
@ -87,7 +88,9 @@ function Panel_Menu() : PanelContent() constructor {
];
if(!DEMO) menu_file = array_append(menu_file_nondemo, menu_file);
#endregion
#region help
menu_help = [
menuItem(__txtx("panel_menu_help_video", "Tutorial videos"), function() {
url_open("https://www.youtube.com/@makhamdev");
@ -111,13 +114,9 @@ function Panel_Menu() : PanelContent() constructor {
dialogPanelCall(new Panel_Patreon());
}, THEME.patreon),
];
#endregion
menu_help_steam = array_clone(menu_help);
array_push(menu_help_steam, -1,
menuItem(__txtx("panel_menu_steam_workshop", "Steam Workshop"), function() {
steam_activate_overlay_browser("https://steamcommunity.com/app/2299510/workshop/");
}, THEME.steam) );
#region //////// MENU ////////
menus = [
[ __txt("File"), menu_file ],
[ __txt("Edit"), [
@ -225,9 +224,10 @@ function Panel_Menu() : PanelContent() constructor {
} ).setIsShelf(),
]],
[ __txt("Help"), menu_help ],
]
];
#endregion
if(TESTING) {
if(TESTING) { #region
array_push(menus, [ __txt("Dev"), [
menuItem(__txtx("panel_debug_console", "Debug console"), function() {
panelAdd("Panel_Console", true)
@ -275,16 +275,22 @@ function Panel_Menu() : PanelContent() constructor {
]);
} ).setIsShelf(),
]]);
}
} #endregion
menu_help_steam = array_clone(menu_help);
array_push(menu_help_steam, -1,
menuItem(__txtx("panel_menu_steam_workshop", "Steam Workshop"), function() {
steam_activate_overlay_browser("https://steamcommunity.com/app/2299510/workshop/");
}, THEME.steam) );
function onFocusBegin() { PANEL_MENU = self; }
function setNotiIcon(icon) {
function setNotiIcon(icon) { #region
noti_icon = icon;
noti_icon_time = 90;
}
} #endregion
function undoUpdate() {
function undoUpdate() { #region
var txt;
if(ds_stack_empty(UNDO_STACK)) {
@ -312,9 +318,11 @@ function Panel_Menu() : PanelContent() constructor {
menus[1][1][1].active = !ds_stack_empty(REDO_STACK);
menus[1][1][1].name = txt;
}
} #endregion
function drawContent(panel) { #region
var _right = PREFERENCES.panel_menu_right_control;
function drawContent(panel) {
draw_clear_alpha(COLORS.panel_bg_clear, 1);
menus[6][1] = STEAM_ENABLED? menu_help_steam : menu_help;
var hori = w > h;
@ -322,6 +330,7 @@ function Panel_Menu() : PanelContent() constructor {
var xx = ui(40);
var yy = ui(8);
#region about icon
if(hori) {
if(PREFERENCES.panel_menu_right_control)
xx = ui(24);
@ -350,7 +359,9 @@ function Panel_Menu() : PanelContent() constructor {
dialogCall(o_dialog_about);
}
}
#endregion
#region menu
if(hori) {
if(PREFERENCES.panel_menu_right_control)
xx += ui(20);
@ -359,7 +370,7 @@ function Panel_Menu() : PanelContent() constructor {
yy = 0;
} else {
xx = ui(8);
yy = w < ui(200)? ui(72) : ui(40);
yy = w < vertical_break? ui(72) : ui(40);
}
var sx = xx;
@ -428,8 +439,10 @@ function Panel_Menu() : PanelContent() constructor {
_ww = 0;
xx = sx;
}
} else yy += hh + 8;
} else
yy += hh + 8;
}
#endregion
#region notification
var warning_amo = 0;
@ -521,11 +534,7 @@ function Panel_Menu() : PanelContent() constructor {
}
#endregion
var x1 = w - ui(6);
if(PREFERENCES.panel_menu_right_control)
x1 = w - ui(6);
else
x1 = ui(8 + 28);
var x1 = _right? w - ui(6) : ui(8 + 28);
#region actions
var bs = ui(28);
@ -588,16 +597,14 @@ function Panel_Menu() : PanelContent() constructor {
break;
}
if(PREFERENCES.panel_menu_right_control)
x1 -= bs + ui(4);
else
x1 += bs + ui(4);
if(_right) x1 -= bs + ui(4);
else x1 += bs + ui(4);
}
#endregion
if(!PREFERENCES.panel_menu_right_control) x1 = w - ui(40);
#region version
var _xx1 = _right? x1 : w - ui(40);
var txt = "v. " + string(VERSION_STRING);
if(STEAM_ENABLED) txt += " Steam";
@ -608,19 +615,10 @@ function Panel_Menu() : PanelContent() constructor {
if(hori) {
draw_set_text(f_p0, fa_center, fa_center, tc);
var ww = string_width(txt) + ui(12);
if(h > ui(76)) {
ww += ui(16);
var _x0 = w - ui(8) - ww;
var _y0 = h - ui(40);
var _x1 = w - ui(8);
var _y1 = h - ui(8);
} else {
var _x0 = x1 - ww;
var _x0 = _xx1 - ww;
var _y0 = ui(6);
var _x1 = x1;
var _x1 = _xx1;
var _y1 = h - ui(6);
}
if(pHOVER && point_in_rectangle(mx, my, _x0, _y0, _x1, _y1)) {
draw_sprite_stretched_ext(THEME.button_hide_fill, 1, _x0, _y0, _x1 - _x0, _y1 - _y0, sc, 1);
@ -635,13 +633,13 @@ function Panel_Menu() : PanelContent() constructor {
draw_text((_x0 + _x1) / 2, (_y0 + _y1) / 2, txt);
} else {
var x1 = ui(40);
var _xx1 = ui(40);
var y1 = h - ui(20);
draw_set_text(f_p0, fa_left, fa_center, tc);
var ww = string_width(txt) + ui(12);
if(pHOVER && point_in_rectangle(mx, my, x1, y1 - ui(16), x1 + ww, y1 + ui(16))) {
draw_sprite_stretched_ext(THEME.button_hide_fill, 1, x1, y1 - ui(16), ww, ui(32), sc, 1);
if(pHOVER && point_in_rectangle(mx, my, _xx1, y1 - ui(16), _xx1 + ww, y1 + ui(16))) {
draw_sprite_stretched_ext(THEME.button_hide_fill, 1, _xx1, y1 - ui(16), ww, ui(32), sc, 1);
if(mouse_press(mb_left, pFOCUS))
dialogCall(o_dialog_release_note);
@ -651,7 +649,7 @@ function Panel_Menu() : PanelContent() constructor {
}
}
draw_text(x1 + ui(6), y1, txt);
draw_text(_xx1 + ui(6), y1, txt);
}
#endregion
@ -666,30 +664,27 @@ function Panel_Menu() : PanelContent() constructor {
if(ALPHA) txt += " ALPHA";
else if(DEMO) txt += " DEMO";
var tx0, tx1, maxW, tcx;
var tx0, tx1, tcx;
var ty0, ty1;
var tbx0, tby0;
var maxW;
if(hori) {
if(h > ui(76)) {
tx0 = nx0;
tx1 = w - ui(8);
tx1 = w - ui(16);
ty0 = 0;
ty1 = h;
} else {
tx0 = nx0;
tx1 = x1 - ww;
ty0 = 0;
ty1 = h;
}
tcx = (tx0 + tx1) / 2;
} else {
tx0 = ui(8);
tx1 = w < ui(200)? w - ui(16) : w - ui(144);
ty0 = w < ui(200)? ui(36) : ui(6);
tx1 = w < vertical_break? w - ui(16) : w - ui(144);
ty0 = w < vertical_break? ui(36) : ui(6);
tcx = tx0;
if(!_right && w >= vertical_break) {
tx0 = x1 - bs;
tx1 = w - ui(16);
}
}
maxW = abs(tx0 - tx1);
@ -760,5 +755,5 @@ function Panel_Menu() : PanelContent() constructor {
draw_sprite_ext(s_patreon_supporter, 1, _cx, _cy, 1, 1, 0, _ib, 1);
}
#endregion
}
} #endregion
}

View file

@ -53,6 +53,7 @@
PREFERENCES.theme = "default";
PREFERENCES.local = "en";
PREFERENCES.font_overwrite = "";
PREFERENCES.dialog_add_node_grouping = true;
PREFERENCES.dialog_add_node_view = 0;

View file

@ -34,6 +34,7 @@ function shader_set_f(uniform, value) {
if(shader == -1) return;
if(is_array(value)) {
if(array_empty(value)) return;
shader_set_uniform_f_array_safe(shader_get_uniform(shader, uniform), value);
return;
}
@ -71,8 +72,7 @@ function shader_set_uniform_f_array_safe(uniform, array, max_length = 128) {
var _len = array_length(array);
if(_len == 0) return;
if(_len > max_length)
array_resize(array, max_length)
if(_len > max_length) array_resize(array, max_length)
shader_set_uniform_f_array(uniform, array);
}

View file

@ -4,10 +4,10 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform sampler2D baseSurface;
uniform vec2 dimension;
uniform float size;
uniform float treshold;
//#define size 5.
uniform int direction;
vec3 rgb2xyz( vec3 c ) {
@ -43,25 +43,29 @@ float colorDifferent(in vec4 c1, in vec4 c2) {
}
void main() {
vec4 base_col = texture2D( gm_BaseTexture, v_vTexcoord);
vec4 base_col = texture2D( baseSurface, v_vTexcoord);
vec4 curr_col = texture2D( gm_BaseTexture, v_vTexcoord);
if(base_col.a > 0.5) {
vec4 col = base_col;
vec4 _col;
vec4 col = curr_col;
vec4 _bcol, _ccol;
float mulp = 1.;
if(direction == 0) {
for(float i = 1.; i < 32.; i++) {
if(i >= size) break;
_col = texture2D( gm_BaseTexture, v_vTexcoord + vec2(i / dimension.x, 0.));
if(_col.a > 0.5 && colorDifferent(base_col, _col) < treshold) {
col += _col;
_bcol = texture2D( baseSurface, v_vTexcoord + vec2(i / dimension.x, 0.));
if(_bcol.a > 0.5 && colorDifferent(base_col, _bcol) < treshold) {
_ccol = texture2D( gm_BaseTexture, v_vTexcoord + vec2(i / dimension.x, 0.));
col += _ccol;
mulp++;
}
_col = texture2D( gm_BaseTexture, v_vTexcoord - vec2(i / dimension.x, 0.));
if(_col.a > 0.5 && colorDifferent(base_col, _col) < treshold) {
col += _col;
_bcol = texture2D( baseSurface, v_vTexcoord - vec2(i / dimension.x, 0.));
if(_bcol.a > 0.5 && colorDifferent(base_col, _bcol) < treshold) {
_ccol = texture2D( gm_BaseTexture, v_vTexcoord - vec2(i / dimension.x, 0.));
col += _ccol;
mulp++;
}
}
@ -70,21 +74,25 @@ void main() {
} else if(direction == 1) {
for(float i = 1.; i < 32.; i++) {
if(i >= size) break;
_col = texture2D( gm_BaseTexture, v_vTexcoord + vec2(0., i / dimension.y));
if(_col.a > 0.5 && colorDifferent(base_col, _col) < treshold) {
col += _col;
_bcol = texture2D( baseSurface, v_vTexcoord + vec2(0., i / dimension.y));
if(_bcol.a > 0.5 && colorDifferent(base_col, _bcol) < treshold) {
_ccol = texture2D( gm_BaseTexture, v_vTexcoord + vec2(0., i / dimension.y));
col += _ccol;
mulp++;
}
_col = texture2D( gm_BaseTexture, v_vTexcoord - vec2(0., i / dimension.y));
if(_col.a > 0.5 && colorDifferent(base_col, _col) < treshold) {
col += _col;
_bcol = texture2D( baseSurface, v_vTexcoord - vec2(0., i / dimension.y));
if(_bcol.a > 0.5 && colorDifferent(base_col, _bcol) < treshold) {
_ccol = texture2D( gm_BaseTexture, v_vTexcoord - vec2(0., i / dimension.y));
col += _ccol;
mulp++;
}
}
col /= mulp;
}
col.a = base_col.a;
gl_FragColor = col;
} else {

View file

@ -7,7 +7,7 @@ varying vec4 v_vColour;
uniform vec2 dimension;
uniform int horizontal;
uniform float weight[32];
uniform float weight[128];
uniform int size;
uniform int sampleMode;

View file

@ -0,0 +1,10 @@
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main() {
vec4 c = texture2D( gm_BaseTexture, v_vTexcoord );
gl_FragColor = 1. - c;
}

View file

@ -0,0 +1,19 @@
//
// Simple passthrough vertex shader
//
attribute vec3 in_Position; // (x,y,z)
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}

View file

@ -0,0 +1,10 @@
{
"resourceType": "GMShader",
"resourceVersion": "1.0",
"name": "sh_invert_all",
"parent": {
"name": "color",
"path": "folders/shader/filter/color.yy",
},
"type": 1,
}

View file

@ -6,6 +6,7 @@ varying vec4 v_vColour;
uniform sampler2D mask;
uniform int useMask;
uniform int invMask;
uniform sampler2D original;
uniform sampler2D edited;
@ -16,6 +17,13 @@ void main() {
vec4 ori = texture2D( original, v_vTexcoord );
vec4 edt = texture2D( edited, v_vTexcoord );
float rat = (useMask == 1? (msk.r + msk.g + msk.b) / 3. * msk.a : 1.) * mixRatio;
gl_FragColor = mix(ori, edt, clamp(rat, 0., 1.));
float mskAmo = (msk.r + msk.g + msk.b) / 3. * msk.a;
if(invMask == 1) mskAmo = 1. - mskAmo;
float rat = (useMask == 1? mskAmo : 1.) * mixRatio;
rat = clamp(rat, 0., 1.);
gl_FragColor = mix(ori, edt, rat);
if(ori.a == 0.) gl_FragColor.rgb = edt.rgb;
if(edt.a == 0.) gl_FragColor.rgb = ori.rgb;
}

View file

@ -0,0 +1,10 @@
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
gl_FragColor = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
}

View file

@ -0,0 +1,19 @@
//
// Simple passthrough vertex shader
//
attribute vec3 in_Position; // (x,y,z)
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
attribute vec4 in_Colour; // (r,g,b,a)
attribute vec2 in_TextureCoord; // (u,v)
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main()
{
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = in_Colour;
v_vTexcoord = in_TextureCoord;
}

View file

@ -0,0 +1,10 @@
{
"resourceType": "GMShader",
"resourceVersion": "1.0",
"name": "sh_mask_modify",
"parent": {
"name": "mask",
"path": "folders/shader/mask.yy",
},
"type": 1,
}