sigmoid interpolation attempted, but for some confusing reason didnt look as good at linear interpolation

git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/dev-1.0@341 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
psperl
2007-08-16 02:57:05 +00:00
parent 4b65ccefef
commit e210bf1903

View File

@ -73,7 +73,8 @@ projectM *projectM::currentEngine = NULL;
RenderTarget * projectM::renderTarget = NULL;
Renderer * projectM::renderer = NULL;
float smoothTime = 5;
double presetDuration = 15;
double smoothDuration = 5;
//int smoothFrame = 0;
int oldFrame = 0;
@ -146,7 +147,7 @@ DLLEXPORT void projectM::renderFrame()
assert(m_activePreset2.get());
nohard=(int)(presetInputs.fps*3.5);
smoothFrame = (int)(presetInputs.fps * smoothTime);
smoothFrame = (int)(presetInputs.fps * smoothDuration);
printf("SOFT CUT - Smooth started\n");
}
@ -182,8 +183,10 @@ DLLEXPORT void projectM::renderFrame()
renderer->PerPixelMath(&m_activePreset2->presetOutputs(), &presetInputs);
renderer->WaveformMath(&m_activePreset2->presetOutputs(), &presetInputs, true);
double ratio = smoothFrame / (presetInputs.fps * smoothTime);
//double pos = -((smoothFrame / (presetInputs.fps * smoothDuration))-1);
//double ratio = 1/(1 + exp((pos-0.5)*4*M_PI));
double ratio = smoothFrame / (presetInputs.fps * smoothDuration);
// printf("f(%f)=%f\n",pos, ratio);
PresetMerger::MergePresets(m_activePreset->presetOutputs(),m_activePreset2->presetOutputs(),ratio,presetInputs.gx, presetInputs.gy);
//printf("Smooth:%d\n",smoothFrame);
@ -448,7 +451,7 @@ DLLEXPORT void projectM::projectM_init ( int gx, int gy, int fps, int texsize, i
DWRITE ( "post PCM init\n" );
#endif
this->avgtime=this->presetInputs.fps*10;
this->avgtime=this->presetInputs.fps*presetDuration;
this->hasInit = 1;