]> git.sesse.net Git - nageru/commitdiff
Make the fade look maybe a tad more natural.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 11 Oct 2015 22:24:43 +0000 (00:24 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 11 Oct 2015 22:24:43 +0000 (00:24 +0200)
theme.lua

index 8e433e279369c5b9bdc8bf325efeba0ef2e99f99..b9d0b5b08c3af1e519db89c12a48a3e0b999b884 100644 (file)
--- 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