r.Lumen.ScreenProbeGather.MaxRoughnessToEvaluateRoughSpecular
r.Lumen.ScreenProbeGather.MaxRoughnessToEvaluateRoughSpecular
#Overview
name: r.Lumen.ScreenProbeGather.MaxRoughnessToEvaluateRoughSpecular
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Maximum roughness value to evaluate rough specular in Screen Probe Gather. Lower values reduce GPU cost of integration, but also lose rough specular.
It is referenced in 5
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.MaxRoughnessToEvaluateRoughSpecular is to control the maximum roughness value for evaluating rough specular reflections in Lumen’s Screen Probe Gather system. This setting is part of Unreal Engine 5’s Lumen global illumination and reflection system, specifically for the rendering subsystem.
The Lumen Screen Probe Gather module in the Renderer subsystem relies on this setting variable. It’s used in the LumenScreenProbeGather.cpp file, which is part of the core rendering functionality for Lumen.
The value of this variable is set through the console variable system (CVars) in Unreal Engine. It’s initialized with a default value of 0.8f and can be adjusted at runtime.
This variable interacts directly with GLumenScreenProbeMaxRoughnessToEvaluateRoughSpecular, which is the C++ variable that stores the actual value. They share the same value, with the console variable providing an interface for adjusting it.
Developers must be aware that this variable affects both the visual quality and performance of the rendering system. Lower values will reduce GPU cost but may result in a loss of rough specular reflections.
Best practices when using this variable include:
- Adjusting it based on the specific needs of your scene and target hardware.
- Testing different values to find the optimal balance between performance and visual quality.
- Considering it as part of a broader optimization strategy for Lumen settings.
Regarding the associated variable GLumenScreenProbeMaxRoughnessToEvaluateRoughSpecular:
This is the actual C++ variable that stores the maximum roughness value. It’s used directly in the rendering code to determine how rough specular reflections are evaluated. The variable is passed to shader parameters in multiple places within the InterpolateAndIntegrate function, indicating its importance in the screen probe gather process.
Developers should be aware that modifying this variable directly in code will have the same effect as changing the console variable, but without the flexibility of runtime adjustment. It’s generally better to use the console variable for adjustments unless there’s a specific need to hard-code a 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:306
Scope: file
Source code excerpt:
float GLumenScreenProbeMaxRoughnessToEvaluateRoughSpecular = .8f;
FAutoConsoleVariableRef GVarLumenScreenProbeMaxRoughnessToEvaluateRoughSpecular(
TEXT("r.Lumen.ScreenProbeGather.MaxRoughnessToEvaluateRoughSpecular"),
GLumenScreenProbeMaxRoughnessToEvaluateRoughSpecular,
TEXT("Maximum roughness value to evaluate rough specular in Screen Probe Gather. Lower values reduce GPU cost of integration, but also lose rough specular."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenScreenProbeRoughSpecularSamplingMode = 0;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenScreenProbeMaxRoughnessToEvaluateRoughSpecular
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:304
Scope: file
Source code excerpt:
);
float GLumenScreenProbeMaxRoughnessToEvaluateRoughSpecular = .8f;
FAutoConsoleVariableRef GVarLumenScreenProbeMaxRoughnessToEvaluateRoughSpecular(
TEXT("r.Lumen.ScreenProbeGather.MaxRoughnessToEvaluateRoughSpecular"),
GLumenScreenProbeMaxRoughnessToEvaluateRoughSpecular,
TEXT("Maximum roughness value to evaluate rough specular in Screen Probe Gather. Lower values reduce GPU cost of integration, but also lose rough specular."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenScreenProbeRoughSpecularSamplingMode = 0;
FAutoConsoleVariableRef GVarLumenScreenProbeRoughSpecularSamplingMode(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:1151
Scope (from outer to inner):
file
function void InterpolateAndIntegrate
lambda-function
Source code excerpt:
PassParameters->DefaultDiffuseIntegrationMethod = (uint32)LumenScreenProbeGather::GetDiffuseIntegralMethod();
PassParameters->ReflectionsCompositeParameters = ReflectionsCompositeParameters;
PassParameters->MaxRoughnessToEvaluateRoughSpecular = GLumenScreenProbeMaxRoughnessToEvaluateRoughSpecular;
FScreenProbeTileClassificationMarkCS::FPermutationDomain PermutationVector;
PermutationVector.Set<FScreenProbeTileClassificationMarkCS::FOverflowTile>(bOverflow);
PermutationVector.Set<FScreenProbeTileClassificationMarkCS::FSupportBackfaceDiffuse>(bSupportBackfaceDiffuse);
auto ComputeShader = View.ShaderMap->GetShader<FScreenProbeTileClassificationMarkCS>(PermutationVector);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:1260
Scope (from outer to inner):
file
function void InterpolateAndIntegrate
lambda-function
Source code excerpt:
PassParameters->FullResolutionJitterWidth = LumenScreenProbeGather::GetScreenProbeFullResolutionJitterWidth(View);
PassParameters->ReflectionsCompositeParameters = ReflectionsCompositeParameters;
PassParameters->MaxRoughnessToEvaluateRoughSpecular = GLumenScreenProbeMaxRoughnessToEvaluateRoughSpecular;
PassParameters->ApplyMaterialAO = GLumenScreenProbeMaterialAO;
PassParameters->MaxAOMultibounceAlbedo = GLumenMaxShortRangeAOMultibounceAlbedo;
PassParameters->LumenReflectionInputIsSSR = bSSREnabled ? 1 : 0;
PassParameters->ScreenSpaceBentNormalParameters = ScreenSpaceBentNormalParameters;
PassParameters->DefaultDiffuseIntegrationMethod = (uint32)LumenScreenProbeGather::GetDiffuseIntegralMethod();
PassParameters->ViewportTileDimensions = ViewportIntegrateTileDimensions;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:1329
Scope (from outer to inner):
file
function void InterpolateAndIntegrate
lambda-function
Source code excerpt:
PassParameters->FullResolutionJitterWidth = LumenScreenProbeGather::GetScreenProbeFullResolutionJitterWidth(View);
PassParameters->ReflectionsCompositeParameters = ReflectionsCompositeParameters;
PassParameters->MaxRoughnessToEvaluateRoughSpecular = GLumenScreenProbeMaxRoughnessToEvaluateRoughSpecular;
PassParameters->ApplyMaterialAO = GLumenScreenProbeMaterialAO;
PassParameters->MaxAOMultibounceAlbedo = GLumenMaxShortRangeAOMultibounceAlbedo;
PassParameters->ScreenSpaceBentNormalParameters = ScreenSpaceBentNormalParameters;
PassParameters->DefaultDiffuseIntegrationMethod = (uint32)LumenScreenProbeGather::GetDiffuseIntegralMethod();
PassParameters->ViewportTileDimensions = FIntPoint(0, 0);
PassParameters->ViewportTileDimensionsWithOverflow = FIntPoint(0, 0);