From bc4d19bff6b9cb2857890c0d6b03857bb330638c Mon Sep 17 00:00:00 2001 From: divverent Date: Tue, 30 Nov 2010 19:18:25 +0000 Subject: [PATCH] fix random white pixels with r_shadow_glossexact caused by unnormalized VectorS/T/R git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10644 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gl_rmain.c b/gl_rmain.c index 356dd378..6156c5c5 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -1677,6 +1677,7 @@ static const char *builtinshaderstring = " lightnormal.x = dot(lightnormal_modelspace, myhalf3(VectorS));\n" " lightnormal.y = dot(lightnormal_modelspace, myhalf3(VectorT));\n" " lightnormal.z = dot(lightnormal_modelspace, myhalf3(VectorR));\n" +" lightnormal = normalize(lightnormal); // VectorS/T/R are not always perfectly normalized, and EXACTSPECULARMATH is very picky about this\n" " // calculate directional shading (and undoing the existing angle attenuation on the lightmap by the division)\n" " // note that q3map2 is too stupid to calculate proper surface normals when q3map_nonplanar\n" " // is used (the lightmap and deluxemap coords correspond to virtually random coordinates\n" -- 2.39.2