Skip to content

Commit 7e13e5d

Browse files
author
luoqi
committed
request force right_fov sync every 100 frames
1 parent afae87f commit 7e13e5d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/mods/vr/runtimes/OpenXR.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,9 +553,13 @@ VRRuntime::Error OpenXR::update_matrices(float nearz, float farz) {
553553
};
554554
};
555555

556+
static long int frame_count = -1;
557+
frame_count++;
558+
559+
556560
// if we've not yet derived an eye projection matrix, or we've changed the projection, derive it here
557561
// Hacky way to check for an uninitialised eye matrix - is there something better, is this necessary?
558-
if (this->should_recalculate_eye_projections || this->last_eye_matrix_nearz != nearz || this->projections[0][2][3] == 0) {
562+
if (this->should_recalculate_eye_projections || this->last_eye_matrix_nearz != nearz || this->projections[0][2][3] == 0 || frame_count % 100 == 0) {
559563
// deriving the texture bounds when modifying projections requires left and right raw projections so get them all before we start:
560564
std::unique_lock __{this->eyes_mtx};
561565
const auto& left_fov = this->views[0].fov;

0 commit comments

Comments
 (0)