1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Correct vertex Z calculation in GraphicsDrawer::_drawThickLine

Note: viewport transformation of Z coordinate performed in fragment shader.

Fixed #2237 Mario Artist - Polygon Studio: line3D bug (HLE)
This commit is contained in:
Sergey Lipskiy 2020-06-28 17:33:35 +07:00
parent 1b36d5740b
commit 80b219effa

View File

@ -946,13 +946,13 @@ void GraphicsDrawer::_drawThickLine(int _v0, int _v1, float _width)
pVtx[0] = triangles.vertices[_v0];
pVtx[0].x = pVtx[0].x / pVtx[0].w * gSP.viewport.vscale[0] + gSP.viewport.vtrans[0];
pVtx[0].y = ySign * pVtx[0].y / pVtx[0].w * gSP.viewport.vscale[1] + gSP.viewport.vtrans[1];
pVtx[0].z = pVtx[0].z / pVtx[0].w * gSP.viewport.vscale[2] + gSP.viewport.vtrans[2];
pVtx[0].z = pVtx[0].z / pVtx[0].w;
pVtx[1] = pVtx[0];
pVtx[2] = triangles.vertices[_v1];
pVtx[2].x = pVtx[2].x / pVtx[2].w * gSP.viewport.vscale[0] + gSP.viewport.vtrans[0];
pVtx[2].y = ySign * pVtx[2].y / pVtx[2].w * gSP.viewport.vscale[1] + gSP.viewport.vtrans[1];
pVtx[2].z = pVtx[2].z / pVtx[2].w * gSP.viewport.vscale[2] + gSP.viewport.vtrans[2];
pVtx[2].z = pVtx[2].z / pVtx[2].w;
pVtx[3] = pVtx[2];
if (fabs(pVtx[0].y - pVtx[2].y) < 0.0001) {