From 60ab58024990ee209d0643cad9d2fc702c0c03ed Mon Sep 17 00:00:00 2001 From: Tanasart Date: Sun, 5 May 2024 09:59:13 +0700 Subject: [PATCH] - [Preview Panel] Fix onion skin error. --- scripts/node_surface_replace/node_surface_replace.gml | 2 +- scripts/panel_preview/panel_preview.gml | 2 +- .../sh_surface_replace_fast_replace.fsh | 1 - shaders/sh_surface_replace_find/sh_surface_replace_find.fsh | 3 --- 4 files changed, 2 insertions(+), 6 deletions(-) diff --git a/scripts/node_surface_replace/node_surface_replace.gml b/scripts/node_surface_replace/node_surface_replace.gml index 188275893..cda7706a9 100644 --- a/scripts/node_surface_replace/node_surface_replace.gml +++ b/scripts/node_surface_replace/node_surface_replace.gml @@ -97,7 +97,7 @@ function Node_Surface_Replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _ var amo = array_length(_tar); for( var i = 0; i < amo; i++ ) matchTemplate(i / amo, temp_surface[0], _bas, _tar[i], _cthr, _pthr, _fst); - return temp_surface[0]; + //return temp_surface[0]; _outSurf = surface_verify(_outSurf, _sw, _sh); surface_set_target(_outSurf); diff --git a/scripts/panel_preview/panel_preview.gml b/scripts/panel_preview/panel_preview.gml index 6427b3e70..c742ff8af 100644 --- a/scripts/panel_preview/panel_preview.gml +++ b/scripts/panel_preview/panel_preview.gml @@ -728,7 +728,7 @@ function Panel_Preview() : PanelContent() constructor { switch(tileMode) { case 0 : - if(PROJECT.onion_skin.enabled) drawOnionSkin(node, psx, psy, ss); + if(PROJECT.onion_skin.enabled) drawOnionSkin(_node, psx, psy, ss); else draw_surface_ext(preview_surface[0], psx, psy, ss, ss, 0, c_white, preview_node[0].preview_alpha); break; diff --git a/shaders/sh_surface_replace_fast_replace/sh_surface_replace_fast_replace.fsh b/shaders/sh_surface_replace_fast_replace/sh_surface_replace_fast_replace.fsh index b0ccfe491..d1be80dab 100644 --- a/shaders/sh_surface_replace_fast_replace/sh_surface_replace_fast_replace.fsh +++ b/shaders/sh_surface_replace_fast_replace/sh_surface_replace_fast_replace.fsh @@ -24,7 +24,6 @@ void main() { if(wg.r == 1. && abs(wg.g - index) < 0.01) { gl_FragColor = texture2D( replace, (replace_dim - vec2(i, j) - 1. + .5) / replace_dim ); - //gl_FragColor = vec4((replace_dim - vec2(i, j)) / replace_dim, 0., 1.); return; } } diff --git a/shaders/sh_surface_replace_find/sh_surface_replace_find.fsh b/shaders/sh_surface_replace_find/sh_surface_replace_find.fsh index f9495b608..fa89e5ee2 100644 --- a/shaders/sh_surface_replace_find/sh_surface_replace_find.fsh +++ b/shaders/sh_surface_replace_find/sh_surface_replace_find.fsh @@ -29,7 +29,6 @@ float matchTemplate(vec2 pos) { for( float i = 0.; i < targetDimension.x; i++ ) for( float j = 0.; j < targetDimension.y; j++ ) { vec4 targ = texture2D( target, vec2(0.5 + i, 0.5 + j) * targTx ); - if(targ.a == 0.) continue; vec2 bpx = pos + vec2(i, j); vec4 base = texture2D( gm_BaseTexture, bpx * baseTx ); @@ -45,8 +44,6 @@ void main() { gl_FragColor = vec4(0.); vec4 base = texture2D( gm_BaseTexture, v_vTexcoord ); - if(base.a == 0.) - return; vec2 px = v_vTexcoord * dimension;