c/render: Remove the hacks

This commit is contained in:
Jakob Bornecrantz 2021-09-01 23:48:39 +01:00 committed by Jakob Bornecrantz
parent 5bff6f3c9b
commit c5c07eced2
2 changed files with 2 additions and 4 deletions

View file

@ -141,15 +141,11 @@ calc_time_warp_matrix(struct comp_rendering_compute *crc,
// Src rotation matrix.
struct xrt_matrix_4x4_f64 src_rot_inv;
struct xrt_quat src_q = src_pose->orientation;
src_q.x = -src_q.x; // I don't know why we need to do this.
src_q.z = -src_q.z; // I don't know why we need to do this.
m_mat4_f64_orientation(&src_q, &src_rot_inv); // This is a model matrix, a inverted view matrix.
// New rotation matrix.
struct xrt_matrix_4x4_f64 new_rot, new_rot_inv;
struct xrt_quat new_q = new_pose->orientation;
new_q.x = -new_q.x; // I don't know why we need to do this.
new_q.z = -new_q.z; // I don't know why we need to do this.
m_mat4_f64_orientation(&new_q, &new_rot_inv); // This is a model matrix, a inverted view matrix.
m_mat4_f64_invert(&new_rot_inv, &new_rot); // Invert to make it a view matrix.

View file

@ -43,6 +43,7 @@ vec2 transform_uv(vec2 uv, uint iz)
// From uv to tan angle (tanget space).
values.xy = values.xy * ubo.pre_transform[iz].zw + ubo.pre_transform[iz].xy;
values.y = -values.y; // Flip to OpenXR coordinate system.
// Timewarp.
values = ubo.transform[iz] * values;
@ -50,6 +51,7 @@ vec2 transform_uv(vec2 uv, uint iz)
// From [-1, 1] to [0, 1]
values.xy = values.xy * 0.5 + 0.5;
values.y = 1 - values.y; // Flip to UV coordinate system.
// To deal with OpenGL flip and sub image view.
values.xy = values.xy * ubo.post_transform[iz].zw + ubo.post_transform[iz].xy;