Old download link is invalid; the Mac build is now available here.
This is a tool for working with planet textures. Most usefully, it can convert lat/long textures to cube maps. A typical invocation:
Code: Select all
% planettool --input latlong my-latlong-map.png --output cube my-cube-map.png --flip --size 512
- Fixed sixteen-bit-per-channel output on platforms other than Mac OS X.
- Fixed jittering in Windows.
- Error message instead of crash when specified size is too large to allocate memory for.
- Interactive, graphical version for Mac OS X.
- Fixed cubex output.
- When reading from a lat/long map, linear interpolation is now used in normal rendering and nearest-neighbour in fast mode, instead of the other way around.
- Fixed a quantization bug in gamma correction, which caused a posterising effect.
- Fixed a half-pixel seam at 180° longitude when reading from a lat/long map.
- Sixteen bit per channel export mode.
- Mercator and Gall-Peters projection output modes for maps.
- It’s rather slow.
- While it can read from cube maps, it fails at the edges of faces and produces artefacts. This does not affect writing cube maps.
- Writing cube maps with both the --fast and --jitter options results in strangely clipped output.
Code: Select all
Planettool version 0.4.1
planettool -o <outType> <outFile> [-i <inType> <inFile>] [-g <generator>] [-S <size>] [-F] [-J] [--sixteen-bit] [-L] [-R <ry> <rx> <rz>] [-H] [-V] [-Q]
--output, -o: Type and name of output file. Type must be one of: "latlong" (l), "cube" (c), "cubex" (x), "mercator" (m), "gall-peters" (g)
--input, -i: Type and name of input file. Type must be one of: "latlong" (l), "cube" (c), "cubex" (x)
--generate, -g: Type and name of generator. Type must be one of: "grid1" (g)
--size, -S: Size of output, in pixels. Interpretation depends on output type.
--fast, -F: Use faster, low-quality rendering.
--jitter, -J: Use jittering for slower, slightly noisy rendering which may look better in some cases.
--sixteen-bit: Save in sixteen bit per channel format (instead of eight-bit-per-channel format).
--flip, -L: Mirror the texture in 3D space (through the YZ plane) while rendering. This produces an "inside-out" texture.
--rotate, -R: Rotate the texture around the planet while rendering. The ry axis corresponds to the planet's axis of rotation.
--help, -H: Show this helpful help.
--version, -V: Show version number.
--quiet, -Q: Don't print progress information.
Planettool reads a texture map from an input file (in PNG format) or a generator
function, and writes it to an output file (in PNG format). In so doing, it may
change the projection and scale of the map, and may rotate it around the planet.
Planettool's design is geared for flexibility and quality. As a side effect, it
is extremely slow. Don't be alarmed if it takes several minutes to do anything.
EXAMPLES:
planettool --output cube "cubemap.png" --input latlong "original.png" --size 512
Reads original.png, treated as a latitude-longitude map, and remaps it to a
cube map with a side length of 512 pixels.
planettool -o c cubemap.png -i l original.png -S 512
Same as above, only less legible for extra geek cred.
planettool -o cube grid.png --generator grid1 --fast --rotate 30 0 0 --flip
Generate a grid, tilted 30 degrees and projected onto an inside-out cube map
at low quality.
THE PROJECTION TYPES:
latlong: Equirectangular projection. In this format, the intervals between
pixels are constant steps of latitude and longitude. This is
conceptually simple, but inefficent; lots of pixels are crammed
together tightly near the poles.
cube: The surface is divided into six equal areas, which are projected
onto squares. These are then stacked vertically, in the following
order:
+x, -x, +y, -y, +z, -z.
cubex: The same projection as cube, but the squares are rearranged into a
more human-friendly layout (which can be printed and folded into a
cube if you're bored).
mercator: An angle-preserving map projection. The traditional projection for
sailors and people who can't be bothered to choose a more approp-
riate projection for whatever they're doing. Entirely unsuitable
for texturing, but possibly useful if you want a wall map.
gall-peters: A variant of the cylindric equal-area projection, in which the
proportions between different areas are preserved.
THE GENERATORS:
grid1: A grid with lines spaced ten degrees apart. Longitude lines are
green in the northern hemisphere, blue in the south. Latitude lines
are red in the western hemisphere, teal in the east.