From 767a94dfc44dbede854e2ca87fb1621900d86e77 Mon Sep 17 00:00:00 2001 From: Till Date: Thu, 10 Feb 2022 09:15:07 +0000 Subject: [PATCH] Added mask input to Color Balance, Hue Saturation, Invert, Levels. --- shaders/colorbalance.comp | 11 ++++++++++- shaders/colorbalance_comp.spv | Bin 2624 -> 3108 bytes shaders/huesat.comp | 7 ++++++- shaders/huesat_comp.spv | Bin 3676 -> 4080 bytes shaders/invert.comp | 10 +++++++++- shaders/invert_comp.spv | Bin 2292 -> 2776 bytes shaders/levels.comp | 22 ++++++++++++++-------- shaders/levels_comp.spv | Bin 4168 -> 4616 bytes src/nodedefinitions.h | 32 ++++++++++++++++++++------------ 9 files changed, 59 insertions(+), 23 deletions(-) diff --git a/shaders/colorbalance.comp b/shaders/colorbalance.comp index 2d7d1acb..c36f57e2 100644 --- a/shaders/colorbalance.comp +++ b/shaders/colorbalance.comp @@ -14,6 +14,7 @@ layout(set = 0, binding = 3) uniform InputBuffer layout(offset = 4) float balG; layout(offset = 8) float balB; layout(offset = 12) float presLuma; + layout(offset = 16) float useMask; } sb; void main() @@ -22,7 +23,10 @@ void main() ivec2 pixelCoords = ivec2(gl_GlobalInvocationID.xy); - vec4 pixel = imageLoad(inputBack, pixelCoords).rgba; + vec4 pixel = imageLoad(inputBack, pixelCoords).rgba; + float mask = imageLoad(inputFront, pixelCoords).a; + + vec4 original = pixel; float luma = dot(pixel.rgb, vec3(.25, .5, .25)); pixel.r *= 1.0 + sb.balR; @@ -31,6 +35,11 @@ void main() if (sb.presLuma > 0.5) { pixel.rgb *= luma / dot(pixel.rgb, vec3(.25, .5, .25)); } + + if (sb.useMask > 0.5) + { + pixel = mix(original, pixel, mask); + } imageStore(resultImage, pixelCoords, pixel); diff --git a/shaders/colorbalance_comp.spv b/shaders/colorbalance_comp.spv index 9e0e0716597da8cbf4ea219802240c4ebc06a829..099d3b825d8ac4eb6b5f4088bfcaf9b2c7fbf811 100644 GIT binary patch literal 3108 zcmZ9M*>Y4>6o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?Ctm%J}T=l*ZDYG?muVXdOu7AStQOpl8x# z;n!EzR_3;c>vLz%oi=iBs;G*+eZ)*)??N`3-M;uCWIwprfx^}w#aG~tWB);+2_nk8 z36N>_x*N@howe>y9c;0u#rm5&!^LL%`;3`yv-@MGw=@`Rt#1=GRn&dhyI1cGTFqXg z|HGi&9Cio&#?^weE4>h$>{rpfosA}{sPhK8QPkOa@Sw9*oJ`C`#ye_HE9O0c)ytUY z0$UtmlSQ02wYk;VUirUHC7lG@ZjEZ*#b$e_H*9$7qK`IMao+1&gZ?n3I=AE<97kN? z*G4XWrPzNq?|J_-$cxBw?iVx7`ojv$Gl=;Hfq4e8sS;Mn*i&e0d4A*U!?Tq8(zh=; z?t8xSzP|gxZ(-Z(bBOV6bU9w%czdAullZtN5Nv zOgRE`Pk~#1y68h+Zh6TSlkXk4?D=B$eH)kco%gB^%lglt#q3f3LA1HVcBl*vx?Oj~|Y5~-9*PbIeV_C+r;)e;yw5tEksPQX7JkBuJinttm|92tnn9!-#=rW zt!c#f3E%wT`*wbV!uRc}*}nwenc9muPv7Aiw=ZM!R5Q1}vG#ieaduXTbZ(AjOx!hw z{G9XnpK;$j_M{&*{Z3d@-*W=z~=AKu&V z*8H|7aBK1RF#;eFlv2odxDq#b!yv8&m4)@~v860>$YW8$tc zq&#bP@QrcS9_1NW!#1yb)-mrVNICDP854I!-pAyq;eUo0W3ITT&#}$n{N2vAzQ8ut z<=q)07Mw4!t|oBiGB Zd&vImdmr}^YqW_s*8Tg)zjSp0`4718o4^17 diff --git a/shaders/huesat.comp b/shaders/huesat.comp index 530600c7..0477be9e 100644 --- a/shaders/huesat.comp +++ b/shaders/huesat.comp @@ -14,6 +14,7 @@ layout(set = 0, binding = 3) uniform InputBuffer layout(offset = 4) float sat; layout(offset = 8) float invertLuma; layout(offset = 12) float invertChroma; + layout(offset = 16) float useMask; } sb; #define TWO_PI 6.28318530718 @@ -25,6 +26,7 @@ void main() ivec2 pixelCoords = ivec2(gl_GlobalInvocationID.xy); vec4 pixel = imageLoad(inputBack, pixelCoords).rgba; + float mask = imageLoad(inputFront, pixelCoords).a; // The hue is expected to be in radians, // so we stretch the 0.0 --> 1.0 value here @@ -53,7 +55,10 @@ void main() vec4 result = vec4((luma + chroma * sb.sat * inv), pixel.a); - + if (sb.useMask > 0.5) + { + result = mix(pixel, result, mask); + } imageStore(resultImage, pixelCoords, result); diff --git a/shaders/huesat_comp.spv b/shaders/huesat_comp.spv index c464d7c0e5d9c0bd451ec27b62e5c52f78ef66be..8a2f6b08b206703317d128d6bea12e4282b76b77 100644 GIT binary patch literal 4080 zcmZ9N*>Y7y6oz*a!YnfZL?HnY4H!WI5rhz?5Db$zPjC_rB#`9b$si(V5D-Tc1r^7L zQx#VE0N!}*g_mCW1U`X7l~sP~)!n<#si|H%AxWx|$;rgzhomxQ zCeo>E7lr>$?O)L9tlF7>r-Pjkj43nM4v^~}A6eoLn7G%%;@>@1i11}gn6 zN9!6a?k$yj)0n&9ZD}uqM~@cE=`PhA#Eo*#vA-|?AD`%V&)t1P#qvP=U~eHoosjCD zWJTZBRW9k#SDX4go5B9#9$T#C+#2Ei9hJUTgL~3S6}}PPnN={h#aK+dQ(uPLm?@F! zXP8+VJTAEaE*JX;d(wT^CL^P~&D%&?iSZtmV2&y{Oc zslO)0=I)}KIM1bUM`*^Xc`l(bItcAw>RtPA7Re> z<@#M)|M$%9bpbXTRlR|1^Tl(C8P8mgxrcdh9$%{IuZP>enpQ{VnrQFkF8Yvzk4cKbzTF>gLP6Lp9^)G8^xja`$Rao~!w{GTXbl zd~wE&iGCWujurT=wG4CpMPzy(#*Q^>-HqoIeT)91Pym^}mik+&7R z;kVhNb#}vlym@nUormE`GTc0${No^V^L?Gr&9I*PEMx91>JNe$&2vzP01j(FH^7lHp-&6ez>$@%DW`X0QABGJFGTGELp#`S?9u&FVb}HpX{oJ?~yE z>OBO`*V_bF(;QJR`rV9Xjs4mCZU(D`oo8M9+JafD;;%`+v5HpN_cna)Z7Ov+S{b#`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3Yau3&v>r zqKi^Q{~t(s#17(9|8C<=LW+ z-w6HI@eJhA)9<1^<@US_GiI2R^j)pQj8Qk=GgI4*-*<5@wifffSi?JXAEthZ82JN* z=9{rbsnCqK#|F&02l>^!uMZZQy2HKrTi+<^Z2}wPo3Wn1lUmf<0#55~g{x_fs2A&f z49yycinq88tQK~WzOL(W%v$>G>wQp*I!}O0*j(zk?_SJap0B<*kDcHhn11VckJO^h zE^rBpI=jKv@qX;W%<-j z&%@LGyZ|>wJ#tx`s576!)W)&DxTg(f$G`N{_co^H_g)-z zCcx{kxO+{oZ$RC(=u`WLyvTRf*J3s{*7*+DbxvYY|1?-V*7+`2E!O!S*x@?$ox#*x zr#SkY1-pjuIY*E8!LC#8`F?Q{^3;3C*O^@#Zh>>eZL64*HP z`0YOi+ds^^=o&6#`pj`1tC&B*R$y1K=<#WxA0}oF_%qC0M`)je)!Gv6i$ZH>KE%J! wa^|a;`Nr$Fw&!<_S)V<-nZLxY6?`W1b!R0=Z6>P))2VPeSsQ>@~ diff --git a/shaders/invert.comp b/shaders/invert.comp index a47c72dd..e1666731 100644 --- a/shaders/invert.comp +++ b/shaders/invert.comp @@ -30,13 +30,16 @@ layout(set = 0, binding = 3) uniform InputBuffer layout(offset = 4) float bGreen; layout(offset = 8) float bBlue; layout(offset = 12) float bAlpha; + layout(offset = 16) float useMask; } sb; void main() { ivec2 pixelCoords = ivec2(gl_GlobalInvocationID.xy); - vec4 rgba = imageLoad(inputImage, pixelCoords).rgba; + vec4 rgba = imageLoad(inputImage, pixelCoords).rgba; + float mask = imageLoad(inputImage, pixelCoords).a; + vec4 original = rgba; if (sb.bRed > 0.0) { @@ -54,6 +57,11 @@ void main() { rgba.a = 1.0 - rgba.a; } + + if (sb.useMask > 0.5) + { + rgba = mix(original, rgba, mask); + } imageStore(resultImage, pixelCoords, rgba); } diff --git a/shaders/invert_comp.spv b/shaders/invert_comp.spv index 1b33945b8574601716f83d4572dbb37642f89aae..ca38e088a36b19634dd6b1d645dff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NrKwOKsFNg}b;07+Gih}z`(@H^Np`-=l2S1qjfBXUdF_*-| z=efOO?n$OI^Uj=^dG9%=9a~3sB*~VfE9p$$ChgUmYz0Y@?qqwaOLH&hMq3+;qvI1} zX6#8i(nNE5$SI(=A*+>@H3Pemz2IWKsjY99gqm@`*r>YJ4NkNFj<)AjWabS}W_D1NKj z?ze#5thF}l*$~e825hy``iM$O_!#^sie>l=^#ud(GdgqSbye7?T<&T4OcdG%4j z8pB}r((Y&fc61Rje-NJwn_|X``0^4{%JPT{&#eGM>tYh4L z`ksy0d3?XqF~ntl5pB#m#?_v=Yd?__=)ljU=-0dYazC5;?K!cWv^c# z{#Tjno$iXaT@LVL%y+7h?w6% z+uEM%dBlF6chtU+;or!y*G0tpAs+iiv16Yz>zntR`q4)n9LBKa;Jt}Hm$Aiz!xe0? z;4qHul7q3Uh?pF-W0py5XPH2v_BCwr;BXyV4&t%z26pU|gT8rkh(7AzFoi7#?{@UL zg)JT&ZexoDhr8G=IT*Wxh{-`aW|_uzmU~Flp1~Fm4)?L;(8k;6_W(ck$wA*dIYb|I zaCn3*2j5@xDPfBThgoc~;P4pRB?n_=L`)9a!C?;DS$xY;`zf|~aCn9-2l3c9j~)Bu ppl_ZWqL12|zNhENLgw#4zd(FX#(hsO5$nCjH`ln>Uta8W 0.5) + { + pixel = mix(original, pixel, mask); + } imageStore(resultImage, pixelCoords, pixel); - } \ No newline at end of file diff --git a/shaders/levels_comp.spv b/shaders/levels_comp.spv index ac1704888bbb5b67c9930f57e1e9a9873afddb69..e86a3f375ff952f50269084d75f037438865bc7b 100644 GIT binary patch literal 4616 zcmZ{mhjUa_6o($_N&Vkovy1O!Bo7FwbpO~npNSi;I?7k3lDhzcT#4IB1`ie14z zj{lft#u>lw?K}ErXS|u;+;e`X-gEEUNz1_5Lz84cG9nq4{E{@*xMUzqlDIEsADIkE z_03y$ZCOz7-M?VT(uI1CPFmbj+ZcQXBM$;Sg;GU+A{YxVH!hXc8~!cC4n)34p}~0M z;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.h +++ b/src/nodedefinitions.h @@ -597,15 +597,17 @@ namespace Cascade NODE_TYPE_INVERT, nodeStrings[NODE_TYPE_INVERT], NODE_CATEGORY_COLOR, - { NODE_INPUT_TYPE_RGB_BACK }, + { NODE_INPUT_TYPE_RGB_BACK, + NODE_INPUT_TYPE_ALPHA }, { NODE_OUTPUT_TYPE_RGB }, { { UI_ELEMENT_TYPE_PROPERTIES_HEADING, nodeStrings[NODE_TYPE_INVERT] }, - { UI_ELEMENT_TYPE_CHANNEL_SELECT, "0" } + { UI_ELEMENT_TYPE_CHANNEL_SELECT, "0" }, + { UI_ELEMENT_TYPE_CHECKBOX, "Use Mask,0," } }, FRONT_INPUT_ALWAYS_CLEAR, BACK_INPUT_RENDER_UPSTREAM_OR_CLEAR, - ALPHA_INPUT_ALWAYS_CLEAR, + ALPHA_INPUT_RENDER_UPSTREAM_OR_CLEAR, OUTPUT_RENDER_UPSTREAM_OR_CLEAR, ":/shaders/invert_comp.spv", 1 @@ -831,18 +833,20 @@ namespace Cascade NODE_TYPE_COLOR_BALANCE, nodeStrings[NODE_TYPE_COLOR_BALANCE], NODE_CATEGORY_COLOR, - { NODE_INPUT_TYPE_RGB_BACK }, + { NODE_INPUT_TYPE_RGB_BACK, + NODE_INPUT_TYPE_ALPHA }, { NODE_OUTPUT_TYPE_RGB }, { { UI_ELEMENT_TYPE_PROPERTIES_HEADING, nodeStrings[NODE_TYPE_COLOR_BALANCE] }, { UI_ELEMENT_TYPE_SLIDER_BOX_DOUBLE, "Red,-1.0,1.0,0.01,0.0" }, { UI_ELEMENT_TYPE_SLIDER_BOX_DOUBLE, "Green,-1.0,1.0,0.01,0.0" }, { UI_ELEMENT_TYPE_SLIDER_BOX_DOUBLE, "Blue,-1.0,1.0,0.01,0.0" }, - { UI_ELEMENT_TYPE_CHECKBOX, "Preserve Luminance,0," } + { UI_ELEMENT_TYPE_CHECKBOX, "Preserve Luminance,0," }, + { UI_ELEMENT_TYPE_CHECKBOX, "Use Mask,0," } }, FRONT_INPUT_ALWAYS_CLEAR, BACK_INPUT_RENDER_UPSTREAM_OR_CLEAR, - ALPHA_INPUT_ALWAYS_CLEAR, + ALPHA_INPUT_RENDER_UPSTREAM_OR_CLEAR, OUTPUT_RENDER_UPSTREAM_OR_CLEAR, ":/shaders/colorbalance_comp.spv", 1 @@ -853,18 +857,20 @@ namespace Cascade NODE_TYPE_HUE_SATURATION, nodeStrings[NODE_TYPE_HUE_SATURATION], NODE_CATEGORY_COLOR, - { NODE_INPUT_TYPE_RGB_BACK }, + { NODE_INPUT_TYPE_RGB_BACK, + NODE_INPUT_TYPE_ALPHA }, { NODE_OUTPUT_TYPE_RGB }, { { UI_ELEMENT_TYPE_PROPERTIES_HEADING, nodeStrings[NODE_TYPE_HUE_SATURATION] }, { UI_ELEMENT_TYPE_SLIDER_BOX_DOUBLE, "Hue,0.0,1.0,0.01,0.0" }, { UI_ELEMENT_TYPE_SLIDER_BOX_DOUBLE, "Saturation,0.0,5.0,0.01,1.0" }, { UI_ELEMENT_TYPE_CHECKBOX, "Invert Luminance,0," }, - { UI_ELEMENT_TYPE_CHECKBOX, "Invert Chroma,0," } + { UI_ELEMENT_TYPE_CHECKBOX, "Invert Chroma,0," }, + { UI_ELEMENT_TYPE_CHECKBOX, "Use Mask,0," } }, FRONT_INPUT_ALWAYS_CLEAR, BACK_INPUT_RENDER_UPSTREAM_OR_CLEAR, - ALPHA_INPUT_ALWAYS_CLEAR, + ALPHA_INPUT_RENDER_UPSTREAM_OR_CLEAR, OUTPUT_RENDER_UPSTREAM_OR_CLEAR, ":/shaders/huesat_comp.spv", 1 @@ -875,7 +881,8 @@ namespace Cascade NODE_TYPE_LEVELS, nodeStrings[NODE_TYPE_LEVELS], NODE_CATEGORY_COLOR, - { NODE_INPUT_TYPE_RGB_BACK }, + { NODE_INPUT_TYPE_RGB_BACK, + NODE_INPUT_TYPE_ALPHA }, { NODE_OUTPUT_TYPE_RGB }, { { UI_ELEMENT_TYPE_PROPERTIES_HEADING, nodeStrings[NODE_TYPE_LEVELS] }, @@ -884,11 +891,12 @@ namespace Cascade { UI_ELEMENT_TYPE_SLIDER_BOX_DOUBLE, "Gamma,0.2,5.0,0.01,1.0" }, { UI_ELEMENT_TYPE_SLIDER_BOX_DOUBLE, "Out Black,0.0,1.0,0.01,0.0" }, { UI_ELEMENT_TYPE_SLIDER_BOX_DOUBLE, "Out White,0.0,1.0,0.01,1.0" }, - { UI_ELEMENT_TYPE_CHECKBOX, "Luminance Only,0," } + { UI_ELEMENT_TYPE_CHECKBOX, "Luminance Only,0," }, + { UI_ELEMENT_TYPE_CHECKBOX, "Use Mask,0," } }, FRONT_INPUT_ALWAYS_CLEAR, BACK_INPUT_RENDER_UPSTREAM_OR_CLEAR, - ALPHA_INPUT_ALWAYS_CLEAR, + ALPHA_INPUT_RENDER_UPSTREAM_OR_CLEAR, OUTPUT_RENDER_UPSTREAM_OR_CLEAR, ":/shaders/levels_comp.spv", 1