Tessellated landscape material stops compiling when more displacement layers are added

I started to have a problem with my landscape material when I added world displacement layer blends. The material just stops compiling and I have no idea why this happens as I don’t think it’s so complex shader.


It has 1 unused Alpha Blend layer (because I’ve seen a tutorial on youtube in which the guy suggested so), one Weight Blend and 4 Height Blend layers. One height blend is not connected because I don’t have textures yet.

I’m using distance-based tessellation multiplier to fade out displacement map over distance (usual distance based thing). I also have visibility mask on my landscape.


Tessellation itself works just fine, but when I blend at least 2 world displacement maps (in this case these are just height maps) using layer blend node it just doesn’t want to work no matter what I do. It’s probably good to note that I actually use material functions for each layer to make it a bit cleaner and easier to change stuff.

I’ve already tried some things I found on the internet like changing texture sampler source to “shared: wrap” (which I would do anyway), turning off adaptive tessellation, crack-free displacement, using PN triangles.
What seems to fix this issue is turning one layer’s displacement off in my instance, but it’s not really what I want to do.
I really don’t know what’s happening and why is it happening. Base pass shader has 96 instructions and vertex shader has 30.
And yes, I’m pretty sure I need tessellation on my landscape because it just looks so flat and fake without it. I hope it can be fixed and it’s not engine related. I’ve seen LAM and I’m pretty sure it has a bunch of different layers with tessellation, so I don’t think there’s something wrong with Unreal itself.

I’d really love to get some help from the community as I haven’t ever run into this kind of problems, this is my first so advanced game that I’m working on now and I hope I’ll learn some stuff as the development goes.

Quite possible that you are just hitting 16 sampler limit per landscape component. Try using Shared texture samplers.

I’ve actually already changed every sampler to shared: wrap and in my material stats, it says I have 4/16. Does this shared mode even do anything? I’m curious as I do actually have even more than 16 samplers on these components, but every single one is shared.
And by the way, it only happens with tessellation, when I turn it off, the problem disappears

Anybody? Is this really so uncommon that no one knows what’s going on?

What is your engine version? As I recall, there was an issue up until about 4.12 as I recall (might have been a slightly earlier version…) in which there was a max of 4 landscape layers you could create using the layerblend node. If you wanted more you had to do the blending yourself using layersample or layerweight nodes.