Reaction diffusion

This commit is contained in:
Tanasart 2024-01-10 12:36:33 +07:00
parent 70576f9db1
commit c3051fa4d2
61 changed files with 1071 additions and 99 deletions

View file

@ -230,6 +230,7 @@
{"name":"interpret","order":35,"path":"folders/shader/generator/interpret.yy",},
{"name":"noise","order":33,"path":"folders/shader/generator/noise.yy",},
{"name":"random shape","order":29,"path":"folders/shader/generator/random shape.yy",},
{"name":"reaction diffusion","order":38,"path":"folders/shader/generator/reaction diffusion.yy",},
{"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",},
@ -619,6 +620,7 @@
{"name":"json_file","order":4,"path":"scripts/json_file/json_file.yy",},
{"name":"_addon_custom","order":4,"path":"objects/_addon_custom/_addon_custom.yy",},
{"name":"s_node_smokeSim_add_collider","order":6,"path":"sprites/s_node_smokeSim_add_collider/s_node_smokeSim_add_collider.yy",},
{"name":"sh_rd_add","order":3,"path":"shaders/sh_rd_add/sh_rd_add.yy",},
{"name":"s_node_3d_export","order":10,"path":"sprites/s_node_3d_export/s_node_3d_export.yy",},
{"name":"s_node_curve_edit","order":1,"path":"sprites/s_node_curve_edit/s_node_curve_edit.yy",},
{"name":"textBox","order":2,"path":"scripts/textBox/textBox.yy",},
@ -685,6 +687,7 @@
{"name":"time_source","order":25,"path":"scripts/time_source/time_source.yy",},
{"name":"string_formatting","order":5,"path":"scripts/string_formatting/string_formatting.yy",},
{"name":"node_level_selector","order":8,"path":"scripts/node_level_selector/node_level_selector.yy",},
{"name":"s_node_reaction_diffusion","order":37,"path":"sprites/s_node_reaction_diffusion/s_node_reaction_diffusion.yy",},
{"name":"node_posterize","order":13,"path":"scripts/node_posterize/node_posterize.yy",},
{"name":"o_dialog_image_array_edit","order":4,"path":"objects/o_dialog_image_array_edit/o_dialog_image_array_edit.yy",},
{"name":"s_ui_base_white","order":2,"path":"sprites/s_ui_base_white/s_ui_base_white.yy",},
@ -786,6 +789,7 @@
{"name":"node_tile","order":4,"path":"scripts/node_tile/node_tile.yy",},
{"name":"sh_rsh_rotate","order":1,"path":"shaders/sh_rsh_rotate/sh_rsh_rotate.yy",},
{"name":"FirebaseFirestoreMainFunctions","order":1,"path":"scripts/FirebaseFirestoreMainFunctions/FirebaseFirestoreMainFunctions.yy",},
{"name":"sh_spherize","order":11,"path":"shaders/sh_spherize/sh_spherize.yy",},
{"name":"node_VFX_effect_destroy","order":3,"path":"scripts/node_VFX_effect_destroy/node_VFX_effect_destroy.yy",},
{"name":"node_cache","order":9,"path":"scripts/node_cache/node_cache.yy",},
{"name":"sh_bw","order":3,"path":"shaders/sh_bw/sh_bw.yy",},
@ -1019,6 +1023,7 @@
{"name":"ase_object","order":7,"path":"scripts/ase_object/ase_object.yy",},
{"name":"node_rigid_object","order":1,"path":"scripts/node_rigid_object/node_rigid_object.yy",},
{"name":"__node_template","order":17,"path":"scripts/__node_template/__node_template.yy",},
{"name":"node_reaction_diffusion","order":25,"path":"scripts/node_reaction_diffusion/node_reaction_diffusion.yy",},
{"name":"node_pb_box_transform","order":9,"path":"scripts/node_pb_box_transform/node_pb_box_transform.yy",},
{"name":"areaBox","order":13,"path":"scripts/areaBox/areaBox.yy",},
{"name":"__global_object_depths","order":7,"path":"scripts/__global_object_depths/__global_object_depths.yy",},
@ -1038,6 +1043,7 @@
{"name":"node_animation_control","order":11,"path":"scripts/node_animation_control/node_animation_control.yy",},
{"name":"s_node_tunnel_in","order":21,"path":"sprites/s_node_tunnel_in/s_node_tunnel_in.yy",},
{"name":"s_node_pb_draw_trapezoid","order":10,"path":"sprites/s_node_pb_draw_trapezoid/s_node_pb_draw_trapezoid.yy",},
{"name":"sh_rd_render","order":2,"path":"shaders/sh_rd_render/sh_rd_render.yy",},
{"name":"append_function","order":1,"path":"scripts/append_function/append_function.yy",},
{"name":"node_3dsurf","order":4,"path":"scripts/node_3dsurf/node_3dsurf.yy",},
{"name":"fd_rectangle_reset_target","order":17,"path":"scripts/fd_rectangle_reset_target/fd_rectangle_reset_target.yy",},
@ -1125,6 +1131,7 @@
{"name":"fd_rectangle_draw_view","order":4,"path":"scripts/fd_rectangle_draw_view/fd_rectangle_draw_view.yy",},
{"name":"fd_rectangle_set_material_type","order":9,"path":"scripts/fd_rectangle_set_material_type/fd_rectangle_set_material_type.yy",},
{"name":"node_fluid_domain_queue","order":9,"path":"scripts/node_fluid_domain_queue/node_fluid_domain_queue.yy",},
{"name":"node_spherize","order":6,"path":"scripts/node_spherize/node_spherize.yy",},
{"name":"node_sequence_to_anim","order":3,"path":"scripts/node_sequence_to_anim/node_sequence_to_anim.yy",},
{"name":"sh_blend_replace","order":50,"path":"shaders/sh_blend_replace/sh_blend_replace.yy",},
{"name":"node_FLIP_domain","order":1,"path":"scripts/node_FLIP_domain/node_FLIP_domain.yy",},
@ -1346,6 +1353,7 @@
{"name":"s_node_average","order":50,"path":"sprites/s_node_average/s_node_average.yy",},
{"name":"s_node_sprite_sheet","order":1,"path":"sprites/s_node_sprite_sheet/s_node_sprite_sheet.yy",},
{"name":"node_noise_gabor","order":11,"path":"scripts/node_noise_gabor/node_noise_gabor.yy",},
{"name":"sh_rd_propagate","order":1,"path":"shaders/sh_rd_propagate/sh_rd_propagate.yy",},
{"name":"node_pb_box_mirror","order":10,"path":"scripts/node_pb_box_mirror/node_pb_box_mirror.yy",},
{"name":"s_node_text_length","order":9,"path":"sprites/s_node_text_length/s_node_text_length.yy",},
{"name":"s_node_grid_hex","order":4,"path":"sprites/s_node_grid_hex/s_node_grid_hex.yy",},
@ -1763,6 +1771,7 @@
{"name":"panel_array_sequence","order":3,"path":"scripts/panel_array_sequence/panel_array_sequence.yy",},
{"name":"sh_displace","order":5,"path":"shaders/sh_displace/sh_displace.yy",},
{"name":"fd_rectangle_get_material_height","order":10,"path":"scripts/fd_rectangle_get_material_height/fd_rectangle_get_material_height.yy",},
{"name":"s_node_spherize","order":60,"path":"sprites/s_node_spherize/s_node_spherize.yy",},
{"name":"s_node_mk_sparkle","order":7,"path":"sprites/s_node_mk_sparkle/s_node_mk_sparkle.yy",},
{"name":"rangeBox","order":9,"path":"scripts/rangeBox/rangeBox.yy",},
{"name":"s_node_array_copy","order":14,"path":"sprites/s_node_array_copy/s_node_array_copy.yy",},

View file

