r.Lumen.TranslucencyVolume.RadianceCache.FarField

r.Lumen.TranslucencyVolume.RadianceCache.FarField

#Overview

name: r.Lumen.TranslucencyVolume.RadianceCache.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.TranslucencyVolume.RadianceCache.FarField is to control whether the Lumen Translucency Volume Radiance Cache system should trace against the Far Field representation. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically focusing on the translucency volume lighting component.

This setting variable is primarily used by the Lumen subsystem within the Renderer module of Unreal Engine 5. It’s particularly relevant to the translucency volume lighting calculations, which are part of the broader global illumination solution provided by Lumen.

The value of this variable is set through the Unreal Engine console variable system. It’s defined as an integer (int32) and is initialized to 0 by default. The associated C++ variable GTranslucencyVolumeRadianceCacheFarField directly reflects the value of this console variable.

The main interaction with this variable occurs in the GetLumenTranslucencyGIVolumeRadianceCacheInputs function, where it’s used to set the bFarField flag in the FRadianceCacheConfiguration structure. This suggests that when the variable is set to a non-zero value, the Far Field representation is used in the radiance cache calculations for translucency volumes.

Developers should be aware that this setting can impact the quality and performance of translucency lighting in scenes using Lumen. Enabling the Far Field representation (by setting this variable to a non-zero value) may provide more accurate lighting at a distance but could also increase computational cost.

Best practices when using this variable include:

  1. Testing the impact on both visual quality and performance when enabling or disabling this feature.
  2. Considering the scale and composition of your scenes when deciding whether to enable Far Field tracing.
  3. Using this in conjunction with other Lumen settings to achieve the desired balance between quality and performance.

Regarding the associated variable GTranslucencyVolumeRadianceCacheFarField:

The purpose of GTranslucencyVolumeRadianceCacheFarField is to serve as the C++ representation of the r.Lumen.TranslucencyVolume.RadianceCache.FarField console variable. It directly controls the behavior of the Far Field tracing in the code.

This variable is used within the Lumen subsystem of the Renderer module, specifically in the translucency volume lighting calculations.

The value of GTranslucencyVolumeRadianceCacheFarField is set by the console variable system when r.Lumen.TranslucencyVolume.RadianceCache.FarField is modified.

It interacts directly with the FRadianceCacheConfiguration structure in the GetLumenTranslucencyGIVolumeRadianceCacheInputs function.

Developers should be aware that modifying this variable directly in C++ code is not recommended, as it should be controlled through the console variable system to ensure consistency.

Best practices include using the console variable r.Lumen.TranslucencyVolume.RadianceCache.FarField to modify this setting rather than changing the C++ variable directly, and considering its impact on both lighting quality and performance when adjusting it.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:220

Scope: file

Source code excerpt:

int32 GTranslucencyVolumeRadianceCacheFarField = 0;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheFarField(
	TEXT("r.Lumen.TranslucencyVolume.RadianceCache.FarField"),
	GTranslucencyVolumeRadianceCacheFarField,
	TEXT("Whether to trace against the FarField representation"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GTranslucencyVolumeRadianceCacheStats = 0;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:218

Scope: file

Source code excerpt:

);

int32 GTranslucencyVolumeRadianceCacheFarField = 0;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheFarField(
	TEXT("r.Lumen.TranslucencyVolume.RadianceCache.FarField"),
	GTranslucencyVolumeRadianceCacheFarField,
	TEXT("Whether to trace against the FarField representation"),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GTranslucencyVolumeRadianceCacheStats = 0;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheStats(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenTranslucencyVolumeLighting.cpp:688

Scope (from outer to inner):

file
function     LumenRadianceCache::FUpdateInputs FDeferredShadingSceneRenderer::GetLumenTranslucencyGIVolumeRadianceCacheInputs

Source code excerpt:


	FRadianceCacheConfiguration Configuration;
	Configuration.bFarField = GTranslucencyVolumeRadianceCacheFarField != 0;

	FMarkUsedRadianceCacheProbes MarkUsedRadianceCacheProbesCallbacks;

	if (GLumenTranslucencyVolume && GLumenTranslucencyVolumeRadianceCache)
	{
		MarkUsedRadianceCacheProbesCallbacks.AddLambda([VolumeParameters, ComputePassFlags](