This commit is contained in:
Tanasart 2023-12-01 16:30:48 +07:00
parent d392a4341a
commit 7de5a3a7be
21 changed files with 635 additions and 8 deletions

View file

@ -224,6 +224,7 @@
{"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":"MK effects","order":22,"path":"folders/shader/MK effects.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",},
@ -243,7 +244,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":"MK effects","order":22,"path":"folders/shader/MK effects.yy",},
],
"ResourceOrderSettings": [
{"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",},
@ -558,6 +558,7 @@
{"name":"s_node_rigidSim_global","order":4,"path":"sprites/s_node_rigidSim_global/s_node_rigidSim_global.yy",},
{"name":"sh_channel_G_grey","order":8,"path":"shaders/sh_channel_G_grey/sh_channel_G_grey.yy",},
{"name":"s_node_smokeSim_update","order":10,"path":"sprites/s_node_smokeSim_update/s_node_smokeSim_update.yy",},
{"name":"s_node_mk_flip_grid","order":2,"path":"sprites/s_node_mk_flip_grid/s_node_mk_flip_grid.yy",},
{"name":"node_3d_depth","order":15,"path":"scripts/node_3d_depth/node_3d_depth.yy",},
{"name":"s_node_vec4","order":9,"path":"sprites/s_node_vec4/s_node_vec4.yy",},
{"name":"vct_knob","order":2,"path":"scripts/vct_knob/vct_knob.yy",},
@ -879,6 +880,7 @@
{"name":"s_node_vfx_trail","order":13,"path":"sprites/s_node_vfx_trail/s_node_vfx_trail.yy",},
{"name":"s_node_base_conversion","order":10,"path":"sprites/s_node_base_conversion/s_node_base_conversion.yy",},
{"name":"node_transform_array","order":15,"path":"scripts/node_transform_array/node_transform_array.yy",},
{"name":"sh_mk_saber_glow","order":2,"path":"shaders/sh_mk_saber_glow/sh_mk_saber_glow.yy",},
{"name":"s_node_loop_array","order":23,"path":"sprites/s_node_loop_array/s_node_loop_array.yy",},
{"name":"node_pb_fx_stack","order":8,"path":"scripts/node_pb_fx_stack/node_pb_fx_stack.yy",},
{"name":"s_node_iterator_amount","order":26,"path":"sprites/s_node_iterator_amount/s_node_iterator_amount.yy",},
@ -1194,6 +1196,7 @@
{"name":"s_node_crop_content","order":13,"path":"sprites/s_node_crop_content/s_node_crop_content.yy",},
{"name":"draw_line_zigzag","order":20,"path":"scripts/draw_line_zigzag/draw_line_zigzag.yy",},
{"name":"sh_alpha_grey","order":1,"path":"shaders/sh_alpha_grey/sh_alpha_grey.yy",},
{"name":"sh_mk_flipGrid","order":1,"path":"shaders/sh_mk_flipGrid/sh_mk_flipGrid.yy",},
{"name":"sh_channel_R2B","order":12,"path":"shaders/sh_channel_R2B/sh_channel_R2B.yy",},
{"name":"s_node_voronoi_extra","order":36,"path":"sprites/s_node_voronoi_extra/s_node_voronoi_extra.yy",},
{"name":"s_node_smokeSim_domain","order":11,"path":"sprites/s_node_smokeSim_domain/s_node_smokeSim_domain.yy",},
@ -1239,6 +1242,7 @@
{"name":"node_convolution","order":5,"path":"scripts/node_convolution/node_convolution.yy",},
{"name":"node_pb_draw_ellipse","order":2,"path":"scripts/node_pb_draw_ellipse/node_pb_draw_ellipse.yy",},
{"name":"sh_outline_only","order":35,"path":"shaders/sh_outline_only/sh_outline_only.yy",},
{"name":"node_mk_saber","order":3,"path":"scripts/node_mk_saber/node_mk_saber.yy",},
{"name":"lcd_function","order":13,"path":"scripts/lcd_function/lcd_function.yy",},
{"name":"d3d_gizmo_line","order":1,"path":"scripts/d3d_gizmo_line/d3d_gizmo_line.yy",},
{"name":"s_node_destray","order":18,"path":"sprites/s_node_destray/s_node_destray.yy",},
@ -1400,6 +1404,7 @@
{"name":"s_node_separate_file_path","order":14,"path":"sprites/s_node_separate_file_path/s_node_separate_file_path.yy",},
{"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":"s_node_mk_saber","order":3,"path":"sprites/s_node_mk_saber/s_node_mk_saber.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",},
@ -1720,6 +1725,7 @@
{"name":"s_node_json_file_write","order":10,"path":"sprites/s_node_json_file_write/s_node_json_file_write.yy",},
{"name":"node_pb_fx_intersect","order":5,"path":"scripts/node_pb_fx_intersect/node_pb_fx_intersect.yy",},
{"name":"fd_rectangle_get_material_time_step","order":13,"path":"scripts/fd_rectangle_get_material_time_step/fd_rectangle_get_material_time_step.yy",},
{"name":"node_mk_grid_flip","order":2,"path":"scripts/node_mk_grid_flip/node_mk_grid_flip.yy",},
{"name":"node_pack_sprites","order":4,"path":"scripts/node_pack_sprites/node_pack_sprites.yy",},
{"name":"font_data","order":10,"path":"scripts/font_data/font_data.yy",},
{"name":"node_camera","order":3,"path":"scripts/node_camera/node_camera.yy",},

View file

@ -256,6 +256,7 @@
{"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":"MK effects","folderPath":"folders/shader/MK effects.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",},
@ -278,7 +279,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":"MK effects","folderPath":"folders/shader/MK effects.yy",},
],
"IncludedFiles": [
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
@ -1163,6 +1163,7 @@
{"id":{"name":"s_node_rigidSim_global","path":"sprites/s_node_rigidSim_global/s_node_rigidSim_global.yy",},},
{"id":{"name":"sh_channel_G_grey","path":"shaders/sh_channel_G_grey/sh_channel_G_grey.yy",},},
{"id":{"name":"s_node_smokeSim_update","path":"sprites/s_node_smokeSim_update/s_node_smokeSim_update.yy",},},
{"id":{"name":"s_node_mk_flip_grid","path":"sprites/s_node_mk_flip_grid/s_node_mk_flip_grid.yy",},},
{"id":{"name":"node_3d_depth","path":"scripts/node_3d_depth/node_3d_depth.yy",},},
{"id":{"name":"s_node_vec4","path":"sprites/s_node_vec4/s_node_vec4.yy",},},
{"id":{"name":"vct_knob","path":"scripts/vct_knob/vct_knob.yy",},},
@ -1539,6 +1540,7 @@
{"id":{"name":"assets_data","path":"scripts/assets_data/assets_data.yy",},},
{"id":{"name":"s_node_base_conversion","path":"sprites/s_node_base_conversion/s_node_base_conversion.yy",},},
{"id":{"name":"node_transform_array","path":"scripts/node_transform_array/node_transform_array.yy",},},
{"id":{"name":"sh_mk_saber_glow","path":"shaders/sh_mk_saber_glow/sh_mk_saber_glow.yy",},},
{"id":{"name":"s_node_loop_array","path":"sprites/s_node_loop_array/s_node_loop_array.yy",},},
{"id":{"name":"node_pb_fx_stack","path":"scripts/node_pb_fx_stack/node_pb_fx_stack.yy",},},
{"id":{"name":"s_node_iterator_amount","path":"sprites/s_node_iterator_amount/s_node_iterator_amount.yy",},},
@ -1889,6 +1891,7 @@
{"id":{"name":"s_node_crop_content","path":"sprites/s_node_crop_content/s_node_crop_content.yy",},},
{"id":{"name":"draw_line_zigzag","path":"scripts/draw_line_zigzag/draw_line_zigzag.yy",},},
{"id":{"name":"sh_alpha_grey","path":"shaders/sh_alpha_grey/sh_alpha_grey.yy",},},
{"id":{"name":"sh_mk_flipGrid","path":"shaders/sh_mk_flipGrid/sh_mk_flipGrid.yy",},},
{"id":{"name":"sh_channel_R2B","path":"shaders/sh_channel_R2B/sh_channel_R2B.yy",},},
{"id":{"name":"s_node_voronoi_extra","path":"sprites/s_node_voronoi_extra/s_node_voronoi_extra.yy",},},
{"id":{"name":"s_node_smokeSim_domain","path":"sprites/s_node_smokeSim_domain/s_node_smokeSim_domain.yy",},},
@ -1941,6 +1944,7 @@
{"id":{"name":"node_pb_draw_ellipse","path":"scripts/node_pb_draw_ellipse/node_pb_draw_ellipse.yy",},},
{"id":{"name":"sh_blink_extract","path":"shaders/sh_blink_extract/sh_blink_extract.yy",},},
{"id":{"name":"sh_outline_only","path":"shaders/sh_outline_only/sh_outline_only.yy",},},
{"id":{"name":"node_mk_saber","path":"scripts/node_mk_saber/node_mk_saber.yy",},},
{"id":{"name":"lcd_function","path":"scripts/lcd_function/lcd_function.yy",},},
{"id":{"name":"d3d_gizmo_line","path":"scripts/d3d_gizmo_line/d3d_gizmo_line.yy",},},
{"id":{"name":"s_node_destray","path":"sprites/s_node_destray/s_node_destray.yy",},},
@ -2130,6 +2134,7 @@
{"id":{"name":"s_node_separate_file_path","path":"sprites/s_node_separate_file_path/s_node_separate_file_path.yy",},},
{"id":{"name":"node_scale_algo","path":"scripts/node_scale_algo/node_scale_algo.yy",},},
{"id":{"name":"s_node_image_replace","path":"sprites/s_node_image_replace/s_node_image_replace.yy",},},
{"id":{"name":"s_node_mk_saber","path":"sprites/s_node_mk_saber/s_node_mk_saber.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",},},
@ -2500,6 +2505,7 @@
{"id":{"name":"timer_function","path":"scripts/timer_function/timer_function.yy",},},
{"id":{"name":"fd_rectangle_get_material_time_step","path":"scripts/fd_rectangle_get_material_time_step/fd_rectangle_get_material_time_step.yy",},},
{"id":{"name":"FirebasePathsUserFunctions","path":"scripts/FirebasePathsUserFunctions/FirebasePathsUserFunctions.yy",},},
{"id":{"name":"node_mk_grid_flip","path":"scripts/node_mk_grid_flip/node_mk_grid_flip.yy",},},
{"id":{"name":"node_pack_sprites","path":"scripts/node_pack_sprites/node_pack_sprites.yy",},},
{"id":{"name":"font_data","path":"scripts/font_data/font_data.yy",},},
{"id":{"name":"animation_curve","path":"scripts/animation_curve/animation_curve.yy",},},

Binary file not shown.

View file

@ -1,7 +1,7 @@
function Node_MK_GridBalls(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "MK GridBalls";
inputs[| 0] = nodeValue("Surfce in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF)
.setDisplay(VALUE_DISPLAY.vector);
@ -56,7 +56,6 @@ function Node_MK_GridBalls(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
attribute_surface_depth();
dimension_index = 1;
balls = [];
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
inputs[| 8].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
@ -89,8 +88,8 @@ function Node_MK_GridBalls(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
var _sw = _dim[0];
var _sh = _dim[1];
var _row = _bamo[0];
var _col = _bamo[1];
var _col = _bamo[0];
var _row = _bamo[1];
var _amo = _row * _col;
var _irow = 1 / _row;
@ -148,8 +147,7 @@ function Node_MK_GridBalls(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
} #endregion
if(_strh != 0) { #region
var _cdirr = _strh_dir + 90 - point_direction(_cx, _cy, _bx, _by);
var _cdirr = _strh_dir + 90 - point_direction(_cx, _cy, _bx, _by);
var _st_prg = _cdist * dsin(_cdirr) + _strh_shf;
var _st_str = max(0, _st_prg * _strh);

View file

@ -0,0 +1,149 @@
function Node_MK_GridFlip(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "MK GridFlip";
inputs[| 0] = nodeValue("Surface front", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 1] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF)
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 2] = nodeValue("Amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 4, 4 ])
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 3] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, irandom_range(100000, 999999));
inputs[| 4] = nodeValue("Surface back", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
inputs[| 5] = nodeValue("Rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.rotation);
inputs[| 6] = nodeValue("Axis", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_button, [ "X", "Y" ]);
inputs[| 7] = nodeValue("Sweep", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0);
inputs[| 8] = nodeValue("Sweep direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.rotation);
inputs[| 9] = nodeValue("Sweep shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.slider, { range: [ -1, 1, 0.01 ] });
inputs[| 10] = nodeValue("Flip limit", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "None", "90", "180" ]);
input_display_list = [ 3, 1,
["Surface", true], 0, 4,
["Grid", false], 2,
["Flip", false], 6, 10, 5, 7, 8, 9,
];
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
attribute_surface_depth();
dimension_index = 1;
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
}
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _surf = _data[0];
var _dim = _data[1];
var _bamo = _data[2];
var _seed = _data[3];
var _srfB = _data[4];
var _flip = _data[5];
var _axis = _data[6];
var _swp = _data[7];
var _swp_dir = _data[8];
var _swp_shf = _data[9];
var _limt = _data[10];
if(!is_surface(_surf)) return _outSurf;
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
random_set_seed(_seed);
var _sw = _dim[0];
var _sh = _dim[1];
var _col = _bamo[0];
var _row = _bamo[1];
var _amo = _row * _col;
var _irow = 1 / _row;
var _icol = 1 / _col;
var _flpw = _sw * _icol;
var _flph = _sh * _irow;
var _cx = _sw / 2;
var _cy = _sh / 2;
var _cd = sqrt(_cx * _cx + _cy * _cy);
_swp_shf *= _cd;
var _strh_dx = lengthdir_x(1, _swp_dir);
var _strh_dy = lengthdir_y(1, _swp_dir);
surface_set_shader(_outSurf, sh_mk_flipGrid);
shader_set_surface("texture", _surf);
shader_set_surface("textureBack", _srfB);
shader_set_i("hasBack", is_surface(_srfB));
shader_set_f("dimension", _dim);
for( var i = 0; i < _amo; i++ ) {
var _c = i % _col;
var _r = floor(i * _icol);
var _flxc = (_c + 0.5) * _flpw;
var _flyc = (_r + 0.5) * _flph;
var _cdist = point_distance(_cx, _cy, _flxc, _flyc);
var _fRot = _flip;
if(_swp != 0) { #region
var _cdirr = _swp_dir + 90 - point_direction(_cx, _cy, _flxc, _flyc);
var _st_prg = _cdist * dsin(_cdirr) + _swp_shf;
_fRot += max(0, _st_prg * _swp);
} #endregion
if(_limt == 1) _fRot = clamp(_fRot, -90, 90);
else if(_limt == 2) _fRot = clamp(_fRot, -180, 180);
var _fw = _flpw / 2 * ((_axis == 1)? dcos(_fRot) : 1);
var _fh = _flph / 2 * ((_axis == 0)? dcos(_fRot) : 1);
var _flx = _c * _flpw;
var _fly = _r * _flph;
var _flx0 = _flxc - _fw;
var _flx1 = _flxc + _fw;
var _fly0 = _flyc - _fh;
var _fly1 = _flyc + _fh;
var _rRot = _fRot < 0? 360 - abs(_fRot) % 360 : _fRot;
var _f = floor(_rRot / 90) % 4;
shader_set_f("flipPos", _flx0, _fly0);
shader_set_f("flipSize", _fw * 2, _fh * 2);
shader_set_f("fr_flipPos", _flx, _fly);
shader_set_f("fr_flipSize", _flpw, _flph);
shader_set_i("axis", _axis);
shader_set_i("flip", _f == 1 || _f == 2);
var _x0 = min(_flx0, _flx1);
var _x1 = max(_flx0, _flx1);
var _y0 = min(_fly0, _fly1);
var _y1 = max(_fly0, _fly1);
draw_rectangle(_x0, _y0, _x1, _y1, false);
}
surface_reset_shader();
return _outSurf;
}
}

View file

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

View file

@ -0,0 +1,197 @@
function Node_MK_Saber(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "MK Saber";
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF)
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 1] = nodeValue("Point 1", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 2] = nodeValue("Point 2", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 16, 16 ])
.setDisplay(VALUE_DISPLAY.vector);
inputs[| 3] = nodeValue("Thickness", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 2)
inputs[| 4] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject(c_white))
inputs[| 5] = nodeValue("Trace", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0);
inputs[| 6] = nodeValue("Fix length", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
inputs[| 7] = nodeValue("Gradient step", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1);
inputs[| 8] = nodeValue("Glow intensity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
.setDisplay(VALUE_DISPLAY.slider);
inputs[| 9] = nodeValue("Glow radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0);
input_display_list = [ 0,
["Saber", false], 1, 2, 3, 6,
["Render", false], 4, 7, 5, 8, 9,
];
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
prev_points = noone;
fixed_length = 0;
temp_surface = [ surface_create(1, 1), surface_create(1, 1), surface_create(1, 1) ];
surface_blur_init();
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
var _p1 = getSingleValue(1);
var _p2 = getSingleValue(2);
var _p1x = _x + _p1[0] * _s;
var _p1y = _y + _p1[1] * _s;
var _p2x = _x + _p2[0] * _s;
var _p2y = _y + _p2[1] * _s;
draw_set_color(COLORS._main_accent);
draw_line(_p1x, _p1y, _p2x, _p2y);
var _a = inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); active &= _a;
var _a = inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny); active &= _a;
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _dim = _data[0];
var _pnt1 = _data[1];
var _pnt2 = _data[2];
var _thck = _data[3];
var _colr = _data[4];
var _trac = _data[5];
var _fixl = _data[6];
var _grds = max(1, _data[7]);
var _gint = _data[8];
var _grad = _data[9];
draw_set_circle_precision(32);
var _p1x = round(_pnt1[0] - 1);
var _p1y = round(_pnt1[1] - 1);
var _p2x = round(_pnt2[0] - 1);
var _p2y = round(_pnt2[1] - 1);
var _dir = point_direction(_p1x, _p1y, _p2x, _p2y);
var _cur;
if(prev_points == noone || CURRENT_FRAME == 0) prev_points = [];
if(!is_array(array_safe_get(prev_points, _array_index)))
prev_points[_array_index] = [];
if(_fixl) { #region
var _prevArr = prev_points[_array_index];
if(CURRENT_FRAME == 0)
fixed_length = point_distance(_pnt1[0], _pnt1[1], _pnt2[0], _pnt2[1]);
else if(!array_empty(_prevArr)){
var _prev = _prevArr[array_length(_prevArr) - 1];
var _pr1x = _prev[2][0];
var _pr1y = _prev[2][1];
var _pr2x = _prev[3][0];
var _pr2y = _prev[3][1];
var _dsp = point_distance(_pr1x, _pr1y, _pr2x, _pr2y);
var _dsc = point_distance(_p1x, _p1y, _p2x, _p2y);
var _ds1 = point_distance(_p1x, _p1y, _pr1x, _pr1y);
var _ds2 = point_distance(_p2x, _p2y, _pr2x, _pr2y);
var _ds_off = _dsp - _dsc;
var _ds_of1 = _ds_off * (_ds1 / (_ds1 + _ds2));
var _ds_of2 = _ds_off * (_ds2 / (_ds1 + _ds2));
var __p2x = _p2x + lengthdir_x(_ds_of2, _dir);
var __p2y = _p2y + lengthdir_y(_ds_of2, _dir);
var __p1x = _p1x - lengthdir_x(_ds_of1, _dir);
var __p1y = _p1y - lengthdir_y(_ds_of1, _dir);
_p1x = __p1x;
_p1y = __p1y;
_p2x = __p2x;
_p2y = __p2y;
}
} #endregion
if(_thck) {
_cur = [
[ _p1x - lengthdir_x(_thck / 2, _dir), _p1y - lengthdir_y(_thck / 2, _dir) ],
[ _p2x + lengthdir_x(_thck / 2, _dir), _p2y + lengthdir_y(_thck / 2, _dir) ],
[ _p1x, _p1y ], [ _p2x, _p2y ]
];
} else
_cur = [[ _p1x, _p1y ], [ _p2x, _p2y ], [ _p1x, _p1y ], [ _p2x, _p2y ]];
for( var i = 0; i < array_length(temp_surface); i++ )
temp_surface[i] = surface_verify(temp_surface[i], _dim[0], _dim[1]);
surface_set_target(temp_surface[0]);
DRAW_CLEAR
draw_set_color(_colr.eval(1));
if(_trac > 0 && CURRENT_FRAME > 0 && prev_points != noone) { #region
var _prevArr = prev_points[_array_index];
var _inds = max(0, array_length(_prevArr) - _trac);
for( var i = _inds, n = array_length(_prevArr); i < n; i++ ) {
var _prev = _prevArr[i];
var _curr = i + 1 == n? _cur : _prevArr[i + 1];
var _pr1x = _prev[0][0];
var _pr1y = _prev[0][1];
var _pr2x = _prev[1][0];
var _pr2y = _prev[1][1];
var _pp1x = _curr[0][0];
var _pp1y = _curr[0][1];
var _pp2x = _curr[1][0];
var _pp2y = _curr[1][1];
draw_triangle(_pr1x, _pr1y, _pr2x, _pr2y, _pp1x, _pp1y, false);
draw_triangle(_pr2x, _pr2y, _pp1x, _pp1y, _pp2x, _pp2y, false);
}
} #endregion
if(_thck == 1) {
draw_set_color(_colr.eval(1));
draw_line(_p1x, _p1y, _p2x, _p2y);
} else {
for( var i = _thck; i > 0; i -= _grds ) {
draw_set_color(_colr.eval((i - 1) / (_thck - 1)));
draw_line_round(_p1x, _p1y, _p2x, _p2y, i);
}
}
surface_reset_target();
if(_gint > 0) { #region
surface_set_target(temp_surface[1]);
draw_clear(c_black);
draw_surface(temp_surface[0], 0, 0);
surface_reset_target();
temp_surface[2] = surface_apply_gaussian(temp_surface[1], _grad, false, 0, 1);
} #endregion
surface_set_target(_outSurf);
DRAW_CLEAR
if(_gint > 0) {
BLEND_OVERRIDE
shader_set(sh_mk_saber_glow);
shader_set_color("color", _colr.eval(1));
shader_set_f("intensity", _gint);
draw_surface(temp_surface[2], 0, 0);
shader_reset();
}
BLEND_ALPHA_MULP
draw_surface(temp_surface[0], 0, 0);
BLEND_NORMAL
surface_reset_target();
array_push(prev_points[_array_index], _cur);
return _outSurf;
}
}

