r.Lumen.HardwareRayTracing.FarFieldBias

r.Lumen.HardwareRayTracing.FarFieldBias

#Overview

name: r.Lumen.HardwareRayTracing.FarFieldBias

This variable is created as a Console Variable (cvar).

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:

  1. Only modify it if you understand the implications on rendering quality and performance.
  2. Test thoroughly after making changes, as it can affect the appearance of global illumination.
  3. Consider the relationship between this bias and other ray tracing settings for optimal results.

Regarding the associated variable CVarLumenHardwareRayTracingFarFieldBias:

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);
}