Tips for Creating Heightfields and Details on Terrain RAW Files

Private Region owners can set their own ground textures and upload raw height maps in a special 13-channel RAW graphic file format (see below).

Land in Second Life is stored as a 2D grid of height values. This means the ground can never overlap, nor can there be made holes through the ground. The grid has a resolution of 1m in each direction, resulting in 256x256 grid points (0 to 255) per region. It can be modified with the built-in terraforming tools or the LSL function llModifyLand. It can also be read using llGround. Land height between the grid points is interpolated, giving it a smooth look. The surface is textured, using multiple textures based on the land height and slope.

Land is owned by agents or groups. Such land parcels consist of blocks with at a resolution of 4x4m size. Land owners can disallow the rezzing of objects or running scripts. Sound can optionally be restricted to a parcel, with no sound leaving or entering it. Land parcels can have an audio stream associated with them.

Creating Height Field Maps for Second Life

These steps presume you'll be designing a land mass comprising more than one Region, but also apply to single-Region design.  When designing land that will abut existing land, obtain the heightmaps (if possible) from neighboring Regions and paste them into the grid of your working file.

  1. Set up a 256-pixel grid on your master document to use as a guide (Second Life can only accept Regions that are 256 pixels squared).
  2. Paint your land as you wish, keeping in mind the caveats mentioned in the previous section.  As you paint, try to minimize the amount of noise, as this will cause the terrain to be bumpy and difficult to walk on. Try a blurring function on your heightmap.
  3. Remember that the water level has a default elevation of 20 meters (with a corresponding gray value of 20), and that an estate owner can change this setting in-world.

  4. Make sure the elevation data is clean and in exists in each of the RGB channels as well as the Alpha channel.
  5. Flatten all layers.
  6. Make sure the file is 16-bit.
  7. From the Save As dropdown, select .raw. Be certain to include the X & Y dimensions of the file in its name (example: HF1_1024x512.raw).
  8. Make sure the Alpha Channels checkbox is selected.
  9. Choose Non-interleaved Order and IBM PC.
  10. Click OK.

Smoothing Out Borders with Existing Simulators

If you're creating terrain that takes the place of some existing terrain:

  1. Paste the existing heightmap into a layer on top of your new artwork (in this example, the upper left-hand corner).
  2. Along the edges where the existing simulator touches your new one, copy the pixel values from the existing heightmap onto your new one. Shared pixel values across simulator borders are the best way to ensure seamless borders when matching existing terrain.
  3. Use the smudge and erase tools to blend the layers together.
  4. Save the file in RAW format.

Importing a Height Field Map

To import your heightmap into Second Life, your avatar must actually be in the region for which you intend the heightmap.

  1. Make sure you’ve saved any content that exists on the region to your inventory!
  2. From the menus at the top of the Second Life window, select World > Region/Estate.
  3. Click the Terrain tab, and click Upload RAW terrain.
  4. Navigate to the location of the RAW file you wish to upload and click Open.
    It may take a minute or more to upload the file to the region. You'll receive a note stating that the file has been successfully uploaded.
  5. When you're satisfied with the terrain, return to the Region/Estate window and click the Bake terrain button.

Notes for Creating Height Field Maps for Second Life

As of Second Life v. 1.3, terrain height fields are created and uploaded into a new region via a 13-channel .raw graphics file. Each channel in the file contains specific information represented by a gray color value between 0 (black) and 255 (white). The size in pixels of one region's .raw file is 256x256. A region is 256x256 meters, so the resolution of the .raw file is 1 square meter per pixel.

You can view a .raw file in Photoshop. When opening the file you are prompted for, you must specify the height and width of the file size in pixels, as well as the number of channels (13). Since bulk uploaded .raw files can be an arbitrary size (dimensions must be divisible by 256), and since the file will not load correctly unless these values are correct, it's important to keep track of the dimensions of the file. It's helpful to embed the dimension in the name of the file itself; for example, "snowregion_hf_2560x1024_v2.raw". This information is required during bulk sim upload. There should be no spaces in the raw filename, since the raw file uploader utility can't handle spaces.

Download a sample RAW file (of the Brilliant region) - Unzip it and open it as 256x256 with 13 channels

Note: Historically, all 13 channels of the RAW files were used in the terraforming process.  This number has since been reduced to 3 terraforming channels.  Despite this, it is still necessary to create and save the RAW file with 13 channels!

Here's how the 3 useful channels in the raw file are defined:

Channel Number Gray Value Range Description
1(red) 0-255 Height Field
2(green) 0-255 Height Multiply Factor
3(blue) 0-255 Water Height of sim in Meters

Notes on Channels

Misc. Tips for Creating Terrain