r.Lumen.ScreenProbeGather.MaterialAO
r.Lumen.ScreenProbeGather.MaterialAO
#Overview
name: r.Lumen.ScreenProbeGather.MaterialAO
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to apply Material Ambient Occlusion or Material Bent Normal to Lumen GI.
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.ScreenProbeGather.MaterialAO is to control whether Material Ambient Occlusion or Material Bent Normal should be applied to Lumen Global Illumination (GI) in Unreal Engine 5’s rendering system.
This setting variable is primarily used in the Lumen rendering subsystem, specifically in the screen probe gathering and integration process. It’s part of the global illumination and reflection system in Unreal Engine 5.
The value of this variable is set through a console variable (CVar) system, allowing it to be modified at runtime. It’s initialized with a default value of 1, meaning it’s enabled by default.
The associated variable GLumenScreenProbeMaterialAO interacts directly with this setting. It’s used in the C++ code to determine whether to apply Material AO during the screen probe integration process.
Developers should be aware that:
- This setting affects the visual quality and performance of global illumination.
- Enabling this feature (value 1) may provide more accurate lighting but could have a performance impact.
- Disabling it (value 0) might improve performance at the cost of some lighting accuracy.
Best practices when using this variable include:
- Test the visual impact and performance with this setting both on and off in various scenarios.
- Consider exposing this as a user-configurable graphics option for performance scaling.
- Be aware of its interaction with other Lumen settings for optimal balance between quality and performance.
Regarding the associated variable GLumenScreenProbeMaterialAO:
- It directly reflects the value of the r.Lumen.ScreenProbeGather.MaterialAO console variable.
- It’s used in the screen probe integration compute shader to determine whether to apply Material AO.
- Developers should treat it as read-only in most cases, as its value is set by the CVar system.
- When debugging or profiling Lumen performance, checking this variable’s value can help understand the current Material AO application state.
#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:139
Scope: file
Source code excerpt:
int32 GLumenScreenProbeMaterialAO = 1;
FAutoConsoleVariableRef CVarLumenScreenProbeMaterialAO(
TEXT("r.Lumen.ScreenProbeGather.MaterialAO"),
GLumenScreenProbeMaterialAO,
TEXT("Whether to apply Material Ambient Occlusion or Material Bent Normal to Lumen GI."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenScreenProbeTemporalFilter = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenScreenProbeMaterialAO
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:137
Scope: file
Source code excerpt:
);
int32 GLumenScreenProbeMaterialAO = 1;
FAutoConsoleVariableRef CVarLumenScreenProbeMaterialAO(
TEXT("r.Lumen.ScreenProbeGather.MaterialAO"),
GLumenScreenProbeMaterialAO,
TEXT("Whether to apply Material Ambient Occlusion or Material Bent Normal to Lumen GI."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenScreenProbeTemporalFilter = 1;
FAutoConsoleVariableRef CVarLumenScreenProbeTemporalFilter(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:1261
Scope (from outer to inner):
file
function void InterpolateAndIntegrate
lambda-function
Source code excerpt:
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;
PassParameters->ViewportTileDimensionsWithOverflow = TileClassificationBufferDimensions;
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScreenProbeGather.cpp:1330
Scope (from outer to inner):
file
function void InterpolateAndIntegrate
lambda-function
Source code excerpt:
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);
PassParameters->Substrate = Substrate::BindSubstrateGlobalUniformParameters(View);