[Introduction to Unity] How to use Terrain Engine

When creating a Scene, the geographical features such as the ground, sea, mountains, are essential.

You can get them from Asset Store, but you can also create your own world by using a function ‘Terrain Engine’ available in Unity.

In this article, I will show how to create terrain with ‘Terrain Engine’.

Create terrain

In the menu bar, select ‘GameObject > 3D Object > Terrain’.

Select ‘Terrain’

Now, a ‘planar’ terrain model has been created.

A terrain model has been created

We make it look more realistic.

Create upheavals and depressions

Since the created terrain is flat, we are going to add realistic upheavals and depressions.

In the Inspector window of ‘Terrain’, there is a group of icons (tool buttons).

The tool buttons in the Inspector

Those are the tools to edit terrain.

Select the leftmost tool button ‘Raise/Lower Terrain’ to display the items for editing, at the bottom of the window.

Select ‘Raise/Lower Terrain’

With a brush in the ‘Brushes’ palette selected, click or drag the mouse to add irregularities to the terrain.

When moving the mouse pointer to the Scene window, it changes into a blue shadow-like pointer. Then place it where you want to add irregularities and click the mouse to add them.

Create upheavals and depressions with a brush

In ‘Settings’, ‘Brush Size’ defines the size of the brush and ‘Opacity’ defines ‘variation width’.

The word ‘variation width’ might not describe how ‘Opacity’ works very well, so let’s compare the actual results with Opacity set to 10 and 100. In both cases, I draw in the same way with the same settings except for Opacity.

Drawing with Opacity set to 10

Drawing with Opacity set to 100

I think the above animations gives you an idea of what ‘variation width’ is.

Create plateaus

Next, create plateaus.

Click the second tool button ‘Paint Height’ to display the settings below.

The setting for ‘Height’

‘Brush Size’ and ‘Height’ work in the same way as those for ‘Raise/Lower Terrain’.

By setting the ‘Height’ value, you can create the plateaus with the specified height.

Then, in the Scene window, draw in the same way as ‘Raise/Lower Terrain’ to create plateaus.

Create plateaus

Now, you have added some plateaus.

Set up textures

Next, apply textures to the terrain.

Prepare the materials for texture

Firstly, import a free texture asset for the terrain.

Download and import the ‘Terrain Textures Pack Free’ asset from Asset Store.

Terrain Textures Pack Free

Add texture to Terrain

Select the ‘Paint Texture’ tool button and press the ‘Edit Texture’ button to attach a texture to Terrain.

Apply texture #1

It displays a pop-up window, so select ‘Add Texture’.

Apply texture #2

Then the ‘Add Terrain Texture’ window pops up, so click ‘select’ in the ‘Non (Texture 2D)’ box on the left.

Add texture

It brings up a list of textures. You can choose any, but let’s select ‘GrassUV01’ this time.

The list of textures

Close the window and click ‘Add’.

Now, grass-like texture has been applied to the terrain.

Check the appearance in the Scene window

Add the second texture

Currently, the whole terrain has a single texture, so it’s not suitable for the world with multiple colour tones such as grass and rocks.

Therefore, in addition to the grass-like texture above, add wasteland-like texture to the terrain.

As with the first texture, select ‘Edit Textures > Add Textures’.

It brings up the window to select texture again, so select a texture with grey-ish colour.

Add the second texture.

Close the window. Now, you can paint the terrain with the specified texture by clicking or dragging the mouse.

Paint the terrain with the second texture

You can change the texture from ‘Edit Texture’.

Change the texture

Create forest

Next, plant the terrain with trees to create woods or forest.

Prepare the material for forest

Firstly, import a free asset of trees.

From Asset Store, download and import the ‘Free Trees’ asset.

 

‘Free Trees’ asset

Add trees to the Scene

Click the ‘Paint Trees’ tool button and select ‘Edit Trees > Add Trees’.

Select ‘Edit Trees’

Then the following window pops up, so click the button on the right.

Click the small button on the right

It brings up the list of the imported trees, so select your favourite one.

The list of tree assets

With a tree selected, move the mouse on to the Scene window. Then the pointer will change into a light-blue marker. Click the mouse to place trees.

Place trees by clicking the mouse

Trees are added automatically by dragging the mouse.

Add trees by dragging the mouse

Place trees in the Scene

Create a lake

Next, create a geographical feature like a pond or lake on the terrain.

Unity doesn’t have a pond or lake-like feature by default, so make a basin on the terrain and pour water into it to make a similar feature. 

Import the ‘water’ material

Let’s import the ‘water’ material first.

In the manu bar, select ‘Assets > Import Package > Environment’.

Import the ‘Environment’ package

It brings up a pop-up window to import packages, so press ‘Import’ with all the packages selected.

Import all the packages

After importing the packages, in the Project view, check if there is ‘WaterProDaytime’ in Assets/Standard Assets/Environment/Water/Water.

This is the material of water we use this time. By the way, ‘WaterProNight’ is the water for a night scene, as the name suggested. So, use it if you place water in a dark scene.

Select the Water Prefab

Make a basin

Next, make a basin on the terrain.

In the Inspector of Terrain, set up the parameters for ‘Paint Height’ as follows.

The setting for ‘Paint Height’

Draw a circle with upheavals by dragging the mouse in the Scene, shaping a basin.

Create a basin

Place ‘WaterProDaytime’ in the Scene

Drag ‘WaterProDaytime’ from the Project view and place it so that it fits into the basin on the Scene.

Place ‘WaterProDaytime’

If the size doesn’t fit, adjust the ‘WaterProDaytime’ by scaling and moving it.

Upload the terrain to STYLY

You can also upload the created terrain to STYLY.

However, if you upload the terrain created with Unity to STYLY as it is, it will cause some problems, for example, you won’t be able to scale or rotate it. In the worst case, you can’t even upload it due to the file size. So, please refer to the following two methods to upload a terrain to STYLY.

The first one can be used for free, but it has drawbacks; only one main texture can be applied and trees cannot be reproduced, requiring another method to place trees in the STYLY’s scene.

The second one can’t be used for free, but you can apply multiple textures and it can reproduce trees.

Congratulations. This is the end of the introduction to the basics of Terrain Engine.

If you can handle the terrain as you like, you will make more variations for your VR-space design.