OpenXR - Gran Turismo projection hack

This commit is contained in:
Lubos 2024-05-10 19:40:13 +02:00
parent 39966730e9
commit e76a5b1d3d
4 changed files with 16 additions and 1 deletions

View File

@ -811,7 +811,9 @@ void UpdateVRParams(float* projMatrix) {
void UpdateVRProjection(float* projMatrix, float* leftEye, float* rightEye) {
float output[16];
for (int i = 0; i < 16; i++) {
if (fabs(projMatrix[i]) > 0) {
if (PSP_CoreParameter().compat.vrCompat().ProjectionHack && ((i == 8) || (i == 9))) {
output[i] = 0;
} else if (fabs(projMatrix[i]) > 0) {
output[i] = vrMatrix[VR_PROJECTION_MATRIX][i];
if ((output[i] > 0) != (projMatrix[i] > 0)) {
output[i] *= -1.0f;

View File

@ -145,6 +145,7 @@ void Compatibility::CheckVRSettings(IniFile &iniFile, const std::string &gameID)
CheckSetting(iniFile, gameID, "ForceMono", &vrCompat_.ForceMono);
CheckSetting(iniFile, gameID, "IdentityViewHack", &vrCompat_.IdentityViewHack);
CheckSetting(iniFile, gameID, "MirroringVariant", &vrCompat_.MirroringVariant);
CheckSetting(iniFile, gameID, "ProjectionHack", &vrCompat_.ProjectionHack);
CheckSetting(iniFile, gameID, "Skyplane", &vrCompat_.Skyplane);
CheckSetting(iniFile, gameID, "UnitsPerMeter", &vrCompat_.UnitsPerMeter);

View File

@ -115,6 +115,7 @@ struct VRCompat {
bool ForceFlatScreen;
bool IdentityViewHack;
int MirroringVariant;
bool ProjectionHack;
bool Skyplane;
float UnitsPerMeter;
};

View File

@ -110,6 +110,17 @@ ULES00035 = 3
ULUS10014 = 3
[ProjectionHack]
# Forces ignoring of projection matrix pivot point.
# Gran Turismo: The Real Driving Simulator
NPJG00027 = true
UCAS40265 = true
UCES01245 = true
UCJS10100 = true
UCUS98632 = true
[Skyplane]
# Workaround to remove the background skyplane and add clearing framebuffer with a fog color.