1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Fix geometry clipping problem for GL ES.

NoN - no near clipping.
GL ES does not support z-clipping disabling, so harmless hack used here.
Harmlessness condition: z value is not used by pixel pipeline.
gDP.otherMode.depthCompare == 0 && gDP.otherMode.depthUpdate == 0 - z not used for depth compare/update.
Thus we can set vertex z to any value, which will ensure that z/w is in range [-1, 1], e.g. to zero.

Fixed issue #588
This commit is contained in:
Sergey Lipskiy 2015-07-03 15:02:04 +06:00
parent c50b3c8c1d
commit d8817013cd

View File

@ -318,6 +318,15 @@ void OGLRender::addTriangle(int _v0, int _v1, int _v2)
vtx.z = gDP.primDepth.z * vtx.w;
}
}
#ifdef GLESX
if (GBI.isNoN() && gDP.otherMode.depthCompare == 0 && gDP.otherMode.depthUpdate == 0) {
for (u32 i = triangles.num - 3; i < triangles.num; ++i) {
SPVertex & vtx = triangles.vertices[triangles.elements[i]];
vtx.z = 0.0f;
}
}
#endif
}
void OGLRender::_setBlendMode() const