r.LumenScene.Lighting.AsyncCompute
r.LumenScene.Lighting.AsyncCompute
#Overview
name: r.LumenScene.Lighting.AsyncCompute
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Whether to run LumenSceneLighting 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.LumenScene.Lighting.AsyncCompute is to control whether the Lumen Scene Lighting computation runs on the async compute pipeline in Unreal Engine 5. This setting is part of the Lumen global illumination system, specifically for the scene lighting calculations.
This setting variable is primarily used by the Lumen rendering subsystem within Unreal Engine 5’s renderer module. It affects the performance and execution of the Lumen Scene Lighting computations.
The value of this variable is set through the console variable system in Unreal Engine. It’s defined as a TAutoConsoleVariable with a default value of 1 (enabled).
The associated variable CVarLumenSceneLightingAsyncCompute directly interacts with r.LumenScene.Lighting.AsyncCompute. They share the same value and purpose.
Developers should be aware that:
- This variable affects rendering performance and should be tuned carefully.
- It’s marked with ECVF_Scalability, indicating it’s part of the scalability settings.
- It’s also marked as ECVF_RenderThreadSafe, meaning it can be safely changed from any thread.
Best practices when using this variable include:
- Testing performance with and without async compute enabled to determine the optimal setting for your specific scene and hardware.
- Considering the target hardware capabilities, as async compute may not be beneficial on all systems.
- Using it in conjunction with other Lumen settings for optimal performance and quality balance.
Regarding the associated variable CVarLumenSceneLightingAsyncCompute:
- Its purpose is identical to r.LumenScene.Lighting.AsyncCompute.
- It’s used internally by the engine to check the current state of the async compute setting.
- The UseAsyncCompute function in the LumenSceneLighting namespace uses this variable to determine if async compute should be used.
- Developers don’t typically need to interact with this variable directly, as it’s an internal representation of the console variable.
When working with Lumen Scene Lighting, developers should use the r.LumenScene.Lighting.AsyncCompute console variable to control the behavior, rather than directly manipulating CVarLumenSceneLightingAsyncCompute.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneLighting.cpp:53
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarLumenSceneLightingAsyncCompute(
TEXT("r.LumenScene.Lighting.AsyncCompute"),
1,
TEXT("Whether to run LumenSceneLighting on the compute pipe if possible."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
namespace LumenSceneLighting
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenSceneLightingAsyncCompute
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneLighting.cpp:52
Scope: file
Source code excerpt:
);
static TAutoConsoleVariable<int32> CVarLumenSceneLightingAsyncCompute(
TEXT("r.LumenScene.Lighting.AsyncCompute"),
1,
TEXT("Whether to run LumenSceneLighting on the compute pipe if possible."),
ECVF_Scalability | ECVF_RenderThreadSafe
);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenSceneLighting.cpp:194
Scope (from outer to inner):
file
function bool LumenSceneLighting::UseAsyncCompute
Source code excerpt:
bool LumenSceneLighting::UseAsyncCompute(const FViewFamilyInfo& ViewFamily)
{
return Lumen::UseAsyncCompute(ViewFamily) && CVarLumenSceneLightingAsyncCompute.GetValueOnRenderThread() != 0;
}
DECLARE_GPU_STAT(LumenSceneLighting);
void FDeferredShadingSceneRenderer::RenderLumenSceneLighting(
FRDGBuilder& GraphBuilder,