Moving UE4's Foliage System in Unity
Subscribe:  iCal  |  Google Calendar
7, Mar — 12, Jun
San Francisco US   19, Mar — 24, Mar
Anaheim US   23, Mar — 26, Mar
San Jose US   26, Mar — 30, Mar
Washington US   30, Mar — 2, Apr
Latest comments
by badminton rackets
13 min ago

Wonderful illustrated information. I thank you about that. No doubt it will be very useful for my future projects. Would like to see some other posts on the same subject! badminton rackets

by rayen
41 min ago

that's all nice but what's the purpose of that there is no consumer hardware that can't handle that in real game enviroment

by Romain
1 hours ago

Yeah I know normally a friendly artist is planning to make one about it

Moving UE4's Foliage System in Unity
25 October, 2017

A little talk from Ioan Lazu about his amazing new foliage system for Unity, which was inspired by some of the Unreal’s tech.


My name is Ioan Lazu and I am a 24-year-old programmer from Timisoara, Romania. My first brief encounter with the game development industry was more than 10 years ago, with an old version the ‘GameMaker’ game creation software, and much earlier than that by using some game’s map editing possibilities. Since then I’ve developed my own small engine and used the very limited existing solutions, but I haven’t got seriously into game production until Unity and Unreal became free to use.


Developing an open world game, called ‘The Unwritten Critias’, we faced the problem of low-quality foliage and poor performance while using the standard Unity solution. Therefore we developed our own solution, the ‘Critias Foliage System’ that is, as the name implies, a vegetation panting and rendering mechanism. I’ve tried to make the workflow as close to Unreal’s foliage system, in order to help people that already had that technical background.

At the system’s core lies a spatial hash space partitioning method that is very good at rendering only the visible and close instances and skipping the far away or invisible batches. The system’s main functions are hand-painting, extracting, in case that you already have a populated terrain, and most important, the rendering of millions of foliage instances in a very optimal way, that your game’s FPS is kept withing good limits. 

Using this space partitioning method instead of a terrain grid is also beneficial for other uses where you do not want to use a terrain. Maybe you want to paint the foliage on a floating island or maybe you want to add vines to a building…


While the first version was developed for SpeedTree mostly, now you can throw in it any terrain detail that you might require, including but not limited to: trees, grass, small rocks, large rocks, metal scraps, objects with LOD’s etc… Your custom shaders are also supported, however you will have to tweak them a little if you want your instances to fade out nicely in the distance. And of course, keep everything within the limits that other engines or systems might expect, I really would not recommend adding mountains or huge cliffs.

Another very important part of the system is the tweaking of the settings for each individual foliage type, like if that type can cast shadows or what would it’s maximum draw distance be. It is an absolutely vital part if you want dense looking and optimized forests. Global density settings are also available.


The first part is the smartly batching of close instances in a single draw call using the ‘DrawMeshInstanced’ API, through the mentioned spatial hashing space partitioning method. The second part is the batching of distant tree billboards, in a single mesh and passing the rotation, scale and position as UV’s, with the setup taking place in the vertex shader. 

So you have a distant mountain and want to flood it with trees? No problem! You can have thousands of instances that when are billboards will probably get translated into 4 or 5 draw calls.

Ioan Lazu, Programmer 

Interview conducted by Kirill Tokarev

Follow on FacebookTwitter and Instagram


Leave a Reply

2 Comments on "Moving UE4’s Foliage System in Unity"


It is available in the Unity Asset Store:!/content/99233


where we can buy his asset