Download

Efficient Massive Forest?

Hello all,

I was wondering if anyone could educate me on the most effective and efficient way to render a forest Vista in Unreal Engine 4. The forest consists of roughly 1000 trees created in speedtree, and a large proportion of these can be seen at any one time.

The Speedtree’s have 4 LOD levels, the last of which is a billboard.

First I tried using the foliage paint tool, and this created desirable results visually, however, I took a SEVERE performance hit, far greater than I had anticipated. I realised this is because for some reason the LOD switches are not happening:

To check this theory, I manually placed 1000 copies of the tree in the level. The performance hit was far smaller, despite the fact that every single tree was rendered on screen, compared to the 500 or so that were visible in the foliage layer.

It would be incredibly innefficient to place every instance of the tree by hand, and I imagine that this would create a rather large number of draw calls?

Can anyone tell me why the foliage paint method does not seem to be utilizing the LOD’s correctly?

Regards, George

You have to modify the instance settings in the foliage tool to fit your needs. The default settings group your meshes into groups of 100. LOD is witched per group so that’s why performance is terrible.

To get the same performance you get with static meshes (and LOD changing) you have to set instances per cluster to 1 but you should probably play around with different settings to get the best performance possible.

https://docs.unrealengine.com/latest/INT/Engine/Foliage/index.html#instancesettingsmode

Welcome to the foliage party.
Dissonanceint is right but on top of that each “instance” well load the trees at the same LOD so if you walk into a patch of 100 it will load all 100 to the Highest LOD.

Just like dissonanceint said you need to edit the instancing settings. Another thing to keep in mind is that having foliage mode on, severely reduce FPS usually. So you might want to switch mode after painting out some foliage, so you can see your actual fps.

Like the others said, if you get the LOD’s right you can place a lot of trees without a problem. I currently have over 22.000 Trees on my map, and it runs just fine. LOD’s are working nearly perfectly. Gotta mess with it around a bit more, but you can make huge forests in UE4.

Can you though? I mean as soon as you start putting out quite a lot of grass and other flora together with some bushes and whatnot you would have a quite severe performance hit right? I have had issues with grass specifically at least.

How expensive is the grass you are using? How many tris? How fancy is the shader? Is there a lot of overdraw?

You can have quite a lot, but with the foliage lighting model currently being worked on according to Trello I hope it’ll be even less performance heavy.
I made a test and placed 80 000 grass meshes, all with 32 triangles and about 6000 trees ranging from 800 to 2400 triangles and stayed at a steady 50 fps with my old 7970 card.
All of these have wind and also various other things such as changing color depending on ground and it works fine. Also, the landscape shader I was currently using in the level have 350 instructions and quite performance heavy. All textures were 1024 or larger.
It all depends on how you set up LOD and such. All these I loaded have several LOD levels but I didn’t use culling (since I wanted to see the performance with all of them loaded). Also they were all placed with foliage mode (of course).

It is a very simple version (low poly and few instructions), the issue is the grass needs to be fairly short, but even long grass I feel is usually simply not that good performance wise.

Yeah I also have a lot of hope for that new foliage lighting model. The ones I used also had several LOD levels (not the grass mind you as it was already extremely low from the start), wind doesn’t seem to impact my performance almost at all. Problem for me is that 50 fps is not okay since as soon as I launch up the Oculus the fps drops further and anything under 60 looks quite choppy.

Yeah, procedural would probably be the best. Very interested in that but haven’t seen much about it on the forum and I am not a coder myself.

I don’t know if it’s the same case in UE4, but in UDK, I got a huge performance boost when I really reduced the amount of transparent space on the grass model and when I grouped grass into larger chunks (I had about 8 sets of the low poly model seen here http://i.imgur.com/XjgM1.png the low poly shows what I mean by reducing transparent space).