Moving UE4’s Foliage System in Unity
Events
Subscribe:  iCal  |  Google Calendar
Marina Del Rey US   10, Dec — 13, Dec
Las Vegas US   8, Jan — 12, Jan
Zürich CH   31, Jan — 4, Feb
Leamington Spa GB   31, Jan — 3, Feb
Bradford GB   6, Feb — 11, Feb
Latest comments

Good work bro!

i focus on the composition and framing of my images and the silhouettes of my objects more than on the quality or complexity of the models or materials. http://geometrydashfree.com/

by Duacan
1 days ago

hello Alexander, I really loved your these draw works. I loved cathedrals too.I started 3ds Max new. And I really really want to meet you, if you wanna to do. By the way, my name is Duacan, from Turkey. also Im working for learning and speaking German. Cause Deutschland is the my first country for living. Whatever, take care yourself, Tschüss. insta: 06optimusprime06

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

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

Introduction

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.

System

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…

Editor

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.

FPS

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 80.lv on FacebookTwitter and Instagram

Comments

Leave a Reply

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

avatar
Robytla
Guest
Robytla

It is available in the Unity Asset Store: https://www.assetstore.unity3d.com/en/#!/content/99233

rayen
Guest
rayen

where we can buy his asset

wpDiscuz