banner



How To Draw On Terrian In Unity

For some fourth dimension at present, Unity has been changing its APIs to use a data-oriented model, as Scriptable Objects and Addressables clearly demonstrate. The primary thought is to rely on data rather than systems. That data is an asset in your projection — a file on your hard bulldoze.

In the by, working with terrains was a nightmare if yous had also many scenes. At present, nonetheless, Unity has improved the Terrain Tools to use the same architecture. This tutorial is near the new Terrain Toolbox API and new features in the Terrain component.

By the end of this tutorial, you'll:

  • Know how to install the Terrain Tools API and understand its user interface.
  • Sympathise the new Terrain Toolbox workflow.
  • Be able to create new terrains.
  • Acquire about Heightmaps and Splatmaps.
  • Learn about layers and painting terrains.
  • Discover all of the new brushes and some masks.
  • Create your own landscapes.

Note: This tutorial assumes you already have basic feel with Unity. If you're new to the subject area, check out this Unity for Beginners series first. Additionally, this tutorial assumes y'all're using Unity 2020.3 (LTS).

You'll go plenty of practice creating peaks and valleys, culminating in a full mountain scene.

And then what are you waiting for? Dive in!

Getting Started

Download the sample project by clicking the Download Materials push button at the top or lesser of this tutorial.

Unzip the files to a convenient location. After extracting, y'all'll see the Starter and the Last project folders. Feel free to explore these projects to familiarize yourself with their contents.

When you're prepare, open the Starter projection in Unity and buckle up.

The projection contains some folders to help you get started. Open up Avails/RW, and yous'll run into the following:

Folder structure and assets in your project

Hither'due south what each contains:

  • Scenes: The scenes yous'll work on and the related assets yous'll use. Each scene is specific to one part of the tutorial, and the concluding one brings everything together.
  • Scripts: A premade script to command the Camera.
  • Skyboxes: The skyboxes used in the project.
  • Terrain Avails: Terrain brushes, layers and textures.
  • Terrains: The terrains you'll create. As you'll see afterward, these form your TerrainData Directory.
  • Unity Settings: The Universal Render Pipeline settings this projection uses.

All the necessary assets and scenes are arranged and numbered inside the Scenes folder.

The starter project already contains the packages you lot need to get started. All the same, you lot'll withal demand to import two additional packages: the new Terrain Tools and an Asset Sample Pack. These volition let you utilise the Terrain Tools at maximum power.

Installing the Terrain Editor

First, go to Window ▸ Parcel Manager and select Unity Registry in the Packages drib-down menu in the upper left corner. Select the settings gear in the superlative correct, then select Avant-garde Project Settings. Make sure the Enable Preview Packages option is checked.

At present, in the search box in the upper correct corner, enter Terrain Tool. The Install push button volition announced in the bottom right corner. Printing it and wait until the download completes.

How to install Terrain Tool

I parcel down, ane more to go!

Installing the Terrain Tools Sample Asset Pack

At this point, you've installed the Terrain Tools. To get the well-nigh out of them, all the same, you'll need some brushes and textures.

Next, you'll download the free Terrain Tools Sample Asset Pack by clicking the Download Asset Samples from Asset Store button, which is also in the Package Manager.

The button to download the sample asset pack

One time you do this, a browser window opens showing the Unity Asset Shop. Click Open up in Unity, as shown below. Finally, back in Unity, press the Import button in the Terrain Tools Sample Asset Pack window, and you're good to go. Make sure to check all the boxes!

How to download an additional package of tools for the Terrain Tool

Note: There are two things to watch out for hither:

  • If you lot see an Add to My Assets button instead, you might have to sign in to your Unity account. Recall to sign in to the aforementioned business relationship as yous did in the Editor.
  • If Unity hangs on Update, press the Open in Unity button in the website again.

Finally, you're done. Now, tighten that seat belt considering the ride's well-nigh to begin!

Agreement the Terrain Toolbox as a Toolbox

Before diving in, accept a moment for some necessary theory. In that location'south no way to emphasize plenty the importance of understanding the core concept behind the new Unity Terrain Toolbox. If yous're a Lord of the Rings fan, you tin can recall most the Terrain Toolbox like this:

One API to rule them all,
One API to detect them,
One API to bring them all
And in the Terrain Toolbox bind them.

