Added support for new supersampleScale setting. Old RenderTargetMultiplier setting for applications will not work anymore.
This commit is contained in:
@@ -14,7 +14,7 @@ MyStackViewPage {
|
|||||||
spacing: 16
|
spacing: 16
|
||||||
|
|
||||||
MyText {
|
MyText {
|
||||||
text: "Application Supersampling*:"
|
text: "Application Supersampling:"
|
||||||
Layout.preferredWidth: 350
|
Layout.preferredWidth: 350
|
||||||
Layout.rightMargin: 12
|
Layout.rightMargin: 12
|
||||||
}
|
}
|
||||||
@@ -30,7 +30,7 @@ MyStackViewPage {
|
|||||||
MySlider {
|
MySlider {
|
||||||
id: steamvrSupersamplingSlider
|
id: steamvrSupersamplingSlider
|
||||||
from: 0.1
|
from: 0.1
|
||||||
to: 2
|
to: 5.0
|
||||||
stepSize: 0.1
|
stepSize: 0.1
|
||||||
value: 1.0
|
value: 1.0
|
||||||
snapMode: Slider.SnapAlways
|
snapMode: Slider.SnapAlways
|
||||||
@@ -83,8 +83,8 @@ MyStackViewPage {
|
|||||||
spacing: 16
|
spacing: 16
|
||||||
|
|
||||||
MyText {
|
MyText {
|
||||||
text: "Compositor Supersampling*:"
|
text: "Compositor Render Target Multiplier*:"
|
||||||
Layout.preferredWidth: 350
|
Layout.preferredWidth: 450
|
||||||
Layout.rightMargin: 12
|
Layout.rightMargin: 12
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,9 @@ void SteamVRTabController::initStage2(OverlayController * parent, QQuickWindow *
|
|||||||
void SteamVRTabController::eventLoopTick() {
|
void SteamVRTabController::eventLoopTick() {
|
||||||
if (settingsUpdateCounter >= 50) {
|
if (settingsUpdateCounter >= 50) {
|
||||||
vr::EVRSettingsError vrSettingsError;
|
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) {
|
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) {
|
if (m_superSampling != 1.0) {
|
||||||
LOG(DEBUG) << "OpenVR returns an error and we have a custom supersampling value: " << m_superSampling;
|
LOG(DEBUG) << "OpenVR returns an error and we have a custom supersampling value: " << m_superSampling;
|
||||||
setSuperSampling(1.0);
|
setSuperSampling(1.0);
|
||||||
@@ -76,7 +76,7 @@ void SteamVRTabController::setSuperSampling(float value, bool notify) {
|
|||||||
if (override || m_superSampling != value) {
|
if (override || m_superSampling != value) {
|
||||||
LOG(DEBUG) << "Supersampling value changed: " << m_superSampling << " => " << value;
|
LOG(DEBUG) << "Supersampling value changed: " << m_superSampling << " => " << value;
|
||||||
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();
|
vr::VRSettings()->Sync();
|
||||||
if (notify) {
|
if (notify) {
|
||||||
emit superSamplingChanged(m_superSampling);
|
emit superSamplingChanged(m_superSampling);
|
||||||
@@ -167,9 +167,9 @@ void SteamVRTabController::setForceReprojection(bool value, bool notify) {
|
|||||||
void SteamVRTabController::reset() {
|
void SteamVRTabController::reset() {
|
||||||
vr::EVRSettingsError vrSettingsError;
|
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) {
|
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
|
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_allowAsyncReprojection = "allowAsyncReprojection";
|
||||||
//static const char* vrsettings_steamvr_allowInterleavedReprojection = "allowInterleavedReprojection";
|
//static const char* vrsettings_steamvr_allowInterleavedReprojection = "allowInterleavedReprojection";
|
||||||
static const char* vrsettings_compositor_category = "compositor";
|
static const char* vrsettings_compositor_category = "compositor";
|
||||||
|
static const char* vrsettings_steamvr_supersampleScale = "supersampleScale";
|
||||||
|
|
||||||
|
|
||||||
class QQuickWindow;
|
class QQuickWindow;
|
||||||
|
|||||||
Reference in New Issue
Block a user