From: divverent Date: Tue, 30 Nov 2010 19:18:25 +0000 (+0000) Subject: fix random white pixels with r_shadow_glossexact caused by unnormalized VectorS/T/R X-Git-Tag: xonotic-v0.5.0~438^2~197 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=bc4d19bff6b9cb2857890c0d6b03857bb330638c;p=xonotic%2Fdarkplaces.git 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 --- 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"