r.AutoExposure.IgnoreMaterials.ReconstructFromSceneColor

r.AutoExposure.IgnoreMaterials.ReconstructFromSceneColor

#Overview

name: r.AutoExposure.IgnoreMaterials.ReconstructFromSceneColor

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.AutoExposure.IgnoreMaterials.ReconstructFromSceneColor is to control whether the auto-exposure system should reconstruct material information from the scene color when ignoring certain materials in its calculations.

This setting variable is primarily used in the rendering system, specifically in the post-processing pipeline for eye adaptation (auto-exposure) calculations.

Based on the callsites, this variable is used within the Renderer module of Unreal Engine 5, particularly in the PostProcessEyeAdaptation.cpp file.

The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of true and can be changed at runtime.

This variable interacts with other auto-exposure related variables, such as CVarAutoExposureIgnoreMaterialsLuminanceScale and CVarAutoExposureIgnoreMaterialsMinBaseColorLuminance, as part of the eye adaptation parameter set.

Developers should be aware that this variable affects how the auto-exposure system handles materials in the scene. When set to true, it may alter the way the system calculates overall scene brightness, potentially impacting the visual look of the game.

Best practices when using this variable include:

  1. Testing the visual impact of enabling/disabling this feature in various lighting conditions.
  2. Considering performance implications, as reconstructing from scene color might have a slight performance cost.
  3. Coordinating its use with other auto-exposure settings for consistent results.

Regarding the associated variable CVarAutoExposureIgnoreMaterialsReconstructFromSceneColor:

This is the actual CVar object that stores and manages the r.AutoExposure.IgnoreMaterials.ReconstructFromSceneColor setting. It is defined as a TAutoConsoleVariable, indicating it’s a boolean value that can be changed via console commands.

The value of this variable is retrieved in the GetEyeAdaptationParameters function, which suggests it’s used when calculating eye adaptation parameters for the renderer.

Developers should note that changes to this CVar will take effect on the render thread, as indicated by the ECVF_RenderThreadSafe flag.

When working with this variable, it’s important to understand its impact on the eye adaptation system and to use appropriate console commands or C++ code to modify its value if needed during development or runtime.

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

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


	TAutoConsoleVariable<bool> CVarAutoExposureIgnoreMaterialsReconstructFromSceneColor(
		TEXT("r.AutoExposure.IgnoreMaterials.ReconstructFromSceneColor"),
		true,
		TEXT(""),
		ECVF_RenderThreadSafe);

	TAutoConsoleVariable<float> CVarAutoExposureIgnoreMaterialsEvaluationPositionBias(
		TEXT("r.AutoExposure.IgnoreMaterials.EvaluationPositionBias"),

#Associated Variable and Callsites

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

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

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

		ECVF_RenderThreadSafe);

	TAutoConsoleVariable<bool> CVarAutoExposureIgnoreMaterialsReconstructFromSceneColor(
		TEXT("r.AutoExposure.IgnoreMaterials.ReconstructFromSceneColor"),
		true,
		TEXT(""),
		ECVF_RenderThreadSafe);

	TAutoConsoleVariable<float> CVarAutoExposureIgnoreMaterialsEvaluationPositionBias(

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

Scope (from outer to inner):

file
function     FEyeAdaptationParameters GetEyeAdaptationParameters

Source code excerpt:

	Parameters.IgnoreMaterialsLuminanceScale = CVarAutoExposureIgnoreMaterialsLuminanceScale.GetValueOnRenderThread();
	Parameters.IgnoreMaterialsMinBaseColorLuminance = CVarAutoExposureIgnoreMaterialsMinBaseColorLuminance.GetValueOnRenderThread();
	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();