r.EyeAdaptationQuality
r.EyeAdaptationQuality
#Overview
name: r.EyeAdaptationQuality
The value of this variable can be defined or overridden in .ini config files. 21
.ini config files referencing this setting variable.
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Defines the eye adaptation quality which allows to adjust for quality or performance.\n<=0: off (fastest)\n 1: low quality (e.g. non histogram based, not yet implemented)\n 2: normal quality (default)\n 3: high quality (e.g. screen position localized, not yet implemented)
It is referenced in 7
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.EyeAdaptationQuality is to control the quality of the eye adaptation effect in Unreal Engine’s rendering system. Eye adaptation simulates how human eyes adjust to different light levels, enhancing the realism of the rendered scene.
This setting variable is primarily used by the Unreal Engine’s rendering subsystem, specifically in the post-processing pipeline for eye adaptation and auto-exposure.
The value of this variable is set through the console variable system. It’s initialized with a default value of 2, which represents normal quality. The variable can be modified at runtime using console commands or through C++ code.
The associated variable CVarEyeAdaptationQuality interacts directly with r.EyeAdaptationQuality. They share the same value and are used interchangeably in the code.
Developers should be aware that:
- Setting this variable to 0 or below disables eye adaptation entirely, which can be useful for performance optimization or specific visual styles.
- The variable affects the auto-exposure method used in the rendering pipeline.
- Changes to this variable can impact both visual quality and performance.
Best practices when using this variable include:
- Use the default value (2) for most scenarios, as it offers a good balance between quality and performance.
- Consider lowering the value for performance-critical situations or on lower-end hardware.
- Be cautious when setting it to 0, as it completely disables eye adaptation, which may result in unrealistic lighting in some scenes.
- When taking screenshots or running automated tests, you may want to disable eye adaptation (set to 0) to ensure consistent results.
Regarding the associated variable CVarEyeAdaptationQuality:
- It serves the same purpose as r.EyeAdaptationQuality and is used interchangeably in the code.
- It’s typically used in C++ code to retrieve the current eye adaptation quality setting.
- The variable is accessed through the console variable system, allowing for runtime modifications.
- When working with eye adaptation in C++ code, developers should use CVarEyeAdaptationQuality to read the current setting, ensuring consistency with the r.EyeAdaptationQuality console variable.
#Setting Variables
#References In INI files
<Workspace>/Engine/Config/BaseScalability.ini:399, section: [PostProcessQuality@0]
<Workspace>/Engine/Config/BaseScalability.ini:419, section: [PostProcessQuality@1]
<Workspace>/Engine/Config/BaseScalability.ini:452, section: [PostProcessQuality@2]
<Workspace>/Engine/Config/BaseScalability.ini:487, section: [PostProcessQuality@3]
<Workspace>/Engine/Config/BaseScalability.ini:525, section: [PostProcessQuality@Cine]
<Workspace>/Engine/Config/Android/AndroidScalability.ini:93, section: [PostProcessQuality@0]
<Workspace>/Engine/Config/Android/AndroidScalability.ini:103, section: [PostProcessQuality@1]
<Workspace>/Engine/Config/Android/AndroidScalability.ini:113, section: [PostProcessQuality@2]
<Workspace>/Engine/Config/Android/AndroidScalability.ini:123, section: [PostProcessQuality@3]
<Workspace>/Engine/Config/IOS/IOSScalability.ini:93, section: [PostProcessQuality@0]
<Workspace>/Engine/Config/IOS/IOSScalability.ini:103, section: [PostProcessQuality@1]
<Workspace>/Engine/Config/IOS/IOSScalability.ini:113, section: [PostProcessQuality@2]
<Workspace>/Engine/Config/IOS/IOSScalability.ini:123, section: [PostProcessQuality@3]
<Workspace>/Projects/Lyra/Config/Android/AndroidScalability.ini:3, section: [PostProcessQuality@0]
<Workspace>/Projects/Lyra/Config/Android/AndroidScalability.ini:5, section: [PostProcessQuality@1]
<Workspace>/Projects/Lyra/Config/Android/AndroidScalability.ini:7, section: [PostProcessQuality@2]
<Workspace>/Projects/Lyra/Config/Android/AndroidScalability.ini:9, section: [PostProcessQuality@3]
<Workspace>/Projects/Lyra/Config/IOS/IOSScalability.ini:3, section: [PostProcessQuality@0]
<Workspace>/Projects/Lyra/Config/IOS/IOSScalability.ini:5, section: [PostProcessQuality@1]
<Workspace>/Projects/Lyra/Config/IOS/IOSScalability.ini:7, section: [PostProcessQuality@2]
<Workspace>/Projects/Lyra/Config/IOS/IOSScalability.ini:9, section: [PostProcessQuality@3]
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:4005
Scope: file
Source code excerpt:
static TAutoConsoleVariable<int32> CVarEyeAdaptationQuality(
TEXT("r.EyeAdaptationQuality"),
2,
TEXT("Defines the eye adaptation quality which allows to adjust for quality or performance.\n"
"<=0: off (fastest)\n"
" 1: low quality (e.g. non histogram based, not yet implemented)\n"
" 2: normal quality (default)\n"
" 3: high quality (e.g. screen position localized, not yet implemented)"),
#Loc: <Workspace>/Engine/Plugins/Tests/EditorTests/Source/EditorTests/Private/UnrealEd/EditorAutomationTests.cpp:244
Scope (from outer to inner):
file
function bool FLoadAllMapsInEditorTest::RunTest
Source code excerpt:
//Disable Eye Adaptation
static IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("r.EyeAdaptationQuality"));
CVar->Set(0);
//Create a screen shot filename and path
const FString LoadAllMapsTestName = FString::Printf(TEXT("LoadAllMaps_Editor/%s"), *FPaths::GetBaseFilename(MapName));
WindowParameters.ScreenshotName = AutomationCommon::GetScreenshotPath(LoadAllMapsTestName);
#Loc: <Workspace>/Engine/Source/Developer/FunctionalTesting/Private/AutomationBlueprintFunctionLibrary.cpp:244
Scope (from outer to inner):
file
function FAutomationTestScreenshotEnvSetup::FAutomationTestScreenshotEnvSetup
Source code excerpt:
, MotionBlurQuality(TEXT("r.MotionBlurQuality"))
, ScreenSpaceReflectionQuality(TEXT("r.SSR.Quality"))
, EyeAdaptationQuality(TEXT("r.EyeAdaptationQuality"))
, ContactShadows(TEXT("r.ContactShadows"))
, TonemapperGamma(TEXT("r.TonemapperGamma"))
, TonemapperSharpen(TEXT("r.Tonemapper.Sharpen"))
, ScreenPercentage(TEXT("r.ScreenPercentage"))
, DynamicResTestScreenPercentage(TEXT("r.DynamicRes.TestScreenPercentage"))
, DynamicResOperationMode(TEXT("r.DynamicRes.OperationMode"))
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/ShowFlags.cpp:447
Scope (from outer to inner):
file
function void EngineShowFlagOverride
Source code excerpt:
{
static const auto ICVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.EyeAdaptationQuality"));
if(ICVar->GetValueOnGameThread() <= 0)
{
EngineShowFlags.SetEyeAdaptation(false);
}
}
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:204
Scope (from outer to inner):
file
function static EAutoExposureMethod ApplyEyeAdaptationQuality
Source code excerpt:
static EAutoExposureMethod ApplyEyeAdaptationQuality(EAutoExposureMethod AutoExposureMethod)
{
static const auto CVarEyeAdaptationQuality = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.EyeAdaptationQuality"));
const int32 EyeAdaptationQuality = CVarEyeAdaptationQuality->GetValueOnRenderThread();
if (AutoExposureMethod != EAutoExposureMethod::AEM_Manual)
{
if (EyeAdaptationQuality == 1)
{
#Associated Variable and Callsites
This variable is associated with another variable named CVarEyeAdaptationQuality
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Core/Private/HAL/ConsoleManager.cpp:4004
Scope: file
Source code excerpt:
ECVF_Scalability | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<int32> CVarEyeAdaptationQuality(
TEXT("r.EyeAdaptationQuality"),
2,
TEXT("Defines the eye adaptation quality which allows to adjust for quality or performance.\n"
"<=0: off (fastest)\n"
" 1: low quality (e.g. non histogram based, not yet implemented)\n"
" 2: normal quality (default)\n"
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:204
Scope (from outer to inner):
file
function static EAutoExposureMethod ApplyEyeAdaptationQuality
Source code excerpt:
static EAutoExposureMethod ApplyEyeAdaptationQuality(EAutoExposureMethod AutoExposureMethod)
{
static const auto CVarEyeAdaptationQuality = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.EyeAdaptationQuality"));
const int32 EyeAdaptationQuality = CVarEyeAdaptationQuality->GetValueOnRenderThread();
if (AutoExposureMethod != EAutoExposureMethod::AEM_Manual)
{
if (EyeAdaptationQuality == 1)
{
// Clamp current method to AEM_Basic