r.Lumen.Reflections.Contrast
r.Lumen.Reflections.Contrast
#Overview
name: r.Lumen.Reflections.Contrast
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Non-physically correct Lumen reflection contrast. Recommended to keep at 1.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.Lumen.Reflections.Contrast is to control the contrast of Lumen reflections in Unreal Engine 5’s rendering system. It is specifically designed for the Lumen global illumination system, which is part of UE5’s advanced rendering features.
This setting variable is primarily used in the Renderer module, specifically within the Lumen reflections subsystem. It’s referenced in the LumenReflections.cpp file, which suggests it’s closely tied to the implementation of Lumen’s reflection system.
The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 1.0f and can be modified at runtime using the console command “r.Lumen.Reflections.Contrast”.
The associated variable GLumenReflectionsContrast directly interacts with r.Lumen.Reflections.Contrast. They share the same value, with GLumenReflectionsContrast being the actual float variable used in the code, while r.Lumen.Reflections.Contrast is the console variable name used to modify it.
Developers must be aware that this variable provides a non-physically correct way to adjust reflection contrast. The comment in the code explicitly recommends keeping this value at 1, which suggests that deviating from this value might lead to unrealistic results.
Best practices when using this variable include:
- Keeping it at the default value of 1 for physically accurate results.
- If adjusting, do so sparingly and with careful consideration of the visual impact.
- Use it for stylized or non-photorealistic rendering where physical accuracy is not the primary goal.
Regarding GLumenReflectionsContrast, it’s the actual float variable that stores the contrast value. It’s clamped between 0.001f and 1.0f in the GetLumenReflectionContrast() function, which suggests that values outside this range are not supported or could cause issues. Developers should be aware of this clamping when setting values through the console variable, as any value set outside this range will be automatically adjusted to fit within these bounds.
#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:282
Scope: file
Source code excerpt:
float GLumenReflectionsContrast = 1.f;
FAutoConsoleVariableRef GVarLumenReflectionsContrast(
TEXT("r.Lumen.Reflections.Contrast"),
GLumenReflectionsContrast,
TEXT("Non-physically correct Lumen reflection contrast. Recommended to keep at 1."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int> GVarLumenReflectionsFixedStateFrameIndex(
TEXT("r.Lumen.Reflections.FixedStateFrameIndex"),
#Associated Variable and Callsites
This variable is associated with another variable named GLumenReflectionsContrast
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:280
Scope: file
Source code excerpt:
ECVF_RenderThreadSafe);
float GLumenReflectionsContrast = 1.f;
FAutoConsoleVariableRef GVarLumenReflectionsContrast(
TEXT("r.Lumen.Reflections.Contrast"),
GLumenReflectionsContrast,
TEXT("Non-physically correct Lumen reflection contrast. Recommended to keep at 1."),
ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int> GVarLumenReflectionsFixedStateFrameIndex(
TEXT("r.Lumen.Reflections.FixedStateFrameIndex"),
-1,
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/Lumen/LumenReflections.cpp:301
Scope (from outer to inner):
file
function float GetLumenReflectionContrast
Source code excerpt:
float GetLumenReflectionContrast()
{
return FMath::Clamp(GLumenReflectionsContrast, 0.001f, 1.0f);
}
bool LumenReflections::UseSurfaceCacheFeedback()
{
return CVarLumenReflectionsSurfaceCacheFeedback.GetValueOnRenderThread() != 0;
}