fixed naming bug in QML and formatted/cleaned up
This commit is contained in:
@@ -239,75 +239,6 @@ MyStackViewPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
RowLayout {
|
|
||||||
spacing: 16
|
|
||||||
|
|
||||||
MyText {
|
|
||||||
text: "Compositor Render Target Multiplier*:"
|
|
||||||
Layout.preferredWidth: 450
|
|
||||||
Layout.rightMargin: 12
|
|
||||||
}
|
|
||||||
|
|
||||||
MyPushButton2 {
|
|
||||||
text: "-"
|
|
||||||
Layout.preferredWidth: 40
|
|
||||||
onClicked: {
|
|
||||||
steamvrCompositorSupersamplingSlider.decrease()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MySlider {
|
|
||||||
id: steamvrCompositorSupersamplingSlider
|
|
||||||
from: 0.1
|
|
||||||
to: 2
|
|
||||||
stepSize: 0.1
|
|
||||||
value: 1.0
|
|
||||||
snapMode: Slider.SnapAlways
|
|
||||||
Layout.fillWidth: true
|
|
||||||
onPositionChanged: {
|
|
||||||
var val = this.from + ( this.position * (this.to - this.from))
|
|
||||||
steamvrCompositorSupersamplingText.text = val.toFixed(1)
|
|
||||||
}
|
|
||||||
onValueChanged: {
|
|
||||||
SteamVRTabController.setCompositorSuperSampling(this.value.toFixed(1), false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MyPushButton2 {
|
|
||||||
text: "+"
|
|
||||||
Layout.preferredWidth: 40
|
|
||||||
onClicked: {
|
|
||||||
steamvrCompositorSupersamplingSlider.increase()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
MyTextField {
|
|
||||||
id: steamvrCompositorSupersamplingText
|
|
||||||
text: "0.0"
|
|
||||||
keyBoardUID: 402
|
|
||||||
Layout.preferredWidth: 100
|
|
||||||
Layout.leftMargin: 10
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
function onInputEvent(input) {
|
|
||||||
var val = parseFloat(input)
|
|
||||||
if (!isNaN(val)) {
|
|
||||||
if (val < 0.1) {
|
|
||||||
val = 0.1
|
|
||||||
}
|
|
||||||
var v = val.toFixed(1)
|
|
||||||
if (v <= steamvrCompositorSupersamplingSlider.to) {
|
|
||||||
steamvrCompositorSupersamplingSlider.value = v
|
|
||||||
} else {
|
|
||||||
SteamVRTabController.setCompositorSuperSampling(v, false)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
text = SteamVRTabController.compositorSuperSampling.toFixed(1)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
MyToggleButton {
|
MyToggleButton {
|
||||||
id: steamvrAllowSupersampleFilteringToggle
|
id: steamvrAllowSupersampleFilteringToggle
|
||||||
text: "Enable Advanced Supersample Filtering"
|
text: "Enable Advanced Supersample Filtering"
|
||||||
@@ -362,12 +293,6 @@ MyStackViewPage {
|
|||||||
if (s1 <= steamvrSupersamplingSlider.to) {
|
if (s1 <= steamvrSupersamplingSlider.to) {
|
||||||
steamvrSupersamplingSlider.value = s1
|
steamvrSupersamplingSlider.value = s1
|
||||||
}
|
}
|
||||||
steamvrSupersamplingText.text = s1
|
|
||||||
var s2 = SteamVRTabController.compositorSuperSampling.toFixed(1)
|
|
||||||
if (s2 <= steamvrCompositorSupersamplingSlider.to) {
|
|
||||||
steamvrCompositorSupersamplingSlider.value = s2
|
|
||||||
}
|
|
||||||
steamvrCompositorSupersamplingText.text = s2
|
|
||||||
steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering
|
steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering
|
||||||
steamvrMotionSmoothingToggle.checked = SteamVRTabController.motionSmoothing
|
steamvrMotionSmoothingToggle.checked = SteamVRTabController.motionSmoothing
|
||||||
reloadSteamVRProfiles()
|
reloadSteamVRProfiles()
|
||||||
@@ -382,32 +307,12 @@ MyStackViewPage {
|
|||||||
}
|
}
|
||||||
steamvrSupersamplingText.text = s1
|
steamvrSupersamplingText.text = s1
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
onCompositorSuperSamplingChanged: {
|
|
||||||
var s2 = SteamVRTabController.compositorSuperSampling.toFixed(1)
|
|
||||||
if (s2 <= steamvrCompositorSupersamplingSlider.to && Math.abs(steamvrCompositorSupersamplingSlider.value-s2) > 0.08) {
|
|
||||||
steamvrCompositorSupersamplingSlider.value = s2
|
|
||||||
}
|
|
||||||
steamvrCompositorSupersamplingText.text = s2
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
onAllowSupersampleFilteringChanged: {
|
onAllowSupersampleFilteringChanged: {
|
||||||
steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering
|
steamvrAllowSupersampleFilteringToggle.checked = SteamVRTabController.allowSupersampleFiltering
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
onAllowInterleavedReprojectionChanged: {
|
|
||||||
steamvrAllowInterleavedReprojectionToggle.checked = SteamVRTabController.allowInterleavedReprojection
|
|
||||||
}
|
|
||||||
onAllowAsyncReprojectionChanged: {
|
|
||||||
steamvrAllowAsyncReprojectionToggle.checked = SteamVRTabController.allowAsyncReprojection
|
|
||||||
}
|
|
||||||
onForceReprojectionChanged: {
|
|
||||||
steamvrForceReprojectionToggle.checked = SteamVRTabController.forceReprojection
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
onMotionSmoothingChanged: {
|
onMotionSmoothingChanged: {
|
||||||
steamvrMotionSmoothingToggle.checked = SteamVRTabController.allowMotionSmoothing
|
steamvrMotionSmoothingToggle.checked = SteamVRTabController.motionSmoothing
|
||||||
}
|
}
|
||||||
|
|
||||||
onSteamVRProfilesUpdated: {
|
onSteamVRProfilesUpdated: {
|
||||||
|
|||||||
@@ -29,9 +29,10 @@ namespace advsettings
|
|||||||
// vrsettings_steamvr_allowInterleavedReprojection =
|
// vrsettings_steamvr_allowInterleavedReprojection =
|
||||||
// "allowInterleavedReprojection";
|
// "allowInterleavedReprojection";
|
||||||
|
|
||||||
//static const char* vrsettings_steamvr_supersampleScale = "supersampleScale";
|
// static const char* vrsettings_steamvr_supersampleScale = "supersampleScale";
|
||||||
//static const char* vrsettings_steamvr_allowSupersampleFiltering = "allowSupersampleFiltering";
|
// static const char* vrsettings_steamvr_allowSupersampleFiltering =
|
||||||
//static const char* vrsettings_compositor_category = "compositor";
|
// "allowSupersampleFiltering"; static const char*
|
||||||
|
// vrsettings_compositor_category = "compositor";
|
||||||
|
|
||||||
void SteamVRTabController::initStage1()
|
void SteamVRTabController::initStage1()
|
||||||
{
|
{
|
||||||
@@ -139,16 +140,19 @@ Q_INVOKABLE QString
|
|||||||
return QString::fromStdString( steamvrProfiles[index].profileName );
|
return QString::fromStdString( steamvrProfiles[index].profileName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//TODO DISC does it make any sense to check these settings once every ~ 1second?
|
// TODO DISC does it make any sense to check these settings once every ~
|
||||||
|
// 1second. primary purpose seems to be to re-sync settings if changed via other
|
||||||
|
// means?
|
||||||
void SteamVRTabController::eventLoopTick()
|
void SteamVRTabController::eventLoopTick()
|
||||||
{
|
{
|
||||||
if ( settingsUpdateCounter >= 50 )
|
if ( settingsUpdateCounter >= 50 )
|
||||||
{
|
{
|
||||||
vr::EVRSettingsError vrSettingsError;
|
vr::EVRSettingsError vrSettingsError;
|
||||||
auto ss
|
// checks supersampling and re-synchs if necessary
|
||||||
= vr::VRSettings()->GetFloat( vr::k_pch_SteamVR_Section,
|
auto ss = vr::VRSettings()->GetFloat(
|
||||||
vr::k_pch_SteamVR_SupersampleScale_Float,
|
vr::k_pch_SteamVR_Section,
|
||||||
&vrSettingsError );
|
vr::k_pch_SteamVR_SupersampleScale_Float,
|
||||||
|
&vrSettingsError );
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||||
{
|
{
|
||||||
LOG( WARNING ) << "Could not read \""
|
LOG( WARNING ) << "Could not read \""
|
||||||
@@ -170,10 +174,11 @@ void SteamVRTabController::eventLoopTick()
|
|||||||
<< m_superSampling << " => " << ss;
|
<< m_superSampling << " => " << ss;
|
||||||
setSuperSampling( ss );
|
setSuperSampling( ss );
|
||||||
}
|
}
|
||||||
|
// checks if Supersampling filter is on and changes if it has been
|
||||||
|
// changed elsewhere
|
||||||
auto sf = vr::VRSettings()->GetBool(
|
auto sf = vr::VRSettings()->GetBool(
|
||||||
vr::k_pch_SteamVR_Section,
|
vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
|
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
|
||||||
&vrSettingsError );
|
&vrSettingsError );
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||||
{
|
{
|
||||||
@@ -185,23 +190,23 @@ void SteamVRTabController::eventLoopTick()
|
|||||||
}
|
}
|
||||||
setAllowSupersampleFiltering( sf );
|
setAllowSupersampleFiltering( sf );
|
||||||
|
|
||||||
//Checks if Motion smoothing setting can be read
|
// Checks if Motion smoothing setting can be read and synchs adv
|
||||||
auto ms = vr::VRSettings()->GetBool(
|
// settings to steamvr/openvr
|
||||||
vr::k_pch_SteamVR_Section,
|
auto ms
|
||||||
vr::k_pch_SteamVR_MotionSmoothing_Bool,
|
= vr::VRSettings()->GetBool( vr::k_pch_SteamVR_Section,
|
||||||
&vrSettingsError);
|
vr::k_pch_SteamVR_MotionSmoothing_Bool,
|
||||||
if (vrSettingsError != vr::VRSettingsError_None)
|
&vrSettingsError );
|
||||||
{
|
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||||
LOG(WARNING) << "Could not read \""
|
{
|
||||||
<< vr::k_pch_SteamVR_MotionSmoothing_Bool
|
LOG( WARNING ) << "Could not read \""
|
||||||
<< "\" setting: "
|
<< vr::k_pch_SteamVR_MotionSmoothing_Bool
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
<< "\" setting: "
|
||||||
vrSettingsError);
|
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||||
}
|
vrSettingsError );
|
||||||
setMotionSmoothing(ms);
|
}
|
||||||
|
setMotionSmoothing( ms );
|
||||||
|
|
||||||
settingsUpdateCounter = 0;
|
settingsUpdateCounter = 0;
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -225,7 +230,7 @@ void SteamVRTabController::setSuperSampling( float value, bool notify )
|
|||||||
<< " => " << value;
|
<< " => " << value;
|
||||||
m_superSampling = value;
|
m_superSampling = value;
|
||||||
vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section,
|
vr::VRSettings()->SetFloat( vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_SupersampleScale_Float,
|
vr::k_pch_SteamVR_SupersampleScale_Float,
|
||||||
m_superSampling );
|
m_superSampling );
|
||||||
vr::VRSettings()->Sync();
|
vr::VRSettings()->Sync();
|
||||||
if ( notify )
|
if ( notify )
|
||||||
@@ -234,46 +239,11 @@ void SteamVRTabController::setSuperSampling( float value, bool notify )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
void SteamVRTabController::setCompositorSuperSampling( float value,
|
|
||||||
bool notify )
|
|
||||||
{
|
|
||||||
bool override = false;
|
|
||||||
if ( value <= 0.01f )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Encountered a compositor supersampling value <= "
|
|
||||||
"0.01, setting supersampling to 1.0";
|
|
||||||
value = 1.0f;
|
|
||||||
override = true;
|
|
||||||
}
|
|
||||||
if ( override || m_compositorSuperSampling != value )
|
|
||||||
{
|
|
||||||
LOG( DEBUG ) << "Compositor supersampling value changed: "
|
|
||||||
<< m_compositorSuperSampling << " => " << value;
|
|
||||||
m_compositorSuperSampling = value;
|
|
||||||
vr::VRSettings()->SetFloat(
|
|
||||||
vrsettings_compositor_category,
|
|
||||||
vr::k_pch_SteamVR_RenderTargetMultiplier_Float,
|
|
||||||
m_compositorSuperSampling );
|
|
||||||
vr::VRSettings()->Sync();
|
|
||||||
if ( notify )
|
|
||||||
{
|
|
||||||
emit compositorSuperSamplingChanged( m_compositorSuperSampling );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
float SteamVRTabController::superSampling() const
|
float SteamVRTabController::superSampling() const
|
||||||
{
|
{
|
||||||
return m_superSampling;
|
return m_superSampling;
|
||||||
}
|
}
|
||||||
/*
|
|
||||||
float SteamVRTabController::compositorSuperSampling() const
|
|
||||||
{
|
|
||||||
return m_compositorSuperSampling;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
bool SteamVRTabController::motionSmoothing() const
|
bool SteamVRTabController::motionSmoothing() const
|
||||||
{
|
{
|
||||||
@@ -355,9 +325,10 @@ void SteamVRTabController::setAllowSupersampleFiltering( bool value,
|
|||||||
if ( m_allowSupersampleFiltering != value )
|
if ( m_allowSupersampleFiltering != value )
|
||||||
{
|
{
|
||||||
m_allowSupersampleFiltering = value;
|
m_allowSupersampleFiltering = value;
|
||||||
vr::VRSettings()->SetBool( vr::k_pch_SteamVR_Section,
|
vr::VRSettings()->SetBool(
|
||||||
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
|
vr::k_pch_SteamVR_Section,
|
||||||
m_allowSupersampleFiltering );
|
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
|
||||||
|
m_allowSupersampleFiltering );
|
||||||
vr::VRSettings()->Sync();
|
vr::VRSettings()->Sync();
|
||||||
if ( notify )
|
if ( notify )
|
||||||
{
|
{
|
||||||
@@ -371,37 +342,22 @@ void SteamVRTabController::reset()
|
|||||||
{
|
{
|
||||||
vr::EVRSettingsError vrSettingsError;
|
vr::EVRSettingsError vrSettingsError;
|
||||||
|
|
||||||
vr::VRSettings()->RemoveKeyInSection( vr::k_pch_SteamVR_Section,
|
|
||||||
vr::k_pch_SteamVR_SupersampleScale_Float,
|
|
||||||
&vrSettingsError );
|
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
|
||||||
{
|
|
||||||
LOG( WARNING ) << "Could not remove \""
|
|
||||||
<< vr::k_pch_SteamVR_SupersampleScale_Float << "\" setting: "
|
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
|
||||||
vrSettingsError );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
setCompositorSuperSampling( 1.0f ); // Is not in default.vrsettings yet
|
|
||||||
vr::VRSettings()->RemoveKeyInSection(
|
vr::VRSettings()->RemoveKeyInSection(
|
||||||
vrsettings_compositor_category,
|
vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_RenderTargetMultiplier_Float,
|
vr::k_pch_SteamVR_SupersampleScale_Float,
|
||||||
&vrSettingsError );
|
&vrSettingsError );
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||||
{
|
{
|
||||||
LOG( WARNING ) << "Could not remove \""
|
LOG( WARNING ) << "Could not remove \""
|
||||||
<< vrsettings_compositor_category
|
<< vr::k_pch_SteamVR_SupersampleScale_Float
|
||||||
<< "::" << vr::k_pch_SteamVR_RenderTargetMultiplier_Float
|
|
||||||
<< "\" setting: "
|
<< "\" setting: "
|
||||||
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
<< vr::VRSettings()->GetSettingsErrorNameFromEnum(
|
||||||
vrSettingsError );
|
vrSettingsError );
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
vr::VRSettings()->RemoveKeyInSection(
|
vr::VRSettings()->RemoveKeyInSection(
|
||||||
vr::k_pch_SteamVR_Section,
|
vr::k_pch_SteamVR_Section,
|
||||||
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
|
vr::k_pch_SteamVR_AllowSupersampleFiltering_Bool,
|
||||||
&vrSettingsError );
|
&vrSettingsError );
|
||||||
if ( vrSettingsError != vr::VRSettingsError_None )
|
if ( vrSettingsError != vr::VRSettingsError_None )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ class SteamVRTabController : public QObject
|
|||||||
/*Q_PROPERTY(
|
/*Q_PROPERTY(
|
||||||
float compositorSuperSampling READ compositorSuperSampling WRITE
|
float compositorSuperSampling READ compositorSuperSampling WRITE
|
||||||
setCompositorSuperSampling NOTIFY compositorSuperSamplingChanged )
|
setCompositorSuperSampling NOTIFY compositorSuperSamplingChanged )
|
||||||
*/
|
*/
|
||||||
|
|
||||||
Q_PROPERTY( bool motionSmoothing READ motionSmoothing WRITE
|
Q_PROPERTY( bool motionSmoothing READ motionSmoothing WRITE
|
||||||
setMotionSmoothing NOTIFY motionSmoothingChanged )
|
setMotionSmoothing NOTIFY motionSmoothingChanged )
|
||||||
@@ -44,7 +44,7 @@ private:
|
|||||||
QQuickWindow* widget;
|
QQuickWindow* widget;
|
||||||
|
|
||||||
float m_superSampling = 1.0;
|
float m_superSampling = 1.0;
|
||||||
//float m_compositorSuperSampling = 1.0;
|
// float m_compositorSuperSampling = 1.0;
|
||||||
bool m_motionSmoothing = true;
|
bool m_motionSmoothing = true;
|
||||||
bool m_allowSupersampleFiltering = true;
|
bool m_allowSupersampleFiltering = true;
|
||||||
|
|
||||||
@@ -61,7 +61,7 @@ public:
|
|||||||
void eventLoopTick();
|
void eventLoopTick();
|
||||||
|
|
||||||
float superSampling() const;
|
float superSampling() const;
|
||||||
//float compositorSuperSampling() const;
|
// float compositorSuperSampling() const;
|
||||||
bool motionSmoothing() const;
|
bool motionSmoothing() const;
|
||||||
bool allowSupersampleFiltering() const;
|
bool allowSupersampleFiltering() const;
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setSuperSampling( float value, bool notify = true );
|
void setSuperSampling( float value, bool notify = true );
|
||||||
// void setCompositorSuperSampling( float value, bool notify = true );
|
// void setCompositorSuperSampling( float value, bool notify = true );
|
||||||
void setMotionSmoothing( 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 );
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ public slots:
|
|||||||
|
|
||||||
signals:
|
signals:
|
||||||
void superSamplingChanged( float value );
|
void superSamplingChanged( float value );
|
||||||
//void compositorSuperSamplingChanged( float value );
|
// void compositorSuperSamplingChanged( float value );
|
||||||
void motionSmoothingChanged( bool value );
|
void motionSmoothingChanged( bool value );
|
||||||
void allowSupersampleFilteringChanged( bool value );
|
void allowSupersampleFilteringChanged( bool value );
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user