- put in timer resets for the shader system, so that they can continue being passed as floats

This commit is contained in:
Rachael Alexanderson 2017-11-14 22:46:28 -05:00
parent 763222b571
commit d2bc24737b

View file

@ -118,8 +118,10 @@ void FRenderState::Reset()
bool FRenderState::ApplyShader()
{
static int firstFrame = 0;
if (firstFrame == 0)
static uint64_t firstFrame = 0;
// if firstFrame is not yet initialized, initialize it to current time
// if we're going to overflow a float (after ~4.6 hours, or 24 bits), re-init to regain precision
if ((firstFrame == 0) || (screen->FrameTime - firstFrame >= 1<<24))
firstFrame = screen->FrameTime;
static const float nulvec[] = { 0.f, 0.f, 0.f, 0.f };