All terrain interconnects through the new Toolbox

(United nations?)fortunately, at that place are no rings, no darkness and no Lord of the Terrains in here — just the Terrain Toolbox does bring all your terrains together and rules them all.

Post-obit this metaphor, the Terrain Toolbox is a existent toolbox. This API is an interface between all your scenes and your Projection files. If you need to do annihilation with terrain, the Terrain Toolbox is your one-cease destination.

Note: Remember, terrains are avails stored in your project.

Then how does the Toolbox wait? Get to Window ▸ Terrain ▸ Terrain Toolbox and open it.

How to open the Toolbox

Basically, it's a window containing a toolbar with some buttons on the top. Those iv buttons are the master Toolbox tabs.

The Toolbox and its toolbar

And that's all yous need to know to get started! Next, yous'll create your get-go terrain and start using the toolbox.

Getting to Know the "Create New Terrain" Tab

First, expect at the Create New Terrain tab. It goes without saying that this is the tab where you create terrains. Nevertheless, since Unity has added and then many new features, you lot'll get to know them one by one. Retrieve, the new Toolbox handles not just one, merely lots of terrains at a fourth dimension.

To get-go, open Scene 0 located in RW/Scenes/Scene 0.

Note: As yous tin run into, the proper name of the scene is Creating New Terrain because that's what you lot volition do. But, for the sake of simplicity, in the hereafter this tutorial will merely call them Scene N, with N beingness its number.

Notice that this tab has five sections:

  1. General
  2. Import Heightmap
  3. Gizmo
  4. Preset
  5. Options

The New Terrain Tab with its different sections highlighted

Next, you'll examine the most common and useful options of each department.

Creating Your First Terrain

The options department is the last on the folio, so it may seem strange to get-go with it. However, TerrainData Directory is where Unity will store all of the terrain avails you lot create. You'll want to ready this up first to make sure everything is saved in the same place.

Click the Ellipsis icon. In Explorer, select the existing folder, Terrains, from the path: Using the Terrain Tools in Unity Starter/Assets/RW/Terrains.

Next, in the General department, enter the following values:

  • Full Terrain Width(yard): 8000
  • Total Terrain Length(m): 8000
  • Terrain Summit(m): 3000
  • Group Settings ▸ Tile Tiptop Resolution: 1025

Y'all'll learn more about these options in the next section.

Finally, set the fabric to use for the generated terrain. In the General section, under Group Settings, find the Material Override and select the TerrainLit textile from Packages/Universal RP/Runtime/Materials, like this:

How to recover the TerrainLit material for the terrain

Now, click Create.

Lo and behold… congratulations on your first terrain!

Looking Over Your First Terrain

The new terrain looks like this:

A Terrain consisting of a black background with a gray trapezoid on it

Notice that at that place are three toggles at the lesser of the Options section:

The three toggles in the Options menu

Here'south what they do:

  • TerrainData Proper name Enable Guid: Appends a GUID to the name of the terrain, ensuring each terrain asset is named uniquely.
  • Replace Terrains: Keeps the TerrainData file intact, just updates the values and mesh.
  • Enable Machine Generate Lighting: Enables that option in the Lighting tab by default.

Now, for the adjacent step in the tutorial!

Understanding the General Department

The General section might seem daunting at first sight, merely if you scan the text, y'all'll discover information technology's but a specialized Transform Component.

You've already used Height, Width and Length components. They do just what they describe — set the height, width and length of the terrains you lot create.

Amongst others, Tiles and Grouping ID are new features.

Group ID is merely a number for making groups of terrains that are located well-nigh each other. Imagine, for instance, that you need to create distant mountains. You'd create a new group to keep those mountains together, and to ease distancing them from your other terrain in the scene.

Continue an center on Tile Tiptop Resolution. Very frequently, people overexaggerate the polygon count. In this tutorial, you'll use 1025.

Besides, for brevity, this tutorial will abbreviate Tile Height Resolution as THR or, merely, Resolution.

Notation: The bachelor values for THR may look strange at first, just these are all merely (power of 2) + 1. Working in powers of two is mutual when dealing with textures and tiles, as information technology helps these values fit nicely into a estimator'due south memory.

What? Y'all don't believe people overexaggerate? Feel free to change the THR values and run into for yourself!