View file

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

View file

@ -616,6 +616,8 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { #regio
ds_list_add(generator, "MK Effects");
addNodeObject(generator, "MK Rains", s_node_mk_rain, "Node_MK_Rain", [1, Node_MK_Rain]).setVersion(11600);
addNodeObject(generator, "MK GridBalls", s_node_mk_ball_grid, "Node_MK_GridBalls", [1, Node_MK_GridBalls]).setVersion(11600);
addNodeObject(generator, "MK GridFlip", s_node_mk_flip_grid, "Node_MK_GridFlip", [1, Node_MK_GridFlip]).setVersion(11600);
addNodeObject(generator, "MK Saber", s_node_mk_saber, "Node_MK_Saber", [1, Node_MK_Saber]).setVersion(11600);
#endregion
var compose = ds_list_create(); #region

View file

@ -0,0 +1,30 @@
varying vec4 v_vColour;
varying vec2 v_vPosition;
uniform sampler2D texture;
uniform sampler2D textureBack;
uniform vec2 dimension;
uniform vec2 fr_flipPos;
uniform vec2 fr_flipSize;
uniform int hasBack;
uniform int axis;
uniform int flip;
void main() {
vec2 flSiz = fr_flipSize / dimension;
vec2 flPos = fr_flipPos / dimension;
vec2 pos = v_vPosition;
if(flip == 1) {
if(axis == 0) pos.y = 1. - pos.y;
if(axis == 1) pos.x = 1. - pos.x;
}
vec2 coord = flPos + pos * flSiz;
vec4 col;
if(hasBack == 1 && flip == 1) col = texture2D( textureBack, coord );
else col = texture2D( texture, coord );
gl_FragColor = col;
}

View file

@ -0,0 +1,16 @@
attribute vec3 in_Position; // (x,y,z)
attribute vec4 in_Colour; // (r,g,b,a)
varying vec4 v_vColour;
varying vec2 v_vPosition;
uniform vec2 flipPos;
uniform vec2 flipSize;
void main() {
vec4 object_space_pos = vec4( in_Position, 1.0);
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
v_vColour = in_Colour;
v_vPosition = (in_Position.xy - flipPos) / flipSize;
}

View file

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

View file

@ -0,0 +1,14 @@
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform float intensity;
uniform vec4 color;
void main() {
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord );
float lum = (col.x + col.y + col.z) / 3. * col.a;
gl_FragColor = vec4(color.rgb, lum * intensity);
}

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_mk_saber_glow",
"parent": {
"name": "MK effects",
"path": "folders/shader/MK effects.yy",
},
"type": 1,
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,74 @@
{
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_node_mk_flip_grid",
"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":"9346723f-9bfe-4d65-a80e-4ce2643a5b3f",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"0abbdf26-32ca-4411-999b-57beff9ac021","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
"parent": {
"name": "MK effects",
"path": "folders/nodes/icons/MK effects.yy",
},
"preMultiplyAlpha": false,
"sequence": {
"resourceType": "GMSequence",
"resourceVersion": "1.4",
"name": "s_node_mk_flip_grid",
"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":"9346723f-9bfe-4d65-a80e-4ce2643a5b3f","path":"sprites/s_node_mk_flip_grid/s_node_mk_flip_grid.yy",},},},"Disabled":false,"id":"47e778b6-b6b8-4972-9d4f-a5ae19e40300","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: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

View file

@ -0,0 +1,74 @@
{
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_node_mk_saber",
"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":"738a7dcd-3806-4941-ad43-fb97ce09c4e8",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"97534089-2439-4d31-a905-7f8ab255ac71","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
"parent": {
"name": "MK effects",
"path": "folders/nodes/icons/MK effects.yy",
},
"preMultiplyAlpha": false,
"sequence": {
"resourceType": "GMSequence",
"resourceVersion": "1.4",
"name": "s_node_mk_saber",
"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":"738a7dcd-3806-4941-ad43-fb97ce09c4e8","path":"sprites/s_node_mk_saber/s_node_mk_saber.yy",},},},"Disabled":false,"id":"04252012-20e2-42a9-b7a7-6a71b7b9c596","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,
}