r.Lumen.TranslucencyVolume.RadianceCache.Stats

r.Lumen.TranslucencyVolume.RadianceCache.Stats

#Overview

name: r.Lumen.TranslucencyVolume.RadianceCache.Stats

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.Stats is to enable GPU printing of Radiance Cache update statistics for the Lumen Translucency Volume lighting system in Unreal Engine 5.

This setting variable is primarily used by the Lumen rendering subsystem, specifically for the Translucency Volume lighting feature. It is part of the Renderer module in Unreal Engine 5.

The value of this variable is set through the Unreal Engine console variable system. It is defined as an FAutoConsoleVariableRef, which allows it to be modified at runtime through console commands or configuration files.

This variable interacts directly with the associated variable GTranslucencyVolumeRadianceCacheStats. They share the same value, with the console variable acting as an interface to modify the global variable.

Developers should be aware that enabling this variable will cause the GPU to print out Radiance Cache update statistics, which could impact performance if left enabled in a shipping build. It’s primarily intended for debugging and optimization purposes.

Best practices for using this variable include:

  1. Use it during development and testing phases to gather performance data on the Radiance Cache updates.
  2. Disable it in shipping builds to avoid unnecessary performance overhead.
  3. Combine its use with other Lumen debugging tools for a comprehensive understanding of the rendering pipeline.

Regarding the associated variable GTranslucencyVolumeRadianceCacheStats:

The purpose of GTranslucencyVolumeRadianceCacheStats is to store the state of whether Radiance Cache update statistics should be printed by the GPU.

This variable is used within the Lumen Translucency Volume lighting system, specifically in the SetupRadianceCacheInputs function of the LumenRadianceCache class.

The value of this variable is set through the r.Lumen.TranslucencyVolume.RadianceCache.Stats console variable.

It interacts directly with the LumenRadianceCache system, influencing whether statistics are gathered and printed during the rendering process.

Developers should be aware that this variable directly affects the behavior of the Radiance Cache system and can impact performance when enabled.

Best practices for using this variable include:

  1. Use it in conjunction with other debugging tools to profile and optimize the Lumen Translucency Volume lighting system.
  2. Ensure it’s set to 0 (disabled) in release builds to prevent unnecessary performance overhead.
  3. Consider the impact on frame rate when enabling this feature, especially on lower-end hardware.

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

Scope: file

Source code excerpt:

int32 GTranslucencyVolumeRadianceCacheStats = 0;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheStats(
	TEXT("r.Lumen.TranslucencyVolume.RadianceCache.Stats"),
	GTranslucencyVolumeRadianceCacheStats,
	TEXT("GPU print out Radiance Cache update stats."),
	ECVF_RenderThreadSafe
);

float GTranslucencyVolumeGridCenterOffsetFromDepthBuffer = 0.5f;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

int32 GTranslucencyVolumeRadianceCacheStats = 0;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheStats(
	TEXT("r.Lumen.TranslucencyVolume.RadianceCache.Stats"),
	GTranslucencyVolumeRadianceCacheStats,
	TEXT("GPU print out Radiance Cache update stats."),
	ECVF_RenderThreadSafe
);

float GTranslucencyVolumeGridCenterOffsetFromDepthBuffer = 0.5f;
FAutoConsoleVariableRef CVarTranslucencyVolumeGridCenterOffsetFromDepthBuffer(

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

Scope (from outer to inner):

file
namespace    LumenTranslucencyVolumeRadianceCache
function     LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs

Source code excerpt:

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


const static uint32 MaxTranslucencyVolumeConeDirections = 64;