From bcccdeaec859baef596d72adae46c383e51bb3ce Mon Sep 17 00:00:00 2001 From: Rene Lindsay Date: Fri, 12 Aug 2016 17:56:09 -0600 Subject: demos : SAM6 Flip projection matrix, instead of vertex-shader Change-Id: I0000000000decaf15bad0000000000000000006b --- demos/cube.c | 2 ++ demos/cube.vert | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/demos/cube.c b/demos/cube.c index 17617e5e..5c4a6dc7 100644 --- a/demos/cube.c +++ b/demos/cube.c @@ -3040,6 +3040,8 @@ static void demo_init(struct demo *demo, int argc, char **argv) { 1.0f, 0.1f, 100.0f); mat4x4_look_at(demo->view_matrix, eye, origin, up); mat4x4_identity(demo->model_matrix); + + demo->projection_matrix[1][1]*=-1; //Flip projection matrix from GL to Vulkan orientation. } #if defined(VK_USE_PLATFORM_WIN32_KHR) diff --git a/demos/cube.vert b/demos/cube.vert index c09899b4..1e67f758 100644 --- a/demos/cube.vert +++ b/demos/cube.vert @@ -37,8 +37,4 @@ void main() { texcoord = ubuf.attr[gl_VertexIndex]; gl_Position = ubuf.MVP * ubuf.position[gl_VertexIndex]; - - // GL->VK conventions - gl_Position.y = -gl_Position.y; - gl_Position.z = (gl_Position.z + gl_Position.w) / 2.0; } -- cgit v1.2.3