mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-03-30 22:16:14 -05:00
AutoHDR now uses queried or user settings for HDR
If the user hasn't set a HDR DISPLAY MAX NITS, the first time a game is launched using DirectX11 or 12, the queried display values are saved in the ini Of course user settings always take preference. But for someone that doesn't have the HDR settings set, the correct default value should be set so clipping and those bright neon/fluorescent colors can be avoided.
This commit is contained in:
parent
f9fd18282f
commit
7ac148ee65
|
|
@ -54,8 +54,7 @@ void main()
|
|||
// Find the color luminance (it works better than average)
|
||||
float sdr_ratio = luminance(color.rgb);
|
||||
|
||||
const float display_max_nits = hdr_max_luminance_nits > 0.0 ? hdr_max_luminance_nits : HDR_DISPLAY_MAX_NITS;
|
||||
const float auto_hdr_max_white = max(display_max_nits / (hdr_paper_white_nits / hdr_sdr_white_nits), hdr_sdr_white_nits) / hdr_sdr_white_nits;
|
||||
const float auto_hdr_max_white = max(HDR_DISPLAY_MAX_NITS / (hdr_paper_white_nits / hdr_sdr_white_nits), hdr_sdr_white_nits) / hdr_sdr_white_nits;
|
||||
if (sdr_ratio > AUTO_HDR_SHOULDER_START_ALPHA && AUTO_HDR_SHOULDER_START_ALPHA < 1.0)
|
||||
{
|
||||
const float auto_hdr_shoulder_ratio = 1.0 - (max(1.0 - sdr_ratio, 0.0) / (1.0 - AUTO_HDR_SHOULDER_START_ALPHA));
|
||||
|
|
|
|||
|
|
@ -259,6 +259,7 @@ void PostProcessingConfiguration::LoadOptionsConfiguration()
|
|||
Common::IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||
std::string section = m_current_shader + "-options";
|
||||
bool needs_save = false;
|
||||
|
||||
// We already expect all the options to be marked as "dirty" when we reach here
|
||||
for (auto& it : m_options)
|
||||
|
|
@ -295,10 +296,24 @@ void PostProcessingConfiguration::LoadOptionsConfiguration()
|
|||
it.second.m_float_values = float_values;
|
||||
}
|
||||
}
|
||||
else if (it.second.m_option_name == "HDR_DISPLAY_MAX_NITS" &&
|
||||
g_backend_info.hdr_max_luminance_nits > 0.f)
|
||||
{
|
||||
it.second.m_float_values[0] = g_backend_info.hdr_max_luminance_nits;
|
||||
it.second.m_dirty = true;
|
||||
std::ostringstream queried_value;
|
||||
queried_value.imbue(std::locale("C"));
|
||||
queried_value << g_backend_info.hdr_max_luminance_nits;
|
||||
ini.GetOrCreateSection(section)->Set(it.second.m_option_name, queried_value.str());
|
||||
needs_save = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (needs_save)
|
||||
ini.Save(File::GetUserPath(F_DOLPHINCONFIG_IDX));
|
||||
}
|
||||
|
||||
void PostProcessingConfiguration::SaveOptionsConfiguration()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user