r.MotionBlur.HalfResGather
r.MotionBlur.HalfResGather
#Overview
name: r.MotionBlur.HalfResGather
The value of this variable can be defined or overridden in .ini config files. 5
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to do motion blur filter dynamically at half res under heavy motion.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.MotionBlur.HalfResGather is to control whether the motion blur filter should be performed dynamically at half resolution under heavy motion conditions. This setting is part of the rendering system, specifically the post-processing pipeline for motion blur effects.
This setting variable is primarily used in the Renderer module of Unreal Engine 5, specifically in the post-processing subsystem for motion blur effects. It’s referenced in the PostProcessMotionBlur.cpp file, which is responsible for implementing motion blur rendering.
The value of this variable is set through a console variable (CVarMotionBlurHalfResGather) with a default value of 1 (enabled). It can be changed at runtime using console commands or through code.
The associated variable CVarMotionBlurHalfResGather interacts directly with r.MotionBlur.HalfResGather. They share the same value and purpose.
Developers should be aware that this variable affects the performance and quality trade-off of motion blur rendering. When enabled (set to 1), it allows the motion blur filter to dynamically switch to half resolution processing under heavy motion, which can improve performance at the cost of some quality reduction.
Best practices when using this variable include:
- Testing the visual impact and performance differences with the setting enabled and disabled.
- Considering enabling it for performance-critical scenarios or on lower-end hardware.
- Potentially exposing this setting to end-users as a scalability option.
Regarding the associated variable CVarMotionBlurHalfResGather:
The purpose of CVarMotionBlurHalfResGather is the same as r.MotionBlur.HalfResGather. It’s the actual console variable that controls the behavior described above.
This variable is used in the Renderer module, specifically in the motion blur post-processing pipeline.
The value is set when the console variable is initialized, with a default value of 1. It can be changed at runtime using console commands or through code.
CVarMotionBlurHalfResGather interacts directly with the shader code that implements the motion blur effect. It’s used to determine whether to allow half-resolution gathering in the motion blur computations.
Developers should be aware that changes to this variable will directly affect the motion blur rendering process and may impact both performance and visual quality.
Best practices include using GetValueOnRenderThread() when accessing this variable in render thread code to ensure thread-safe access, and considering the performance implications when enabling or disabling this feature.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:390, section: [PostProcessQuality@0]
- INI Section:
PostProcessQuality@0
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:410, section: [PostProcessQuality@1]
- INI Section:
PostProcessQuality@1
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:443, section: [PostProcessQuality@2]
- INI Section:
PostProcessQuality@2
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:478, section: [PostProcessQuality@3]
- INI Section:
PostProcessQuality@3
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:515, section: [PostProcessQuality@Cine]
- INI Section:
PostProcessQuality@Cine
- Raw value:
0
- Is Array:
False
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessMotionBlur.cpp:53
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<int32> CVarMotionBlurHalfResGather(
TEXT("r.MotionBlur.HalfResGather"), 1,
TEXT("Whether to do motion blur filter dynamically at half res under heavy motion."),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarMotionBlurAllowExternalVelocityFlatten(
TEXT("r.MotionBlur.AllowExternalVelocityFlatten"), 1,
TEXT("Whether to allow motion blur's velocity flatten into other pass."),
#Associated Variable and Callsites
This variable is associated with another variable named CVarMotionBlurHalfResGather
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessMotionBlur.cpp:52
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarMotionBlurHalfResGather(
TEXT("r.MotionBlur.HalfResGather"), 1,
TEXT("Whether to do motion blur filter dynamically at half res under heavy motion."),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarMotionBlurAllowExternalVelocityFlatten(
TEXT("r.MotionBlur.AllowExternalVelocityFlatten"), 1,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessMotionBlur.cpp:892
Scope (from outer to inner):
file
class class FMotionBlurVelocityFlattenCS : public FMotionBlurShader
Source code excerpt:
PassParameters->TileListMaxSize = TileListMaxSize;
PassParameters->HalfResPixelVelocityThreshold = FMath::Square(float(MaxSampleCount));
PassParameters->bAllowHalfResGather = CVarMotionBlurHalfResGather.GetValueOnRenderThread() ? 1 : 0;
PassParameters->VelocityTileTextures = VelocityTileTextures;
PassParameters->TileListsOutput = GraphBuilder.CreateUAV(TileListsBuffer);
PassParameters->TileListsSizeOutput = GraphBuilder.CreateUAV(TileListsSizeBuffer);
PassParameters->DebugOutput = CreateDebugUAV(GraphBuilder, PassParameters->FilterTileCount, TEXT("Debug.MotionBlur.FilterTileClassify"));
FMotionBlurFilterTileClassifyCS::FPermutationDomain PermutationVector;