summaryrefslogtreecommitdiff
path: root/servers/rendering
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2021-06-15 20:39:11 +1000
committerBastiaan Olij <mux213@gmail.com>2021-06-19 19:33:40 +1000
commitb1bbbb44394963d39ec313b29c35dbba75caacb5 (patch)
treea4ac67cf5c39cfb5b0a089fd3273f04272b57f80 /servers/rendering
parent655516c7580bda855217369d879b165f65aec37e (diff)
Inverse XR camera offset for stereoscopic rendering
Diffstat (limited to 'servers/rendering')
-rw-r--r--servers/rendering/renderer_scene_render.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/servers/rendering/renderer_scene_render.cpp b/servers/rendering/renderer_scene_render.cpp
index 3aa97f4084..3a230ac89d 100644
--- a/servers/rendering/renderer_scene_render.cpp
+++ b/servers/rendering/renderer_scene_render.cpp
@@ -175,7 +175,7 @@ void RendererSceneRender::CameraData::set_multiview_camera(uint32_t p_view_count
/////////////////////////////////////////////////////////////////////////////
// 3. Copy our view data
for (uint32_t v = 0; v < view_count; v++) {
- view_offset[v] = p_transforms[v] * main_transform_inv;
- view_projection[v] = p_projections[v] * CameraMatrix(view_offset[v]);
+ view_offset[v] = main_transform_inv * p_transforms[v];
+ view_projection[v] = p_projections[v] * CameraMatrix(view_offset[v].inverse());
}
}