THR 33:
A picture showing a wireframe version of a terrain at 33 THR

THR 65:
A picture showing a wireframe version of a terrain at 65 THR

THR 129:
A picture showing a wireframe version of a terrain at 129 THR

THR 257:
A picture showing a wireframe version of a terrain at 257 THR

THR 513:
A picture showing a wireframe version of a terrain at 513 THR

If you lot spend also many triangles on terrain, your figurer won't have any time left over to render your other models, like your wizards and hobbits. As a dominion of thumb, if your mesh looks solid green and y'all can't see its triangles, y'all probably accept the resolution besides high and can lower information technology down!

Now, yous'll learn about some other cool feature.

Introducing the Cool New Gizmo Feature

At last! Unity added a terrain gizmo. Activate it by clicking the checkbox side by side to Gizmo in the Create New Terrain tab.

How to activate the terrain Gizmo

With this tool, it's easy to check the boundaries and overall height of your terrains. It besides gives you an intuitive idea of the extension a terrain has. Unfortunately, you can simply use it on i terrain at a time.

What's information technology expert for? For example, say you desire to raise your overall terrain top by 50%. The gizmo will clearly bear witness you both positive and negative headroom, like this:

Gizmo tool showing the headroom of a terrain

Take some time to play around with all the features. Create equally many terrains as y'all want. When you're ready, go to the next function… where the real fun begins.

Importing Heightmaps

Heightmaps are among the most important and fun tools at your disposal.

Before you begin, switch to Scene i, located in RW/Scenes/Scene 1.

Yous'll discover every folder has a number. That'due south because they follow an asset-oriented blueprint that relies on instances of objects, so it's useful to know which scene they belong to.

Now, go to the Terrain Toolbox. Select the Create New Terrain tab and click the Import Heightmap toggle to activate information technology.

Import Heightmap box of the Toolbox

Inside Scene 1, there's a heightmap that'southward gear up for yous to use.

How to set up the heightmap to a 16 bit red channel

Note: Although the heightmap is a grayscale image, Unity uses the red channel for it. It's of import to make sure to verify its format in the inspector before proceeding. Otherwise, it won't work.

At present, make sure the texture format of Heightmap 1 is R xvi chip, so drag and driblet it inside the empty box on the Toolbox'southward Import Heightmap section (the Select Texture field).

How to drag and drop a texture to the Heightmap in the Toolbox

Now, get dorsum to the General section and use these values:

  • Width: 8000
  • Length: 8000
  • Pinnacle: 2500
  • THR: 1025

Finally, accept a deep breath and press Create. Behold!

A mountain created from heightmaps

Note: If you don't see the whole mountain, tweak the values of the camera on the Scene View.

Your Hierarchy volition now have a parent GameObject showing the terrain group and the terrain yous've merely created as a child.

Hierarchy of the Terrain GameObject

Look at the name and yous'll see it'south a niggling… long. Again, Unity appended this name with a GUID to proceed your terrain names unique. For the sake of this tutorial, rename information technology to Terrain_1.

Select it and y'all'll encounter the same old Terrain component in the inspector along with Terrain Data.

As a mental annotation, Terrain Data is an asset. It'due south inside your projection, located in the TerrainData Directory you lot selected before. Click it and so you can rename it to Terrain_1, too.

Renaming the Terrain GameObject and the Data

Terrain Textures

Is that it? Of class non. Just for a piffling sense of taste, practise this:

  1. Select the Terrain_1 GameObject.
  2. Go to the Terrain component.
  3. Select the Paint Terrain tab.
  4. In the get-go dropdown below the row of tabs, select Paint Texture.
  5. Find the Layers section.
  6. Click Add Layer.
  7. Find TextureMountainLayer 1 and select information technology.

Boom!

This PNG explains how to assign a layer texture to terrain

Await, information technology doesn't wait so good? Gotcha. Go to the Terrain Settings tab in the same component and conform Base of operations Map Distance to maximum.

This GIF shows how to adjust the Base Map Distance.

This is the last result:

an image showing a mountain with the texture applied

And there you lot go. Next, you'll take a look at the Terrain Settings tab.

Exploring the Terrain Settings Tab

The Terrain Settings tab on the Toolbox is exactly the same equally the Terrain Settings tab on the Terrain component… only you can only utilise the old, every bit you lot've read before, to all terrains.

