r.AutoExposure.IgnoreMaterials
r.AutoExposure.IgnoreMaterials
#Overview
name: r.AutoExposure.IgnoreMaterials
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
(Experimental) Whether to calculate auto exposure assuming every surface uses a perfectly diffuse white material.\n(default: false)
It is referenced in 4
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.AutoExposure.IgnoreMaterials is to control whether the auto exposure calculation in Unreal Engine 5 should ignore material properties and assume every surface uses a perfectly diffuse white material. This setting is part of the rendering system, specifically the auto exposure (eye adaptation) feature.
This setting variable is primarily used in the Renderer module of Unreal Engine 5, particularly in the post-processing subsystem for eye adaptation (auto exposure).
The value of this variable is set through a console variable (CVar) system. It’s defined as a boolean value with a default of false, meaning by default, material properties are considered in auto exposure calculations.
The associated variable CVarAutoExposureIgnoreMaterials directly interacts with r.AutoExposure.IgnoreMaterials. They share the same value and purpose.
Developers must be aware of several important points when using this variable:
- This feature is marked as experimental, indicating it may not be fully stable or optimized.
- Enabling this option will significantly change how auto exposure is calculated, potentially affecting the overall look of the scene.
- This setting cannot be used with path tracing, as it requires a GBuffer which is not available in path tracing.
- It’s only effective when the auto exposure method is set to Histogram.
Best practices when using this variable include:
- Use it cautiously, as it’s experimental and can significantly impact visual quality.
- Test thoroughly in various lighting conditions to ensure desired results.
- Consider performance implications, as ignoring materials might affect render times.
- Be aware of its interaction with other auto exposure settings.
Regarding the associated variable CVarAutoExposureIgnoreMaterials:
This is the actual CVar object that controls the r.AutoExposure.IgnoreMaterials setting. It’s used internally by the engine to access and modify the setting value. The variable is checked in various parts of the auto exposure calculation code to determine whether to ignore material properties.
Developers should note that this variable is accessed using GetValueOnRenderThread(), indicating that it’s safe to be read from the render thread. Any changes to this variable will affect the rendering pipeline, so it should be modified with caution and primarily for debugging or very specific use cases.
#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:72
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<bool> CVarAutoExposureIgnoreMaterials(
TEXT("r.AutoExposure.IgnoreMaterials"),
false,
TEXT("(Experimental) Whether to calculate auto exposure assuming every surface uses a perfectly diffuse white material.\n")
TEXT("(default: false)"),
ECVF_Scalability | ECVF_RenderThreadSafe);
TAutoConsoleVariable<int32> CVarAutoExposureLuminanceMethod(
#Associated Variable and Callsites
This variable is associated with another variable named CVarAutoExposureIgnoreMaterials
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:71
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
TAutoConsoleVariable<bool> CVarAutoExposureIgnoreMaterials(
TEXT("r.AutoExposure.IgnoreMaterials"),
false,
TEXT("(Experimental) Whether to calculate auto exposure assuming every surface uses a perfectly diffuse white material.\n")
TEXT("(default: false)"),
ECVF_Scalability | ECVF_RenderThreadSafe);
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:145
Scope (from outer to inner):
file
namespace AutoExposurePermutation
function FCommonDomain BuildCommonPermutationDomain
Source code excerpt:
FCommonDomain PermutationVector;
if (CVarAutoExposureIgnoreMaterials.GetValueOnRenderThread())
{
if (CVarAutoExposureIgnoreMaterialsUsePrecalculatedIlluminance.GetValueOnRenderThread())
{
PermutationVector.Set<FUsePrecalculatedLuminanceDim>(true);
}
else
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:192
Scope (from outer to inner):
file
function bool IsAutoExposureUsingIlluminanceEnabled
Source code excerpt:
{
// NOTE: This method cannot be supported with PathTracing because it requires a GBuffer which is not available in the path tracing case
return CVarAutoExposureIgnoreMaterials.GetValueOnRenderThread() && GetAutoExposureMethod(View) == AEM_Histogram && !View.Family->EngineShowFlags.PathTracing;
}
int32 GetAutoExposureIlluminanceDownscaleFactor()
{
int32 DownscaleFactor = CVarAutoExposureIgnoreMaterialsDownscaleFactor.GetValueOnRenderThread();