Landscape increasing drawcalls way too much / drawcalls optimization

Hey, I’ve got this problem when I go far from the center of my map and look to the center, the drawcalls increase by ~3.2K. The drawcalls stay at about 3.6K when the landscape is hidden.

stat scenerendering:
When landscape is visible:
When landscape hidden:
Landscape settings:

How would I go about decreasing the drawcalls significantly? As far as I’m aware, the current amount is far too much with or without the landscape.

I can play without any lag but when others play it they have very bad FPS.
The models we use are made with BSP’s and changed into static meshes if that changes anything.
The level has minimal lights and they are static, except there are 15 cars with 3 lights each but hiding those barely changed anything.

Make components bigger. Other optimization is to disable dynamic shadow from components that can’t cast visible shadow because they are too flat.

Thanks for your help. I managed to get the draw calls down to max 3-4K. The landscape still creates a bunch of draw calls, not sure if I got what you meant. Though I changed the landscape section size to 63x63 quads and there wasn’t that much of a difference from changing landscape settings, did I make it worse? I’m pretty new to landscapes and optimization.

I merged a bunch of models together, that was noticeable, I get around 1.6K draw calls without the landscape now.
This is what I’m getting now: but it needs to be better.

Why it’s need to be better? Are you sure you are CPU limited? Usually when you make draw call optimizations your GPU will suffer. Bigger meshes are not so efficiently culled by frustum or occlusion. This can lead more vertices rendered. 2k draw calls does not sound that bad for PC. Are you targeting to VR or mobile?

I read somewhere that 1-2K draw calls is good, as I said I get 3K at most. (Honestly, I thought draw call optimizations lower GPU usage)

Anyway how would I go about optimizing GPU usage? I guess that’s what really needs to be optimized

Those trees… do they have LoDs? And also, do they have the latest LoD as billboard? Im not sure the issue is with the Landscape. Can you hide the trees and let the Landscape as it was before with those 1st pictures you got? Are you using 4.19 already?

Do you have any landscape holes? If so, do you use a single Masked material for the entire landscape with Landscape Visibility as the opacity mask? You might want to switch out the material for all components that don’t have holes to use an opaque version.

Yes they have lods, hiding the trees did nothing. Not on 4.19 yet, should I update?

I did have a hole in the landscape, not intentionally though.

I’m going to build lighting just to test if it changes anything. Also, should I keep merging models like houses next to each other if they use the same materials?

4.19 introduced improvement on landscape LoD system. So, it is good to update, before updating make sure if all plugins you are using are already updated.

You mentioned on building lights, which one are you using dynamic/static/stationary? I ask because the performance is very different for each one, but the quality result is also important. Depending on what you want to do in that scene you might need dynamic, since you have trees and the best shadows are given by dynamic light (as the Sun), but the performance will suffer too. All these questions are important, because if you don’t know yet, then it is just hard to focus on what to optimize.

Merge things that you wont get action near it, so merge distant meshes/actors only. The merge procedure might not be 100% good, so beware and do backups constantly to make sure you can rollback changes.

Updating to 4.19 at the moment.

I’ve used stationary and dynamic since we’re planning to add a day/night cycle to the game eventually, but right now static. We’re not going after the best shadows possible at the moment since we’re trying to get the game to run on low to mid range PCs which isn’t working out very well so far.

Static works best for closed environments and if you are going to have day/night cycle you will need dynamic. You can select, as suggested above, the meshes/actors that you won’t be able to see the shadows, to not cast any shadow, this would prove a good optimization already.

The thing on doing games to run on low and mid range PCs also takes into account which is the scalability you will choose to run the game, like trying to run Epic settings on a low end PC will be hurtful at some point and impossible to optimize. The engine with the scalability settings already provides automatic switches for some features to allow better optimization. Keep that in mind.

Your component size is waaay way too small. That component count is through the roof. For a landscape that size you could have something like 60 or 100 components or so.

The component size is now at 40. The minimum my FPS now goes down to is about 65 in editor so this helped a bunch, I was supposed to ask about the component amount but I forgot. Thanks

Alright. Yeah I’ve already made a basic graphics settings that have the engine scalability settings available.

I’ll test how the game runs on a different PC and edit here if something is bad.

Epic should implement Virtual Textures for Landscape…that would help…A LOT?!^^

PS: I know this doesnt help you…but its still something that needs to happen sooner or later for good Landscape performance with a layer complexity common these days :wink:

Landscape rendering is indeed weak in UE4, if not being its weakest part. Overhauling it completely, including implementation of procedural virtual texture, or at least texture arrays, is indeed much needed.

As for original issue with drawcalls from OP, you should adhere to realistic landscape resolutions(something 500ish), while using world composition to consolidate vista terrain into meshes.
Do note, that larger components do not always mean less drawcalls. Having smaller landscape components improves efficiency of shadow culling. Subjected to number of shadow cascades and their overlap, having smaller components might yield less drawcalls. But larger components commonly result in less efficient shader permutations and less control over LOD.

The game runs much better now and the initial problem I had is fixed.

And yeah, virtual textures would be nice, it’s on the roadmap. Been there for a while though…

It would be nice of you to leave the solution you adopted for others who search the forums to have a reference, :wink:

Oh yeah forgot that lol. Reducing the landscape’s component count helped a lot and merging together static meshes like road parts, fences, rocks etc. Merging the roads helped a lot too since we had about 500 road parts placed individually which increased draw calls a lot.

Virtual texturing for everything is already being done, the reason it’s taking a while is because it’s for everything and not just landscapes. Far less ram usage for all titles that can support it across the board, and no streaming problems as far as textures go!

The second step is to switch the mesh pipeline over to bindless draw calls. A lot of even somewhat modern hardware supports such, all the way down to before even the xbo/ps4. With virtual texturing you could even go bindless texturing, all of which should reduce draw call problems so much that you’d probably be blocked by small mesh triangle counts more than anything.