aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRene Lindsay <rene@lunarg.com>2016-08-12 17:56:09 -0600
committerRene Lindsay <rene@lunarg.com>2016-08-12 18:01:03 -0600
commitbcccdeaec859baef596d72adae46c383e51bb3ce (patch)
treeac2b2841380418b6cb9c0f1eeb38914c014fd997
parent84560642e88ab57ea40325bf21376a7305e7f29f (diff)
downloadusermoji-bcccdeaec859baef596d72adae46c383e51bb3ce.tar.xz
demos : SAM6 Flip projection matrix, instead of vertex-shader
Change-Id: I0000000000decaf15bad0000000000000000006b
-rw-r--r--demos/cube.c2
-rw-r--r--demos/cube.vert4
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;
}