Description

In game sessions when the value for world time becomes large enough we start running into floating point precision issues. These issues can easily be seen in materials which do periodic animation based on View.Time. Also, things like UPrimitiveComponent::GetLastRenderTime() become imprecise also since they use floats, not doubles even though UWorld::GetTimeSeconds() returns a double.

The issues can be worse on some platforms that use -ffast-math and lower float precision (halfs) in shaders. In these cases the precision issues are usually noticeable after 3600+ seconds, but on most platforms the float precision is noticeable after 24+hrs

Resetting UWorld's time periodically is not really viable since there are patterns in the engine which assume it doesn't wrap.

For example:

float GetTimeRemaining(float WorldTime) const
{
	float Duration = GetDuration();
	return (Duration == FGameplayEffectConstants::INFINITE_DURATION ? -1.f : Duration - (WorldTime - StartWorldTime));
}

Workarounds include:

  1. View.Time could be a FLargeWorldRenderScalar, but this adds shader overhead. This would be like the two-float trick we use for LWC for time as well. It would have a perf impact. It shouldn't be done for the Time value put in the view UB, but should be added to another new view UB member like HighPrecisionAbsTime
  2. Wrap the time sent to the material, e.g. compute the part of the expression which involves time on the CPU in double precision, do a modulo with some period that's appropriate for the use case, then truncate to float and pass that to the shader. This could be a separate value or passed as View.Time, but then the time doesn't match world time on the CPU.
  3. Restarting the map, but this isn't transparent to the player
Steps to Reproduce

Steps to Reproduce

Leave a single game session running for a very long time

An example of the precision issue with WPO using the attached project (also see video):

  1. Modify BaseGame.ini or Game.ini to allow for high time dilation with the “slomo” console command
[/Script/Engine.WorldSettings]
MinUndilatedFrameTime=0.000001
MaxUndilatedFrameTime=0.4	
MinGlobalTimeDilation=0.00001
MaxGlobalTimeDilation=10000.0
  1. Open the attached project and enter PIE
  2. In the console run "slomo .1" and note that the sphere animates slowly but without stutter
  3. In the console fast forward time a lot using "slomo 10000".
  4. After about a 30 seconds in the console run "slomo .1"

Expected

The animation doesn't stutter when the world time exceeds 24+ hours

Actual

The animation stutters due to float precision degrading over time

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-373131 in the post.

0
Login to Vote

Backlogged
CreatedApr 8, 2026
UpdatedApr 13, 2026
View Jira Issue