r.LumenScene.FarField.FarFieldDitherScale
r.LumenScene.FarField.FarFieldDitherScale
#Overview
name: r.LumenScene.FarField.FarFieldDitherScale
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Dither region between near and far field in world space units.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.LumenScene.FarField.FarFieldDitherScale is to control the dither region between the near and far field in world space units for the Lumen lighting system in Unreal Engine 5.
This setting variable is primarily used by the Lumen rendering system, which is part of Unreal Engine’s global illumination solution. Specifically, it’s utilized in the LumenScene module within the Renderer subsystem.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 200.0f, but can be modified at runtime or through configuration files.
The associated variable CVarLumenFarFieldDitherScale directly interacts with r.LumenScene.FarField.FarFieldDitherScale. They share the same value and purpose.
Developers should be aware that this variable affects the transition between near and far field lighting in Lumen. It’s marked with ECVF_Scalability and ECVF_RenderThreadSafe flags, indicating that it can be used for scalability settings and is safe to modify from the render thread.
Best practices when using this variable include:
- Adjusting it carefully to balance visual quality and performance.
- Testing different values to find the optimal dither scale for your specific scene.
- Considering its impact on different hardware configurations, as it’s a scalability setting.
Regarding the associated variable CVarLumenFarFieldDitherScale:
The purpose of CVarLumenFarFieldDitherScale is identical to r.LumenScene.FarField.FarFieldDitherScale, as they represent the same setting.
It’s used within the Lumen rendering system, specifically in the LumenScene module of the Renderer subsystem.
The value is set through the TAutoConsoleVariable system, allowing for runtime modifications.
This variable is directly accessed in the GetNearFieldMaxTraceDistanceDitherScale function, which is part of the Lumen namespace. This function returns the dither scale value when far field is in use, or 0.0f when it’s not.
Developers should be aware that changes to this variable will directly affect the Lumen lighting system’s behavior, particularly in how it transitions between near and far field lighting.
Best practices include:
- Using the GetValueOnRenderThread() method to access its value safely from render thread code.
- Considering the performance implications when modifying this value, especially in real-time applications.
- Coordinating changes to this variable with other Lumen-related settings for optimal results.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScene.cpp:40
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarLumenFarFieldDitherScale(
TEXT("r.LumenScene.FarField.FarFieldDitherScale"),
200.0f,
TEXT("Dither region between near and far field in world space units."),
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarLumenFarFieldReferencePosZ(
TEXT("r.LumenScene.FarField.ReferencePos.Z"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarLumenFarFieldDitherScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScene.cpp:39
Scope: file
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarLumenFarFieldDitherScale(
TEXT("r.LumenScene.FarField.FarFieldDitherScale"),
200.0f,
TEXT("Dither region between near and far field in world space units."),
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarLumenFarFieldReferencePosZ(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenScene.cpp:89
Scope (from outer to inner):
file
namespace Lumen
function float GetNearFieldMaxTraceDistanceDitherScale
Source code excerpt:
float GetNearFieldMaxTraceDistanceDitherScale(bool bUseFarField)
{
return bUseFarField ? CVarLumenFarFieldDitherScale.GetValueOnRenderThread() : 0.0f;
}
float GetNearFieldSceneRadius(const FViewInfo& View, bool bUseFarField)
{
float SceneRadius = FLT_MAX;