r.Lumen.HardwareRayTracing.PullbackBias
r.Lumen.HardwareRayTracing.PullbackBias
#Overview
name: r.Lumen.HardwareRayTracing.PullbackBias
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Determines the pull-back bias when resuming a screen-trace ray (default = 8.0)
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.HardwareRayTracing.PullbackBias is to determine the pull-back bias when resuming a screen-trace ray in Lumen’s hardware ray tracing system. This setting variable is primarily used for the rendering system, specifically for the Lumen global illumination system in Unreal Engine 5.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the Lumen hardware ray tracing component. This can be inferred from the file location (LumenHardwareRayTracingCommon.cpp) and the namespace (Lumen) where it’s being used.
The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of 8.0, but can be changed at runtime using console commands or through project settings.
This variable interacts with its associated variable CVarLumenHardwareRayTracingPullbackBias. They share the same value, and CVarLumenHardwareRayTracingPullbackBias is used to access the value in the code.
Developers must be aware that this variable affects the accuracy and performance of ray tracing in the Lumen system. A higher value might prevent self-intersection artifacts but could potentially lead to light leaking or other visual artifacts. A lower value might improve accuracy but could introduce self-intersection issues.
Best practices when using this variable include:
- Testing different values to find the optimal balance between performance and visual quality for your specific scene.
- Monitoring performance impact when adjusting this value, especially in complex scenes with many ray-traced elements.
- Considering the scale of your scene when setting this value, as larger scenes might require different pull-back bias values.
Regarding the associated variable CVarLumenHardwareRayTracingPullbackBias:
The purpose of CVarLumenHardwareRayTracingPullbackBias is to provide a programmatic way to access and modify the r.Lumen.HardwareRayTracing.PullbackBias value within the C++ code of the engine.
It’s used in the Lumen namespace, specifically in the GetHardwareRayTracingPullbackBias function, which suggests it’s part of the Lumen subsystem in the Renderer module.
The value of this variable is set indirectly through the r.Lumen.HardwareRayTracing.PullbackBias console variable. It’s accessed using the GetValueOnRenderThread() method, ensuring thread-safe access in the render thread.
This variable directly interacts with r.Lumen.HardwareRayTracing.PullbackBias, serving as its in-code representation.
Developers should be aware that this variable is meant for internal engine use and should generally not be modified directly. Instead, changes should be made through the r.Lumen.HardwareRayTracing.PullbackBias console variable.
Best practices for this variable include:
- Using GetValueOnRenderThread() when accessing its value to ensure thread safety.
- Avoiding direct modification of this variable; instead, use the console variable system to change its value.
- Being cautious when using this variable in performance-critical code, as accessing console variables can have a small performance cost.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenHardwareRayTracingCommon.cpp:52
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarLumenHardwareRayTracingPullbackBias(
TEXT("r.Lumen.HardwareRayTracing.PullbackBias"),
8.0,
TEXT("Determines the pull-back bias when resuming a screen-trace ray (default = 8.0)"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<float> CVarLumenHardwareRayTracingFarFieldBias(
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenHardwareRayTracingPullbackBias
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenHardwareRayTracingCommon.cpp:51
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<float> CVarLumenHardwareRayTracingPullbackBias(
TEXT("r.Lumen.HardwareRayTracing.PullbackBias"),
8.0,
TEXT("Determines the pull-back bias when resuming a screen-trace ray (default = 8.0)"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenHardwareRayTracingCommon.cpp:273
Scope (from outer to inner):
file
namespace Lumen
function float GetHardwareRayTracingPullbackBias
Source code excerpt:
float GetHardwareRayTracingPullbackBias()
{
return CVarLumenHardwareRayTracingPullbackBias.GetValueOnRenderThread();
}
}
void SetLumenHardwareRayTracingSharedParameters(
FRDGBuilder& GraphBuilder,
const FSceneTextureParameters& SceneTextures,