r.Lumen.ScreenProbeGather.RadianceCache.GridResolution
r.Lumen.ScreenProbeGather.RadianceCache.GridResolution
#Overview
name: r.Lumen.ScreenProbeGather.RadianceCache.GridResolution
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Resolution of the probe placement grid within each clipmap
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.RadianceCache.GridResolution is to control the resolution of the probe placement grid within each clipmap in Lumen’s Screen Probe Gather system, which is part of Unreal Engine 5’s global illumination solution.
This setting variable is primarily used in the Lumen rendering subsystem, specifically in the Screen Probe Gather component of Lumen. It’s part of the Renderer module of Unreal Engine 5.
The value of this variable is set through the console variable system, as evidenced by the FAutoConsoleVariableRef declaration. It can be modified at runtime using console commands or through project settings.
This variable interacts directly with GRadianceCacheGridResolution, which is the C++ variable that stores the actual value. They share the same value, with GRadianceCacheGridResolution being the in-memory representation of the console variable.
Developers should be aware that this variable affects the density of probes used in the radiance cache. A higher value will result in a denser grid of probes, potentially improving lighting quality at the cost of performance. Conversely, a lower value will improve performance but may reduce lighting accuracy.
Best practices when using this variable include:
- Balancing between quality and performance based on the project’s needs.
- Testing different values to find the optimal setting for your specific scene.
- Considering adjusting this value dynamically based on performance metrics or scene complexity.
Regarding the associated variable GRadianceCacheGridResolution:
The purpose of GRadianceCacheGridResolution is to store the actual value of the grid resolution for the radiance cache in Lumen’s Screen Probe Gather system.
This variable is used directly in the Lumen rendering code, specifically in the LumenScreenProbeGatherRadianceCache namespace.
The value of GRadianceCacheGridResolution is set by the console variable system and can be modified through the r.Lumen.ScreenProbeGather.RadianceCache.GridResolution console command.
GRadianceCacheGridResolution interacts with the GetClipmapGridResolution() function, which uses this value to determine the final grid resolution, taking into account factors like the fast camera mode.
Developers should be aware that modifying GRadianceCacheGridResolution directly in code is not recommended, as it may be overwritten by the console variable system. Instead, they should use the console variable to change this value.
Best practices for using GRadianceCacheGridResolution include:
- Accessing its value through the GetClipmapGridResolution() function rather than directly, as this function applies additional logic and clamping.
- Being aware of the performance implications of changing this value, as it directly affects the number of probes used in the radiance cache.
- Considering the interaction with other Lumen settings when adjusting this value.
#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:455
Scope: file
Source code excerpt:
int32 GRadianceCacheGridResolution = 48;
FAutoConsoleVariableRef CVarRadianceCacheResolution(
TEXT("r.Lumen.ScreenProbeGather.RadianceCache.GridResolution"),
GRadianceCacheGridResolution,
TEXT("Resolution of the probe placement grid within each clipmap"),
ECVF_RenderThreadSafe
);
int32 GRadianceCacheProbeResolution = 32;
#Associated Variable and Callsites
This variable is associated with another variable named GRadianceCacheGridResolution
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:453
Scope: file
Source code excerpt:
);
int32 GRadianceCacheGridResolution = 48;
FAutoConsoleVariableRef CVarRadianceCacheResolution(
TEXT("r.Lumen.ScreenProbeGather.RadianceCache.GridResolution"),
GRadianceCacheGridResolution,
TEXT("Resolution of the probe placement grid within each clipmap"),
ECVF_RenderThreadSafe
);
int32 GRadianceCacheProbeResolution = 32;
FAutoConsoleVariableRef CVarRadianceCacheProbeResolution(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:510
Scope (from outer to inner):
file
namespace LumenScreenProbeGatherRadianceCache
function int32 GetClipmapGridResolution
Source code excerpt:
int32 GetClipmapGridResolution()
{
const int32 GridResolution = GRadianceCacheGridResolution / (GLumenFastCameraMode ? 2 : 1);
return FMath::Clamp(GridResolution, 1, 256);
}
int32 GetProbeResolution()
{
return GRadianceCacheProbeResolution / (GLumenFastCameraMode ? 2 : 1);