r.Lumen.TranslucencyVolume.RadianceCache.NumProbesToTraceBudget

r.Lumen.TranslucencyVolume.RadianceCache.NumProbesToTraceBudget

#Overview

name: r.Lumen.TranslucencyVolume.RadianceCache.NumProbesToTraceBudget

The value of this variable can be defined or overridden in .ini config files. 3 .ini config files referencing this setting variable.

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.NumProbesToTraceBudget is to control the number of probes to trace in the radiance cache for the Lumen translucency volume lighting system. This setting is part of Unreal Engine 5’s rendering system, specifically the Lumen global illumination solution.

This setting variable is used in the Lumen subsystem, particularly in the translucency volume lighting module. It’s part of the renderer’s implementation for handling translucent objects in the scene.

The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which means it can be adjusted at runtime through console commands or configuration files.

The associated variable GTranslucencyVolumeRadianceCacheNumProbesToTraceBudget directly interacts with this setting. They share the same value, with GTranslucencyVolumeRadianceCacheNumProbesToTraceBudget being the actual variable used in the code.

Developers should be aware that this variable affects the performance and quality trade-off in the Lumen translucency volume lighting system. A higher value will result in more accurate lighting but may impact performance.

Best practices when using this variable include:

  1. Adjusting it based on the scene complexity and performance requirements.
  2. Testing different values to find the optimal balance between lighting quality and performance.
  3. Considering scaling this value in different quality settings of the game.

Regarding the associated variable GTranslucencyVolumeRadianceCacheNumProbesToTraceBudget:

The purpose of GTranslucencyVolumeRadianceCacheNumProbesToTraceBudget is to store the actual value used in the code for the number of probes to trace in the radiance cache.

This variable is used directly in the Lumen translucency volume lighting system, specifically in the SetupRadianceCacheInputs function of the LumenRadianceCache class.

The value of this variable is set by the console variable system, mirroring the value of r.Lumen.TranslucencyVolume.RadianceCache.NumProbesToTraceBudget.

It interacts with other parts of the rendering system, such as the view family’s editing state, which can scale the trace budget.

Developers should be aware that this variable’s value might be scaled in certain situations, such as when the scene is being edited in the editor.

Best practices include:

  1. Considering the impact of this variable on both runtime performance and editor performance.
  2. Monitoring its usage across different scenarios to ensure optimal performance.
  3. Potentially exposing this as a user-adjustable setting for advanced users or developers.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseScalability.ini:290, section: [GlobalIlluminationQuality@2]

Location: <Workspace>/Engine/Config/BaseScalability.ini:314, section: [GlobalIlluminationQuality@3]

Location: <Workspace>/Engine/Config/BaseScalability.ini:338, section: [GlobalIlluminationQuality@Cine]

#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:180

Scope: file

Source code excerpt:

int32 GTranslucencyVolumeRadianceCacheNumProbesToTraceBudget = 200;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheNumProbesToTraceBudget(
	TEXT("r.Lumen.TranslucencyVolume.RadianceCache.NumProbesToTraceBudget"),
	GTranslucencyVolumeRadianceCacheNumProbesToTraceBudget,
	TEXT(""),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GTranslucencyVolumeRadianceCacheGridResolution = 24;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

int32 GTranslucencyVolumeRadianceCacheNumProbesToTraceBudget = 200;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheNumProbesToTraceBudget(
	TEXT("r.Lumen.TranslucencyVolume.RadianceCache.NumProbesToTraceBudget"),
	GTranslucencyVolumeRadianceCacheNumProbesToTraceBudget,
	TEXT(""),
	ECVF_Scalability | ECVF_RenderThreadSafe
);

int32 GTranslucencyVolumeRadianceCacheGridResolution = 24;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheResolution(

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

Scope (from outer to inner):

file
namespace    LumenTranslucencyVolumeRadianceCache
function     LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs

Source code excerpt:

		Parameters.FinalRadianceAtlasMaxMip = GetNumMipmaps() - 1;
		const float TraceBudgetScale = View.Family->bCurrentlyBeingEdited ? 10.0f : 1.0f;
		Parameters.NumProbesToTraceBudget = GTranslucencyVolumeRadianceCacheNumProbesToTraceBudget * TraceBudgetScale;
		Parameters.RadianceCacheStats = GTranslucencyVolumeRadianceCacheStats;
		return Parameters;
	}
};