transform z position coordinate

This commit is contained in:
Samuliak 2024-07-02 10:10:20 +02:00
parent 4bc19e8e43
commit c93b1fa606

View file

@ -30,7 +30,9 @@ struct DrawVertexOut {
vertex DrawVertexOut vertexDraw(DrawVertexIn in [[stage_in]]) { vertex DrawVertexOut vertexDraw(DrawVertexIn in [[stage_in]]) {
DrawVertexOut out; DrawVertexOut out;
out.position = float4(in.position.xy, 0.0, 1.0); // HACK out.position = in.position;
// in.position.z is in range of [-1 ... 1], convert it to [0 ... 1]
out.position.z = (in.position.z + 1.0) * 0.5;
out.color = in.color; out.color = in.color;
return out; return out;