r.EyeAdaptation.VisualizeDebugType

r.EyeAdaptation.VisualizeDebugType

#Overview

name: r.EyeAdaptation.VisualizeDebugType

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.VisualizeDebugType is to control the visualization of the Eye Adaptation (HDR) debug output in Unreal Engine’s rendering system.

This setting variable is primarily used in the rendering system, specifically in the post-processing pipeline for eye adaptation and HDR rendering. It is part of the Renderer module in Unreal Engine 5.

The Unreal Engine subsystem that relies on this setting variable is the post-processing system, particularly the eye adaptation component. It is used in the PostProcessEyeAdaptation.cpp file, which handles the eye adaptation calculations and visualizations.

The value of this variable is set through the console variable system in Unreal Engine. It is defined as a TAutoConsoleVariable with an initial value of 0.

The associated variable CVarEyeAdaptationVisualizeDebugType interacts directly with r.EyeAdaptation.VisualizeDebugType. They share the same value and are used interchangeably in the code.

Developers must be aware that this variable affects the visualization output when the “Show->Visualize->HDR (Eye Adaptation)” option is enabled. It determines how the scene color is displayed in the debug view.

Best practices when using this variable include:

  1. Use it primarily for debugging purposes.
  2. Be aware of the two possible values and their meanings:
    • 0: Shows the scene color after tonemapping (default)
    • 1: Displays the Histogram Debug view
  3. Use it in conjunction with other eye adaptation and HDR debugging tools for a comprehensive understanding of the rendering pipeline.

Regarding the associated variable CVarEyeAdaptationVisualizeDebugType:

When working with both r.EyeAdaptation.VisualizeDebugType and CVarEyeAdaptationVisualizeDebugType, developers should remember that changes to one will affect the other, as they represent the same underlying setting.

#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:50

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


	TAutoConsoleVariable<int> CVarEyeAdaptationVisualizeDebugType(
		TEXT("r.EyeAdaptation.VisualizeDebugType"),
		0,
		TEXT("When enabling Show->Visualize->HDR (Eye Adaptation) is enabled, this flag controls the scene color.\n")
		TEXT("    0: Scene Color after tonemapping (default).\n")
		TEXT("    1: Histogram Debug\n"),
		ECVF_RenderThreadSafe);

#Associated Variable and Callsites

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

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

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

		ECVF_RenderThreadSafe);

	TAutoConsoleVariable<int> CVarEyeAdaptationVisualizeDebugType(
		TEXT("r.EyeAdaptation.VisualizeDebugType"),
		0,
		TEXT("When enabling Show->Visualize->HDR (Eye Adaptation) is enabled, this flag controls the scene color.\n")
		TEXT("    0: Scene Color after tonemapping (default).\n")
		TEXT("    1: Histogram Debug\n"),
		ECVF_RenderThreadSafe);

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

Scope (from outer to inner):

file
function     FEyeAdaptationParameters GetEyeAdaptationParameters

Source code excerpt:

	Parameters.IgnoreMaterialsReconstructFromSceneColor = CVarAutoExposureIgnoreMaterialsReconstructFromSceneColor.GetValueOnRenderThread();
	Parameters.ForceTarget = ForceTarget;
	Parameters.VisualizeDebugType = CVarEyeAdaptationVisualizeDebugType.GetValueOnRenderThread();
	Parameters.MeterMaskTexture = MeterMask;
	Parameters.MeterMaskSampler = TStaticSamplerState<SF_Bilinear, AM_Clamp, AM_Clamp, AM_Clamp>::GetRHI();

	const int32 LuminanceMethod = CVarAutoExposureLuminanceMethod.GetValueOnRenderThread();
	if (LuminanceMethod == 1)
	{