How to create .RAW terrain files for Second Life and OpenSim with Terragen
Tools needed:
Due to popular demand, following my free island file package, I promised to explain how to create these using free tools. First off, while I know Terragen 2 is out for a while now, I’m still using the previous version, as I simply couldn’t get used to the new interface, and for the scope of this tutorial, Terragen 1 is entirely sufficient. We will not use their advanced sky or water editor, just the noise filters to create our terrains, and optionally the terrain editor. Terragen is a cross-platform application, but the critically needed Bailiwick is Windows-only, making it a bit cumbersome for Mac users, but not impossible, given the ability to run Windows for an occasional sidestep on your Mac, using either the native Bootcamp, or some VM solution like Fusion or Parallels. (Backhoe, on the other hand, is Mac-only, soothing the pain with Bailiwick somewhat.)
To begin, fire up Terragen. There are only a few functions we will be using right now. Open the landscape window and click on the “Generate Terrain…” button. Another window will open, allowing you to create random terrains and tweaking the results with some sliders and different noise generators. Just play with the settings a little to see what they do. For this tutorial, I tried to create an island that will fit on a normal region. Please note especially the slider ‘Size of Features’ as you can get best results setting it to max or close to max. Still, it will need a lot of repeated clicking on the ‘Generate Terrain’ button to finally get something you like.
When you are finished with the creation of your terrain, click on ‘close’. You can get a rendered preview of it clicking on the 3d Preview Button and you can edit and / or zoom over your terrain using the Landscape View & Sculpt tool. The green dot is the camera, the red dot is the view target. By default, the camera hovers a set distance above ground and thus moves with the terrain height when you move it. To move, just click and drag it across the window. You will see how it flies through the terrain on the 3D preview window. Clicking the ‘sculpting’ button on the Landscape View & Sculpt window (the button that looks like a paintbrush running over green colour) you can toggle the landscape editor. Now, left-clicking anywhere on your terrain map wil raise the terrain there, while alt-clicking (holding the alt key while left-clicking) will lower it. That way you can make some adjustments or even create your own custom terrain from scratch. When you’re satisfied with the result, it’s a good opportunity to save your terrain, as Terragen allows for only one undo step. To do so, click on file > Save Separate > Terrain… and save it as a terragen terrain file for now.
Note: Terragen can create terrains out of nearly any image file, using the Import function by clicking on File > Import > Terrain… and selecting “Image” as data format. The results may vary; for a basic rule, the images are converted to greyscales, with the light parts selecting higher terrain than darker ones.
Going back to our island, there are three things you will have to keep in mind to make it compatible with Second Life and Opensim. First, a standard region for these platforms is 256 x 256 meters in size. so we will have to adjust the size of the terrain map to 256 on each side. To do so, click on the “Size / Radius” button in the Landscape window and enter the size in the Landscape Area in the Landscape Settings window. Secondly, water height is -300 m in Terragen, while it is 20 m in Second Life by default. (Yes, Terragen works with negative terrain heights.) So, we will have to open the Water window by clicking its button and change the water level to 20.00 m there.12 And finally, the terrain itself will have negative heights in some parts. This is the most crucial and frustrating step, as it can ruin all your terrain again. Sadly, I don’t know any solution around it, so the only way out is through. If you click the “Modify Terrain” button in the Landscape window, you can, in addition to a few other modifications, change the height range. In my case, the little island ranged from -48.605 to +53.575 meters. Enter at least 0 in the first field (the minimum height range) and click on “Set Height Range”. You will notice your terrain will seemingly grow ‘larger’ as bigger portions of it will now be above water level. To avoid this effect, the number of the second field (maximum height range) can be carefully lowered a bit, moving the edges below water level again, but flattening the terrain all in all. Again, some experimentation here helps to achieve the best results. Also, save regularly.
So how do we get our terrain to Second Life now? It would be too easy if Terragen’s built-in RAW file export would simply create the neccessary file to upload to SL for us. Sadly, the RAW files generated that way will not work. Thus we need a converter that will make Sl compatible RAW files out of our terragen terrain file. Enter Bailiwick.
Start it up and import your terrain by clicking on File > Import > Terragen Terrain, selecting your terrain file and simply clicking the ‘import’ button. None of the settings need to be changed, simply create your .RAW file by clicking File > Save. Bailiwick will automatically save it as a sim raw file which can now be used on your Opensim region, applying it directly from the console using the >terrain load< command or upload it to a Second Life private region via the region/estate window.
Bonus Track: Backhoe offers some very nice and user friendly landscape editor for SL terrains. You can load the .RAW file created with Bailiwick into it and adjust basically everything you can with SL’s inworld tools, too. It just works faster and more smooth, and thus is a great tool if you want to get serious about landscaping.
Known issues: neither Terragen, nor Bailiwick or Backhoe offer some ability to rotate a terrain map, thus ‘up’ means ‘north’ in any case. While .RAW files are image files, I could not edit the SL specific raw file in neither Gimp nor Photoshop without rendering it useless for SL. So for now, I can sadly provide no solution for this.
[Edit June 5th 2010: A new tutorial now provides a solution for these issues as well as a way to create seamless terrains that stretch multiple regions.]
[Edit 25th January 2011: Added a memo to the waterline. 21.75 meters are required for OpenSim.]
[Edit 1st February 2011: As it seems, OpenSim will start supporting Terragen files, so it won't be neccessary to use Bailiwick anymore.]
- Note: While it is possible to raise and lower the water level on SL regions, 20 meters is a good medium level and should be used for reference. Also, note that neither terrain nor water can ever get negative settings in SL. [↩]
- Memo: For a precise waterline, it’s neccessary to raise the water level to 21.75 m in Terragen to have the waterline at the same level as in OpenSim. [↩]
Comments
Leave a Reply





















Sparkaphat Doobie on 06.16.2010
Thank You for this awesome bit of information!
[Reply]
V on 06.16.2010
You’re most welcome. I hope it helps.
[Reply]
Pathfinder on 01.01.2011
This tutorial is fantastic.
I’ve just added a link to it in our ReactionGrid knowledgebase article on “Terraforming.” Now our ReactionGrid customers searching our knowledgebase for answers can find it easily.
http://metaverseheroes.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=16&nav=0
Thank you again, V, for sharing your knowledge.
[Reply]
V on 01.02.2011
Thanks a lot, Pathfinder. I have to admit this little tutorial is much more popular than I thought it would ever be. I didn’t know there was such a big interest in terraforming – and I’m glad there is, I enjoy it a lot myself. (Hey, that’s how I ended up with Terragen in the first place.)
I was thinking about re-writing the tutorial a few times already, as I’m not too happy with the order of the instructions. The size should be changed to 256 much earlier (but that’s not too crucial) and the water level to 20 too (which is a lot more crucial, as it can change the whole terrain). However, changing that sequence would leave readers puzzled in the beginning, and moreover, the terrain level can be adjusted with the Modify Terrain module up to where it can retain almost all its original features.
I’m using this comment therefor to point out that terrain can be elevated (or lowered) simply by adding the desired elevation to both minimum and maximum height range in the Modify Terrain window. I used this particular feature to raise terrains up to 200 meters where they will be right within the clouds, which makes for a great effect. While the water in OpenSim can be raised/lowered for each region individually, the “horizon” water is always at 20 meters, so it looks a bit odd when zooming out.
As with everything, the best way to learn is by trial and error, so I encourage everyone to play with Terragen a little. It’s a wonderful tool.
[Reply]
Aedan on 01.02.2011
Greetings,
..and thanks for this. I stumbled across this while starting a new project and found it quite informative. The search that brought me here was trying to find what is the maximum terrain height in SL ( and btw, OpenSim also if it is different).
I’ve an object that travels sims and takes terrain height measurements every meter and saves those measurements off world…to be used as need – primariliy to generate height maps or graphical re-creations of the terrain for the sim owner or other cartography purposes. I know water height is 20m but is there a maximum height so that I might convert the data I collect to the appropriate value before writing to an image file?
Thanks for your response.
…Aedan
[Reply]
V on 01.02.2011
Hi Aedan,
I can’t speak for SL; I’m not aware of the limits there. For OpenSim there doesn’t seem to be a limit for terrain heights; I just made a few tests on my standalone, and raised the terrain up to 3000 meters without problems, so my guess would be it can be at any height.
In regards to your project, there’s already a nice tool from Spinmass (the creators of Bailiwick), called Terrain Sculptor, which does provide the same functions as the object you describe.
[Reply]
Aedan on 01.02.2011
wow…perfect! that is almost EXACTLY what I was wanting to do..and I spent the last two days trying to figure out how to get started ( and sending my bird around taking measurements to the dismay of neighbors when the script went awry :D ) Thank you :)
[Reply]
Aedan on 01.02.2011
hmm..actually, I think I spoke too soon. It appeared to be exactly what I was looking for but after several attempts, the sculpty texture generated doesn’t match the terrain…some features match but others are completely wrong. I rotated it and tried other sims no avail.
It hasn’t been updated for some time so I’m fearing it got left behind…. :( ..and I’m still searching :(
[Reply]
V on 01.02.2011
Hi Aedan,
the sculptie terrain will never match the terrain completely, because sculpties have much less vertices than the terrain (4096 vertices for the sculpt versus 65536 vertices for the terrain). However, you can export the terrain as a .raw file too.
Greetings,
V
[Reply]
Aedan on 01.02.2011
Thanks V,
I’ll play with it a while…it is actually like half the sim is missing..the sculpty is flat and I’ve gotten three different results with three different attempts. If I can figure out how to take the 256×256 height measurements I’ve taken and put them into a file that can be properly read, I think I”ll be back on track. That seems so simple and yet I haven’t found a format descriptor to do just that…
[Reply]
V on 01.03.2011
Hi Aedan,
from what I remember (haven’t used Terrain Sculptor in a while) the terrain only exports right if your avatar can see it all, so it works best if you fly across it at a some altitude (like 50 meters) and cross the sim. On the map window you can see how much of the terrain has already rezzed.
[Reply]
Aedan on 01.03.2011
*smiles* I’ll try that. I found no instructions so couldn’t know if there was a distance concern (I thought maybe the libraries pulled the information directly from the sim) …thanks once again.
[Reply]
Karen on 02.07.2011
Thanks for your great tutorial! When I downloaded Terragen from your link and ran it, it appears to be a different version than what shows in your screen shots. I downloaded Terragen Classic, and the version is V0.9. I’ve struggled trying to follow your directions, but can’t seem to save in the right format. Any suggestions?
[Reply]
V Reply of February 7th, 2011 23:46:
Hi Karen,
I’m using Terragen for Mac, the Windows version looks somewhat different, it seems. Still, the features should be the same. I just took a look at the windows version and the menus and buttons are organized differently. To save the terrain in windows, click on the “Save” button in the Landscape window. This will save a terrain file by default, there’s nothing to change there. After that, convert the terragen file to a .raw with bailiwick.
Greetings
V
[Reply]
Karen on 02.08.2011
That worked fine! Thanks for your quick response, I really appreciate your help.
[Reply]
V on 02.08.2011
You’re most welcome. Happy landscaping!
V
[Reply]
DancingKim on 05.12.2011
Hi there, i’m a professional dancer. i’d prefer to make a showreel regarding my promotions. I also would like to use some animation. Can someone suggest me a great animation studio, but not necessarily very expensive? I’m here for 3 months for a tour.
Love
Kim.
[Reply]
Ewan on 09.10.2011
Hi there,
I was wondering if anyone could tell me in which detail SL can configure the RAW files. I made a plan for making a footprint of roughly 20X20 in a one sim raw file, with a maze in it, and it looks pretty cool in the preview, but i now dont know if it will work.
Do i need to set up a height, anything else i need to think of? I know SL works with a 20m waterlevel, but I have no clue how to do that. I used L3DT to make my simshape.
Any suggestions?
Kind regards,
Ewan.
[Reply]
V Reply of September 10th, 2011 19:00:
Hi Ewan, the resolution of a sim raw file is always 256×256 pixels, the height scale is presented as the increments in a greyscale spectrum. I’m not sure if that answers your question. Sadly, I’m not familiar with L3DT, I use Terragen and the inworld editor for all terrains.
[Reply]