China's space agency has released an amazingly detailed map of the entire lunar surface this week. The new moon map is made up of many high-resolution photos snapped by China's second lunar probe â€” the Chang'e 2 orbiter
â€”and stitched together into a complete equirectangular map
The Chang'e probe is currently stationed at the Sun-Earth L2 Lagrange point
http://lunarscience.nasa.gov/articles/c ... s-l2-point
Note that Chang'e is a Chinese goddess of the Moon
Of course, all this is a clear signal to start working on an adaptation for Celestia(.Sci).
This thread will contain a detailed description of my approach along with status reports and a discussion of possibly appearing problems. Once I am ready and content with the resulting texture, I'll offer it for download, here.
The link to the chinese server site, was first brought to my attention by Hungry4info
over at shatters.net. Thanks for that, Hungry!
To get tuned into what is at stake, here is a tiny example of the amazing amount of detail that we can hope for: A zoomed-in view of the wall of the Tycho crater
[Click on image by all means!]
The original texture file is simply HUGE!
Size: 213.4k x 106.6k
We can't possibly just include such a huge map into Celestia
, hence what is required is a proper VT tile set matched to another VT set with highest-quality normalmap tiles. Moreover, it has to be properly cleaned of remaining artefacts.
That's where the work starts. Of course, much of it is done with my superfast F-TexTools/Nmtools
that may be downloaded here from Celestial Matters.
Another "speciality" is that the original moon map is offered in lossless JPEG2 (.jp2) format
, and hence we first need to use some dedicated software to convert it e.g. to lossless PNG format. Most familiar conversion tools like ImageMagick's convert or XnView nConvert will fail for such a big filesize!
The only software that has a chance of handling such big files during the conversion is gdal_translate
, a command-line tool that is part of the FWTools
The FWTools work in principle for all popular OS (Windows, MacOS and Linux).
Installation is trivial.
Unfortunately, the Windows version seems considerably less stable and the memory management less sophisticated than the Linux version. For Linux I encountered no problems in converting the .jp2 original to PNG using the simple console command:
gdal_translate -of png Global-50m-sc.jp2 Global-50m-sc.png
As I wrote already in shatters.net, the resulting .png file is huge (8.5 GB) and the conversion took about 4 hours! The texture size is also forbiddingly large: 218527 x 109166
Moreover, it's neither a 2:1 aspect ratio nor a power-of-two size, which is required for VT tiling.
Hence (for now) I adopted a modified approach, exploiting additional command options in gdal_translate. I decided to use the scaling option that allows to rescale the original xsize and ysize separately already during the .jp2->.png conversion. So I rescaled the original precisely to a proper 65536 x 32768 size. The required command reads
gdal_translate -outsize 29.989887% 30.016672% -of png Global-50m-sc.jp2 moon_64k.png
(You may also use the desired pixels and lines directly instead of percent:
-outsize 65536 32768)
This command takes much less time than the original conversion and left me with an error-free 64k, 2:1 moon texture, which is still "monstrous". There are various arguments why this looks like a good maximum size:
Using my tx2half F-TexTool command twice in a pipe:
png2bin < moon_64k.png| tx2half 1 65536| tx2half 1 32768 | bin2png 1 16384 > moon_16k.png,
I quickly generated first a 16k texture that I could still load as a whole into Celestia, in order to inspect the image quality and the alignment quality wrto the 64k LRO-WAC normalmap. It became obvious that a considerable amount of "destriping" is necessary and also quite some brightening of the original albedo range. The original moon is far too dark. Moreover, I wanted to computer colorize the texture using a true-color template. The destriping I do with the corresponding ISIS3 routines.
Due to these required operations, a map much larger rhan 64k seems asking too much (for now)... Moreover, 64k would fit well to the best existing normalmap (LRO-WAC).
Unfortunately, the matching with the LRO-WAC normalmap is not perfect with my present strategy. Presumably related to the original NON 2:1 aspect ratio...I will have to experiment here for the best compromise.
Once the matching has been optimized, my F-TexTools are eager to produce an optimized VT tile set. On the one hand, directly, with highest-quality DXT output format and once as PNG format. The result will be offered for download here at Celestial Matters.
If anyone has good arguments for including further considerations/modifications, please let me know before all work is completed...
So far so good...