adjusted profiles and switched to cubed root for linearization of brightness

This commit is contained in:
ykeara
2019-04-12 18:18:49 -05:00
parent ae800e6f3a
commit e2e68ecc89
2 changed files with 14 additions and 2 deletions
+13 -2
View File
@@ -67,8 +67,9 @@ namespace advsettings
settings->beginGroup(getSettingsName());
setBrightnessEnabled(settings->value("brightnessEnabled", false).toBool(), true);
m_opacityValue = settings->value("opacityValue", 0.0f).toFloat();
setBrightnessValue(settings->value("brightnessValue", 1.0f).toFloat(), true);
m_brightnessValue=settings->value("brightnessValue", 1.0f).toFloat();
settings->endGroup();
setOpacityValue();
}
@@ -130,7 +131,7 @@ namespace advsettings
{
//This takes the Perceived value, and converts it to allow more accurate linear positioning. (human perception logarithmic)
float realvalue = static_cast<float>(sqrt(static_cast<double>(1.0f - percvalue)));
float realvalue = static_cast<float>(std::pow(static_cast<double>(1.0f - percvalue), 1/3.));
if (realvalue != m_opacityValue)
{
@@ -158,4 +159,14 @@ namespace advsettings
}
}
}
void VideoTabController::setOpacityValue() {
vr::VROverlayError overlayError = vr::VROverlay()->SetOverlayAlpha(m_brightnessNotificationOverlayHandle, m_opacityValue);
if (overlayError != vr::VROverlayError_None) {
LOG(ERROR) << "Could not set alpha: "
<< vr::VROverlay()->GetOverlayErrorNameFromEnum(
overlayError);
}
emit brightnessValueChanged(m_brightnessValue);
}
}