* Create your FREE website now *
Switch To  | Home | Dashboard | Tell a Friend | Help | Feedback | Sign in/Sign up
Land Answers for Second Life
Tips for Creating Heightfields and Details on Terrain RAW Files


Tips for Creating Heightfields and Details on Terrain RAW Files

Tags:  


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.

    Gray-scale heightmap (or elevation map).
    The same heightmap revealing the water layer (at the default value of 20) and grid to show simulator borders.
  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
  • Channel 1(red) is the raw terrain heightfield data. In its simplest form it represents the ground height in meters of every point on the map, where black (grey level 0) is 0 meters high and white (grey level 255) is 255 meters high. However, the height of the terrain is often modified further by values in channel 2.
  • Channel 2 (green) is a grayscale map that is used as a multiplier to scale the data in channel 1, resulting in the final height of each point on the map. The formula used to combine the 2 channels is not easily described, but a few examples will help to illustrate their interaction.

    32 -- Divides pixel values by 4. The resultant elevations will be ¼ of the original
    64 -- Divides pixel values by 2. The resultant elevations will be ½ of the original
    128 -- No effect
    255 -- Multiplies pixel values by 2. The resultant elevations will be twice that of the original
  • Channel 3 (blue) is a gray value that sets the water height of the sim in meters. A sim can only have one water height, so fill the entire channel with one value. The default water level found in Second Life is 20 meters. This is the level of all "void" water, as well as the water level on the vast majority of existing sims. The water level can be set to other values on a per sim basis, but this should only be done in special cases, since it leaves a noticeable vertical gap between sims whose visible water edges abut but are not at the same level. The water channel is not affected by the multiply channel, so the maximum height of water is 255.

Misc. Tips for Creating Terrain

  • While tempting, creating a 512 meter high mountain on a 256 square meter sim usually leads to disappointing results. Ground textures will be stretched and tiled unrealistically. Draw distance setting on most people's machines means that if they stood on top of the mountain, they couldn't see the ground below. Artifacts in the skybox and frame rate slowdown due to lots of overlapping clouds viewed close up will be apparent. Steep cliffs often tessellate poorly, resulting in jaggy terrain, and entire mountains may disappear when viewed from a distance due to the lower level of detail. Many of these artifacts can be reduced or avoided by keeping the range of the elevation in a sim to within 50-100 meters. Similarly, any radical changes in height over a short distance will exhibit some of these artifacts, so design accordingly. This was reported fixed, so this might no longer be valid.
  • Many commercial and shareware tools exist for creating terrain files. Existing real world terrain data is also available from various sources that can be useful starting points for creating your own heigh tfields.
  • Blurring the terrain channel slightly often improves the visual quality of the ground inworld.

 

5 Comments
Kubota Homewood, 205 - days ago  

"The formula used to combine the 2 channels is not easily described..." Actually, it looks pretty simple, the multiplier is simply the value / 128.

32/128 = 1/4
64/128 = 1/2
128/128 = 1
255/128 = 1.99 (almost 2)

nubianbliss1@yahoo.com, 193 - days ago  

I love the information and wish there was more available. It seems so hard to find information to accomplish my desires in Second Life. I have been searching for weeks. Do you know or can provide information or links where I can learn to make terraforms using real world state or city maps like manhattan or california shapes or an ax or a bird I am desperately trying to get this instruction. I would be grafeful if you could help me.

Nunu

Nubianbliss1@yahoo.com, 190 - days ago  

I done this numerous times and all if get is a fractured 500M thick sim. It does not work for me my ticket is still open when they asked me to submit a help ticket is there anyone that can walk me through it? I know I am probably missing a tiny thing here. Please help 2 months and counting.

suezanne, 190 - days ago  

Nubian, I wish I knew the answer to your question. I suggest that you ask this question in the Resident Answers forum at forums.secondlife.com, and for that matter, at the forums at sluniverse.com, and make sure you have checked the wiki at secondlife.com.

paula.dix@hotmal.com, 156 - days ago  

Nubian, try saving your map 8 bits interleaved... worked for me.

>Paula


Attachments (0)


 RSS of this page

Written by:   Written by:   Version:   Last Edited By:   Modified
Document Saved Successfully
Quick Search | Wiki Index


Navigate Pages | Site Map
    RC 1 19 1 Parcel Media - web content on a prim
    How do I return other peoples objects
    What are the different levels of account membership
    Streaming Video in Second Life
    Rollbacks
    Guide to Freezing Banning and Ejecting
    I just cancelled my account and I am still being charged
    What happens to land I own on the mainland if I downgrade from a Premium account to Basic
    How Do Land Sales in Private Regions Work
    Identity Verification FAQ
    How do I manage objects on group owned land
    How do I keep people off my land
    How do I deed land to a group
    VAT FAQ
    streaming video in second live
    Prims related to Land
    How To Terraform
    Common mistakes by new land owners
    Estate and Private Region Price Increase FAQ
    How to play streaming music in Second Life
    Missing Inventory Coalesce Feature
    How to Get to the About Land Window
    Who is the owner of a parcel of land
    Why was my group disbanded
    How do I find land to buy
    Parcel encroachment
    Did you make a mistake when you billed me for my Mainland land holdings
    How do I rent land to other people
    Estate and Private Region Billing
    How do I join and split land
    How do I reclaim land that is deeded to a group
    How to Use the Edit Terrain Tool
    Abandoned Land FAQ
    How do I sell land
    Land FAQ
    How does group owned land work
    The About Land window
    HomePage
    Second Life Billing Policies
    Protected Land FAQ
    Tips for Creating Heightfields and Details on Terrain RAW Files
    Estate and Private Region FAQ
    Voice FAQ
    Estates Private Regions and Groups
    Estate and Private Region Covenants
    The Region Estate window
    Usage Fees and US Dollar Charges
    Land Management FAQ
    How do I change or remove group land contributions
    INVENTORY Complete recovery steps and information about perceived loss
    How do I buy land
    Parcel Media Update

Recently Changed 
  • Parcel Media Update
  • HomePage
  • Streaming Video in Second Life
  • QuickTime
  • Tips for Creating Heightfields and Details on Terrain RAW Files
  • RC 1 19 1 Parcel Media - web content on a prim
  • streaming video in second live
  • NetroMedia
  • Prims related to Land
  • How To Terraform
view all


Incoming Links
There are no incoming links for this page.


Powered by Zoho Wiki | Zoho | Report Abuse | Create your website like this. Its FREE!!!