r.MotionBlur.AllowExternalVelocityFlatten
r.MotionBlur.AllowExternalVelocityFlatten
#Overview
name: r.MotionBlur.AllowExternalVelocityFlatten
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to allow motion blur\'s velocity flatten into other pass.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.MotionBlur.AllowExternalVelocityFlatten
is to control whether motion blur’s velocity flattening can be integrated into other rendering passes. This setting is part of Unreal Engine’s rendering system, specifically related to the post-processing and motion blur effects.
This setting variable is primarily used in the Renderer module of Unreal Engine, as evidenced by its location in the PostProcessMotionBlur.cpp
file within the Runtime/Renderer directory.
The value of this variable is set through a console variable (CVar) system, which allows for runtime configuration. It is initialized with a default value of 1 (enabled) in the C++ code.
The associated variable CVarMotionBlurAllowExternalVelocityFlatten
is directly linked to this setting. It’s an instance of TAutoConsoleVariable<int32>
that represents the console variable in the C++ code.
Developers should be aware that this setting affects the performance and visual quality of motion blur. Enabling external velocity flattening (by setting the value to 1) may improve performance by allowing the motion blur calculations to be combined with other rendering passes, but it might have subtle effects on the final image quality.
Best practices when using this variable include:
- Testing the visual impact of enabling/disabling this feature in different scenarios.
- Considering performance implications, especially on lower-end hardware.
- Ensuring that the motion blur effect still meets the artistic vision when this optimization is enabled.
Regarding the associated variable CVarMotionBlurAllowExternalVelocityFlatten
:
- Its purpose is to provide programmatic access to the
r.MotionBlur.AllowExternalVelocityFlatten
setting within the C++ code. - It is used in the
FVelocityFlattenTextures::AllowExternal
function to determine if external velocity flattening is allowed. - The value is retrieved using the
GetValueOnRenderThread()
method, ensuring thread-safe access in the render thread. - Developers should use this variable when they need to check the current state of the setting in C++ code, particularly within the rendering pipeline.
When working with this variable, developers should ensure they’re accessing it in a thread-safe manner, especially when used in render thread operations.
#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:58
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<int32> CVarMotionBlurAllowExternalVelocityFlatten(
TEXT("r.MotionBlur.AllowExternalVelocityFlatten"), 1,
TEXT("Whether to allow motion blur's velocity flatten into other pass."),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarAllowMotionBlurInVR(
TEXT("vr.AllowMotionBlurInVR"),
0,
#Associated Variable and Callsites
This variable is associated with another variable named CVarMotionBlurAllowExternalVelocityFlatten
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessMotionBlur.cpp:57
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarMotionBlurAllowExternalVelocityFlatten(
TEXT("r.MotionBlur.AllowExternalVelocityFlatten"), 1,
TEXT("Whether to allow motion blur's velocity flatten into other pass."),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarAllowMotionBlurInVR(
TEXT("vr.AllowMotionBlurInVR"),
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessMotionBlur.cpp:195
Scope (from outer to inner):
file
function bool FVelocityFlattenTextures::AllowExternal
Source code excerpt:
}
return CVarMotionBlurAllowExternalVelocityFlatten.GetValueOnRenderThread() != 0;
}
FRHISamplerState* GetMotionBlurColorSampler()
{
bool bFiltered = false;