mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-16 18:59:48 +12:00
transform z position coordinate
This commit is contained in:
parent
4bc19e8e43
commit
c93b1fa606
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue