r.AutoExposure.IgnoreMaterials.LuminanceScale
r.AutoExposure.IgnoreMaterials.LuminanceScale
#Overview
name: r.AutoExposure.IgnoreMaterials.LuminanceScale
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.LuminanceScale is to control the luminance scaling factor for materials that should be ignored in the auto-exposure calculation of the rendering system.
This setting variable is primarily used in the rendering subsystem of Unreal Engine 5, specifically in the post-processing module responsible for eye adaptation (auto-exposure).
The value of this variable is set through a console variable (CVar) system. It is initialized with a default value of 0.18f in the C++ code, but can be modified at runtime through console commands or configuration files.
The associated variable CVarAutoExposureIgnoreMaterialsLuminanceScale directly interacts with r.AutoExposure.IgnoreMaterials.LuminanceScale. They share the same value and purpose.
Developers must be aware that this variable affects the auto-exposure calculation, which can significantly impact the overall brightness and contrast of the rendered scene. Modifying this value can change how the engine handles the luminance of certain materials during exposure adaptation.
Best practices when using this variable include:
- Use it cautiously, as it can affect the visual quality of your scene.
- Test thoroughly with different lighting conditions to ensure desired results.
- Consider performance implications, as it’s used in render-thread operations.
- Document any custom values used in your project for consistency.
Regarding the associated variable CVarAutoExposureIgnoreMaterialsLuminanceScale:
- It’s a TAutoConsoleVariable
type, allowing for runtime modification. - It’s used in the GetEyeAdaptationParameters function to set the IgnoreMaterialsLuminanceScale parameter.
- When modifying this variable, be aware that changes will take effect on the render thread, which may not be immediate.
- Always use the GetValueOnRenderThread() method when accessing this variable in render-thread contexts to ensure thread-safety.
#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:99
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
TAutoConsoleVariable<float> CVarAutoExposureIgnoreMaterialsLuminanceScale(
TEXT("r.AutoExposure.IgnoreMaterials.LuminanceScale"),
0.18f,
TEXT(""),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<float> CVarAutoExposureIgnoreMaterialsMinBaseColorLuminance(
TEXT("r.AutoExposure.IgnoreMaterials.MinBaseColorLuminance"),
#Associated Variable and Callsites
This variable is associated with another variable named CVarAutoExposureIgnoreMaterialsLuminanceScale
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:98
Scope (from outer to inner):
file
namespace anonymous
Source code excerpt:
ECVF_RenderThreadSafe);
TAutoConsoleVariable<float> CVarAutoExposureIgnoreMaterialsLuminanceScale(
TEXT("r.AutoExposure.IgnoreMaterials.LuminanceScale"),
0.18f,
TEXT(""),
ECVF_RenderThreadSafe);
TAutoConsoleVariable<float> CVarAutoExposureIgnoreMaterialsMinBaseColorLuminance(
#Loc: <Workspace>/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessEyeAdaptation.cpp:534
Scope (from outer to inner):
file
function FEyeAdaptationParameters GetEyeAdaptationParameters
Source code excerpt:
Parameters.LuminanceMax = LuminanceMax;
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();