Page 1 of 1

Tools for creating VT in Windows

Posted: 11.01.2007, 17:55
by abramson
Hi, Celestians.

After creating the amazing 64k normalmap for Earth with Fridger's nmtools, I wanted a good base texture to match it. Fridger plans to provide some tools for the creation of base tools as well, eventually. But I had done it before, so I unearthed old code, downloaded July 2004 from BMNG, and updated my tools to make the VT, and in addition to optimized them as taught by Fridger (resolution at high latitudes, monochromatic tiles).

As a result, I ended up with a nice set of tools written mostly in Perl, that worked very nicely in Windows. I have decided to make them available, for the benefit of other Windows users that wouldn't know how to make VT themselves. Find them at my webpage: http://cabfst28.cnea.gov.ar/~abramson/celestia/autotile-v1.0.zip.

(Edit: they are still there, sorry...
I visited today the Alaskan repository for BMNG and it seems that the montly images at 500m/pixel are now single binary data files... )

The readme file follows, with a little more information about the tools.

Have fun!

Guillermo

This distribution consists of a set of perl scripts for the generation and optimization of virtual textures for Celestia (http://www.celestiaproject.net/celestia).

WARNING: I have written this scripts for my personal use. They are not foolprof. Many things are not checked for: that the original textures exist, that they are in the right format, that you provide a sensible TileSize, etc. Please use them with care. Make always a backup copy of your textures before manipulating them in any way. Read the instructions and the warnings. Press Crtl-C at any time to abort.

Note: Check your temp folder for any temporary file left over by convert if you abort (they may be very big). (The temp folder is usually c:\Documents and Settings\Username\Local Settings\Temp\ in Windows XP).

You will need Perl to run these scripts. A good distribution for Windows is ActivePerl (http://www.activestate.com/Products/ActivePerl), which is free for download. After installing it, reboot your computer and open a command console. Put the scripts in the folder where you want to use them, and execute: perl <script.pl>, where <script.pl> is the script you want to run.

Why Perl? Unfortunately, the Windows command language lacks the mathematical functionality for these tasks. Stitch and monochrome could be translated to .bat scripts, but not the others. Batch scripts can be generated by a previous version of autotile, to allow the autotiling in computers without Perl.

1. stitch
---------
The script reads the eight tiles of the 86400x43200 Blue Marble Next Generation Earth texture, and stitches together a single PNG for each hemisphere, each one 32kx32k pixels. The script calls two utilities by myself, west.exe and east.exe, that do the binary job. The FORTRAN sources are also provided.

BMNG consists of monthly cloudless high resolution textures of the year 2004, up to 500m per pixel. Their home page is bluemarble.nasa.gov. There are several download places for the textures. You can choose shaded textures, or flat ones (best choice if you plan to use a normalmap for shading). The BMNG also provides high quality topographic data, bathymetry, etc.

2. autotile
-----------
The script reads two square hemispheres of a 2:1 texture in PNG format, and creates a Virtual Texture of the desired TileSize. Each level of the VT is placed into an appropriate folder. The user must then organize them as a VT, and provide an adequate .ctx file descrition for its use in Celestia.

3. texopt
---------
The script reads the tiles in a level of a Virtual Texture, and reduces their horizontal size according to their latitude. This results into a great reduction of the storage space for the texture, without any loss of resolution in Celestia. This script is a translation of the zsh shell script authored by Fridger Schrempp, which I got from the Celestia Forum.

4. monochrome
-------------
The script reads the tiles in a level of a virtual Texture, and reduces monochromatic tiles to 4x4 pixels. This results into further reduction of storage space, without any loss of resolution in Celestia.

5. west.exe and east.exe
------------------------
These utilities are called by stitch.pl. By themselves, they read the BMNG quadrants in binary PPM format and stitch them into west.ppm and east.ppm, also in binary PPM. The FORTRAN sources are also provided.

6. autotile2bat
---------------
This script is similar to autotile, but it does not perform the tiling itself. Instead, it outputs a set of .bat scripts, for their direct execution at the Windows console. Before I knew Perl, I wrote this tool in Fortran years ago. It may prove useful to provide a tiling utility for a computer that, for some reason, does not have Perl installed.


If you are interested in the creation of good normalmaps for your textures, you may wish to visit Celestial Matters (http://www.celestialmatters.org), where Fridger Shrempp provide his nmtools.

Thanks to Chris Laurel <claurel@www.shatters.net> \, and all the developers, for the excellent Celestia program.

Copyright Guillermo Abramson, 2007
<abramson@cab.cnea.gov.ar>

This utilities are distributed under the conditions of the GNU General Public License (see the file "copying", in this same release).