X-Git-Url: https://git.sesse.net/?p=movit;a=blobdiff_plain;f=overlay_effect.frag;fp=overlay_effect.frag;h=d32cc062204c4492dbb552c6930908e2f8b805be;hp=9e5709d1dad6271535701316d4ff1b60c4533d99;hb=2906256567cb3899b615d45e7d8a8fb482572147;hpb=7cfa62b39fb56fb1e5f094fa11bfe9d84445c80f diff --git a/overlay_effect.frag b/overlay_effect.frag index 9e5709d..d32cc06 100644 --- a/overlay_effect.frag +++ b/overlay_effect.frag @@ -13,7 +13,15 @@ // C_o without the division by alpha_o). vec4 FUNCNAME(vec2 tc) { +// SWAP_INPUTS will be #defined to 1 if we want to swap the two inputs, +#if SWAP_INPUTS + vec4 bottom = INPUT2(tc); + vec4 top = INPUT1(tc); +#else vec4 bottom = INPUT1(tc); vec4 top = INPUT2(tc); +#endif return top + (1.0 - top.a) * bottom; } + +#undef SWAP_INPUTS