r.EyeAdaptation.MethodOverride

r.EyeAdaptation.MethodOverride

#Overview

name: r.EyeAdaptation.MethodOverride

This variable is created as a Console Variable (cvar).

It is referenced in 3 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of r.EyeAdaptation.MethodOverride is to control the eye adaptation method used in the rendering system of Unreal Engine 5. It allows developers to override the camera metering method that is typically set in post-processing volumes.

This setting variable is primarily used in the rendering subsystem of Unreal Engine, specifically in the post-processing pipeline for eye adaptation or auto-exposure.

The value of this variable is set through a console variable (CVarEyeAdaptationMethodOverride) in the Renderer module. It can be modified at runtime using console commands or through code.

The associated variable CVarEyeAdaptationMethodOverride directly interacts with r.EyeAdaptation.MethodOverride. They share the same value and purpose.

Developers must be aware of the following when using this variable:

  1. The default value is -1, which means no override is applied.
  2. Values 1 and 2 correspond to different auto-exposure methods (Auto Histogram-based and Auto Basic, respectively).
  3. A value of -2 is used for custom settings, primarily for testing the Basic Mode.

Best practices when using this variable include:

  1. Use it primarily for debugging or testing purposes, as it overrides the settings in post-processing volumes.
  2. Be cautious when using it in production builds, as it may affect the visual quality and consistency across different scenes.
  3. When using the override, ensure to reset it to -1 when the custom behavior is no longer needed.

Regarding the associated variable CVarEyeAdaptationMethodOverride:

The purpose of CVarEyeAdaptationMethodOverride is to provide a programmable interface for the r.EyeAdaptation.MethodOverride setting. It allows developers to read and modify the eye adaptation method override through C++ code.

This variable is used in the Renderer module of Unreal Engine, specifically in the post-processing pipeline for eye adaptation.

The value of CVarEyeAdaptationMethodOverride is set when the console variable is initialized, but it can be modified at runtime using the console or through C++ code.

CVarEyeAdaptationMethodOverride directly interacts with r.EyeAdaptation.MethodOverride, as they represent the same setting.

Developers should be aware that:

  1. This variable is accessed on the render thread, so any modifications should be thread-safe.
  2. Changes to this variable will immediately affect the rendering pipeline.

Best practices for using CVarEyeAdaptationMethodOverride include:

  1. Use GetValueOnRenderThread() when accessing the value in render thread code.
  2. Consider using the console variable interface (IConsoleVariable) for more advanced operations if needed.
  3. Remember that changes to this variable will override post-processing volume settings, so use it judiciously.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:32

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


	TAutoConsoleVariable<int32> CVarEyeAdaptationMethodOverride(
		TEXT("r.EyeAdaptation.MethodOverride"),
		-1,
		TEXT("Override the camera metering method set in post processing volumes\n")
		TEXT("-2: override with custom settings (for testing Basic Mode)\n")
		TEXT("-1: no override\n")
		TEXT(" 1: Auto Histogram-based\n")
		TEXT(" 2: Auto Basic\n")

#Associated Variable and Callsites

This variable is associated with another variable named CVarEyeAdaptationMethodOverride. They share the same value. See the following C++ source code.

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:31

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

		ECVF_RenderThreadSafe);

	TAutoConsoleVariable<int32> CVarEyeAdaptationMethodOverride(
		TEXT("r.EyeAdaptation.MethodOverride"),
		-1,
		TEXT("Override the camera metering method set in post processing volumes\n")
		TEXT("-2: override with custom settings (for testing Basic Mode)\n")
		TEXT("-1: no override\n")
		TEXT(" 1: Auto Histogram-based\n")

#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:248

Scope (from outer to inner):

file
function     EAutoExposureMethod GetAutoExposureMethod

Source code excerpt:

	AutoExposureMethod = ApplyEyeAdaptationQuality(AutoExposureMethod);

	const int32 EyeOverride = CVarEyeAdaptationMethodOverride.GetValueOnRenderThread();

	EAutoExposureMethod OverrideAutoExposureMethod = AutoExposureMethod;

	if (EyeOverride >= 0)
	{
		// Additional branching for override.