Horrible performance with trees

Hi! I always had trouble with the trees in the unreal engine. Maybe I’m doing something wrong, but as soon as I add more than 10-15 trees with the foliage painting tool, my framerate drops to 20fps or even less. It has nothing to do with my computer specs since I’ve got a powerful rig. In cryengine for exemple, I can basically add hundreds of trees and the framerate loss is minimal. Am I doing something wrong? :frowning:

How complex are those trees?

It’s because lighting/shadowing/rendering in UE4 is as unoptimized as it can be. If you remove your directional light and only have a skylight you will see your frame rate is back to the top.
Long time ago, as a test, I put same amount of instances of the same tree in both UE4 and Cryengine. The result is 100 times different. Overdraw costs too much in UE4. Shadowing costs too much. It’s a WIP engine and you have to live with it until it gets better.

What do you mean it’s a WIP engine? It’s the 4th iteration of a large and well-known tool…

It’s unfortunately also well known that fully dynamic lighting and Unreal Engine does not work well together.
There was glimmer of hope, when we learned about dynamic GI, but since we all know how it ended (we are back to lightmaps).
Lightmaps of course are no go solution for anything bigger than 500x500m or closed corridors…

Idk if we are get fully dynamic lighting to be as fast as in CryEngine. It seem like there is no incentive at Epic to get dynamic lighting performance to the level of CryEngine.

Lot’s of total BS in this thread considering OP provided little to no info on his scene or system specs.

UE4’s renderer isn’t ‘unoptimized’ - there’s a reason it tends to look better than other engines, it’s flexible and packed with features. Unless you’re an experienced rendering engineer then ill-informed statements like that are totally invalid. There are bigger differences between Cry, Unity and UE that extend way past the renderer. Why do certain things run better in each engine? We can only imagine why frankly.

Every engine is “WIP” if you count ‘improvements’ as ‘work in progress’ - and it’s been around over 20 years.

To diagnose your problem OP, you need to post more information. System Specs, screenshots of your scene and the details about the assets that are causing the slowdown.

Finally, if you folks check the thread about dynamic lighting in UE (DFGI) - you will notice the whole reason they stopped working on DGI was to squeeze the last 15-10% of performance out of the renderer.

ProTip: If you want a stable job in the games industry, become a (good) rendering engineer. They’re a scarce resource.

who went back to lightmaps?

You know what? You’re right. I’m not a rendering engineer, but I don’t need to be a rendering engineer to see the if an engine performs well or not. If it can’t handle 100 trees or a simple grass field or a basic distance based tessellation, or even something as old as POM. then it’s not good, no matter how flexible it is.

And I completely disagree with you regarding UE4 looking better than Cry. With baked G.I? yes. Without baked G.I it’s nothing near Cry.

The dominant part of performance difference is in shadowcasting. Maximum-Dev definitely has a point here.

Seeing a comparison scene would be good though.

It handles ALL of those things as well as can be expected so long as you’re sensible… throwing statements around about how the renderer isn’t optimized is false and after you do it for long enough, insanely irritating too. I mean look at the Kite demo, a stable, solid 30 FPS on my modest home PC - which is FINE for a foliage-heavy game where you literally have 100 square kilometers of transluscent grass (and heightfield GI)! I garauntee if you drop the kite demo into any engine, the gaps in it’s renderer will be exposed. Even Paragon had high-density foliage in it’s first map in some areas, made heavy use of POM & tessalation and a fairly large environment and it ran at 60, AND it was scaled for PS4 and is probably the best looking game I’ve ever seen.

Until UE4 has dynamic GI we can’t make an objective desicion as to which looks better without baked. UE4 is less ‘strict’ than CryEngine, the latter of which has been catered to foliage-heavy, small-environment FPS games for years upon years. It stands to reason they might have a good foliage rendering technique. If that suits your project better, why not use Cry instead? Some engines are better at certain things than others, that’s just a given.

If certain features run faster in other engines than they do Unreal, that’s totally expected isn’t it? No one engine is going to do everything perfectly. Anyway, Daniel Wright said they are working to squeeze the last out of the renderer over a year ago. I’m a million percent certain it can always be optimized further - but rendering engineers are hard to come by and at Epic they’re spread pretty thin across many projects.

Plus mod or not, I’m only human and the constant complaining takes it toll sometimes - especially if nobody has anything constructive or suggestive to say and uses OP’s question as a chance to moan.

EDIT: Man I need a Beer or ten.

I mean it’s not news that Cyengine in many ways is further ahead in the graphics side of things (but backwards in other areas) compared to UE4 but the statement “unoptimized as it can be” is a tiny bit of an exaggeration obviously :stuck_out_tongue:

I get the point Maximum-Dev is trying to make though, it can be frustrating sometimes when another engine has that “one” better feature that UE4 doesn’t have (or is way worse at) but it goes both ways… try to use Cryengine for a few months and you will miss plenty of UE4 features, and especially the community.

But anyways, enough with the engine comparisons… that never ends anyway :rolleyes:

To answer the original post…

15 trees sounds too little to be affecting performance in such major way unless you are using high poly trees without LODs (or…?).

