r.ExposureOffset
r.ExposureOffset
#Overview
name: r.ExposureOffset
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
For adjusting the exposure on top of post process settings and eye adaptation. 0: default
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.ExposureOffset is to adjust the exposure in the rendering system, specifically for post-processing and eye adaptation. It provides an additional offset on top of existing post-process settings and eye adaptation calculations.
This setting variable is primarily used in the rendering subsystem of Unreal Engine, specifically in the post-processing pipeline. Based on the callsite details, it’s referenced in the Engine module, within the SceneView.cpp file.
The value of this variable is set through a console variable (CVarExposureOffset) with a default value of 0.0f. It can be modified at runtime using console commands or through C++ code.
The r.ExposureOffset variable interacts directly with CVarExposureOffset, which is its associated console variable. The value from CVarExposureOffset is used to modify the AutoExposureBias in the FinalPostProcessSettings.
Developers should be aware that this variable is marked with ECVF_Cheat flag, indicating it’s intended for debugging or cheats rather than regular gameplay adjustments. It directly affects the final rendering output, so changes to this value can significantly impact the visual appearance of the scene.
Best practices for using this variable include:
- Use it primarily for debugging or fine-tuning purposes.
- Be cautious when modifying it in shipping builds, as it can affect the intended visual design.
- Consider exposing it through a user interface only if necessary for specific use cases.
Regarding the associated variable CVarExposureOffset:
The purpose of CVarExposureOffset is to provide a console-accessible way to modify the exposure offset. It’s a TAutoConsoleVariable that corresponds directly to the r.ExposureOffset setting.
This console variable is part of the Engine module and is used in the rendering system, specifically for post-processing adjustments.
The value of CVarExposureOffset is set when the variable is initialized, with a default value of 0.0f. It can be modified through console commands at runtime.
CVarExposureOffset interacts directly with the AutoExposureBias in the FinalPostProcessSettings. Its value is added to the existing AutoExposureBias.
Developers should be aware that changes to CVarExposureOffset will immediately affect the scene’s exposure, potentially altering the visual balance of the entire rendered image.
Best practices for using CVarExposureOffset include:
- Use it for quick iterations and testing of exposure adjustments during development.
- Be cautious about leaving non-zero values in production builds, as it may interfere with intended exposure settings.
- Consider creating a more robust system for exposure control if frequent adjustments are needed in the final product.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:128
Scope: file
Source code excerpt:
static TAutoConsoleVariable<float> CVarExposureOffset(
TEXT("r.ExposureOffset"),
0.0f,
TEXT("For adjusting the exposure on top of post process settings and eye adaptation. 0: default"),
ECVF_Cheat);
// Engine default (project settings):
#Associated Variable and Callsites
This variable is associated with another variable named CVarExposureOffset
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:127
Scope: file
Source code excerpt:
ECVF_Cheat | ECVF_RenderThreadSafe);
static TAutoConsoleVariable<float> CVarExposureOffset(
TEXT("r.ExposureOffset"),
0.0f,
TEXT("For adjusting the exposure on top of post process settings and eye adaptation. 0: default"),
ECVF_Cheat);
// Engine default (project settings):
#Loc: <Workspace>/Engine/Source/Runtime/Engine/Private/SceneView.cpp:2144
Scope (from outer to inner):
file
function void FSceneView::EndFinalPostprocessSettings
Source code excerpt:
{
float Value = CVarExposureOffset.GetValueOnGameThread();
FinalPostProcessSettings.AutoExposureBias += Value;
}
#if !(UE_BUILD_SHIPPING || UE_BUILD_TEST)
{
float& DepthBlurAmount = FinalPostProcessSettings.DepthOfFieldDepthBlurAmount;