Added support for new supersampleScale setting. Old RenderTargetMultiplier setting for applications will not work anymore.

This commit is contained in:
2017-05-19 17:41:39 +02:00
parent 133f3cc379
commit 58cfa8d3a1
3 changed files with 10 additions and 9 deletions
+4 -4
View File
@@ -14,7 +14,7 @@ MyStackViewPage {
spacing: 16
MyText {
text: "Application Supersampling*:"
text: "Application Supersampling:"
Layout.preferredWidth: 350
Layout.rightMargin: 12
}
@@ -30,7 +30,7 @@ MyStackViewPage {
MySlider {
id: steamvrSupersamplingSlider
from: 0.1
to: 2
to: 5.0
stepSize: 0.1
value: 1.0
snapMode: Slider.SnapAlways
@@ -83,8 +83,8 @@ MyStackViewPage {
spacing: 16
MyText {
text: "Compositor Supersampling*:"
Layout.preferredWidth: 350
text: "Compositor Render Target Multiplier*:"
Layout.preferredWidth: 450
Layout.rightMargin: 12
}
+5 -5
View File
@@ -20,9 +20,9 @@ void SteamVRTabController::initStage2(OverlayController * parent, QQuickWindow *
void SteamVRTabController::eventLoopTick() {
if (settingsUpdateCounter >= 50) {
vr::EVRSettingsError vrSettingsError;
auto ss = vr::VRSettings()->GetFloat(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, &vrSettingsError);
auto ss = vr::VRSettings()->GetFloat(vr::k_pch_SteamVR_Section, vrsettings_steamvr_supersampleScale, &vrSettingsError);
if (vrSettingsError != vr::VRSettingsError_None) {
LOG(WARNING) << "Could not read \"" << vr::k_pch_SteamVR_RenderTargetMultiplier_Float << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
LOG(WARNING) << "Could not read \"" << vrsettings_steamvr_supersampleScale << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
if (m_superSampling != 1.0) {
LOG(DEBUG) << "OpenVR returns an error and we have a custom supersampling value: " << m_superSampling;
setSuperSampling(1.0);
@@ -76,7 +76,7 @@ void SteamVRTabController::setSuperSampling(float value, bool notify) {
if (override || m_superSampling != value) {
LOG(DEBUG) << "Supersampling value changed: " << m_superSampling << " => " << value;
m_superSampling = value;
vr::VRSettings()->SetFloat(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, m_superSampling);
vr::VRSettings()->SetFloat(vr::k_pch_SteamVR_Section, vrsettings_steamvr_supersampleScale, m_superSampling);
vr::VRSettings()->Sync();
if (notify) {
emit superSamplingChanged(m_superSampling);
@@ -167,9 +167,9 @@ void SteamVRTabController::setForceReprojection(bool value, bool notify) {
void SteamVRTabController::reset() {
vr::EVRSettingsError vrSettingsError;
vr::VRSettings()->RemoveKeyInSection(vr::k_pch_SteamVR_Section, vr::k_pch_SteamVR_RenderTargetMultiplier_Float, &vrSettingsError);
vr::VRSettings()->RemoveKeyInSection(vr::k_pch_SteamVR_Section, vrsettings_steamvr_supersampleScale, &vrSettingsError);
if (vrSettingsError != vr::VRSettingsError_None) {
LOG(WARNING) << "Could not remove \"" << vr::k_pch_SteamVR_RenderTargetMultiplier_Float << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
LOG(WARNING) << "Could not remove \"" << vrsettings_steamvr_supersampleScale << "\" setting: " << vr::VRSettings()->GetSettingsErrorNameFromEnum(vrSettingsError);
}
setCompositorSuperSampling(1.0f); // Is not in default.vrsettings yet
@@ -7,6 +7,7 @@
//static const char* vrsettings_steamvr_allowAsyncReprojection = "allowAsyncReprojection";
//static const char* vrsettings_steamvr_allowInterleavedReprojection = "allowInterleavedReprojection";
static const char* vrsettings_compositor_category = "compositor";
static const char* vrsettings_steamvr_supersampleScale = "supersampleScale";
class QQuickWindow;