r.Lumen.Reflections.AsyncCompute

r.Lumen.Reflections.AsyncCompute

#Overview

name: r.Lumen.Reflections.AsyncCompute

This variable is created as a Console Variable (cvar).

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:

  1. Testing the impact on both performance and visual quality when enabling or disabling it.
  2. Considering hardware capabilities of target platforms, as not all systems benefit from async compute.
  3. Using it in conjunction with other Lumen settings for optimal results.

Regarding the associated variable CVarLumenReflectionsAsyncCompute:

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);