Cubic Terragen Environment to HDR Map Tutorial
Return to the Index

(Click for large image.)
Courtesy of Helen Triantafillou

These instructions show how to translate a 6-face cubic HDR environment from Terragen to a spherical map for use in ml-POV or other renderers. Text is Helen's except where I've added comments [in brackets]. Instructions assume basic awareness of Terragen scripting (i.e., how to execute Terragen scripts, generate images from them, and basic text editing).

Note that these basic instructions are also useful for taking a 6-face cubic HDR environment from Terragen and converting it to any other HDR panorama type--at least, any panorama type supported by HDR Shop. This makes it possible to create cylindrical or spherical HDR textures, or even LightGen light lists, all from Terragen scenes. (Of course, once the cubic environment is in a panorama format that HDR Shop recognizes, anything that HDR Shop would normally be used for is available to the Terragen user.)

  1. Make your Terragen world, until the previews show it right. Save the world.
  2. Put the camera in the middle of the terrain (or just about), looking straight ahead to the terrain perimeter (doesn't matter where). Preview to make sure there are no obstructions. Set the width and height of the image to the same number; don't start with anything higher than 400X400. Save the world with a new name, one that will remind you that this is a panorama. [It is not vitally important that the camera be placed exactly in the center of the terrain. It can be situated anywhere as long as the "edge of the world" is not visible in any direction. Don't ruin a good panorama by having a big black stripe across one or more of the images!]
  3. In the camera settings, choose "HDR image". [Reminder: This will only appear if SOPack is properly installed.]
  4. Open Jo Meder's panoscript (or write your own) with a text editor. Change the path of the animation files to the one appropriate for your case. Save the script with a familiar name. [If you don't happen to have a copy of Jo Meder's panoscript, there is one available from Dave Drews; look for PANO.ZIP.]
  5. Run your saved script.
  6. Look at the directory where you saved the panorama images. Sort the directory by date. You will find the HDR files corresponding to your panorama image frames, by looking at their time stamp.
  7. If you used Jo's script, rename the HDR images to (... is for the name of your world):
    • ..._ft.hdr (for frame 1)
    • ..._rt.hdr (for frame 2)
    • ..._bk.hdr (for frame 3)
    • ..._lt.hdr (for frame 4)
    • ..._up.hdr (for frame 5)
    • ..._dn.hdr (for frame 6)
    If you used another script, ft is for the "front" image, rt for the right, bk for back, lt for left, up for up and dn for down. [Since the timestamps only indicate in which order the images were rendered and not which images they are--front, top, right, etc.--it is extremely important to know in what order the panorama script you're using renders each of the 6 frames!]
  8. Double click cube2cross.exe. A console (command prompt or DOS) window will open. Pay no attention to it, just don't close it. A "file open" dialog will appear. Choose one of the renamed HDR files and wait until the program finishes. Then you will have a new larger HDR file named "..._cross.hdr".
  9. Open HDRShop and load the cross HDR image. Choose image->panorama->panoramic transformations - from cubic environment (vertical cross) - to light probe (angular map). Put a number equal to 3 times the width of each panorama frame, both as height and as width. Save the resulting image with a new name.
    • Important When doing panoramic transformations:
      • In HDRIE: Choose nearest neighbor interpolation - not bicubic, which is default, and none of the others (bilinear or bicubic2).
      • In HDRShop: choose no interpolation (not bicubic, which is default).
      Failure to change the interpolation method may result in black lines appearing in the final map.
  10. ml-POV Only You are now ready to load it into ml-POV to map on a sphere (for map_type 7 only). Or use in your favorite 3d (HDR compatible) program.
  11. ml-POV Only You can also use the latitude-longitude projection in ml-POV (for map_type 1), so long as you uncheck the HDRShop option for the 2:1 ratio and use the size recommendations mentioned on #9 above. The result will not be exactly the same.

The contents of this webpage and all files contained herein, unless otherwise noted, are copyright (C)2003, Sean O'Malley.

Back to the Index