Preparing Realistic Grass in UE4
Events
Subscribe:  iCal  |  Google Calendar
Los Angeles US   27, Sep — 1, Oct
Moscow RU   4, Oct — 8, Oct
Prague CZ   5, Oct — 7, Oct
Frankfurt DE   5, Oct — 8, Oct
Latest comments
by Obamu
54 min ago

Is it just me who can't find the "template"? all the "Learn more" links are just mirrors of this same copied paragraph but different site;

by PhilipWatkins
1 hours ago

Thanks for the great template, I test it and it's work extraordinary, But truly might want to put my comics picture and replace initial one. I duplicate all impacts from "Comic strip 3D", however, when replacing my photo moving a similar way like original, yet video 1 and 2 don't appear… I’m a beginner and really would like to help me! cheap coursework writing service

by kellim worthington
2 hours ago

When i am in university i have also one of Graphic designing and i also develop some designs that teacher give me but after that i did not even read anything about because of other courses is to hard and their Best Assignment Help that is why i am not given time on design but i wanted to learn and use these software's to design like others.

Preparing Realistic Grass in UE4
13 June, 2018
Environment Art
Environment Design
Interview

Nils Arenz talked about his vegetation studies and explained how to produce highly realistic and diverse grass with UE4.

Introduction

Hello, my name is Nils Arenz and I am a Junior 3D Environment Artist from Germany. Earlier this year I finished my study in the field of computer graphics and image processing. For my graduation thesis, I developed an application for simulating different avalanche types using the Nvidia PhysX library. The main field of my study was coding C++ and OpenGL, but I was always more interested in doing digital art with the knowledge I gained during my study. As often as possible I participated in game or film art projects at my university and improved my knowledge of the Unreal. After I graduated I had to make the choice: working as a programmer or following my dream and trying to become a 3D Environment Artist. I chose the last one and I am really happy with that decision!

My main fields of interests are designing the nature as detailed and complex as possible but doing this in a very efficient way. My background in coding 3D applications helps me a lot to optimize the designs because I know the math behind all the calculations. Projects I published recently are photoscanned ground landscape materials, photoscanned bark materials and a dynamic and interactive ivy. For the next half of the year, I will focus on creating dynamic wind animated and interactive vegetation.

Vegetation Creation Basics

In my opinion, this splits into five parts. First of all the visual quality has to be very high. A blade of grass or other vegetation parts are not just some green mesh parts. All the pictures of the vegetation I create are scanned in a portable studio out in the woods or at home for the best lighting setup.

Next, you need some kind of wind animation. You simply can’t walk through a forest and see all the vegetation static. That simply doesn’t feel right.

Third, you need some way to interact with the vegetation. If you walk by an ivy branch, the branch should have some interaction with your character.

Your vegetation should be as complex/unique as possible but efficient at the same time. It will not look good if you only use 5 different blades of grass for designing grass clusters. The more different kinds of leaves/blades of grass you have the better the result will look. Plus the more you optimize, the more people will be happy with your designs.

Building Grass

The most common way to implement grass is to arrange the blades of grass side by side in the albedo map and using a big plane to map this to an object. This planes will then be stacked inside each other at different angles. If you look at the grass from the top you will not see the grass blades under you. A better way is to put a smaller plane around each blade of grass and put these blades as a structure. Both ways have two big disadvantages: the quad overdraw and the shader complexity are very high. The only way to reduce them is to model each blade of grass individually so that the opacity of usage is as low as possible. This will also lower the quad overdraw. The downside of this method is that the vertex count is higher than other methods, but I benefited from it. For using the Unreal Engine Pivot Painter Tool 2.0 you need a finer mesh for the wind simulation. Further, the UE4 is using foliage instances what makes the vertex count not that important.

 

Diversifying Grass

Let me guide you through my workflow. Unlike flowers, you can cut grass and it will stay fresh for about one hour. As I live in the country I just go outside and collect a huge pile of grass. Mind that it’s important to choose a high diversity of different kinds of grass. Next, I bring the grass home and put it in a vase. For the best results later you need also to pick out variously looking blades of each kind of grass. You can see this in the picture below. Mind that it’s important to choose a high diversity of different kinds of grass. Next, I bring the grass home and put it in a vase. For the best results later you need also to pick out variously looking blades of each kind of grass.  

For each kind of grass, I picked about 5-10 different unique blades. For the best performance, I packed all of them in one albedo map. In total, I came up with 84 different blades of grass in the texture. Each object got modeled, duplicated multiple times and then transformed into different shapes. So I came up with 150+ different looking blades of grass. The next step was creating grass clusters you can use as foliage brushes. For this asset, I made 82 grass brushes, that provide you with a high foliage variation. The clusters are made by 100-200 grass blades, what brings an average vertex of about 1200 per cluster. The brushes work as object instances, and the vertex count is not that important. Using Unreal Engine you have to add a free transformation in x, y and z axes for about +-20% of the size. This all provides a look that every part of the grass landscape looks completely different.

Due to the low shader complexity and low quad overdraw the performance compared to other grass foliages is higher, even with the higher vertex count. At the moment the LOD is made by the Unreal Engine. I am working on a new implementation, which lowers the vertex count by decreasing the height separations of each grass blade. For testing the performance I made a simple scene and put 30k foliage instances in it. I have GeForce 1070 GTX, the frames between 80 and 120. In the following videos, the performance can be seen pretty well.