You should profile your scene and/or turn dynamic shadows on/off etc. to figure out what is actually causing the perf. drop.
Then from there you can try various techniques to optimize your scene… you can look into imposter sprites, hierarchical LODs and even roll your own system (not using the foliage tool).

It’s not about which engine is better. It’s about which engine specifically handles things like overdraw and shadowing better. Which is the subject of this thread. And UE4 performs really, really bad at it. That’s the subject of the thread.
Some engines are better than others in some specific things. I do not understand why you’d tell me to leave and use cryengine if I’m pointing out a weakness of UE4 against Cryengine. That’s just unprofessional discussion you’re putting up here. Over there on the CryDev forums when someone says x thing works better in UE4, they tell him “Why do you not leave and go use UE4 instead?” and it’s pretty stupid thing to say. One can’t discuss the truth without getting hit by a train.

Edit1: OP has mentioned Cryengine, he compared his result with that. I didn’t try to be a cryengine fanboy, only testified to that because I am perfectly aware of the difference.

Edit2: @SilentAndAsleep, What you can do to compensate some of the cost is to fill your polygons with as much texture as possible and reduce the transparent areas. Another thing to do is to make the mesh as low poly as possible (few leaves as possible) so there aren’t many many shadows being casted. Another thing is to upgrade your already good enough hardware to a beast PC. But you won’t have a reasonable frame rate as you do in cryengine.

Alright I’m back. The performance is better now, I have created a new scene with hundreds of trees (with shadows enabled) and my framerate is stable (45-60 fps in ultra, but it’s not optimized yet so it will get better). Maybe there was something wrong with my last level but now I’m not experiencing any exagerated FPS issues. My specs are not an issue, I have a GTX 1060 ti, 8 gigs of ram and a quadcore i5. It’s not the ultimate rig but it can handle any game I throw at it in ultra @60fps.

Id just like to chime in, if these are known weaknesses of UE4 as you say and Cryengine better supports the feature set you require then I think its a mature perspective to consider moving to an engine which may cause you the least resistance. Obviously these issues can be alleviated in UE4 but the skill of the person making the scene is heavily in question not only the renderer, to jump on the renderer first is really not the best approach in my opinion. Its not that youre entirely wrong, its the way people around these forums expect Epic to do their work for them, obviously Id like the renderer to be as fast an general purpose as possible but Cryengine was built with foliage in mind since it was used for Crysis so thats a specific set which may always outperform a general purpose solution.

Granted not everyone uses the correct tone in putting things across but there are a hugely varying bunch of age groups and skill levels, its extremely difficult to come to a conclusion from acouple of lines especially when discussing something as complex as a renderer, you have to admit you hugely jumped the gun with your blanket statement about optimization.

You can argue both of these calculations result in the same number:

A) 10000 + 10000 = 20000
B) 9243 + 10757 = 20000

But to say which one fits better in your mind, it’s A. And that’s where you can say A works better. And if you was to force everyone to go with B and argue that’s not any harder to memorize because it results in the same number as A, that’s a problem.

And no, no one is blaming the renderer in the first place and no one has jumped high with their guns. Do you know me? do you know anything of my background to say that about me?
I’ve been using Cryengine 2 since 2007 and 3 ever since the Free SDK came out, and the moment I started using UE4 about 2 years ago, I noticed the difference. To make sure I wasn’t doing something wrong I ran so many tests using the same meshes and same textures in both engines and tried to keep all the conditions as close as possible. The result is always 180 degree different performance wise. No I do not wish to go back to cryengine because of this, but I’m letting the OP know he will not be able to get the same result as in cryengine because that’s what he was after. Even if you optimize (degrade the quality) of your foliage so much so they run ok in UE4, the (unoptimized) meshes still run better in cryengine, so it’s not entirely an artist issue at all. Does cry work better there because their games relied so much on dense foliage? or that UE4 performs worse there because it has more uses over cry? that’s not the point of this discussion. The point is the artist is not to blame and he is only a small part of a large issue.

Edit: Now since this thread is in “Feedback for Epic”, I’d like to add a test, maybe they consider some improvements. :slight_smile:

This is 817 tree instances, almost all of them in the viewport, ~4000 Tris each + lods, No billboards used, 7 shadow cascades. Most atmospheric features such as fog, sun rays etc. enabled by default. Running on GTX 970 without overclocking.

^ Says it all if you ask me…

Same tree. Same lighting settings. 1.05k instances. However, placed denser so all of them fit into the dynamic shadowing distance of 20,000 units.

If you put them denser they cover bigger screen area and use higher poly lods. You aren’t really comparing them equally then.

Nice to see some comparison shots, but I don’t think they are conclusive. Proper profiling with several averaged samples needed :cool: Plus, you can’t really compare cascades like that. In CE cascade updates are distributed over several frames. Somebody should be kind enough to provide a unified test scene :slight_smile:

Denser in relation to that of Chariots, not the Cry test. Plus, in UE4 you have only 4 cascades and they cover only 20,000 units and the rest of the far instances go unshadowed, which is not the case with cry.