So this…

Terrain Settings Tab

Is the same as this:

Terrain Settings in the inspector

The difference is that, now, you lot tin apply changes locally to each terrain, through the Terrain component, or globally to all terrains in the scene, through the Terrain Toolbox.

If you want to know more near basic settings, please also bank check this amazing tutorial by Brian Moakley Introduction to Unity: Terrain Generation.

Terrain Utilities Tab

Welcome to one the most of import tools. Terrain Utilities is where the Toolbox really exploits its "one-for-all" ability.

Every bit a quick introduction, this tab allows you to safely erase terrains. No more lost terrains cluttering your project. As well, you can manage all your layers and splatmaps from here.

Looking at the Terrain Edit Section

In the by, information technology was common to forget about your terrains and end up having lots of unused files. The worst-case scenario was to erase an of import terrain. Equally you know, they're assets, so if you erase them… there'southward no undo.

Finally (!), you can get rid of unneeded terrains safely. Just select a terrain and click Erase. Unity will take care of the TerrainData for yous.

Reviewing the Terrain Layers Section

To brainstorm afresh, open Scene two. It's your plough to practise. Your goal is to repeat the process of creating a terrain using a heightmap texture.

Use the values beneath in the Full general settings, then add the heightmap located in Assets/RW/Scenes/Scene ii/Heightmap 2. As ever, remember to rename the GameObject and the linked TerrainData object, like you did earlier. This helps you lot keep track of them.

  • Width: 8000
  • Length: 8000
  • Peak: 2500
  • Resolution: 1025
  • Base Map Altitude: 20000

How to create a mountain using a heightmap.

Recollect, practice makes perfect!

Next, it's time to expect at terrain layers.

Examining the Layers

Before you proceed, try to wrap your head around this: A Terrain Layer is an nugget. It's a file in your project that holds textures to paint Terrains. Textures are also assets. Terrains are assets. Palettes are assets. Textile Palettes are assets. You are an asset. The author of this tutorial is an nugget. Ray Wenderlich himself is an asset… the whole earth is an asset! :]

Joking aside, you lot have to be extra careful near which asset's values you're changing. Otherwise, if you're looking at a global asset, yous'll cease up changing global values. The solution to this is to learn to properly utilise and edit Layers.

Navigate to Assets/RW/Scenes/Scene two/TerrainLayers 2 to explore the layers yous need for this part of the tutorial.

You tin can always create new layers by right-clicking in the Unity Editor window and selecting Create and then Terrain Layer. Yous'll then add the relevant Diffuse, Normal Map and Mask Map textures.

Now that you have an overview of layers, yous tin can create palettes.

Creating Palettes

Layers in the Toolbox work exactly as they do in popular programs similar GIMP, Substance Painter and Photoshop. They stack on superlative of each other and blend co-ordinate to alpha values:

How layers stack to make a texture

A palette is just a group of layers. It'southward a key chemical element in the hierarchy of tools in your toolbox:

How textures, layers and palettes relate to each other

To create one, go back to the Toolbox, navigate to Terrain Utilities and, in the Terrain Layers section, click the Plus push to add a new layer.

How to create a new palette

Select snowfall 2 from the assets you only saw, then drag and drop it into your new layer slot.

Gild matters here (the top layer will be rendered over all of the others), so repeat this process with dirt ii, and then moss 2, and finally rock two to consummate your palette.

This GIF shows how to add four layers to the Terrain Layers to create a New Palette

Finally, press the Save button in the top right of the Terrain Layers section to save this group of layers as a palette preset. Yous will be prompted to create a new palette; printing OK. For like shooting fish in a barrel reference, you tin relieve it to the aforementioned path as the layers: Avails/RW/Scenes/Scene 2/TerrainLayers 2. Name this palette something comfy, like PaletteScene ii.

Adding the Palette to the Terrain

Washed! Now, you're ready to add together the palette to your terrain. Select your terrain in the Scene view and click the Add to Terrain push button.

Where the Add to Terrain button is

Your mountain will now be snow-tinted, like this:

A mountain tinted white

Note: Remember, the order of layers in a palette matters. You tin can play around with changing this guild to run into how the terrain textures change.

Next, you lot'll learn how to use splatmaps to make this mountain more awesome!

