]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
fix a small math error in -samples causing it to only ever consider 2/3 of the length...
authorRudolf Polzer <divverent@alientrap.org>
Tue, 21 Sep 2010 20:04:55 +0000 (22:04 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 21 Sep 2010 20:04:55 +0000 (22:04 +0200)
tools/quake3/q3map2/light_ydnar.c

index 0026fecbee7dda76e0a1cee48ac6e0c13eec9828..81c04df1ee4bfaa5b103220ae218fba167199f94 100644 (file)
@@ -1834,7 +1834,7 @@ static void SubsampleRawLuxel_r( rawLightmap_t *lm, trace_t *trace, vec3_t sampl
                {
                        if( cluster[ b ] < 0 )
                                continue;
-                       SubsampleRawLuxel_r( lm, trace, origin[ b ], x, y, (bias * 0.25f), luxel[ b ] );
+                       SubsampleRawLuxel_r( lm, trace, origin[ b ], x, y, (bias / 3.0f), luxel[ b ] );
                }
        }
        
@@ -2203,7 +2203,8 @@ void IlluminateRawLightmap( int rawLightmapNum )
                                                                //%             continue;
                                                                
                                                                /* subsample it */
-                                                               SubsampleRawLuxel_r( lm, &trace, origin, sx, sy, 0.25f, lightLuxel );
+                                                               SubsampleRawLuxel_r( lm, &trace, origin, sx, sy, 1.0f/3.0f, lightLuxel );
+                                                               /* will do: first -1/3 .. +1/3, then subsample these corners the same way -> -1/9 .. +1/9 around them, etc. -> 1/3 + 1/9 + 1/27 + ... = 0.5 */
                                                                
                                                                /* debug code to colorize subsampled areas to yellow */
                                                                //%     luxel = SUPER_LUXEL( lightmapNum, sx, sy );