@ -262,6 +262,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"interpret","folderPath":"folders/shader/generator/interpret.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"noise","folderPath":"folders/shader/generator/noise.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"random shape","folderPath":"folders/shader/generator/random shape.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"reaction diffusion","folderPath":"folders/shader/generator/reaction diffusion.yy",},
{"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",},
@ -856,6 +857,7 @@
{"id":{"name":"json_file","path":"scripts/json_file/json_file.yy",},},
{"id":{"name":"_addon_custom","path":"objects/_addon_custom/_addon_custom.yy",},},
{"id":{"name":"s_node_smokeSim_add_collider","path":"sprites/s_node_smokeSim_add_collider/s_node_smokeSim_add_collider.yy",},},
{"id":{"name":"sh_rd_add","path":"shaders/sh_rd_add/sh_rd_add.yy",},},
{"id":{"name":"s_node_3d_export","path":"sprites/s_node_3d_export/s_node_3d_export.yy",},},
{"id":{"name":"s_node_curve_edit","path":"sprites/s_node_curve_edit/s_node_curve_edit.yy",},},
{"id":{"name":"node_gradient","path":"scripts/node_gradient/node_gradient.yy",},},
@ -930,6 +932,7 @@
{"id":{"name":"time_source","path":"scripts/time_source/time_source.yy",},},
{"id":{"name":"string_formatting","path":"scripts/string_formatting/string_formatting.yy",},},
{"id":{"name":"node_level_selector","path":"scripts/node_level_selector/node_level_selector.yy",},},
{"id":{"name":"s_node_reaction_diffusion","path":"sprites/s_node_reaction_diffusion/s_node_reaction_diffusion.yy",},},
{"id":{"name":"node_posterize","path":"scripts/node_posterize/node_posterize.yy",},},
{"id":{"name":"o_dialog_image_array_edit","path":"objects/o_dialog_image_array_edit/o_dialog_image_array_edit.yy",},},
{"id":{"name":"s_ui_base_white","path":"sprites/s_ui_base_white/s_ui_base_white.yy",},},
@ -1051,6 +1054,7 @@
{"id":{"name":"sh_rsh_rotate","path":"shaders/sh_rsh_rotate/sh_rsh_rotate.yy",},},
{"id":{"name":"FirebaseFirestoreMainFunctions","path":"scripts/FirebaseFirestoreMainFunctions/FirebaseFirestoreMainFunctions.yy",},},
{"id":{"name":"node_mk_sparkle","path":"scripts/node_mk_sparkle/node_mk_sparkle.yy",},},
{"id":{"name":"sh_spherize","path":"shaders/sh_spherize/sh_spherize.yy",},},
{"id":{"name":"node_VFX_effect_destroy","path":"scripts/node_VFX_effect_destroy/node_VFX_effect_destroy.yy",},},
{"id":{"name":"node_cache","path":"scripts/node_cache/node_cache.yy",},},
{"id":{"name":"sh_bw","path":"shaders/sh_bw/sh_bw.yy",},},
@ -1317,6 +1321,7 @@
{"id":{"name":"ase_object","path":"scripts/ase_object/ase_object.yy",},},
{"id":{"name":"node_rigid_object","path":"scripts/node_rigid_object/node_rigid_object.yy",},},
{"id":{"name":"__node_template","path":"scripts/__node_template/__node_template.yy",},},
{"id":{"name":"node_reaction_diffusion","path":"scripts/node_reaction_diffusion/node_reaction_diffusion.yy",},},
{"id":{"name":"node_pb_box_transform","path":"scripts/node_pb_box_transform/node_pb_box_transform.yy",},},
{"id":{"name":"areaBox","path":"scripts/areaBox/areaBox.yy",},},
{"id":{"name":"__global_object_depths","path":"scripts/__global_object_depths/__global_object_depths.yy",},},
@ -1337,6 +1342,7 @@
{"id":{"name":"node_animation_control","path":"scripts/node_animation_control/node_animation_control.yy",},},
{"id":{"name":"s_node_tunnel_in","path":"sprites/s_node_tunnel_in/s_node_tunnel_in.yy",},},
{"id":{"name":"s_node_pb_draw_trapezoid","path":"sprites/s_node_pb_draw_trapezoid/s_node_pb_draw_trapezoid.yy",},},
{"id":{"name":"sh_rd_render","path":"shaders/sh_rd_render/sh_rd_render.yy",},},
{"id":{"name":"append_function","path":"scripts/append_function/append_function.yy",},},
{"id":{"name":"node_3dsurf","path":"scripts/node_3dsurf/node_3dsurf.yy",},},
{"id":{"name":"fd_rectangle_reset_target","path":"scripts/fd_rectangle_reset_target/fd_rectangle_reset_target.yy",},},
@ -1432,6 +1438,7 @@
{"id":{"name":"fd_rectangle_set_material_type","path":"scripts/fd_rectangle_set_material_type/fd_rectangle_set_material_type.yy",},},
{"id":{"name":"node_seperate_shapes","path":"scripts/node_seperate_shapes/node_seperate_shapes.yy",},},
{"id":{"name":"node_fluid_domain_queue","path":"scripts/node_fluid_domain_queue/node_fluid_domain_queue.yy",},},
{"id":{"name":"node_spherize","path":"scripts/node_spherize/node_spherize.yy",},},
{"id":{"name":"node_sequence_to_anim","path":"scripts/node_sequence_to_anim/node_sequence_to_anim.yy",},},
{"id":{"name":"sh_blend_replace","path":"shaders/sh_blend_replace/sh_blend_replace.yy",},},
{"id":{"name":"node_FLIP_domain","path":"scripts/node_FLIP_domain/node_FLIP_domain.yy",},},
@ -1684,6 +1691,7 @@
{"id":{"name":"s_node_average","path":"sprites/s_node_average/s_node_average.yy",},},
{"id":{"name":"s_node_sprite_sheet","path":"sprites/s_node_sprite_sheet/s_node_sprite_sheet.yy",},},
{"id":{"name":"node_noise_gabor","path":"scripts/node_noise_gabor/node_noise_gabor.yy",},},
{"id":{"name":"sh_rd_propagate","path":"shaders/sh_rd_propagate/sh_rd_propagate.yy",},},
{"id":{"name":"node_pb_box_mirror","path":"scripts/node_pb_box_mirror/node_pb_box_mirror.yy",},},
{"id":{"name":"s_node_text_length","path":"sprites/s_node_text_length/s_node_text_length.yy",},},
{"id":{"name":"s_node_grid_hex","path":"sprites/s_node_grid_hex/s_node_grid_hex.yy",},},
@ -2173,6 +2181,7 @@
{"id":{"name":"node_group","path":"scripts/node_group/node_group.yy",},},
{"id":{"name":"fd_rectangle_get_material_height","path":"scripts/fd_rectangle_get_material_height/fd_rectangle_get_material_height.yy",},},
{"id":{"name":"node_PCX_fn_surface_height","path":"scripts/node_PCX_fn_surface_height/node_PCX_fn_surface_height.yy",},},
{"id":{"name":"s_node_spherize","path":"sprites/s_node_spherize/s_node_spherize.yy",},},
{"id":{"name":"s_node_mk_sparkle","path":"sprites/s_node_mk_sparkle/s_node_mk_sparkle.yy",},},
{"id":{"name":"rangeBox","path":"scripts/rangeBox/rangeBox.yy",},},
{"id":{"name":"s_node_array_copy","path":"sprites/s_node_array_copy/s_node_array_copy.yy",},},
@ -2238,6 +2247,7 @@
{"id":{"name":"draw_corner","path":"scripts/draw_corner/draw_corner.yy",},},
{"id":{"name":"o_dialog_preference","path":"objects/o_dialog_preference/o_dialog_preference.yy",},},
{"id":{"name":"node_pb_fx","path":"scripts/node_pb_fx/node_pb_fx.yy",},},
{"id":{"name":"sh_rd_convert","path":"shaders/sh_rd_convert/sh_rd_convert.yy",},},
{"id":{"name":"s_node_smokeSim_render_output","path":"sprites/s_node_smokeSim_render_output/s_node_smokeSim_render_output.yy",},},
{"id":{"name":"node_3d_transform_image","path":"scripts/node_3d_transform_image/node_3d_transform_image.yy",},},
{"id":{"name":"node_wrap","path":"scripts/node_wrap/node_wrap.yy",},},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View file

