]> git.xonotic.org Git - xonotic/xonotic.git/commitdiff
use Scharr operator instead of Sobel operator for edge detection
authorRudolf Polzer <divverent@alientrap.org>
Sat, 28 Aug 2010 09:20:59 +0000 (11:20 +0200)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 28 Aug 2010 09:20:59 +0000 (11:20 +0200)
misc/tools/fft-normalmap-to-heightmap.c

index aa4ac7fffe78855f555424ba2cfff178581f75db..17f9fd896ac66a4d33d4801fe0c60f090f99f2c4 100644 (file)
@@ -354,11 +354,11 @@ void hmap_to_nmap_local(unsigned char *map, int w, int h, int src_chan, double s
        int i, j;
        double *img_reduced = malloc(w*h * sizeof(double));
        static const double filter[3][3] = { /* filter to derive one component */
        int i, j;
        double *img_reduced = malloc(w*h * sizeof(double));
        static const double filter[3][3] = { /* filter to derive one component */
-               { -1, 0, 1 },
-               { -2, 0, 2 },
-               { -1, 0, 1 }
+               {  -3, 0,  3 },
+               { -10, 0, 10 },
+               {  -3, 0,  3 }
        };
        };
-       static const double filter_mult = 0.125;
+       static const double filter_mult = 0.03125;
 
        for(y = 0; y < h; ++y)
        for(x = 0; x < w; ++x)
 
        for(y = 0; y < h; ++y)
        for(x = 0; x < w; ++x)