PostProcessing.cpp
GEtAutoExposureMethod(View)
PostProcessEyeAdaptation.cpp
TAutoConsoleVariable<int32> CVarEyeAdaptationMethodOverride(
TEXT("r.EyeAdaptation.MethodOverride"),
-1,
TEXT("Override the camera metering method set in post processing volumes\n")
TEXT("-2: override with custom settings (for testing Basic Mode)\n")
TEXT("-1: no override\n")
TEXT(" 1: Auto Histogram-based\n")
TEXT(" 2: Auto Basic\n")
TEXT(" 3: Manual"),
ECVF_Scalability | ECVF_RenderThreadSafe);
EAutoExposureMethod GetAutoExposureMethod(const FViewInfo& View)
{
EAutoExposureMethod AutoExposureMethod = View.FinalPostProcessSettings.AutoExposureMethod;
// Fallback to basic if the requested mode is not supported by the feature level.
if (!IsAutoExposureMethodSupported(View.GetFeatureLevel(), AutoExposureMethod))
{
AutoExposureMethod = EAutoExposureMethod::AEM_Basic;
}
const int32 EyeOverride = CVarEyeAdaptationMethodOverride.GetValueOnRenderThread();
EAutoExposureMethod OverrideAutoExposureMethod = AutoExposureMethod;
if (EyeOverride >= 0)
{
// Additional branching for override.
switch (EyeOverride)
{
case 1:
{
OverrideAutoExposureMethod = EAutoExposureMethod::AEM_Histogram;
break;
}
case 2:
{
OverrideAutoExposureMethod = EAutoExposureMethod::AEM_Basic;
break;
}
case 3:
{
OverrideAutoExposureMethod = EAutoExposureMethod::AEM_Manual;
break;
}
}
}
if (IsAutoExposureMethodSupported(View.GetFeatureLevel(), OverrideAutoExposureMethod))
{
AutoExposureMethod = OverrideAutoExposureMethod;
}
// If auto exposure is disabled, revert to manual mode which will clamp to a reasonable default.
if (!View.Family->EngineShowFlags.EyeAdaptation)
{
AutoExposureMethod = AEM_Manual;
}
return AutoExposureMethod;
}