a.URO.DisableInterpolation
a.URO.DisableInterpolation
#Overview
name: a.URO.DisableInterpolation
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Set to 1 to disable interpolation
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of a.URO.DisableInterpolation is to control the interpolation behavior in the animation update rate optimization (URO) system within Unreal Engine 5. This setting variable is primarily used in the animation system to manage performance and visual quality tradeoffs.
The Unreal Engine subsystem that relies on this setting variable is the animation system, specifically within the SkinnedMeshComponent module. This can be seen from the file path where the variable is defined and used: Engine/Source/Runtime/Engine/Private/Components/SkinnedMeshComponent.cpp.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0, meaning interpolation is enabled by default. Users can change this value at runtime using console commands.
This variable interacts closely with another variable named CVarURODisableInterpolation, which is the actual CVar object that stores and manages the value. They essentially represent the same setting, with a.URO.DisableInterpolation being the console command name and CVarURODisableInterpolation being the C++ variable that holds the value.
Developers must be aware that setting this variable to 1 will disable interpolation in the animation update rate system. This can affect the smoothness of animations, especially when the update rate is lowered for performance reasons. Disabling interpolation might improve performance but could lead to choppier animations.
Best practices when using this variable include:
- Leave it at the default value (0) unless there’s a specific need to disable interpolation.
- If disabling interpolation, thoroughly test the visual impact on animations, especially for characters close to the camera.
- Consider using this in conjunction with other animation update rate settings for fine-tuning performance and quality.
Regarding the associated variable CVarURODisableInterpolation:
The purpose of CVarURODisableInterpolation is to provide a C++ accessible interface to the a.URO.DisableInterpolation console variable. It allows the engine code to read and react to changes in this setting.
This variable is used directly in the animation update rate management system, specifically in the FAnimUpdateRateParameters::SetTrailMode function. It’s checked to determine whether frame interpolation should be applied.
The value of CVarURODisableInterpolation is set automatically by the console variable system when a.URO.DisableInterpolation is changed.
CVarURODisableInterpolation interacts with CVarForceInterpolation, another console variable that can force interpolation on regardless of other settings.
Developers should be aware that this variable is read in performance-critical code paths related to animation updates. Frequent querying of its value should be minimized if possible.
Best practices for CVarURODisableInterpolation include:
- Use GetValueOnAnyThread() for reading the value, as seen in the provided code snippet.
- Consider caching the value if it’s needed frequently in a tight loop, to avoid repeated CVar queries.
- Be cautious about changing this value during gameplay, as it can cause noticeable changes in animation behavior.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkinnedMeshComponent.cpp:212
Scope (from outer to inner):
file
namespace FAnimUpdateRateManager
Source code excerpt:
static TAutoConsoleVariable<int32> CVarURODisableInterpolation(
TEXT("a.URO.DisableInterpolation"),
0,
TEXT("Set to 1 to disable interpolation"));
void AnimUpdateRateSetParams(FAnimUpdateRateParametersTracker* Tracker, float DeltaTime, bool bRecentlyRendered, float MaxDistanceFactor, int32 MinLod, bool bNeedsValidRootMotion, bool bUsingRootMotionFromEverything)
{
// default rules for setting update rates
#Associated Variable and Callsites
This variable is associated with another variable named CVarURODisableInterpolation
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkinnedMeshComponent.cpp:211
Scope (from outer to inner):
file
namespace FAnimUpdateRateManager
Source code excerpt:
TEXT("Set to 1 to force interpolation"));
static TAutoConsoleVariable<int32> CVarURODisableInterpolation(
TEXT("a.URO.DisableInterpolation"),
0,
TEXT("Set to 1 to disable interpolation"));
void AnimUpdateRateSetParams(FAnimUpdateRateParametersTracker* Tracker, float DeltaTime, bool bRecentlyRendered, float MaxDistanceFactor, int32 MinLod, bool bNeedsValidRootMotion, bool bUsingRootMotionFromEverything)
{
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/Components/SkinnedMeshComponent.cpp:5089
Scope (from outer to inner):
file
function void FAnimUpdateRateParameters::SetTrailMode
Source code excerpt:
// Make sure EvaluationRate is a multiple of UpdateRate.
EvaluationRate = FMath::Max((NewEvaluationRate / UpdateRate) * UpdateRate, 1);
bInterpolateSkippedFrames = (FAnimUpdateRateManager::CVarURODisableInterpolation.GetValueOnAnyThread() == 0) &&
((bNewInterpSkippedFrames && (EvaluationRate < MaxEvalRateForInterpolation)) || (FAnimUpdateRateManager::CVarForceInterpolation.GetValueOnAnyThread() == 1));
// Make sure we don't overflow. we don't need very large numbers.
const uint32 Counter = (GFrameCounter + UpdateRateShift) % MAX_uint32;
bSkipUpdate = ((Counter % UpdateRate) > 0);