@ -174,13 +174,13 @@ event_inherited();
var sw = sprite_get_width(spr);
var sh = sprite_get_height(spr);
var s = max(gw / sw, gh / sh);
var s = min(gw / sw, gh / sh);
var ox = (sprite_get_xoffset(spr) - sw / 2) * s;
var oy = (sprite_get_yoffset(spr) - sh / 2) * s;
var _sx = _boxx + grid_width / 2 + ox;
var _sy = yy + grid_heigh / 2 + ox;
var _sy = yy + grid_heigh / 2 + oy;
var _spw = sw * s;
var _sph = sh * s;
@ -198,8 +198,9 @@ event_inherited();
surface_reset_target();
draw_surface(clip_surf, _sx, _sy);
} else
} else {
draw_sprite_ui_uniform(spr, 0, _sx, _sy, s);
}
} #endregion
}

View file

@ -13,14 +13,12 @@ function dec_to_hex(dec, len = 1) {
static dig = "0123456789ABCDEF";
var hex = "";
if (dec < 0) {
len = max(len, ceil(logn(16, 2 * abs(dec))));
}
if (dec < 0) len = max(len, ceil(logn(16, 2 * abs(dec))));
while (len-- || dec) {
hex = string_char_at(dig, (dec & $F) + 1) + hex;
dec = dec >> 4;
}
return hex;
}

View file

@ -149,4 +149,21 @@ function buttonColor(_onApply, dialog = noone) : widget() constructor {
resetFocus();
return h;
}
}
function drawColor(color, _x, _y, _w, _h) {
if(is_real(color))
draw_sprite_stretched_ext(THEME.palette_mask, 1, _x, _y, _w, _h, color, 1);
else if(is_int64(color)) {
var _a = _color_get_alpha(color);
if(_a == 1) {
draw_sprite_stretched_ext(THEME.palette_mask, 1, _x, _y, _w, _h, color, 1);
} else {
draw_sprite_stretched_ext(THEME.palette_mask, 1, _x, _y, _w, _h - ui(8), color, 1);
draw_sprite_stretched_ext(THEME.palette_mask, 1, _x, _y + _h - ui(6), _w, ui(6), c_black, 1);
draw_sprite_stretched_ext(THEME.palette_mask, 1, _x, _y + _h - ui(6), _w * _a, ui(6), c_white, 1);
}
}
}

View file

