r.Lumen.TranslucencyVolume.RadianceCache.ReprojectionRadiusScale

r.Lumen.TranslucencyVolume.RadianceCache.ReprojectionRadiusScale

#Overview

name: r.Lumen.TranslucencyVolume.RadianceCache.ReprojectionRadiusScale

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.ReprojectionRadiusScale is to control the reprojection radius scale for the translucency volume radiance cache in Lumen, Unreal Engine 5’s global illumination system.

This setting variable is primarily used in the Lumen subsystem, specifically within the translucency volume lighting module. It’s part of the rendering system, focusing on how light interacts with 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 allows it to be modified at runtime through console commands or configuration files.

The variable interacts directly with GTranslucencyVolumeRadianceCacheReprojectionRadiusScale, which is the actual float value used in the code. They share the same value, with the console variable acting as an interface to modify the global variable.

Developers should be aware that this variable affects the reprojection radius for the radiance cache used in translucency volume lighting. A larger value will increase the radius, potentially improving temporal stability but possibly introducing more artifacts or reducing accuracy in rapidly changing lighting conditions.

Best practices when using this variable include:

  1. Testing different values to find the right balance between temporal stability and accuracy for your specific scene.
  2. Being cautious when increasing the value, as it may impact performance or visual quality.
  3. Considering the interaction with other Lumen settings, especially those related to translucency and radiance caches.

Regarding the associated variable GTranslucencyVolumeRadianceCacheReprojectionRadiusScale:

The purpose of this variable is to store the actual float value used in the radiance cache calculations for translucency volume lighting.

It’s used directly in the Lumen translucency volume lighting module, specifically in the SetupRadianceCacheInputs function within the LumenTranslucencyVolumeRadianceCache namespace.

The value of this variable is set by the console variable r.Lumen.TranslucencyVolume.RadianceCache.ReprojectionRadiusScale, with an initial value of 10.0f.

It interacts with the LumenRadianceCache::FRadianceCacheInputs structure, setting the ReprojectionRadiusScale parameter.

Developers should be aware that modifying this variable directly in code is not recommended, as it’s intended to be controlled through the console variable system.

Best practices for this variable include:

  1. Using the console variable to modify its value rather than changing it directly in code.
  2. Considering its impact on the radiance cache behavior when debugging or optimizing Lumen’s translucency lighting.
  3. Monitoring its value when investigating issues related to translucency lighting or temporal stability in Lumen.

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

Scope: file

Source code excerpt:

float GTranslucencyVolumeRadianceCacheReprojectionRadiusScale = 10.0f;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheProbeReprojectionRadiusScale(
	TEXT("r.Lumen.TranslucencyVolume.RadianceCache.ReprojectionRadiusScale"),
	GTranslucencyVolumeRadianceCacheReprojectionRadiusScale,
	TEXT(""),
	ECVF_RenderThreadSafe
);

int32 GTranslucencyVolumeRadianceCacheFarField = 0;

#Associated Variable and Callsites

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

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

Scope: file

Source code excerpt:

);

float GTranslucencyVolumeRadianceCacheReprojectionRadiusScale = 10.0f;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheProbeReprojectionRadiusScale(
	TEXT("r.Lumen.TranslucencyVolume.RadianceCache.ReprojectionRadiusScale"),
	GTranslucencyVolumeRadianceCacheReprojectionRadiusScale,
	TEXT(""),
	ECVF_RenderThreadSafe
);

int32 GTranslucencyVolumeRadianceCacheFarField = 0;
FAutoConsoleVariableRef CVarTranslucencyVolumeRadianceCacheFarField(

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

Scope (from outer to inner):

file
namespace    LumenTranslucencyVolumeRadianceCache
function     LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs

Source code excerpt:

	{
		LumenRadianceCache::FRadianceCacheInputs Parameters = LumenRadianceCache::GetDefaultRadianceCacheInputs();
		Parameters.ReprojectionRadiusScale = GTranslucencyVolumeRadianceCacheReprojectionRadiusScale;
		Parameters.ClipmapWorldExtent = GLumenTranslucencyVolumeRadianceCacheClipmapWorldExtent;
		Parameters.ClipmapDistributionBase = GLumenTranslucencyVolumeRadianceCacheClipmapDistributionBase;
		Parameters.RadianceProbeClipmapResolution = GetClipmapGridResolution();
		Parameters.ProbeAtlasResolutionInProbes = FIntPoint(GTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes, GTranslucencyVolumeRadianceCacheProbeAtlasResolutionInProbes);
		Parameters.NumRadianceProbeClipmaps = GetNumClipmaps(LumenTranslucencyVolume::GetEndDistanceFromCamera(View));
		Parameters.RadianceProbeResolution = FMath::Max(GetProbeResolution(), LumenRadianceCache::MinRadianceProbeResolution);