r.DOF.Gather.AccumulatorQuality
r.DOF.Gather.AccumulatorQuality
#Overview
name: r.DOF.Gather.AccumulatorQuality
The value of this variable can be defined or overridden in .ini config files. 4
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Controles the quality of the gathering accumulator.\n
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.DOF.Gather.AccumulatorQuality is to control the quality of the gathering accumulator in the Depth of Field (DOF) effect. This setting variable is part of the rendering system in Unreal Engine 5, specifically for the post-processing pipeline.
This setting variable is primarily used in the Renderer module, particularly in the DiaphragmDOF (Depth of Field) subsystem. It’s referenced in the file “DiaphragmDOF.cpp”, which suggests it’s crucial for the implementation of the Depth of Field effect.
The value of this variable is set using a console variable (CVarAccumulatorQuality) with a default value of 1. It can be changed at runtime through console commands or project settings.
The variable interacts with the rendering pipeline, specifically the DOF gathering pass. It’s used to determine the quality level of the accumulator used in the DOF effect. There are three quality levels: 0 - Low quality 1 - Default quality (as set by default) 2 - Cinematic quality
Developers must be aware that changing this variable affects the visual quality and potentially the performance of the DOF effect. Higher quality settings may result in better visual results but at the cost of increased computational overhead.
Best practices when using this variable include:
- Use the default value (1) for most scenarios as it provides a good balance between quality and performance.
- Consider using the low quality setting (0) for performance-critical situations or on lower-end hardware.
- Reserve the cinematic quality setting (2) for high-end systems or for generating cinematic content where visual quality is paramount.
- Test thoroughly when changing this setting to ensure it doesn’t negatively impact performance, especially on target hardware.
Regarding the associated variable CVarAccumulatorQuality:
This is the actual console variable that controls the r.DOF.Gather.AccumulatorQuality setting. It’s defined as a TAutoConsoleVariable
The purpose of CVarAccumulatorQuality is to provide a way to modify the r.DOF.Gather.AccumulatorQuality setting dynamically, either through console commands or through code.
It’s used in the AddPasses function of the DiaphragmDOF class to determine which quality level should be used for the DOF gathering pass. The value is retrieved using GetValueOnRenderThread(), indicating that it’s accessed on the render thread for immediate effect on the rendering pipeline.
Developers should be aware that changes to this variable will take effect immediately on the render thread. They should also note that it’s marked with ECVF_Scalability | ECVF_RenderThreadSafe, which means it’s considered a scalability option and is safe to modify on the render thread.
Best practices for using CVarAccumulatorQuality include:
- Use it for dynamic quality adjustments based on performance metrics or user settings.
- Be cautious when modifying it frequently, as it may cause visual inconsistencies if changed too often.
- Consider exposing it as a user-facing option for advanced graphics settings, allowing players to fine-tune their DOF quality.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:430, section: [PostProcessQuality@1]
- INI Section:
PostProcessQuality@1
- Raw value:
0 ; lower gathering accumulator quality
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:463, section: [PostProcessQuality@2]
- INI Section:
PostProcessQuality@2
- Raw value:
0 ; lower gathering accumulator quality
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:498, section: [PostProcessQuality@3]
- INI Section:
PostProcessQuality@3
- Raw value:
1 ; higher gathering accumulator quality
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:536, section: [PostProcessQuality@Cine]
- INI Section:
PostProcessQuality@Cine
- Raw value:
1 ; higher gathering accumulator quality
- 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/DiaphragmDOF.cpp:39
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<int32> CVarAccumulatorQuality(
TEXT("r.DOF.Gather.AccumulatorQuality"),
1,
TEXT("Controles the quality of the gathering accumulator.\n"),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarEnableGatherBokehSettings(
TEXT("r.DOF.Gather.EnableBokehSettings"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarAccumulatorQuality
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/DiaphragmDOF.cpp:38
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarAccumulatorQuality(
TEXT("r.DOF.Gather.AccumulatorQuality"),
1,
TEXT("Controles the quality of the gathering accumulator.\n"),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarEnableGatherBokehSettings(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/DiaphragmDOF.cpp:1405
Scope (from outer to inner):
file
function bool DiaphragmDOF::AddPasses
Source code excerpt:
// Whether should use shade permutation that does lower quality accumulation.
// TODO: this is becoming a mess.
const bool bUseLowAccumulatorQuality = CVarAccumulatorQuality.GetValueOnRenderThread() == 0;
const bool bUseCinematicAccumulatorQuality = CVarAccumulatorQuality.GetValueOnRenderThread() == 2;
// Setting for scattering budget upper bound.
const float MaxScatteringRatio = FMath::Clamp(CVarScatterMaxSpriteRatio.GetValueOnRenderThread(), 0.0f, 1.0f);
// Slight out of focus is not supporting with DOF's TAA upsampling, because of the brute force
// kernel used in GatherCS for slight out of focus stability buffer.