Animation

The animation of the grass is the key feature of this asset. The most used animation for grass and foliage movement in the Unreal Engine is the Simple Grass Wind Node. The main function of it is bending the whole cluster. The downside is that the grass blades next to each other have closely the same animation, they bend in the same direction with the same strength. Nevertheless, I used this feature to create a wind rolling effect.

I was not happy with the look of this, so I did some research and discovered the Pivot Painter Tool 2.0. After weeks of trial and error, I managed to master the pipeline creation and control over all parameters. The Pivot Painter Tool put the wind animation on every single blade of grass of the cluster. All the calculations are done in the shader. These transformations of each object are made based on its pivot point. The higher the vertex count the more smooth the animation will be. If you only use a plane with 4 vertex points, the animation will bend the whole plane locked to the pivot point. Now all the objects move completely different but defined by parameters in the same way. Unreal already implemented all important parameters like wind strength, wind direction, bending strength, random wind direction change and a lot more.

Another important step was to vertex paint all the blades of grass individually. The animation will look better if the side leaves move more than the stem of grasses. The downside of this method is that you need an individual material instance for every cluster because you need to tell the material where the pivot points are and in what direction the pivot is pointing. 

 

As you need a unique material instance all the wind parameters can be assigned individually as well. A tall grass cluster will be affected by wind more than cut short grass. Further, you can outsource parameters in a material collection, so you can change the wind direction and other values for all objects in your scene. With this method, you can build some kind of wind engine in your application. With a few clicks, you can now change wind direction, wind power, wind noise and a lot more parameters for your whole vegetation system, what will make your vegetation look super alive.

Future Plans

The grass package is a part of my upcoming foliage essentials pack. It will be a pack with all the plants, flowers, grass and much more stuff for filling your ground nicely. Of course, all elements will have the presented wind animation and optimization. I will split this pack into three parts and a bundle with everything. The first part is grass, which is the most important, it will be a big package. The grass project is already submitted and will be hitting the UE4 Marketplace in about 1-2 weeks from now. Further information will be published on the Unreal Marketplace Forum soon. The next pack will be wild meadow flowers and ground plants that don’t fit in the flower or grass sections. Thee two packs are half finished and will be submitted in about 2 weeks. After this, I planned to do a forest foliage pack, with forest fern, small bushes, small trees and other elements. Here the interaction between the vegetation/wind and the character will be key.

Nils Arenz, 3D Environment Artist

Interview conducted by Kirill Tokarev

Comments

Leave a Reply

12 Comments on "Preparing Realistic Grass in UE4"

avatar
Tristan
Guest
Tristan

Hi how long have you been making 3D art and models
i have started this year and you work is great
I have learned a lot but no where near your knowledge
Do you have any suggestions or tips to speed up my workflow and quality. I am also working on a game in ue4 with 2 other people which is going to be a long project and do you have any recommendations on performance and quality
Would greatly appreciate it
Thanks

Nils Arenz
Guest
Nils Arenz

@Utsav singh, Yes. But a kind of lowpoly projection to have the best balance between poly count and alpha/quad overdraw.

Utsav singh
Guest
Utsav singh

your shader complexity is low because you used true polygon models instead of just a masked plane to prevent alpha overdraw?

Nils Arenz
Guest
Nils Arenz

@DANIEL m NAJERA, the change with no animation will be very small/close to no change. The Pivot Painter Animation is done in the Vertex shader in real time.

DANIEL m NAJERA
Guest
DANIEL m NAJERA

I wonder if the animation was taken off, what type of perfomance numbers we would gain.

Nils Arenz
Guest
Nils Arenz

@ ivan paul ninichuck, I used albedo & normal as textures, for specular & subsurface albedo parameters where used.

@ igor vagun, after so many comments on doing a 4.16 version I will think about it, atm only a 4.19 is planned

@ Ryban, the draw call displacement is shown wrong, I linked some new pictures. Drawcalls are at 0.2ms maximum, cause foilage is getting object instanced. The GPU thread is this high cause of the dynamic shadow calulation, what takes about 70%. For the future I think a better LOD implementation would work better.

igor vagun
Guest
igor vagun

need this for v4.16 . pls make it happen.

Nils Arenz
Guest
Nils Arenz
@ ivan paul ninichuck, yes I used Albedo, Normal & AO as Textures. Aswell as Subsurface and Specular derived by the Albedo. @Ryban: First of all thanks for pointing at the draw thread. I done the test again and like I had in my mind the draw calls where like 0.15ms with 120k instances. This is apparently recorded wrong. Sorry! Cause of the usage of object instances the draw call/poly count is really incidental, but it makes the simulation looks more realistic. Here a picture of the real draw calls: https://drive.google.com/open?id=1meTmUYpIHjJByQNgH3gNRoULg_0WiHQN The GPU thred is this “high” caused by the… Read more »
Ryban
Guest
Ryban

Pretty cool, but I worry not performant enough at this scale. with effectively a top-of-the-line rig you’re still spending around 9ms on draw thread and 10ms on GPU. What’re your thoughts on further improvement?

ivan paul ninichuck
Guest
ivan paul ninichuck

In your article you mention that the albedo was all in one texture. Were any other pbr textures used, or just set values?

wpDiscuz
Related articles
Partners’ project
Environment Art
Environment Design
Interview
Partners’ project
Environment Art
Environment Design
Interview
Materials