r.Lumen.RadianceCache.HardwareRayTracing.Retrace.FarField

r.Lumen.RadianceCache.HardwareRayTracing.Retrace.FarField

#Overview

name: r.Lumen.RadianceCache.HardwareRayTracing.Retrace.FarField

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.RadianceCache.HardwareRayTracing.Retrace.FarField is to control whether a second ray trace is performed for far-field contributions in Lumen’s radiance cache when using hardware ray tracing.

This setting variable is primarily used in the Lumen rendering system, specifically in the hardware ray tracing component of the radiance cache. It’s part of Unreal Engine 5’s global illumination solution.

The value of this variable is set through the console variable system. It’s initialized with a default value of 1 (enabled) and can be changed at runtime.

The associated variable CVarLumenRadianceCacheHardwareRayTracingRetraceFarField directly interacts with it. This is the actual console variable object that stores and provides access to the setting’s value.

Developers should be aware that:

  1. This setting only takes effect when hardware ray tracing is enabled.
  2. Enabling this feature (value = 1) may increase rendering quality but at the cost of performance, as it involves an additional ray trace.
  3. The setting is render thread safe, meaning it can be changed dynamically without causing thread safety issues.

Best practices when using this variable include:

  1. Consider the performance implications when enabling this feature, especially on less powerful hardware.
  2. Use it in conjunction with other Lumen settings to fine-tune the balance between visual quality and performance.
  3. Test the impact of enabling/disabling this feature in various scenes to understand its effect on your specific project.

Regarding the associated variable CVarLumenRadianceCacheHardwareRayTracingRetraceFarField:

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadianceCacheHardwareRayTracing.cpp:34

Scope: file

Source code excerpt:


static TAutoConsoleVariable<int32> CVarLumenRadianceCacheHardwareRayTracingRetraceFarField(
	TEXT("r.Lumen.RadianceCache.HardwareRayTracing.Retrace.FarField"),
	1,
	TEXT("Determines whether a second trace will be fired for far-field contribution (Default = 1)"),
	ECVF_RenderThreadSafe
);

#endif // RHI_RAYTRACING

#Associated Variable and Callsites

This variable is associated with another variable named CVarLumenRadianceCacheHardwareRayTracingRetraceFarField. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadianceCacheHardwareRayTracing.cpp:33

Scope: file

Source code excerpt:

);

static TAutoConsoleVariable<int32> CVarLumenRadianceCacheHardwareRayTracingRetraceFarField(
	TEXT("r.Lumen.RadianceCache.HardwareRayTracing.Retrace.FarField"),
	1,
	TEXT("Determines whether a second trace will be fired for far-field contribution (Default = 1)"),
	ECVF_RenderThreadSafe
);

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenRadianceCacheHardwareRayTracing.cpp:247

Scope (from outer to inner):

file
function     bool UseFarFieldForRadianceCache

Source code excerpt:

bool UseFarFieldForRadianceCache(const FSceneViewFamily& ViewFamily)
{
	return Lumen::UseFarField(ViewFamily) && CVarLumenRadianceCacheHardwareRayTracingRetraceFarField.GetValueOnRenderThread();
}

void FDeferredShadingSceneRenderer::PrepareLumenHardwareRayTracingRadianceCache(const FViewInfo& View, TArray<FRHIRayTracingShader*>& OutRayGenShaders)
{
}