r.AOGlobalDistanceFieldPartialUpdates
r.AOGlobalDistanceFieldPartialUpdates
#Overview
name: r.AOGlobalDistanceFieldPartialUpdates
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to allow partial updates of the global distance field. When profiling it\'s useful to disable this and get the worst case composition time that happens on camera cuts.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.AOGlobalDistanceFieldPartialUpdates is to control whether partial updates of the global distance field are allowed in Unreal Engine’s rendering system, specifically for Ambient Occlusion (AO) calculations.
This setting variable is primarily used in the Renderer module of Unreal Engine, specifically within the global distance field computation system. It’s part of the rendering pipeline that handles ambient occlusion and other global illumination effects.
The value of this variable is set using a console variable (cvar) system. It’s initialized to 1 (enabled) by default, but can be changed at runtime or through configuration files.
The associated variable GAOGlobalDistanceFieldPartialUpdates directly interacts with r.AOGlobalDistanceFieldPartialUpdates. They share the same value, with the console variable acting as an interface to modify the internal GAOGlobalDistanceFieldPartialUpdates variable.
Developers should be aware that this variable affects performance and visual quality trade-offs. When enabled (set to 1), it allows for partial updates of the global distance field, which can be more efficient in terms of performance. When disabled (set to 0), it forces full updates, which might be useful for profiling or ensuring consistent behavior across camera cuts.
Best practices for using this variable include:
- Leaving it enabled (1) for normal gameplay to benefit from performance optimizations.
- Disabling it (0) when profiling to get worst-case composition times, especially during camera cuts.
- Consider disabling it temporarily when debugging visual artifacts related to ambient occlusion or global illumination, as it might help isolate issues related to partial updates.
Regarding the associated variable GAOGlobalDistanceFieldPartialUpdates:
- Its purpose is to store the actual boolean value used in the code to determine whether partial updates are allowed.
- It’s used directly in the rendering code to control the update behavior of the global distance field.
- Its value is set by the console variable r.AOGlobalDistanceFieldPartialUpdates.
- Developers don’t typically need to interact with this variable directly, as it’s controlled through the console variable.
- Best practice is to use the console variable (r.AOGlobalDistanceFieldPartialUpdates) to modify this setting, rather than attempting to change GAOGlobalDistanceFieldPartialUpdates directly.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/GlobalDistanceField.cpp:71
Scope: file
Source code excerpt:
int32 GAOGlobalDistanceFieldPartialUpdates = 1;
FAutoConsoleVariableRef CVarAOGlobalDistanceFieldPartialUpdates(
TEXT("r.AOGlobalDistanceFieldPartialUpdates"),
GAOGlobalDistanceFieldPartialUpdates,
TEXT("Whether to allow partial updates of the global distance field. When profiling it's useful to disable this and get the worst case composition time that happens on camera cuts."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GAOGlobalDistanceFieldStaggeredUpdates = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GAOGlobalDistanceFieldPartialUpdates
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/GlobalDistanceField.cpp:69
Scope: file
Source code excerpt:
);
int32 GAOGlobalDistanceFieldPartialUpdates = 1;
FAutoConsoleVariableRef CVarAOGlobalDistanceFieldPartialUpdates(
TEXT("r.AOGlobalDistanceFieldPartialUpdates"),
GAOGlobalDistanceFieldPartialUpdates,
TEXT("Whether to allow partial updates of the global distance field. When profiling it's useful to disable this and get the worst case composition time that happens on camera cuts."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GAOGlobalDistanceFieldStaggeredUpdates = 1;
FAutoConsoleVariableRef CVarAOGlobalDistanceFieldStaggeredUpdatess(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/GlobalDistanceField.cpp:1113
Scope (from outer to inner):
file
function static void ComputeUpdateRegionsAndUpdateViewState
Source code excerpt:
const FBox ClipmapBounds(SnappedCenter - ClipmapExtent, SnappedCenter + ClipmapExtent);
const bool bUsePartialUpdates = GAOGlobalDistanceFieldPartialUpdates && !bForceFullUpdate;
if (!bUsePartialUpdates)
{
// Store the location of the full update
ClipmapViewState.FullUpdateOriginInPages = PageGridCenter;
GlobalDistanceFieldData.bInitializedOrigins = true;