work very well…
]]>Make sure you have Terrain Toolkit installed, as instructed in the last tutorial, create a new terrain, and attach the TerrainToolkit script to it.
In the inspector, go to Terrain Toolkit’s create tab. Here, you will see a few different generators you can use. The Voronoi Generator creates odd-looking, pyramidal features:
The Fractal Generator creates natural-looking, rough land:
and the Perlin Generator creates, well, perlin noise:
Pick whichever generator you wish to use, and use the scales on it’s tab to define the types of features you want it to generate (these scales vary between the three generators, try a few different settings to see what gives you the terrain you want).
The last two tabs in the create window are the smooth and normalize windows. The smooth window can be used to remove the fractal look from your terrain:
(all examples from now on will use the perlin heightmap from the last screenshot)
And the normalize window can be used to scale down and blend the terrain together:
You can use one of the noise generators, as well as both the smooth and normalize tools on one terrain. Unfortunately, you cannot use two noise generators for the same terrain.
The next section of the terrain generator is the erode window. Any number of erosion tools can be used on the same terrain, and each produce a slightly different effect. Thermal erosion acts on the entire heightmap, smoothing jagged areas and adding texture to smooth slopes:
Hydraulic erosion simulates rainfall effects to give a weathered look:
Tidal erosion also simulates water erosion, but only over a small vertical area, where tides would be.
Wind erosion also simulates weathering, but will give a very jagged look on noisy terrains:
You can combine these tools any way you like to get very different terrain looks. For example, if you want a strange, jagged terrain, you can use the Voronoi generator, and thermal and wind erosion to get this type of terrain:
and you can use the fractal generator, smoothing, and hydraulic erosion to get a hilly effect:
Add some texturing, water, and lighting, and you’re good to go.
Have fun!
]]>
Click Terrain → import heightmap – RAW, and select your .raw file from L3DT.
In this import window, you can set the size of your terrain, but more importantly you can set the import parameters. Chose Bit16, 1025×1025, and Windows for the Depth, Width, Height, and Byte Order, and click import. You will get a terrain map like this:
If you want to make the map a little flatter, you can click Terrain → Set Resolution, and change the height there.
To texture your map, you can use Unity’s built-in texturing tools, or you can use Terrain Toolkit to set the textures procedurally. To do this, download Terrain Toolkit (http://code.google.com/p/unityterraintoolkit/downloads/list) and run the Unity package file. This will import the Terrain Toolkit into the project you have open. Then, in the project window, go to TerrainToolkit and drag the TerrainToolkit C# file onto your terrain object.
Now select the terrain and, in the inspector window, you can change the slope where the cliff texture is displayed, and change the heights where the textures you selected are displayed. After you have everything set, click apply procedural texture to texture the map:
On this map, I just used contrasting textures to show how the textures are applied. When you use actual terrain textures, it looks a bit more like this:
And that’s all there is to it. Feel free to email me with any questions, and happy mapping!
]]>First of all, download and install L3DT (standard edition) from http://www.bundysoft.com/L3DT/.
When you launch L3DT, go to File → New Project. It will bring up this window:
Pick blank designable map if you want to create the terrain from scratch, or designable map if you want randomly generated terrain to work with. If you pick designable map, you will get a window like this:
Here you can set some parameters to define how the terrain will be generated. The features are pretty self-explanatory.
Once you are done refining those, hit next until you get a design map:
where the land tiles will appear green (hue based on height), and the water tiles will appear blue. Here, you can click edit to paint additional features onto the terrain, or double-click a specific tile:
to edit it individually. You can also refine some of the parameters from before in these windows, which can give varying types of terrain on the same map.
Once you have the design map refined, click calc. And select heightfield:
the generator will display a window showing the different steps of the heightmap generation, and then leave you on a heightmap like this:
This map will be basically the same as your design map, but the generator does average heights across tiles to simulate real terrain, so you may need to edit the heightmap itself to make sure any small features you want are still there. To do this, click the 3-D button in the second toolbar:
and then click edit heightfield in the Sapphire window:
This will give you many of the same tools available in the Unity terrain mapper, as well as a few additional ones that make the mapping process easier. The most important tools are:
Raise Brush: raises the terrain.
Lower Brush: lowers the terrain.
Set To: sets the painted area’s height to a specific altitude.
Raise To / Lower To: same as Set To, but will not lower or raise terrain (respectively). Use if you want to set a maximum or minimum height for an area, but not create a plateau.
Smooth: rounds off the painted area, to make it look, well, smoother.
Perlin Noise: The opposite of smooth, it adds noise back into the terrain.
After you are finished editing the heightmap, hit escape to close the Sapphire window and go to file → export → export map layer → heightfield, and click OK.
In the export map wizard, select RAW format, select a path to save the exported heightmap to, and change the width an height to 1025, 1025, and hit OK.
Congratulations, you just exported a .raw file that you can import into Unity! I will cover the importing process in the next tutorial.
If you want a better visualization of your map, you can again click calc, and check the rest of the boxes in the calculation queue.
After a few dialog windows (feel free to change whatever settings you want) and a couple minutes of staring at the generator, you will get a textured map:
which you can fly around by clicking 3-D again:
These textures will not be visible in Unity, since you cannot import the texture map. There is, however, a $25 tool called Tom’s Terrain Tools that will allow you to import alpha splat maps into unity to replicate L3DT’s texturing. I will not cover this here, since there are free alternatives for texturing, and I will instead show you how to use Terrain Toolkit to texture your map in my next tutorial.
Have fun!
]]>http://www.twodee.org/teaching/honors304-503/2012C/homework/jj/
]]>
]]>