From ecaa961850f44f7d70ade7f92bc2c5206276f03c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 2 Oct 2026 07:11:17 -0600 Subject: [PATCH] SoftGPU: A zero normal gets no diffuse or specular It used (0, 0, 1) instead. The PSP keeps it zero, under every light kind and type (gpu/probe exp173). SOCOM (UCES01242) lights meshes whose s8 normals are all zero; its PSP replay becomes exact. Co-Authored-By: Claude Opus 5.5 (1M context) --- GPU/Software/TransformUnit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GPU/Software/TransformUnit.cpp b/GPU/Software/TransformUnit.cpp index c9846330b9..357accce6d 100644 --- a/GPU/Software/TransformUnit.cpp +++ b/GPU/Software/TransformUnit.cpp @@ -537,9 +537,11 @@ ClipVertexData TransformUnit::ReadVertex(const VertexReader &vreader, const Tran const float len2 = GEDot(worldnormal, worldnormal); if (len2 > 0.0f && std::isfinite(len2)) { normalRsqrt = GERsqrt(len2); - } else { + } else if (len2 != 0.0f) { worldnormal = Vec3f(0.0f, 0.0f, 1.0f); } + // A zero normal stays zero: no diffuse or specular from any light (gpu/probe exp173; SOCOM + // UCES01242 has meshes without normals but lit). } // Time to generate some texture coords. Lighting will handle shade mapping.