Grass Tool Quick Start

A Quick Start guide for setting up and using the Grass Tools.

Windows
MacOS
Linux

Overview

In this Quick Start tutorial we will take a look at how you can setup and use the new GrassTool that are now available with the 4.8 release of Unreal Engine 4 (UE4). Over the course of this Quick Start tutorial you will learn how to create, setup, and spawn static meshes to make your Landscape look like it is densely covered in thick grass. You will also be introduced to key properties and settings that will help you shape your virtual grasslands to fit your project's needs.

T_Grass_Intro.png

You will also be exposed to all of the required Actors and properties the Grass tool requires to function correctly and deliver the results you want. When you have completed this Quick Start you will have a new level that should look similar to the image above.

Currently the Grass system will only work with the Landscape Terrain Actor. Trying to use the Grass system to spawn grass on any other Actor type will not work.

1 - Prerequisites

You will also need to download the Open World Demo Collection content pack from the Unreal Engine Marketplace as some of the content from the collection will be used in the following Quick Start. Once the Open World Demo Collection is downloaded, add it to the project that you are using to follow along with this Quick Start by doing the following:

  1. From the Epic Games Launcher in the Marketplace, locate and then download the Open World Demo Collection.

    T_OWT_OWDC.png

  2. Go the the Library section of the launcher and under Vault section locate the Open World Demo Collection .

    T_OWT_Add_Content_00.png

  3. Click on the button that says Add to Project.

    T_OWT_Add_To_Project.png

  4. You will be shown a list of projects that you can add this to. Select the project that you are using to follow along with this Quick Start and then press the Add to Project button

    T_OWT_ATP.png

2 - Initial Level Setup

In the following section we will create a new level and Landscape terrain so that we have something to use the Grass Tool with.

  1. Create a new level that uses the Default Template as a base.

    T_New_Level.png

  2. Add a new Landscape Actor to the level by first clicking on the Landscape Tool icon and then clicking on the Create button to add the Landscape Actor to the level.

    T_Create_Landscape.gif

  3. To help better show off the Grass Tool we are going to add a tiny bit of noise to our Landscape terrain so it's not completely flat. To do this go to the Landscape Tools and under the Landscape Editor section click on the Sculpt Tool icon to expose the available tools then pick the Noise tool from the tool list and set the following properties with the following values.

    T_Sculpt_Tool_Settings.png

    Property Name

    Value

    The Why

    Brush Size

    65536.0

    This gives us a brush that is big enough to effect the entire Landscape terrain at once.

    Tool Strength

    0.01

    Since we only want a very subtle effect we set the Tool Strength very low and add more intensity by painting more.

    Noise Scale

    256

    Making the Noise Scale bigger makes the noise look smoother and more natural when applied to the Landscape.

  4. Position the Landscape Brush in the viewport so that it covers the entire Landscape terrain then click the Left Mouse Button 3 to 4 times to add some very subtle noise to the Landscape terrain. When completed you should have something that looks similar to the following image.

    T_Noise_On_Landscape.png

    The above modification to the Landscape was done purely for artistic reason to help better show how the Grass Tool worked. If you needed to or wanted to you could use the Grass Tools on a completely flat Landscape terrain.

  5. Exit the Landscape Tools by clicking on the Place icon in the Modes panel.

    T_Exit_LS_Tools.png

3 - Grass Tool Actor Creation and Setup

