r.AutoExposure.IgnoreMaterials.DownscaleFactor

r.AutoExposure.IgnoreMaterials.DownscaleFactor

#Overview

name: r.AutoExposure.IgnoreMaterials.DownscaleFactor

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.DownscaleFactor is to control the downscale factor for the auto-exposure system when ignoring materials in the scene. This setting variable is part of Unreal Engine’s rendering system, specifically the post-processing and eye adaptation subsystem.

Based on the callsites section, this variable is primarily used in the Renderer module, specifically within the PostProcessEyeAdaptation.cpp file. This suggests that it’s an integral part of the auto-exposure and eye adaptation system in Unreal Engine’s rendering pipeline.

The value of this variable is set through a console variable (CVar) system. It’s initialized with a default value of 2, as seen in the source code excerpt. Developers can modify this value at runtime using console commands or through project settings.

This variable interacts directly with its associated variable CVarAutoExposureIgnoreMaterialsDownscaleFactor. They share the same value and are used interchangeably in the code.

Developers must be aware that this variable affects the performance and quality trade-off in the auto-exposure system. A higher downscale factor will improve performance but may reduce the accuracy of the exposure calculation.

Best practices when using this variable include:

  1. Adjusting it based on the specific needs of your project, balancing between performance and visual quality.
  2. Testing different values to find the optimal setting for your scene.
  3. Considering the target hardware when setting this value, as lower-end devices may benefit from a higher downscale factor.

Regarding the associated variable CVarAutoExposureIgnoreMaterialsDownscaleFactor:

This is the actual console variable that stores the downscale factor value. It’s defined as an integer and is used to retrieve the current setting value in the GetAutoExposureIlluminanceDownscaleFactor function.

The value obtained from this variable is clamped between 1 and 16, ensuring that the downscale factor remains within a reasonable range. This clamping is an important detail that developers should be aware of, as it means that even if a value outside this range is set, it will be automatically adjusted to fit within these bounds.

When working with this variable, developers should:

  1. Use the GetAutoExposureIlluminanceDownscaleFactor function to retrieve the current value, as it applies the necessary clamping.
  2. Be aware that changes to this variable will affect the rendering performance and quality of the auto-exposure system.
  3. Consider exposing this setting in user-facing graphics options if fine-tuning of auto-exposure performance is desired.

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

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:


	TAutoConsoleVariable<int32> CVarAutoExposureIgnoreMaterialsDownscaleFactor(
		TEXT("r.AutoExposure.IgnoreMaterials.DownscaleFactor"),
		2,
		TEXT(""),
		ECVF_Scalability | ECVF_RenderThreadSafe);

	TAutoConsoleVariable<bool> CVarAutoExposureIgnoreMaterialsDebug(
		TEXT("r.AutoExposure.IgnoreMaterials.Debug"),

#Associated Variable and Callsites

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

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

Scope (from outer to inner):

file
namespace    anonymous

Source code excerpt:

		ECVF_Scalability | ECVF_RenderThreadSafe);

	TAutoConsoleVariable<int32> CVarAutoExposureIgnoreMaterialsDownscaleFactor(
		TEXT("r.AutoExposure.IgnoreMaterials.DownscaleFactor"),
		2,
		TEXT(""),
		ECVF_Scalability | ECVF_RenderThreadSafe);

	TAutoConsoleVariable<bool> CVarAutoExposureIgnoreMaterialsDebug(

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

Scope (from outer to inner):

file
function     int32 GetAutoExposureIlluminanceDownscaleFactor

Source code excerpt:

int32 GetAutoExposureIlluminanceDownscaleFactor()
{
	int32 DownscaleFactor = CVarAutoExposureIgnoreMaterialsDownscaleFactor.GetValueOnRenderThread();

	return FMath::Clamp(DownscaleFactor, 1, 16);
}

static EAutoExposureMethod ApplyEyeAdaptationQuality(EAutoExposureMethod AutoExposureMethod)
{