Introducing Splatmaps

A splatmap is a texture that uses its own colour channels as layer masks. Ordinarily, a splatmap uses 4 channels: green, blueish, cherry-red and alpha.

That ways, instead of painting snow, rocks and grass directly, you pigment green, blue, cerise and alpha. This decouples the painting process from the called textures.

Suppose tomorrow, you make up one's mind to change the snow texture to… er… lava. You'd only need to alter the texture, non the paint strokes.

In practical terms, yous could accept:

  • Snowfall on the greenish channel.
  • Rocks on the bluish one.
  • Grass on the red one.
  • Dry grass on the alpha.

Notation: URP supports upwards to iv layers per splatmap.

So, how tin can yous utilise a splatmap to your mountain?

Applying Splatmaps

Within your toolbox, go dorsum to Terrain Utilities and locate Terrain Splatmaps.

Where the Terrain Splatmaps tab is

Click the Plus push to add a new splatmap, only like you did to add a new layer. Drag and drib RW/Scenes/Scene two/SplatMap 2 into your new splatmap slot, and so click Apply to Terrain.

One more than step for the magic: Make sure your Terrain object is selected in the Bureaucracy, then click Apply to Terrain… and curiosity!!

How to apply a splatmap to a terrain with layers.

To recap, each layer in your palette corresponds to a color in the splatmap: Unity paints snow everywhere it's crimson, moss everywhere it's blue, etc. Again, order matters here. Feel costless to reorder the layers in your palette to swap the channels in your splatmap.

The final result:
A mountain after applying splatmaps to it

Experimenting on Your Ain

In many means, creating terrain is an organic procedure; sometimes peachy results come from randomly tweaking numbers and painting Picasso-esque heightmaps/splatmaps.

Before proceeding, yous can take some fourth dimension to practise and strengthen your cognition. Scene 3 is your playground. Endeavour out everything you've learned and experiment. Call up to check the terrain values, specially the height, and combine layers to become different results.

Once y'all're ready, you'll learn tools for adding more detail and create an entire scene you can explore!

Importing and Saving Presets

Hope you loved that last mountain! The toolbox has some other superpower: Yous tin can save pretty much everything equally a… can you approximate? Yes! An asset. You can salve well-nigh any change y'all brand in the Toolbox as a Preset.

For case, your palette for Scene 2 is a preset. If y'all go back to Terrain Settings, you'll too notice a Preset section. The procedure is the same every bit before: click Save to convert that preset into an nugget. Don't repeat yourself!

Exploring the Terrain Visualization Tab

Terrain visualization uses the aforementioned concept as splatmaps. Unity lets you tint different heights so yous can visualize them better. For example, it could assist you select better heightmaps or check the overall peak of different parts of your terrain.

Too, recall this tool is relatively new; Unity volition surely expand on it.

To enable altitude visualization, in the Terrain Toolbox, get the the Terrain Visualization tab. In the Visualization Modes dropdown, select Altitude Heatmap. You can utilise the Levels slider and list of levels to adjust the bands of colour to your liking.

Heatmap function of the Terrain Visualization

Revisiting the One-time Terrain Component

The Terrain Toolbox is the new, shiny terrain utility from Unity. Simply information technology'due south not the first time they've added features to create terrain, and many of the previous tools are notwithstanding accessible alongside the new terrain organisation.

In this department, you'll learn the fundamentals to create terrain by hand — particularly, the fundamentals for painting.

Open Scene 4. This scene has six terrains, which were created with just one click using Tiles. Each ane has an assortment of signs with titles. The signs along the 10 axis represent tools, and the Z axis has an empty infinite for you to use.

Note: It's important yous go through the list. This will assistance you know which tool serves you better in the future.

Select Terrain_4 within of TerrainGroup_0; you'll see the Terrain Component.

The Terrain Component

There is a row of tabs inside of the Terrain component. These tabs are, from left to correct:

  • Create Neighbour Terrains
  • Paint Terrain
  • Paint Trees
  • Paint Details
  • Terrain Settings

Now, y'all'll explore each department in more depth.

Create Neighbor Terrains

The showtime button on the list lets you lot create neighbor terrains intuitively. When you click it, Unity will brandish squares to show yous where to create one.

The New Neighbor Icon

