Merge pull request #11333 from ctrlaltdavid/faster-fade-in

Reduce entity fade-in time
This commit is contained in:
Andrew Meadows 2017-09-11 09:29:45 -07:00 committed by GitHub
commit ce3ed68861

View file

@ -69,7 +69,7 @@ float Interpolate::simpleNonLinearBlend(float fraction) {
}
float Interpolate::calculateFadeRatio(quint64 start) {
const float FADE_TIME = 1.0f;
const float FADE_TIME = 0.5f;
float t = 2.0f * std::min(((float)(usecTimestampNow() - start)) / ((float)(FADE_TIME * USECS_PER_SECOND)), 1.0f);
float fadeRatio = (t < 1.0f) ? 0.5f * powf(2.0f, 10.0f * (t - 1.0f)) : 0.5f * (-powf(2.0f, -10.0f * (t - 1.0f)) + 2.0f);