]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix random white pixels with r_shadow_glossexact caused by unnormalized VectorS/T/R
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 30 Nov 2010 19:18:25 +0000 (19:18 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 30 Nov 2010 19:26:29 +0000 (20:26 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10644 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=bc4d19bff6b9cb2857890c0d6b03857bb330638c

gl_rmain.c

index 356dd378096a9cb794f316b284ebd64e8b0abc48..6156c5c50e7660df2b5dbb1d12f2b7ed595d1523 100644 (file)
@@ -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"