Landscape performance issue

Then we can’t paint like this?


And are limited to paint like this?

Exactly.
But in reality, you can use a setup, where you are a blending 3 or 4 samples, not just 2.

Just gonna give this thread a nice bump.

Summary: Currently we paint the landscape with 4-5 layers and we lose ~50% performance because of shader complexity. Virtual Texturing, a feature other engines have, i.e Frostbite 3, allows for creating many more layers on landscape without losing performance i.e Battlefield 3 usually had around 12 layers, and it ran perfectly smooth on 2011 hardware. When we brought up this thread, sometime later I noticed a Virtual Texturing card on the roadmap. It was backlogged as usual, but with the new roadmap all backlogged items are deleted. I wanted to hear from any engine developer, is there any possibility to get this on the to-do list? I know the projects you’re working on don’t have anything to do with landscape and landscape related issues, but the vast majority of game developers aren’t working on closed arena shooters, and always being limited to a grass, dirt and 2 other layers and paying 50% performance for it, is holding back from creating anything awesome, or go anywhere near realistic open worlds.

Thanks.

There is a trick in order to paint more than 5 layers on a terrain component.
You can see it in the video below at 1:04:00

Didn’t say it’s capped to 5 layers. You can go above 5 layers, but at that point that’s basically an unplayable demo, not a playable game, due to how much performance every single layer is consuming. Virtual Texturing reduces the cost of layers so you can have many more without such huge performance loss.

Find other ways to boost your performance. Check shadow settings especially. Take advantage of world composition. Use sublevel layers and dynamically load/unload parts of them (put things into separate levels like lighting, particles, small detail SMs, etc). There are many ways you can make up the lost performance.

What kind of performance do you get with 10 layers and adjusting shadow settings, taking advantage of world composition, sublevel layers?

A lot more than I’d get without it… If you want to push the visual boundaries, you’ll need to equally step up your optimization game; if not quadruple it. Hence why AAA games spend so much developmental time in optimization. Just take a game like Witcher 3, for example, and dig around for videos/screenshots of it before release. It’s startling how much it changed before launch… http://imgur.com/a/K3uFC

The moral of the story is that you’ll have to make some sacrifices and you’ll have to spend a lot of time with optimization.

Ummm… sorry sir… do you understand what you’re talking about?

With 5 layers you’re already down from 120 FPS to 60 FPS (That’s only bare terrain yet). With adding another 5 layers which is the point of this thread, that 60 FPS is down to like 5 FPS (still bare terrain) without anything being placed on it to optimize. And you’re asking us to “optimize and sacrifice” with what?

Virtual Texturing is a thing… please read the papers.

What you’re asking for is a lot… Don’t try to use 10 layers. Do you know how translucency works and how expensive blending it is? Couple that with some complex terrain material shaders and of course you’ll get low fps… The guy that posted his setup with a bunch of simple terrain textures, that you criticized, had the right idea. If you want more layers, you’ll have to drop special effects from their materials; to reduce instructions. Regardless of however many layers you use, you will ALWAYS get more performance by optimizing the other visual aspects of the scene. Even if it means going from 20fps to 25fps, that’s still a gain.

Did you not read what they said? CE=16 layers per terrain, 1 layer per vertex aka 3 layers per triangle. FC4=really low res far terrain textures (>300m away), heightmap+4 detail layers blended with a mask texture; for up close. Also, in FC4, they bake decals. Don’t get me wrong, virtual texturing is nice, but it’s not an absolute must and it has it’s pros/cons; just like any other system out there.

The point is that we shouldn’t have to jump through hoops. Unreal doesn’t exist in a void. There are other engines out whose featuresets we can compare and contrast. If someone else does something better, it’s fair to request those features in Unreal. Suggesting a workaround to reach 25 fps is insane.

That’s not how other engines are handling it. They don’t limit the artist’s abilities to what the engine does. They improve the engine to let the artist have freedom. If Frostbite 3 and Cryengine 3 can have 16 layers while giving a constant +90 FPS, UE4 should be able to do so too otherwise it’s not an all purpose engine. It’s a Paragon engine.

It is an absolute must. Ask the ones who have it, hear their opinion on it.

