r.Lumen.ScreenProbeGather.MaxRayIntensity
r.Lumen.ScreenProbeGather.MaxRayIntensity
#Overview
name: r.Lumen.ScreenProbeGather.MaxRayIntensity
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Clamps the maximum ray lighting intensity (with PreExposure) to reduce fireflies.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.MaxRayIntensity is to control the maximum ray lighting intensity in Lumen’s screen probe gathering process. It is used to clamp the intensity values to reduce fireflies (small, overly bright spots) in the rendered image.
This setting variable is primarily used in the Lumen subsystem of Unreal Engine’s rendering module. Specifically, it’s utilized in the screen probe filtering and gathering process, which is part of Lumen’s global illumination system.
The value of this variable is set through the Unreal Engine console variable system. It’s initialized with a default value of 40 and can be modified at runtime using console commands or through game settings.
The associated variable GLumenScreenProbeGatherMaxRayIntensity directly interacts with r.Lumen.ScreenProbeGather.MaxRayIntensity. They share the same value, with GLumenScreenProbeGatherMaxRayIntensity being the C++ variable that stores the actual value used in the rendering code.
Developers should be aware that this variable affects the visual quality and performance of Lumen’s global illumination. Setting it too low might result in dimmer lighting or loss of bright details, while setting it too high might introduce fireflies or other visual artifacts.
Best practices when using this variable include:
- Adjusting it carefully to find a balance between reducing fireflies and maintaining lighting intensity.
- Testing the variable’s effects across different lighting scenarios in the game.
- Considering performance implications, as very high values might impact rendering speed.
Regarding the associated variable GLumenScreenProbeGatherMaxRayIntensity:
- Its purpose is to store the actual value used in the rendering code.
- It’s used directly in the Lumen screen probe filtering process.
- Its value is set by the console variable system and can be modified at runtime.
- It interacts directly with r.Lumen.ScreenProbeGather.MaxRayIntensity, mirroring its value.
- Developers should be aware that modifying this variable directly in code is not recommended; instead, they should use the console variable system.
- Best practices include using this variable for read-only purposes in the rendering code and relying on the console variable system for modifications.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeFiltering.cpp:56
Scope: file
Source code excerpt:
float GLumenScreenProbeGatherMaxRayIntensity = 40;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherMaxRayIntensity(
TEXT("r.Lumen.ScreenProbeGather.MaxRayIntensity"),
GLumenScreenProbeGatherMaxRayIntensity,
TEXT("Clamps the maximum ray lighting intensity (with PreExposure) to reduce fireflies."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenScreenProbeTemporalFilterProbesHistoryDistanceThreshold = 30;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenScreenProbeGatherMaxRayIntensity
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeFiltering.cpp:54
Scope: file
Source code excerpt:
);
float GLumenScreenProbeGatherMaxRayIntensity = 40;
FAutoConsoleVariableRef GVarLumenScreenProbeGatherMaxRayIntensity(
TEXT("r.Lumen.ScreenProbeGather.MaxRayIntensity"),
GLumenScreenProbeGatherMaxRayIntensity,
TEXT("Clamps the maximum ray lighting intensity (with PreExposure) to reduce fireflies."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenScreenProbeTemporalFilterProbesHistoryDistanceThreshold = 30;
FAutoConsoleVariableRef CVarLumenScreenProbeTemporalFilterProbesHistoryDistanceThreshold(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeFiltering.cpp:442
Scope (from outer to inner):
file
function void FilterScreenProbes
Source code excerpt:
PassParameters->View = View.ViewUniformBuffer;
// This is used to quantize to uint during compositing, prevent poor precision
PassParameters->MaxRayIntensity = FMath::Min(GLumenScreenProbeGatherMaxRayIntensity, 100000.0f);
FScreenProbeCompositeTracesWithScatterCS::FPermutationDomain PermutationVector;
PermutationVector.Set< FScreenProbeCompositeTracesWithScatterCS::FThreadGroupSize >(CompositeScatterThreadGroupSize);
PermutationVector.Set< FScreenProbeCompositeTracesWithScatterCS::FStructuredImportanceSampling >(LumenScreenProbeGather::UseImportanceSampling(View));
auto ComputeShader = View.ShaderMap->GetShader<FScreenProbeCompositeTracesWithScatterCS>(PermutationVector);