]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
fix two deluxemap bugs
authorrpolzer <rpolzer@61c419a2-8eb2-4b30-bcec-8cead039b335>
Tue, 30 Sep 2008 13:07:10 +0000 (13:07 +0000)
committerrpolzer <rpolzer@61c419a2-8eb2-4b30-bcec-8cead039b335>
Tue, 30 Sep 2008 13:07:10 +0000 (13:07 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@110 61c419a2-8eb2-4b30-bcec-8cead039b335

tools/quake3/q3map2/light_ydnar.c

index a206a0397c9032bc1b2ed19e2656c6027a67093a..e11f3400b893b453e8453417af071da9da0db5d2 100644 (file)
@@ -2007,7 +2007,11 @@ void IlluminateRawLightmap( int rawLightmapNum )
                                {
                                        VectorCopy( ambientColor, luxel );
                                        if( deluxemap )
-                                               VectorScale( normal, 0.00390625f, deluxel );
+                                       {
+                                               brightness = ambientColor[ 0 ] * 0.3f + ambientColor[ 1 ] * 0.59f + ambientColor[ 2 ] * 0.11f;
+                                               brightness *= (1.0 / 255.0);
+                                               VectorScale( normal, brightness, deluxel );
+                                       }
                                        luxel[ 3 ] = 1.0f;
                                }
                        }
@@ -2374,6 +2378,11 @@ void IlluminateRawLightmap( int rawLightmapNum )
                                        luxel[2]+=flood[2];
 
                                        if (luxel[3]==0) luxel[3]=1;
+
+                                       brightness = flood[ 0 ] * 0.3f + flood[ 1 ] * 0.59f + flood[ 2 ] * 0.11f;
+                                       brightness *= (1.0 / 255.0);
+                                       VectorScale( normal, brightness, temp );
+                                       VectorAdd( deluxel, temp, deluxel );
                                }
                        }
                }