r.Lumen.ScreenProbeGather.HardwareRayTracing
r.Lumen.ScreenProbeGather.HardwareRayTracing
#Overview
name: r.Lumen.ScreenProbeGather.HardwareRayTracing
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
0. Software raytracing of diffuse indirect from Lumen cubemap tree.1. Enable hardware ray tracing of diffuse indirect. (Default)\n
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:
- This variable toggles between software raytracing (0) and hardware raytracing (1) for the Lumen screen probe gather process.
- Hardware raytracing is the default setting.
- The setting is render thread safe, meaning it can be changed at runtime without causing threading issues.
Best practices when using this variable include:
- Ensure that the hardware supports raytracing before enabling this feature.
- Consider performance implications when switching between software and hardware raytracing.
- Use this in conjunction with other Lumen settings for optimal results.
Regarding the associated variable CVarLumenScreenProbeGatherHardwareRayTracing:
- It serves the same purpose as r.Lumen.ScreenProbeGather.HardwareRayTracing.
- It’s used internally in the C++ code to check the current setting.
- The UseHardwareRayTracedScreenProbeGather function uses this variable to determine if hardware raytracing should be used for screen probe gathering.
- Developers should be aware that changing the console variable will affect this internal C++ variable.
- Best practice is to use the console command to modify this setting rather than trying to change the C++ variable directly.
#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
}
}