- How to make Terrain in Unity!
- Get Terrain Tools:
- Click Window > Package Manager and make sure we have All Packages selected and go under Advanced >Show Preview Packages and click Open.
- Search for Terrain Tools (it's a preview package) and click Install.
- Click Download Asset Samples from Asset Store button. Or we can click the Asset Store tab to open Asset Store and search for terrain sample assets.
- Download and Accept this free pack which features more brushes that you can use while sculpting and painting as well as some cool sample textures.
- Click Import and Import again to finish the setup.
- In our Assets folder, we can now find a Samples folder with all the Terrain Tools including
- BrushTextures
- TerrainBrushes
- TerrainLayers
- TerrainTextures
- Create a New Terrain:
- There are two ways to create a Terrain:
- Control-click the hierarchy > 3D Object > Terrain to spawn in a huge piece of terrain into our scene.
- Window > Terrain > Terrain Toolbox with a new window to easily set up terrains. Grab the Terrain Toolbox and dock it next to the Inspector window.
- We can change the Width, Length and Height of the Terrain.
- Hit Create to create a terrain in our scene.
- Now we have a new folder called Terrain in our Assets and within it we have a Terrain Data Object which stores all the information about our terrain such as where are the hills and slopes and which texture we apply.
- In the hierarchy we can also see a new object in the hierarchy called TerrainGroup_0 and within this a Terrain Object.
- This object has two components:
- Terrain Component: is used to configure our terrain and change our sculpting and painting settings.
- Terrain Collider: creates a Collider so that physics objects will interact with our terrain.
- Sculpt Terrain:
- Go to the Environment tab on top to disable the Fog so you can see everything clearly.
- Go to Lighting to make sure the Auto Generate (Generate Lighting) is turned off.
- In the Terrain component, select Paint Terrain tool. There are many modes.
- Raise or Lower Terrain:
- First, make sure that we have Raise or Lower Terrain selected and now we can choose various brushes to paint the terrain.
- Pick a soft brush, hover around our terrain and press to start sculpting.
- We can adjust the Strength (a), Size (s), Rotation (d) and Spacing (f) of the Brush.
- Shortcuts can be changed by Edit > Shortcuts...
- We can also hold down the Control to inverse the effect - lowering the terrain and reduce the size of the brush.
- Change Spacing will change the distance between each individual brushstroke and we can also use Scattering to randomly scatter our brush.
- Set Height:
- Change from Raise or Lower Terrain to Set Height which allow us to set the terrain to certain height.
- Drag the Height slide-bar to certain value and do a soft brush and increase the size.
- Now we can paint everything with this height.
- Smooth Height:
- Select Smooth Height mode and it allow us to smooth out our terrain.
- We can adjust the brush strength to reduce the impact of the smoothing.
- Add Noise:
- Select Sculpt > Noise to allow us to paint noise to our terrain.
- We can go to the Noise Height Tool Settings. We adjust the Scale of our noise such as (20, 20, 20), and change the strength.
- Now we can paint this type of noise and add details onto our terrain.
- Build Bridge:
- Select Sculpt > Bridge to allow us Control-click a starting point and then click another place in our terrain to create a bridge or road across it.
- Terrace:
- Select Sculpt > Terrace to divide our terrain into terrace or layers.
- We can adjust Terrace Count to change the appearance of the effect.
- Erosion:
- Select Erosion > Hydraulic to erode the terrain according to fluid simulation. We can change the Advanced option of the Simulation Scale of the Hydraulic Erosion Controls component to smooth out the terrain.
- Change Settings:
- Click the Terrain Settings tab of the terrain to change any settings. For example, under Mesh Resolution (on Terrain Data), we can change the Width, Length and Height of the terrain to (2000, 2000, 500).
- If we need to adjust the settings of multiple terrains, we can use the Terrain Toolbox to do that instead going to each one individually.
- String Multiple Terrain Tasks Together:
- The terrain system allows us to string together multiple terrain tasks.
- Click the first tab to create four neighboring terrains and the heigh data is going to seamlessly onto the terrain.
- We can create all four of them and start to paint.
- To do this we need to make sure that all the terrains sharing the same Grouping ID. Grouping ID can be found by clicking Settings tab and under the Basic Terrain. Also, they need to have the same resolution.
- Paint Texture:
- Change the mode to Paint Texture and working Terrain Layers.
- Click Edit Terrain Layers... > Create Layer... to create a new layer since there is currently no layers. (Add Layer... means adding existing layers)
- A panel will pop up and we can select a texture (e.g., dirt_albedo) to create a new layer.
- Now we can see a new texture for the Terrain Layer and the is a new object called New Layer in the Assets. Let's click it and rename it Dirt Layer.
- In the Inspector window we can see the settings such as Diffuse. We can also input the Normal Map by selecting dirt_normal and input the Mask Map by selection dirt_mask. We can adjust metallic and smoothness, and see the effect applies to our entire terrain. We can also adjust the Tiling Settings to, e.g., 10 x 10.
- Now we can add another Layer by clicking the Edit Terrain Layer... button and select Add Layer... In this sample assets, we can add rock layer, sand layer, scree layer, snow layer and moss layer. We are ready for painting.
- We can increase the Brush Size and play around the Opacity.
- Add rock, moss, scree. sand and snow to the terrain.
- Create Terrain from a Height Map:
- Height maps are gray-level images storing height information. White parts are high and black parts are low. There are lots of free height maps online.
- The format of the height maps needs to be ".raw" and we can use photo-editing software like Photoshop or Gimp to convert them.
- Drag the terrain into the Unity and add to the Assets.
- Go to the Terrain Toolbox > Create New Terrain > check the checkbox of Import Height Map > Select Heightmap File > clicking and select the Height Map.
- We can change the Tile Height Resolution (doesn't need to be the same as the height map) to 512 and adjust the Height Remap to decrease the max. height.
- We also want to make sure that we aren't create this in the same grouping ID as our previous terrain (0), so set it to 1.
- Hit Create button and we just create a new terrain based on the height map.
- Go back to Lighting and re-enable Auto Generate and it's going to generate a light map for your terrain.
- We are Done!
Saturday, July 11, 2020
Creating Terrains
Subscribe to:
Post Comments (Atom)
Coordinating Multiplayer Game: Photon Bolt
Documentation : Photon Bolt Documentation Photon Bolt Engine API Overview : Feature Comparison between Bolt Pro and Bolt Free: Photon Bolt R...
-
How to make a Video Game - Getting Started Video game creation team: 3D modeling, programming, concept art and sound design. Game engine:...
-
Playing Video In Unity - Introduction and Session Goals [1/8] : Video Player with First Person Shooter (FPS): Create a scene to play using a...
-
How to make Terrain in Unity! Get Terrain Tools: Click Window > Package Manager and make sure we have All Packages selected and go under ...
No comments:
Post a Comment