How To Paint Textures Onto Layer Blended Landscape?

I can’t figure out how to paint new textures onto a layer blended landscape. Nothing blends and I can’t layer textures on top of other textures.

I started in World Machine, exported my heightmap and splatmap, imported into UE4 and created a heightmap-driven weightmap with grass, sand and stone. Working great so far. Now, I want to manually paint on a texture (say, mud around a building so it looks like it’s been walked on). I tried adding another layer (alpha, because I want it to “blend” into the landscape) called “mud”, then I go into Landscape Mode -> Paint. I start painting and suddenly entire squares of texture just disappear (turn into the checkered box material) and nothing layers or blends together. I rebuild my lighting and sometimes it turns black. I’m on my third day trying to get this to work. Any help is greatly appreciated!

Here’s an example of what I mean I want to achieve. In my case, it’s not a road but a large area, so I can’t use the spline tool.

e6477cad40d4bf1be87a6f04ebbd35a92f89c4d1.jpeg

1 Like

You need to make a material that have a shader specially made for terrain painting textures, there are some examples videos.

Unsure of what you mean, Galeon. Which shader is that?

Are you using more than 10 texture samples I ask because that is the most common problem with landscape layers. Otherwise the UE documentation has a pretty substantial amount of information on this.

No sir, just 4 so far. Landscape Material Layer Blending in Unreal Engine | Unreal Engine 5.3 Documentation is what I’m referencing. I’m following it to a T, but it doesn’t work for me.

can you post a picture of your landscape material flowchart? with the layerblend node selected so I can see how that’s set up.

Sure! Thanks for your help. See below.

13edfd0976e1ceda534d18d76ed6beac0da0dcf8.jpeg

I’m trying to paint the gravel on top of the other stuff.

Here’s what happens when I click once where I want to paint. I don’t get it. :frowning:

c67530c6211a4532778bf02b881c2631b8ed835a.jpeg

I think your problem is you have no normals for gravel. Normal it isn’t a big deal but since It’s blending layers I might be causing you problem. Make a 3 vector in it’s place with the values [0,0,1]. That’s 0 for red and green and 1 for blue. The other thing I noticed is you don’t have an alpha layer. make the grass an alpha blend and keep in mind it will mess up the node connections for the rest so re check those.

Thanks! A little better now, but still the blackness.

Hmm, Off the top of my head I think you are still having problems with the normals. Sometimes after the compile your shaders it helps to go over it once with your alpha layer (grass in your case). Just select the largest brush and go over the whole thing real quick. Another thing that may help is to have similar layer blend nodes for diffuse and normals. Just copy and paste the one your using for diffuse. This is because it will try to paint the"gravel" layer but have no information for the normals.

Anyway, hope this helps and good luck!

Thanks, again. I guess I’m probably confusing " alpha layer" here and that’s the problem. I know what an alpha layer is, but not in this context. :frowning: Sorry to be so difficult. I understand if you can’t continue answering.

I’m thinking this isn’t me, but the engine. Found about 50 other posts saying it’s broken. Painting: Why is my landscape getting "Corrupt" quads? - Rendering - Unreal Engine Forums

The engine will always have bugs. You can attempt a work around or wait for an update.

Sorry, the word ‘alpha’ gets tossed around a lot. I meant ‘LB_AlphaBlend’
It is a Blend Type like LB_HeightBlend or LB_weightblend

if you’re using a splat map you want all the layers to be a Weightblend. (I’m only about 70% sure of this so definitely double check)
and if you want to be able to manually paint on layers all your layers except 1 need to be set to HeightBlend (100% sure of this)

here is the documentation that explains it:

Thanks for coming back. Yeah, I’ve been doing that this entire time. That was one of the first pieces of documentation I found, sadly. Nothing works at all for me. 15 hours of testing different blend types, textures, nodes, and it’s always the same: a black texture. :frowning:

could you post a picture of your updated material flow graph?

'sup, not sure but lemme give this a shot. (also, landscapes in UE4 are sorta mess’d up atm)

your 1st pic in your 2nd post: on the left in details, grass, stone, etc. you have the preview weight set but no constant height. Same for your normals, they need to be set as well. ie: 0.0, 0.5, 1.0 for example, I think 1 shows before lower numbers, but see docs on that.

your 2nd pic in your 2nd post: again on the left, (paint mode section) you need to assign your materials to a layer blend type to get them to work.(shows in your content browser)(just click the drop down list to assign them) again best to look at the docs

and not really intended but most of the time to get materials to work on landscapes you usually have to paint the whole landscape , then save, build, to get painting to work right.
once you have the painting working , set your brush size & strength (especially strength) to get the effect you want. have to experiment for best results.
still playing around with the alpha blend, so not sure how well it works yet, but well worth trying.

this might not fix everything, but should give you a starting point. best to start out simple n test as you go. good luck

Thanks for the reply. What does constant height do? I’ve been experimenting, but it doesn’t seem to do much of anything in my tests. The docs are very vague on it, too.

The best I’ve been able to do now, including with your advice here, is to get my gravel layer to paint correctly over grass, but I had to remove my splatmap/heightmap entirely and had to make Gravel an alpha blend. Even with this small success, it’s not consistent at all and Gravel is the only layer I’m able to paint for some reason.

UPDATE

I’ve made some serious breakthroughs. It seems that the stacking order of the layers really matters. Once I put my alpha layers above my height and weight layers, everything seems to be rendering fine. Unfortunately, I lost my splatmap-generated terrain, but at least I can paint textures now. I mean, landscape painting still doesn’t work like it probably should, but I think I’m on a good path now.