r.Lumen.HardwareRayTracing.FarFieldBias
r.Lumen.HardwareRayTracing.FarFieldBias
#Overview
name: r.Lumen.HardwareRayTracing.FarFieldBias
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Determines bias for the far field traces. Default = 200
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.HardwareRayTracing.FarFieldBias is to determine the bias for far field traces in Lumen’s hardware ray tracing system. This setting is specifically used for the rendering system, particularly in the Lumen global illumination solution.
This setting variable is primarily used in the Lumen module of Unreal Engine’s rendering system. It’s part of the hardware ray tracing functionality within Lumen, which is responsible for real-time global illumination.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 200.0f, but can be adjusted at runtime or through configuration files.
The associated variable CVarLumenHardwareRayTracingFarFieldBias directly interacts with r.Lumen.HardwareRayTracing.FarFieldBias. This CVar is used to store and retrieve the value of the setting.
Developers must be aware that this variable affects the bias for far field traces in hardware ray tracing. The bias is used to prevent self-intersection artifacts in ray tracing, so adjusting this value can impact the visual quality and performance of the rendering.
Best practices when using this variable include:
- Only modify it if you understand the implications on rendering quality and performance.
- Test thoroughly after making changes, as it can affect the appearance of global illumination.
- Consider the relationship between this bias and other ray tracing settings for optimal results.
Regarding the associated variable CVarLumenHardwareRayTracingFarFieldBias:
- Its purpose is to provide a programmatic interface to get and set the far field bias value.
- It’s used within the LumenHardwareRayTracing namespace, specifically in the GetFarFieldBias() function.
- The value is retrieved using the GetValueOnRenderThread() method, ensuring thread-safe access.
- It’s clamped to a minimum value of 0.0f for safety.
- Developers should use this variable when they need to programmatically access or modify the far field bias in C++ code.
When working with CVarLumenHardwareRayTracingFarFieldBias, ensure to access it from the correct thread (render thread in this case) and consider any potential performance impacts of frequently querying or modifying this value.
#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:59
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarLumenHardwareRayTracingFarFieldBias(
TEXT("r.Lumen.HardwareRayTracing.FarFieldBias"),
200.0f,
TEXT("Determines bias for the far field traces. Default = 200"),
ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarLumenHardwareRayTracingMaxIterations(
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenHardwareRayTracingFarFieldBias
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenHardwareRayTracingCommon.cpp:58
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<float> CVarLumenHardwareRayTracingFarFieldBias(
TEXT("r.Lumen.HardwareRayTracing.FarFieldBias"),
200.0f,
TEXT("Determines bias for the far field traces. Default = 200"),
ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenHardwareRayTracingCommon.cpp:175
Scope (from outer to inner):
file
function float LumenHardwareRayTracing::GetFarFieldBias
Source code excerpt:
float LumenHardwareRayTracing::GetFarFieldBias()
{
return FMath::Max(CVarLumenHardwareRayTracingFarFieldBias.GetValueOnRenderThread(), 0.0f);
}
uint32 LumenHardwareRayTracing::GetMaxTraversalIterations()
{
return FMath::Max(CVarLumenHardwareRayTracingMaxIterations.GetValueOnRenderThread(), 1);
}