Download

Long Distance Foilage!

Okay I have been playing around with some of the UE4 Foliage settings such as cull distance,LOD, low poly trees and density. But I am wondering what is the best way of doing trees just for long distances, so it wouldn’t be too performance heavy. I have never seen a UE4 game do this successfully and being optimized. The trees don’t have to be foliage because the map is so massive, the players wouldn’t be able to walk to it, in that case any ideas on making a good illusion of trees? I am just wondering if you guys have any ideas that might help me out? The map I want to create is a very large one 100X100KM.

This is what I mean by long distance trees:

http://www.whistler.com/images/header/whistler-canada.jpg

I’m not really a pro in this area, but it seems to me that it really depends on exactly how close they can get to the trees. I would go as far as saying if they can’t see the full depth of the trees, you could probably just paint on some scattered material to give the look of trees and shrubbery. :wink:

Interesting topic though. I would like to hear some other ideas as well.

OT: That’s a very beautiful scene.

Billboards are already being used? Camera facing billboards are an option aswel? they can have simulated shadows/lighting aswel

Just make very optimized billboards. Either something like the ones you can make in SpeedTree or perhaps even simpler camera facing ones and make sure to reduce the amount of transparency as much as possible. Then just spawn them with procedural foliage or what ever as long as they are instanced. Use distance field shadows to prevent them from looking like ****. Might want to keep a fairly high resolution of the billboards to prevent Mip maps from blurring them too much too close, but that depends on what distance they should be seen at.

I tried to make something like that. Huge forest made of plane static meshes (no billboards cause you can’t use foliage tool) with a masked texture of a tree. High quality textures from evermotion. Always facing the camera and paintable with the foliage tool.

There are something like 30k of them in this particular scene.

I use camera facing billboards with the foliage tool /procedural foliage and it works just fine. But this method works great as well, just don’t want anyone to get the wrong idea.

I would just use speedtrees. In this level I have 900k trees with properly set up LODs: http://i.imgur.com/X5Mls4j.png
That’s with everything on epic + DF shadows. Only problem is that the game hitches and lags sometimes (like it was garbage collection pause or something).

Edit: The map was 16 x 16 km. I wouldn’t even try 100 x 100 km.

Billboards or planes are definitely the correct methods. This has always been what the major studios have done from Halo:CE in 2000, all the way up through Skyrim and even current gen games.

In Unreal you will have to use the foliage tool or a custom blueprint system to place them in order to take advantage of instancing. Manual placement would be a nightmare on draw calls.

I´m also experimenting with very large amounts of trees. I may not have the final answer but I can share some experience.
Attached are some Images of 130k trees.
The tree used was not really an optimal tree from an old tree library wich was around 20mb in size.
I would also suggest Speedtree btw.

I created 2 LODs.
LOD0 was was the mesh as I got it from the Library. Cast Shadow and Collision is enabled.
LOD1 are 4 Bilboards, (well more or less they don´t align to the camera) rendered from the Mesh. 3 from the sides and one from top wich are mapped on simple planes.
LOD1 blendes at 0.02 Screensize.

Materials. I made the experience that turning off mipmaps on the billboard textures give the best results. As long as temporal AA is used there´s no big problem
with flickering. With Mipmaps they start to brighten up in the distance.
I use a Two Sided Foliage shader for nice transluceny effects.

Lighting and Shadows.
I use a Moveable direct light as sun and a stationary skylight. There is no way to get acceptable results with static lightmaps from this amounts of trees. I think I even was not able to turn
the lightmap size that low that I would not run out of memory. Btw. the indirect lighting from the skylight is just not that visible in my scene as I made a pretty
high controst with a post process volume in case you wonder.
I tried all possible shadows. The best looking shadows are raytraced shadows. Also the performance is acceptable. The problem with them is this

So I use cascade shadow maps with a dynamic shadow distance of roughly 60k. Just so large it covers my trees. As larger the value as worse the shadow quality.
Every shadow beyond the trees on the terrain is handled by the far shadow cascades.

the performence is acceptable at the moment. It´s a pretty hybrid test. There is just a terrain and trees. Don´t know if this is still possible if grass, stones and other meshes are involved.
Also I´m not yet sure how to mix baked with dynamic stuff… Like a house interior that would be placed in this scene.But well I´m still experimenting with this scene.

Here´s a snowy version with two different sun angles.

You can set up world position offset on a 1 tri plane with a rendered image of your tree to always face the camera, and then you can have billboard lods + foliage painting. Take a look at the grass from the stylized rendering example to learn how to set up your WPO properly.

Picture: