From 74144d6126e846f69e102fa6c618aa9c3c109945 Mon Sep 17 00:00:00 2001 From: Sergey Lipskiy Date: Sat, 3 Dec 2016 17:34:30 +0700 Subject: [PATCH] Transform vertex normale with modelview matrix when LookAt is not used. Fixed Quake 2 metallic effect in the menu is broken. #1279 --- src/gSP.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gSP.cpp b/src/gSP.cpp index 7b1f6702..45785e85 100644 --- a/src/gSP.cpp +++ b/src/gSP.cpp @@ -576,6 +576,10 @@ void gSPProcessVertex(u32 v) x = DotProduct(&gSP.lookat[0].ix, fLightDir); y = DotProduct(&gSP.lookat[1].ix, fLightDir); } else { + fLightDir[0] *= 128.0f; + fLightDir[1] *= 128.0f; + fLightDir[2] *= 128.0f; + TransformVectorNormalize(fLightDir, gSP.matrix.modelView[gSP.matrix.modelViewi]); x = fLightDir[0]; y = fLightDir[1]; }