- New Delay node

This commit is contained in:
Tanasart 2024-01-20 11:06:56 +07:00
parent 8380e460f0
commit 093985444c
37 changed files with 508 additions and 174 deletions

View file

@ -224,14 +224,14 @@
{"name":"shadow caster","order":46,"path":"folders/shader/filter/shadow caster.yy",},
{"name":"flood fill","order":11,"path":"folders/shader/flood fill.yy",},
{"name":"generator","order":1,"path":"folders/shader/generator.yy",},
{"name":"blinker","order":30,"path":"folders/shader/generator/blinker.yy",},
{"name":"cell","order":31,"path":"folders/shader/generator/cell.yy",},
{"name":"grid","order":32,"path":"folders/shader/generator/grid.yy",},
{"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":"blinker","order":12,"path":"folders/shader/generator/blinker.yy",},
{"name":"cell","order":13,"path":"folders/shader/generator/cell.yy",},
{"name":"grid","order":14,"path":"folders/shader/generator/grid.yy",},
{"name":"interpret","order":17,"path":"folders/shader/generator/interpret.yy",},
{"name":"noise","order":15,"path":"folders/shader/generator/noise.yy",},
{"name":"random shape","order":11,"path":"folders/shader/generator/random shape.yy",},
{"name":"reaction diffusion","order":20,"path":"folders/shader/generator/reaction diffusion.yy",},
{"name":"region","order":16,"path":"folders/shader/generator/region.yy",},
{"name":"mask","order":10,"path":"folders/shader/mask.yy",},
{"name":"misc","order":13,"path":"folders/shader/misc.yy",},
{"name":"find boundary","order":9,"path":"folders/shader/misc/find boundary.yy",},
@ -260,6 +260,7 @@
{"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":"vector mapper","order":21,"path":"folders/shader/generator/vector mapper.yy",},
],
"ResourceOrderSettings": [
{"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",},
@ -274,6 +275,7 @@
{"name":"panel_preview_window","order":1,"path":"scripts/panel_preview_window/panel_preview_window.yy",},
{"name":"node_PCX_equation","order":5,"path":"scripts/node_PCX_equation/node_PCX_equation.yy",},
{"name":"sh_scale3x","order":29,"path":"shaders/sh_scale3x/sh_scale3x.yy",},
{"name":"sh_active_canvas_ink","order":22,"path":"shaders/sh_active_canvas_ink/sh_active_canvas_ink.yy",},
{"name":"__node_3d","order":2,"path":"scripts/__node_3d/__node_3d.yy",},
{"name":"node_csv_file_write","order":12,"path":"scripts/node_csv_file_write/node_csv_file_write.yy",},
{"name":"surface_functions","order":5,"path":"scripts/surface_functions/surface_functions.yy",},
@ -469,7 +471,7 @@
{"name":"s_node_displace","order":20,"path":"sprites/s_node_displace/s_node_displace.yy",},
{"name":"sh_polar","order":1,"path":"shaders/sh_polar/sh_polar.yy",},
{"name":"s_node_warp_mesh","order":10,"path":"sprites/s_node_warp_mesh/s_node_warp_mesh.yy",},
{"name":"sh_pixel_cloud","order":13,"path":"shaders/sh_pixel_cloud/sh_pixel_cloud.yy",},
{"name":"sh_pixel_cloud","order":4,"path":"shaders/sh_pixel_cloud/sh_pixel_cloud.yy",},
{"name":"panel_graph_connection_settings","order":6,"path":"scripts/panel_graph_connection_settings/panel_graph_connection_settings.yy",},
{"name":"sh_d3d_wireframe","order":17,"path":"shaders/sh_d3d_wireframe/sh_d3d_wireframe.yy",},
{"name":"s_biterator_b_grey_short","order":8,"path":"sprites/s_biterator_b_grey_short/s_biterator_b_grey_short.yy",},
@ -533,7 +535,7 @@
{"name":"s_node_offset","order":19,"path":"sprites/s_node_offset/s_node_offset.yy",},
{"name":"node_iterator_each_size","order":3,"path":"scripts/node_iterator_each_size/node_iterator_each_size.yy",},
{"name":"panel_console","order":8,"path":"scripts/panel_console/panel_console.yy",},
{"name":"sh_gradient_display_alpha","order":37,"path":"shaders/sh_gradient_display_alpha/sh_gradient_display_alpha.yy",},
{"name":"sh_gradient_display_alpha","order":19,"path":"shaders/sh_gradient_display_alpha/sh_gradient_display_alpha.yy",},
{"name":"s_node_HSV_combine","order":44,"path":"sprites/s_node_HSV_combine/s_node_HSV_combine.yy",},
{"name":"Obj_FirebaseFirestore_Collection_Query_GreaterEqual","order":5,"path":"objects/Obj_FirebaseFirestore_Collection_Query_GreaterEqual/Obj_FirebaseFirestore_Collection_Query_GreaterEqual.yy",},
{"name":"s_node_pb_box_contract","order":25,"path":"sprites/s_node_pb_box_contract/s_node_pb_box_contract.yy",},
@ -568,7 +570,7 @@
{"name":"rotatorRange","order":2,"path":"scripts/rotatorRange/rotatorRange.yy",},
{"name":"node_3d_mesh_cone","order":6,"path":"scripts/node_3d_mesh_cone/node_3d_mesh_cone.yy",},
{"name":"font_loader","order":8,"path":"scripts/font_loader/font_loader.yy",},
{"name":"sh_water_caustic","order":36,"path":"shaders/sh_water_caustic/sh_water_caustic.yy",},
{"name":"sh_water_caustic","order":18,"path":"shaders/sh_water_caustic/sh_water_caustic.yy",},
{"name":"node_iterator_filter_input","order":1,"path":"scripts/node_iterator_filter_input/node_iterator_filter_input.yy",},
{"name":"s_node_ovreride_channel","order":62,"path":"sprites/s_node_ovreride_channel/s_node_ovreride_channel.yy",},
{"name":"point_rotate","order":1,"path":"scripts/point_rotate/point_rotate.yy",},
@ -617,7 +619,7 @@
{"name":"curveBox","order":8,"path":"scripts/curveBox/curveBox.yy",},
{"name":"s_node_iterator_length","order":24,"path":"sprites/s_node_iterator_length/s_node_iterator_length.yy",},
{"name":"preview_overlay_vector","order":2,"path":"scripts/preview_overlay_vector/preview_overlay_vector.yy",},
{"name":"sh_gradient_display","order":18,"path":"shaders/sh_gradient_display/sh_gradient_display.yy",},
{"name":"sh_gradient_display","order":7,"path":"shaders/sh_gradient_display/sh_gradient_display.yy",},
{"name":"node_json_file_write","order":11,"path":"scripts/node_json_file_write/node_json_file_write.yy",},
{"name":"s_node_chromatic_abarration","order":14,"path":"sprites/s_node_chromatic_abarration/s_node_chromatic_abarration.yy",},
{"name":"node_blur_directional","order":2,"path":"scripts/node_blur_directional/node_blur_directional.yy",},
@ -647,6 +649,7 @@
{"name":"node_lua_surface","order":2,"path":"scripts/node_lua_surface/node_lua_surface.yy",},
{"name":"sh_blur_directional","order":4,"path":"shaders/sh_blur_directional/sh_blur_directional.yy",},
{"name":"panel_tunnels","order":1,"path":"scripts/panel_tunnels/panel_tunnels.yy",},
{"name":"s_node_delay","order":7,"path":"sprites/s_node_delay/s_node_delay.yy",},
{"name":"node_processor","order":7,"path":"scripts/node_processor/node_processor.yy",},
{"name":"animation_controller","order":1,"path":"scripts/animation_controller/animation_controller.yy",},
{"name":"Obj_FirebaseFirestore_Document_Delete","order":3,"path":"objects/Obj_FirebaseFirestore_Document_Delete/Obj_FirebaseFirestore_Document_Delete.yy",},
@ -656,7 +659,7 @@
{"name":"Spout","order":14,"path":"extensions/Spout/Spout.yy",},
{"name":"s_node_grid_hex_noise","order":21,"path":"sprites/s_node_grid_hex_noise/s_node_grid_hex_noise.yy",},
{"name":"s_node_logic_opr","order":2,"path":"sprites/s_node_logic_opr/s_node_logic_opr.yy",},
{"name":"sh_zigzag","order":11,"path":"shaders/sh_zigzag/sh_zigzag.yy",},
{"name":"sh_zigzag","order":2,"path":"shaders/sh_zigzag/sh_zigzag.yy",},
{"name":"node_blur_bokeh","order":6,"path":"scripts/node_blur_bokeh/node_blur_bokeh.yy",},
{"name":"sh_color_remove","order":7,"path":"shaders/sh_color_remove/sh_color_remove.yy",},
{"name":"o_dialog_migration","order":11,"path":"objects/o_dialog_migration/o_dialog_migration.yy",},
@ -730,7 +733,7 @@
{"name":"node_FLIP_apply_force","order":8,"path":"scripts/node_FLIP_apply_force/node_FLIP_apply_force.yy",},
{"name":"luaHighlight","order":1,"path":"scripts/luaHighlight/luaHighlight.yy",},
{"name":"d3d_rot3","order":3,"path":"scripts/d3d_rot3/d3d_rot3.yy",},
{"name":"sh_sample_points","order":26,"path":"shaders/sh_sample_points/sh_sample_points.yy",},
{"name":"sh_sample_points","order":9,"path":"shaders/sh_sample_points/sh_sample_points.yy",},
{"name":"sh_draw_flare_star","order":14,"path":"shaders/sh_draw_flare_star/sh_draw_flare_star.yy",},
{"name":"node_voronoi_extra","order":24,"path":"scripts/node_voronoi_extra/node_voronoi_extra.yy",},
{"name":"node_combine_rgb","order":1,"path":"scripts/node_combine_rgb/node_combine_rgb.yy",},
@ -764,7 +767,7 @@
{"name":"preview_overlay_rotation","order":1,"path":"scripts/preview_overlay_rotation/preview_overlay_rotation.yy",},
{"name":"node_array_find","order":1,"path":"scripts/node_array_find/node_array_find.yy",},
{"name":"node_registry","order":11,"path":"scripts/node_registry/node_registry.yy",},
{"name":"sh_checkerboard","order":12,"path":"shaders/sh_checkerboard/sh_checkerboard.yy",},
{"name":"sh_checkerboard","order":3,"path":"shaders/sh_checkerboard/sh_checkerboard.yy",},
{"name":"node_unicode","order":1,"path":"scripts/node_unicode/node_unicode.yy",},
{"name":"draw_setter","order":1,"path":"scripts/draw_setter/draw_setter.yy",},
{"name":"node_pb_draw","order":1,"path":"scripts/node_pb_draw/node_pb_draw.yy",},
@ -961,7 +964,7 @@
{"name":"node_path_builder","order":9,"path":"scripts/node_path_builder/node_path_builder.yy",},
{"name":"o_dialog_gradient","order":1,"path":"objects/o_dialog_gradient/o_dialog_gradient.yy",},
{"name":"sh_channel_R_grey","order":7,"path":"shaders/sh_channel_R_grey/sh_channel_R_grey.yy",},
{"name":"s_node_diffuse","order":63,"path":"sprites/s_node_diffuse/s_node_diffuse.yy",},
{"name":"s_node_diffuse","order":41,"path":"sprites/s_node_diffuse/s_node_diffuse.yy",},
{"name":"node_array_sample","order":18,"path":"scripts/node_array_sample/node_array_sample.yy",},
{"name":"sh_blend_subtract","order":5,"path":"shaders/sh_blend_subtract/sh_blend_subtract.yy",},
{"name":"BBMOD_Vec4","order":6,"path":"scripts/BBMOD_Vec4/BBMOD_Vec4.yy",},
@ -976,7 +979,7 @@
{"name":"d3d_gizmo_plane","order":5,"path":"scripts/d3d_gizmo_plane/d3d_gizmo_plane.yy",},
{"name":"node_surface_replace","order":11,"path":"scripts/node_surface_replace/node_surface_replace.yy",},
{"name":"node_strand_create","order":1,"path":"scripts/node_strand_create/node_strand_create.yy",},
{"name":"sh_gradient","order":17,"path":"shaders/sh_gradient/sh_gradient.yy",},
{"name":"sh_gradient","order":6,"path":"shaders/sh_gradient/sh_gradient.yy",},
{"name":"sh_region_fill_init","order":2,"path":"shaders/sh_region_fill_init/sh_region_fill_init.yy",},
{"name":"node_json_file_read","order":7,"path":"scripts/node_json_file_read/node_json_file_read.yy",},
{"name":"s_node_array_remove","order":7,"path":"sprites/s_node_array_remove/s_node_array_remove.yy",},
@ -1036,7 +1039,6 @@
{"name":"s_node_palette_shift","order":58,"path":"sprites/s_node_palette_shift/s_node_palette_shift.yy",},
{"name":"__strandSim","order":2,"path":"scripts/__strandSim/__strandSim.yy",},
{"name":"s_node_random_tile","order":40,"path":"sprites/s_node_random_tile/s_node_random_tile.yy",},
{"name":"sh_shape","order":3,"path":"shaders/sh_shape/sh_shape.yy",},
{"name":"draw_line_width2","order":2,"path":"scripts/draw_line_width2/draw_line_width2.yy",},
{"name":"matrixGrid","order":6,"path":"scripts/matrixGrid/matrixGrid.yy",},
{"name":"node_VFX_override","order":7,"path":"scripts/node_VFX_override/node_VFX_override.yy",},
@ -1222,7 +1224,7 @@
{"name":"node_polar","order":4,"path":"scripts/node_polar/node_polar.yy",},
{"name":"s_node_twirl","order":41,"path":"sprites/s_node_twirl/s_node_twirl.yy",},
{"name":"s_node_perlin_extra","order":31,"path":"sprites/s_node_perlin_extra/s_node_perlin_extra.yy",},
{"name":"sh_2d_light","order":28,"path":"shaders/sh_2d_light/sh_2d_light.yy",},
{"name":"sh_2d_light","order":10,"path":"shaders/sh_2d_light/sh_2d_light.yy",},
{"name":"node_image_animated","order":2,"path":"scripts/node_image_animated/node_image_animated.yy",},
{"name":"s_node_transform_array","order":17,"path":"sprites/s_node_transform_array/s_node_transform_array.yy",},
{"name":"node_palette_extract","order":7,"path":"scripts/node_palette_extract/node_palette_extract.yy",},
@ -1320,6 +1322,7 @@
{"name":"sh_perlin_extra","order":9,"path":"shaders/sh_perlin_extra/sh_perlin_extra.yy",},
{"name":"node_text","order":4,"path":"scripts/node_text/node_text.yy",},
{"name":"panel_collection","order":3,"path":"scripts/panel_collection/panel_collection.yy",},
{"name":"node_delay","order":5,"path":"scripts/node_delay/node_delay.yy",},
{"name":"node_string_trim","order":4,"path":"scripts/node_string_trim/node_string_trim.yy",},
{"name":"node_mk_rain","order":1,"path":"scripts/node_mk_rain/node_mk_rain.yy",},
{"name":"Obj_FirebaseFirestore_Collection_Query_OrderBy","order":13,"path":"objects/Obj_FirebaseFirestore_Collection_Query_OrderBy/Obj_FirebaseFirestore_Collection_Query_OrderBy.yy",},
@ -1513,7 +1516,7 @@
{"name":"Obj_FirebaseFirestore_Collection_Query_options","order":10,"path":"objects/Obj_FirebaseFirestore_Collection_Query_options/Obj_FirebaseFirestore_Collection_Query_options.yy",},
{"name":"stack_functions","order":7,"path":"scripts/stack_functions/stack_functions.yy",},
{"name":"panel_nodes","order":2,"path":"scripts/panel_nodes/panel_nodes.yy",},
{"name":"sh_gradient_points","order":19,"path":"shaders/sh_gradient_points/sh_gradient_points.yy",},
{"name":"sh_gradient_points","order":8,"path":"shaders/sh_gradient_points/sh_gradient_points.yy",},
{"name":"node_array_composite","order":17,"path":"scripts/node_array_composite/node_array_composite.yy",},
{"name":"sh_blink_expand","order":2,"path":"shaders/sh_blink_expand/sh_blink_expand.yy",},
{"name":"s_node_vfx_turb","order":5,"path":"sprites/s_node_vfx_turb/s_node_vfx_turb.yy",},
@ -1549,7 +1552,7 @@
{"name":"pack_shelf","order":1,"path":"scripts/pack_shelf/pack_shelf.yy",},
{"name":"s_node_path_trim","order":6,"path":"sprites/s_node_path_trim/s_node_path_trim.yy",},
{"name":"node_channels_hsv","order":1,"path":"scripts/node_channels_hsv/node_channels_hsv.yy",},
{"name":"sh_stripe","order":10,"path":"shaders/sh_stripe/sh_stripe.yy",},
{"name":"sh_stripe","order":1,"path":"shaders/sh_stripe/sh_stripe.yy",},
{"name":"s_node_shard","order":33,"path":"sprites/s_node_shard/s_node_shard.yy",},
{"name":"node_path_trim","order":6,"path":"scripts/node_path_trim/node_path_trim.yy",},
{"name":"s_node_rigidSim_deactivate","order":7,"path":"sprites/s_node_rigidSim_deactivate/s_node_rigidSim_deactivate.yy",},
@ -1843,7 +1846,7 @@
{"name":"s_node_iterator_index","order":8,"path":"sprites/s_node_iterator_index/s_node_iterator_index.yy",},
{"name":"preferences","order":5,"path":"scripts/preferences/preferences.yy",},
{"name":"sh_fd_replace_material_advanced_glsl","order":11,"path":"shaders/sh_fd_replace_material_advanced_glsl/sh_fd_replace_material_advanced_glsl.yy",},
{"name":"sh_solid","order":15,"path":"shaders/sh_solid/sh_solid.yy",},
{"name":"sh_solid","order":5,"path":"shaders/sh_solid/sh_solid.yy",},
{"name":"panel_animation_scaler","order":1,"path":"scripts/panel_animation_scaler/panel_animation_scaler.yy",},
{"name":"wav_file_object","order":2,"path":"scripts/wav_file_object/wav_file_object.yy",},
{"name":"s_node_json_file_write","order":10,"path":"sprites/s_node_json_file_write/s_node_json_file_write.yy",},

View file

@ -296,6 +296,7 @@
{"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":"vector mapper","folderPath":"folders/shader/generator/vector mapper.yy",},
],
"IncludedFiles": [
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},
@ -466,6 +467,7 @@
{"id":{"name":"panel_preview_window","path":"scripts/panel_preview_window/panel_preview_window.yy",},},
{"id":{"name":"node_PCX_equation","path":"scripts/node_PCX_equation/node_PCX_equation.yy",},},
{"id":{"name":"sh_scale3x","path":"shaders/sh_scale3x/sh_scale3x.yy",},},
{"id":{"name":"sh_active_canvas_ink","path":"shaders/sh_active_canvas_ink/sh_active_canvas_ink.yy",},},
{"id":{"name":"__node_3d","path":"scripts/__node_3d/__node_3d.yy",},},
{"id":{"name":"node_csv_file_write","path":"scripts/node_csv_file_write/node_csv_file_write.yy",},},
{"id":{"name":"surface_functions","path":"scripts/surface_functions/surface_functions.yy",},},
@ -616,6 +618,7 @@
{"id":{"name":"node_PCX_fn_var","path":"scripts/node_PCX_fn_var/node_PCX_fn_var.yy",},},
{"id":{"name":"s_node_vfx_render","path":"sprites/s_node_vfx_render/s_node_vfx_render.yy",},},
{"id":{"name":"node_stack","path":"scripts/node_stack/node_stack.yy",},},
{"id":{"name":"sh_vector_diverge","path":"shaders/sh_vector_diverge/sh_vector_diverge.yy",},},
{"id":{"name":"sh_cell_noise","path":"shaders/sh_cell_noise/sh_cell_noise.yy",},},
{"id":{"name":"sh_draw_r32","path":"shaders/sh_draw_r32/sh_draw_r32.yy",},},
{"id":{"name":"s_node_rigidSim_object","path":"sprites/s_node_rigidSim_object/s_node_rigidSim_object.yy",},},
@ -889,6 +892,7 @@
{"id":{"name":"node_lua_surface","path":"scripts/node_lua_surface/node_lua_surface.yy",},},
{"id":{"name":"sh_blur_directional","path":"shaders/sh_blur_directional/sh_blur_directional.yy",},},
{"id":{"name":"panel_tunnels","path":"scripts/panel_tunnels/panel_tunnels.yy",},},
{"id":{"name":"s_node_delay","path":"sprites/s_node_delay/s_node_delay.yy",},},
{"id":{"name":"node_processor","path":"scripts/node_processor/node_processor.yy",},},
{"id":{"name":"animation_controller","path":"scripts/animation_controller/animation_controller.yy",},},
{"id":{"name":"Obj_FirebaseFirestore_Document_Delete","path":"objects/Obj_FirebaseFirestore_Document_Delete/Obj_FirebaseFirestore_Document_Delete.yy",},},
@ -1652,6 +1656,7 @@
{"id":{"name":"node_text","path":"scripts/node_text/node_text.yy",},},
{"id":{"name":"panel_collection","path":"scripts/panel_collection/panel_collection.yy",},},
{"id":{"name":"contextMenu_controller","path":"scripts/contextMenu_controller/contextMenu_controller.yy",},},
{"id":{"name":"node_delay","path":"scripts/node_delay/node_delay.yy",},},
{"id":{"name":"node_string_trim","path":"scripts/node_string_trim/node_string_trim.yy",},},
{"id":{"name":"node_mk_rain","path":"scripts/node_mk_rain/node_mk_rain.yy",},},
{"id":{"name":"Obj_FirebaseFirestore_Collection_Query_OrderBy","path":"objects/Obj_FirebaseFirestore_Collection_Query_OrderBy/Obj_FirebaseFirestore_Collection_Query_OrderBy.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

@ -1,11 +1,11 @@
function buffer_get_color(buffer, _x, _y, w, h) {
function buffer_get_color(buffer, _x, _y, w, h) { #region
buffer_seek(buffer, buffer_seek_start, (w * _y + _x) * 4);
var c = buffer_read(buffer, buffer_u32);
return c;
}
} #endregion
function buffer_get_string(buffer, text = true, limit = 400) {
function buffer_get_string(buffer, text = true, limit = 400) { #region
buffer_seek(buffer, buffer_seek_start, 0);
var len = min(limit, buffer_get_size(buffer));
var ss = "";
@ -18,16 +18,16 @@ function buffer_get_string(buffer, text = true, limit = 400) {
}
return ss;
}
} #endregion
function buffer_from_string(str) {
function buffer_from_string(str) { #region
var _b = buffer_create(string_length(str) * 1, buffer_fast, 1);
for( var i = 1; i <= string_length(str); i++ )
buffer_write(_b, buffer_u8, ord(string_char_at(str, i)));
return _b;
}
} #endregion
function buffer_from_surface(surface, header = true) {
function buffer_from_surface(surface, header = true) { #region
static header_length = 24;
if(!is_surface(surface)) return noone;
@ -38,20 +38,41 @@ function buffer_from_surface(surface, header = true) {
buffer_write(_b, buffer_text, "PXCS");
buffer_write(_b, buffer_u16, surface_get_width_safe(surface));
buffer_write(_b, buffer_u16, surface_get_height_safe(surface));
buffer_write(_b, buffer_u8, surface_get_format(surface));
buffer_write(_b, buffer_u8, surface_get_format(surface));
}
buffer_get_surface(_b, surface, header_length * header);
return _b;
}
} #endregion
function buffer_from_file(path) {
function buffer_from_file(path) { #region
if(!file_exists_empty(path)) return;
var _b = buffer_load(path);
return _b;
}
} #endregion
function buffer_read_at(buffer, position, type) {
function buffer_read_at(buffer, position, type) { #region
buffer_seek(buffer, buffer_seek_start, position);
return buffer_read(buffer, type);
}
} #endregion
function buffer_serialize(buffer, compress = true) { #region
INLINE
if(!buffer_exists(buffer)) return "";
if(compress) {
var comp = buffer_compress(buffer, 0, buffer_get_size(buffer));
return buffer_base64_encode(comp, 0, buffer_get_size(comp));
}
return buffer_base64_encode(buffer, 0, buffer_get_size(buffer));
} #endregion
function buffer_deserialize(buffer, compress = true) { #region
INLINE
var buff = buffer_base64_decode(buffer);
if(!compress) return buff;
return buffer_decompress(buff);
} #endregion

View file

@ -35,9 +35,11 @@ function Node_Active_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) const
brush_prev = noone;
brush_next_dist = 0;
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
temp_surface = [ surface_create(1, 1) ];
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
}
} #endregion
static step = function() { #region
@ -65,58 +67,71 @@ function Node_Active_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) const
var _bact = getInputData(7);
var _bdst = getInputData(8);
_surf = surface_verify(_surf, _dim[0], _dim[1]);
_surf = surface_verify(_surf, _dim[0], _dim[1]);
temp_surface[0] = surface_verify(temp_surface[0], _dim[0], _dim[1]);
var _bdense = _bdst[0] == _bdst[1] && _bdst[0] == 1;
outputs[| 0].setValue(_surf);
if(!_bact) return;
surface_set_target(temp_surface[0]);
DRAW_CLEAR
BLEND_OVERRIDE
if(!IS_FIRST_FRAME)
draw_surface_ext(_surf, 0, 0, 1, 1, 0, c_white, 1);
BLEND_NORMAL
surface_reset_target();
surface_set_target(_surf);
if(IS_FIRST_FRAME) DRAW_CLEAR
DRAW_CLEAR
if(_bact) {
if(!is_surface(_bsurf)) {
if(IS_FIRST_FRAME || brush_prev == noone)
draw_point_color(_bpos[0] - 1, _bpos[1] - 1, _bcol);
else
draw_line_color(brush_prev[2][0] - 1, brush_prev[2][1] - 1, _bpos[0] - 1, _bpos[1] - 1, brush_prev[5], _bcol);
} else {
BLEND_ALPHA
draw_surface(temp_surface[0], 0, 0);
if(!is_surface(_bsurf)) {
if(IS_FIRST_FRAME || brush_prev == noone)
draw_point_color(_bpos[0] - 1, _bpos[1] - 1, _bcol);
else
draw_line_color(brush_prev[2][0] - 1, brush_prev[2][1] - 1, _bpos[0] - 1, _bpos[1] - 1, brush_prev[5], _bcol);
} else {
BLEND_ALPHA
if(IS_FIRST_FRAME || brush_prev == noone) {
brush_draw_surface(_bsurf, _bpos[0], _bpos[1], _bsca[0], _bsca[1], _brot, _bcol, _balp);
} else {
var _x0 = brush_prev[2][0];
var _y0 = brush_prev[2][1];
var diss = point_distance(_x0, _y0, _bpos[0], _bpos[1]);
var dirr = point_direction(_x0, _y0, _bpos[0], _bpos[1]);
if(IS_FIRST_FRAME || brush_prev == noone) {
brush_draw_surface(_bsurf, _bpos[0], _bpos[1], _bsca[0], _bsca[1], _brot, _bcol, _balp);
} else {
var _x0 = brush_prev[2][0];
var _y0 = brush_prev[2][1];
var diss = point_distance(_x0, _y0, _bpos[0], _bpos[1]);
var dirr = point_direction(_x0, _y0, _bpos[0], _bpos[1]);
var st_x = lengthdir_x(1, dirr);
var st_y = lengthdir_y(1, dirr);
var st_x = lengthdir_x(1, dirr);
var st_y = lengthdir_y(1, dirr);
var _draw = !brush_prev[7];
var _i = _draw? 0 : brush_next_dist;
var _dst = diss;
if(_i < diss) {
while(_i < diss) {
var _px = _x0 + st_x * _i;
var _py = _y0 + st_y * _i;
var _draw = !brush_prev[7];
var _i = _draw? 0 : brush_next_dist;
var _dst = diss;
if(_i < diss) {
while(_i < diss) {
var _px = _x0 + st_x * _i;
var _py = _y0 + st_y * _i;
brush_draw_surface(_bsurf, _px, _py, _bsca[0], _bsca[1], _brot, _bcol, _balp);
brush_draw_surface(_bsurf, _px, _py, _bsca[0], _bsca[1], _brot, _bcol, _balp);
brush_next_dist = random_range(_bdst[0], _bdst[1]);
_i += brush_next_dist;
_dst -= brush_next_dist;
}
brush_next_dist = random_range(_bdst[0], _bdst[1]);
_i += brush_next_dist;
_dst -= brush_next_dist;
}
brush_next_dist -= _dst;
} else
brush_next_dist -= diss;
brush_next_dist -= _dst;
} else
brush_next_dist -= diss;
if(_bdense) brush_draw_surface(_bsurf, _bpos[0], _bpos[1], _bsca[0], _bsca[1], _brot, _bcol, _balp);
}
BLEND_NORMAL
if(_bdense) brush_draw_surface(_bsurf, _bpos[0], _bpos[1], _bsca[0], _bsca[1], _brot, _bcol, _balp);
}
BLEND_NORMAL
}
surface_reset_target();

View file

@ -395,7 +395,9 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
if(!is_surface(_canvas_surface)) {
setCanvasSurface(surface_create_from_buffer(_dim[0], _dim[1], canvas_buffer[index]));
} else if(surface_get_width_safe(_canvas_surface) != _dim[0] || surface_get_height_safe(_canvas_surface) != _dim[1]) {
buffer_delete(canvas_buffer[index]);
var _cbuff = array_safe_get(canvas_buffer, index);
if(buffer_exists(_cbuff)) buffer_delete(_cbuff);
canvas_buffer[index] = buffer_create(_dim[0] * _dim[1] * 4, buffer_fixed, 4);
setCanvasSurface(surface_size_to(_canvas_surface, _dim[0], _dim[1]), index);
}
@ -478,14 +480,15 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
} #endregion
function draw_line_size(_x0, _y0, _x1, _y1, _draw = false) { #region
if(_x1 > _x0) _x0--;
if(_y1 > _y0) _y0--;
if(_y1 < _y0) _y1--;
if(_x1 < _x0) _x1--;
if(brush_size == 1 && brush_surface == noone)
if(brush_size == 1 && brush_surface == noone) {
if(_x1 > _x0) _x0--;
if(_y1 > _y0) _y0--;
if(_y1 < _y0) _y1--;
if(_x1 < _x0) _x1--;
draw_line(_x0, _y0, _x1, _y1);
else {
} else {
var diss = point_distance(_x0, _y0, _x1, _y1);
var dirr = point_direction(_x0, _y0, _x1, _y1);
var st_x = lengthdir_x(1, dirr);
@ -498,9 +501,9 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
while(_i < diss) {
var _px = _x0 + st_x * _i;
var _py = _y0 + st_y * _i;
draw_point_size(_px, _py, _draw);
brush_next_dist = random_range(brush_dist_min, brush_dist_max);
_i += brush_next_dist;
_dst -= brush_next_dist;
@ -955,7 +958,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
if(brush_sizing) {
var s = brush_sizing_s + (_mx - brush_sizing_mx) / 16;
s = max(1, s);
inputs[| 2].setValue(s);
tool_attribute.size = s;
if(mouse_release(mb_right))
brush_sizing = false;

View file

@ -168,6 +168,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
["Auto update", function() { return attributes.update_graph; }, new checkBox(function() { attributes.update_graph = !attributes.update_graph; }) ],
["Update trigger", function() { return attributes.show_update_trigger; }, new checkBox(function() { attributes.show_update_trigger = !attributes.show_update_trigger; }) ],
];
bufferStore = {};
#endregion
#region ---- preview ----
@ -1746,7 +1748,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
static drawTools = function(_mx, _my, xx, yy, tool_size, hover, focus) { return 0; }
static serialize = function(scale = false, preset = false) { #region
static serialize = function(scale = false, preset = false) { #region >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> SERIALIZE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
if(!active) return;
var _map = {};
@ -1791,6 +1793,13 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
_map.inspectInputs = _trigger;
_map.renamed = renamed;
_map.buffer = {};
var _bufferKey = struct_key(bufferStore);
for( var i = 0, n = array_length(_bufferKey); i < n; i++ ) {
var _key = _bufferKey[i];
_map.buffer[$ _key] = buffer_serialize(bufferStore[$ _key]);
}
doSerialize(_map);
processSerialize(_map);
return _map;
@ -1802,7 +1811,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
load_scale = false;
load_map = -1;
static deserialize = function(_map, scale = false, preset = false) { #region
static deserialize = function(_map, scale = false, preset = false) { #region >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DESERIALIZE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
load_map = _map;
load_scale = scale;
renamed = struct_try_get(load_map, "renamed", false);
@ -1834,6 +1843,16 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x
if(struct_has(load_map, "attri"))
attributeDeserialize(load_map.attri);
if(struct_has(load_map, "buffer")) {
var _bufferKey = struct_key(bufferStore);
for( var i = 0, n = array_length(_bufferKey); i < n; i++ ) {
var _key = _bufferKey[i];
if(!struct_has(bufferStore, _key)) continue;
bufferStore[$ _key] = buffer_deserialize(load_map.buffer[$ _key]);
}
}
if(is_dynamic_input) {
inputBalance();
inputGenerate();

View file

@ -0,0 +1,53 @@
function Node_Delay(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
name = "Delay";
inputs[| 0] = nodeValue("Surface", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
inputs[| 1] = nodeValue("Frames", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1);
outputs[| 0] = nodeValue("Surface", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [ 0,
["Delay", false], 1,
];
surf_indexes = [];
static processData_prebatch = function() {
surf_indexes = array_verify(surf_indexes, process_amount);
for( var i = 0; i < process_amount; i++ )
surf_indexes[i] = array_verify(surf_indexes[i], TOTAL_FRAMES);
}
static processData = function(_output, _data, _output_index, _array_index = 0) {
var _surf = _data[0];
var _frme = _data[1];
var _time = CURRENT_FRAME;
var _frtm = clamp(_time - _frme, 0, TOTAL_FRAMES - 1);
var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height_safe(_surf);
surf_indexes[_array_index][_time] = surface_verify(surf_indexes[_array_index][_time], _sw, _sh);
surface_set_target(surf_indexes[_array_index][_time]);
DRAW_CLEAR
draw_surface_safe(_surf);
surface_reset_target();
_output = surface_verify(_output, _sw, _sh);
surface_set_target(_output);
DRAW_CLEAR
if(0 <= _frtm && _frtm < TOTAL_FRAMES) {
draw_surface_safe(surf_indexes[_array_index][_frtm]);
surface_free(surf_indexes[_array_index][_frtm]);
surf_indexes[_array_index][_frtm] = 0;
}
surface_reset_target();
return _output;
}
}

View file

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

View file

@ -30,11 +30,21 @@ function Node_Diffuse(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
input_display_list = [ 0, 6,
["Diffuse", false], 1,
["Flow", false], 2, 9, 3, 4,
["Forces", false], 7, 8,
["Forces", false], 8,
["Rendering", false], 5,
]
temp_surface = [ surface_create(1, 1), surface_create(1, 1) ];
temp_surface = [ surface_create(1, 1), surface_create(1, 1), surface_create(1, 1) ];
bufferStore.velocity = buffer_create(1, buffer_grow, 4);
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
var _surf = getInputData(0);
var _sw = surface_get_width_safe(_surf);
var _sh = surface_get_height_safe(_surf);
if(!surface_valid(temp_surface[2], _sw, _sh)) return;
} #endregion
static update = function() {
var _surf = getInputData(0);
@ -44,7 +54,6 @@ function Node_Diffuse(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
var _flow = getInputData(4);
var _thre = getInputData(5);
var _seed = getInputData(6);
var _forc = getInputData(7);
var _fstr = getInputData(8);
var _detl = getInputData(9);
if(!is_surface(_surf)) return;
@ -64,6 +73,22 @@ function Node_Diffuse(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
draw_surface_safe(_surf);
surface_reset_shader();
#region velocity
temp_surface[2] = surface_from_buffer(bufferStore.velocity);
if(!surface_valid(temp_surface[2], _sw, _sh, surface_rgba16float)) {
surface_free(temp_surface[2]);
temp_surface[2] = surface_create(_sw, _sh, surface_rgba16float);
surface_clear(temp_surface[2]);
bufferStore.velocity = buffer_from_surface(temp_surface[2]);
}
surface_set_shader(temp_surface[2], sh_vector_diverge,, BLEND.add);
draw_sprite_stretched(s_fx_pixel, 0, 0, 0, _sw, _sh);
surface_reset_shader();
#endregion
surface_set_shader(temp_surface[1], sh_diffuse_flow);
shader_set_f("dimension", _sw, _sh);
shader_set_f("scale", _scal);
@ -71,9 +96,9 @@ function Node_Diffuse(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
shader_set_f("flowRate", _flow);
shader_set_f("seed", _seed + CURRENT_FRAME / _rand);
shader_set_i("useExternal", is_surface(_forc));
shader_set_i("useExternal", is_surface(temp_surface[2]));
shader_set_f("externalStrength", _fstr);
shader_set_surface("externalForce", _forc);
shader_set_surface("externalForce", temp_surface[2]);
draw_surface_safe(temp_surface[0]);
surface_reset_shader();

View file

@ -44,21 +44,29 @@ function Node_Gradient(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
//////////////////////////////////////////////////////////////////////////////////////////////////
inputs[| 14] = nodeValue("Uniform ratio", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
input_display_list = [
["Output", true], 0, 8,
["Gradient", false], 1, 5, 12, 9, 13, 7,
["Shape", false], 2, 3, 10, 4, 11, 6,
["Shape", false], 2, 3, 10, 4, 11, 6, 14,
];
attribute_surface_depth();
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
inputs[| 6].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
}
} #endregion
static step = function() { #region
var _typ = getInputData(2);
inputs[| 3].setVisible(_typ != 1);
inputs[| 4].setVisible(_typ == 1);
inputs[| 14].setVisible(_typ == 1);
inputs[| 3].mappableStep();
inputs[| 4].mappableStep();
inputs[| 5].mappableStep();
@ -72,23 +80,19 @@ function Node_Gradient(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
var _cnt = _data[6];
var _lop = _data[7];
var _msk = _data[8];
var _uni = _data[14];
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
if(_typ == 0 || _typ == 2) {
inputs[| 3].setVisible(true);
inputs[| 4].setVisible(false);
} else if(_typ == 1) {
inputs[| 3].setVisible(false);
inputs[| 4].setVisible(true);
}
surface_set_shader(_outSurf, sh_gradient);
_gra.shader_submit();
shader_set_f("dimension", _dim);
shader_set_i("gradient_loop", _lop);
shader_set_f("center", _cnt[0] / _dim[0], _cnt[1] / _dim[1]);
shader_set_i("type", _typ);
shader_set_i("uniAsp", _uni);
shader_set_f_map("angle", _data[3], _data[10], inputs[| 3]);
shader_set_f_map("radius", _data[4], _data[11], inputs[| 4]);

View file

@ -12,7 +12,7 @@ function Node_Mirror(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
inputs[| 3] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
active_index = 3;
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
outputs[| 1] = nodeValue("Mirror mask", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
@ -24,7 +24,7 @@ function Node_Mirror(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
attribute_surface_depth();
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
var _pos = getInputData(1);
var _ang = getInputData(2);
var _posx = _pos[0] * _s + _x;
@ -40,32 +40,23 @@ function Node_Mirror(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
inputs[| 2].drawOverlay(active, _posx, _posy, _s, _mx, _my, _snx, _sny);
}
} #endregion
static processData = function(_outSurf, _data, _output_index, _array_index) {
var _dim = [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ];
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
var _suf = _data[0];
var _pos = _data[1];
var _ang = _data[2];
surface_set_target(_outSurf);
DRAW_CLEAR
BLEND_OVERRIDE;
var _dim = surface_get_dimension(_suf);
surface_set_shader(_outSurf, _output_index? sh_mirror_mask : sh_mirror);
shader_set_f("dimension", _dim);
shader_set_f("position", _pos);
shader_set_f("angle", degtorad(_ang));
shader = _output_index? sh_mirror_mask : sh_mirror;
uniform_dim = shader_get_uniform(shader, "dimension");
uniform_pos = shader_get_uniform(shader, "position");
uniform_ang = shader_get_uniform(shader, "angle");
shader_set(shader);
shader_set_uniform_f_array_safe(uniform_dim, _dim);
shader_set_uniform_f_array_safe(uniform_pos, _pos);
shader_set_uniform_f(uniform_ang, degtorad(_ang));
draw_surface_safe(_data[0], 0, 0);
shader_reset();
BLEND_NORMAL;
surface_reset_target();
draw_surface_safe(_suf);
surface_reset_shader();
return _outSurf;
}
} #endregion
}

View file

@ -855,6 +855,7 @@ function __initNodes() {
addNodeObject(animation, "Wiggler", s_node_wiggler, "Node_Wiggler", [1, Node_Wiggler],, "Create smooth random value.");
addNodeObject(animation, "Evaluate Curve", s_node_curve_eval, "Node_Anim_Curve", [1, Node_Anim_Curve],, "Evaluate value from an animation curve.");
addNodeObject(animation, "Rate Remap", s_node_rate_remap, "Node_Rate_Remap", [1, Node_Rate_Remap],, "Remap animation to a new framerate.").setVersion(1147);
addNodeObject(animation, "Delay", s_node_delay, "Node_Delay", [1, Node_Delay]).setVersion(11640);
addNodeObject(animation, "Stagger", s_node_stagger, "Node_Stagger", [1, Node_Stagger]).setVersion(11640);
ds_list_add(animation, "Audio");

View file

@ -298,27 +298,29 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
if(!_node) return;
var _outp = -1;
var surf = -1;
var surf = -1;
for( var i = 0; i < ds_list_size(_node.outputs); i++ ) {
if(_node.outputs[| i].type == VALUE_TYPE.surface) {
_outp = _node.outputs[| i];
var _val = _node.outputs[| i].getValue();
if(is_array(_val))
surf = _val[_node.preview_index];
else
surf = _val;
break;
}
if(_node.outputs[| i].type != VALUE_TYPE.surface) continue;
_outp = _node.outputs[| i];
surf = _outp.getValue();
break;
}
if(_outp == -1) return;
if(!is_array(surf)) surf = [ surf ];
var _canvas = nodeBuild("Node_Canvas", _node.x + _node.w + 64, _node.y);
_canvas.inputs[| 0].setValue([surface_get_width_safe(surf), surface_get_height_safe(surf)]);
_canvas.canvas_surface = surface_clone(surf);
_canvas.apply_surface();
var _dim = surface_get_dimension(surf[0]);
_canvas.attributes.dimension = _dim;
_canvas.attributes.frames = array_length(surf);
_canvas.canvas_surface = surface_array_clone(surf);
_canvas.inputs[| 0].setValue(_dim);
_canvas.apply_surfaces();
} #endregion
function setTriggerPreview() { #region
@ -376,7 +378,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
var pan = panelAdd("Panel_Inspector", true);
pan.destroy_on_click_out = false;
pan.content.setInspecting(node_hover);
pan.content.locked = true;
pan.content.locked = true;
});
menu_send_export = menuItem(__txtx("panel_graph_send_to_export", "Send to export"), function() { setCurrentExport(node_hover); }, noone, ["Graph", "Export"]);
menu_toggle_preview = menuItem(__txtx("panel_graph_toggle_preview", "Toggle node preview"), function() { setTriggerPreview(); }, noone, ["Graph", "Toggle preview"]);

View file

@ -1,4 +1,5 @@
#macro struct_has variable_struct_exists
#macro struct_key variable_struct_get_names
function struct_override(original, override) {
var args = variable_struct_get_names(override);

View file

@ -223,6 +223,17 @@ function surface_verify(surf, w, h, format = surface_rgba8unorm) { #region
return surface_size_to(surf, w, h, format, true);
} #endregion
function surface_valid(surf, w, h, format = surface_rgba8unorm) { #region
INLINE
if(!is_surface(surf)) return false;
var _sw = surface_get_width(surf);
var _sh = surface_get_height(surf);
var _f = surface_get_format(surf);
return _sw == w && _sh == h && _f == format;
} #endregion
//get
function surface_get_pixel(surface, _x, _y) { #region
INLINE
@ -293,7 +304,9 @@ function surface_create_from_buffer(w, h, buff, format = surface_rgba8unorm) { #
function surface_from_buffer(buff) { #region
static header_length = 24;
if(!buffer_exists(buff)) return noone;
if(!buffer_exists(buff)) return noone;
if(buffer_get_size(buff) < header_length) return noone;
buffer_seek(buff, buffer_seek_start, 0);
var text = "";
@ -303,7 +316,6 @@ function surface_from_buffer(buff) { #region
var w = buffer_read(buff, buffer_u16);
var h = buffer_read(buff, buffer_u16);
var format = buffer_read(buff, buffer_u8);
//print($"Creating surface from buffer {buff}: size {buffer_get_size(buff) - 4}: w = {w}, h = {h}");
if(w < 1 || h < 1) return noone;
var s = surface_create(w, h, format);

View file

@ -0,0 +1,26 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec2 dimension;
void main() {
vec2 tx = 1. / dimension;
vec4 f0 = texture2D( gm_BaseTexture, v_vTexcoord + vec2(-tx.x, -tx.y) );
vec4 f1 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( 0., -tx.y) );
vec4 f2 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( tx.x, -tx.y) );
vec4 f3 = texture2D( gm_BaseTexture, v_vTexcoord + vec2(-tx.x, 0.) );
vec4 f4 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( 0., 0.) );
vec4 f5 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( tx.x, 0.) );
vec4 f6 = texture2D( gm_BaseTexture, v_vTexcoord + vec2(-tx.x, tx.y) );
vec4 f7 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( 0., tx.y) );
vec4 f8 = texture2D( gm_BaseTexture, v_vTexcoord + vec2( tx.x, tx.y) );
vec4 clr = (f0 + f1 + f2 + f3 + f4 + f5 + f6 + f7 + f8) / 9.;
clr *= 1.8;
clr.a = (clr.r + clr.g + clr.b) / 3.;
gl_FragColor = clr;
}

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

View file

@ -127,7 +127,7 @@ void main() {
vec2 flow = vec2(x1 - x0, y1 - y0);
if(useExternal == 1) {
vec4 _forc = texture2D( externalForce, v_vTexcoord );
flow -= (_forc.xy - 0.5) * 2. * externalStrength;
flow -= _forc.xy * externalStrength;
}
gl_FragColor = texture2D( gm_BaseTexture, v_vTexcoord - flow * flowRate );

View file

@ -7,6 +7,7 @@ varying vec4 v_vColour;
#define TAU 6.283185307179586
uniform vec2 center;
uniform vec2 dimension;
uniform vec2 angle;
uniform int angleUseSurf;
@ -26,6 +27,7 @@ uniform sampler2D scaleSurf;
uniform int type;
uniform int gradient_loop;
uniform int uniAsp;
float sca;
@ -142,12 +144,18 @@ void main() {
float prog = 0.;
if(type == 0) {
prog = .5 + (v_vTexcoord.x - center.x) * cos(ang) - (v_vTexcoord.y - center.y) * sin(ang);
} else if(type == 1) {
prog = distance(v_vTexcoord, center) / rad;
vec2 asp = dimension / dimension.y;
if(uniAsp == 0) prog = distance(v_vTexcoord, center) / rad;
else prog = distance(v_vTexcoord * asp, center * asp) / rad;
} else if(type == 2) {
vec2 _p = v_vTexcoord - center;
float _a = atan(_p.y, _p.x) + ang;
prog = (_a - floor(_a / TAU) * TAU) / TAU;
}
prog += shf;

View file

@ -5,39 +5,32 @@ varying vec4 v_vColour;
#define pi1 3.14159
#define pi2 1.57079
uniform vec2 dimension;
uniform vec2 position;
uniform vec2 dimension;
uniform vec2 position;
uniform float angle;
float angle_different(in float a1, in float a2) {
float angle_different(in float a1, in float a2) { #region
float _d = (a2 - a1) + pi2;
return (_d - floor(_d / pi1) * pi1) - pi2;
}
} #endregion
void main() {
vec2 pos = v_vTexcoord;
vec2 pixel_pos = v_vTexcoord * dimension;
vec2 pos = v_vTexcoord;
vec2 pixel_pos = v_vTexcoord * dimension;
float _angle;
_angle = atan((pixel_pos.y - position.y), (pixel_pos.x - position.x)) + angle;
_angle = TAU - (_angle - floor(_angle / TAU) * TAU);
//gl_FragColor = vec4(vec3(_angle / TAU), 1.);
if(_angle < pi1) {
float _alpha = (angle + pi1) - (_angle + angle);
float _alpha = (angle + pi1) - (_angle + angle);
float inv_angle = (angle + pi1) + _alpha;
float dist = distance(pixel_pos, position);
pos = (position + vec2(cos(inv_angle) * dist, -sin(inv_angle) * dist )) / dimension;
float dist = distance(pixel_pos, position);
if(pos.x > 0. && pos.x < 1. && pos.y > 0. && pos.y < 1.)
gl_FragColor = v_vColour * texture2D( gm_BaseTexture, pos );
else
gl_FragColor = vec4(0.);
//gl_FragColor = vec4(vec3(inv_angle / TAU), 1.);
} else {
gl_FragColor = v_vColour * texture2D( gm_BaseTexture, pos );
}
pos = (position + vec2(cos(inv_angle) * dist, -sin(inv_angle) * dist )) / dimension;
}
gl_FragColor = vec4(0.);
if(pos.x > 0. && pos.x < 1. && pos.y > 0. && pos.y < 1.)
gl_FragColor = v_vColour * texture2D( gm_BaseTexture, pos );
}

View file

@ -5,12 +5,12 @@ varying vec4 v_vColour;
#define pi1 3.14159
#define pi2 1.57079
uniform vec2 dimension;
uniform vec2 position;
uniform vec2 dimension;
uniform vec2 position;
uniform float angle;
void main() {
vec2 pos = v_vTexcoord;
vec2 pos = v_vTexcoord;
vec2 pixel_pos = v_vTexcoord * dimension;
float _angle;

View file

@ -0,0 +1,9 @@
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
void main() {
vec2 vc = normalize(v_vTexcoord - 0.5);
vec4 c = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
gl_FragColor = vec4(vc.xy * c.a, 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_vector_diverge",
"parent": {
"name": "vector mapper",
"path": "folders/shader/generator/vector mapper.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_delay",
"bbox_bottom": 58,
"bbox_left": 3,
"bbox_right": 60,
"bbox_top": 5,
"bboxMode": 0,
"collisionKind": 1,
"collisionTolerance": 0,
"DynamicTexturePage": false,
"edgeFiltering": false,
"For3D": false,
"frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"a26741db-06f1-48a9-9857-4920d5bbf2b4",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"75a3f575-63b9-4b3b-bf0e-f0dae0d10cfa","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
"parent": {
"name": "animation",
"path": "folders/nodes/icons/animation.yy",
},
"preMultiplyAlpha": false,
"sequence": {
"resourceType": "GMSequence",
"resourceVersion": "1.4",
"name": "s_node_delay",
"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":"a26741db-06f1-48a9-9857-4920d5bbf2b4","path":"sprites/s_node_delay/s_node_delay.yy",},},},"Disabled":false,"id":"7bd3f404-0881-4ca9-9328-21f82fcfe49c","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: 3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3 KiB

View file

@ -13,20 +13,20 @@
"edgeFiltering": false,
"For3D": false,
"frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"d1e85f96-d61b-4899-8e77-6ea2e64c5d6d",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"ac33b00f-823e-49c4-b07b-554eadc678a3",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"97939aed-8fe8-4d7a-b6cb-3a8e69c6a402","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"9419e650-d94c-4998-b905-0379893c6edf","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
"parent": {
"name": "filter",
"path": "folders/nodes/icons/filter.yy",
"name": "generator",
"path": "folders/nodes/icons/generator.yy",
},
"preMultiplyAlpha": false,
"sequence": {
@ -54,7 +54,7 @@
"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":"d1e85f96-d61b-4899-8e77-6ea2e64c5d6d","path":"sprites/s_node_diffuse/s_node_diffuse.yy",},},},"Disabled":false,"id":"fa33f3e1-5206-4403-8ae9-a15881009356","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"ac33b00f-823e-49c4-b07b-554eadc678a3","path":"sprites/s_node_diffuse/s_node_diffuse.yy",},},},"Disabled":false,"id":"5f2d1729-84ed-487d-a4fe-70ad627c4d42","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange": null,