]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - r_light.c
patch from div0 to add -sndmono and -sndstereo options to sdl sound code
[xonotic/darkplaces.git] / r_light.c
index 5c69018b3f2309f8283a65c1c54395b85cbc4542..69b5097e425b3a4aab7afa817eb449afdc18abd1 100644 (file)
--- a/r_light.c
+++ b/r_light.c
@@ -387,9 +387,11 @@ void R_LightModel_CalcVertexColors(const float *ambientcolor4f, const float *dif
                // silly directional diffuse shading
                if (usediffuse)
                {
+                       // we have to negate this result because it is the incoming light
+                       // direction, not simply the normal to dotproduct with.
                        dot = DotProduct(normal3f, dnormal);
-                       if (dot > 0)
-                               VectorMA(color, dot, diffusecolor, color);
+                       if (dot < 0)
+                               VectorMA(color, -dot, diffusecolor, color);
                }
 
                // pretty good lighting