mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2025-03-06 14:27:44 +00:00
The hardware actually seems to treat the quad primitive as a triangle strip. The winding order can actually change between the first and second 'triangle' inside the quad, leading our code to incorrectly backface cull the 2nd triangle. So we must re-calculate the winding order for the 2nd triangle. This fixes a massive missing poly in the road in la machine guns, probably other games too. The hardware is unaffected by the winding order, as it doesn't calculate the poly normal from the vertices directly, instead it uses the provided normal in the poly header.
This commit is contained in:
parent
5b9741bd5d
commit
f173c3c3ce
|
@ -868,6 +868,11 @@ void CNew3D::CopyVertexData(const R3DPoly& r3dPoly, std::vector<Poly>& polyArray
|
|||
|
||||
if (r3dPoly.number == 4) {
|
||||
|
||||
V3::createNormal(r3dPoly.v[0].pos, r3dPoly.v[2].pos, r3dPoly.v[3].pos, normal);
|
||||
|
||||
dotProd = V3::dotProduct(normal, r3dPoly.faceNormal);
|
||||
clockWise = dotProd >= 0;
|
||||
|
||||
if (clockWise) {
|
||||
p.p1 = r3dPoly.v[0];
|
||||
p.p2 = r3dPoly.v[2];
|
||||
|
|
Loading…
Reference in a new issue