r.Lumen.Reflections.RoughnessFadeLength
r.Lumen.Reflections.RoughnessFadeLength
#Overview
name: r.Lumen.Reflections.RoughnessFadeLength
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.RoughnessFadeLength is to control the roughness fade length in Lumen reflections, which is part of Unreal Engine 5’s global illumination and reflection system.
This setting variable is primarily used in the Lumen Reflections subsystem of Unreal Engine 5’s rendering module. Based on the callsites, it’s clear that this variable is utilized in the LumenReflections.cpp file, which is part of the Renderer module.
The value of this variable is set through the console variable system in Unreal Engine. It’s initialized with a default value of 0.1f and can be modified at runtime using console commands or through project settings.
The associated variable GLumenReflectionRoughnessFadeLength directly interacts with r.Lumen.Reflections.RoughnessFadeLength. They share the same value, with GLumenReflectionRoughnessFadeLength being the C++ variable that stores the actual value used in the engine’s calculations.
Developers should be aware that this variable affects the transition between rough and smooth surfaces in Lumen reflections. A smaller value will create a sharper transition, while a larger value will create a more gradual fade.
Best practices when using this variable include:
- Experimenting with different values to find the right balance for your specific scene.
- Being mindful of performance implications, as adjusting this value may affect rendering performance.
- Considering the overall visual quality and realism of reflections in your scene when modifying this value.
Regarding the associated variable GLumenReflectionRoughnessFadeLength:
The purpose of GLumenReflectionRoughnessFadeLength is to store the actual value of the roughness fade length used in Lumen reflection calculations.
This variable is used directly in the LumenReflections::SetupCompositeParameters function to calculate the inverse of the roughness fade length. It’s clamped between 0.001f and 1.0f to prevent division by zero and ensure a reasonable range of values.
The value of GLumenReflectionRoughnessFadeLength is set through the console variable system, specifically by r.Lumen.Reflections.RoughnessFadeLength.
Developers should be aware that this variable is used in critical reflection calculations and modifying it can have a significant impact on the appearance of reflections in the scene.
Best practices for GLumenReflectionRoughnessFadeLength include:
- Avoiding direct modification of this variable in code, instead use the r.Lumen.Reflections.RoughnessFadeLength console variable to change its value.
- Understanding that extremely small values (close to 0.001f) or large values (close to 1.0f) may produce unexpected visual results.
- Considering the performance implications of very small values, as they may increase the computational cost of reflection calculations.
#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:89
Scope: file
Source code excerpt:
float GLumenReflectionRoughnessFadeLength = .1f;
FAutoConsoleVariableRef GVarLumenReflectionRoughnessFadeLength(
TEXT("r.Lumen.Reflections.RoughnessFadeLength"),
GLumenReflectionRoughnessFadeLength,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenReflectionGGXSamplingBias = .1f;
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReflectionRoughnessFadeLength
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:87
Scope: file
Source code excerpt:
);
float GLumenReflectionRoughnessFadeLength = .1f;
FAutoConsoleVariableRef GVarLumenReflectionRoughnessFadeLength(
TEXT("r.Lumen.Reflections.RoughnessFadeLength"),
GLumenReflectionRoughnessFadeLength,
TEXT(""),
ECVF_Scalability | ECVF_RenderThreadSafe
);
float GLumenReflectionGGXSamplingBias = .1f;
FAutoConsoleVariableRef GVarLumenReflectionGGXSamplingBias(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:317
Scope (from outer to inner):
file
function void LumenReflections::SetupCompositeParameters
Source code excerpt:
{
OutParameters.MaxRoughnessToTrace = FMath::Min(View.FinalPostProcessSettings.LumenMaxRoughnessToTraceReflections, CVarLumenReflectionMaxRoughnessToTraceClamp.GetValueOnRenderThread());
OutParameters.InvRoughnessFadeLength = 1.0f / FMath::Clamp(GLumenReflectionRoughnessFadeLength, 0.001f, 1.0f);
OutParameters.MaxRoughnessToTraceForFoliage = CVarLumenReflectionsMaxRoughnessToTraceForFoliage.GetValueOnRenderThread();
if (CVarLumenReflectionMaxRoughnessToTrace.GetValueOnRenderThread() >= 0.0f)
{
OutParameters.MaxRoughnessToTrace = CVarLumenReflectionMaxRoughnessToTrace.GetValueOnRenderThread();
}