r.Lumen.ScreenProbeGather.HardwareRayTracing

r.Lumen.ScreenProbeGather.HardwareRayTracing

#Overview

name: r.Lumen.ScreenProbeGather.HardwareRayTracing

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.HardwareRayTracing is to control the raytracing method used for gathering diffuse indirect lighting in the Lumen global illumination system. It is specifically related to the screen probe gather process in Lumen.

This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. It affects the raytracing approach for calculating indirect lighting.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1, which enables hardware raytracing for diffuse indirect lighting.

The associated variable CVarLumenScreenProbeGatherHardwareRayTracing directly interacts with it. They share the same value and purpose.

Developers must be aware that:

  1. This variable toggles between software raytracing (0) and hardware raytracing (1) for the Lumen screen probe gather process.
  2. Hardware raytracing is the default setting.
  3. The setting is render thread safe, meaning it can be changed at runtime without causing threading issues.

Best practices when using this variable include:

  1. Ensure that the hardware supports raytracing before enabling this feature.
  2. Consider performance implications when switching between software and hardware raytracing.
  3. Use this in conjunction with other Lumen settings for optimal results.

Regarding the associated variable CVarLumenScreenProbeGatherHardwareRayTracing:

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeHardwareRayTracing.cpp:21

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarLumenScreenProbeGatherHardwareRayTracing(
	TEXT("r.Lumen.ScreenProbeGather.HardwareRayTracing"),
	1,
	TEXT("0. Software raytracing of diffuse indirect from Lumen cubemap tree.")
	TEXT("1. Enable hardware ray tracing of diffuse indirect. (Default)\n"),
	ECVF_RenderThreadSafe
);

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

#include "LumenHardwareRayTracingCommon.h"

static TAutoConsoleVariable<int32> CVarLumenScreenProbeGatherHardwareRayTracing(
	TEXT("r.Lumen.ScreenProbeGather.HardwareRayTracing"),
	1,
	TEXT("0. Software raytracing of diffuse indirect from Lumen cubemap tree.")
	TEXT("1. Enable hardware ray tracing of diffuse indirect. (Default)\n"),
	ECVF_RenderThreadSafe
);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeHardwareRayTracing.cpp:51

Scope (from outer to inner):

file
namespace    Lumen
function     bool UseHardwareRayTracedScreenProbeGather

Source code excerpt:

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