]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
fix deluxemap when lit from the wrong side as good as possible (by ignoring the delux...
authorrpolzer <rpolzer@61c419a2-8eb2-4b30-bcec-8cead039b335>
Tue, 30 Sep 2008 13:29:31 +0000 (13:29 +0000)
committerrpolzer <rpolzer@61c419a2-8eb2-4b30-bcec-8cead039b335>
Tue, 30 Sep 2008 13:29:31 +0000 (13:29 +0000)
cull none + deluxemapping still is broken by design, but less broken now.

git-svn-id: svn://svn.icculus.org/netradiant/trunk@111 61c419a2-8eb2-4b30-bcec-8cead039b335

tools/quake3/q3map2/light_ydnar.c

index e11f3400b893b453e8453417af071da9da0db5d2..801ef5ac240c681afa7f8c173948314bcc4e5577 100644 (file)
@@ -2101,11 +2101,14 @@ void IlluminateRawLightmap( int rawLightmapNum )
                                        /* add to light direction map (fixme: use luxel normal as starting point for deluxel?) */
                                        if( deluxemap )
                                        {
-                                               /* color to grayscale (photoshop rgb weighting) */
-                                               brightness = trace.color[ 0 ] * 0.3f + trace.color[ 1 ] * 0.59f + trace.color[ 2 ] * 0.11f;
-                                               brightness *= (1.0 / 255.0);
-                                               VectorScale( trace.direction, brightness, trace.direction );
-                                               VectorAdd( deluxel, trace.direction, deluxel );
+                                               if(DotProduct(normal, trace.direction) > 0) // do not take light from the back side
+                                               {
+                                                       /* color to grayscale (photoshop rgb weighting) */
+                                                       brightness = trace.color[ 0 ] * 0.3f + trace.color[ 1 ] * 0.59f + trace.color[ 2 ] * 0.11f;
+                                                       brightness *= (1.0 / 255.0);
+                                                       VectorScale( trace.direction, brightness, trace.direction );
+                                                       VectorAdd( deluxel, trace.direction, deluxel );
+                                               }
                                        }
                                }
                        }