Merge pull request #49615 from BastiaanOlij/inverse_xr_camera_offset

Inverse XR camera offset for stereoscopic rendering
This commit is contained in:
Bastiaan Olij 2021-06-19 20:19:53 +10:00 committed by GitHub
commit 0a6a71973e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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());
}
}