Landscape Visibility material bug

Hi Visnarel,

Ok I had a look at this and think that, with the setup you have you would be better served with LERP nodes as opposed to painting. Try this setup:

Additionally your landscape coords is extremely high, which may be partly to blame for the black tiling when using visibility masks. I would consider reducing that. Once I changed to the lerp data, however, the black splotches were no longer visible.

It seems that the lerps cause some color washing in the gradient areas but using a heightlerp seems to work and gives the same basic controls that the blend does, just more kludgy of a workflow :slight_smile:

It also makes blending the normal maps for those sections much harder to deal with

I spent the day rebuilding my master material with heightLerps and the results are perfect, and I don’t see a performance hit on it, so I think this will at least work for this project :slight_smile:

Thank you!

I am happy to hear that you have achieved the results you are looking for. I am remarking this thread as answered for tracking purposes. If you need additional help with this, please feel free to comment back and I’ll be more than happy to assist.

Hey guys,

I’m happy that there’s a solution for this, because I’m experiencing the exact same issue with my terrain using a splatmap and layer blend.

However, I have no idea how Visnarel fixed this because I can’t see your full material setup.
Can one of you guys please elaborate on the weightLerps and such? This is giving me a pretty good headache.

Attached is a shot of my current material. As you can see it’s pretty simple, because I’m not too advanced with materials yet. The textures are solid colours, just for testing purposes. Also, my Terrain visibility material is a copy of this, masked with the landscape visibility node - and yes it’s applied as the ‘hole’ material for the landscape.

Any help would be greatly appreciated

What Visnarel did was use heightlerps, which are specifically designed to get height data from a heightmap/splatmap and output texture information between two values (a and b) based on the height, blending based on parameters you enter.These have lerp’d textures added into their values for additional contrast. For you, try moving each layer to a specific heightlerp, then plug the information gained into the base color as opposed to having a layer blend.

Thanks for the reply

I’ve tried to setup my material with heightlerps, but I’m not getting the result I previously had with the layerblends.
Like I said I’m not all that savvy with the material editor yet, and there’s not much documentation on heightlerps, so I may be doing it wrong.

Attached are my material setup and a shot of how my terrain looks now with the heightLerp setup vs. how it looked with height LayerBlend.
I tried setting the transition phases on the heightlerps from 0.1 - 0.4 respectively but there was no blend at all when doing that.

EDIT: would it be better for me to have a bunch of greyscale maps instead of a splatmap and one greyscale heightmap?

I believe the primary reason this is occurring is that you do not have anything in the B slot of your heightlerps. They are effecitvely lerping between 0,0,0 and your textures. Are you attempting to paint an imported heightmap or was the landscape created in editor and you are applying the splat map to it?

Hey
Forgive me for not knowing what I’m doing, but I really don’t know what I’m doing.
I’ve read that a Lerp is taking A and B and then using the alpha input in it to determine where in between them to land.

So I’m guessing that for a HeightLerp, I plug my texture into A and one of the splatmap RGB channels into the height texture to act as the alpha telling the lerp to output the texture only where there’s white…

But what value do I put for transition phase and what am I plugging into B? Do I put a constant of 0 for B, as in I want nothing where the black of the heightmap is? If I only want the white sections painted, do I have transition phase a constant of 1?

I imported the landscape .r16 and it’s RGB splatmap into UE4 from World Machine. I won’t need to paint on it using the UE4 editor, so that’s not a concern.

It’s probably easier to think of a LERP as a Base and a mask. The base covers everything, then the mask alpha channels out whatever the pattern in it is. So in this case we’re creating base after base after base and adding on different masks in a stack. So simply speaking I blend two together, then treat that as a the base for the next blend of 2. Here’s a few shots

It gets a little confusing because I’m also doing a distance lerp for small and large UV values (to remove patterning) so you can ignore the first lerp going in, and just use the height lerps (vector 3 inputs) to blend

Another thing to keep in mind is that a splatmap ,while it looks like color, is just 4 greyscale images that you can use just like any other grey scale image, you just need to use the output from just the channel that you need as your mask. On this one I have 2 splatmaps for 8 unique masks

Ok, so the complexity of your material is throwing me off a bit, considering I don’t have nearly as many variables to deal with (I, uh, think…).

I was going to write up a reply, but do you have Skype? I can PM you my username if you can have a quick chat.

If you can’t or you don’t want to, that’s no problem, I’ll try and gather my thoughts and post here.

I appreciate you helping me, either way!

Alright, so like I said, my material doesn’t seem to need the complexity of yours, but I could be wrong.

I figured I can ignore my normal maps for now, and focus on the diffuse maps and then mimic the process for the normals after.

It also looks like you’ve got two versions of diffuse for each texture, at different scales. So there’s nodes in yours that I won’t necessarily need. It’s just that your material is so different from mine…

Judging by the image of my material I’ve attached, how would I hook this up properly? Or am I missing quite a few variables…? I don’t know how I’d hook up the A’s and I don’t know what you’ve got your results going into. And I doubt the Lerps are doing their job if they could, anyway.

Sorry for all this, but this is really bending my mind and for some reason I’m not learning this stuff very well.

I think the problem that you’re running into is that you’re lerping your lerps :slight_smile: try just using the heightlerp to heightlerp and drop all of the generic lerps outside of it. You don’t need all of the nodes that mine has… You just need the SPLATS going to the heightlerps and the results of those mixes leading to another set of heightlerps a standard lerp won’t give you the transition control that I think you’ll need

K I eliminated the basic lerps and set up the material how I think you said, by connecting heightlerps to each other. But I don’t know what to plug into the “A” of the top heightlerp if that’s the case.

Just can’t wrap my head around this…

Added you to Skype. Thanks buddy

Since I hate it when threads go dead without the person posting their solution, here’s how mine played out:

suggestion worked and the pic of my material setup that I last attached is the way to go, just plug whatever you want into A.
My other problem was that the splatmap I was using wasn’t completely filled with RGB, so it was allowing whatever texture that was plugged into A to dominate, since it was inhabiting all the open space.

I went back into Photoshop and fixed the RGB splatmap so that it’s pretty much filled with Red Green and Blue. I left a little bit open so I could plug another texture into A and have some variation.

What is the difference in Content Example’s Landscape map and our maps?
Because there the visibility brush works fine even with layer blend but when I migrate that material to my project it does not work. I tried different setups but the brush just doesnt work. I cant see the hole (if both has the “hole” material) and there is the good old blackness if the only difference between the 2 material is the mask stuff.

try implementing the mask in your landscape material and use the landscape material for both your landscape material and hole material on your landscape. Does this work for you?

That doesnt work.
When I use the same material (having mask) for landscape and hole there is no black landscape parts but no hole either. I pretty much tried every combination there is. :slight_smile:

Also I figured out the only difference between the Content Examples landscape and our “generated from world machine” is it is painted manually. Also I managed to create a similar looking landscape with HeightLerp node instead of LayerBlend. There was a HeightBlend with two height input. Like this:

The difference is there is less rock texture than with Layer Blend but fortunately Transition Phase helped a little with that. Problem is if I go lower than 0.4 then the whole landscape is grey (rock texture).

All in all it’s not the same result but close enough.