How to make Phys Materials work on automatic Landscape?

Hi!
I have an automatic landscape set up, that automatically masks cliffs to be on the side of slopes, sand to be low and snow to be high up etc, based on this tutorial: Setting up an Automatic Landscape Material - YouTube

Now I’m trying to set up physics materials on the landscape. I tried adding it to the landscape layers, but as I modify the masks after the sample, they don’t match. And it thinks there is sand and cliff everywhere, as the sample technically is everywhere, but the visual results are masked later.
I saw that they added a Physical Material Output node in UE 4.26, but my project is on 4.25 so I’d prefer to not need to update, if possible.

What options are there in this case?
The only thing I see right now is painting away the layers that aren’t visible, but that kinda defeats the purpose of having a material that applies itself automatically, so I’d prefer something more non-destructive

You have to math your own multiplexer to look at the various layers and decide what has precedence over what.

Thanks! Is there a way to get all active material layers? Because right now my trace only gives me one?
I’m an artist so I don’t have a lot of experience/knowledge with these kinds of things.

So, to the best of my knowledge, no.

Your hit result, IIRC, only returns the one physics material it hits. And I don’t believe there is much about the landscape system that is much exposed to blueprints so it’s hard to go diggging to find it.

Ah, I see. I’m not sure I understand what you mean with creating my own multiplexer?

Sorry for the slow reply; life… :smiley:

So I am going to put myself on the hook for this (I guess…). I too need to take an auto-material and build out the logic for this. If/when I get through this, I’ll post my solution.

Otherwise, insofar as a multiplexer, I mean you will have to create some logic that takes into account the various weights of each layer and then decides which one has precedence. The physics node (as I understand it) takes values of 0 to 1 (alpha) for each layer-input. Ideally, you’d have only one input trigger. With automaterials it can be such that since the logic lays down layer on layer, multiple layers are at a value of 1…hence our problem.

So, for example, if your mask is 0->1 where 0 is rock and 1 is grass, wherever the mask is going to be 0.0 → 0.5, we place rock. The same for grass, wherever there is grass it’s going to be where the alpha is 0.5+ → 1.0. Values in the middle are a mix of course, but, for example, 0.75 is more grass than rock so you might want the physics-material to read out grass.

You’d need to look at the alpha for each layer and figure out which one ‘wins’. In the case above, the less something is rock the more it’s grass and vice-versa, so we’d likely try a one-minus node off the alpha (so we can make rock ‘live’ at 1) and then compare it’s value vs grass. If the alpha is 0.3, for example, the rock ought to have an effective weight of 0.7 and the grass 0.3, so rock wins and we should register rock. You’d have some logic to look at the two layers’ alpha’s distinctly, and then pick a winner.

This extends to any additional layer we put on top of all that, so it’s more a rinse/repeat type thing in that once you get two layers working, you should be able to merely extend the logic.

If/Once I have a practical example I’ll come back to this thread and post a solution.

I am running into this error: Default physical material BUG on landscape patches

I cannot validate my logic until I get past this, but it should track with the above.

Oh sorry that I haven’t replied yet! A lot of stuff happened and I totally forgot about this, sorry!
But now I’m back to the project, more than one year later :sweat_smile:
Did you manage to get something working for this?

I never figured out the solution.

It appears to be a known-issue in the 4.2x branches, but does NOT present in 5.1+. I’ve tried to test multiple times and it just doesn’t seem to break.

I want to say that playing-in-editor was more prone to issue around this. I WANT to say that playing in a standalone game was workable and that based on my research there was indeed a command to reset/flush/whatever ‘the buffers’ and make the issue go away, but I would eventually come back.

I think the true-solution here is to upgrade, sorry.

Ah, sad to see it doesn’t seem to work properly until UE5, but I’ll see if I can figure something else out then. Thanks for all the info! :slight_smile: