4.17 Landscape material glitch?

I know that I’ve set up my landscape material correctly because its a very simple shader. At first it shows up correctly. it even let me paint on it for a moment and then it just defaulted to the checkerboard material randomly. Is this a bug or am I just doing something wrong?

UPDATE***
Seems to only happen when there are more than three textures being used in the layers tab beneath the landscape painting section.

There is a limit to the number of texture samplers you can use in any particular material. It seems that the landscape material is optimised for each landscape component, such that if you paint only one layer, all other layers are culled from the material, or something along those lines. Thus, if you paint a layer onto the landscape, the relevant landscape component (64x64 grid or whatever) can become overloaded with texture samplers and defaults to the checkerboard. Typically this results in some grids of landscape becoming bugged and others rendering fine. The fix is to simplify your materials, only have X layers painted per component and/or to set some texture samplers to ‘sampler source: shared’ (google that for more info).

Alternatively, it may be that your material contains an error which only becomes apparent when the material optimises/recompiles after you paint it. I found, for example, that materials that worked fine in 4.xx initially worked in 4.16 (or later) but stopped working as soon as they were recompiled. The cause in that case was a stock macro texture which changed sampler type to linear RGB rather than RGB (or something along those lines - look for bugged texture samplers).

I hope that helps… it’s very far from obvious what causes these problems. Sometimes the material errors don’t even show up, and the material claims to compile ok (despite being bugged).