r.AutoExposure.IgnoreMaterials.MinBaseColorLuminance
r.AutoExposure.IgnoreMaterials.MinBaseColorLuminance
#Overview
name: r.AutoExposure.IgnoreMaterials.MinBaseColorLuminance
This variable is created as a Console Variable (cvar).
- type:
Var
- help: ``
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of r.AutoExposure.IgnoreMaterials.MinBaseColorLuminance is to set a minimum threshold for base color luminance in the auto-exposure system of Unreal Engine’s rendering pipeline. This setting is specifically used in the context of ignoring certain materials during the auto-exposure calculation.
This setting variable is primarily used in the rendering system, specifically in the post-processing stage related to eye adaptation (auto-exposure). It is part of the Renderer module of Unreal Engine.
The value of this variable is set through the TAutoConsoleVariable system, which allows it to be changed at runtime. Its default value is set to 0.01f.
The variable interacts with other auto-exposure related variables, as seen in the GetEyeAdaptationParameters function. It’s used alongside other settings like IgnoreMaterialsEvaluationPositionBias, IgnoreMaterialsLuminanceScale, and IgnoreMaterialsReconstructFromSceneColor.
Developers should be aware that this variable affects how the auto-exposure system calculates scene luminance. By setting a minimum base color luminance, it can potentially exclude very dark materials from affecting the overall exposure calculation.
Best practices when using this variable include:
- Carefully adjusting its value based on the specific lighting conditions of your scene.
- Testing different values to find the right balance between ignoring unwanted dark areas and maintaining proper exposure for the entire scene.
- Using it in conjunction with other auto-exposure settings for fine-tuned control over the final image exposure.
Regarding the associated variable CVarAutoExposureIgnoreMaterialsMinBaseColorLuminance:
This is the actual console variable object that represents r.AutoExposure.IgnoreMaterials.MinBaseColorLuminance in the code. It’s created using the TAutoConsoleVariable template, which allows for type-safe console variables.
The purpose of this variable is the same as r.AutoExposure.IgnoreMaterials.MinBaseColorLuminance - to store and provide access to the minimum base color luminance threshold for the auto-exposure system.
This variable is used in the Renderer module, specifically in the eye adaptation (auto-exposure) post-processing stage.
The value of this variable is set when it’s created (with a default of 0.01f), but it can be changed at runtime through console commands due to its nature as a console variable.
It interacts with other auto-exposure related variables in the GetEyeAdaptationParameters function, where its value is retrieved and stored in the FEyeAdaptationParameters struct.
Developers should be aware that this is the actual variable they would interact with in C++ code when they need to read or modify this setting programmatically.
Best practices for using this variable include:
- Using GetValueOnRenderThread() when accessing its value in render thread code.
- Considering performance implications when frequently accessing or changing this value, as it may trigger recalculations in the auto-exposure system.
#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:105
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<float> CVarAutoExposureIgnoreMaterialsMinBaseColorLuminance(
TEXT("r.AutoExposure.IgnoreMaterials.MinBaseColorLuminance"),
0.01f,
TEXT(""),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<bool> CVarAutoExposureIgnoreMaterialsUsePrecalculatedIlluminance(
TEXT("r.AutoExposure.IgnoreMaterials.UsePrecalculatedIlluminance"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarAutoExposureIgnoreMaterialsMinBaseColorLuminance
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:104
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
TAutoConsoleVariable<float> CVarAutoExposureIgnoreMaterialsMinBaseColorLuminance(
TEXT("r.AutoExposure.IgnoreMaterials.MinBaseColorLuminance"),
0.01f,
TEXT(""),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<bool> CVarAutoExposureIgnoreMaterialsUsePrecalculatedIlluminance(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:535
Scope (from outer to inner):
file
function FEyeAdaptationParameters GetEyeAdaptationParameters
Source code excerpt:
Parameters.IgnoreMaterialsEvaluationPositionBias = CVarAutoExposureIgnoreMaterialsEvaluationPositionBias.GetValueOnRenderThread();
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();