ULTRA TERRAIN TOOLS
Documentation and Quick Start Guide
For the easy creation of Terrain height maps using real world data and a variety of generation algorithms.
Quick Start
1. After installing the package from the Package Manager under your assets
2. Under Tools, select Ultra Terrain Tools (UTT)
3. This will open the main window for Ultra Terrain Tools. For easier navigation, and to avoid accidently closing it, please dock this window somewhere.
4. When you first open the UTT window you will be presented with three methods to obtain terrain data. Each of these will be explained in detail in the following sections.
5. Using the guides below acquire the elevation data and place them into the main screen.
6. Create an empty game object that will store the created terrains.
7. Drag the new empty game object to the “Terrain(s) Parent” option. You may also need to change the Terrain Material if not using the Standard graphics engine.
8. Click the Generate Terrain Button.
Elevation Data from Bing Maps
To get real world elevation data from Bing maps click the “Acquire Elevation Data from Bing Maps”
from the main UTT screen.
This will open the following screen.
Acquiring a Bing API Key
Before data can be gathered from Bing Maps a Bing API key is required. To get started click on the “Gey My Bing Api Key” button. This will open https://www.bingmapsportal.com/. Either sign in or create a new free account to get a free API Key. There are limits to how much data you can download in a month, but for a single user this should be extremely difficult to exceed. Once you enter your Bing API Key here it will be remembered for future sessions in this project.
Acquiring Map Coordinates
These are the latitude and longitude of the location on Earth where to download data from. The default coordinates are for the Grand Canyon. There is a button titled “Get Coordinates”, this will open Google Maps. For example, to model a terrain from the Matterhorn, go to the location of the Matterhorn on google maps and click anywhere near the peak. Note, this is easier from the satellite or terrain layer. The coordinates are location in the window that opens. Copy and paste them into the Latitude and Longitude text box.
Select the Distance from Point to Download
This is how many meters from the entered latitude and longitude to download data from. The larger the selected area the longer it will take to download.
Accepting the Terrain Data
A preview of the data is shown in a grey scale image below the Accept button. Lighter shades of grey correspond to higher elevations. Once happy with the result click the “Accept” button to load the height array into the main window. Clicking the X will close this window without saving the new data.
Generate Terrain from Noise
To generate a random terrain, click the “Generate Terrain From Noise” from the main UTT screen.
This will open the following screen.
Select Noise Type
UTT comes with three different methods of generating noise.
Perlin Noise
https://en.wikipedia.org/wiki/Perlin_noise
This is the most common noise algorithm used in Unity. Unity has a built in math function for creating Perlin Noise.
Simplex Noise
https://en.wikipedia.org/wiki/Simplex_noise
Simplex noise can create more jagged algorithm that Perlin noise.
Diamond Square
https://en.wikipedia.org/wiki/Diamond-square_algorithm
When Diamond Square is selected a new control becomes visible called “Randomness”. This controls how much smoothing is introduced into the algorithm. This allows greater control on the landscape being generated.
A Randomness level of zero will create a very smooth surface while a randomness of 1 will create a very uneven surface. Which one is chosen will depend on the kind of landscape desired.
Noise Array Size and Terrain Size
These two settings work in tandem for terrains generated via noise. The noise array size is the width and height of the array that will contain the resulting noise data. The terrain size is what the noise array will be enlarged to fit the terrain array. Larger noise arrays will produce terrain data that looks rougher.
To the left is a terrain 1024x1024 meter terrain from a noise array size of 32x32 without erosion with a max height of 1000m.
To the right is a 1024x1024 meter terrain from a noise array size of 512x512 without erosion with a max height of 1000m.
The two terrains below are the same terrains as above but after the erosion process.
Max Height
This is the maximum height that will be generated for the terrain. All the noise generators create an array of floats from 0 to 1. The maximum height is what the resulting array is multiplied by to get the final elevation size.
Regenerate
This button can be clicked until happy with the results. When happy with the results click on the Accept button to load the height array into the main window. Clicking the X will close this window without saving the new data.
Load Terrain from RAW file
This option loads in existing data from a RAW file. This data could have been created in a graphics application like Photoshop or exported from another Unity Terrain.
To load terrain from a 16-bit RAW file click the “Load Terrain from RAW File” button from the main UTT screen.
This will open the following screen.
Click on the “Open Raw File” button to open a file open dialog and choose a valid RAW file.
Double click a RAW file to import it. A preview of the elevation data in the RAW file is displayed.
New Terrain Size
A new terrain size can be chosen for this terrain data. However, only a larger size can be selected. At the moment resizing to a smaller terrain size is not implemented.
Max Height
This is the max height for this terrain data.
Accept
When happy with the data click the accept button to load this data into the main window. Clicking the X will close this window without saving the new data.
Erosion Settings
The Main Screen
One the data has been acquired either via Bing Maps, Noise, or a loaded RAW file it can be loaded into the main screen to be used for creating Terrains.
Terrain Shape Settings
Exaggerate Terrain
Use this setting to exaggerate mountains and valleys in the data. This value indicates by how much the data will be exaggerated. A value of two will double the size of all mountains. Keep in mind that the maximum height of a terrain is 16384.
Smooth Passes
How many times the smoothing algorithm will be ran on the resulting data after erosion is ran. A value of zero will turn smoothing off.
Noise Level
After the erosion, but before the smoothing, a layer of noise is added to the terrain. This value indicates how strong the noise addition should be. A value of zero turns the noise option off.
Data Size Ratio
This allows the size of the data to be increased or decreased. If the data downloaded was 4k by 4k, then setting the Data Size Ratio to 2 would treat the data as if it was 8x by 8k.
World Size
This displays the current size of the data. The size is selected when either downloading or generating data. It can be further modified using the Data Size Ratio.
There are two sets of erosion settings. The screen shot to the left shows the advanced erosion settings. To switch between them click on the “Use Simple Erosion Settings” to switch to simple or “Use Advanced Erosion Settings” to switch to the advanced settings.
The Erosion algorithm works by creating virtual “drops” of water in random locations on the terrain data map. It then sends that water drop down the terrain. For each movement on the terrain’s data grid it will pick up or drop off “sediment”. When sediment is picked up, it decreases the terrain height of that grid location, and when sediment is dropped off it increases the height of that current grid location. The drop continues down until it can not find any lower elevation to go to.
Sediment is picked up when the angle of the terrain is above 45 degrees, and dropped off when the angle is below 45 degrees. It can also be picked up or dropped off at other times by changing the minimum and maximum sediment values explained below.
Use GPU For Erosion
If a decent video card is installed, then this option will provide an increase to the speed of generating terrain erosion data. It is off by default for compatibility. It was developed with a DX11 card, but should also work with a DX9 compatible card. If using this option causes errors then please send me the error at support@room805.net and then uncheck this box to use the CPU. The CPU version was written with Unity Jobs so should also be quick, just not as quick as the GPU.
Simple Erosion Settings
Erosion Amount
In the simple settings there is a single setting for the erosion amount. Changing this setting will modify the advanced settings to either make the erosion more or less aggressive.
Advanced Erosion Settings
Rain Drop Density
This determines the total number of drops to be placed and rolled down the terrain per 128x128 section of the terrain to keep a consistent erosion value around the map regardless of the size.
The value to the left is a value of 5 while the value to the right is a value of 30. All of the screen shots below are using a rain drop density of 10.
Maximum Sediment Drop
The amount of erosion that is picked with each movement downhill depends on how far a drop falls between one step and the next. This is the maximum drop that the amount of the fall matters.
The image to the left has a value of 0.1. The value in the middle is 0.5. The value to the right is 5. The higher the value the more sediment will be carried with the drop.
The below photo is a rain drop denisty of 30 with a rain drop height of 5. At this point the terrain’s steepness has been flatnened and the river bed below has spread out.
Sediment Percent
This value is a measure of how much sediment or height from one location is brought down to a lower location. If the value is set to 0.5, then when the value of the terrain is reduced by 1 in one location, it will add 0.5 terrain further down. The default value is 0.5.
The value to the left is set to 0.1, to the right is set to 1. The default value is 0.5. A value of 0.1 is used to mimic a hard rock like granite, while a value of 1 will create something akin to a pile of mud.
Minimum Sediment
This value determines how much sediment must be picked up from higher elevations before it will start to increase values at lower elevations. This value is also dependent on the sediment percent value. If the sediment percent value has been set to 0.5 and the Minimum Sediment to 1 then only 2 meters of elevation must be collected before it starts to raise sediment in lower elevations. Really high values for this setting essentially turns the ability to drop sediment off as the drop never collects enough sediment to ever drop any off.
The value to the left is set at 1 while the value to the right is set to 200. It is clear that no sediment was dropped on the right.
Maximum Sediment
This is the maximum amount of sediment that can be collected in the drop before it starts to drop sediment to lower levels. At very low settings the terrain will look create hard features.
This value is used in tandem with the minimum sediment setting and the sediment percent. The minimum value this can be set at is the minimum sediment. For the following examples the sediment percent has been set to 0.5.
In the photo to the left the minimum and maximum sediment value is set to 1.
The photo the right has the rain drop intensity set to 20, the sediment percent set to 0.4, the minimum sediment set to 35, and the maximum set to 40. These settings have created a land scape with sharp features at higher elevations with smoother features below them.
Minimum Difference
This setting can change when the rain drop stops. After sixteen steps down the terrain, the average of the previous height changes are tallied with each new step down. If that average drops below this setting’s value, then the rain drop is stopped. Changing this value will noticed in smoother sections of the terrain. If generating the terrain is taking longer than expected, raise this value to avoid the rain drop traveling in flat area for too long where it make’s little difference.
Terrain Settings
These settings pertain to how the terrains are created using the generated data.
Terrain(s) Parent
As explained in the Quick Start guide, this is the game object that all of the terrains will be created under. This object will have a component added to it to save some details about the terrains created.
Terrain Material
This is the Material that the terrain will use. For the standard renderer this will be set correctly by default. However, for other rendering modes the correct material will need to be selected. A custom material can be selected here. If the terrain can not be seen then this is likely wrong.
Terrain Pixel Error
This sets the Pixel error level for all of the created or updated terrains. https://docs.unity3d.com/Manual/terrain-OtherSettings.html
World Terrain Split
This setting determines how many terrains this world data will be split up into. The default value is “Single Terrain”. This means that all of the world data will be put into a single Terrain. However, the max Terrain resolution is 4097x4097. This means worlds larger than 4k in size will lose detail. It is recommended to keep terrains 2k or smaller for best performance. The largest value that can be set is 32 x 32 terrains. This means 1024 terrains will be created.
Terrain Resolution
This is the resolution of every terrain that is created. This setting works in tandem with the World Terrain Split setting. The largest terrain resolution that can be selected is one meter in resolution for every one meter in world size.
For example, if the world size is 8x by 8x and the world split is set to 4x4 terrains, then the max resolution for all terrains will be 2049x2049 (8 / 4 = 2). This combination would created 16 terrains each with a resolution of 2049x2049.
Note: Once the terrains are created, they cannot currently be split up. A future release will allow the terrains to be split up in a configuration different than their original creation.
Max Terrain Height
This is the max terrain height for each terrain. This is auto filled with the current highest terrain value in the current data. If this terrain will be manually edited later, and it might require setting the terrain higher than this, then enter a new value.
Note: The higher this is set, the less height resolution a terrain will contain. This is typically only noticed after 8000 or so though.
This setting will not change the height data of the world data. Setting the Terrain height on the Terrain component settings directly after the terrain is created will scale all of the height values in just one terrain, so it is better to set this setting before the terrain is created.
Update Terrain
This is the magic button that either creates or updates the current terrains in the scene under the game object selected under “Terrain(s) Parent”
Export Raw Image
This will create a raw 16-bit uncompressed grey scale image of the terrain data instead of using it to create the terrains.
This file is created inside the RawExports folder.
This is useful for updating the terrain in a graphics application like Adobe Photoshop or using it in a third-party terrain tool like Gaia. It can also be used as a file for the import raw function.
To use RAW files here as a Gaia Stamp see the Gaia documentation: https://proceduralworlds.freshdesk.com/support/solutions/articles/33000255157--gaia-scanner
An example RAW file opened in Adobe Photoshop on 4k terrain data centred at 36.101731, -112.096108
Experimental Features
Warning, these are features currently in development. They have been included for demo purposes. They will be finished in a future release of Ultra Terrain Tools.
Split Terrain into Scenes
Each Terrain is copied into a new scene. These scenes in a folder with the same name of the current scene. This should not be done until the terrain is exactly as it is needed. Once each terrain is on its own scene the scenes can be opened and other objects can be placed on it. This will leave the scene itself as it is in order to make sure everything is correct before clicking the next button. I would suggest making a backup of the project for clicking the next button.
Set Main Scene for Dynamic Loading
After all Terrains have been set as they should be, this button will set the current terrains to the lowest resolution, and will set up regions for loading in the scenes created during the “Split Terrain into Scenes” functions.
Conclusion
Thank you again for your purchase. With a little trial and error with the settings you can get the exact terrain you are trying to build.