From 241f08251d3af26b11aec7a113374d12f1bbe231 Mon Sep 17 00:00:00 2001 From: Tanasart <22589759+Ttanasart-pt@users.noreply.github.com> Date: Tue, 4 Apr 2023 09:49:33 +0200 Subject: [PATCH] 1.14pr8.2 patch --- objects/o_dialog_add_node/Create_0.gml | 2 ++ objects/o_main/Step_1.gml | 2 +- scripts/__VFX/__VFX.gml | 1 - scripts/globals/globals.gml | 2 +- scripts/node_data/node_data.gml | 17 +++++------ .../node_group_output/node_group_output.gml | 7 +++++ scripts/node_line/node_line.gml | 9 +++--- scripts/node_path/node_path.gml | 2 +- scripts/node_registry/node_registry.gml | 2 +- scripts/node_rigid_group/node_rigid_group.gml | 30 +++++++++---------- .../node_rigid_object/node_rigid_object.gml | 8 ++--- scripts/render_data/render_data.gml | 4 +-- shaders/sh_downsample/sh_downsample.fsh | 2 +- shaders/sh_sample/sh_sample.fsh | 2 +- 14 files changed, 48 insertions(+), 42 deletions(-) diff --git a/objects/o_dialog_add_node/Create_0.gml b/objects/o_dialog_add_node/Create_0.gml index a8e593b4e..918a18f8d 100644 --- a/objects/o_dialog_add_node/Create_0.gml +++ b/objects/o_dialog_add_node/Create_0.gml @@ -527,6 +527,8 @@ event_inherited(); for(var i = 0; i < ds_list_size(NODE_CATEGORY); i++) { var cat = NODE_CATEGORY[| i]; + if(i == NODE_PAGE_DEFAULT) + continue; if(array_length(cat.filter) && !array_exists(cat.filter, context)) continue; diff --git a/objects/o_main/Step_1.gml b/objects/o_main/Step_1.gml index 3d1697ccd..abf137d26 100644 --- a/objects/o_main/Step_1.gml +++ b/objects/o_main/Step_1.gml @@ -69,7 +69,7 @@ } #endregion -#region nodes +#region render DEF_SURFACE_RESET(); var _k = ds_map_find_first(NODE_MAP); diff --git a/scripts/__VFX/__VFX.gml b/scripts/__VFX/__VFX.gml index 3ada72c45..7adeecc57 100644 --- a/scripts/__VFX/__VFX.gml +++ b/scripts/__VFX/__VFX.gml @@ -219,7 +219,6 @@ function __part(_node) constructor { if(blend != c_white) cc = colorMultiply(blend, cc); alp_draw = alp * eval_curve_x(alp_fade, lifeRat); - shader_set_f("sampleDimension", surface_get_width(ss), surface_get_height(ss)); draw_surface_ext_safe(ss, _xx, _yy, scx, scy, rot, cc, alp_draw); } diff --git a/scripts/globals/globals.gml b/scripts/globals/globals.gml index 4e010472e..4551f99f2 100644 --- a/scripts/globals/globals.gml +++ b/scripts/globals/globals.gml @@ -33,7 +33,7 @@ globalvar VERSION, SAVEFILE_VERSION, VERSION_STRING; VERSION = 1140; SAVEFILE_VERSION = 1400; - VERSION_STRING = "1.14.0pr8"; + VERSION_STRING = "1.14.0pr8.2"; globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT, NODE_INSTANCES; diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index ebbf51278..8c42b00fd 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -248,16 +248,13 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x var willUpdate = false; if(ANIMATOR.frame_progress) { - if(update_on_frame) - willUpdate = true; + if(update_on_frame) willUpdate = true; + if(isAnimated()) willUpdate = true; - if(isAnimated()) - willUpdate = true; - } - - if(willUpdate) { - setRenderStatus(false); - UPDATE |= RENDER_TYPE.partial; + if(willUpdate) { + setRenderStatus(false); + UPDATE |= RENDER_TYPE.partial; + } } if(auto_height) @@ -352,7 +349,7 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x if( val_from == noone) continue; if(!val_from.node.active) continue; if(!val_from.node.renderActive) continue; - if(!val_from.node.rendered) + if(!val_from.node.rendered && !val_from.node.update_on_frame) return false; } diff --git a/scripts/node_group_output/node_group_output.gml b/scripts/node_group_output/node_group_output.gml index 9f4790ce1..0683ab727 100644 --- a/scripts/node_group_output/node_group_output.gml +++ b/scripts/node_group_output/node_group_output.gml @@ -18,6 +18,13 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr outParent = undefined; output_index = -1; + static setRenderStatus = function(result) { + LOG_LINE_IF(global.RENDER_LOG, "Set render status for " + name + " : " + string(result)); + + rendered = result; + if(group) group.setRenderStatus(result); + } + static onValueUpdate = function(index = 0) { if(is_undefined(outParent)) return; diff --git a/scripts/node_line/node_line.gml b/scripts/node_line/node_line.gml index 6752ef853..af2f53915 100644 --- a/scripts/node_line/node_line.gml +++ b/scripts/node_line/node_line.gml @@ -102,8 +102,8 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons inputs[| 14].setVisible(px); inputs[| 18].setVisible(px); - inputs[| 15].setVisible(_tex); - inputs[| 16].setVisible(_tex); + inputs[| 15].setVisible(!_tex); + inputs[| 16].setVisible(!_tex); inputs[| 2].setVisible(!_flen); inputs[| 20].setVisible( _flen); @@ -238,8 +238,9 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons _ny += lengthdir_y(random1D(_sed + _sedIndex, -_wig, _wig), _d + 90); _sedIndex++; } - if(_prog_total >= _pathStr) //Do not point before range start. Do this instead of starting at _rtStr to prevent wiggle. - array_push(points, [ _nx, _ny, _prog_total / _pathEnd, _prog_curr ]); + if(_prog_total >= _pathStr) { //Do not add point before range start. Do this instead of starting at _rtStr to prevent wiggle. + array_push(points, [ _nx, _ny, _prog_total / _pathEnd, _prog_curr / _pathLength ]); + } if(_prog_next > _prog_curr) { _prog_total += _prog_next - _prog_curr; diff --git a/scripts/node_path/node_path.gml b/scripts/node_path/node_path.gml index 48d36576c..355fbb679 100644 --- a/scripts/node_path/node_path.gml +++ b/scripts/node_path/node_path.gml @@ -4,7 +4,7 @@ function Node_Path(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { w = 96; - inputs[| 0] = nodeValue("Path progress", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0) + inputs[| 0] = nodeValue("Path progress", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0, "Sample position from path.") .setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]); inputs[| 1] = nodeValue("Loop", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false) diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 9a852baaa..3c29deaad 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -294,7 +294,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { addNodeObject(filter, "Convolution", s_node_convolution, "Node_Convolution", [1, Node_Convolution], ["kernel"], "Apply convolution operation on each pixel using a custom 3x3 kernel.").setVersion(1090); addNodeObject(filter, "Local Analyze", s_node_local_analyze, "Node_Local_Analyze", [1, Node_Local_Analyze],, "Apply non-linear operation (minimum, maximum) on each pixel locally.").setVersion(1110); addNodeObject(filter, "SDF", s_node_sdf, "Node_SDF", [1, Node_SDF],, "Create signed distance field using jump flooding algorithm.").setVersion(1130); - addNodeObject(filter, "Replace Image", s_node_image_replace, "Node_Surface_Replace", [1, Node_Surface_Replace]).setVersion(1140); + addNodeObject(filter, "Replace Image", s_node_image_replace, "Node_Surface_Replace", [1, Node_Surface_Replace], ["image replace"]).setVersion(1140); addNodeObject(filter, "Chromatic Aberration", s_node_chromatic_abarration, "Node_Chromatic_Aberration", [1, Node_Chromatic_Aberration],, "Apply chromatic aberration effect to the image."); ds_list_add(filter, "Colors"); diff --git a/scripts/node_rigid_group/node_rigid_group.gml b/scripts/node_rigid_group/node_rigid_group.gml index 72f17a31e..1abec5376 100644 --- a/scripts/node_rigid_group/node_rigid_group.gml +++ b/scripts/node_rigid_group/node_rigid_group.gml @@ -18,23 +18,23 @@ function Node_Rigid_Group(_x, _y, _group = noone) : Node_Collection(_x, _y, _gro //physics_world_update_iterations(30); //physics_world_update_speed(100) - //static reset = function() { - // instance_destroy(oRigidbody); - // physics_pause_enable(true); + static reset = function() { + instance_destroy(oRigidbody); + physics_pause_enable(true); - // var node_list = getNodeList(); - // for( var i = 0; i < ds_list_size(node_list); i++ ) { - // var n = node_list[| i]; - // if(variable_struct_exists(n, "reset")) - // n.reset(); - // } - // physics_pause_enable(false); - //} + var node_list = getNodeList(); + for( var i = 0; i < ds_list_size(node_list); i++ ) { + var n = node_list[| i]; + if(variable_struct_exists(n, "reset")) + n.reset(); + } + physics_pause_enable(false); + } - //static update = function() { - // if(ANIMATOR.current_frame == 0) - // reset(); - //} + static update = function() { + if(ANIMATOR.current_frame == 0) + reset(); + } PATCH_STATIC } \ No newline at end of file diff --git a/scripts/node_rigid_object/node_rigid_object.gml b/scripts/node_rigid_object/node_rigid_object.gml index d151abf62..8a02c3e76 100644 --- a/scripts/node_rigid_object/node_rigid_object.gml +++ b/scripts/node_rigid_object/node_rigid_object.gml @@ -673,7 +673,7 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr } static step = function() { - var _shp = inputs[| 5].getValue(); + var _shp = inputs[| 5].getValue(); inputs[| 9].setVisible(_shp == 2); var _tex = inputs[| 6].getValue(); @@ -688,9 +688,6 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr } static reset = function() { - var _spwn = inputs[| 8].getValue(); - if(!_spwn) return; - var _tex = inputs[| 6].getValue(); for( var i = 0; i < array_length(object); i++ ) { if(instance_exists(object[i])) @@ -698,6 +695,9 @@ function Node_Rigid_Object(_x, _y, _group = noone) : Node(_x, _y, _group) constr } object = []; + var _spwn = inputs[| 8].getValue(); + if(!_spwn) return; + if(is_array(_tex)) { for( var i = 0; i < array_length(_tex); i++ ) object[i] = spawn(noone, i); diff --git a/scripts/render_data/render_data.gml b/scripts/render_data/render_data.gml index f277eadfe..99138265d 100644 --- a/scripts/render_data/render_data.gml +++ b/scripts/render_data/render_data.gml @@ -180,9 +180,9 @@ function RenderListAction(list, context = PANEL_GRAPH.getCurrentContext()) { rendering = ds_queue_dequeue(RENDER_QUEUE); if(rendering.group == context) break; - var txt = rendering.rendered? " [Skip]" : " [Update]"; + var txt = rendering.isRenderable()? " [Skip]" : " [Update]"; - if(!rendering.rendered) { + if(!rendering.isRenderable()) { rendering.doUpdate(); if(rendering.hasInspector1Update()) { rendering.inspector1Update(); diff --git a/shaders/sh_downsample/sh_downsample.fsh b/shaders/sh_downsample/sh_downsample.fsh index 8ee3669b3..2fdafe8b9 100644 --- a/shaders/sh_downsample/sh_downsample.fsh +++ b/shaders/sh_downsample/sh_downsample.fsh @@ -19,5 +19,5 @@ void main() { col /= down * down; - gl_FragColor = col; + gl_FragColor = col * v_vColour; } diff --git a/shaders/sh_sample/sh_sample.fsh b/shaders/sh_sample/sh_sample.fsh index 1170e64a8..06e2f35b3 100644 --- a/shaders/sh_sample/sh_sample.fsh +++ b/shaders/sh_sample/sh_sample.fsh @@ -53,5 +53,5 @@ vec4 texture2Dintp( sampler2D texture, vec2 uv ) { /////////////// SAMPLING /////////////// void main() { - gl_FragColor = texture2Dintp( gm_BaseTexture, v_vTexcoord ); + gl_FragColor = texture2Dintp( gm_BaseTexture, v_vTexcoord ) * v_vColour; } \ No newline at end of file