r.Lumen.ScreenProbeGather.RadianceCache.ProbeResolution
r.Lumen.ScreenProbeGather.RadianceCache.ProbeResolution
#Overview
name: r.Lumen.ScreenProbeGather.RadianceCache.ProbeResolution
The value of this variable can be defined or overridden in .ini config files. 3
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Resolution of the probe\'s 2d radiance layout. The number of rays traced for the probe will be ProbeResolution ^ 2
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.RadianceCache.ProbeResolution is to control the resolution of the 2D radiance layout for probes in Lumen’s Screen Probe Gather system. This setting variable is part of Unreal Engine 5’s Lumen global illumination system, specifically for the Screen Probe Gather component of Lumen.
This setting variable is primarily used in the Lumen rendering subsystem, which is part of Unreal Engine’s rendering module. Based on the callsites, it’s clear that this variable is utilized in the LumenScreenProbeGather.cpp file, which is responsible for handling screen probe gathering in Lumen.
The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 32 and can be modified at runtime using console commands or through project settings.
The associated variable GRadianceCacheProbeResolution interacts directly with this setting. They share the same value, and GRadianceCacheProbeResolution is used in the actual code implementation to determine the probe resolution.
Developers should be aware that this variable directly affects the number of rays traced for each probe. The number of rays is calculated as the square of the probe resolution (ProbeResolution ^ 2). This means that increasing the resolution will significantly increase the number of rays traced, which can impact performance.
Best practices when using this variable include:
- Balancing quality and performance: Higher resolutions provide more accurate lighting but at the cost of performance.
- Considering the target hardware: Lower-end devices may require lower resolutions to maintain acceptable performance.
- Testing different values to find the optimal balance for your specific scene and target platforms.
- Being aware of how this interacts with other Lumen settings, particularly those related to screen probe gathering.
Regarding the associated variable GRadianceCacheProbeResolution:
The purpose of GRadianceCacheProbeResolution is to store and provide access to the probe resolution value within the C++ code of the Lumen system.
This variable is used directly in the Lumen Screen Probe Gather system, specifically in functions that need to know the current probe resolution.
The value of GRadianceCacheProbeResolution is set by the r.Lumen.ScreenProbeGather.RadianceCache.ProbeResolution console variable.
It interacts with GLumenFastCameraMode in the GetProbeResolution() function, where the resolution is halved if fast camera mode is enabled.
Developers should be aware that modifying GRadianceCacheProbeResolution directly in code is not recommended, as it may be overwritten by the console variable system.
Best practices include using the provided functions like GetProbeResolution() to access the current probe resolution, which takes into account other factors like the fast camera mode.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:277, section: [GlobalIlluminationQuality@2]
- INI Section:
GlobalIlluminationQuality@2
- Raw value:
16
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:300, section: [GlobalIlluminationQuality@3]
- INI Section:
GlobalIlluminationQuality@3
- Raw value:
32
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:324, section: [GlobalIlluminationQuality@Cine]
- INI Section:
GlobalIlluminationQuality@Cine
- Raw value:
32
- Is Array:
False
#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:463
Scope: file
Source code excerpt:
int32 GRadianceCacheProbeResolution = 32;
FAutoConsoleVariableRef CVarRadianceCacheProbeResolution(
TEXT("r.Lumen.ScreenProbeGather.RadianceCache.ProbeResolution"),
GRadianceCacheProbeResolution,
TEXT("Resolution of the probe's 2d radiance layout. The number of rays traced for the probe will be ProbeResolution ^ 2"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GRadianceCacheNumMipmaps = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GRadianceCacheProbeResolution
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:461
Scope: file
Source code excerpt:
);
int32 GRadianceCacheProbeResolution = 32;
FAutoConsoleVariableRef CVarRadianceCacheProbeResolution(
TEXT("r.Lumen.ScreenProbeGather.RadianceCache.ProbeResolution"),
GRadianceCacheProbeResolution,
TEXT("Resolution of the probe's 2d radiance layout. The number of rays traced for the probe will be ProbeResolution ^ 2"),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GRadianceCacheNumMipmaps = 1;
FAutoConsoleVariableRef CVarRadianceCacheNumMipmaps(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:516
Scope (from outer to inner):
file
namespace LumenScreenProbeGatherRadianceCache
function int32 GetProbeResolution
Source code excerpt:
int32 GetProbeResolution()
{
return GRadianceCacheProbeResolution / (GLumenFastCameraMode ? 2 : 1);
}
int32 GetFinalProbeResolution()
{
return GetProbeResolution() + 2 * (1 << (GRadianceCacheNumMipmaps - 1));
}