r.AOGlobalDistanceField.ForceRecacheForStreaming
r.AOGlobalDistanceField.ForceRecacheForStreaming
#Overview
name: r.AOGlobalDistanceField.ForceRecacheForStreaming
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Useful for debugging or profiling full clipmap updates that happen when a clipmap is detected to have pending streaming.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.AOGlobalDistanceField.ForceRecacheForStreaming is to force a full recache of the global distance field for streaming purposes. It’s primarily used for debugging and profiling full clipmap updates that occur when a clipmap is detected to have pending streaming.
This setting variable is part of the rendering system, specifically related to the global distance field used in Ambient Occlusion (AO) calculations. It’s used in the Renderer module of Unreal Engine 5.
The value of this variable is set through the console variable system. It’s defined as an integer with an initial value of 0.
The associated variable GAOGlobalDistanceFieldForceRecacheForStreaming directly interacts with it. They share the same value, and the console variable r.AOGlobalDistanceField.ForceRecacheForStreaming is used to modify GAOGlobalDistanceFieldForceRecacheForStreaming.
Developers should be aware that:
- This variable is intended for debugging and profiling purposes.
- Setting this variable to a non-zero value will force full clipmap updates, which can impact performance.
- It’s marked with ECVF_Scalability and ECVF_RenderThreadSafe flags, indicating it affects scalability and is safe to modify from the render thread.
Best practices when using this variable include:
- Only enable it when necessary for debugging or profiling.
- Be cautious of performance impacts when enabled.
- Reset it to 0 after debugging to restore normal behavior.
Regarding the associated variable GAOGlobalDistanceFieldForceRecacheForStreaming:
The purpose of GAOGlobalDistanceFieldForceRecacheForStreaming is to act as the internal representation of the r.AOGlobalDistanceField.ForceRecacheForStreaming console variable.
This variable is used in the Renderer module, specifically in the global distance field computation for Ambient Occlusion.
Its value is set by the console variable system when r.AOGlobalDistanceField.ForceRecacheForStreaming is modified.
It interacts directly with the logic for updating global distance field clipmaps. When set to a non-zero value, it forces full updates of clipmaps regardless of streaming status.
Developers should be aware that:
- This variable directly affects the behavior of global distance field updates.
- It can cause performance impacts when set to a non-zero value.
Best practices for this variable are the same as for r.AOGlobalDistanceField.ForceRecacheForStreaming, as they are essentially the same variable with different access methods.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/GlobalDistanceField.cpp:207
Scope: file
Source code excerpt:
int32 GAOGlobalDistanceFieldForceRecacheForStreaming = 0;
FAutoConsoleVariableRef CVarAOGlobalDistanceFieldForceRecacheForStreaming(
TEXT("r.AOGlobalDistanceField.ForceRecacheForStreaming"),
GAOGlobalDistanceFieldForceRecacheForStreaming,
TEXT("Useful for debugging or profiling full clipmap updates that happen when a clipmap is detected to have pending streaming."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenSceneGlobalSDFCoveredExpandSurfaceScale = 1.0f;
#Associated Variable and Callsites
This variable is associated with another variable named GAOGlobalDistanceFieldForceRecacheForStreaming
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/GlobalDistanceField.cpp:205
Scope: file
Source code excerpt:
);
int32 GAOGlobalDistanceFieldForceRecacheForStreaming = 0;
FAutoConsoleVariableRef CVarAOGlobalDistanceFieldForceRecacheForStreaming(
TEXT("r.AOGlobalDistanceField.ForceRecacheForStreaming"),
GAOGlobalDistanceFieldForceRecacheForStreaming,
TEXT("Useful for debugging or profiling full clipmap updates that happen when a clipmap is detected to have pending streaming."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenSceneGlobalSDFCoveredExpandSurfaceScale = 1.0f;
FAutoConsoleVariableRef CVarLumenSceneGlobalSDFCoveredExpandSurfaceScale(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/GlobalDistanceField.cpp:1207
Scope (from outer to inner):
file
function static void ComputeUpdateRegionsAndUpdateViewState
Source code excerpt:
// If some of the height fields has pending streaming regions, postpone a full update.
if (bHasPendingStreaming && GAOGlobalDistanceFieldForceRecacheForStreaming == 0)
{
// Mark a pending update for this height field. It will get processed when all pending texture streaming affecting it will be completed.
GlobalDistanceFieldData.DeferredUpdates[CacheType].AddUnique(ClipmapIndex);
}
else if (GlobalDistanceFieldData.DeferredUpdates[CacheType].Remove(ClipmapIndex) > 0 || GAOGlobalDistanceFieldForceRecacheForStreaming != 0)
{
// Push full update
Clipmap.UpdateBounds.Reset();
Clipmap.UpdateBounds.Add(FClipmapUpdateBounds(ClipmapBounds.GetCenter(), ClipmapBounds.GetExtent(), false));
Clipmap.FullRecaptureReason = EGlobalSDFFullRecaptureReason::HeightfieldStreaming;
}