From 6945604492a1e09b05ce5de4aa2e6f67c37d39a6 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Thu, 20 Oct 2022 23:10:56 -0700 Subject: [PATCH] softgpu: Multiply prev normal by world matrix. Even when it's not in the vertex data, we still must multiply by the world matrix. Fixes some lighting issues in Nayuta no Kiseki. --- GPU/Software/TransformUnit.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/GPU/Software/TransformUnit.cpp b/GPU/Software/TransformUnit.cpp index ac52ef180f..043683b88c 100644 --- a/GPU/Software/TransformUnit.cpp +++ b/GPU/Software/TransformUnit.cpp @@ -411,11 +411,9 @@ ClipVertexData TransformUnit::ReadVertex(VertexReader &vreader, const TransformS vertex.v.clipw = vertex.clippos.w; Vec3 worldnormal; - if (vreader.hasNormal()) { + if (state.enableLighting || state.uvGenMode == GE_TEXMAP_ENVIRONMENT_MAP) { worldnormal = TransformUnit::ModelToWorldNormal(normal); worldnormal.NormalizeOr001(); - } else { - worldnormal = Vec3(0.0f, 0.0f, 1.0f); } // Time to generate some texture coords. Lighting will handle shade mapping.