Planet Textures

This is a short tutorial on creating planetary textures for mapping to spheres. Perhaps the hardest part of creating textures using generic tools is that they tend not to wrap around, so a seam is present along some line of longitude. I have created a Java program that creates a fairly realistic terrain height map which you can colorize, touch up, and map to a sphere in your favorite rendering software or whatever. If you are interested, you can download the source code here. The technique works by taking random circles on the sphere and making them lighter (starting from solid black). The appropriate transforms have been used to create the projection used in mapping the texture back to a sphere.

This program is to be run from the command line, with 0, 1, or 3 arguments. The first argument, if present, specifies the number of iterations to use. A higher number will take longer, but generally result in a better, more detailed texture. However, at some point it all gets lost in the noise, and adding extra iterations is of little use. The next two arguments specify the width and height of the resulting texture in pixels. The default values are 512x512. For example:

java SphereTexture
java SphereTexture 200
java SphereTexture 300 256 256

The actual image created is larger than this and surrounded by a red border, allowing you to select only the actual texture in your favorite image editing software, because I am too lazy to figure out how to actually export the texture directly to a usable format.

Unless you have used an exceedingly high iteration count, you will probably want to add some random noise to the image. This is easily accomplished in PhotoShop or the GIMP. You may also want to do a little blurring before you add the noise, to remove some of the hard edges.

You will also want to add color. You can do this in many different ways. My preferred method is to import the noisified texture into POV-Ray as a height field, and then apply colors based on that. You can also add such features as clouds fairly simply using POV-Ray. The file that I used to create these images is here. You can change the terrain by modifying the value TOP, or changing the colors used, quite easily.

As you can see, there is still some undesirable banding and blocks. This can be reduced by increasing the number of iterations. I used the default value of 1000 at 512x512 for these images. All that remains now is to apply it to a sphere. I used POV-Ray again for this, but I also use these images in my game, Event Horizon. You can download the POV-Ray file to create these two images here.