r.MotionBlur.Scale
r.MotionBlur.Scale
#Overview
name: r.MotionBlur.Scale
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Allows to scale the postprocess intensity/amount setting in the postprocess.\n1: don\'t do any scaling (default)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.MotionBlur.Scale is to control the scaling of motion blur intensity in the post-processing pipeline of Unreal Engine 5. It allows developers to adjust the strength of the motion blur effect applied to the rendered scene.
This setting variable is primarily used by the rendering system, specifically in the post-processing stage. Based on the callsites, it’s evident that the Engine module relies on this variable, as it’s defined and used in the SceneView.cpp file.
The value of this variable is set using a TAutoConsoleVariable, which means it can be adjusted at runtime through console commands or configuration files. The default value is 1.0f, which means no scaling is applied by default.
The r.MotionBlur.Scale variable interacts with the MotionBlurAmount setting in the FinalPostProcessSettings. The scale value is used to multiply the MotionBlurAmount, effectively increasing or decreasing the intensity of the motion blur effect.
Developers should be aware that this variable is marked with ECVF_Scalability and ECVF_RenderThreadSafe flags. This means it can be used for performance scaling and can be safely modified from the render thread.
Best practices when using this variable include:
- Use it for fine-tuning motion blur intensity without changing the base MotionBlurAmount setting.
- Be cautious when setting values above 1.0, as it may lead to excessive motion blur.
- Consider using this variable for performance optimization on lower-end hardware by reducing the motion blur intensity.
Regarding the associated variable CVarMotionBlurScale:
The purpose of CVarMotionBlurScale is to provide a console variable interface for the r.MotionBlur.Scale setting. It allows for runtime adjustment of the motion blur scale through console commands.
This variable is part of the Engine module and is used in the rendering system’s post-processing pipeline.
The value of CVarMotionBlurScale is set when the TAutoConsoleVariable is initialized, but it can be changed at runtime using console commands.
CVarMotionBlurScale interacts directly with the FinalPostProcessSettings.MotionBlurAmount, scaling its value before it’s applied in the rendering process.
Developers should be aware that changes to CVarMotionBlurScale will immediately affect the motion blur intensity in the game. It’s also important to note that the value is clamped between 0.0f and 50.0f when used.
Best practices for using CVarMotionBlurScale include:
- Use it for debugging and fine-tuning motion blur in real-time.
- Consider exposing it as an advanced graphics option for players to adjust based on their preferences or hardware capabilities.
- Be mindful of the performance impact when increasing the scale, especially on lower-end hardware.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:231
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarMotionBlurScale(
TEXT("r.MotionBlur.Scale"),
1.0f,
TEXT("Allows to scale the postprocess intensity/amount setting in the postprocess.\n")
TEXT("1: don't do any scaling (default)"),
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarMotionBlurAmount(
#Associated Variable and Callsites
This variable is associated with another variable named CVarMotionBlurScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:230
Scope: file
Source code excerpt:
TEXT(" 2: lumens"));
static TAutoConsoleVariable<float> CVarMotionBlurScale(
TEXT("r.MotionBlur.Scale"),
1.0f,
TEXT("Allows to scale the postprocess intensity/amount setting in the postprocess.\n")
TEXT("1: don't do any scaling (default)"),
ECVF_Scalability | ECVF_RenderThreadSafe);
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:2221
Scope (from outer to inner):
file
function void FSceneView::EndFinalPostprocessSettings
Source code excerpt:
{
float Value = FMath::Clamp(CVarMotionBlurScale.GetValueOnGameThread(), 0.0f, 50.0f);
FinalPostProcessSettings.MotionBlurAmount *= Value;
}
{
float Value = CVarMotionBlurAmount.GetValueOnGameThread();