r.Lumen.ScreenProbeGather.RadianceCache
r.Lumen.ScreenProbeGather.RadianceCache
#Overview
name: r.Lumen.ScreenProbeGather.RadianceCache
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to enable the Persistent world space Radiance Cache
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.RadianceCache is to control the usage of the Persistent world space Radiance Cache in Unreal Engine’s Lumen lighting system. This setting variable is specifically related to the screen probe gathering process within the Lumen global illumination system.
This setting variable is primarily used by the Lumen subsystem, which is part of Unreal Engine’s rendering module. It’s specifically utilized in the screen probe gathering process, which is a crucial component of Lumen’s real-time global illumination system.
The value of this variable is set through the FAutoConsoleVariableRef system, which allows it to be modified at runtime via console commands. It’s initialized with a default value of 1, meaning the Radiance Cache is enabled by default.
The associated variable GLumenRadianceCache directly interacts with this setting. It’s an integer variable that shares the same value as the console variable and is used in the C++ code to check if the Radiance Cache should be used.
Developers should be aware that this variable can significantly impact the performance and visual quality of the Lumen lighting system. Enabling the Radiance Cache (value set to non-zero) can improve performance by caching and reusing radiance information, but it may introduce some approximations in the lighting calculations.
Best practices when using this variable include:
- Test the visual impact of enabling/disabling the Radiance Cache in various lighting scenarios.
- Consider the performance implications, especially on lower-end hardware.
- Use it in conjunction with other Lumen settings to achieve the best balance of performance and visual quality.
Regarding the associated variable GLumenRadianceCache:
The purpose of GLumenRadianceCache is to provide a quick, in-code way to check if the Radiance Cache is enabled. It’s an integer variable that directly reflects the value of the r.Lumen.ScreenProbeGather.RadianceCache console variable.
This variable is used within the Lumen subsystem of the rendering module, specifically in the screen probe gathering process.
Its value is set by the FAutoConsoleVariableRef system, which keeps it synchronized with the console variable.
The UseRadianceCache function directly uses this variable to determine if the Radiance Cache should be used for a given view. It’s worth noting that this function also considers another variable (GLumenScreenProbeGatherReferenceMode) which can override the use of the Radiance Cache.
Developers should be aware that changes to the console variable will be reflected in this variable, and vice versa. It’s used as a performance optimization to avoid constantly querying the console variable system.
Best practices include using this variable for quick checks in performance-critical code paths where the overhead of accessing the console variable system might be noticeable.
#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:280
Scope: file
Source code excerpt:
int32 GLumenRadianceCache = 1;
FAutoConsoleVariableRef CVarRadianceCache(
TEXT("r.Lumen.ScreenProbeGather.RadianceCache"),
GLumenRadianceCache,
TEXT("Whether to enable the Persistent world space Radiance Cache"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenScreenProbeIrradianceFormat = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenRadianceCache
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:278
Scope: file
Source code excerpt:
);
int32 GLumenRadianceCache = 1;
FAutoConsoleVariableRef CVarRadianceCache(
TEXT("r.Lumen.ScreenProbeGather.RadianceCache"),
GLumenRadianceCache,
TEXT("Whether to enable the Persistent world space Radiance Cache"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenScreenProbeIrradianceFormat = 1;
FAutoConsoleVariableRef CVarLumenScreenProbeIrradianceFormat(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:389
Scope (from outer to inner):
file
namespace LumenScreenProbeGather
function bool UseRadianceCache
Source code excerpt:
bool UseRadianceCache(const FViewInfo& View)
{
return GLumenScreenProbeGatherReferenceMode ? false : GLumenRadianceCache != 0;
}
int32 GetDiffuseIntegralMethod()
{
return GLumenScreenProbeGatherReferenceMode ? 2 : GLumenScreenProbeDiffuseIntegralMethod;
}