r.FastBlurThreshold
r.FastBlurThreshold
#Overview
name: r.FastBlurThreshold
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:
Defines at what radius the Gaussian blur optimization kicks in (estimated 25% - 40% faster).\nThe optimization uses slightly less memory and has a quality loss on smallblur radius.\n 0: use the optimization always (fastest, lowest quality)\n 3: use the optimization starting at a 3 pixel radius (quite fast)\n 7: use the optimization starting at a 7 pixel radius (default)\n>15: barely ever use the optimization (high quality)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.FastBlurThreshold is to define the threshold at which the Gaussian blur optimization is activated in the rendering system. This setting is used to balance between performance and quality in post-processing blur effects.
This setting variable is primarily used in the Renderer module of Unreal Engine, specifically in the post-processing subsystem. It’s referenced in the PostProcessWeightedSampleSum.cpp file, which suggests it’s involved in weighted sample sum calculations for post-processing effects.
The value of this variable is set through the console variable system. It’s initialized with a default value of 7.0f, but can be changed at runtime using console commands or through configuration files.
The associated variable CVarFastBlurThreshold directly interacts with r.FastBlurThreshold. They share the same value and purpose.
Developers must be aware that:
- This setting affects the trade-off between performance and quality for blur effects.
- Lower values will result in faster performance but potentially lower quality, especially for small blur radii.
- The optimization is estimated to be 25% - 40% faster when active.
Best practices when using this variable include:
- Carefully consider the visual quality requirements of your project before adjusting this value.
- Test thoroughly at different blur radii to ensure the visual quality remains acceptable when the optimization kicks in.
- Use the provided guidelines (0 for always on, 3 for quite fast, 7 as default) as starting points for tuning.
Regarding the associated variable CVarFastBlurThreshold:
Its purpose is identical to r.FastBlurThreshold, serving as the C++ representation of the console variable.
It’s used directly in the IsFastBlurEnabled function to determine whether the fast blur optimization should be applied based on the current blur radius.
The value is set through the TAutoConsoleVariable template, which ties it to the r.FastBlurThreshold console variable.
Developers should be aware that changes to r.FastBlurThreshold will directly affect the behavior of CVarFastBlurThreshold.
Best practices include accessing this variable using the GetValueOnRenderThread() method to ensure thread-safe access in render thread operations.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:402, section: [PostProcessQuality@0]
- INI Section:
PostProcessQuality@0
- Raw value:
0
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:422, section: [PostProcessQuality@1]
- INI Section:
PostProcessQuality@1
- Raw value:
2
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:455, section: [PostProcessQuality@2]
- INI Section:
PostProcessQuality@2
- Raw value:
3
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:490, section: [PostProcessQuality@3]
- INI Section:
PostProcessQuality@3
- Raw value:
100
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:528, section: [PostProcessQuality@Cine]
- INI Section:
PostProcessQuality@Cine
- Raw value:
100
- 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/PostProcessWeightedSampleSum.cpp:42
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<float> CVarFastBlurThreshold(
TEXT("r.FastBlurThreshold"),
7.0f,
TEXT("Defines at what radius the Gaussian blur optimization kicks in (estimated 25% - 40% faster).\n")
TEXT("The optimization uses slightly less memory and has a quality loss on smallblur radius.\n")
TEXT(" 0: use the optimization always (fastest, lowest quality)\n")
TEXT(" 3: use the optimization starting at a 3 pixel radius (quite fast)\n")
TEXT(" 7: use the optimization starting at a 7 pixel radius (default)\n")
#Associated Variable and Callsites
This variable is associated with another variable named CVarFastBlurThreshold
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessWeightedSampleSum.cpp:41
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<float> CVarFastBlurThreshold(
TEXT("r.FastBlurThreshold"),
7.0f,
TEXT("Defines at what radius the Gaussian blur optimization kicks in (estimated 25% - 40% faster).\n")
TEXT("The optimization uses slightly less memory and has a quality loss on smallblur radius.\n")
TEXT(" 0: use the optimization always (fastest, lowest quality)\n")
TEXT(" 3: use the optimization starting at a 3 pixel radius (quite fast)\n")
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessWeightedSampleSum.cpp:197
Scope (from outer to inner):
file
function bool IsFastBlurEnabled
Source code excerpt:
bool IsFastBlurEnabled(float BlurRadius)
{
const float FastBlurRadiusThreshold = CVarFastBlurThreshold.GetValueOnRenderThread();
return BlurRadius >= FastBlurRadiusThreshold;
}
uint32 GetStaticSampleCount(uint32 RequiredSampleCount)
{