I.e 11 layers used on this map. With everything added on top of the landscape, it gave a solid 60 FPS back on 2011 hardware.


If you have 11 layers in UE4, there’s still nothing anyone can do to achieve even a solid 10 FPS at 1080p on something like GTX 970. Let alone adding meshes, A.I, , Decals… etc.
And when we say layers, we mean simple plugging of textures to corresponding slots, without any additional artistic work to add any further instructions, yet it’s not possible.

The 25 fps thing wasn’t meant to be taken literally… Regardless, you’ll have to optimize in ANY engine that you use or you’ll have another run of the mill poorly optimized “UE4 mod” for a game. UE isn’t perfect, by any means, but there are a lot of pros to it’s fidelity in other sectors of game design. If people get that fixated on something like having 20000 landscape layers, you probably need to rethink your creative process.

As for Maximum-Dev, that’s great and all, but at what expense did they achieve that? You’d have to examine the core rendering code between engines and see where they are optimized and where they cut corners. And again, did you read ANYTHING at all about how you’re technically only blending 3-4 layers at a time and not all 16?

The number of layers you can blend together at one point doesn’t have anything to do with the total number of layers you can have on a landscape with reasonable performance per layer. Being limited to 3-4 layers due to massive performance drops in 2017 doesn’t help anyone with developing what the engine was advertised to be capable of developing when they showcased open world tools with 4.8. Yes we all know a lot of the Kite Demo’s performance drop was just due to large textures and high tri counts, but the bigger chunk of the performance was the landscape layers.

There’s no argument though, I know if UE4 didn’t have i.e built in vertex painting and someone asked for it, he’d still face all the negativity from some people and hear suggestions about doing the vertex paint in modeling package before importing it in engine. Because that’s exactly the case with cryengine for a long time. The people who don’t benefit from the requested feature happen to think it doesn’t benefit anyone else either.

I just made a test map with a 16 layer landscape material and am not having any issues at all… Played it in standalone at 720p high scalability, full dynamic lighting with DFAO and got a solid 32fps; which is what my frame cap is set to. This is all on my crappy laptop that has a 540m in it. Yes, a 540m…

Some things you could do to lower the burden of things might be:

  1. Use the alpha channels of diffuse textures to store a mask or you could store an extra diffuse texture per three alphas and merge the channels.
  2. Remove the blue channels from the normal maps, store extra channels in their B and A channels, do the same as I just said and reconstruct the blue channel from the RG normal channels; to make the normal map complete again.
  3. Make texture atlases. An 8k texture can hold 4 4k, 16 2k, 64 1k textures in it. From there, you can just sample the region you need. You can even get fancy and store different sizes in it like 1 4k, 4 2k, 32 1k, etc etc.

3fd773994b241a9680b1b72f71cc090ad6e7f9d4.jpeg
081e8ace2585229d75e616825bb6f7f010bba62f.jpeg

EDIT: Just to make it more fair, I filled quite a few other material spots in with random channel info to simulate it having to work harder and STILL no change in fps…


EDIT 2: I set all the textures to shared wrap and painted all 16 onto one component just to show it still has no effect on my fps

it’s still very relevant in relation to the amount of layers present in a component, which can of course be different from the total amount of layers in the entire landscape.

maybe we can find ways for you to improve your setup, as for me any slowdowns are far from what you’re getting.
you say you get 5 FPS at 10 layers, 60 FPS at 5 layers, and 120 FPS at… what? no layers? empty scene? isn’t your editor capped at 120 FPS? let’s start with that. and please specify your GPU and also the time (miliseconds) and not just FPS.

now I know you’re not a noob (your work is quite nice) but I don’t know how much technical knowledge you have, so bear with me if what I’ll say is too basic at some points.


now let’s start with layers vs. components
you probably know that under the hood unreal makes a new shader depending on the painted layers on each component (ditching all unused components from that shader) which is used in that specific component. as such, a landscape component with 10 painted layers will already be much more expensive than its neighbor that only has 3 layers painted.

