]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix bug with deluxemapping (I thought GLSL had a recip function but it
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 20 Dec 2009 07:26:01 +0000 (07:26 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 20 Dec 2009 07:26:01 +0000 (07:26 +0000)
does not)

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9595 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 8353ecec6b177bffcbf6223020492cc1b0487485..2bb2e5e8935dbab2b871d1b2032ae1687c61deea 100644 (file)
@@ -1497,7 +1497,7 @@ static const char *builtinshaderstring =
 "      // are added up. To prevent divisions by zero or strong exaggerations, a max()\n"
 "      // nudge is done here at expense of some additional fps. This is ONLY needed for\n"
 "      // deluxemaps, tangentspace deluxemap avoid this problem by design.\n"
-"      lightcolor *= recip(max(0.25, lightnormal.z));\n"
+"      lightcolor *= 1.0 / max(0.25, lightnormal.z);\n"
 "#endif // MODE_LIGHTDIRECTIONMAP_MODELSPACE\n"
 "#ifdef MODE_LIGHTDIRECTIONMAP_TANGENTSPACE\n"
 "#define SHADING\n"