r.Lumen.Visualize.HardwareRayTracing
r.Lumen.Visualize.HardwareRayTracing
#Overview
name: r.Lumen.Visualize.HardwareRayTracing
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Enables visualization of hardware ray tracing (Default = 1)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Visualize.HardwareRayTracing is to enable or disable the visualization of hardware ray tracing in the Lumen global illumination system within Unreal Engine 5. This setting is primarily used for debugging and visual inspection of the ray tracing process.
This setting variable is relied upon by the Lumen subsystem within the Renderer module of Unreal Engine 5. Specifically, it is used in the hardware ray tracing visualization component of Lumen.
The value of this variable is set through the console variable system in Unreal Engine. It is defined as a TAutoConsoleVariable with a default value of 1 (enabled).
The associated variable CVarLumenVisualizeHardwareRayTracing interacts directly with r.Lumen.Visualize.HardwareRayTracing. They share the same value and purpose.
Developers must be aware that:
- This variable only has an effect when hardware ray tracing is enabled and supported by the system.
- It is render thread safe, meaning it can be changed at runtime without causing threading issues.
- The visualization may have a performance impact, so it should be used primarily for debugging and development purposes.
Best practices when using this variable include:
- Only enable it when actively debugging or inspecting the ray tracing process.
- Disable it in production builds to avoid unnecessary performance overhead.
- Use it in conjunction with other Lumen debugging tools for a comprehensive understanding of the ray tracing process.
Regarding the associated variable CVarLumenVisualizeHardwareRayTracing:
- It serves the same purpose as r.Lumen.Visualize.HardwareRayTracing.
- It is used internally within the engine code to check the state of the visualization setting.
- Developers should generally interact with the r.Lumen.Visualize.HardwareRayTracing console variable rather than this internal variable directly.
- It is used in the UseHardwareRayTracedVisualize function to determine if the visualization should be active.
When working with either of these variables, developers should ensure that hardware ray tracing is supported and enabled in their project settings for the visualization to have any effect.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeHardwareRayTracing.cpp:25
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarLumenVisualizeHardwareRayTracing(
TEXT("r.Lumen.Visualize.HardwareRayTracing"),
1,
TEXT("Enables visualization of hardware ray tracing (Default = 1)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarLumenVisualizeHardwareRayTracingDeferredMaterial(
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenVisualizeHardwareRayTracing
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeHardwareRayTracing.cpp:24
Scope: file
Source code excerpt:
#endif // RHI_RAYTRACING
static TAutoConsoleVariable<int32> CVarLumenVisualizeHardwareRayTracing(
TEXT("r.Lumen.Visualize.HardwareRayTracing"),
1,
TEXT("Enables visualization of hardware ray tracing (Default = 1)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeHardwareRayTracing.cpp:95
Scope (from outer to inner):
file
namespace Lumen
function bool UseHardwareRayTracedVisualize
Source code excerpt:
bVisualize = IsRayTracingEnabled()
&& Lumen::UseHardwareRayTracing(ViewFamily)
&& CVarLumenVisualizeHardwareRayTracing.GetValueOnRenderThread() != 0;
#endif
return bVisualize;
}
bool ShouldVisualizeHardwareRayTracing(const FSceneViewFamily& ViewFamily)
{