you might know that unreal uses weightmaps for blending the layers, and the weightmaps are created per-component (and relate as: 1 pixel on the weightmap = 1 vertex on the landscape component). as weightmaps are textures, it can only paint 4 layers into a weightmap texture (into the RGBA channels). this means that when you go from 4 to 5 painted layers in a component, it needs a second weightmap and the consequent extra logic for blending, which makes it a bit more complex. same goes when you go from 8 to 9 and so on.
therefore it’s a good idea to set up a cap of multiples of 4 layers per component.

with the above 2 things in mind, you could try to set up your landscape to use smaller components and limit the painted layers per component more tightly. at work we limited it to 4 layers per component and it was enough visually and gave good performance.


the next point is your pixel shader
I’m not going to ask you to post your material, but I’ll at least want to know the spec you’re amining for. IIRC your project is a realistic shooter which means you need high fidelity visuals from up-close.
so I’d ask you the following:

  • what “features” does your landscape material have? aside from Diffuse and Normalmap textures, do you use other textures for anything else (i.e. Roughness, Specular) ? how big are your textures? do you use Tessellation or POM? do you use triplanar mapping for any/some/all layers? do you use any other fancy things like DistanceFields (distance to nearest surface), detail maps, etc?
  • in your material, if you assign preview weights to be above 0.0 to 4 given layers in all your landscape blend nodes, how many instructions does it say it has? check the material instance after compiling the material, as uncompiled materials often show less instructions.

and last some questions about the landscape itself

  • how dense is your landscape? do you have 1 vertex per 1 meter, or more, or less dense?
  • do you use world composition?
  • what’s the performance difference between your landscape with the default material vs. your landscape material?

@, Your test case and results is completely wrong to start with. You have painted each component with a different material. When one component only has one type of material painted on it the shader complexity for that component is rather green. For production, they don’t paint an entire component with 1 layer. Every component of the whole landscape will at least have 4-5 different materials painted on it, which makes the shader complexity red for that component, and the entire landscape. Your landscape is also quite small, should be at least 8k when talking about open worlds.

Check the updated edit, I have a component with all 16 on it(shared wrap settings in textures)… The initial image, showing all the various components with single materials, was to show that there are 16 materials. And I updated it to have a more “complex” material.

Edit: Oh and my landscape isn’t small at all, it’s the full size…

The numbers I threw there aren’t accurate. Here are some accurate numbers with pictures below.

That’s not really how it works if you do for instance splat mapping. Entire components happen to share all the materials unless you’re hand painting several kilometers, which ultimately ends up looking too unrealistic and unbelievable. For our game I am hand painting the terrain since it’s mostly flat lands, but still there are so many places that urgently need more than just 4 layers on a whole component (since each component isn’t that small to get away with 4 layers only).

Increasing the number of components in order to make them smaller to get away with 4 layers, on the other hand brings more weight on the CPU and it get’s a bit slower overall.

I’m posting results of a landscape I made a while ago. This is 4 layers, each layer being a material function.
This is how a material function typically looks like here:

http://uupload.ir/files/jol2_51251.jpg

Albedo + Normal. 4k.
Roughness packed with Normal map.
Specular derived from Albedo.
No Tessellation.
No POM.
Only fancy feature being the texture fades into less tiled version of itself at distance, which is not the case with all the material functions.

1Vert per meter
Not using world composition for this particular landscape. It’s only 8k. But we’re using world composition for our WW2 game and the result isn’t any different in terms of performance, if not worse because of world composition bugs.
Default material = 8.33ms or 120 FPS (capped at 120).
After applying material = 12.58ms or 79 FPS.

http://uupload.ir/files/7hb1_561.jpg

If I added a distance based tessellation with a radius like 10 meters:

http://uupload.ir/files/yelo_77.jpg

Though that’s a bugbelonging to backlog.

Now to sum it up,
12.58ms or 79 FPS at 1080p on GTX 970, i7 4790K.
Material is 4 layers entirely, blended using a splat map.
Normal map is channel packed with Masks compression.
And no artistic features involved other than distance fade of textures.
No gameplay, 3D art assets, A.I, Networking, Particles, foliage etc.

Having ~10 layers is an issue for us using UE4, but it’s a memory for others. Today using tessellation on terrain is also normal outside here. Yet, we seek ways to limit our creativity to make up for the basics of open world.

You have 1 component with 16 layers on it.

Let me quote myself again.