From 21bd4d7fe09c7291c6309bd230cfef7ea98ede99 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Mon, 28 Feb 2022 17:34:00 +0100 Subject: [PATCH] ray:: uProjection is now always taken as a 4x4 matrix --- raycaster.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/raycaster.cpp b/raycaster.cpp index e9f25a0d..066bf7db 100644 --- a/raycaster.cpp +++ b/raycaster.cpp @@ -2493,24 +2493,27 @@ EX void cast() { #if CAP_VR if(o->uEyeShift != -1) { + dynamicval g(geometry, gCubeTiling); transmatrix T = vrhr::eyeshift; if(nonisotropic) T = inverse(NLP) * T; - glUniformMatrix4fv(o->uEyeShift, 1, 0, glhr::tmtogl_transpose3(T).as_array()); + glUniformMatrix4fv(o->uEyeShift, 1, 0, glhr::tmtogl_transpose(T).as_array()); glUniform1f(o->uAbsUnit, vrhr::absolute_unit_in_meters); } if(vrhr::rendering_eye()) { - glUniformMatrix4fv(o->uProjection, 1, 0, glhr::tmtogl_transpose3(vrhr::eyeproj).as_array()); + dynamicval g(geometry, gCubeTiling); + glUniformMatrix4fv(o->uProjection, 1, 0, glhr::tmtogl_transpose(vrhr::eyeproj).as_array()); } #else if(0) ; #endif else { + dynamicval g(geometry, gCubeTiling); transmatrix proj = Id; proj = eupush(-global_projection * d, 0) * proj; proj = euscale(cd->tanfov / (vid.stereo_mode == sLR ? 2 : 1), cd->tanfov * cd->ysize / cd->xsize) * proj; proj = eupush(-((cd->xcenter-cd->xtop)*2./cd->xsize - 1), -((cd->ycenter-cd->ytop)*2./cd->ysize - 1)) * proj; - glUniformMatrix4fv(o->uProjection, 1, 0, glhr::tmtogl_transpose3(proj).as_array()); + glUniformMatrix4fv(o->uProjection, 1, 0, glhr::tmtogl_transpose(proj).as_array()); } if(!callhandlers(false, hooks_rayset, o)) {