[HELP] Understanding Performance and How To Improve Performance

​ [No idea in what category this belongs, so i’m posting it here]
I am working on a simple scene that is quite ambitious, with that I mean that my scene only has some foliage and rocks.
The ambitious part is that my landscape is 8kmx8km.

I am running into some performance issues that I just can’t seem to understand as to why the GPU is taking up so much time for rendering. And because of that I am struggling fixing this issue.

I have already optimised A LOT in this scene, by adjusting rendering distances for grass, shadow and enabling Distance Field Shadows.

It would be great if someone who has more knowledge of creating scenes like these to help me out, since this is my very first “open-world” scene.
Also I will keep posting here if I find a way on my own to fix the performance.

Here are some screenshots that explain a lot better than I can do with words.

As you can see the FPS is about 25 when rendering far into the distance. [ATTACH=JSON]{“data-align”:“center”,“data-size”:“custom”,“data-tempid”:“temp_204935_1602599508418_236”,“height”:“1013”,“title”:“UE4Editor_hWcj2iPox6.jpg”,“width”:“1920”}[/ATTACH]


Shader Complexity isn’t bad, however some assets are rendered in grey squares?

The quad overdraw isn’t bad either.

Quad overdraw and shader complexity is really bad in combination, but why not when viewing them seperately?

GPU Profile console command results, when rendering far away distance.

A more closeup view that has good performance at around 60FPS on average.

GPU Profile view from the close up shot.

My Early Z-Pass settings.

Oke found something mildly interesting, when packaging and playing the game in 1920x1080 windowed

When you render the far away distance you get 30FPS
But when render a little less of the far away distance of the terrain, than the FPS increases. (goes from 40FPS to 55-60)
It’s a very small change in terms of what you view, but the performance is drastically different.

8km^2 could be the leading issue.

Component size is huge, and adversely impacts performance. You would definitely be better off reducing to 8 1017 sized tiles with world composition.

What you have to look at is the base size of a single component.

Because when you position your character at the corner of 4 components, all the components take on LOD 0 - the highest vertex count.
on a 1080, the vertex load from grass + foliage is already drastic without piling on 4 lod0 components with extra vertex.

You can alternatively try to balance the LOD of the single landscape by trying to adjust it so that you get a maximum of LOD3 when on it - however with the changes they made in engine the balancing is very improbable / not reliable.

A stat RHI would tell you how many tris on screen.
base it off that.

You can fade grass out after 10 to 30 m from camera. And give it a proper LOD by changing the mesh LOD preset to Deco or something similar (which generates lods as defined in scalability).
Same for trees. Except a manual billboard at a distance is probably best - even if lighting them to look the same can be a problem.

Oh wow thanks man, that’s usefull info I didn’t account for.
Makes sense now that the component LODs would give a big hitch in performance.
I made this terrain with WorldCreator 2, so if i’m going to lower the size I’ll have to reexport.
I’ll also try adjusting the tiles size as you suggested.

I was hoping to buy a 3090TI by now, but financially this isn’t affordable right now so i’ll have to stick with a 1080 for now haha.
The rest of December I have my time off from work, so i’ll be continueing testing with this project again and making it more playable on mid hardware.

Having said that, I do want this game/project of mine to target high-end PCs, similar to what Crysis used to be.
But that doesn’t mean I want it to be unoptimised + this is a great learning experience for me haah.

Use low-level tesselation for distant landscape geometry, and create an LOD for it which kicks in while 1/2 km or more away. That level is going to require a ton of optimization because there’s only a landscape and a sky with atmosphere so far, unless there’s geometry in other areas that the screenshots aren’t showing. Does the landscape use subsections?

The landscape material already has detail/fade with the distance between the camera and the terrain, so that’s not really an issue i belief.

I watched UE4’s latest video on performance and found some nice console debugging commands.
Turns out there were too many triangles (15million plus) on the screen.
I figured out that it was the procedural folliage doing this even though they had LODs (small bushy plants and rocks).
So I turned on a max distance for these objects.

In my original scene I went back up to 55-60fps, and in my new scene with volumetric clouds and skyatmosphere I went up to 32-42fps from 17fps.

From optimisation viewmodes, I can only see that my landscape and my objects are a bit in the red but mostly my landscape.
I think it is because of the terrain’s resolution maybe.
Next optimisation step is to test in a seperate scene the same terrain but with a lower resolution.

The more red in the distance is why I suggested setting tesselation lower past a certain distance for the landscape. I’m not talking about landscape material, but the form / shape of the landscape to use low tesselation on in the distance. It lowers the number of triangles and maintains at least some detail.

triangulation in the screenshot seems to be about what you’d expect in the distance. sure, maybe a bit more than you’d like ideally. however the issue is the shader, which should be dark green at worse.

For understanding performance in general this is by far the best tutorial on the subject.

In modern engines FPS is no longer the bar as to what is and what is not a performance concern as to how objects are rendered to the viewport so things like shader complexity, draw calls, and how long an object takes to re-fresh with in a single frame is the bar as compared to the more general FPS over a series of frames.

Watching back the profile, as demonstrated in the video, will tell you what is taking the most amount of time to draw based on the visual perspective and you can drill down to the single object with out having to guess what the problem might be.

Based on your pic though that’s a lot of red and is typical of foliage adding a lot of transparency over draw, which is one of the top performance sucking vampires, which increases the number of draw calls as part of the total count for a single frame. Since it’s a far looking perspective that is a lot of load as part of the total sum of the number of overdraw being caused by the grass alone is enough to cause rendering time issues as compared to the occasional red among green results.

This is what shader complexity is telling you and decreasing tessellation is not going to do much for you as compared to LODing the shader complexity over distance.

As you can LOD the geometry you can do the same as to materials and shaders that are assigned to the object based on screen space so that at close range you can maintain the transparency of the material but at distance remove transparency in flavor of a less performance hungry opacity map, or remove masks altogether, so that at distance things are a lot more green.

The trees you are looking at in the complexity pic for example at distance is green so my guess that it’s material complexity in the LOD for that distance is made as simple as possible so take a closer look at them.