]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
fix dotproduct2
authorrpolzer <rpolzer@61c419a2-8eb2-4b30-bcec-8cead039b335>
Tue, 23 Sep 2008 14:56:52 +0000 (14:56 +0000)
committerrpolzer <rpolzer@61c419a2-8eb2-4b30-bcec-8cead039b335>
Tue, 23 Sep 2008 14:56:52 +0000 (14:56 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@100 61c419a2-8eb2-4b30-bcec-8cead039b335

tools/quake3/q3map2/shaders.c

index da86549431403ee9496eb037d19594750d85ceee..0dfa2daa862ce51ae2f28edd6aab93290c09aef0 100644 (file)
@@ -123,7 +123,7 @@ void ColorMod( colorMod_t *cm, int numVerts, bspDrawVert_t *drawVerts )
                                case CM_COLOR_DOT_PRODUCT_2_SCALE:
                                        c = DotProduct( dv->normal, cm2->data );
                                        c *= c;
-                                       c = cm2->data[4] + c * (cm2->data[5] - cm2->data[4]);
+                                       c = (c - cm2->data[4]) / (cm2->data[5] - cm2->data[4]);
                                        VectorSet( mult, c, c, c );
                                        break;
                                
@@ -135,7 +135,7 @@ void ColorMod( colorMod_t *cm, int numVerts, bspDrawVert_t *drawVerts )
                                case CM_ALPHA_DOT_PRODUCT_2_SCALE:
                                        c = DotProduct( dv->normal, cm2->data );
                                        c *= c;
-                                       c = cm2->data[4] + c * (cm2->data[5] - cm2->data[4]);
+                                       c = (c - cm2->data[4]) / (cm2->data[5] - cm2->data[4]);
                                        mult[ 3 ] = c;
                                        break;