Just click where you want your new terrain to be and that's it. You lot tin can rename the new terrain and the related TerrainData component every bit Terrain_4_1. Make it a child of TerrainGroup_0 to better organize the scene.

How to create a new neighbor terrain

Paint Terrain

Now, spoiler alert, this is some heavy-duty stuff. The Paint Terrain has eleven unlike operations — and 4 of them have suboperations. That'due south why information technology'due south so of import to follow forth with the examples at to the lowest degree once.

Paint Terrain tools operations

Hither are a few useful keyboard shortcuts:

  • A: Brush strength.
  • Due south: Brush size.
  • D: Castor rotation.
  • Command: On some brushes, this inverts the result. For others, information technology works equally a modifier.
  • Shift: Enables the smoothing castor.

Side by side, you'll notice a large list of all brushes with a petty example for each.

Reviewing the Brushes

Take into account that most brushes depend on a myriad of tweaks that change the result drastically. So, these examples are just for illustration, but try to follow them.

Top Brushes

The Set Height title

This tool sets an absolute top for the terrain, whether it'due south in Earth or Local space.

How to use the Set Height Brush in Unity

Raise or lower terrain title

Raise or lower the current peak of the terrain. Use the Control primal to make the value negative and cleave the surface.

How to use the Lower or Raise Terrain tool

Paint Brushes

Paint Texture title

Paint textures onto the terrain manually.

How to use the Paint Texture tool

Paint Hole title

Remove chunks of the terrain completely. Use Control to erase holes.

How to use the Paint Hole tool terrain

Postage stamp Brushes

Mesh stamp title

This tool allows you to select a mesh you like and paint with it. Y'all tin utilise the mesh in Scenes/Scenes 4/Geometry for practice.

How to use the Mesh Stamp tool terrain

Paint Stamp Terrain title

Whereas the Mesh Stamp allows you to stamp with a 3D mesh, Postage stamp Terrain uses the 2D brush image.

How to use the Stamp Terrain tool

Sculpting Brushes

Sculpt Bridge title

This tin create an incline. Command-click the terrain once to kickoff. Click the target once to terminate.

How to use the Sculpt Bridge tool

Sculpt Noise title

This tool is crawly! Adding noise into your terrain is an important aspect to making information technology feel natural. Practise a lot with it.

How to use the Sculpt Noise tool

Sculpt Terrace title

This creates a terraced event. For when you want to Minecraft your terrain. :]

How to use the Sculpt Terrace tool

Sculpt Clone title

This tool works like the Sculpt Bridge. You click to select an area yous want to copy from, so click the role y'all want to copy to.

How to use the Sculpt Clone tool

Erosion Brushes

Erosion Hydraulic title

Simulates erosion acquired by water.

How to use the Erosion Hydraulic tool

Erosion Thermal title

Simulates erosion acquired by freezing/thawing temperature cycles.

How to use the Erosion Thermal tool

Erosion Wind title

Simulates erosion acquired past air current.

How to use the Erosion Wind tool

So much erosion! Here's a reminder to conserve and establish some trees. :]

Transform Brushes

Transform Pinch title

Pinches the terrain, excels at creating sharp points. This tool is skilful for making Italian meringue!

A GIF showing how to use the Transform Pinch tool

Transform Smudge title

Smudges the terrain elevation in the management of the brush. Information technology'south like kneading the dough for a pizza.

How to use the Transform Smudge tool

Transform Swirl title

Twists the pinnacle into a swirling pattern. Awesome for swirl lollipops or some cinnamon rolls. :]

How to use the Transform Swirl tool

Result Brushes

Effect Contrast title

Accents the contrast betwixt lower and higher terrain.

How to use the Effect Contrast tool

Effect Sharpen Peaks title

Sharpens summit features.

How to use the Effect Sharpen Peaks tool

Effect Slope Flatten tool

This flattens terrain while maintaining any slope in the acme.

How to use the Effect Slope Flatten tool

In the side by side section, you'll expand your knowledge about painting terrains by using brush masks.

Introduction to Brush Masks

In this short section, you'll exam castor filters. You already know how to create a new terrain. Open Scene 5 in RW/Scenes/Scene 5.

Import the heightmap from RW/Scenes/Scene five/Heightmap 5 and utilise these values as General Settings:

  • Width: 4000
  • Length: 4000
  • Pinnacle: 2000
  • Resolution: 1025

