r.Lumen.ScreenProbeGather.ShortRangeAO.ApplyDuringIntegration

r.Lumen.ScreenProbeGather.ShortRangeAO.ApplyDuringIntegration

#Overview

name: r.Lumen.ScreenProbeGather.ShortRangeAO.ApplyDuringIntegration

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.Lumen.ScreenProbeGather.ShortRangeAO.ApplyDuringIntegration is to control whether Screen Space Bent Normal should be applied during BRDF integration in the Lumen rendering system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically related to screen probe gathering and short-range ambient occlusion.

This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. It’s referenced in the LumenScreenProbeGather.cpp file, which suggests it’s closely tied to the screen probe gathering process in Lumen.

The value of this variable is set through the Unreal Engine console variable system. It’s defined as an integer (int32) named GLumenShortRangeAOApplyDuringIntegration, initially set to 0. The console variable allows this value to be changed at runtime.

This variable interacts directly with the ApplyShortRangeAODuringIntegration() function, which returns true if GLumenShortRangeAOApplyDuringIntegration is non-zero.

Developers should be aware that enabling this feature (setting the value to non-zero) can improve quality but may cause streaking on moving objects. This is because the Screen Space Bent Normal is applied before the temporal filter when this setting is enabled.

Best practices when using this variable include:

  1. Testing the visual impact with and without this feature enabled.
  2. Being cautious of potential performance impacts, as applying additional calculations during BRDF integration may affect rendering speed.
  3. Considering the trade-off between quality improvement and potential artifacts on moving objects.

Regarding the associated variable GLumenShortRangeAOApplyDuringIntegration:

The purpose of GLumenShortRangeAOApplyDuringIntegration is to store the actual value of the r.Lumen.ScreenProbeGather.ShortRangeAO.ApplyDuringIntegration setting. It’s the internal representation of the console variable.

This variable is used in the Lumen rendering system, specifically in the screen probe gathering process.

The value of GLumenShortRangeAOApplyDuringIntegration is set through the console variable system, allowing it to be changed at runtime.

It directly interacts with the ApplyShortRangeAODuringIntegration() function, which checks if this variable is non-zero.

Developers should be aware that this is the actual variable being checked in the code, so any programmatic changes to the behavior should modify this variable.

Best practices include using the console variable system to modify this value rather than changing it directly in code, to maintain consistency with the engine’s configuration system.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:264

Scope: file

Source code excerpt:

int32 GLumenShortRangeAOApplyDuringIntegration = 0;
FAutoConsoleVariableRef CVarLumenShortRangeAOApplyDuringIntegration(
	TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.ApplyDuringIntegration"),
	GLumenShortRangeAOApplyDuringIntegration,
	TEXT("Whether Screen Space Bent Normal should be applied during BRDF integration, which has higher quality but is before the temporal filter so causes streaking on moving objects."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenScreenProbeFixedJitterIndex = -1;

#Associated Variable and Callsites

This variable is associated with another variable named GLumenShortRangeAOApplyDuringIntegration. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:262

Scope: file

Source code excerpt:

);

int32 GLumenShortRangeAOApplyDuringIntegration = 0;
FAutoConsoleVariableRef CVarLumenShortRangeAOApplyDuringIntegration(
	TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.ApplyDuringIntegration"),
	GLumenShortRangeAOApplyDuringIntegration,
	TEXT("Whether Screen Space Bent Normal should be applied during BRDF integration, which has higher quality but is before the temporal filter so causes streaking on moving objects."),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GLumenScreenProbeFixedJitterIndex = -1;
FAutoConsoleVariableRef CVarLumenScreenProbeUseJitter(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:374

Scope (from outer to inner):

file
namespace    LumenScreenProbeGather
function     bool ApplyShortRangeAODuringIntegration

Source code excerpt:

	bool ApplyShortRangeAODuringIntegration()
	{
		return GLumenShortRangeAOApplyDuringIntegration != 0;
	}

	bool UseProbeSpatialFilter()
	{
		return GLumenScreenProbeGatherReferenceMode ? false : GLumenScreenProbeSpatialFilter != 0;
	}