added Motion Smoothing toggle
This commit is contained in:
@@ -315,6 +315,14 @@ MyStackViewPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MyToggleButton {
|
||||||
|
id: steamvrMotionSmoothingToggle
|
||||||
|
text: "Motion Smoothing"
|
||||||
|
onCheckedChanged: {
|
||||||
|
SteamVRTabController.setMotionSmoothing(this.checked, false)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//No longer Valid
|
//No longer Valid
|
||||||
/*
|
/*
|
||||||
MyToggleButton {
|
MyToggleButton {
|
||||||
@@ -389,6 +397,7 @@ MyStackViewPage {
|
|||||||
//steamvrAllowInterleavedReprojectionToggle.checked = SteamVRTabController.allowInterleavedReprojection
|
//steamvrAllowInterleavedReprojectionToggle.checked = SteamVRTabController.allowInterleavedReprojection
|
||||||
//steamvrAllowAsyncReprojectionToggle.checked = SteamVRTabController.allowAsyncReprojection
|
//steamvrAllowAsyncReprojectionToggle.checked = SteamVRTabController.allowAsyncReprojection
|
||||||
//steamvrForceReprojectionToggle.checked = SteamVRTabController.forceReprojection
|
//steamvrForceReprojectionToggle.checked = SteamVRTabController.forceReprojection
|
||||||
|
steamvrMotionSmoothingToggle.checked = SteamVRTabController.allowMotionSmoothing
|
||||||
reloadSteamVRProfiles()
|
reloadSteamVRProfiles()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,6 +431,11 @@ MyStackViewPage {
|
|||||||
steamvrForceReprojectionToggle.checked = SteamVRTabController.forceReprojection
|
steamvrForceReprojectionToggle.checked = SteamVRTabController.forceReprojection
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
onMotionSmoothingChanged: {
|
||||||
|
steamvrMotionSmoothingToggle.checked = SteamVRTabController.allowMotionSmoothing
|
||||||
|
}
|
||||||
|
|
||||||
onSteamVRProfilesUpdated: {
|
onSteamVRProfilesUpdated: {
|
||||||
reloadSteamVRProfiles()
|
reloadSteamVRProfiles()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ static const char* vrsettings_compositor_category = "compositor";
|
|||||||
|
|
||||||
void SteamVRTabController::initStage1()
|
void SteamVRTabController::initStage1()
|
||||||
{
|
{
|
||||||
|
initMotionSmoothing();
|
||||||
eventLoopTick();
|
eventLoopTick();
|
||||||
reloadSteamVRProfiles();
|
reloadSteamVRProfiles();
|
||||||
}
|
}
|
||||||
@@ -339,6 +340,77 @@ float SteamVRTabController::compositorSuperSampling() const
|
|||||||
{
|
{
|
||||||
return m_compositorSuperSampling;
|
return m_compositorSuperSampling;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool SteamVRTabController::motionSmoothing() const {
|
||||||
|
return m_motionSmoothing;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Name: setMotionSmoothing
|
||||||
|
|
||||||
|
input: bool value, bool notify
|
||||||
|
output: none
|
||||||
|
|
||||||
|
@value - value to be passed to m_motionSMoothing
|
||||||
|
@notify - whether QML is informed of change (default true)
|
||||||
|
|
||||||
|
Description:
|
||||||
|
sets value of m_motionSmoothing AND applies changes in Steam/OpenVr
|
||||||
|
*/
|
||||||
|
|
||||||
|
void SteamVRTabController::setMotionSmoothing(bool value,
|
||||||
|
bool notify)
|
||||||
|
{
|
||||||
|
if (m_motionSmoothing!= value)
|
||||||
|
{
|
||||||
|
m_motionSmoothing = value;
|
||||||
|
vr::VRSettings()->SetBool(vr::k_pch_SteamVR_Section,
|
||||||
|
vr::k_pch_SteamVR_MotionSmoothing_Bool,
|
||||||
|
m_motionSmoothing);
|
||||||
|
vr::VRSettings()->Sync();
|
||||||
|
if (notify)
|
||||||
|
{
|
||||||
|
emit motionSmoothingChanged(
|
||||||
|
m_motionSmoothing);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Name: initMotionSmoothing
|
||||||
|
|
||||||
|
input: none
|
||||||
|
output: none
|
||||||
|
|
||||||
|
description: Gets the Value of Motion Smoothing from Steam/OpenVR.
|
||||||
|
Sets the member variable of motion smoothing for UI
|
||||||
|
Adds error to log if unable to find variable.
|
||||||
|
|
||||||
|
OnError:
|
||||||
|
default value of true for motion smoothing is initialized, if user has disabled motion smoothing on their end,
|
||||||
|
they will have to toggle the variable twice to get it to re-sync.
|
||||||
|
*/
|
||||||
|
void SteamVRTabController::initMotionSmoothing() {
|
||||||
|
bool temporary = false;
|
||||||
|
vr::EVRSettingsError vrSettingsError;
|
||||||
|
temporary = vr::VRSettings()->GetBool(vr::k_pch_SteamVR_Section,
|
||||||
|
vr::k_pch_SteamVR_MotionSmoothing_Bool,
|
||||||
|
&vrSettingsError);
|
||||||
|
if (vrSettingsError != vr::VRSettingsError_None)
|
||||||
|
{
|
||||||
|
LOG(WARNING) << "Could not get MotionSmoothing State \""
|
||||||
|
<< vr::k_pch_SteamVR_MotionSmoothing_Bool << "\" setting: "
|
||||||
|
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||||
|
vrSettingsError);
|
||||||
|
}
|
||||||
|
vr::VRSettings()->Sync();
|
||||||
|
setMotionSmoothing(temporary, true);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
bool SteamVRTabController::allowInterleavedReprojection() const
|
bool SteamVRTabController::allowInterleavedReprojection() const
|
||||||
{
|
{
|
||||||
@@ -527,8 +599,7 @@ void SteamVRTabController::restartSteamVR()
|
|||||||
|
|
||||||
void SteamVRTabController::addSteamVRProfile( QString name,
|
void SteamVRTabController::addSteamVRProfile( QString name,
|
||||||
bool includeSupersampling,
|
bool includeSupersampling,
|
||||||
bool includeSupersampleFiltering,
|
bool includeSupersampleFiltering)
|
||||||
bool includeReprojectionSettings )
|
|
||||||
{
|
{
|
||||||
SteamVRProfile* profile = nullptr;
|
SteamVRProfile* profile = nullptr;
|
||||||
for ( auto& p : steamvrProfiles )
|
for ( auto& p : steamvrProfiles )
|
||||||
|
|||||||
@@ -45,6 +45,10 @@ class SteamVRTabController : public QObject
|
|||||||
Q_PROPERTY( bool forceReprojection READ forceReprojection WRITE
|
Q_PROPERTY( bool forceReprojection READ forceReprojection WRITE
|
||||||
setForceReprojection NOTIFY forceReprojectionChanged )
|
setForceReprojection NOTIFY forceReprojectionChanged )
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Q_PROPERTY(bool motionSmoothing READ motionSmoothing
|
||||||
|
WRITE setMotionSmoothing NOTIFY
|
||||||
|
motionSmoothingChanged)
|
||||||
Q_PROPERTY( bool allowSupersampleFiltering READ allowSupersampleFiltering
|
Q_PROPERTY( bool allowSupersampleFiltering READ allowSupersampleFiltering
|
||||||
WRITE setAllowSupersampleFiltering NOTIFY
|
WRITE setAllowSupersampleFiltering NOTIFY
|
||||||
allowSupersampleFilteringChanged )
|
allowSupersampleFilteringChanged )
|
||||||
@@ -58,8 +62,11 @@ private:
|
|||||||
//bool m_allowInterleavedReprojection = true;
|
//bool m_allowInterleavedReprojection = true;
|
||||||
//bool m_allowAsyncReprojection = true;
|
//bool m_allowAsyncReprojection = true;
|
||||||
//bool m_forceReprojection = false;
|
//bool m_forceReprojection = false;
|
||||||
|
bool m_motionSmoothing = true;
|
||||||
bool m_allowSupersampleFiltering = true;
|
bool m_allowSupersampleFiltering = true;
|
||||||
|
|
||||||
|
void initMotionSmoothing();
|
||||||
|
|
||||||
std::vector<SteamVRProfile> steamvrProfiles;
|
std::vector<SteamVRProfile> steamvrProfiles;
|
||||||
|
|
||||||
unsigned settingsUpdateCounter = 0;
|
unsigned settingsUpdateCounter = 0;
|
||||||
@@ -75,6 +82,7 @@ public:
|
|||||||
//bool allowInterleavedReprojection() const;
|
//bool allowInterleavedReprojection() const;
|
||||||
//bool allowAsyncReprojection() const;
|
//bool allowAsyncReprojection() const;
|
||||||
//bool forceReprojection() const;
|
//bool forceReprojection() const;
|
||||||
|
bool motionSmoothing() const;
|
||||||
bool allowSupersampleFiltering() const;
|
bool allowSupersampleFiltering() const;
|
||||||
|
|
||||||
void reloadSteamVRProfiles();
|
void reloadSteamVRProfiles();
|
||||||
@@ -89,12 +97,12 @@ public slots:
|
|||||||
//void setAllowInterleavedReprojection( bool value, bool notify = true );
|
//void setAllowInterleavedReprojection( bool value, bool notify = true );
|
||||||
//void setAllowAsyncReprojection( bool value, bool notify = true );
|
//void setAllowAsyncReprojection( bool value, bool notify = true );
|
||||||
//void setForceReprojection( bool value, bool notify = true );
|
//void setForceReprojection( bool value, bool notify = true );
|
||||||
|
void setMotionSmoothing(bool value, bool notify = true);
|
||||||
void setAllowSupersampleFiltering( bool value, bool notify = true );
|
void setAllowSupersampleFiltering( bool value, bool notify = true );
|
||||||
|
|
||||||
void addSteamVRProfile( QString name,
|
void addSteamVRProfile( QString name,
|
||||||
bool includeSupersampling,
|
bool includeSupersampling,
|
||||||
bool includeSupersampleFiltering,
|
bool includeSupersampleFiltering);
|
||||||
bool includeReprojectionSettings );
|
|
||||||
void applySteamVRProfile( unsigned index );
|
void applySteamVRProfile( unsigned index );
|
||||||
void deleteSteamVRProfile( unsigned index );
|
void deleteSteamVRProfile( unsigned index );
|
||||||
|
|
||||||
@@ -107,6 +115,7 @@ signals:
|
|||||||
//void allowInterleavedReprojectionChanged( bool value );
|
//void allowInterleavedReprojectionChanged( bool value );
|
||||||
//void allowAsyncReprojectionChanged( bool value );
|
//void allowAsyncReprojectionChanged( bool value );
|
||||||
//void forceReprojectionChanged( bool value );
|
//void forceReprojectionChanged( bool value );
|
||||||
|
void motionSmoothingChanged(bool value);
|
||||||
void allowSupersampleFilteringChanged( bool value );
|
void allowSupersampleFilteringChanged( bool value );
|
||||||
|
|
||||||
void steamVRProfilesUpdated();
|
void steamVRProfilesUpdated();
|
||||||
|
|||||||
Reference in New Issue
Block a user