Grass Quick Start

Learn how to add Grass textures to a landscape.

Windows
MacOS
Linux

Overview

In this Quick Start guide, we will take a look at how you can set up and apply a grass texture to a landscape. Over the course of this Quick Start tutorial you will learn how to create, set up, and spawn static meshes to make your Landscape appear covered in thick grass. You will 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 learn about the Actors and properties required for a grassy-looking result 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

Download the Open World Demo Collection content pack 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 either the Learn or Marketplace tab, locate and then download the Open World Demo Collection.

    OWDC_1.png

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

    OWDC_2.png

  3. Click on the Add to Project button.

    Add_To_Project.png

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

    Select_Project.png

2 - Initial Level Setup

Now, we will create a new level and Landscape terrain so that we have something on which to apply the grass.

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

    T_New_Level.png

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

    T_Create_Landscape.gif

  3. To help better show off the Grass Tool, we are going to add a some noise to our Landscape terrain so it is not completely flat. In the Modes panel, select the Landscape Tool 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. Set the properties with the following values.

    T_Sculpt_Tool_Settings.png

    Property Name

    Value

    Additional Details

    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, 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. 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 Grass system works on a completely flat Landscape terrain. The above modification to the Landscape was done purely for artistic reasons, to help show the final result.

  5. In the Modes panel, click on the Place icon to exit the Landscape Tools.

    T_Exit_LS_Tools.png

3 - Grass Tool Actor Creation and Setup

We will create the required Actors and Materials the Grass Tool needs to function correctly. We will continue to work with the the level that was created in the last step.

  1. Create a Landscape Grass Type: right-click in the Content Browser. From the displayed context menu, go to Miscellaneous > Landscape Grass Type and name it Grass_00.

    T_Create_LS_Grass.png

  2. Open up the Landscape Grass Type and add a new item to the Grass Varieties array: double-click on Landscape Grass Type and once opened, press 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, click on the input box that says None and enter SM_FieldGrass_01 as the search term, then click on the SM_FieldGrass_01 to load it as the Grass Mesh.

  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

    Additional Details

    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 densely covered in grass.

    Use Grid

    Enabled

    To make the Static Meshes look more naturally placed, this offset is 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 conforms 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 a Material that can work with both the Landscape terrain and the Landscape Grass Type. 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, refer to the Landscape pages for more information.

  1. Create a new Material for our Landscape Terrain by right-clicking in the Content Browser, then selecting the Material option from the Create Basic Asset section, and name the new Material, MAT_GT_Grass.

  2. Open up the MAT_GT_Grass Material by double-clicking on the Material inside of the Content Browser, 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. Using the Palette search function, search for the Material Expression nodes listed below. Once you locate a required Material Expression node, select it in the Palette and then drag it into the Material Graph.

    Material Expression Name

    Amount

    Additional Details

    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. In the Content Browser, select the Grass_00 Landscape Grass Type that was created in the last step.

  8. 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

  9. 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

  10. 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, then how to use the Landscape Painting Tools to define areas where grass should spawn. We will continue to work in the level that was created in the last step.

  1. Select the Landscape Actor that was placed in the level by clicking on it 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, then click on the Paint icon to go into Paint mode.

    T_Landscape_Paint_Mode.png

  5. Under the Target Layers section, add a new Layer Info by pressing the Plus icon 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 to save the new Layer Blend in the Content Browser. Make sure that you create Layer Info for both the Rock and the Grass.

    T_Add_LWB.gif

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

    T_Painting_Grass.png

    Depending on the power of your development PC, 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, then putting it back up to the desired level when done, is a great way to help mitigate this as much as possible.

  8. 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 features such as 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 Sequencer to render out a video of your level for you to share with the world.

Select Skin
Light
Dark

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