r.Lumen.Reflections.AsyncCompute
r.Lumen.Reflections.AsyncCompute
#Overview
name: r.Lumen.Reflections.AsyncCompute
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to run Lumen reflection passes on the compute pipe if possible.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Reflections.AsyncCompute is to control whether Lumen reflection passes are executed on the compute pipeline when possible. This setting variable is part of Unreal Engine 5’s Lumen global illumination system, specifically for the reflection component.
This setting variable is primarily used in the Lumen Reflections subsystem, which is part of the Renderer module in Unreal Engine 5. Based on the callsites, it’s clear that this variable is used within the LumenReflections namespace.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 0, meaning async compute for Lumen reflections is disabled by default.
The associated variable CVarLumenReflectionsAsyncCompute interacts directly with r.Lumen.Reflections.AsyncCompute. They share the same value and purpose.
Developers must be aware that this variable affects the performance and potentially the visual quality of Lumen reflections. Enabling async compute (by setting the value to non-zero) may improve performance on hardware that supports it, but it could also introduce frame pacing issues or visual artifacts on some systems.
Best practices when using this variable include:
- Testing the impact on both performance and visual quality when enabling or disabling it.
- Considering hardware capabilities of target platforms, as not all systems benefit from async compute.
- Using it in conjunction with other Lumen settings for optimal results.
Regarding the associated variable CVarLumenReflectionsAsyncCompute:
- It’s the actual console variable that controls the r.Lumen.Reflections.AsyncCompute setting.
- It’s defined as an integer, where 0 means disabled and any non-zero value means enabled.
- It has the ECVF_Scalability and ECVF_RenderThreadSafe flags, indicating it’s safe to change at runtime and can be used for performance scaling.
- It’s used in the LumenReflections::UseAsyncCompute function to determine whether async compute should be used, in combination with a global Lumen async compute check.
Developers should treat CVarLumenReflectionsAsyncCompute as the implementation detail of r.Lumen.Reflections.AsyncCompute, and generally interact with the latter in console commands or configuration files.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:253
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarLumenReflectionsAsyncCompute(
TEXT("r.Lumen.Reflections.AsyncCompute"),
0,
TEXT("Whether to run Lumen reflection passes on the compute pipe if possible."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
static TAutoConsoleVariable<int32> CVarLumenReflectionsSurfaceCacheFeedback(
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenReflectionsAsyncCompute
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:252
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarLumenReflectionsAsyncCompute(
TEXT("r.Lumen.Reflections.AsyncCompute"),
0,
TEXT("Whether to run Lumen reflection passes on the compute pipe if possible."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:311
Scope (from outer to inner):
file
function bool LumenReflections::UseAsyncCompute
Source code excerpt:
bool LumenReflections::UseAsyncCompute(const FViewFamilyInfo& ViewFamily)
{
return Lumen::UseAsyncCompute(ViewFamily) && CVarLumenReflectionsAsyncCompute.GetValueOnRenderThread() != 0;
}
void LumenReflections::SetupCompositeParameters(const FViewInfo& View, LumenReflections::FCompositeParameters& OutParameters)
{
OutParameters.MaxRoughnessToTrace = FMath::Min(View.FinalPostProcessSettings.LumenMaxRoughnessToTraceReflections, CVarLumenReflectionMaxRoughnessToTraceClamp.GetValueOnRenderThread());
OutParameters.InvRoughnessFadeLength = 1.0f / FMath::Clamp(GLumenReflectionRoughnessFadeLength, 0.001f, 1.0f);