In the following section we will be creating the required Actors and Materials the Grass Tool needs to function correctly. We will continue to work with the GT_00 level that was created in the last step.

  1. Create a Landscape Grass Type by right - clicking in the Content Browser and from the menu that is displayed go to Miscellaneous > Landscape Grass Type and then give it a name of Grass_00.

    T_Create_LS_Grass.png

  2. Open up the Landscape Grass Type by double - clicking on it and once opened add a new item to the Grass Varieties array by pressing the Plus icon that is to the right of the Grass Varieties name.

  3. Inside of the Landscape Grass Type Actor look for the Grass Mesh section and then click on the input box that says None and input SM_FieldGrass_01 as the search term, then clicking on the SM_FieldGrass_01 to load it as the Grass Mesh.

    T_Set_Grass_Type.gif

  4. With the Static Mesh added we need to set the following properties to ensure that we are spawning enough grass mesh and that those meshes are randomly rotated and aligned to the Landscape terrain.

    Property Name

    Value

    The Why

    Grass Density

    400.0

    Because we want this to look like grass we must spawn a lot of Static Meshes to make the Landscape appear like it is densely covered in grass.

    Use Grid

    Enabled

    To make the Static Meshes look more naturally placed this offset's their placement position.

    Random Rotation

    Enabled

    Giving the Static Meshes used for the plants and grasses a random rotation makes sure that the same side of the Static Mesh used is not seen all the time adding to the visual variety of the scene.

    Align to Surface

    Enabled

    This makes sure that the Static Mesh used conform to the surface of the Landscape terrain.

4 - Landscape Materials and the Grass Tool

Before we can begin to use the Grass Tools we first have to create Material that can work with both the Landscape terrain and the Landscape Grass Type. In the following section we will cover how to set up this Material as well as how to link it so that it will work with the Landscape Grass Type.

If you would like to have a more in-depth look at how the Landscape terrain works in UE4 check out the Landscape pages for more information.

  1. First create a new Material for our Landscape Terrain by right - clicking in the Content Browser then selecting the Material option form the Create Basic Asset section naming the new Material MAT_GT_Grass

    T_Create_New_Material.png

  2. Open up the MAT_GT_Grass Material by double - clicking on the Material inside of the Content Browser and then add the following two Textures from the Open World Demo Collection to the Material Graph.

    • T_AlpinePatch001_D_alt_R

    • T_GDC_Grass01_D_NoisyAlpha

    T_Added_Textures.png

  3. Search for the Material Expression nodes listed below using the Palette search function. Once you locate a required Material Expression node select it in the Palette and then dragging it into the Material Graph.

    Material Expression Name

    Amount

    The Why

    Landscape Layer Blend

    1

    To make the Landscape terrain look more realistic you will often need to blend and paint multiple together or separately and that is what the Landscape Layer Blend allows you to do.

    Landscape Layer Sample

    1

    This Material Expression allows the Material and the Landscape to talk to one another to ensure the right Static Mesh is used whenever a certain Landscape layer is painted .

    Landscape Grass Output

    1

    This enables the Landscape terrain to be able to spawn the Grass Types based on the setup in the Landscape Material.

    T_Add_Material_Nodes.gif

    If you are unfamiliar with how the UE4 Material Editor works or would just like more information about it, check the official Unreal Engine Material documentation for more information on all things related to Materials.

  4. Select the Landscape Layer Blend node and under the Details panel in the Layers section and add two new Layers to it by clicking the Plus icon 2 times.

    T_LB_Add_2_Layers.png

  5. Once 2 layers have been added, set the Layer Name of one to Grass and set the Layer Name of the other one to Rock also setting the Preview Weight to 1.0 for each.

    T_LS_LayerBlend_Setup.png

  6. Connect the T_AlpinePatch001_D_alt_R Texture to the Layer Rock input on the Landscape Layer Blend node then connect the T_GDC_Grass01_D_NoisyAlpha to the Layer Grass input finally connect the Output of the Landscape Layer Blend node into the Base Color input on the Main Material Node.

    T_Hook_Up_Textures.png

  7. Select the Landscape Grass Output node in the Material Graph then in the Details panel in the Grass Types section press the Plus sign icon to add a new element to the Grass Types array.

    T_Grass_Out_SetUp.gif

  8. In the Content Browser, select the Grass_00 Landscape Grass Type that was created in the last step.

  9. In the Material under the Grass Type option, press the Arrow icon to load the Actor that is currently selected in the Content Browser.

    T_Input_Grass_Type.png

  10. Select the Landscape Layer Sample node under the Parameter Name input Grass for the name and connect the Output from the Landscape Layer Sample to the input of the Landscape Grass Output node.

    T_LLW_Setup.png

  11. When completed you should have a Material that looks like the following. As always, do not forget to press the Apply and Save buttons to compile and save the Material.

    T_Final_Material.png

