r.AOGlobalDistanceFieldForceFullUpdate

r.AOGlobalDistanceFieldForceFullUpdate

#Overview

name: r.AOGlobalDistanceFieldForceFullUpdate

This variable is created as a Console Variable (cvar).

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:

  1. Keep it disabled (set to 0) for normal gameplay and production builds.
  2. Use it sparingly and only when necessary for debugging or specific visual effects.
  3. Be aware of the performance impact when enabled.
  4. Consider using it in conjunction with other distance field-related settings for comprehensive debugging.

Regarding the associated variable GAOGlobalDistanceFieldForceFullUpdate:

#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)