From 05fd1d5c2926d9fff2da1555a0659e30f375ea7c Mon Sep 17 00:00:00 2001 From: Samuliak Date: Tue, 2 Jul 2024 19:55:40 +0200 Subject: [PATCH] fix: incorrect z position --- src/host_shaders/metal_shaders.metal | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/host_shaders/metal_shaders.metal b/src/host_shaders/metal_shaders.metal index 39eaf31f..37f7892d 100644 --- a/src/host_shaders/metal_shaders.metal +++ b/src/host_shaders/metal_shaders.metal @@ -90,10 +90,9 @@ vertex DrawVertexOut vertexDraw(DrawVertexIn in [[stage_in]], constant PicaRegs& // Flip the y position out.position.y = -out.position.y; // in.position.z is in range of [-1 ... 1], convert it to [0 ... 1] - //out.position.xyz /= out.position.w; - //out.position.w = 1.0; - // HACK - out.position.z = 0.5;//(in.position.z + 1.0) * 0.5; + out.position.xyz /= out.position.w; + out.position.w = 1.0; + out.position.z = (out.position.z + 1.0) * 0.5; // Color out.color = in.color;