sigmoid function to smooth preset transitions even further

git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@1251 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
psperl
2009-08-02 16:50:53 +00:00
parent 69feaf00f7
commit a1b13e5efd

View File

@ -5,6 +5,11 @@
void PipelineMerger::mergePipelines(const Pipeline & a, const Pipeline & b, Pipeline & out, RenderItemMatcher::MatchResults & results, RenderItemMergeFunction & mergeFunction, float ratio)
{
double s = 0.5;
double e = 2.71828182845904523536;
double x = (ratio - 0.5) * 20;
double sigmoid = 1.0 / (1.0 + e - s * x);
double invratio = 1.0 - ratio;
out.textureWrap = (ratio < 0.5) ? a.textureWrap : b.textureWrap;