Landscape - Multiple Physical Material ???

Hello!

So I’m trying to have 1 material that has multiple Physical Materials associated to it. The only thing is when doing with with a worldmachine landscape there’s only 1 Index ID.

So i wanted to do a noise… now using the mask image assign as physical material let’s say ICE + Lava to each one (and the player would see the color difference). That way in blueprints i can indicate what happens on the material, plus the friction would already be working.

is this possible some how?
de03e55de6b28b0e5321451993cb521696d5e26a.jpeg
48d2715ce2ee99e2d2e3cf257f1006d442692158.jpeg

sadly currently the only way to assign different physical materials to landscapes is via painted layers. I requested a feature for an alternate way 1 year and 9 months ago, here: Multiple Landscape PhysMats? - World Creation - Unreal Engine Forums - if implemented, this feature would allow you to do exactly what you need

apparently there’s a request in their system (UE-22749) but once/if they make it, I’m not sure it will be usable for landscapes (if you see the AnswerHub post, mr. Andrew Hurley seems to completely disregard the need for this in landscapes).

since you’re interested in this and the Epic staff seem to value requests based on the amount of community interest, I would kindly ask you to upvote the AnswerHub post and express your need for this feature there as well :slight_smile:

https://answers.unrealengine.com/questions/444118/feature-request-landscape-physical-surface-id.html

I’ve received a response not so long ago that is getting implemented soonish.

darn… well 4.14 not bad. Thanks guys.

The only other thing i was thinking is if World Machine could give seperate index IDs, so then i could plug it in… the only not fun thing is that’s more ‘permanent’ than a material

It is quite possible to export several weightmaps from WM.

Hey Deathrey, I dont think that would work. A Weightmap is still an image.

Would I would need is the landscape to accept multiple Materials each materail for a specific Material Index ID. That way each Material would have a specific Phys Mat.

Hi guys,

We don’t currently have a way to generate multiple physical materials for landscape except by having it choose the most weight-painted layer. Obviously that doesn’t work for material-generated texturing. As Deathrey mentions we have a ticket for this currently slated for 4.14, to use something similar to the landscape grass density to output the physical material from the material.

  • Jack

I’m curious why there were 2 different tickets for the same thing, especially since what you describe is exactly what I requested in my post from October 2014

anyway. awesome Jack, you never disappoint :o

I have multiple physics materials working on my landscape. As far as I can tell it’s irrelevant to what kind of material you are using for the visual part. As long as you add multiple paint layers to the landscape itself you can assign physics material to each of them.
From WM you need to export one or two mask, then add two or more paint layers on landscape and load masks into them. When you add layer, editor will ask you to same LayerInfo (or something like that) asset. That’s the asset which you can open and set physics material in it.
If you need an example, check my MMT Content project (GitHub - BoredEngineer/MMT_Content: Machinery Modelling Toolkit is a plugin for UE4), landscape on Land Vehicles map should have multiple physics materials assigned.

the idea is to be able to use different PhysicalMats without any layer painting at all. Some us have materials that control the visuals of the landscape procedurally (much like the Stylized Example from Epic) so this feature is still needed

Sure, I understand that, but that’s not what OP is asking for as far as I understand. I myself would prefer as many options in this respect as possible. I don’t think we need to mislead OP in this respect, as long as he can export separate maps from WM, current approach will work for him just fine.

Thanks BoredEngineer!! Yeah i was about to look into that. I’ll have to test what you’re saying tonight! Thanks. What I dont fully understand is is the layer info using the makes from WM or I have to ‘paint’ these weights/masks in the landscape painter.

You don’t have to paint them manually. What I did just to get some fast result is export for example ‘flow’ map from WM. You need to use .raw format for such masks, maybe some other work too but this is what I was using.
Then you can do like this:

  1. Create a landscape material with a couple of LandscapeLayerWeightNodes:
    a1fd1d8e3b91904b87902cb4a4b9030d8328b40f.jpeg
    Don’t forget to give them some names

  2. Add landscape and give it material made in step 1

  3. Now if you go to paint you will see your layers:
    758926aede7473d2989788514f3ca7f29e5f4b95.jpeg

  4. Click on the “+” sign next to the layer name and choose Weight Blend Layer (normal). Editor will ask you to choose name and folder where to save Landscape Layer Info Object:
    9070beee12d36640182073395970f5a022dd15ae.jpeg
    Just save it somewhere in your Content structure

  5. Repeat the same for 2-nd material

  6. Now if you right click on the layer name in “Target Layers” section, you will have options to Export and Import from file. This is where you can import your mask made in WM. You can import the same mask for both materials, what will happen is that for a second material mask will be re-calculated and they should blend. Sometime you get black area without any material, to fix this either manually paint whole landscape with a single material first and then import mask or import a tiny 16x16 white texture first. This is necessary to “fill” layer with data (known bug)

  7. To add physics materials open Landscape Layer Info Object assets that you saved earlier and assign physics material in them:
    905fcdf92d1376813d0b25a28de4d7a7470e8e59.jpeg

Just don’t forget that your heightmap and material layer mask need to have a proper size matching size of the landscape.

this is awesome ill try it tonight!!! Thanks so much. I didnt know about the importing a mask to the layer that’s why I wasn’t crazy about this pipeline

this totally works. Thanks BoredEngineer!
Like you said the only that that kind of sucks is i have to work with a mask outside of UE4, it’s too bad it doesn’t work with my noise shader that i could tweak

Sorry another question… how do you you use those landscapelayer weight nodes? I used them like u did for the color, would i make the same configuration for the Specular, metallic, etc ?

Hi guys,

We don’t currently have a way to generate multiple physical materials for landscape other than by having it choose the most weight-painted layer. Obviously that doesn’t work for material-generated texturing. As Deathrey mentions we have a ticket for this currently slated for 4.14, to use something similar to the landscape grass density to output the physical material from the material.

  • Jack

Haven’t used them for anything besides color yet. Not sure if it would work out of the box for normals for example but in principal it should. If I’m not mistaken there were other blend nodes that should work with layers too.

Thank you for addressing these concerns Jack! As far as I understand one could build something like this in c++ by populating Layer Info Object programmatically. What concerns me is how data is split between different landscape components.

Thanks for this little tut @BoredEngineer, this is clever trick and it works!