r.Lumen.Reflections.DownsampleFactor
r.Lumen.Reflections.DownsampleFactor
#Overview
name: r.Lumen.Reflections.DownsampleFactor
The value of this variable can be defined or overridden in .ini config files. 6
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Reflections.DownsampleFactor is to control the downsampling factor for Lumen reflections in Unreal Engine 5’s rendering system. This setting variable is part of the Lumen global illumination system, specifically affecting the reflection quality and performance.
The Unreal Engine subsystem that relies on this setting variable is the Renderer module, particularly the Lumen reflections component. This can be seen from the file path where the variable is defined and used: “Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp”.
The value of this variable is set through the Unreal Engine console variable system. It’s defined as an FAutoConsoleVariableRef, which allows it to be modified at runtime through console commands or configuration files.
The associated variable GLumenReflectionDownsampleFactor interacts directly with r.Lumen.Reflections.DownsampleFactor. They share the same value, with GLumenReflectionDownsampleFactor being the actual integer variable used in the C++ code.
Developers must be aware that this variable affects the quality and performance of Lumen reflections. A higher downsampling factor will result in lower quality reflections but better performance, while a lower factor will produce higher quality reflections at the cost of performance.
Best practices when using this variable include:
- Adjusting it based on the target hardware capabilities and desired visual quality.
- Testing different values to find the optimal balance between visual quality and performance for your specific game or application.
- Considering its interaction with other Lumen settings for a holistic approach to reflection quality and performance.
Regarding the associated variable GLumenReflectionDownsampleFactor:
The purpose of GLumenReflectionDownsampleFactor is to store the actual integer value of the downsampling factor used in the C++ code for Lumen reflections.
This variable is used within the Renderer module, specifically in the Lumen reflections component of Unreal Engine 5.
The value of GLumenReflectionDownsampleFactor is set by the console variable system through r.Lumen.Reflections.DownsampleFactor.
It interacts with other variables in the rendering process, such as UserDownsampleFactor and LumenReflectionDownsampleFactor, to determine the effective downsampling factor for reflections.
Developers should be aware that modifying GLumenReflectionDownsampleFactor directly in the code is not recommended, as it’s meant to be controlled through the console variable system.
Best practices for GLumenReflectionDownsampleFactor include:
- Using it as a read-only variable in your code when you need to access the current downsampling factor.
- Relying on the console variable system (r.Lumen.Reflections.DownsampleFactor) to modify its value rather than changing it directly in the code.
- Considering its impact on view size and buffer size calculations in the rendering process.
#Setting Variables
#References In INI files
Location: <Workspace>/Engine/Config/BaseScalability.ini:358, section: [ReflectionQuality@2]
- INI Section:
ReflectionQuality@2
- Raw value:
2
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:368, section: [ReflectionQuality@3]
- INI Section:
ReflectionQuality@3
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Engine/Config/BaseScalability.ini:378, section: [ReflectionQuality@Cine]
- INI Section:
ReflectionQuality@Cine
- Raw value:
1
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultScalability.ini:56, section: [ReflectionQuality@2]
- INI Section:
ReflectionQuality@2
- Raw value:
2
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultScalability.ini:61, section: [ReflectionQuality@3]
- INI Section:
ReflectionQuality@3
- Raw value:
2
- Is Array:
False
Location: <Workspace>/Projects/Lyra/Config/DefaultScalability.ini:66, section: [ReflectionQuality@Cine]
- INI Section:
ReflectionQuality@Cine
- Raw value:
1
- Is Array:
False
#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:28
Scope: file
Source code excerpt:
int32 GLumenReflectionDownsampleFactor = 1;
FAutoConsoleVariableRef GVarLumenReflectionDownsampleFactor(
TEXT("r.Lumen.Reflections.DownsampleFactor"),
GLumenReflectionDownsampleFactor,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReflectionTraceMeshSDFs = 1;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReflectionDownsampleFactor
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:26
Scope: file
Source code excerpt:
);
int32 GLumenReflectionDownsampleFactor = 1;
FAutoConsoleVariableRef GVarLumenReflectionDownsampleFactor(
TEXT("r.Lumen.Reflections.DownsampleFactor"),
GLumenReflectionDownsampleFactor,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
int32 GLumenReflectionTraceMeshSDFs = 1;
FAutoConsoleVariableRef GVarLumenReflectionTraceMeshSDFs(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:1077
Scope (from outer to inner):
file
function FRDGTextureRef FDeferredShadingSceneRenderer::RenderLumenReflections
Source code excerpt:
// Compute effective reflection downsampling factor.
const int32 UserDownsampleFactor = View.FinalPostProcessSettings.LumenReflectionQuality <= .25f ? 2 : 1;
const float LumenReflectionDownsampleFactor = FMath::Clamp(GLumenReflectionDownsampleFactor * UserDownsampleFactor, 1, 4);
ReflectionTracingParameters.ReflectionDownsampleFactor = bDenoise ? LumenReflectionDownsampleFactor : 1;
const FIntPoint ViewSize = FIntPoint::DivideAndRoundUp(View.ViewRect.Size(), (int32)ReflectionTracingParameters.ReflectionDownsampleFactor);
FIntPoint BufferSize = FIntPoint::DivideAndRoundUp(SceneTextures.Config.Extent, (int32)ReflectionTracingParameters.ReflectionDownsampleFactor);
if (!bFrontLayer && !bSingleLayerWater)
{
BufferSize = Substrate::GetSubstrateTextureResolution(View, BufferSize);