From 8930eadc6358597ad53c3716b9d797324989ffbf Mon Sep 17 00:00:00 2001 From: Tanasart Date: Thu, 1 Feb 2024 11:26:02 +0700 Subject: [PATCH] - New Strand noise node. --- PixelComposer.resource_order | 9 +- PixelComposer.yyp | 10 +- fonts/_f_sdf/_f_sdf.old.png | Bin 82361 -> 82361 bytes fonts/_f_sdf/_f_sdf.png | Bin 82361 -> 82361 bytes fonts/_f_sdf_medium/_f_sdf_medium.old.png | Bin 59906 -> 59906 bytes fonts/_f_sdf_medium/_f_sdf_medium.png | Bin 59906 -> 59906 bytes scripts/node_blend_edge/node_alpha_to_grey.yy | 12 ++ scripts/node_blend_edge/node_blend_edge.gml | 64 +++++++++ scripts/node_blend_edge/node_blend_edge.yy | 11 ++ scripts/node_blend_edge/node_bw.yy | 12 ++ .../node_blend_edge/node_color_adjustment.yy | 12 ++ .../node_blend_edge/node_color_replacement.yy | 12 ++ scripts/node_blend_edge/node_greyscale.yy | 12 ++ scripts/node_blend_edge/node_outline.yy | 12 ++ .../node_gradient.yy | 0 .../node_noise_fold.gml} | 0 .../node_noise_fold.yy} | 2 +- scripts/node_noise_strand/node_gradient.yy | 12 ++ .../node_noise_strand/node_noise_strand.gml | 38 ++++++ .../node_noise_strand/node_noise_strand.yy | 11 ++ scripts/node_registry/node_registry.gml | 6 +- scripts/node_transform/node_transform.gml | 31 +++-- scripts/node_value/node_value.gml | 100 ++++++++------ scripts/panel_graph/panel_graph.gml | 2 + scripts/panel_inspector/panel_inspector.gml | 129 +++++++++++++----- scripts/panel_preview/panel_preview.gml | 20 ++- .../surface_functions/surface_functions.gml | 4 +- shaders/sh_blend_edge/sh_blend_edge.fsh | 36 +++++ shaders/sh_blend_edge/sh_blend_edge.vsh | 19 +++ shaders/sh_blend_edge/sh_blend_edge.yy | 10 ++ .../sh_blend_edge_blend.fsh | 26 ++++ .../sh_blend_edge_blend.vsh | 19 +++ .../sh_blend_edge_blend.yy | 10 ++ .../sh_blend_edge_extract.fsh | 36 +++++ .../sh_blend_edge_extract.vsh | 19 +++ .../sh_blend_edge_extract.yy | 10 ++ shaders/sh_noise_strand/sh_noise_strand.fsh | 42 ++++++ shaders/sh_noise_strand/sh_noise_strand.vsh | 19 +++ shaders/sh_noise_strand/sh_noise_strand.yy | 10 ++ .../58394d46-a521-4621-ad94-582aea25b18e.png | Bin 0 -> 1702 bytes .../91f7785d-8ec5-4bd2-97c6-09f8c66dba59.png | Bin 0 -> 1702 bytes .../s_node_strand_noise.yy | 74 ++++++++++ 42 files changed, 752 insertions(+), 99 deletions(-) create mode 100644 scripts/node_blend_edge/node_alpha_to_grey.yy create mode 100644 scripts/node_blend_edge/node_blend_edge.gml create mode 100644 scripts/node_blend_edge/node_blend_edge.yy create mode 100644 scripts/node_blend_edge/node_bw.yy create mode 100644 scripts/node_blend_edge/node_color_adjustment.yy create mode 100644 scripts/node_blend_edge/node_color_replacement.yy create mode 100644 scripts/node_blend_edge/node_greyscale.yy create mode 100644 scripts/node_blend_edge/node_outline.yy rename scripts/{node_fold_noise => node_noise_fold}/node_gradient.yy (100%) rename scripts/{node_fold_noise/node_fold_noise.gml => node_noise_fold/node_noise_fold.gml} (100%) rename scripts/{node_fold_noise/node_fold_noise.yy => node_noise_fold/node_noise_fold.yy} (87%) create mode 100644 scripts/node_noise_strand/node_gradient.yy create mode 100644 scripts/node_noise_strand/node_noise_strand.gml create mode 100644 scripts/node_noise_strand/node_noise_strand.yy create mode 100644 shaders/sh_blend_edge/sh_blend_edge.fsh create mode 100644 shaders/sh_blend_edge/sh_blend_edge.vsh create mode 100644 shaders/sh_blend_edge/sh_blend_edge.yy create mode 100644 shaders/sh_blend_edge_blend/sh_blend_edge_blend.fsh create mode 100644 shaders/sh_blend_edge_blend/sh_blend_edge_blend.vsh create mode 100644 shaders/sh_blend_edge_blend/sh_blend_edge_blend.yy create mode 100644 shaders/sh_blend_edge_extract/sh_blend_edge_extract.fsh create mode 100644 shaders/sh_blend_edge_extract/sh_blend_edge_extract.vsh create mode 100644 shaders/sh_blend_edge_extract/sh_blend_edge_extract.yy create mode 100644 shaders/sh_noise_strand/sh_noise_strand.fsh create mode 100644 shaders/sh_noise_strand/sh_noise_strand.vsh create mode 100644 shaders/sh_noise_strand/sh_noise_strand.yy create mode 100644 sprites/s_node_strand_noise/58394d46-a521-4621-ad94-582aea25b18e.png create mode 100644 sprites/s_node_strand_noise/layers/58394d46-a521-4621-ad94-582aea25b18e/91f7785d-8ec5-4bd2-97c6-09f8c66dba59.png create mode 100644 sprites/s_node_strand_noise/s_node_strand_noise.yy diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index a5f90c702..751173140 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -220,6 +220,7 @@ {"name":"color selector","order":14,"path":"folders/shader/color selector.yy",}, {"name":"draw","order":7,"path":"folders/shader/draw.yy",}, {"name":"filter","order":4,"path":"folders/shader/filter.yy",}, + {"name":"blend edge","order":50,"path":"folders/shader/filter/blend edge.yy",}, {"name":"blur","order":40,"path":"folders/shader/filter/blur.yy",}, {"name":"channels","order":39,"path":"folders/shader/filter/channels.yy",}, {"name":"color","order":33,"path":"folders/shader/filter/color.yy",}, @@ -744,6 +745,7 @@ {"name":"fd_rectangle_get_visualization_shader","order":27,"path":"scripts/fd_rectangle_get_visualization_shader/fd_rectangle_get_visualization_shader.yy",}, {"name":"preset_data","order":8,"path":"scripts/preset_data/preset_data.yy",}, {"name":"_f_h5","order":2,"path":"fonts/_f_h5/_f_h5.yy",}, + {"name":"node_blend_edge","order":19,"path":"scripts/node_blend_edge/node_blend_edge.yy",}, {"name":"node_string_split","order":3,"path":"scripts/node_string_split/node_string_split.yy",}, {"name":"meta_data","order":12,"path":"scripts/meta_data/meta_data.yy",}, {"name":"node_find_pixel","order":1,"path":"scripts/node_find_pixel/node_find_pixel.yy",}, @@ -836,6 +838,7 @@ {"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_noise_strand","order":15,"path":"shaders/sh_noise_strand/sh_noise_strand.yy",}, {"name":"sh_bw","order":3,"path":"shaders/sh_bw/sh_bw.yy",}, {"name":"var_comparison","order":1,"path":"scripts/var_comparison/var_comparison.yy",}, {"name":"node_array_zip","order":13,"path":"scripts/node_array_zip/node_array_zip.yy",}, @@ -1007,6 +1010,7 @@ {"name":"FirebaseREST_HTTP_Success_Firestore","order":19,"path":"scripts/FirebaseREST_HTTP_Success_Firestore/FirebaseREST_HTTP_Success_Firestore.yy",}, {"name":"s_node_pb_draw_rectangle","order":13,"path":"sprites/s_node_pb_draw_rectangle/s_node_pb_draw_rectangle.yy",}, {"name":"panel_animation","order":1,"path":"scripts/panel_animation/panel_animation.yy",}, + {"name":"sh_blend_edge_blend","order":1,"path":"shaders/sh_blend_edge_blend/sh_blend_edge_blend.yy",}, {"name":"sh_bend_arc","order":13,"path":"shaders/sh_bend_arc/sh_bend_arc.yy",}, {"name":"node_array_rearrange","order":19,"path":"scripts/node_array_rearrange/node_array_rearrange.yy",}, {"name":"sh_pb_to_mask","order":7,"path":"shaders/sh_pb_to_mask/sh_pb_to_mask.yy",}, @@ -1016,6 +1020,7 @@ {"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_strand_noise","order":44,"path":"sprites/s_node_strand_noise/s_node_strand_noise.yy",}, {"name":"s_node_array_remove","order":7,"path":"sprites/s_node_array_remove/s_node_array_remove.yy",}, {"name":"s_node_zigzag","order":18,"path":"sprites/s_node_zigzag/s_node_zigzag.yy",}, {"name":"node_FLIP_render","order":3,"path":"scripts/node_FLIP_render/node_FLIP_render.yy",}, @@ -1607,6 +1612,7 @@ {"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":1,"path":"shaders/sh_stripe/sh_stripe.yy",}, + {"name":"node_noise_strand","order":15,"path":"scripts/node_noise_strand/node_noise_strand.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",}, @@ -1766,6 +1772,7 @@ {"name":"s_node_scatter","order":19,"path":"sprites/s_node_scatter/s_node_scatter.yy",}, {"name":"s_node_bokeh","order":5,"path":"sprites/s_node_bokeh/s_node_bokeh.yy",}, {"name":"s_node_3d_sphere_uv","order":16,"path":"sprites/s_node_3d_sphere_uv/s_node_3d_sphere_uv.yy",}, + {"name":"sh_blend_edge","order":2,"path":"shaders/sh_blend_edge/sh_blend_edge.yy",}, {"name":"s_biterator_toggler","order":13,"path":"sprites/s_biterator_toggler/s_biterator_toggler.yy",}, {"name":"s_node_smokeSim_render","order":9,"path":"sprites/s_node_smokeSim_render/s_node_smokeSim_render.yy",}, {"name":"sh_vertex_depth_pass","order":2,"path":"shaders/sh_vertex_depth_pass/sh_vertex_depth_pass.yy",}, @@ -1921,7 +1928,7 @@ {"name":"draw_surface_functions","order":4,"path":"scripts/draw_surface_functions/draw_surface_functions.yy",}, {"name":"node_rigid_variable","order":8,"path":"scripts/node_rigid_variable/node_rigid_variable.yy",}, {"name":"project_function","order":2,"path":"scripts/project_function/project_function.yy",}, - {"name":"node_fold_noise","order":14,"path":"scripts/node_fold_noise/node_fold_noise.yy",}, + {"name":"node_noise_fold","order":14,"path":"scripts/node_noise_fold/node_noise_fold.yy",}, {"name":"s_node_zoom","order":48,"path":"sprites/s_node_zoom/s_node_zoom.yy",}, {"name":"node_noise_fbm","order":3,"path":"scripts/node_noise_fbm/node_noise_fbm.yy",}, {"name":"sh_channel_V","order":6,"path":"shaders/sh_channel_V/sh_channel_V.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index b6d113f3c..bdd0abdd8 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -252,6 +252,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"color selector","folderPath":"folders/shader/color selector.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"draw","folderPath":"folders/shader/draw.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"filter","folderPath":"folders/shader/filter.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"blend edge","folderPath":"folders/shader/filter/blend edge.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"blur","folderPath":"folders/shader/filter/blur.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"channels","folderPath":"folders/shader/filter/channels.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"color","folderPath":"folders/shader/filter/color.yy",}, @@ -757,6 +758,7 @@ {"id":{"name":"__node","path":"scripts/__node/__node.yy",},}, {"id":{"name":"fd_rectangle_add_velocity","path":"scripts/fd_rectangle_add_velocity/fd_rectangle_add_velocity.yy",},}, {"id":{"name":"Obj_FirebaseFirestore_allCallbacks","path":"objects/Obj_FirebaseFirestore_allCallbacks/Obj_FirebaseFirestore_allCallbacks.yy",},}, + {"id":{"name":"sh_blend_edge_extract","path":"shaders/sh_blend_edge_extract/sh_blend_edge_extract.yy",},}, {"id":{"name":"sh_level_selector","path":"shaders/sh_level_selector/sh_level_selector.yy",},}, {"id":{"name":"pcx_ast","path":"scripts/pcx_ast/pcx_ast.yy",},}, {"id":{"name":"s_node_struct","path":"sprites/s_node_struct/s_node_struct.yy",},}, @@ -997,6 +999,7 @@ {"id":{"name":"fd_rectangle_get_visualization_shader","path":"scripts/fd_rectangle_get_visualization_shader/fd_rectangle_get_visualization_shader.yy",},}, {"id":{"name":"preset_data","path":"scripts/preset_data/preset_data.yy",},}, {"id":{"name":"_f_h5","path":"fonts/_f_h5/_f_h5.yy",},}, + {"id":{"name":"node_blend_edge","path":"scripts/node_blend_edge/node_blend_edge.yy",},}, {"id":{"name":"node_color","path":"scripts/node_color/node_color.yy",},}, {"id":{"name":"node_string_split","path":"scripts/node_string_split/node_string_split.yy",},}, {"id":{"name":"meta_data","path":"scripts/meta_data/meta_data.yy",},}, @@ -1106,6 +1109,7 @@ {"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_noise_strand","path":"shaders/sh_noise_strand/sh_noise_strand.yy",},}, {"id":{"name":"sh_bw","path":"shaders/sh_bw/sh_bw.yy",},}, {"id":{"name":"var_comparison","path":"scripts/var_comparison/var_comparison.yy",},}, {"id":{"name":"sh_sdf_tex","path":"shaders/sh_sdf_tex/sh_sdf_tex.yy",},}, @@ -1302,6 +1306,7 @@ {"id":{"name":"node_surface_from_color","path":"scripts/node_surface_from_color/node_surface_from_color.yy",},}, {"id":{"name":"s_node_pb_draw_rectangle","path":"sprites/s_node_pb_draw_rectangle/s_node_pb_draw_rectangle.yy",},}, {"id":{"name":"panel_animation","path":"scripts/panel_animation/panel_animation.yy",},}, + {"id":{"name":"sh_blend_edge_blend","path":"shaders/sh_blend_edge_blend/sh_blend_edge_blend.yy",},}, {"id":{"name":"sh_bend_arc","path":"shaders/sh_bend_arc/sh_bend_arc.yy",},}, {"id":{"name":"node_array_rearrange","path":"scripts/node_array_rearrange/node_array_rearrange.yy",},}, {"id":{"name":"sh_pb_to_mask","path":"shaders/sh_pb_to_mask/sh_pb_to_mask.yy",},}, @@ -1311,6 +1316,7 @@ {"id":{"name":"sh_gradient","path":"shaders/sh_gradient/sh_gradient.yy",},}, {"id":{"name":"sh_region_fill_init","path":"shaders/sh_region_fill_init/sh_region_fill_init.yy",},}, {"id":{"name":"node_json_file_read","path":"scripts/node_json_file_read/node_json_file_read.yy",},}, + {"id":{"name":"s_node_strand_noise","path":"sprites/s_node_strand_noise/s_node_strand_noise.yy",},}, {"id":{"name":"s_node_array_remove","path":"sprites/s_node_array_remove/s_node_array_remove.yy",},}, {"id":{"name":"s_node_zigzag","path":"sprites/s_node_zigzag/s_node_zigzag.yy",},}, {"id":{"name":"node_FLIP_render","path":"scripts/node_FLIP_render/node_FLIP_render.yy",},}, @@ -1984,6 +1990,7 @@ {"id":{"name":"sh_d3d_ssao","path":"shaders/sh_d3d_ssao/sh_d3d_ssao.yy",},}, {"id":{"name":"node_channels_hsv","path":"scripts/node_channels_hsv/node_channels_hsv.yy",},}, {"id":{"name":"sh_stripe","path":"shaders/sh_stripe/sh_stripe.yy",},}, + {"id":{"name":"node_noise_strand","path":"scripts/node_noise_strand/node_noise_strand.yy",},}, {"id":{"name":"s_node_shard","path":"sprites/s_node_shard/s_node_shard.yy",},}, {"id":{"name":"node_path_trim","path":"scripts/node_path_trim/node_path_trim.yy",},}, {"id":{"name":"s_node_rigidSim_deactivate","path":"sprites/s_node_rigidSim_deactivate/s_node_rigidSim_deactivate.yy",},}, @@ -2169,6 +2176,7 @@ {"id":{"name":"s_node_scatter","path":"sprites/s_node_scatter/s_node_scatter.yy",},}, {"id":{"name":"s_node_bokeh","path":"sprites/s_node_bokeh/s_node_bokeh.yy",},}, {"id":{"name":"s_node_3d_sphere_uv","path":"sprites/s_node_3d_sphere_uv/s_node_3d_sphere_uv.yy",},}, + {"id":{"name":"sh_blend_edge","path":"shaders/sh_blend_edge/sh_blend_edge.yy",},}, {"id":{"name":"s_biterator_toggler","path":"sprites/s_biterator_toggler/s_biterator_toggler.yy",},}, {"id":{"name":"s_node_smokeSim_render","path":"sprites/s_node_smokeSim_render/s_node_smokeSim_render.yy",},}, {"id":{"name":"sh_vertex_depth_pass","path":"shaders/sh_vertex_depth_pass/sh_vertex_depth_pass.yy",},}, @@ -2349,7 +2357,7 @@ {"id":{"name":"sh_mask","path":"shaders/sh_mask/sh_mask.yy",},}, {"id":{"name":"node_rigid_variable","path":"scripts/node_rigid_variable/node_rigid_variable.yy",},}, {"id":{"name":"project_function","path":"scripts/project_function/project_function.yy",},}, - {"id":{"name":"node_fold_noise","path":"scripts/node_fold_noise/node_fold_noise.yy",},}, + {"id":{"name":"node_noise_fold","path":"scripts/node_noise_fold/node_noise_fold.yy",},}, {"id":{"name":"s_node_zoom","path":"sprites/s_node_zoom/s_node_zoom.yy",},}, {"id":{"name":"migration_function","path":"scripts/migration_function/migration_function.yy",},}, {"id":{"name":"node_noise_fbm","path":"scripts/node_noise_fbm/node_noise_fbm.yy",},}, diff --git a/fonts/_f_sdf/_f_sdf.old.png b/fonts/_f_sdf/_f_sdf.old.png index fba7c844747f059e154daa60ba489be2a583d720..3232274359c1afb1d45f41d24123e623d52ba2fa 100644 GIT binary patch delta 125 zcmdnl%(}CgwP6dRp`(Y9u7P2QfsvJgv6YF5wt<0_fk9!vn=u0egKCLuL`h0wNvc(D ueoAIqC4-THk%_JW77YxS{`F6!C8<`q v`6-!cl?+A(MkcxjSTs!kzINmEN=HUnWh{~h9`)n_O=IwM^>bP0l+XkKpwA-( diff --git a/fonts/_f_sdf/_f_sdf.png b/fonts/_f_sdf/_f_sdf.png index 19c9843bfed0db5bcc0a662fc8e6d5e1a017d30e..03a8835c8ffd05dde632d2904d90597c1a17955c 100644 GIT binary patch delta 125 zcmdnl%(}CgwP6dRp`(Y9u7P2QfsvJwk(G&owt<0_fq_xphWiW*45}rr5hW>!C8<`q u`6-!cl?+A(MkcxjSTr~rb0kl%bYzrO#v&=Arnv`b8iS{+pUXO@geCw}6d&0D delta 125 zcmdnl%(}CgwP6dRp`(YPuCZZ=fti(|xs`#bwt<0_fx+rU-8Bph45}rr5hW>!C8<`q v`6-!cl?+A(MkcxjSTx-FZ+u{Sr6Z%PG8W0+S3>eY(-=Hm{an^LB{Ts5$MYhS diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.old.png b/fonts/_f_sdf_medium/_f_sdf_medium.old.png index 5be21924cdadae3807ae508dd99d4ecd1ae40938..11e3a287d6d1ec077fa9d1e109afcbd75633307a 100644 GIT binary patch delta 125 zcmZp=!rXL)c|+ApaU)#=!w>@_D+6OI6H{#i11kfA>py(kCr^AS6^=!2+0w7p3=9k! vC9V-ADTyViRwbFasl_FUxdjYH21X{j23Yib+;HUyP!EHrtDnm{r-UW|+0Q1^ delta 125 zcmZp=!rXL)c|+ApaYJ2WgAfCAD-#1NLkn#K11kfAXRAbcCr^AS6^=!2`uDXP85kHe vN?apKQW8s2tx7U;Q;SOya|;-Z42(>44Y24r@TeybsE5JR)z4*}Q$iB}nrkJi diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.png b/fonts/_f_sdf_medium/_f_sdf_medium.png index ee6bc6db26c32c0d6456f397908c5e6e3709853b..81465410484fb26c0b5b0d8414faa881e35170cb 100644 GIT binary patch delta 125 zcmZp=!rXL)c|+ApaU)#=!w>@_D^AD?@WD15<4S11kfA)r-1oCQp1R6^=#j)_>yz3=9k! vC9V-ADTyViRwbFasl_FUxdjYH21X{j23Yj;z7moL>S6G7^>bP0l+XkKzw;$I diff --git a/scripts/node_blend_edge/node_alpha_to_grey.yy b/scripts/node_blend_edge/node_alpha_to_grey.yy new file mode 100644 index 000000000..fde448fca --- /dev/null +++ b/scripts/node_blend_edge/node_alpha_to_grey.yy @@ -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", +} \ No newline at end of file diff --git a/scripts/node_blend_edge/node_blend_edge.gml b/scripts/node_blend_edge/node_blend_edge.gml new file mode 100644 index 000000000..4ba4cd408 --- /dev/null +++ b/scripts/node_blend_edge/node_blend_edge.gml @@ -0,0 +1,64 @@ +function Node_Blend_Edge(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { + name = "Blend Edge"; + + inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0); + + inputs[| 1] = nodeValue("Width", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.1) + .setDisplay(VALUE_DISPLAY.slider) + .setMappable(5); + + inputs[| 2] = nodeValue("Types",self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0) + .setDisplay(VALUE_DISPLAY.enum_button, [ "Both", "Horizontal", "Vertical" ]); + + inputs[| 3] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true); + active_index = 3; + + inputs[| 4] = nodeValue("Channel", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0b1111) + .setDisplay(VALUE_DISPLAY.toggle, { data: array_create(4, THEME.inspector_channel) }); + + ///////////////////////////////////////////////////////////////////////////////////////////////////// + + inputs[| 5] = nodeValue("Width map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone) + .setVisible(false, false); + + ///////////////////////////////////////////////////////////////////////////////////////////////////// + + inputs[| 6] = nodeValue("Blending", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1) + .setDisplay(VALUE_DISPLAY.slider); + + input_display_list = [ 3, 4, + ["Surfaces", true], 0, + ["Blend", false], 2, 1, 5, 6, + ] + + outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); + + temp_surface = array_create(1); + + attribute_surface_depth(); + + static step = function() { #region + inputs[| 1].mappableStep(); + } #endregion + + static processData = function(_outSurf, _data, _output_index, _array_index) { + var _sw = surface_get_width_safe(_data[0]); + var _sh = surface_get_height_safe(_data[0]); + + for( var i = 0, n = array_length(temp_surface); i < n; i++ ) + temp_surface[i] = surface_verify(temp_surface[i], _sw, _sh); + + surface_set_shader(_outSurf, sh_blend_edge); + shader_set_f("dimension", _sw, _sh); + shader_set_f_map("width", clamp(_data[1], 0.001, 0.999), _data[5], inputs[| 1]); + shader_set_i("edge" , _data[2]); + shader_set_f("blend" , clamp(_data[6], 0.001, 0.999)); + + draw_surface(_data[0], 0, 0); + surface_reset_shader(); + + //return temp_surface[0]; + + return _outSurf; + } +} \ No newline at end of file diff --git a/scripts/node_blend_edge/node_blend_edge.yy b/scripts/node_blend_edge/node_blend_edge.yy new file mode 100644 index 000000000..0e27e1cea --- /dev/null +++ b/scripts/node_blend_edge/node_blend_edge.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_blend_edge", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "effects", + "path": "folders/nodes/data/filter/effects.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_blend_edge/node_bw.yy b/scripts/node_blend_edge/node_bw.yy new file mode 100644 index 000000000..6d2681493 --- /dev/null +++ b/scripts/node_blend_edge/node_bw.yy @@ -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", +} \ No newline at end of file diff --git a/scripts/node_blend_edge/node_color_adjustment.yy b/scripts/node_blend_edge/node_color_adjustment.yy new file mode 100644 index 000000000..8df16cc8c --- /dev/null +++ b/scripts/node_blend_edge/node_color_adjustment.yy @@ -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", +} \ No newline at end of file diff --git a/scripts/node_blend_edge/node_color_replacement.yy b/scripts/node_blend_edge/node_color_replacement.yy new file mode 100644 index 000000000..024aa6a80 --- /dev/null +++ b/scripts/node_blend_edge/node_color_replacement.yy @@ -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", +} \ No newline at end of file diff --git a/scripts/node_blend_edge/node_greyscale.yy b/scripts/node_blend_edge/node_greyscale.yy new file mode 100644 index 000000000..ee372977e --- /dev/null +++ b/scripts/node_blend_edge/node_greyscale.yy @@ -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", +} \ No newline at end of file diff --git a/scripts/node_blend_edge/node_outline.yy b/scripts/node_blend_edge/node_outline.yy new file mode 100644 index 000000000..86468bc09 --- /dev/null +++ b/scripts/node_blend_edge/node_outline.yy @@ -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", +} \ No newline at end of file diff --git a/scripts/node_fold_noise/node_gradient.yy b/scripts/node_noise_fold/node_gradient.yy similarity index 100% rename from scripts/node_fold_noise/node_gradient.yy rename to scripts/node_noise_fold/node_gradient.yy diff --git a/scripts/node_fold_noise/node_fold_noise.gml b/scripts/node_noise_fold/node_noise_fold.gml similarity index 100% rename from scripts/node_fold_noise/node_fold_noise.gml rename to scripts/node_noise_fold/node_noise_fold.gml diff --git a/scripts/node_fold_noise/node_fold_noise.yy b/scripts/node_noise_fold/node_noise_fold.yy similarity index 87% rename from scripts/node_fold_noise/node_fold_noise.yy rename to scripts/node_noise_fold/node_noise_fold.yy index 097e87682..dca1aeb9e 100644 --- a/scripts/node_fold_noise/node_fold_noise.yy +++ b/scripts/node_noise_fold/node_noise_fold.yy @@ -1,7 +1,7 @@ { "resourceType": "GMScript", "resourceVersion": "1.0", - "name": "node_fold_noise", + "name": "node_noise_fold", "isCompatibility": false, "isDnD": false, "parent": { diff --git a/scripts/node_noise_strand/node_gradient.yy b/scripts/node_noise_strand/node_gradient.yy new file mode 100644 index 000000000..fa813bb58 --- /dev/null +++ b/scripts/node_noise_strand/node_gradient.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "generator", + "path": "folders/nodes/data/generator.yy", + }, + "resourceVersion": "1.0", + "name": "node_gradient", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/node_noise_strand/node_noise_strand.gml b/scripts/node_noise_strand/node_noise_strand.gml new file mode 100644 index 000000000..4119ffb27 --- /dev/null +++ b/scripts/node_noise_strand/node_noise_strand.gml @@ -0,0 +1,38 @@ +function Node_Noise_Strand(_x, _y, _group = noone) : Node_Shader_Generator(_x, _y, _group) constructor { + name = "Strand Noise"; + shader = sh_noise_strand; + + inputs[| 1] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ]) + .setDisplay(VALUE_DISPLAY.vector) + .setUnitRef(function(index) { return getDimension(index); }); + addShaderProp(SHADER_UNIFORM.float, "position"); + + inputs[| 2] = nodeValue("Density", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5 ) + .setDisplay(VALUE_DISPLAY.slider); + addShaderProp(SHADER_UNIFORM.float, "density"); + + inputs[| 3] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, seed_random(4)); + addShaderProp(SHADER_UNIFORM.float, "seed"); + + inputs[| 4] = nodeValue("Slope", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5 ) + .setDisplay(VALUE_DISPLAY.slider); + addShaderProp(SHADER_UNIFORM.float, "slope"); + + inputs[| 5] = nodeValue("Curve", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 ) + .setDisplay(VALUE_DISPLAY.slider); + addShaderProp(SHADER_UNIFORM.float, "curve"); + + inputs[| 6] = nodeValue("Curve scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1 ); + addShaderProp(SHADER_UNIFORM.float, "curveDetail"); + + inputs[| 7] = nodeValue("Thickness", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0 ) + .setDisplay(VALUE_DISPLAY.slider); + addShaderProp(SHADER_UNIFORM.float, "thickness"); + + input_display_list = [ 3, + ["Output", true], 0, + ["Noise", false], 1, 2, 4, + ["Curve", false], 5, 6, + ["Render", false], 7, + ]; +} \ No newline at end of file diff --git a/scripts/node_noise_strand/node_noise_strand.yy b/scripts/node_noise_strand/node_noise_strand.yy new file mode 100644 index 000000000..b9ea073e6 --- /dev/null +++ b/scripts/node_noise_strand/node_noise_strand.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_noise_strand", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "noise", + "path": "folders/nodes/data/generator/noise.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 5322f41b0..9de4638e5 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -522,7 +522,7 @@ function __initNodes() { addNodeObject(filter, "Trail", s_node_trail, "Node_Trail", [1, Node_Trail],, "Blend animation by filling in the pixel 'in-between' two or more frames.").setVersion(1130); addNodeObject(filter, "Erode", s_node_erode, "Node_Erode", [1, Node_Erode],, "Remove pixel that are close to the border of the image."); addNodeObject(filter, "Corner", s_node_corner, "Node_Corner", [1, Node_Corner], ["round corner"], "Round out sharp corner of the image.").setVersion(1110); - addNodeObject(filter, "Blobify", s_node_blobify, "Node_Blobify", [1, Node_Blobify]).setVersion(11640); + addNodeObject(filter, "Blobify", s_node_blobify, "Node_Blobify", [1, Node_Blobify]).setVersion(11650); addNodeObject(filter, "2D Light", s_node_2d_light, "Node_2D_light", [1, Node_2D_light],, "Apply different shaped light on the image."); addNodeObject(filter, "Cast Shadow", s_node_shadow_cast, "Node_Shadow_Cast", [1, Node_Shadow_Cast], ["raycast"], "Apply light that create shadow using shadow mask.").setVersion(1100); addNodeObject(filter, "Pixel Expand", s_node_atlas, "Node_Atlas", [1, Node_Atlas], ["atlas"], "Replace transparent pixel with the closet non-transparent pixel."); @@ -536,6 +536,7 @@ function __initNodes() { addNodeObject(filter, "Chromatic Aberration", s_node_chromatic_abarration, "Node_Chromatic_Aberration", [1, Node_Chromatic_Aberration],, "Apply chromatic aberration effect to the image."); addNodeObject(filter, "Vignette", s_node_vignette, "Node_Vignette", [1, Node_Vignette],, "Apply vignette effect to the border.").setVersion(11630); addNodeObject(filter, "FXAA", s_node_FXAA, "Node_FXAA", [1, Node_FXAA],, "Apply fast approximate anti-aliasing to the image."); + //addNodeObject(filter, "Blend Edge", s_node_FXAA, "Node_Blend_Edge", [1, Node_Blend_Edge]).setVersion(11640); 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."); @@ -639,7 +640,8 @@ function __initNodes() { addNodeObject(generator, "Shard Noise", s_node_shard, "Node_Shard_Noise", [1, Node_Shard_Noise]).patreonExtra(); addNodeObject(generator, "Wavelet Noise", s_node_wavelet, "Node_Wavelet_Noise", [1, Node_Wavelet_Noise]).patreonExtra(); addNodeObject(generator, "Caustic", s_node_caustic, "Node_Caustic", [1, Node_Caustic]).patreonExtra(); - addNodeObject(generator, "Fold Noise", s_node_fold_noise, "Node_Fold_Noise", [1, Node_Fold_Noise]); + addNodeObject(generator, "Fold Noise", s_node_fold_noise, "Node_Fold_Noise", [1, Node_Fold_Noise]).setVersion(11650); + addNodeObject(generator, "Strand Noise", s_node_strand_noise, "Node_Noise_Strand", [1, Node_Noise_Strand]).setVersion(11650); ds_list_add(generator, "Patterns"); addNodeObject(generator, "Stripe", s_node_stripe, "Node_Stripe", [1, Node_Stripe],, "Generate stripe pattern."); diff --git a/scripts/node_transform/node_transform.gml b/scripts/node_transform/node_transform.gml index 56553b968..bd1f0e09e 100644 --- a/scripts/node_transform/node_transform.gml +++ b/scripts/node_transform/node_transform.gml @@ -63,11 +63,15 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) inputs[| 13] = nodeValue("Echo amount", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 8); + inputs[| 14] = nodeValue("Opacity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1) + .setDisplay(VALUE_DISPLAY.slider); + input_display_list = [ 11, 0, ["Output", true], 9, 1, 7, ["Position", false], 2, 10, ["Rotation", false], 3, 5, 8, ["Scale", false], 6, + ["Render", false], 14, ["Echo", true, 12], 13, ]; @@ -76,8 +80,8 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) attribute_surface_depth(); attribute_interpolation(); - vel = 0; - prev_pos = [ 0, 0 ]; + vel = 0; + prev_pos = [ 0, 0 ]; prev_data = noone; static getDimension = function(arr = 0) { #region @@ -194,6 +198,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var echo = _data[12]; var echo_amo = _data[13]; + var alp = _data[14]; var cDep = attrDepth(); @@ -261,7 +266,7 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) surface_set_shader(_outSurf); shader_set_interpolation(ins); - draw_surface_tiled_ext_safe(ins, draw_x, draw_y, sca[0], sca[1], rot, c_white, 1); + draw_surface_tiled_ext_safe(ins, draw_x, draw_y, sca[0], sca[1], rot, c_white, alp); surface_reset_shader(); #endregion @@ -289,22 +294,22 @@ function Node_Transform(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) _dy = round(_dy); } - draw_surface_ext_safe(ins, _dx, _dy, _sx, _sy, _rt); + draw_surface_ext_safe(ins, _dx, _dy, _sx, _sy, _rt, c_white, alp); } } else - draw_surface_ext_safe(ins, draw_x, draw_y, sca[0], sca[1], rot); + draw_surface_ext_safe(ins, draw_x, draw_y, sca[0], sca[1], rot, c_white, alp); if(mode == 2) { - draw_surface_ext_safe(ins, draw_x - _ww, draw_y - _hh, sca[0], sca[1], rot, c_white, 1); - draw_surface_ext_safe(ins, draw_x, draw_y - _hh, sca[0], sca[1], rot, c_white, 1); - draw_surface_ext_safe(ins, draw_x + _ww, draw_y - _hh, sca[0], sca[1], rot, c_white, 1); + draw_surface_ext_safe(ins, draw_x - _ww, draw_y - _hh, sca[0], sca[1], rot, c_white, alp); + draw_surface_ext_safe(ins, draw_x, draw_y - _hh, sca[0], sca[1], rot, c_white, alp); + draw_surface_ext_safe(ins, draw_x + _ww, draw_y - _hh, sca[0], sca[1], rot, c_white, alp); - draw_surface_ext_safe(ins, draw_x - _ww, draw_y, sca[0], sca[1], rot, c_white, 1); - draw_surface_ext_safe(ins, draw_x + _ww, draw_y, sca[0], sca[1], rot, c_white, 1); + draw_surface_ext_safe(ins, draw_x - _ww, draw_y, sca[0], sca[1], rot, c_white, alp); + draw_surface_ext_safe(ins, draw_x + _ww, draw_y, sca[0], sca[1], rot, c_white, alp); - draw_surface_ext_safe(ins, draw_x - _ww, draw_y + _hh, sca[0], sca[1], rot, c_white, 1); - draw_surface_ext_safe(ins, draw_x, draw_y + _hh, sca[0], sca[1], rot, c_white, 1); - draw_surface_ext_safe(ins, draw_x + _ww, draw_y + _hh, sca[0], sca[1], rot, c_white, 1); + draw_surface_ext_safe(ins, draw_x - _ww, draw_y + _hh, sca[0], sca[1], rot, c_white, alp); + draw_surface_ext_safe(ins, draw_x, draw_y + _hh, sca[0], sca[1], rot, c_white, alp); + draw_surface_ext_safe(ins, draw_x + _ww, draw_y + _hh, sca[0], sca[1], rot, c_white, alp); } surface_reset_shader(); #endregion diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 88309af3e..0cb8e8818 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -874,7 +874,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru switch(display_type) { case VALUE_DISPLAY._default : #region editWidget = new textBox(_txt, function(val) { - return setValueDirect(val); + return setValueInspector(val); } ); editWidget.slidable = true; if(type == VALUE_TYPE.integer) editWidget.setSlidable(); @@ -887,7 +887,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; #endregion case VALUE_DISPLAY.range : #region editWidget = new rangeBox(_txt, function(index, val) { - return setValueDirect(val, index); + return setValueInspector(val, index); } ); if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1 / 10); @@ -905,7 +905,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru if(len <= 4) { editWidget = new vectorBox(len, function(index, val) { - return setValueDirect(val, index); + return setValueInspector(val, index); }, unit ); if(struct_has(display_data, "label")) editWidget.axis = display_data.label; @@ -941,7 +941,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var val = animator.getValue(); editWidget = new vectorRangeBox(array_length(val), _txt, function(index, val) { - return setValueDirect(val, index); + return setValueInspector(val, index); }, unit ); if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1 / 10); @@ -963,14 +963,14 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var _step = struct_try_get(display_data, "step", -1); editWidget = new rotator(function(val) { - return setValueDirect(val); + return setValueInspector(val); }, _step ); extract_node = "Node_Number"; break; #endregion case VALUE_DISPLAY.rotation_range : #region editWidget = new rotatorRange(function(index, val) { - return setValueDirect(val, index); + return setValueInspector(val, index); } ); for( var i = 0, n = array_length(animators); i < n; i++ ) @@ -980,7 +980,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; #endregion case VALUE_DISPLAY.rotation_random: #region editWidget = new rotatorRandom(function(index, val) { - return setValueDirect(val, index); + return setValueInspector(val, index); } ); extract_node = "Node_Vector2"; @@ -989,7 +989,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var _range = struct_try_get(display_data, "range", [ 0, 1, 0.01 ]); editWidget = new slider(_range[0], _range[1], _range[2], function(val) { - return setValueDirect(toNumber(val)); + return setValueInspector(toNumber(val)); } ); if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1 / 10); @@ -1002,7 +1002,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var _range = struct_try_get(display_data, "range", [ 0, 1, 0.01 ]); editWidget = new sliderRange(_range[0], _range[1], _range[2], function(index, val) { - return setValueDirect(val, index); + return setValueInspector(val, index); } ); if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1 / 10); @@ -1013,7 +1013,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; #endregion case VALUE_DISPLAY.area : #region editWidget = new areaBox(function(index, val) { - return setValueDirect(val, index); + return setValueInspector(val, index); }, unit); if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1 / 10); @@ -1033,7 +1033,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru editWidget = new paddingBox(function(index, val) { //var _val = animator.getValue(); //_val[index] = val; - return setValueDirect(val, index); + return setValueInspector(val, index); }, unit); if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1 / 10); @@ -1044,7 +1044,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; #endregion case VALUE_DISPLAY.corner : #region editWidget = new cornerBox(function(index, val) { - return setValueDirect(val, index); + return setValueInspector(val, index); }, unit); if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1 / 10); @@ -1055,9 +1055,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; #endregion case VALUE_DISPLAY.puppet_control : #region editWidget = new controlPointBox(function(index, val) { - //var _val = animator.getValue(); - //_val[index] = val; - return setValueDirect(val, index); + return setValueInspector(val, index); }); extract_node = ""; @@ -1068,7 +1066,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru editWidget = new scrollBox(choices, function(val) { if(val == -1) return; - return setValueDirect(toNumber(val)); + return setValueInspector(toNumber(val)); } ); if(struct_has(display_data, "update_hover")) editWidget.update_hover = display_data.update_hover; @@ -1082,7 +1080,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru var choices = __txt_junction_data(instanceof(node), connect_type, index, display_data.data); editWidget = new buttonGroup(choices, function(val) { - return setValueDirect(val); + return setValueInspector(val); } ); rejectConnect(); @@ -1091,7 +1089,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; #endregion case VALUE_DISPLAY.matrix : #region editWidget = new matrixGrid(_txt, display_data.size, function(index, val) { - return setValueDirect(val, index); + return setValueInspector(val, index); }, unit ); if(type == VALUE_TYPE.integer) editWidget.setSlideSpeed(1 / 10); @@ -1102,16 +1100,14 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; #endregion case VALUE_DISPLAY.transform : #region editWidget = new transformBox(function(index, val) { - var _val = animator.getValue(); - _val[index] = val; - return setValueDirect(_val); + return setValueInspector(_val, index); }); extract_node = "Node_Transform_Array"; break; #endregion case VALUE_DISPLAY.toggle : #region editWidget = new toggleGroup(display_data.data, function(val) { - return setValueDirect(val); + return setValueInspector(val); } ); rejectConnect(); @@ -1120,7 +1116,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; #endregion case VALUE_DISPLAY.d3quarternion : #region editWidget = new quarternionBox(function(index, val) { - return setValueDirect(val, index); + return setValueInspector(val, index); }); extract_node = "Node_Vector4"; @@ -1128,7 +1124,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; #endregion case VALUE_DISPLAY.path_anchor : #region editWidget = new pathAnchorBox(function(index, val) { - return setValueDirect(val, index); + return setValueInspector(val, index); }); extract_node = "Node_Path_Anchor"; @@ -1137,8 +1133,8 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } break; case VALUE_TYPE.boolean : #region - if(name == "Active") editWidget = new checkBoxActive(function() { return setValueDirect(!animator.getValue()); } ); - else editWidget = new checkBox(function() { return setValueDirect(!animator.getValue()); } ); + if(name == "Active") editWidget = new checkBoxActive(function() { return setValueInspector(!animator.getValue()); } ); + else editWidget = new checkBox( function() { return setValueInspector(!animator.getValue()); } ); key_inter = CURVE_TYPE.cut; extract_node = "Node_Boolean"; @@ -1147,7 +1143,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru switch(display_type) { case VALUE_DISPLAY._default : editWidget = new buttonColor(function(color) { - return setValueDirect(color); + return setValueInspector(color); } ); graph_h = ui(16); @@ -1155,7 +1151,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; case VALUE_DISPLAY.palette : editWidget = new buttonPalette(function(color) { - return setValueDirect(color); + return setValueInspector(color); } ); extract_node = "Node_Palette"; @@ -1164,7 +1160,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru break; #endregion case VALUE_TYPE.gradient : #region editWidget = new buttonGradient(function(gradient) { - return setValueDirect(gradient); + return setValueInspector(gradient); } ); extract_node = "Node_Gradient_Out"; @@ -1172,30 +1168,30 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru case VALUE_TYPE.path : #region switch(display_type) { case VALUE_DISPLAY.path_array : - editWidget = new pathArrayBox(node, display_data.filter, function(path) { setValueDirect(path); } ); + editWidget = new pathArrayBox(node, display_data.filter, function(path) { setValueInspector(path); } ); break; case VALUE_DISPLAY.path_load : - editWidget = new textBox(TEXTBOX_INPUT.text, function(str) { setValueDirect(str); } ); + editWidget = new textBox(TEXTBOX_INPUT.text, function(str) { setValueInspector(str); } ); editWidget.align = fa_left; editWidget.side_button = button(function() { var path = get_open_filename(display_data.filter, ""); key_release(); if(path == "") return noone; - return setValueDirect(path); + return setValueInspector(path); }, THEME.button_path_icon); extract_node = "Node_String"; break; case VALUE_DISPLAY.path_save : - editWidget = new textBox(TEXTBOX_INPUT.text, function(str) { setValueDirect(str); } ); + editWidget = new textBox(TEXTBOX_INPUT.text, function(str) { setValueInspector(str); } ); editWidget.align = fa_left; editWidget.side_button = button(function() { var path = get_save_filename(display_data.filter, ""); key_release(); if(path == "") return noone; - return setValueDirect(path); + return setValueInspector(path); }, THEME.button_path_icon); extract_node = "Node_String"; @@ -1204,7 +1200,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru case VALUE_DISPLAY.path_font : editWidget = new fontScrollBox( function(val) { - return setValueDirect(DIRECTORY + "Fonts/" + FONT_INTERNAL[val]); + return setValueInspector(DIRECTORY + "Fonts/" + FONT_INTERNAL[val]); } ); break; @@ -1213,28 +1209,28 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru case VALUE_TYPE.curve : #region display_type = VALUE_DISPLAY.curve; editWidget = new curveBox(function(_modified) { - return setValueDirect(_modified); + return setValueInspector(_modified); }); break; #endregion case VALUE_TYPE.text : #region switch(display_type) { case VALUE_DISPLAY._default : editWidget = new textArea(TEXTBOX_INPUT.text, function(str) { - return setValueDirect(str); + return setValueInspector(str); }); extract_node = "Node_String"; break; case VALUE_DISPLAY.text_box : editWidget = new textBox(TEXTBOX_INPUT.text, function(str) { - return setValueDirect(str); + return setValueInspector(str); }); extract_node = "Node_String"; break; case VALUE_DISPLAY.codeLUA : editWidget = new textArea(TEXTBOX_INPUT.text, function(str) { - return setValueDirect(str); + return setValueInspector(str); }); editWidget.font = f_code; @@ -1245,7 +1241,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru case VALUE_DISPLAY.codeHLSL: editWidget = new textArea(TEXTBOX_INPUT.text, function(str) { - return setValueDirect(str); + return setValueInspector(str); }); editWidget.autocomplete_server = hlsl_autocomplete_server; @@ -1261,7 +1257,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru case VALUE_DISPLAY.text_tunnel : editWidget = new textBox(TEXTBOX_INPUT.text, function(str) { - return setValueDirect(str); + return setValueInspector(str); }); extract_node = "Node_String"; break; @@ -1274,7 +1270,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru case VALUE_TYPE.d3Material : case VALUE_TYPE.surface : #region editWidget = new surfaceBox(function(ind) { - return setValueDirect(ind); + return setValueInspector(ind); } ); if(!struct_has(display_data, "atlas")) display_data.atlas = true; @@ -1923,6 +1919,26 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru } } #endregion + static setValueInspector = function(val = 0, index = noone) { #region + INLINE + var res = false; + + if(PANEL_INSPECTOR && PANEL_INSPECTOR.inspectGroup == 1) { + var ind = self.index; + + for( var i = 0, n = array_length(PANEL_INSPECTOR.inspectings); i < n; i++ ) { + var _node = PANEL_INSPECTOR.inspectings[i]; + if(ind >= ds_list_size(_node.inputs)) continue; + + var r = _node.inputs[| ind].setValueDirect(val, index); + if(_node == node) res = r; + } + } else + res = setValueDirect(val, index); + + return res; + } #endregion + static setValueDirect = function(val = 0, index = noone, record = true, time = CURRENT_FRAME, _update = true) { #region is_modified = true; var updated = false; diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index bb0ddbd17..01612f877 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -603,6 +603,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { var _l = ds_list_create_from_array(nodes_selecting); toCenterNode(array_empty(nodes_selecting)? nodes_list : _l); ds_list_destroy(_l); + + graph_s_to = 1; } #endregion function dragGraph() { #region diff --git a/scripts/panel_inspector/panel_inspector.gml b/scripts/panel_inspector/panel_inspector.gml index 1fd28b77c..eb0d56030 100644 --- a/scripts/panel_inspector/panel_inspector.gml +++ b/scripts/panel_inspector/panel_inspector.gml @@ -23,9 +23,11 @@ function Panel_Inspector() : PanelContent() constructor { h = ui(640); min_w = ui(160); - locked = false; - inspecting = noone; - top_bar_h = ui(100); + locked = false; + inspecting = noone; + inspectings = []; + inspectGroup = false; + top_bar_h = ui(100); static initSize = function() { content_w = w - ui(32); @@ -397,7 +399,7 @@ function Panel_Inspector() : PanelContent() constructor { } #endregion static drawNodeProperties = function(_y, _m, _inspecting = inspecting) { #region - var con_w = contentPane.surface_w - ui(4); + var con_w = contentPane.surface_w - ui(4); var _hover = pHOVER && contentPane.hover; _inspecting.inspecting = true; @@ -405,23 +407,20 @@ function Panel_Inspector() : PanelContent() constructor { var jun = noone; var amoIn = _inspecting.input_display_list == -1? ds_list_size(_inspecting.inputs) : array_length(_inspecting.input_display_list); var amoOut = ds_list_size(_inspecting.outputs); - var amo = amoIn + 1 + amoOut; - var hh = ui(40); + var amo = inspectGroup == 0? amoIn + 1 + amoOut : amoIn; + var hh = 0; //tb_prop_filter.register(contentPane); //tb_prop_filter.setFocusHover(pHOVER, pFOCUS); //tb_prop_filter.draw(ui(32), _y + ui(4), con_w - ui(64), ui(28), filter_text, _m); //draw_sprite_ui(THEME.search, 0, ui(32 + 16), _y + ui(4 + 14), 1, 1, 0, COLORS._main_icon, 1); - prop_page_button.setFocusHover(pFOCUS, pHOVER); - prop_page_button.draw(ui(32), _y + ui(4), contentPane.w - ui(76), ui(28), prop_page, _m, x + contentPane.x, y + contentPane.y); - var xc = con_w / 2; if(prop_page == 1) { #region attribute/settings editor hh += ui(8); var hg = ui(32); - var yy = hh; + var yy = _y + hh; var wx1 = con_w - ui(8); var ww = max(ui(180), con_w / 3); var wx0 = wx1 - ww; @@ -579,7 +578,7 @@ function Panel_Inspector() : PanelContent() constructor { } else if(i == amoIn) { #region output label hh += ui(8 + 32 + 8); - draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy + ui(8), con_w, ui(32), COLORS.panel_inspector_output_label, 0.85); + draw_sprite_stretched_ext(THEME.group_label, 0, 0, yy + ui(8), con_w, ui(32), COLORS.panel_inspector_output_label, 0.8); draw_set_text(f_p0b, fa_center, fa_center, COLORS._main_text_sub); draw_text_add(xc, yy + ui(8 + 16), __txt("Outputs")); continue; @@ -745,7 +744,38 @@ function Panel_Inspector() : PanelContent() constructor { prop_selecting = noone; if(inspecting == noone) return drawMeta(_y, _m); - return drawNodeProperties(_y, _m); + + prop_page_button.setFocusHover(pFOCUS, pHOVER); + prop_page_button.draw(ui(32), _y + ui(4), contentPane.w - ui(76), ui(28), prop_page, _m, x + contentPane.x, y + contentPane.y); + + var _hh = ui(40); + _y += _hh; + + if(inspectGroup >= 0) return drawNodeProperties(_y, _m, inspecting); + + for( var i = 0, n = min(10, array_length(inspectings)); i < n; i++ ) { + if(i) { + _y += ui(8); + _hh += ui(8); + } + + if(n > 1) { + draw_sprite_stretched_ext(THEME.group_label, 0, 0, _y, con_w, ui(32), COLORS.panel_inspector_output_label, 0.9); + draw_set_text(f_p0b, fa_center, fa_center, COLORS._main_text_sub); + + var _tx = inspectings[i].getFullName(); + draw_text_add(con_w / 2, _y + ui(16), _tx); + + _y += ui(32 + 8); + _hh += ui(32 + 8); + } + + var _h = drawNodeProperties(_y, _m, inspectings[i]); + _y += _h; + _hh += _h; + } + + return _hh; }); #endregion function propSelectCopy() { #region @@ -760,33 +790,43 @@ function Panel_Inspector() : PanelContent() constructor { } #endregion function drawInspectingNode() { #region - tb_node_name.font = f_h5; - tb_node_name.hide = true; - tb_node_name.setFocusHover(pFOCUS, pHOVER); + tb_node_name.font = f_h5; + tb_node_name.hide = true; tb_node_name.align = fa_center; tb_node_name.format = TEXT_AREA_FORMAT.node_title; + tb_node_name.setFocusHover(pFOCUS, pHOVER); + var txt = inspecting.renamed? inspecting.display_name : inspecting.name; + if(inspectGroup == 1) txt = $"[{array_length(PANEL_GRAPH.nodes_selecting)}] {txt}"; + else if(inspectGroup == -1) txt = $"[{array_length(PANEL_GRAPH.nodes_selecting)}] Multiple nodes"; + tb_node_name.draw(ui(64), ui(14), w - ui(128), ui(32), txt, [mx, my]); - draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text_sub); - draw_text_add(w / 2 + ui(8), ui(56), inspecting.name); + if(inspectGroup >= 0) { + draw_set_text(f_p1, fa_center, fa_center, COLORS._main_text_sub); + draw_text_add(w / 2 + ui(8), ui(56), inspecting.name); - draw_set_text(f_p3, fa_center, fa_center, COLORS._main_text_sub); - draw_set_alpha(0.65); - draw_text_add(w / 2, ui(76), inspecting.internalName); - draw_set_alpha(1); - - draw_set_font(f_p1); - var lx = w / 2 - string_width(inspecting.name) / 2 - ui(10); - var ly = ui(56 - 8); - if(buttonInstant(THEME.button_hide, lx, ly, ui(16), ui(16), [mx, my], pFOCUS, pHOVER, __txt("Lock"), THEME.lock, !locked, locked? COLORS._main_icon_light : COLORS._main_icon,, 0.5) == 2) - locked = !locked; + draw_set_text(f_p3, fa_center, fa_center, COLORS._main_text_sub); + draw_set_alpha(0.65); + draw_text_add(w / 2, ui(76), inspecting.internalName); + draw_set_alpha(1); + } var bx = ui(8); var by = ui(12); - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txt("Presets"), THEME.preset, 1) == 2) - dialogCall(o_dialog_preset, x + bx, y + by + ui(36), { "node": inspecting }); + if(inspectGroup == 0) { + draw_set_font(f_p1); + var lx = w / 2 - string_width(inspecting.name) / 2 - ui(10); + var ly = ui(56 - 8); + if(buttonInstant(THEME.button_hide, lx, ly, ui(16), ui(16), [mx, my], pFOCUS, pHOVER, __txt("Lock"), THEME.lock, !locked, locked? COLORS._main_icon_light : COLORS._main_icon,, 0.5) == 2) + locked = !locked; + + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS, pHOVER, __txt("Presets"), THEME.preset, 1) == 2) + dialogCall(o_dialog_preset, x + bx, y + by + ui(36), { "node": inspecting }); + } else { + draw_sprite_ui_uniform(THEME.preset, 1, bx + ui(32) / 2, by + ui(32) / 2, 1, COLORS._main_icon_dark); + } by += ui(36); view_mode_tooltip.index = lineBreak; @@ -795,6 +835,8 @@ function Panel_Inspector() : PanelContent() constructor { PREFERENCES.inspector_view_default = lineBreak; } + //////////////////////////////////////////////////////////////////// INSPECTOR ACTIONS //////////////////////////////////////////////////////////////////// + var bx = w - ui(44); var by = ui(12); @@ -802,9 +844,15 @@ function Panel_Inspector() : PanelContent() constructor { var icon = inspecting.insp1UpdateIcon; var ac = inspecting.insp1UpdateActive; var cc = ac? icon[2] : COLORS._main_icon_dark; + var tt = inspecting.insp1UpdateTooltip; + if(inspectGroup) tt += " [All]"; - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS && ac, pHOVER && ac, inspecting.insp1UpdateTooltip, icon[0], icon[1], cc) == 2) - inspecting.inspector1Update(); + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS && ac, pHOVER && ac, tt, icon[0], icon[1], cc) == 2) { + if(inspectGroup == 1) { + for( var i = 0, n = array_length(inspectings); i < n; i++ ) inspectings[i].inspector1Update(); + } else + inspecting.inspector1Update(); + } } else draw_sprite_ui(THEME.sequence_control, 1, bx + ui(16), by + ui(16),,,, COLORS._main_icon_dark); @@ -813,9 +861,15 @@ function Panel_Inspector() : PanelContent() constructor { var icon = inspecting.insp2UpdateIcon; var ac = inspecting.insp2UpdateActive; var cc = ac? icon[2] : COLORS._main_icon_dark; + var tt = inspecting.insp2UpdateTooltip; + if(inspectGroup) tt += " [All]"; - if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS && ac, pHOVER && ac, inspecting.insp2UpdateTooltip, icon[0], icon[1], cc) = 2) - inspecting.inspector2Update(); + if(buttonInstant(THEME.button_hide, bx, by, ui(32), ui(32), [mx, my], pFOCUS && ac, pHOVER && ac, tt, icon[0], icon[1], cc) = 2) { + if(inspectGroup) { + for( var i = 0, n = array_length(inspectings); i < n; i++ ) inspectings[i].inspector2Update(); + } else + inspecting.inspector2Update(); + } } } #endregion @@ -828,6 +882,15 @@ function Panel_Inspector() : PanelContent() constructor { inspecting = noone; if(inspecting) { + var _ins = instanceof(inspecting); + var _nodes = PANEL_GRAPH.nodes_selecting; + + inspectGroup = array_length(_nodes) > 1; + inspectings = array_empty(_nodes)? [ inspecting ] : _nodes; + + for( var i = 0, n = array_length(_nodes); i < n; i++ ) + if(instanceof(_nodes[i]) != _ins) { inspectGroup = -1; break; } + title = inspecting.renamed? inspecting.display_name : inspecting.name; inspecting.inspectorStep(); drawInspectingNode(); diff --git a/scripts/panel_preview/panel_preview.gml b/scripts/panel_preview/panel_preview.gml index c6d14999f..61c718a09 100644 --- a/scripts/panel_preview/panel_preview.gml +++ b/scripts/panel_preview/panel_preview.gml @@ -443,8 +443,18 @@ function Panel_Preview() : PanelContent() constructor { var dx = mx - d3_camPan_mx; var dy = my - d3_camPan_my; - d3_view_camera.focus_angle_x += dx * 0.2 * d3_pan_speed; - d3_view_camera.focus_angle_y += dy * 0.1 * d3_pan_speed; + var px = d3_view_camera.focus_angle_x; + var py = d3_view_camera.focus_angle_y; + var ax = px + dx * 0.2 * d3_pan_speed; + var ay = py + dy * 0.1 * d3_pan_speed; + + //if(py < 90 && ay >= 90) ax -= 180; + //if(py > 90 && ay <= 90) ax += 180; + + //print($"{ax},\t{ay}"); + + d3_view_camera.focus_angle_x = ax; + d3_view_camera.focus_angle_y = ay; } d3_camPan_mx = mx; @@ -751,8 +761,9 @@ function Panel_Preview() : PanelContent() constructor { sample_x = floor((mx - canvas_x) / canvas_s); sample_y = floor((my - canvas_y) / canvas_s); var surf = getNodePreviewSurface(); - if(is_surface(surf)) - sample_color = surface_get_pixel_ext(surf, sample_x, sample_y); + sample_color = surface_get_pixel_ext(surf, sample_x, sample_y); + + //print($"{dec_to_hex(sample_color)}: {color_get_alpha(int64(sample_color))}"); } } #endregion @@ -1328,6 +1339,7 @@ function Panel_Preview() : PanelContent() constructor { if(sample_color != noone) { draw_set_color(sample_color); draw_rectangle(cx, cy, cx + cw, cy + ch, false); + draw_set_alpha(1); } draw_set_color(COLORS.panel_toolbar_outline); diff --git a/scripts/surface_functions/surface_functions.gml b/scripts/surface_functions/surface_functions.gml index dd8239a9a..aff837c43 100644 --- a/scripts/surface_functions/surface_functions.gml +++ b/scripts/surface_functions/surface_functions.gml @@ -207,10 +207,10 @@ function surface_get_pixel_ext(surface, _x, _y) { #region INLINE - if(!is_surface(surface)) return; + if(!is_surface(surface)) return 0; var px = surface_getpixel_ext(surface, _x, _y); - if(is_numeric(px)) return px; + if(is_numeric(px)) return int64(px); return round(px[0] * (255 * power(256, 0))) + round(px[1] * (255 * power(256, 1))) + round(px[2] * (255 * power(256, 2))) + round(px[3] * (255 * power(256, 3))); } #endregion diff --git a/shaders/sh_blend_edge/sh_blend_edge.fsh b/shaders/sh_blend_edge/sh_blend_edge.fsh new file mode 100644 index 000000000..7b0bbc75f --- /dev/null +++ b/shaders/sh_blend_edge/sh_blend_edge.fsh @@ -0,0 +1,36 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec2 dimension; +uniform int edge; + +uniform vec2 width; +uniform int widthUseSurf; +uniform sampler2D widthSurf; + +uniform float blend; + +void main() { + float wid = width.x; + float widMax = max(width.x, width.y); + if(widthUseSurf == 1) { + vec4 _vMap = texture2D( widthSurf, v_vTexcoord ); + wid = mix(width.x, width.y, (_vMap.r + _vMap.g + _vMap.b) / 3.); + } + + float bnd = 1. - blend; + vec4 off; + float m = 0.; + vec2 v = 1. - max(vec2(0.), abs(v_vTexcoord - 0.5) * 2. / wid - bnd) / (1. - bnd); + vec2 vi = 1. - max(vec2(0.), (1. - abs(v_vTexcoord - 0.5) * 2.) / wid - bnd) / (1. - bnd); + float mi = 1. - max(vi.x, vi.y); + + if(edge == 0) m = min(max(v.x, v.y), max(v.x, v.y) + mi - 1.); + else if(edge == 1) m = v.x; + else if(edge == 2) m = v.y; + + m = clamp(m, 0., 1.); + //m = smoothstep(0., 1., m); + + gl_FragColor = vec4(vec3(m), 1.); +} diff --git a/shaders/sh_blend_edge/sh_blend_edge.vsh b/shaders/sh_blend_edge/sh_blend_edge.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_blend_edge/sh_blend_edge.vsh @@ -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; +} diff --git a/shaders/sh_blend_edge/sh_blend_edge.yy b/shaders/sh_blend_edge/sh_blend_edge.yy new file mode 100644 index 000000000..3a362baf0 --- /dev/null +++ b/shaders/sh_blend_edge/sh_blend_edge.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_blend_edge", + "parent": { + "name": "blend edge", + "path": "folders/shader/filter/blend edge.yy", + }, + "type": 1, +} \ No newline at end of file diff --git a/shaders/sh_blend_edge_blend/sh_blend_edge_blend.fsh b/shaders/sh_blend_edge_blend/sh_blend_edge_blend.fsh new file mode 100644 index 000000000..7d4e69c7c --- /dev/null +++ b/shaders/sh_blend_edge_blend/sh_blend_edge_blend.fsh @@ -0,0 +1,26 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec2 dimension; +uniform int edge; + +uniform sampler2D mask; + +void main() { + float msk = texture2D( mask, v_vTexcoord ).r; + vec4 cur = texture2D( gm_BaseTexture, v_vTexcoord ); + vec4 off; + + if(edge == 0) { + off = texture2D( gm_BaseTexture, fract(v_vTexcoord + vec2(0.5, 0.5)) ); + + } else if(edge == 1) { + off = texture2D( gm_BaseTexture, fract(v_vTexcoord + vec2(0.5, 0.0)) ); + + } else if(edge == 2) { + off = texture2D( gm_BaseTexture, fract(v_vTexcoord + vec2(0.0, 0.5)) ); + + } + + gl_FragColor = mix(off, cur, msk); +} diff --git a/shaders/sh_blend_edge_blend/sh_blend_edge_blend.vsh b/shaders/sh_blend_edge_blend/sh_blend_edge_blend.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_blend_edge_blend/sh_blend_edge_blend.vsh @@ -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; +} diff --git a/shaders/sh_blend_edge_blend/sh_blend_edge_blend.yy b/shaders/sh_blend_edge_blend/sh_blend_edge_blend.yy new file mode 100644 index 000000000..2e1dff3c6 --- /dev/null +++ b/shaders/sh_blend_edge_blend/sh_blend_edge_blend.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_blend_edge_blend", + "parent": { + "name": "blend edge", + "path": "folders/shader/filter/blend edge.yy", + }, + "type": 1, +} \ No newline at end of file diff --git a/shaders/sh_blend_edge_extract/sh_blend_edge_extract.fsh b/shaders/sh_blend_edge_extract/sh_blend_edge_extract.fsh new file mode 100644 index 000000000..7b0bbc75f --- /dev/null +++ b/shaders/sh_blend_edge_extract/sh_blend_edge_extract.fsh @@ -0,0 +1,36 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec2 dimension; +uniform int edge; + +uniform vec2 width; +uniform int widthUseSurf; +uniform sampler2D widthSurf; + +uniform float blend; + +void main() { + float wid = width.x; + float widMax = max(width.x, width.y); + if(widthUseSurf == 1) { + vec4 _vMap = texture2D( widthSurf, v_vTexcoord ); + wid = mix(width.x, width.y, (_vMap.r + _vMap.g + _vMap.b) / 3.); + } + + float bnd = 1. - blend; + vec4 off; + float m = 0.; + vec2 v = 1. - max(vec2(0.), abs(v_vTexcoord - 0.5) * 2. / wid - bnd) / (1. - bnd); + vec2 vi = 1. - max(vec2(0.), (1. - abs(v_vTexcoord - 0.5) * 2.) / wid - bnd) / (1. - bnd); + float mi = 1. - max(vi.x, vi.y); + + if(edge == 0) m = min(max(v.x, v.y), max(v.x, v.y) + mi - 1.); + else if(edge == 1) m = v.x; + else if(edge == 2) m = v.y; + + m = clamp(m, 0., 1.); + //m = smoothstep(0., 1., m); + + gl_FragColor = vec4(vec3(m), 1.); +} diff --git a/shaders/sh_blend_edge_extract/sh_blend_edge_extract.vsh b/shaders/sh_blend_edge_extract/sh_blend_edge_extract.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_blend_edge_extract/sh_blend_edge_extract.vsh @@ -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; +} diff --git a/shaders/sh_blend_edge_extract/sh_blend_edge_extract.yy b/shaders/sh_blend_edge_extract/sh_blend_edge_extract.yy new file mode 100644 index 000000000..0e5cb890f --- /dev/null +++ b/shaders/sh_blend_edge_extract/sh_blend_edge_extract.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_blend_edge_extract", + "parent": { + "name": "blend edge", + "path": "folders/shader/filter/blend edge.yy", + }, + "type": 1, +} \ No newline at end of file diff --git a/shaders/sh_noise_strand/sh_noise_strand.fsh b/shaders/sh_noise_strand/sh_noise_strand.fsh new file mode 100644 index 000000000..d7c5007e5 --- /dev/null +++ b/shaders/sh_noise_strand/sh_noise_strand.fsh @@ -0,0 +1,42 @@ +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec2 u_resolution; +uniform vec2 position; +uniform float density; +uniform float seed; +uniform float slope; + +uniform float curve; +uniform float curveDetail; +uniform float thickness; + +float random (in vec2 st) { return fract(sin(dot(st.xy + vec2(1., 6.), vec2(2., 7.))) * (1. + seed)); } + +void main() { + vec2 tx = 1. / u_resolution; + vec2 pos = v_vTexcoord + position; + float w = 0.; + + float _t = min(tx.x, tx.y) / 2.; + float mt = 1. - _t; + float rp = u_resolution.x; + int amo = int(density * rp); + + for (int i = 0; i < amo; i++) { + float _x = random(vec2(float(i), 1.)); + float _y = random(vec2(1., float(i))); + + float _s = random(vec2(2., float(i))) - 0.5; + float _a = random(vec2(float(i), 2.)); + + _x += _s * 2. * (pos.y - _y) * slope; + _x += sin((pos.y - _y) * curveDetail * u_resolution.y / 4.) * curve / u_resolution.x * 2.; + + float st = smoothstep(mt - thickness, mt + thickness, 1. - abs(pos.x - _x)) * _a; + + w = max(w, st); + } + + gl_FragColor = vec4(vec3(w), 1.); +} diff --git a/shaders/sh_noise_strand/sh_noise_strand.vsh b/shaders/sh_noise_strand/sh_noise_strand.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_noise_strand/sh_noise_strand.vsh @@ -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; +} diff --git a/shaders/sh_noise_strand/sh_noise_strand.yy b/shaders/sh_noise_strand/sh_noise_strand.yy new file mode 100644 index 000000000..86a126432 --- /dev/null +++ b/shaders/sh_noise_strand/sh_noise_strand.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_noise_strand", + "parent": { + "name": "noise", + "path": "folders/shader/generator/noise.yy", + }, + "type": 1, +} \ No newline at end of file diff --git a/sprites/s_node_strand_noise/58394d46-a521-4621-ad94-582aea25b18e.png b/sprites/s_node_strand_noise/58394d46-a521-4621-ad94-582aea25b18e.png new file mode 100644 index 0000000000000000000000000000000000000000..383a881d62a9f52206bf971c382cae915ec3361c GIT binary patch literal 1702 zcmZ{kdsGs57RP@)Lex|W(x$?7O&lD>gRHNpTr}{JfzKRY8RcU{$FxMunv^vuI|^f1 z<|7le@hz355=NS{n>~Ew;-l3CS<4iape8e4xy(O%&i*myo_oLN+BIc0sxr!`BH=RO8GsJ2z_m0omT3_D%Llc4!}8E0JwPotm<3bIRG+<0L(K1AeRDQ zk#mhg3aGUB&#n5U`v@F)id<$#7xxw;9tp@gMm-B{^f(|^sR5Eu_!Y6 z5p11Pl)L5jMUuY`itjhQ`Hi`1u}6)sM9h6Mnl8+^fIIdaq1^j}H}9{jSpV4=^^0#0 z+o9st*!*su3-_lgQ+G8A1;c~>?5+a zjr$1`hnkzVkFS0FSQDUfFiuLhP{Lm!x{xBRPY{L*0ESk5te!P-{&Gj(*h&ymgsnR+ zaqzc?c!=WZ_41g@>h=O=DpdMwS@SCwXu|!nrH9S$2NGgif6fLIO3R;UDD$fYZ(c_T z0uDw;wuVK1t--gLH|$Ukw}74gMe$`&QJcep9dW>4lZBzhzyq(RmOnk57WFkTjJvx- zL%fDRfE7CbY#eG}Tl~CwD;dk_Qhc#~=2FvI>dJlWW&; z9t4~^b^wvkCdk#n-1uIAHrcSJw5zYrM^o-t;@u9_=q65ej?L~VuT#&|PTN5$5pHg7 zW3#q!H28EOodr8${SJ0mH!~BDf;O+}q z$(Bj3Ja?WKiz0@@8V-$kot$hWWU>tCH&NyArAg{typd~87qtVIWHR^9Fd_a{RaH(2 z7&OA;(ogS8W=;s)epz15By7s%#TJl@&Q^lhBlRJl|MjD5`XK96{kYH8T72)y%0rHJ zak0PI?4o|r>tDXS5?d7T?r;6>((>~1G(TkU;wJ?gO9d%C3k%Jh%DTq;o>{kIJ13Vu z^0uqG9$99<_1BV-Kq|{8qvz3SA&aZ46L-*us72O-H!;jm>r2s#jFaAURc>o-6h!{s zL6(|?qK}kI`WsT5Y_5E7+5xTG=xlR1zp#OFV$)$2yblpE254ph7~Ud`W6WlWk4-5Q z5nD#Qxi@ggN+|mo=Q7sf&q8;14>=d{gH-i-ulFeMLl#P(3Dbe|V*E?FGyh(Q#~Q>F z?#sx^`?B&NI>d7FZw4W2J~(c+-KiZGv>>g$Umb+^7UO&Ls7#vZfzG7{Zs#VJ+dg}8 zwZ%k&k}OzVGW3K8roMdO$KTeb~{_sDM{w*6h60RIty~5+dH{EV9bC&+W(Noxv)1@xc_zc@*+IiC^Nk|B%}W zNf7=s;zB<&ktu)Y;-xYR91H%%6WkKunTbeBlyclS2x-!_g-3unijV8@eV&&2Bm zkccE_0+B=@I)xIQ$s`xDlbbz}NG1|DP}Hmc2c)FNu@bWW7$~H#6Z8Q7e-3O`N_;x| XL`vEpGn3(pk9r39(HK;*7c=+2xYqbf literal 0 HcmV?d00001 diff --git a/sprites/s_node_strand_noise/layers/58394d46-a521-4621-ad94-582aea25b18e/91f7785d-8ec5-4bd2-97c6-09f8c66dba59.png b/sprites/s_node_strand_noise/layers/58394d46-a521-4621-ad94-582aea25b18e/91f7785d-8ec5-4bd2-97c6-09f8c66dba59.png new file mode 100644 index 0000000000000000000000000000000000000000..383a881d62a9f52206bf971c382cae915ec3361c GIT binary patch literal 1702 zcmZ{kdsGs57RP@)Lex|W(x$?7O&lD>gRHNpTr}{JfzKRY8RcU{$FxMunv^vuI|^f1 z<|7le@hz355=NS{n>~Ew;-l3CS<4iape8e4xy(O%&i*myo_oLN+BIc0sxr!`BH=RO8GsJ2z_m0omT3_D%Llc4!}8E0JwPotm<3bIRG+<0L(K1AeRDQ zk#mhg3aGUB&#n5U`v@F)id<$#7xxw;9tp@gMm-B{^f(|^sR5Eu_!Y6 z5p11Pl)L5jMUuY`itjhQ`Hi`1u}6)sM9h6Mnl8+^fIIdaq1^j}H}9{jSpV4=^^0#0 z+o9st*!*su3-_lgQ+G8A1;c~>?5+a zjr$1`hnkzVkFS0FSQDUfFiuLhP{Lm!x{xBRPY{L*0ESk5te!P-{&Gj(*h&ymgsnR+ zaqzc?c!=WZ_41g@>h=O=DpdMwS@SCwXu|!nrH9S$2NGgif6fLIO3R;UDD$fYZ(c_T z0uDw;wuVK1t--gLH|$Ukw}74gMe$`&QJcep9dW>4lZBzhzyq(RmOnk57WFkTjJvx- zL%fDRfE7CbY#eG}Tl~CwD;dk_Qhc#~=2FvI>dJlWW&; z9t4~^b^wvkCdk#n-1uIAHrcSJw5zYrM^o-t;@u9_=q65ej?L~VuT#&|PTN5$5pHg7 zW3#q!H28EOodr8${SJ0mH!~BDf;O+}q z$(Bj3Ja?WKiz0@@8V-$kot$hWWU>tCH&NyArAg{typd~87qtVIWHR^9Fd_a{RaH(2 z7&OA;(ogS8W=;s)epz15By7s%#TJl@&Q^lhBlRJl|MjD5`XK96{kYH8T72)y%0rHJ zak0PI?4o|r>tDXS5?d7T?r;6>((>~1G(TkU;wJ?gO9d%C3k%Jh%DTq;o>{kIJ13Vu z^0uqG9$99<_1BV-Kq|{8qvz3SA&aZ46L-*us72O-H!;jm>r2s#jFaAURc>o-6h!{s zL6(|?qK}kI`WsT5Y_5E7+5xTG=xlR1zp#OFV$)$2yblpE254ph7~Ud`W6WlWk4-5Q z5nD#Qxi@ggN+|mo=Q7sf&q8;14>=d{gH-i-ulFeMLl#P(3Dbe|V*E?FGyh(Q#~Q>F z?#sx^`?B&NI>d7FZw4W2J~(c+-KiZGv>>g$Umb+^7UO&Ls7#vZfzG7{Zs#VJ+dg}8 zwZ%k&k}OzVGW3K8roMdO$KTeb~{_sDM{w*6h60RIty~5+dH{EV9bC&+W(Noxv)1@xc_zc@*+IiC^Nk|B%}W zNf7=s;zB<&ktu)Y;-xYR91H%%6WkKunTbeBlyclS2x-!_g-3unijV8@eV&&2Bm zkccE_0+B=@I)xIQ$s`xDlbbz}NG1|DP}Hmc2c)FNu@bWW7$~H#6Z8Q7e-3O`N_;x| XL`vEpGn3(pk9r39(HK;*7c=+2xYqbf literal 0 HcmV?d00001 diff --git a/sprites/s_node_strand_noise/s_node_strand_noise.yy b/sprites/s_node_strand_noise/s_node_strand_noise.yy new file mode 100644 index 000000000..493ebc607 --- /dev/null +++ b/sprites/s_node_strand_noise/s_node_strand_noise.yy @@ -0,0 +1,74 @@ +{ + "resourceType": "GMSprite", + "resourceVersion": "1.0", + "name": "s_node_strand_noise", + "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":"58394d46-a521-4621-ad94-582aea25b18e",}, + ], + "gridX": 0, + "gridY": 0, + "height": 64, + "HTile": false, + "layers": [ + {"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"91f7785d-8ec5-4bd2-97c6-09f8c66dba59","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_strand_noise", + "autoRecord": true, + "backdropHeight": 768, + "backdropImageOpacity": 0.5, + "backdropImagePath": "", + "backdropWidth": 1366, + "backdropXOffset": 0.0, + "backdropYOffset": 0.0, + "events": {"resourceType":"KeyframeStore","resourceVersion":"1.0","Keyframes":[],}, + "eventStubScript": null, + "eventToFunction": {}, + "length": 1.0, + "lockOrigin": false, + "moments": {"resourceType":"KeyframeStore","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","resourceVersion":"1.0","Keyframes":[ + {"resourceType":"Keyframe","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"58394d46-a521-4621-ad94-582aea25b18e","path":"sprites/s_node_strand_noise/s_node_strand_noise.yy",},},},"Disabled":false,"id":"25648bea-fea8-48a3-831d-d0d6e95d3ba7","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, +} \ No newline at end of file