r.SkipRedundantTransformUpdate
r.SkipRedundantTransformUpdate
#Overview
name: r.SkipRedundantTransformUpdate
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Skip updates UpdatePrimitiveTransform is called redundantly, if the proxy allows it.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.SkipRedundantTransformUpdate is to optimize performance by skipping redundant updates to primitive transforms in the rendering system.
This setting variable is primarily used by the Unreal Engine’s rendering subsystem, specifically within the FScene class which is responsible for managing the scene to be rendered. It’s also referenced in the Movie Render Pipeline plugin, indicating its importance in high-quality rendering scenarios.
The value of this variable is set using an FAutoConsoleVariableRef in the RendererScene.cpp file. It’s initialized to 1 (enabled) by default.
This variable interacts with the UpdatePrimitiveTransform_RenderThread function in the FScene class. When enabled, it allows the engine to skip updating a primitive’s transform if the update is determined to be redundant and if the primitive’s proxy allows such optimization.
Developers should be aware that while this optimization can improve performance, it can cause issues in certain scenarios, particularly in high-precision rendering situations like movie rendering. In these cases, what might appear as a redundant update could actually be a necessary update for maintaining visual accuracy.
Best practices when using this variable include:
- Keep it enabled (set to 1) for general gameplay and development to benefit from the performance optimization.
- Disable it (set to 0) when doing high-precision rendering, such as when using the Movie Render Pipeline, to ensure all transform updates are processed.
- Be cautious when modifying this setting in runtime, as it could lead to unexpected visual artifacts if not managed properly.
- When encountering unexplained issues with object positioning or motion blur, especially in the first frame of a sequence, consider disabling this optimization as a troubleshooting step.
Developers working on systems that require frame-perfect accuracy or those dealing with movie rendering should pay special attention to this variable and consider disabling it in those contexts.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/RendererScene.cpp:2012
Scope: file
Source code excerpt:
static int32 GSkipRedundantTransformUpdate = 1;
static FAutoConsoleVariableRef CVarSkipRedundantTransformUpdate(
TEXT("r.SkipRedundantTransformUpdate"),
GSkipRedundantTransformUpdate,
TEXT("Skip updates UpdatePrimitiveTransform is called redundantly, if the proxy allows it."),
ECVF_Default
);
void FScene::UpdatePrimitiveTransform_RenderThread(FPrimitiveSceneProxy* PrimitiveSceneProxy, const FBoxSphereBounds& WorldBounds, const FBoxSphereBounds& LocalBounds, const FMatrix& LocalToWorld, const FVector& AttachmentRootPosition, const TOptional<FTransform>& PreviousTransform)
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/Nodes/MovieGraphGlobalGameOverrides.cpp:83
Scope (from outer to inner):
file
function void UMovieGraphGlobalGameOverridesNode::BuildNewProcessCommandLineArgsImpl
Source code excerpt:
InOutDeviceProfileCvars.Add(FString::Printf(TEXT("wp.Runtime.BlockOnSlowStreaming=%d"), 0));
InOutDeviceProfileCvars.Add(FString::Printf(TEXT("p.Chaos.ImmPhys.MinStepTime=%d"), 0));
InOutDeviceProfileCvars.Add(FString::Printf(TEXT("r.SkipRedundantTransformUpdate=%d"), 0));
InOutDeviceProfileCvars.Add(FString::Printf(TEXT("p.ChaosCloth.UseTimeStepSmoothing=%d"), 0));
}
void UMovieGraphGlobalGameOverridesNode::ApplySettings(const bool bOverrideValues, UWorld* InWorld)
{
// Apply the scalability settings
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/Graph/Nodes/MovieGraphGlobalGameOverrides.cpp:165
Scope (from outer to inner):
file
function void UMovieGraphGlobalGameOverridesNode::ApplySettings
Source code excerpt:
// which causes objects to render in the wrong position on the first frame (and without motion blur). This disables an optimization that detects
// the redundant updates so the update will get sent through anyways even though it thinks it's a duplicate (but it's not).
MOVIEPIPELINE_STORE_AND_OVERRIDE_CVAR_INT(PreviousSkipRedundantTransformUpdate, TEXT("r.SkipRedundantTransformUpdate"), 0, bOverrideValues);
// Cloth's time step smoothing messes up the change in number of simulation substeps that fixes the cloth simulation behavior when using Temporal Samples.
MOVIEPIPELINE_STORE_AND_OVERRIDE_CVAR_INT(PreviousChaosClothUseTimeStepSmoothing, TEXT("p.ChaosCloth.UseTimeStepSmoothing"), 0, bOverrideValues);
// Water skips water info texture when the world's game viewport rendering is disabled so we need to prevent this from happening.
MOVIEPIPELINE_STORE_AND_OVERRIDE_CVAR_INT_IF_EXIST(PreviousSkipWaterInfoTextureRenderWhenWorldRenderingDisabled, TEXT("r.Water.SkipWaterInfoTextureRenderWhenWorldRenderingDisabled"), 0, bOverrideValues);
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/MoviePipelineGameOverrideSetting.cpp:132
Scope (from outer to inner):
file
function void UMoviePipelineGameOverrideSetting::ApplyCVarSettings
Source code excerpt:
// which causes objects to render in the wrong position on the first frame (and without motion blur). This disables an optimization that detects
// the redundant updates so the update will get sent through anyways even though it thinks it's a duplicate (but it's not).
MOVIEPIPELINE_STORE_AND_OVERRIDE_CVAR_INT(PreviousSkipRedundantTransformUpdate, TEXT("r.SkipRedundantTransformUpdate"), 0, bOverrideValues);
// Cloth's time step smoothing messes up the change in number of simulation substeps that fixes the cloth simulation behavior when using Temporal Samples.
MOVIEPIPELINE_STORE_AND_OVERRIDE_CVAR_INT(PreviousChaosClothUseTimeStepSmoothing, TEXT("p.ChaosCloth.UseTimeStepSmoothing"), 0, bOverrideValues);
// Water skips water info texture when the world's game viewport rendering is disabled so we need to prevent this from happening.
MOVIEPIPELINE_STORE_AND_OVERRIDE_CVAR_INT_IF_EXIST(PreviousSkipWaterInfoTextureRenderWhenWorldRenderingDisabled, TEXT("r.Water.SkipWaterInfoTextureRenderWhenWorldRenderingDisabled"), 0, bOverrideValues);
#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineCore/Private/MoviePipelineGameOverrideSetting.cpp:242
Scope (from outer to inner):
file
function void UMoviePipelineGameOverrideSetting::BuildNewProcessCommandLineArgsImpl
Source code excerpt:
InOutDeviceProfileCvars.Add(FString::Printf(TEXT("wp.Runtime.BlockOnSlowStreaming=%d"), 0));
InOutDeviceProfileCvars.Add(FString::Printf(TEXT("p.Chaos.ImmPhys.MinStepTime=%d"), 0));
InOutDeviceProfileCvars.Add(FString::Printf(TEXT("r.SkipRedundantTransformUpdate=%d"), 0));
InOutDeviceProfileCvars.Add(FString::Printf(TEXT("p.ChaosCloth.UseTimeStepSmoothing=%d"), 0));
}