Planettool 0.4.2 released

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Planettool 0.4.2 released

Post by JensAyton »

Planettool 0.4.2 is now available from GURPO, in Mac, Windows, Linux and source forms.
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
Bug fixes in 0.4.2:
  • 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.
New features in 0.4.2:
  • Interactive, graphical version for Mac OS X.
Bug fixes in 0.4.1:
  • Fixed cubex output.
Bug fixes in 0.4:
  • 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.
New features in 0.4:
  • Sixteen bit per channel export mode.
  • Mercator and Gall-Peters projection output modes for maps.
Known issues:
  • 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.
Official documentation, as per planettool --help:

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.
Last edited by JensAyton on Thu Apr 29, 2010 11:28 pm, edited 8 times in total.

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

I have noticed two bugs:
  • When reading from a lat/long map, linear interpolation is used in fast mode and nearest-neighbour sampling is used in full quality mode, instead of the other way around. This reduces quality especially in any areas that need to be upsampled. This has been fixed in trunk.
  • There is a serious colour management problem going on, as seen in the seas in my standard Earth texture. (below) I somehow missed this because I’ve been focussing on other types of test patterns.
The geometry is correct, so it’s good enough for testing, but not deployment.

Image

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

The colour issue is fixed. There will probably be a new release tomorrow.

User avatar
SiriusCG
Dangerous
Dangerous
Posts: 73
Joined: Sat Mar 27, 2010 12:59 am

Post by SiriusCG »

As a new Oolite user, can you tell me what this tool is used for?

Cheers.

User avatar
JazHaz
---- E L I T E ----
---- E L I T E ----
Posts: 2991
Joined: Tue Sep 22, 2009 11:07 am
Location: Enfield, Middlesex
Contact:

Post by JazHaz »

SiriusCG wrote:As a new Oolite user, can you tell me what this tool is used for?
It's for the current trunk version, which recently got a new ability to handle cube maps, for planet textures.
JazHaz

Gimi wrote:
drew wrote:£4,500 though! :shock: <Faints>
Cheers,
Drew.
Maybe you could start a Kickstarter Campaign to found your £4500 pledge. 8)
Thanks to Gimi, I got an eBook in my inbox tonight (31st May 2014 - Release of Elite Reclamation)!

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

SiriusCG wrote:As a new Oolite user, can you tell me what this tool is used for?
As a user, not much. If you’re making OXPs with planets or custom shaders, a wide variety of uses are possible. :-)

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

0.4 released; first post updated.

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

0.4.1 released; first post updated.

User avatar
Svengali
---- E L I T E ----
---- E L I T E ----
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Hehe, nice tool, Ahruman. Thanks a lot - played a bit with v0.2 yesterday. Great.

User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

You can find here some lat-long maps of planets and moons from our solar system to experiment with.

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

And lots of Earth from NASA’s Visible Earth.

They have an Invisible Earth too, but I can’t find it now.

User avatar
Cmd. Cheyd
---- E L I T E ----
---- E L I T E ----
Posts: 928
Joined: Tue Dec 16, 2008 2:52 pm
Location: Deep Horizon Industries Manufacturing & Research Site somewhere in G8...

Post by Cmd. Cheyd »

Is there any chance one of you complete geniuses would consider turning this into a Photoshop Script or Plug-In? Is it even possible?

Also - If I've got a latlong in 2048 x 1024, and want to maintain that level of detail, what output size do I need to specify?

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

Cmd. Cheyd wrote:Is there any chance one of you complete geniuses would consider turning this into a Photoshop Script or Plug-In? Is it even possible?
From what I hear, making Photoshop plug-ins is extremely painful, which is part of the reason only professionals do it. Another reason would be the need to have several versions of Photoshop for each target platform.

A script might be possible, but would be many times slower.
Cmd. Cheyd wrote:Also - If I've got a latlong in 2048 x 1024, and want to maintain that level of detail, what output size do I need to specify?
The closest equivalent is 512.

User avatar
Getafix
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 960
Joined: Tue Apr 01, 2008 12:55 pm
Location: A small ice asteroid, orbiting Oresrati in Galaxy 8 (a.k.a. northwest Armorica).
Contact:

Post by Getafix »

Planettool 0.4.1 for linux-x86 and linux-x86_64, has just been released.

EDIT: ...and has just been removed. OpenSuse reported some issues with libpng14.
EDIT: OpenSuse libpng14 issues are fixed in v2. Release is now available.
"Any sufficiently advanced information is indistinguishable from noise." [Newman, Lachmann, Moore]

User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

0.4.2 released; first post updated. This fixes some bugs with the more obscure options.

Also, to save myself the trouble of writing a comprehensible guide to command line tools, I wrote a graphical version for Mac OS X.

Image

The graphical version requires Mac OS X 10.5 or later. The command line tool is still included and should work in 10.4.

Post Reply