s/DP3/DP3_SAT/ to prevent negative values
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 15 Dec 2004 00:54:17 +0000 (00:54 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 15 Dec 2004 00:54:17 +0000 (00:54 +0000)
progs/demos/arbfplight.c
progs/demos/fplight.c

index 50a1b7e9f32202ecdaa360f6bd099a7a35d732b7..d5508a6aa833d6959710225331202d9cb0f3246b 100644 (file)
@@ -217,7 +217,7 @@ static void Init( void )
       "MUL normal, fragment.texcoord[0], len.y; \n"
 
       "# Compute dot product of light direction and normal vector\n"
-      "DP3 dotProd, lightDir, normal; \n"
+      "DP3_SAT dotProd, lightDir, normal;             # limited to [0,1]\n"
 
       "MUL diffuseColor, Diffuse, dotProd;            # diffuse attenuation\n"
 
index 4f8b42aa96eaf78407fdb6137c0d4a6d57ad4159..6eb77c60ea62a93f877adc139fd1a98e3da4d126 100644 (file)
@@ -180,7 +180,7 @@ static void Init( void )
       "MUL R1, f[TEX0], R1.y;\n"
 
       "# Compute dot product of light direction and normal vector\n"
-      "DP3 R2, R0, R1;"
+      "DP3_SAT R2, R0, R1;"
 
       "MUL R3, Diffuse, R2;    # diffuse attenuation\n"