5 - Using the Grass Tools

In order to see the Grass system in action we need to apply the Material that was created in the last step to the Landscape and then use the Landscape painting tools to define where we want the grass to be spawned. In the following section we will go over how to apply our Material to the Landscape Terrain and then how to use the Landscape Painting Tools to define areas where grass should spawn. We will continue to work with the GT_00 level that was created in the last step .

  1. First select the Landscape Actor that was placed in the level by clicking on it with the in the viewport.

    T_Selected_Landscape.png

  2. Locate the MAT_GT_Grass Material in the Content Browser and click on it to select it.

  3. On the Landscape Terrain under the Details panel in the Landscape Material section, press the Arrow icon to apply the MAT_GT_Grass Material to the Landscape Terrain.

    T_Apply_Material.png

  4. In the Modes panel go to the Landscape section by clicking on the Landscape icon and then go into Paint mode by clicking on the Paint icon.

    T_Landscape_Paint_Mode.png

  5. Under the Target Layers section, add a new Layer Info by pressing the Plus sign icon that is on the far right of the layer name.

    T_Add_Target_Layers.png

  6. When prompted select the Weight- Blended Layer(normal) option then select a location for the new Layer Blend to be saved to inside of the Content Browser. Make sure that you create Layer Info for both the Rock and the Grass.

    T_Add_LWB.gif

  7. Select the Rock_Layerinfo by clicking on it in the Content Browser then under Target Layers input the Rock_Layerinfo into the rock section by pressing the Arrow icon to load the currently selected object.

    T_Load_Layer_Info.png

  8. Select the Grass Target Layer and then inside of the viewport hold down the Left Mouse Button to begin painting the Grass Material to the Landscape Terrain. For this step try and completely cover the Landscape giving you results that look like this.

    T_Painting_Grass.png

    Depending on how powerful your development PC is when you start to paint on the Landscape the editor might become unresponsive as the grass is spawned. This is normal behavior as the grass is dynamically spawned after you have finished painting. Turning down the Grass Density in the Landscape Grass Type while working and then putting it back up to the desired level when done is a great way to help mitigate this as much as possible.

  9. To remove grass from the Landscape Terrain select the Rock Target Layer then inside of the viewport hold down the Left Mouse button to begin replacing the grass Texture with the rock Texture.

    T_Painting_Removing_Grass.gif

    Adjusting the Brush Size and Tool Strength will help to better define how the grass is placed or removed while painting on the Landscape.

6 - On Your Own

Now that you have seen the power that the Grass tool offers, try using the tools listed below in conjunction with what you have just learned to make a level that looks like the following image:

T_On_Your_Own.png

  • Use the Procedural Foliage Tool to make the Landscape look like it is densely covered in grass, flowers and bushes.

  • Define the look and feel of the Landscape terrain using the Landscape Sculpt tools to add things like hills, mountains and lakes.

  • Give the surface of the Landscape more visual variety and detail by creating a Landscape Material that has multiple Textures that can be painted on the Landscape terrain.

  • Adjust the Directional Light to make the level lighting resemble lighting that happens in the early morning or late afternoon.

  • Set up the level lighting to use a completely dynamic based lighting solution that will make use of dynamic shadows as well as Ray Traced Distance Field Soft Shadows.

  • Try using the Foliage System tools to remove or tweak the placement, rotation and scale of the Foliage meshes that are placed by the Procedural Foliage tool so that you can get the exact look you are going for.

  • Show off your creation to others by using a Camera in conjunction with Matinee to render out a video of your level for you to share with the world.

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback