From: Steinar H. Gunderson Date: Sun, 11 Oct 2015 22:24:43 +0000 (+0200) Subject: Make the fade look maybe a tad more natural. X-Git-Tag: 1.0.0~240 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=0f7d09a35eaf85615d2acd2df370a4f230eb9890;p=nageru Make the fade look maybe a tad more natural. --- diff --git a/theme.lua b/theme.lua index 8e433e2..b9d0b5b 100644 --- a/theme.lua +++ b/theme.lua @@ -273,6 +273,11 @@ function get_chain(num, t, width, height) tt = fade_src + tt * (fade_dst - fade_src) + -- Make the fade look maybe a tad more natural, by pumping it + -- through a sigmoid function. + tt = 10.0 * tt - 5.0 + tt = 1.0 / (1.0 + math.exp(-tt)) + fade_chain_mix_effect:set_float("strength_first", tt) fade_chain_mix_effect:set_float("strength_second", 1.0 - tt) end