As e'er, remember to rename the TerrainData object, like you did before, to keep rail of information technology. Press Create. The upshot volition look like this:

Terrain on Scene 5 without textures

Now, in the Toolbox, go to the Terrain Utilities tab, open the Terrain Layers section, and select the Palette Scene 5 preset. And then add i more layer using Texture Layer five by hand. Finally, move that layer you just added up to the outset place and press Add to Terrain.

How to apply layers by hand to the terrain on Scene 5

In this case, yous don't utilize splatmaps considering you lot're going to paint by hand.

Brush Mask Filters

What's new about brushes? Well, they're now 16-scrap. As well, Unity added Filters. You'll use a couple of them for this tutorial, but you should test them all because they're super fun.

Note: Call back, heightmaps are textures that use the red aqueduct. Brushes are exactly the aforementioned — because they are heightmaps.

How would you go virtually painting a slope? Nah, it'due south easier than that. Unity has a slope filter at present.

To apply it, select your terrain. Go to Terrain in the Inspector and select the Paint Terrain tool. After that, select Paint Texture in the dropdown.

Below all of the unlike brush textures, y'all should come across Brush Mask Filters. Click the Plus icon and select Slope.

Find the Middle icons on the left? They activate and deactivate filters. Your new Slope filter should already be active.

Select the Remap Curve; this is what volition be interpreted as a slope. The flatter the bend, the less of a slope in that location needs to be for the brush to apply the texture. Select the linearly increasing line at the bottom, then right click the green line and select Add Primal. Move that key to (0.95, 0.3). This should create a green line with a sudden, precipitous rise towards the very terminate.

Select some cloth, like snow, and examination it.

How use brush filters

Nice, huh? Endeavor one more. Deactivate Slope and add a Concavity filter. This volition only paint surfaces that are concave or convex, depending on if you select Recessed or Exposed. Now, requite it a try.

How to use filters on brushes to paint terrains

Combining Everything

You've made it this far. Guess what? Information technology'south claiming time!! In Scene 6, you can utilize everything yous've learned and so far. Practice everything. Endeavor everything. Endeavor different lighting setups to get unlike moods. You can likewise try varying photographic camera angles. Examination masks and unlike brushes. Experiment!

Equally usual, you'll discover a heightmap, a splatmap and lots of other things inside the Scene 6 folder.

When you lot finish, take a screenshot and post it on social media. Don't forget to tag us! It would be awesome to see what you lot're capable of.

Painting Details and Trees

As a final touch, you tin add details and trees to add some season to the scene.

You'll find a tree mesh in RW/Scenes/Scene 6/Tree/Tree and a detail sprite in RW/Scenes/Scene vi/Grass.

At this point, you know how to create your terrains. Think to apply both heightmaps at hand. Combine and create!

To add trees, but select a terrain, and so go to Pigment Trees in the Terrain component. Select Edit Trees, then Add Tree and elevate and drop the prefab Tree ii where it says Tree Prefab. Finally, click Add.

Now, you tin paint trees.

How to add trees to terrains

To add some details, just select a terrain and go to Paint Details in the Terrain component. Select Edit Details, so Add Grass Texture and select Brush_Grass_01. Finally, click Add.

Now, you tin can paint grass.

How to add details to the Terrain

Finally, here you take ii screenshots for inspiration!

Mountains with a single, bare tree

Mountains with two trees with leaves on them

Where to Go From Here?

You tin download all the projection files by clicking the Download Materials button at the top or lesser of the tutorial.

In this tutorial, yous learned to create and manage your own terrain landscapes using the new Terrain Toolbox API from Unity.

To further detail your landscapes, you lot can use these avails for costless from the Unity Asset Store:

  • Terrain textures
  • Grass and flowers
  • Trees

For more information, see this video about the Terrain Tools from Using Terrain Tools Tutorial from the official Unity YouTube channel.

We hope you enjoyed this tutorial. If you have any questions or comments, please join the forum discussion below. Don't forget to share your own terrains on social media and tag united states of america!

How To Draw On Terrian In Unity,

Source: https://www.raywenderlich.com/21911888-using-the-terrain-tools-in-unity

Posted by: davisbantais.blogspot.com

0 Response to "How To Draw On Terrian In Unity"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel