r.Lumen.ScreenProbeGather.RadianceCache.NumProbesToTraceBudget
r.Lumen.ScreenProbeGather.RadianceCache.NumProbesToTraceBudget
#Overview
name: r.Lumen.ScreenProbeGather.RadianceCache.NumProbesToTraceBudget
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: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.RadianceCache.NumProbesToTraceBudget is to control the number of probes to trace in the radiance cache for Lumen’s screen probe gathering system. This setting is part of the rendering system, specifically the Lumen global illumination solution in Unreal Engine 5.
This setting variable is primarily used in the Lumen module of the Unreal Engine renderer. It’s referenced in the LumenScreenProbeGather.cpp file, which is part of the Lumen screen probe gathering system.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which means it can be adjusted at runtime through console commands or configuration files.
The associated variable GRadianceCacheNumProbesToTraceBudget directly interacts with this setting. They share the same value, with GRadianceCacheNumProbesToTraceBudget being the actual variable used in the code logic.
Developers should be aware that this variable affects the performance and quality trade-off in Lumen’s global illumination system. A higher value will result in more accurate lighting but at the cost of increased performance overhead.
Best practices when using this variable include:
- Adjusting it based on the target hardware capabilities.
- Balancing it with other Lumen settings for optimal performance and visual quality.
- Testing different values to find the sweet spot for your specific scene and performance requirements.
Regarding the associated variable GRadianceCacheNumProbesToTraceBudget:
The purpose of GRadianceCacheNumProbesToTraceBudget is to store and provide access to the number of probes to trace in the radiance cache within the C++ code.
This variable is used directly in the Lumen screen probe gathering system, specifically in the SetupRadianceCacheInputs function.
The value of this variable is set by the console variable system, mirroring the value of r.Lumen.ScreenProbeGather.RadianceCache.NumProbesToTraceBudget.
It interacts with other variables and factors in the code, such as LightingUpdateSpeed and a scaling factor for scenes being edited.
Developers should be aware that this variable’s value can be dynamically adjusted based on the current rendering context, such as whether the scene is being edited.
Best practices include:
- Considering this variable when optimizing Lumen performance.
- Understanding its relationship with other Lumen settings and how they collectively impact rendering quality and performance.
- Monitoring its actual usage in different scenarios to ensure it’s providing the desired balance between quality and performance.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:278, section: [GlobalIlluminationQuality@2]
- INI Section:
GlobalIlluminationQuality@2
- Raw value:
300
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:301, section: [GlobalIlluminationQuality@3]
- INI Section:
GlobalIlluminationQuality@3
- Raw value:
300
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:325, section: [GlobalIlluminationQuality@Cine]
- INI Section:
GlobalIlluminationQuality@Cine
- Raw value:
1000
- 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:447
Scope: file
Source code excerpt:
int32 GRadianceCacheNumProbesToTraceBudget = 300;
FAutoConsoleVariableRef CVarRadianceCacheNumProbesToTraceBudget(
TEXT("r.Lumen.ScreenProbeGather.RadianceCache.NumProbesToTraceBudget"),
GRadianceCacheNumProbesToTraceBudget,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GRadianceCacheGridResolution = 48;
#Associated Variable and Callsites
This variable is associated with another variable named GRadianceCacheNumProbesToTraceBudget
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:445
Scope: file
Source code excerpt:
);
int32 GRadianceCacheNumProbesToTraceBudget = 300;
FAutoConsoleVariableRef CVarRadianceCacheNumProbesToTraceBudget(
TEXT("r.Lumen.ScreenProbeGather.RadianceCache.NumProbesToTraceBudget"),
GRadianceCacheNumProbesToTraceBudget,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GRadianceCacheGridResolution = 48;
FAutoConsoleVariableRef CVarRadianceCacheResolution(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:558
Scope (from outer to inner):
file
namespace LumenScreenProbeGatherRadianceCache
function LumenRadianceCache::FRadianceCacheInputs SetupRadianceCacheInputs
Source code excerpt:
const float LightingUpdateSpeed = FMath::Clamp(View.FinalPostProcessSettings.LumenFinalGatherLightingUpdateSpeed, .5f, 4.0f);
const float EditingBudgetScale = View.Family->bCurrentlyBeingEdited ? 10.0f : 1.0f;
Parameters.NumProbesToTraceBudget = FMath::RoundToInt(GRadianceCacheNumProbesToTraceBudget * LightingUpdateSpeed * EditingBudgetScale);
Parameters.RadianceCacheStats = GRadianceCacheStats;
return Parameters;
}
};
class FScreenProbeDownsampleDepthUniformCS : public FGlobalShader