r.AOGlobalDistanceFieldForceFullUpdate
r.AOGlobalDistanceFieldForceFullUpdate
#Overview
name: r.AOGlobalDistanceFieldForceFullUpdate
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to force full global distance field update every frame.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.AOGlobalDistanceFieldForceFullUpdate is to control whether a full global distance field update is forced every frame in Unreal Engine’s rendering system. This setting is specifically related to the Ambient Occlusion (AO) global distance field functionality.
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 engine’s advanced rendering features, particularly those related to ambient occlusion and global illumination.
The value of this variable is set through the Unreal Engine console system. It’s defined as an FAutoConsoleVariableRef, which means it can be changed at runtime through console commands or configuration files.
The associated variable GAOGlobalDistanceFieldForceFullUpdate directly interacts with r.AOGlobalDistanceFieldForceFullUpdate. They share the same value, with GAOGlobalDistanceFieldForceFullUpdate being the actual integer variable used in the code logic.
Developers must be aware that forcing a full update of the global distance field every frame can have significant performance implications. This setting is intended for debugging or specific scenarios where the distance field needs to be constantly refreshed.
Best practices when using this variable include:
- Keep it disabled (set to 0) for normal gameplay and production builds.
- Use it sparingly and only when necessary for debugging or specific visual effects.
- Be aware of the performance impact when enabled.
- Consider using it in conjunction with other distance field-related settings for comprehensive debugging.
Regarding the associated variable GAOGlobalDistanceFieldForceFullUpdate:
- It’s the actual integer variable used in the code to determine if a full update should be forced.
- It’s used in the ComputeUpdateRegionsAndUpdateViewState function to decide whether to perform a full update of the global distance field.
- This variable is part of a set of conditions that determine when a full update is necessary, including changes in cache settings, scene data updates, or other force update flags.
- Developers should treat this variable with the same considerations as r.AOGlobalDistanceFieldForceFullUpdate, as they are directly linked.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/GlobalDistanceField.cpp:95
Scope: file
Source code excerpt:
int32 GAOGlobalDistanceFieldForceFullUpdate = 0;
FAutoConsoleVariableRef CVarAOGlobalDistanceFieldForceFullUpdate(
TEXT("r.AOGlobalDistanceFieldForceFullUpdate"),
GAOGlobalDistanceFieldForceFullUpdate,
TEXT("Whether to force full global distance field update every frame."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GAOGlobalDistanceFieldForceUpdateOnce = 0;
#Associated Variable and Callsites
This variable is associated with another variable named GAOGlobalDistanceFieldForceFullUpdate
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/GlobalDistanceField.cpp:93
Scope: file
Source code excerpt:
);
int32 GAOGlobalDistanceFieldForceFullUpdate = 0;
FAutoConsoleVariableRef CVarAOGlobalDistanceFieldForceFullUpdate(
TEXT("r.AOGlobalDistanceFieldForceFullUpdate"),
GAOGlobalDistanceFieldForceFullUpdate,
TEXT("Whether to force full global distance field update every frame."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GAOGlobalDistanceFieldForceUpdateOnce = 0;
FAutoConsoleVariableRef CVarAOGlobalDistanceFieldForceUpdateOnce(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/GlobalDistanceField.cpp:1089
Scope (from outer to inner):
file
function static void ComputeUpdateRegionsAndUpdateViewState
Source code excerpt:
|| ClipmapViewState.CacheMostlyStaticSeparately != GAOGlobalDistanceFieldCacheMostlyStaticSeparately
|| ClipmapViewState.LastUsedSceneDataForFullUpdate != &Scene->DistanceFieldSceneData
|| GAOGlobalDistanceFieldForceFullUpdate
|| GAOGlobalDistanceFieldForceUpdateOnce
|| GDFReadbackRequest != nullptr;
const bool bUpdateRequested = GAOUpdateGlobalDistanceField != 0 && ShouldUpdateClipmapThisFrame(ClipmapIndex, NumClipmaps, GlobalDistanceFieldData.UpdateIndex);
if (bUpdateRequested && !bUpdatedThisFrame)