r.Lumen.ScreenProbeGather.ShortRangeAO.HardwareRayTracing

r.Lumen.ScreenProbeGather.ShortRangeAO.HardwareRayTracing

#Overview

name: r.Lumen.ScreenProbeGather.ShortRangeAO.HardwareRayTracing

The value of this variable can be defined or overridden in .ini config files. 3 .ini config files referencing this setting variable.

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.HardwareRayTracing is to control the method used for calculating the full resolution Bent Normal (directional occlusion) in the Lumen lighting system of Unreal Engine 5.

This setting variable is primarily used by the Lumen subsystem, which is part of Unreal Engine 5’s rendering system. Specifically, it affects the Short Range Ambient Occlusion (AO) calculation within the Lumen Screen Probe Gather process.

The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with an initial value of 0.

This variable interacts directly with its associated variable CVarLumenShortRangeAOHardwareRayTracing. They share the same value and are used interchangeably in the code.

Developers must be aware that this variable has two possible values: 0: Uses screen space tracing for the full resolution Bent Normal calculation. 1: Enables hardware ray tracing for the full resolution Bent Normal calculation.

Best practices when using this variable include:

  1. Ensure that hardware ray tracing is supported on the target platform before enabling it.
  2. Consider the performance implications of enabling hardware ray tracing, as it can be more computationally expensive.
  3. Test the visual quality and performance differences between the two modes to determine the best setting for your specific use case.

Regarding the associated variable CVarLumenShortRangeAOHardwareRayTracing:

The purpose of CVarLumenShortRangeAOHardwareRayTracing is identical to r.Lumen.ScreenProbeGather.ShortRangeAO.HardwareRayTracing. It’s an internal representation of the same setting.

This variable is used within the Lumen namespace, specifically in the UseHardwareRayTracedShortRangeAO function. This function determines whether hardware ray tracing should be used for short-range ambient occlusion calculations.

The value of this variable is set in the same way as r.Lumen.ScreenProbeGather.ShortRangeAO.HardwareRayTracing, through the console variable system.

Developers should be aware that this variable is checked in conjunction with other conditions, such as whether ray tracing is enabled globally and whether hardware ray tracing is used for Lumen in general.

Best practices for using this variable are the same as those for r.Lumen.ScreenProbeGather.ShortRangeAO.HardwareRayTracing, as they represent the same setting.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseScalability.ini:286, section: [GlobalIlluminationQuality@2]

Location: <Workspace>/Engine/Config/BaseScalability.ini:309, section: [GlobalIlluminationQuality@3]

Location: <Workspace>/Engine/Config/BaseScalability.ini:333, section: [GlobalIlluminationQuality@Cine]

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenShortRangeAOHardwareRayTracing.cpp:20

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarLumenShortRangeAOHardwareRayTracing(
	TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HardwareRayTracing"),
	0,
	TEXT("0. Screen space tracing for the full resolution Bent Normal (directional occlusion).")
	TEXT("1. Enable hardware ray tracing of the full resolution Bent Normal (directional occlusion). (Default)\n"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenShortRangeAOHardwareRayTracing.cpp:19

Scope: file

Source code excerpt:

#endif // RHI_RAYTRACING

static TAutoConsoleVariable<int32> CVarLumenShortRangeAOHardwareRayTracing(
	TEXT("r.Lumen.ScreenProbeGather.ShortRangeAO.HardwareRayTracing"),
	0,
	TEXT("0. Screen space tracing for the full resolution Bent Normal (directional occlusion).")
	TEXT("1. Enable hardware ray tracing of the full resolution Bent Normal (directional occlusion). (Default)\n"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenShortRangeAOHardwareRayTracing.cpp:41

Scope (from outer to inner):

file
namespace    Lumen
function     bool UseHardwareRayTracedShortRangeAO

Source code excerpt:

		return IsRayTracingEnabled()
			&& Lumen::UseHardwareRayTracing(ViewFamily)
			&& (CVarLumenShortRangeAOHardwareRayTracing.GetValueOnAnyThread() != 0);
#else
		return false;
#endif
	}
}