diff --git a/Common/VR/PPSSPPVR.cpp b/Common/VR/PPSSPPVR.cpp index eff2c37525..5cd35fc590 100644 --- a/Common/VR/PPSSPPVR.cpp +++ b/Common/VR/PPSSPPVR.cpp @@ -655,7 +655,8 @@ bool Is2DVRObject(float* projMatrix, bool ortho) { void UpdateVRParams(float* projMatrix, float* viewMatrix) { // Set mirroring of axes - if (!vrMirroring[VR_MIRRORING_UPDATED] && !IsMatrixIdentity(projMatrix) && !IsMatrixIdentity(viewMatrix)) { + bool identityView = PSP_CoreParameter().compat.vrCompat().IdentityViewHack && IsMatrixIdentity(viewMatrix); + if (!vrMirroring[VR_MIRRORING_UPDATED] && !IsMatrixIdentity(projMatrix) && !identityView) { vrMirroring[VR_MIRRORING_UPDATED] = true; vrMirroring[VR_MIRRORING_AXIS_X] = projMatrix[0] < 0; vrMirroring[VR_MIRRORING_AXIS_Y] = projMatrix[5] < 0; @@ -697,7 +698,7 @@ void UpdateVRView(float* leftEye, float* rightEye) { for (int index = 0; index < 2; index++) { // Validate the view matrix - if (IsMatrixIdentity(dst[index])) { + if (PSP_CoreParameter().compat.vrCompat().IdentityViewHack && IsMatrixIdentity(dst[index])) { return; } diff --git a/Core/Compatibility.cpp b/Core/Compatibility.cpp index 21fb578456..b09eb67c14 100644 --- a/Core/Compatibility.cpp +++ b/Core/Compatibility.cpp @@ -122,6 +122,7 @@ void Compatibility::CheckSettings(IniFile &iniFile, const std::string &gameID) { } void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID) { + CheckSetting(iniFile, gameID, "IdentityViewHack", &vrCompat_.IdentityViewHack); CheckSetting(iniFile, gameID, "Skyplane", &vrCompat_.Skyplane); CheckSetting(iniFile, gameID, "UnitsPerMeter", &vrCompat_.UnitsPerMeter); diff --git a/Core/Compatibility.h b/Core/Compatibility.h index c37541ce7a..86d139a536 100644 --- a/Core/Compatibility.h +++ b/Core/Compatibility.h @@ -93,6 +93,7 @@ struct CompatFlags { }; struct VRCompat { + bool IdentityViewHack; bool Skyplane; float UnitsPerMeter; }; diff --git a/assets/compatvr.ini b/assets/compatvr.ini index b54081f4f5..b896196ab8 100644 --- a/assets/compatvr.ini +++ b/assets/compatvr.ini @@ -30,6 +30,18 @@ # ======================================================================================== +[IdentityViewHack] +# Disables head tracking for render passes where view matrix is Identity + +# Sonic Rivals 1 +ULES00622 = true +ULUS10195 = true + +# Sonic Rivals 2 +ULES00940 = true +ULUS10323 = true + + [Skyplane] # Workaround to remove the background skyplane and add clearing framebuffer with a fog color. @@ -53,6 +65,7 @@ ULJM05395 = true ULJM05884 = true ULUS10160 = true + [UnitsPerMeter] # Scale of game world to convert the world units into meters. This enables following VR features: # + 3D stereoscopy (that can work only with accurate values)