From 56cf102d6417ee780f45af1fb8d4628a0132f5ec Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 26 Aug 2010 06:09:40 +0200 Subject: [PATCH 1/1] explain more --- misc/tools/fft-normalmap-to-heightmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/misc/tools/fft-normalmap-to-heightmap.c b/misc/tools/fft-normalmap-to-heightmap.c index 909f591f..aa4ac7ff 100644 --- a/misc/tools/fft-normalmap-to-heightmap.c +++ b/misc/tools/fft-normalmap-to-heightmap.c @@ -39,7 +39,7 @@ void nmap_to_hmap(unsigned char *map, const unsigned char *refmap, int w, int h, { int x, y; int fx, fy; - int ffx, ffy; + double ffx, ffy; double nx, ny, nz; double v, vmin, vmax; #ifndef C99 @@ -95,6 +95,7 @@ void nmap_to_hmap(unsigned char *map, const unsigned char *refmap, int w, int h, if(fy > h/2) fy -= h; /* these must have the same sign as fx and fy (so ffx*fx + ffy*fy is nonzero), otherwise do not matter */ + /* it basically decides how artifacts are distributed */ ffx = fx; ffy = fy; #ifdef C99 -- 2.39.2