@ -90,7 +90,7 @@ function FileObject(_name, _path) constructor { #region
return spr;
} #endregion
static getMetadata = function() { #region
static getMetadata = function(_createnew = false) { #region
retrive_data = true;
if(meta != noone) return meta;
@ -106,6 +106,8 @@ function FileObject(_name, _path) constructor { #region
if(struct_has(m, "metadata")) meta.deserialize(m.metadata);
if(struct_has(m, "preview")) thumbnail_data = json_try_parse(m.preview, -1);
if(_createnew) json_save_struct(meta_path, meta);
}
meta.name = name;

View file

@ -1,6 +1,6 @@
function draw_line_feedback(x0, y0, x1, y1, th, c1, c0, _s) { #region
draw_line_dashed_color(x0, y0, x1, y1, th, c1, c0, 6 * _s);
return;
//draw_line_dashed_color(x0, y0, x1, y1, th, c1, c0, 6 * _s);
//return;
var _y0 = y0 - 12 * _s;
var _y1 = y1 - 12 * _s;
@ -17,6 +17,22 @@ function draw_line_feedback(x0, y0, x1, y1, th, c1, c0, _s) { #region
draw_line_dashed_color(x1e, y1, x1, y1, th, c1, c1, 6 * _s);
} #endregion
function distance_line_feedback(mx, my, x0, y0, x1, y1) { #region
return distance_to_line(mx, my, x0, y0, x1, y1);
function distance_line_feedback(mx, my, x0, y0, x1, y1, _s) { #region
var _y0 = y0 - 12 * _s;
var _y1 = y1 - 12 * _s;
var x0e = x0 + 12 * _s * sign(x0 - x1);
var x1e = x1 - 12 * _s * sign(x0 - x1);
var dd = 99999999;
dd = min(dd, distance_to_line(mx, my, x0e, y0, x0e, _y0));
dd = min(dd, distance_to_line(mx, my, x0, y0, x0e, y0));
dd = min(dd, distance_to_line(mx, my, x0e, _y0, x1e, _y1));
dd = min(dd, distance_to_line(mx, my, x1e, y1, x1e, _y1));
dd = min(dd, distance_to_line(mx, my, x1e, y1, x1, y1));
return dd;
} #endregion

View file

@ -11,11 +11,13 @@ function Node_Color_Data(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
outputs[| 1] = nodeValue("Green", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0);
outputs[| 2] = nodeValue("Blue", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0);
outputs[| 3] = nodeValue("Hue", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0);
outputs[| 4] = nodeValue("Saturation", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0);
outputs[| 5] = nodeValue("Value", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0);
outputs[| 3] = nodeValue("Hue", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0).setVisible(false);
outputs[| 4] = nodeValue("Saturation", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0).setVisible(false);
outputs[| 5] = nodeValue("Value", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0).setVisible(false);
outputs[| 6] = nodeValue("Brightness", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0);
outputs[| 6] = nodeValue("Brightness", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0).setVisible(false);
outputs[| 7] = nodeValue("Alpha", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0).setVisible(false);
static processData = function(_output, _data, _output_index, _array_index = 0) {
var _c = _data[0];
@ -23,9 +25,9 @@ function Node_Color_Data(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
var val = 0;
switch(_output_index) {
case 0 : val = color_get_red(_c); break;
case 1 : val = color_get_green(_c); break;
case 2 : val = color_get_blue(_c); break;
case 0 : val = color_get_red(_c); break;
case 1 : val = color_get_green(_c); break;
case 2 : val = color_get_blue(_c); break;
case 3 : val = color_get_hue(_c); break;
case 4 : val = color_get_saturation(_c); break;
@ -37,6 +39,8 @@ function Node_Color_Data(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
var b = color_get_blue(_c);
val = 0.2126 * r + 0.7152 * g + 0.0722 * b;
break;
case 7 : val = color_get_alpha(_c); break;
}
return _n? val / 255 : val;

View file

@ -17,21 +17,25 @@ function Node_Color_HSV(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
inputs[| 3] = nodeValue("Normalized", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, 1);
inputs[| 4] = nodeValue("Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider);
outputs[| 0] = nodeValue("Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, c_white);
input_display_list = [ 3, 0, 1, 2 ];
input_display_list = [ 3, 0, 1, 2, 4 ];
static processData = function(_outSurf, _data, _output_index, _array_index) {
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var nor = _data[3];
return make_color_hsv(
return make_color_hsva(
nor? _data[0] * 255 : _data[0] / 360 * 255,
nor? _data[1] * 255 : _data[1],
nor? _data[2] * 255 : _data[2]
nor? _data[2] * 255 : _data[2],
nor? _data[4] * 255 : _data[4],
);
}
} #endregion
static onValueUpdate = function(index = 0) {
static onValueUpdate = function(index = 0) { #region
if(index == 3) {
var _nor = getInputData(3);
@ -44,6 +48,9 @@ function Node_Color_HSV(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
inputs[| 2].setType(VALUE_TYPE.float);
inputs[| 2].setDisplay(VALUE_DISPLAY.slider);
inputs[| 4].setType(VALUE_TYPE.float);
inputs[| 4].setDisplay(VALUE_DISPLAY.slider);
} else {
inputs[| 0].setType(VALUE_TYPE.integer);
inputs[| 0].setDisplay(VALUE_DISPLAY.slider, { range: [0, 360, 1] });
@ -53,11 +60,14 @@ function Node_Color_HSV(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
inputs[| 2].setType(VALUE_TYPE.integer);
inputs[| 2].setDisplay(VALUE_DISPLAY.slider, { range: [0, 255, 1] });
inputs[| 4].setType(VALUE_TYPE.integer);
inputs[| 4].setDisplay(VALUE_DISPLAY.slider, { range: [0, 255, 1] });
}
}
}
} #endregion
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
var bbox = drawGetBbox(xx, yy, _s);
if(bbox.h < 1) return;
@ -68,11 +78,10 @@ function Node_Color_HSV(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
return;
}
draw_set_color(col);
draw_rectangle(bbox.x0, bbox.y0, bbox.x1, bbox.y1, 0);
}
drawColor(col, bbox.x0, bbox.y0, bbox.w, bbox.h);
} #endregion
static doApplyDeserialize = function() {
static doApplyDeserialize = function() { #region
onValueUpdate(3);
}
} #endregion
}

View file

@ -17,11 +17,14 @@ function Node_Color_RGB(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
inputs[| 3] = nodeValue("Normalized", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, 1);
inputs[| 4] = nodeValue("Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider);
outputs[| 0] = nodeValue("Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, c_white);
input_display_list = [ 3, 0, 1, 2 ];
input_display_list = [ 3, 0, 1, 2, 4 ];
static onValueUpdate = function(index = 0) {
static onValueUpdate = function(index = 0) { #region
if(index == 3) {
var _nor = getInputData(3);
@ -34,6 +37,9 @@ function Node_Color_RGB(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
inputs[| 2].setType(VALUE_TYPE.float);
inputs[| 2].setDisplay(VALUE_DISPLAY.slider);
inputs[| 4].setType(VALUE_TYPE.float);
inputs[| 4].setDisplay(VALUE_DISPLAY.slider);
} else {
inputs[| 0].setType(VALUE_TYPE.integer);
inputs[| 0].setDisplay(VALUE_DISPLAY.slider, { range: [0, 255, 1] });
@ -43,24 +49,28 @@ function Node_Color_RGB(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
inputs[| 2].setType(VALUE_TYPE.integer);
inputs[| 2].setDisplay(VALUE_DISPLAY.slider, { range: [0, 255, 1] });
inputs[| 4].setType(VALUE_TYPE.integer);
inputs[| 4].setDisplay(VALUE_DISPLAY.slider, { range: [0, 255, 1] });
}
}
}
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var nor = _data[3];
if(!is_real(_data[0])) return 0;
if(!is_real(_data[1])) return 0;
if(!is_real(_data[2])) return 0;
return make_color_rgb(
return make_color_rgba(
nor? _data[0] * 255 : _data[0],
nor? _data[1] * 255 : _data[1],
nor? _data[2] * 255 : _data[2]
nor? _data[2] * 255 : _data[2],
nor? _data[4] * 255 : _data[4],
);
}
} #endregion
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
var bbox = drawGetBbox(xx, yy, _s);
if(bbox.h < 1) return;
@ -71,11 +81,10 @@ function Node_Color_RGB(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
return;
}
draw_set_color(col);
draw_rectangle(bbox.x0, bbox.y0, bbox.x1, bbox.y1, 0);
}
drawColor(col, bbox.x0, bbox.y0, bbox.w, bbox.h);
} #endregion
static doApplyDeserialize = function() {
static doApplyDeserialize = function() { #region
onValueUpdate(3);
}
} #endregion
}

View file

@ -35,7 +35,6 @@ function Node_Color_Mix(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
return;
}
draw_set_color(col);
draw_rectangle(bbox.x0, bbox.y0, bbox.x1, bbox.y1, 0);
drawColor(col, bbox.x0, bbox.y0, bbox.w, bbox.h);
}
}

View file

@ -11,11 +11,13 @@ function Node_Sampler(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
inputs[| 2] = nodeValue("Sampling size", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1, "Size of square around the position to sample and average pixel color.")
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 3, 1] });
inputs[| 3] = nodeValue("Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
outputs[| 0] = nodeValue("Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, c_white);
static getPreviewValues = function() { return getInputData(0); }
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
var _suf = current_data[0];
@ -43,18 +45,19 @@ function Node_Sampler(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
draw_set_color(COLORS._main_accent);
draw_rectangle(x0, y0, x1, y1, true);
}
} #endregion
static processData = function(_output, _data, _output_index, _array_index = 0) {
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
var _surf = _data[0];
var _pos = _data[1];
var _sam = _data[2];
var _pos = _data[1];
var _sam = _data[2];
var _alp = _data[3];
if(!is_surface(_surf)) return c_black;
var ww = surface_get_width_safe(_surf);
var hh = surface_get_height_safe(_surf);
var r = 0, g = 0, b = 0, amo = 0;
var r = 0, g = 0, b = 0, a = 0, amo = 0;
_sam -= 1;
for( var i = -_sam; i <= _sam; i++ )
@ -66,34 +69,33 @@ function Node_Sampler(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
if(px >= ww) continue;
if(py >= hh) continue;
var cc = surface_get_pixel(_surf, px, py);
var cc = int64(surface_get_pixel_ext(_surf, px, py));
r += color_get_red(cc);
g += color_get_green(cc);
b += color_get_blue(cc);
a += color_get_alpha(cc);
amo++;
}
r /= amo;
g /= amo;
b /= amo;
a /= amo;
return make_color_rgb(r, g, b);
}
return _alp? make_color_rgba(r, g, b, a) : make_color_rgb(r, g, b);
} #endregion
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
var bbox = drawGetBbox(xx, yy, _s);
var col = outputs[| 0].getValue();
if(bbox.h <= 0) return;
var col = outputs[| 0].getValue();
if(is_array(col)) {
drawPalette(col, bbox.x0, bbox.y0, bbox.w, bbox.h);
return;
}
draw_set_color(col);
draw_rectangle(bbox.x0, bbox.y0, bbox.x1, bbox.y1, 0);
}
drawColor(col, bbox.x0, bbox.y0, bbox.w, bbox.h);
} #endregion
}

View file

@ -8,7 +8,7 @@ function Node_Erode(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
inputs[| 2] = nodeValue("Preserve border",self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
inputs[| 3] = nodeValue("Use alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
inputs[| 3] = nodeValue("Use alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
inputs[| 4] = nodeValue("Mask", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);

View file

@ -11,9 +11,19 @@ function Node_Find_Pixel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
inputs[| 3] = nodeValue("Find all", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
inputs[| 4] = nodeValue("Include alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
inputs[| 5] = nodeValue("Alpha tolerance", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.2)
.setDisplay(VALUE_DISPLAY.slider);
outputs[| 0] = nodeValue("Position", self, JUNCTION_CONNECT.output, VALUE_TYPE.integer, [ 0, 0 ])
.setDisplay(VALUE_DISPLAY.vector);
input_display_list = [ 0,
["Search", false], 1, 2, 3,
["Alpha", true, 4], 5,
]
static getPreviewValues = function() { return getInputData(0); }
temp_surface = [ surface_create(1, 1) ];
@ -24,6 +34,9 @@ function Node_Find_Pixel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
var _tol = _data[2];
var _all = _data[3];
var _alp = _data[4];
var _alpT = _data[5];
if(!is_surface(_surf)) return [0, 0];
var _buff = buffer_from_surface(_surf, false);
@ -35,6 +48,7 @@ function Node_Find_Pixel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
var r = _color_get_red(_col);
var g = _color_get_green(_col);
var b = _color_get_blue(_col);
var a = _color_get_alpha(_col);
for( var i = 0; i < _sh; i++ )
for( var j = 0; j < _sw; j++ ) {
@ -45,9 +59,12 @@ function Node_Find_Pixel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
var _b = ((_c & 0x00FF0000) >> 16) / 255;
var _a = ((_c & 0xFF000000) >> 24) / 255;
if(_a == 0) continue;
if(!_alp && _a == 0) continue;
if((abs(r - _r) + abs(g - _g) + abs(b - _b)) / 3 <= _tol) {
var colMatch = (abs(r - _r) + abs(g - _g) + abs(b - _b)) / 3 <= _tol;
if(!colMatch) continue;
if(!_alp || abs(a - _a) <= _alpT) {
if(_all) array_push(res, [ j, i ]);
else return [ j, i ];
}
@ -55,35 +72,19 @@ function Node_Find_Pixel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
buffer_delete(_buff);
return _all? res : [ -1, -1 ];
//temp_surface[0] = surface_verify(temp_surface[0], 1, 1);
//surface_set_shader(temp_surface[0], sh_find_pixel);
// shader_set_surface("texture", _surf);
// shader_set_dim("dimension", _surf);
// draw_sprite_ext(s_fx_pixel, 0, 0, 0, 1, 1, 0, _col, 1);
//surface_reset_shader();
//var pos = surface_get_pixel(temp_surface[0], 0, 0);
//var _x = round(color_get_red(pos) / 255 * surface_get_width_safe(_surf));
//var _y = round(color_get_green(pos) / 255 * surface_get_height_safe(_surf));
//return [ _x, _y ];
} #endregion
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
var bbox = drawGetBbox(xx, yy, _s);
var col = getInputData(1);
if(bbox.h <= 0) return;
var col = getInputData(1);
if(is_array(col)) {
drawPalette(col, bbox.x0, bbox.y0, bbox.w, bbox.h);
return;
}
draw_set_color(col);
draw_rectangle(bbox.x0, bbox.y0, bbox.x1, bbox.y1, 0);
drawColor(col, bbox.x0, bbox.y0, bbox.w, bbox.h);
} #endregion
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "generator",
"path": "folders/nodes/data/generator.yy",
},
"resourceVersion": "1.0",
"name": "node_checkerboard",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,142 @@
function Node_RD(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
name = "Reaction Diffusion";
inputs[| 0] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone );
inputs[| 1] = nodeValue("Kill rate", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.058)
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0, 0.1, 0.001] })
.setMappable(8);
inputs[| 2] = nodeValue("Feed rate", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.043)
.setDisplay(VALUE_DISPLAY.slider, { range: [ 0, 0.1, 0.001] })
.setMappable(9);
inputs[| 3] = nodeValue("Timestep", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setMappable(10);
inputs[| 4] = nodeValue("Iteration", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 16);
inputs[| 5] = nodeValue("Diffusion A", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1.)
.setDisplay(VALUE_DISPLAY.slider)
.setMappable(11);
inputs[| 6] = nodeValue("Diffusion B", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, .2)
.setDisplay(VALUE_DISPLAY.slider)
.setMappable(12);
inputs[| 7] = nodeValue("Add B", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone );
//////////////////////////////////////////////////////////////////////////////////////////////////////////
inputs[| 8] = nodeValue("Kill map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone)
.setVisible(false, false);
inputs[| 9] = nodeValue("Feed map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone)
.setVisible(false, false);
inputs[| 10] = nodeValue("Time map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone)
.setVisible(false, false);
inputs[| 11] = nodeValue("DfA map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone)
.setVisible(false, false);
inputs[| 12] = nodeValue("DfB map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone)
.setVisible(false, false);
//////////////////////////////////////////////////////////////////////////////////////////////////////////
inputs[| 13] = nodeValue("Diffusion", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1.)
.setDisplay(VALUE_DISPLAY.slider)
outputs[| 0] = nodeValue("Reacted", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
outputs[| 1] = nodeValue("Rendered", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
preview_channel = 1;
input_display_list = [
["Surfaces", false], 0, 7,
["Diffusion", false], 13, 5, 11, 6, 12,
["Paramaters", false], 1, 8, 2, 9,
["Simulation", false], 3, 10, 4,
];
attribute_surface_depth();
temp_surface = [ surface_create(1, 1), surface_create(1, 1) ];
static step = function() { #region
inputs[| 1].mappableStep();
inputs[| 2].mappableStep();
inputs[| 3].mappableStep();
inputs[| 5].mappableStep();
inputs[| 6].mappableStep();
} #endregion
static update = function() {
var _surf = getInputData(0);
var _k = getInputData(1);
var _f = getInputData(2);
var _dt = getInputData(3);
var _it = getInputData(4);
var _dd = getInputData(13);
var _da = getInputData(5);
var _db = getInputData(6);
var _b = getInputData(7);
var _outp = outputs[| 0].getValue();
var _rend = outputs[| 1].getValue();
var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height_safe(_surf);
_outp = surface_verify(_outp, _sw, _sh);
_rend = surface_verify(_rend, _sw, _sh);
temp_surface[0] = surface_verify(temp_surface[0], _sw, _sh);
temp_surface[1] = surface_verify(temp_surface[1], _sw, _sh);
surface_set_shader(temp_surface[0], sh_rd_convert);
draw_surface_safe(_surf);
surface_reset_shader();
if(is_surface(_b)) {
surface_set_target(temp_surface[0]);
gpu_set_colorwriteenable(0, 1, 0, 0);
BLEND_ADD
draw_surface_safe(_b);
BLEND_NORMAL
gpu_set_colorwriteenable(1, 1, 1, 1);
surface_reset_target();
}
var _ind = 0;
repeat(_it) {
surface_set_shader(temp_surface[!_ind], sh_rd_propagate);
shader_set_f("dimension", _sw, _sh);
shader_set_f_map("k", _k , getInputData( 8), inputs[| 1]);
shader_set_f_map("f", _f , getInputData( 9), inputs[| 2]);
shader_set_f_map("dt", _dt, getInputData(10), inputs[| 3]);
shader_set_f("dd", _dd);
shader_set_f_map("da", _da, getInputData(11), inputs[| 5]);
shader_set_f_map("db", _db, getInputData(12), inputs[| 6]);
draw_surface_safe(temp_surface[_ind]);
surface_reset_shader();
_ind = !_ind;
}
surface_set_shader(_outp);
draw_surface_safe(temp_surface[_ind]);
surface_reset_shader();
surface_set_shader(_rend, sh_rd_render);
draw_surface_safe(_surf);
surface_reset_shader();
outputs[| 0].setValue(_outp);
outputs[| 1].setValue(_rend);
}
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_reaction_diffusion",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "generator",
"path": "folders/nodes/data/generator.yy",
},
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "generator",
"path": "folders/nodes/data/generator.yy",
},
"resourceVersion": "1.0",
"name": "node_stripe",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -366,9 +366,9 @@ function __initNodes() {
addNodeObject(rigidSim, "Apply Force", s_node_rigidSim_force, "Node_Rigid_Force_Apply", [1, Node_Rigid_Force_Apply],, "Apply force to objects.").hideRecent().setVersion(1110);
ds_list_add(rigidSim, "Instance control");
addNodeObject(rigidSim, "Activate Physics", s_node_rigidSim_activate, "Node_Rigid_Activate", [1, Node_Rigid_Activate],, "Enable or disable rigidbody object.").hideRecent().setVersion(1110);
addNodeObject(rigidSim, "Rigidbody Variable", s_node_rigid_variable, "Node_Rigid_Variable", [1, Node_Rigid_Variable],, "Extract veriable from rigidbody object.").hideRecent().setVersion(1120);
addNodeObject(rigidSim, "Rigidbody Override", s_node_rigid_override, "Node_Rigid_Override", [1, Node_Rigid_Override],, "Replace rigidbody object variable with a new one.").hideRecent().setVersion(1120);
addNodeObject(rigidSim, "Activate Physics", s_node_rigidSim_activate, "Node_Rigid_Activate", [1, Node_Rigid_Activate],, "Enable or disable rigidbody object.").hideRecent().setVersion(1110);
addNodeObject(rigidSim, "Rigidbody Variable", s_node_rigid_variable, "Node_Rigid_Variable", [1, Node_Rigid_Variable],, "Extract veriable from rigidbody object.").hideRecent().setVersion(1120);
addNodeObject(rigidSim, "Rigidbody Override", s_node_rigid_override, "Node_Rigid_Override", [1, Node_Rigid_Override],, "Replace rigidbody object variable with a new one.").hideRecent().setVersion(1120);
#endregion
var smokeSim = ds_list_create(); #region
@ -504,11 +504,12 @@ function __initNodes() {
addNodeObject(filter, "Mirror", s_node_mirror, "Node_Mirror", [1, Node_Mirror],, "Reflect the image along a reflection line.").setVersion(1070);
addNodeObject(filter, "Twirl", s_node_twirl, "Node_Twirl", [1, Node_Twirl], ["twist"], "Twist the image around a mid point.");
addNodeObject(filter, "Dilate", s_node_dilate, "Node_Dilate", [1, Node_Dilate], ["inflate"], "Expand the image around a mid point.");
addNodeObject(filter, "Spherize", s_node_spherize, "Node_Spherize", [1, Node_Spherize],, "Wrap a texture on to sphere.").setVersion(11630);
addNodeObject(filter, "Displace", s_node_displace, "Node_Displace", [1, Node_Displace], ["distort"], "Distort image using another image as a map.");
addNodeObject(filter, "Texture Remap", s_node_texture_map, "Node_Texture_Remap", [1, Node_Texture_Remap],, "Remap image using texture map. Where red channel control x position and green channel control y position.");
addNodeObject(filter, "Time Remap", s_node_time_map, "Node_Time_Remap", [1, Node_Time_Remap],, "Remap image using texture as time map. Where brighter pixel means using pixel from an older frame.");
addNodeObject(filter, "Morph Surface", s_node_morph_surface, "Node_Morph_Surface", [1, Node_Morph_Surface],, "Morph pixel bewteen two surfaces.").setVersion(1141);
ds_list_add(filter, "Effects");
addNodeObject(filter, "Outline", s_node_border, "Node_Outline", [1, Node_Outline], ["border"], "Add border to the image.");
addNodeObject(filter, "Glow", s_node_glow, "Node_Glow", [1, Node_Glow],, "Apply glow to the border of the image.");
@ -529,7 +530,7 @@ function __initNodes() {
addNodeObject(filter, "Replace Image", s_node_image_replace, "Node_Surface_Replace", [1, Node_Surface_Replace], ["image replace"], "Replace instances of an image with a new one.").setVersion(1140);
addNodeObject(filter, "Chromatic Aberration", s_node_chromatic_abarration, "Node_Chromatic_Aberration", [1, Node_Chromatic_Aberration],, "Apply chromatic aberration effect to the image.");
addNodeObject(filter, "FXAA", s_node_FXAA, "Node_FXAA", [1, Node_FXAA],, "Apply fast approximate anti-aliasing to the image.");
ds_list_add(filter, "Colors");
addNodeObject(filter, "Replace Palette", s_node_replace_palette, "Node_Color_replace", [1, Node_Color_replace], ["isolate color", "select color", "palette swap", "color replace"], "Replace color that match one palette with another palette.");
addNodeObject(filter, "Replace Colors", s_node_color_replace, "Node_Colors_Replace", [1, Node_Colors_Replace], ["isolate color", "select color", "palette swap", "color replace"]);
@ -547,7 +548,7 @@ function __initNodes() {
addNodeObject(filter, "Curve", s_node_curve_edit, "Node_Curve", [1, Node_Curve],, "Adjust brightness of an image using curves.").setVersion(1120);
addNodeObject(filter, "Threshold", s_node_threshold, "Node_Threshold", [1, Node_Threshold],, "Set a threshold where pixel darker will becomes black, and brighter to white. Also works with alpha.").setVersion(1080);
addNodeObject(filter, "Alpha Cutoff", s_node_alpha_cut, "Node_Alpha_Cutoff", [1, Node_Alpha_Cutoff], ["remove alpha"], "Remove pixel with low alpha value.");
ds_list_add(filter, "Conversions");
addNodeObject(filter, "RGBA Extract", s_node_RGB, "Node_RGB_Channel", [1, Node_RGB_Channel], ["channel extract"], "Extract RGBA channel on an image, each channel becomes its own image.");
addNodeObject(filter, "HSV Extract", s_node_HSV, "Node_HSV_Channel", [1, Node_HSV_Channel],, "Extract HSVA channel on an image, each channel becomes its own image.").setVersion(1070);
@ -652,6 +653,7 @@ function __initNodes() {
addNodeObject(generator, "FLIP Fluid", s_node_fluidSim_group, "Node_FLIP_Group_Inline", [1, Node_FLIP_Group_Inline],, "Create group for fluid simulation.").setVersion(11620);
addNodeObject(generator, "SmokeSim", s_node_smokeSim_group, "Node_Fluid_Group_Inline", [1, Node_Fluid_Group_Inline],, "Create group for smoke simulation.").setVersion(1120);
addNodeObject(generator, "StrandSim", s_node_strandSim, "Node_Strand_Group_Inline", [1, Node_Strand_Group_Inline], ["Hair"], "Create group for hair simulation.").setVersion(1140);
addNodeObject(generator, "Reaction Diffusion", s_node_reaction_diffusion, "Node_RD", [1, Node_RD],, "Simulate reaction diffusion effect.").setVersion(11630);
ds_list_add(generator, "Region");
addNodeObject(generator, "Separate Shape", s_node_sepearte_shape, "Node_Seperate_Shape", [1, Node_Seperate_Shape],, "Separate disconnected pixel each into an image in an image array.");

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "filter",
"path": "folders/nodes/data/filter.yy",
},
"resourceVersion": "1.0",
"name": "node_alpha_to_grey",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "filter",
"path": "folders/nodes/data/filter.yy",
},
"resourceVersion": "1.0",
"name": "node_bw",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "filter",
"path": "folders/nodes/data/filter.yy",
},
"resourceVersion": "1.0",
"name": "node_color_adjustment",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "process",
"path": "folders/nodes/data/process.yy",
},
"resourceVersion": "1.0",
"name": "node_color_replacement",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "filter",
"path": "folders/nodes/data/filter.yy",
},
"resourceVersion": "1.0",
"name": "node_greyscale",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "process",
"path": "folders/nodes/data/process.yy",
},
"resourceVersion": "1.0",
"name": "node_outline",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -0,0 +1,97 @@
function Node_Spherize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "Spherize";
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue("Center", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ DEF_SURF_W / 2, DEF_SURF_H / 2 ])
.setDisplay(VALUE_DISPLAY.vector)
.setUnitRef(function(index) { return getDimension(index); });
inputs[| 2] = nodeValue("Strength", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider, { range: [-3, 3, 0.01] })
.setMappable(11);
inputs[| 3] = nodeValue("Radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.2)
.setDisplay(VALUE_DISPLAY.slider)
.setMappable(12);
inputs[| 4] = 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" ]);
inputs[| 5] = nodeValue("Mask", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 6] = nodeValue("Mix", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
.setDisplay(VALUE_DISPLAY.slider);
inputs[| 7] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
active_index = 7;
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
//////////////////////////////////////////////////////////////////////////////////////////////////////////
inputs[| 11] = nodeValue("Strength map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone)
.setVisible(false, false);
inputs[| 12] = nodeValue("Radius map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone)
.setVisible(false, false);
//////////////////////////////////////////////////////////////////////////////////////////////////////////
inputs[| 13] = nodeValue("Trim edge", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.slider)
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 7, 8,
["Surfaces", true], 0, 5, 6, 9, 10,
["Spherize", false], 1, 2, 11, 3, 12, 13,
];
attribute_surface_depth();
attribute_oversample();
attribute_interpolation();
attributes.oversample = 2;
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
var pos = getInputData(1);
var px = _x + pos[0] * _s;
var py = _y + pos[1] * _s;
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
} #endregion
static step = function() { #region
__step_mask_modifier();
inputs[| 2].mappableStep();
inputs[| 3].mappableStep();
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var sam = struct_try_get(attributes, "oversample");
surface_set_shader(_outSurf, sh_spherize);
shader_set_interpolation(_data[0]);
shader_set_f("dimension", [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ]);
shader_set_f("center", _data[1]);
shader_set_f("trim", _data[13]);
shader_set_f_map("strength", _data[2], _data[11], inputs[| 2]);
shader_set_f_map("radius", _data[3], _data[12], inputs[| 3]);
shader_set_i("sampleMode", sam);
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]);
return _outSurf;
} #endregion
}

View file

@ -0,0 +1,11 @@
{
"resourceType": "GMScript",
"resourceVersion": "1.0",
"name": "node_spherize",
"isCompatibility": false,
"isDnD": false,
"parent": {
"name": "warps",
"path": "folders/nodes/data/filter/warps.yy",
},
}

View file

@ -0,0 +1,12 @@
{
"isDnD": false,
"isCompatibility": false,
"parent": {
"name": "filter",
"path": "folders/nodes/data/filter.yy",
},
"resourceVersion": "1.0",
"name": "node_twirl",
"tags": [],
"resourceType": "GMScript",
}

View file

@ -3,7 +3,7 @@ function Node_Surface_To_Color(_x, _y, _group = noone) : Node_Processor(_x, _y,
inputs[| 0] = nodeValue("Surface", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
outputs[| 0] = nodeValue("Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, [])
outputs[| 0] = nodeValue("Colors", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, [])
.setDisplay(VALUE_DISPLAY.palette);
static processData = function(_outSurf, _data, _output_index, _array_index) {
@ -11,11 +11,11 @@ function Node_Surface_To_Color(_x, _y, _group = noone) : Node_Processor(_x, _y,
var _pal = [];
var buff = buffer_from_surface(_surf, false);
var size = buffer_get_size(buff);
var size = buffer_get_size(buff) / 4;
buffer_seek(buff, buffer_seek_start, 0);
repeat(size) {
var col = buffer_read(buff, buffer_u8);
var col = buffer_read(buff, buffer_u32);
array_push_unique(_pal, col);
}

View file

@ -70,7 +70,7 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
];
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
attribute_surface_depth();
_font_current = "";

View file

@ -2641,7 +2641,7 @@ function drawJuncConnection(from, to, params, target = to) { #region
if(PANEL_GRAPH.pHOVER) {
if(feed && from.node == to.node) {
hover = distance_line_feedback(mx, my, jx, jy, frx, fry) < hovDist;
hover = distance_line_feedback(mx, my, jx, jy, frx, fry, _s) < hovDist;
} else {
switch(PREFERENCES.curve_connection_line) {
case 0 :

View file

@ -72,7 +72,7 @@ function __loadSteamUGCCollection(file_id, f, path) {
ds_list_add(STEAM_COLLECTION, file);
var meta = file.getMetadata();
var meta = file.getMetadata(true);
meta.steam = FILE_STEAM_TYPE.steamOpen;
meta.file_id = file_id;
}
@ -85,7 +85,7 @@ function __loadSteamUGCProject(file_id, f, path) {
ds_list_add(STEAM_PROJECTS, file);
var meta = file.getMetadata();
var meta = file.getMetadata(true);
meta.steam = FILE_STEAM_TYPE.steamOpen;
meta.file_id = file_id;
}

View file

@ -14,6 +14,7 @@ function steam_ugc_create_project() { #region
directory_create(DIRECTORY + "steamUGC");
file_copy(file.path, DIRECTORY + "steamUGC/" + filename_name(file.path));
json_save_struct(DIRECTORY + "steamUGC/" + filename_name_only(file.path) + ".meta", file.meta);
var preview_surface = PANEL_PREVIEW.getNodePreviewSurface();
surface_save_safe(preview_surface, DIRECTORY + "steamUGC/thumbnail.png");
@ -39,6 +40,7 @@ function steam_ugc_update_project(update_preview = false, update_note = "Updated
file_copy(file.path, DIRECTORY + "steamUGC/" + filename_name(file.path));
if(file_exists_empty(PROJECT.thumbnail))
file_copy(PROJECT.thumbnail, DIRECTORY + "steamUGC/thumbnail.png");
json_save_struct(DIRECTORY + "steamUGC/" + filename_name_only(file.path) + ".meta", file.meta);
STEAM_UGC_PUBLISH_ID = file.meta.file_id;
STEAM_UGC_UPDATE_HANDLE = steam_ugc_start_item_update(STEAM_APP_ID, STEAM_UGC_PUBLISH_ID);

View file

@ -123,5 +123,5 @@ void main() {
}
}
gl_FragColor.a = _col.a;
gl_FragColor.a *= _col.a;
}

View file

@ -60,5 +60,5 @@ void main() {
}
gl_FragColor = palette[closet_index];
if(alpha == 0) gl_FragColor.a = _col.a;
if(alpha == 0) gl_FragColor.a *= _col.a;
}

View file

@ -0,0 +1,9 @@
//
// 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_rd_add",
"parent": {
"name": "reaction diffusion",
"path": "folders/shader/generator/reaction diffusion.yy",
},
"type": 1,
}

View file

@ -0,0 +1,10 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main() {
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord );
gl_FragColor = col;
//float whi = (col.r + col.g + col.b) / 3. * col.a;
//gl_FragColor = vec4(1., whi, 0., 1.);
}

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_rd_convert",
"parent": {
"name": "reaction diffusion",
"path": "folders/shader/generator/reaction diffusion.yy",
},
"type": 1,
}

View file

@ -0,0 +1,83 @@
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec2 dimension;
uniform vec2 k;
uniform int kUseSurf;
uniform sampler2D kSurf;
uniform vec2 f;
uniform int fUseSurf;
uniform sampler2D fSurf;
uniform vec2 dt;
uniform int dtUseSurf;
uniform sampler2D dtSurf;
uniform float dd;
uniform vec2 da;
uniform int daUseSurf;
uniform sampler2D daSurf;
uniform vec2 db;
uniform int dbUseSurf;
uniform sampler2D dbSurf;
float random (in vec2 st, float seed) { return fract(sin(dot(st.xy + vec2(21.456, 46.856), vec2(12.989, 78.233))) * (43758.545 + seed)); }
vec2 samp(float sx, float sy) { return texture2D( gm_BaseTexture, v_vTexcoord + vec2(sx, sy) / dimension ).xy; }
void main() {
#region
float _k = k.x;
if(kUseSurf == 1) {
vec4 _vMap = texture2D( kSurf, v_vTexcoord );
_k = mix(k.x, k.y, (_vMap.r + _vMap.g + _vMap.b) / 3.);
}
float _f = f.x;
if(fUseSurf == 1) {
vec4 _vMap = texture2D( fSurf, v_vTexcoord );
_f = mix(f.x, f.y, (_vMap.r + _vMap.g + _vMap.b) / 3.);
}
float _dt = dt.x;
if(dtUseSurf == 1) {
vec4 _vMap = texture2D( dtSurf, v_vTexcoord );
_dt = mix(dt.x, dt.y, (_vMap.r + _vMap.g + _vMap.b) / 3.);
}
float _da = da.x;
if(daUseSurf == 1) {
vec4 _vMap = texture2D( daSurf, v_vTexcoord );
_da = mix(da.x, da.y, (_vMap.r + _vMap.g + _vMap.b) / 3.);
}
float _db = db.x;
if(dbUseSurf == 1) {
vec4 _vMap = texture2D( dbSurf, v_vTexcoord );
_db = mix(db.x, db.y, (_vMap.r + _vMap.g + _vMap.b) / 3.);
}
#endregion
vec2 _0 = samp(-1., -1.), _1 = samp(0., -1.), _2 = samp(1., -1.);
vec2 _3 = samp(-1., 0.), _4 = samp(0., 0.), _5 = samp(1., 0.);
vec2 _6 = samp(-1., 1.), _7 = samp(0., 1.), _8 = samp(1., 1.);
vec2 lap = _0 * 0.05 + _1 * 0.2 + _2 * 0.05 +
_3 * 0.2 + _4 * -1. + _5 * 0.2 +
_6 * 0.05 + _7 * 0.2 + _8 * 0.05;
vec2 reaction = vec2(-1., 1.) * _4.x * _4.y * _4.y;
vec2 disipation = vec2(_f * (1. - _4.x), -(_k + _f) * _4.y);
vec2 diffusion = lap * vec2(_da, _db) * dd;
vec2 _new = _4 + (reaction + disipation + diffusion) * _dt;
gl_FragColor = vec4(_new, 0., 1.);
}

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_rd_propagate",
"parent": {
"name": "reaction diffusion",
"path": "folders/shader/generator/reaction diffusion.yy",
},
"type": 1,
}

View file

@ -0,0 +1,13 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main() {
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord );
if(col.r + col.g == 0.) {
gl_FragColor = vec4(0., 0., 0., 1.);
} else {
float whi = (col.g) / (col.r + col.g);
gl_FragColor = vec4(whi, whi, whi, 1.);
}
}

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_rd_render",
"parent": {
"name": "reaction diffusion",
"path": "folders/shader/generator/reaction diffusion.yy",
},
"type": 1,
}

View file

@ -0,0 +1,103 @@
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec2 dimension;
uniform vec2 center;
uniform int sampleMode;
uniform vec2 radius;
uniform int radiusUseSurf;
uniform sampler2D radiusSurf;
uniform vec2 strength;
uniform int strengthUseSurf;
uniform sampler2D strengthSurf;
uniform float trim;
#region /////////////// SAMPLING ///////////////
const float PI = 3.14159265358979323846;
uniform int interpolation;
uniform vec2 sampleDimension;
const int RSIN_RADIUS = 1;
float sinc ( float x ) { return x == 0.? 1. : sin(x * PI) / (x * PI); }
vec4 texture2D_rsin( sampler2D texture, vec2 uv ) {
vec2 tx = 1.0 / sampleDimension;
vec2 p = uv * sampleDimension - vec2(0.5);
vec4 sum = vec4(0.0);
float weights = 0.;
for (int x = -RSIN_RADIUS; x <= RSIN_RADIUS; x++)
for (int y = -RSIN_RADIUS; y <= RSIN_RADIUS; y++) {
float a = length(vec2(float(x), float(y))) / float(RSIN_RADIUS);
if(a > 1.) continue;
float w = sinc(a * PI * tx.x) * sinc(a * PI * tx.y);
vec2 offset = vec2(float(x), float(y)) * tx;
vec4 sample = texture2D(texture, (p + offset + vec2(0.5)) / sampleDimension);
sum += w * sample;
weights += w;
}
return sum / weights;
}
vec4 texture2D_bicubic( sampler2D texture, vec2 uv ) {
uv = uv * sampleDimension + 0.5;
vec2 iuv = floor( uv );
vec2 fuv = fract( uv );
uv = iuv + fuv * fuv * (3.0 - 2.0 * fuv);
uv = (uv - 0.5) / sampleDimension;
return texture2D( texture, uv );
}
vec4 texture2Dintp( sampler2D texture, vec2 uv ) {
if(interpolation == 2) return texture2D_bicubic( texture, uv );
else if(interpolation == 3) return texture2D_rsin( texture, uv );
return texture2D( texture, uv );
}
#endregion /////////////// SAMPLING ///////////////
vec4 sampleTexture(vec2 pos) { #region
if(pos.x >= 0. && pos.y >= 0. && pos.x <= 1. && pos.y <= 1.)
return texture2Dintp(gm_BaseTexture, pos);
if(sampleMode == 0)
return vec4(0.);
if(sampleMode == 1)
return texture2Dintp(gm_BaseTexture, clamp(pos, 0., 1.));
if(sampleMode == 2)
return texture2Dintp(gm_BaseTexture, fract(pos));
return vec4(0.);
} #endregion
void main() {
float rad = radius.x;
if(radiusUseSurf == 1) {
vec4 _vMap = texture2Dintp( radiusSurf, v_vTexcoord );
rad = mix(radius.x, radius.y, (_vMap.r + _vMap.g + _vMap.b) / 3.);
}
float str = strength.x;
if(strengthUseSurf == 1) {
vec4 _vMap = texture2Dintp( strengthSurf, v_vTexcoord );
str = mix(strength.x, strength.y, (_vMap.r + _vMap.g + _vMap.b) / 3.);
}
vec2 cen = center / dimension;
vec2 uv = (v_vTexcoord - cen);
float d = 1. - dot(uv, uv) / rad;
float dist = sqrt(abs(d));
vec4 c = sampleTexture(cen + uv / dist);
if(d > trim) gl_FragColor = 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_spherize",
"parent": {
"name": "warp",
"path": "folders/shader/warp.yy",
},
"type": 1,
}

View file

@ -0,0 +1,11 @@
{
"type": 1,
"parent": {
"name": "filter",
"path": "folders/shader/filter.yy",
},
"resourceVersion": "1.0",
"name": "sh_twirl",
"tags": [],
"resourceType": "GMShader",
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

View file

@ -0,0 +1,74 @@
{
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_node_reaction_diffusion",
"bbox_bottom": 63,
"bbox_left": 0,
"bbox_right": 63,
"bbox_top": 0,
"bboxMode": 0,
"collisionKind": 1,
"collisionTolerance": 0,
"DynamicTexturePage": false,
"edgeFiltering": false,
"For3D": false,
"frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"a53ffae8-9fdb-46d4-a419-b105f9c0f7d5",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"723e0dcf-5a4f-4dda-93ce-ab80108bf0b2","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
"parent": {
"name": "generator",
"path": "folders/nodes/icons/generator.yy",
},
"preMultiplyAlpha": false,
"sequence": {
"resourceType": "GMSequence",
"resourceVersion": "1.4",
"name": "s_node_reaction_diffusion",
"autoRecord": true,
"backdropHeight": 768,
"backdropImageOpacity": 0.5,
"backdropImagePath": "",
"backdropWidth": 1366,
"backdropXOffset": 0.0,
"backdropYOffset": 0.0,
"events": {"resourceType":"KeyframeStore<MessageEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"eventStubScript": null,
"eventToFunction": {},
"length": 1.0,
"lockOrigin": false,
"moments": {"resourceType":"KeyframeStore<MomentsEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"playback": 1,
"playbackSpeed": 30.0,
"playbackSpeedType": 0,
"showBackdrop": true,
"showBackdropImage": false,
"timeUnits": 1,
"tracks": [
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"a53ffae8-9fdb-46d4-a419-b105f9c0f7d5","path":"sprites/s_node_reaction_diffusion/s_node_reaction_diffusion.yy",},},},"Disabled":false,"id":"7f80ccbb-00bd-4d04-89f4-948182a4e075","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange": null,
"volume": 1.0,
"xorigin": 32,
"yorigin": 32,
},
"swatchColours": null,
"swfPrecision": 2.525,
"textureGroupId": {
"name": "Default",
"path": "texturegroups/Default",
},
"type": 0,
"VTile": false,
"width": 64,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View file

@ -0,0 +1,74 @@
{
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_node_spherize",
"bbox_bottom": 63,
"bbox_left": 0,
"bbox_right": 63,
"bbox_top": 0,
"bboxMode": 0,
"collisionKind": 1,
"collisionTolerance": 0,
"DynamicTexturePage": false,
"edgeFiltering": false,
"For3D": false,
"frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"033a5e69-7bc1-461e-a969-4272e340dd32",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"be61c715-e453-41d9-946e-7148cb50d788","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
"parent": {
"name": "filter",
"path": "folders/nodes/icons/filter.yy",
},
"preMultiplyAlpha": false,
"sequence": {
"resourceType": "GMSequence",
"resourceVersion": "1.4",
"name": "s_node_spherize",
"autoRecord": true,
"backdropHeight": 768,
"backdropImageOpacity": 0.5,
"backdropImagePath": "",
"backdropWidth": 1366,
"backdropXOffset": 0.0,
"backdropYOffset": 0.0,
"events": {"resourceType":"KeyframeStore<MessageEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"eventStubScript": null,
"eventToFunction": {},
"length": 1.0,
"lockOrigin": false,
"moments": {"resourceType":"KeyframeStore<MomentsEventKeyframe>","resourceVersion":"1.0","Keyframes":[],},
"playback": 1,
"playbackSpeed": 30.0,
"playbackSpeedType": 0,
"showBackdrop": true,
"showBackdropImage": false,
"timeUnits": 1,
"tracks": [
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"033a5e69-7bc1-461e-a969-4272e340dd32","path":"sprites/s_node_spherize/s_node_spherize.yy",},},},"Disabled":false,"id":"338044b5-5935-4c63-92e5-91513cea0d3d","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange": null,
"volume": 1.0,
"xorigin": 32,
"yorigin": 32,
},
"swatchColours": null,
"swfPrecision": 2.525,
"textureGroupId": {
"name": "Default",
"path": "texturegroups/Default",
},
"type": 0,
"VTile": false,
"width": 64,
}