From 3dbfa7373485f6497ceb51a462f12346d268c572 Mon Sep 17 00:00:00 2001 From: Ian Curtis Date: Wed, 19 Sep 2018 20:43:41 +0000 Subject: [PATCH] Both lemans24 and dirt devils are rendering some totally transparent objects as the first model in each viewport. The HW seems to skip these entirely, and including them breaks our near/far plane calculations leading to Z fighting. --- Src/Graphics/New3D/New3D.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Src/Graphics/New3D/New3D.cpp b/Src/Graphics/New3D/New3D.cpp index c7a8d20..639d453 100644 --- a/Src/Graphics/New3D/New3D.cpp +++ b/Src/Graphics/New3D/New3D.cpp @@ -926,6 +926,13 @@ void CNew3D::RenderViewport(UINT32 addr) void CNew3D::CopyVertexData(const R3DPoly& r3dPoly, std::vector& vertexArray) { + // both lemans 24 and dirt devils are rendering some totally transparent polys as the first object in each viewport + // in dirt devils it's parallel to the camera so is completel invisible, but breaks our depth calculation + // in lemans 24 its a sort of diamond shape, but never leaves a hole in the transparent geometry so must be being skipped by the h/w + if (r3dPoly.faceColour[3] == 0) { + return; + } + if (m_numPolyVerts==4) { if (r3dPoly.number == 4) { vertexArray.emplace_back(r3dPoly, 0); // construct directly inside container without copy