r.Lumen.ScreenProbeGather.RadianceCache.ReprojectionRadiusScale

r.Lumen.ScreenProbeGather.RadianceCache.ReprojectionRadiusScale

#Overview

name: r.Lumen.ScreenProbeGather.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.ScreenProbeGather.RadianceCache.ReprojectionRadiusScale is to control the reprojection radius scale for the radiance cache in Lumen’s screen probe gather system. This setting is part of Unreal Engine 5’s Lumen global illumination system, specifically the screen probe gathering and radiance caching components.

This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. It’s referenced in the LumenScreenProbeGather.cpp file, which is part of the runtime renderer.

The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 1.5f and can be modified at runtime using the console command system.

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

Developers should be aware that this variable affects the performance and quality of Lumen’s global illumination system. Increasing the value will expand the reprojection radius, potentially improving temporal stability but at the cost of performance and possibly introducing more artifacts.

Best practices when using this variable include:

  1. Only modify it if you understand the implications on performance and visual quality.
  2. Test thoroughly after making changes, as it can affect the entire scene’s lighting.
  3. Consider using it in conjunction with other Lumen settings for optimal results.

Regarding the associated variable GRadianceCacheReprojectionRadiusScale:

The purpose of GRadianceCacheReprojectionRadiusScale is to store and provide access to the reprojection radius scale value within the C++ code of the Lumen system.

This variable is used directly in the LumenScreenProbeGather.cpp file, specifically in the SetupRadianceCacheInputs function of the LumenScreenProbeGatherRadianceCache namespace.

The value of GRadianceCacheReprojectionRadiusScale is set by the console variable system and can be modified at runtime.

It interacts directly with the console variable r.Lumen.ScreenProbeGather.RadianceCache.ReprojectionRadiusScale, serving as the actual storage for the value set by that console variable.

Developers should be aware that modifying GRadianceCacheReprojectionRadiusScale directly in code would be overridden by any console commands changing the associated console variable.

Best practices for using GRadianceCacheReprojectionRadiusScale include:

  1. Treat it as read-only in most cases, relying on the console variable system for modifications.
  2. When using it in calculations, consider caching its value locally if used frequently in performance-critical code.
  3. Be aware of its impact on the radiance cache system when using it in custom rendering code.

#References in C++ code

#Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:487

Scope: file

Source code excerpt:

float GRadianceCacheReprojectionRadiusScale = 1.5f;
FAutoConsoleVariableRef CVarRadianceCacheProbeReprojectionRadiusScale(
	TEXT("r.Lumen.ScreenProbeGather.RadianceCache.ReprojectionRadiusScale"),
	GRadianceCacheReprojectionRadiusScale,
	TEXT(""),
	ECVF_RenderThreadSafe
);

int32 GRadianceCacheStats = 0;

#Associated Variable and Callsites

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

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:485

Scope: file

Source code excerpt:

);

float GRadianceCacheReprojectionRadiusScale = 1.5f;
FAutoConsoleVariableRef CVarRadianceCacheProbeReprojectionRadiusScale(
	TEXT("r.Lumen.ScreenProbeGather.RadianceCache.ReprojectionRadiusScale"),
	GRadianceCacheReprojectionRadiusScale,
	TEXT(""),
	ECVF_RenderThreadSafe
);

int32 GRadianceCacheStats = 0;
FAutoConsoleVariableRef CVarRadianceCacheStats(

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:547

Scope (from outer to inner):

file
namespace    LumenScreenProbeGatherRadianceCache
function     LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs

Source code excerpt:

	{
		LumenRadianceCache::FRadianceCacheInputs Parameters = LumenRadianceCache::GetDefaultRadianceCacheInputs();
		Parameters.ReprojectionRadiusScale = GRadianceCacheReprojectionRadiusScale;
		Parameters.ClipmapWorldExtent = GLumenRadianceCacheClipmapWorldExtent;
		Parameters.ClipmapDistributionBase = GLumenRadianceCacheClipmapDistributionBase;
		Parameters.RadianceProbeClipmapResolution = GetClipmapGridResolution();
		Parameters.ProbeAtlasResolutionInProbes = FIntPoint(GRadianceCacheProbeAtlasResolutionInProbes, GRadianceCacheProbeAtlasResolutionInProbes);
		Parameters.NumRadianceProbeClipmaps = GetNumClipmaps();
		Parameters.RadianceProbeResolution = FMath::Max(GetProbeResolution(), LumenRadianceCache::MinRadianceProbeResolution);