r.Lumen.Visualize.HardwareRayTracing.Retrace.HitLighting
r.Lumen.Visualize.HardwareRayTracing.Retrace.HitLighting
#Overview
name: r.Lumen.Visualize.HardwareRayTracing.Retrace.HitLighting
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Determines whether a second trace will be fired for hit-lighting for invalid surface-cache hits (default = 1
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Visualize.HardwareRayTracing.Retrace.HitLighting is to control whether a second ray trace should be performed for hit-lighting when invalid surface-cache hits are encountered during hardware ray tracing visualization in Lumen.
This setting variable is primarily used in the Lumen rendering system, which is part of Unreal Engine’s global illumination solution. It is specifically related to the hardware ray tracing visualization feature of Lumen.
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, meaning it’s disabled by default.
The associated variable CVarLumenVisualizeHardwareRayTracingRetraceHitLighting directly interacts with it, as they share the same value and purpose.
Developers should be aware that enabling this variable (setting it to a non-zero value) will cause additional ray tracing operations to be performed, which could impact performance. It should primarily be used for debugging and visualization purposes.
Best practices when using this variable include:
- Use it only when necessary for debugging or visualizing hit-lighting issues.
- Be mindful of the performance impact when enabled, especially in performance-critical scenarios.
- Remember to disable it (set to 0) when not needed to avoid unnecessary performance overhead.
Regarding the associated variable CVarLumenVisualizeHardwareRayTracingRetraceHitLighting:
The purpose of this variable is identical to r.Lumen.Visualize.HardwareRayTracing.Retrace.HitLighting, as they are essentially the same variable represented in different forms (console command vs. C++ variable).
It’s used in the Lumen visualization system, specifically for hardware ray tracing visualization.
The value is set when the console variable is initialized, and it can be modified at runtime through console commands.
This variable is used in the UseHitLighting function within the LumenVisualize namespace to determine whether hit-lighting should be used.
Developers should be aware that this variable directly controls the behavior of the hit-lighting visualization and can affect performance when enabled.
Best practices for using this variable are the same as those for r.Lumen.Visualize.HardwareRayTracing.Retrace.HitLighting, focusing on using it judiciously for debugging and visualization purposes, and ensuring it’s disabled when not needed.
#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:60
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarLumenVisualizeHardwareRayTracingRetraceHitLighting(
TEXT("r.Lumen.Visualize.HardwareRayTracing.Retrace.HitLighting"),
0,
TEXT("Determines whether a second trace will be fired for hit-lighting for invalid surface-cache hits (default = 1"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarLumenVisualizeHardwareRayTracingRetraceFarField(
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenVisualizeHardwareRayTracingRetraceHitLighting
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeHardwareRayTracing.cpp:59
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarLumenVisualizeHardwareRayTracingRetraceHitLighting(
TEXT("r.Lumen.Visualize.HardwareRayTracing.Retrace.HitLighting"),
0,
TEXT("Determines whether a second trace will be fired for hit-lighting for invalid surface-cache hits (default = 1"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenVisualizeHardwareRayTracing.cpp:135
Scope (from outer to inner):
file
namespace LumenVisualize
function bool UseHitLighting
Source code excerpt:
{
return LumenVisualize::IsHitLightingForceEnabled(View, bLumenGIEnabled)
|| CVarLumenVisualizeHardwareRayTracingRetraceHitLighting.GetValueOnRenderThread() != 0;
}
#endif
return false;
}
}