What does the Landscape Physical Material Output node do?

Hi,
While looking through the node palette I noticed a node called LandscapePhysicalMaterialOutput that has no documentation (at least nothing that I could find). I tried searching both Google and the forums for information about this node and found nothing. I couldn’t even find any mentions of it anywhere.

1 Like

Basically landscape materials can output different physical materials per-layer. This means you walk on grass you hear grass footsteps etc.

The problem happens when you have procedural materials (like drawing a cliff when the slope is higher than some angle). This automatic / procedural stuff is just a visual change, it’s still the same landscape layer, and hence the same physical material.

The new output mode allows you to output a procedural mask for physical materials for such “auto landscape” materials. It’s awesome.

2 Likes

Wow. So, this is just like the Landscape Grass Output Node but without custom names.

I like it. Is this something added recently?
I literally see no information on the web.

2 Likes

Thanks! Sounds awesome indeed.

From what DamirH said it sounds like a pretty recent addition to the material system which explains why neither of us could find any information about it.
Have you managed to get it to work with your auto material?

I didn’t try that. But one of our Discord users tried it.
Seems like it worked.

2 Likes

Kind of a nice addition.

So far I have just been using auto paint as a guideline to paint over the real layers.

After which you have to remove the auto-paint because by design it just adds extra complexity without any benefit.

Note that doing just this is still ideal for performance.

Multiple Single layers only add complexity when you manually overlap them. An auto material is just more complex of a shader no matter what.

BUT, you can probably afford the cost difference if you have a 100x100km terrain to paint on your own…

It comes down to whether you want to publish in this century or not.

Having the ability to specify the physmat without having to work around it using a color output is great. It means MUCH less of a load on the material to do the basic stuff :slight_smile:

Actually there is the added benefit of fewer texture samplers and reduced texture memory since layer paint data doesn’t necesarily need to be stored for everything.

As with everything it’s a CPU / GPU vs RAM tradeoff.

You would think that, but in practice I get a close to 2ms difference with layers vs auto material.

Granted the auto material is nowhere near optimized whereas the layers to paint are. Could be my issue really.

1 Like

But, if you paint the landscape manually to look like an auto layer, the complexity is the same right?

No, he’s saying that it may be more because of the added amount of texture samples used.

Why?
Because the paint layer is handled internally like everything else - with textures.

So paiting 6 layers with 3 textures each on a tile will consume 6×3+ potentially 6 samples (one per layer worse case scenario).

Whereas an auto material based on normal slope won’t consume the extra texture samples at all.

What you have to do is test the load on the auto material from the slope sampling. The operations can be more costly than a texture sample.
They can also be optimized though.

1 Like

Fair enough. In practice if it can fit into the performance budget and it saves thousands of man hours of painting then it’s great.

What I’m curious about is whether it will fall back to painted layer physical materials if you don’t specify a value through the output node.

2 Likes

Ah got it.

About this.
I did some tests of both mobile & Desktop.

Reducing tries with LOD distributions helps a lot compared to optimized the material itself.

1 Like

2 different things entierly.
You have to do both to get good performance.

Optimizing the material for performance will involve several things.

  1. Using UV for all the distance blend, because it’s way, way, way cheaper than blending the whole material layers.
  2. limiting the samples and layers amounts, on top of using packed textures.
  3. removing or limiting height blends. Or setting them up manually - off the packed texture. Doing your own can be a lot cheaper.
  4. Doing your own material layering instead of using the layer nodes. Much more performant if done right.

Side note:
Tessellation can’t be turned off, so leverage it as much as possible.

Overall you can see a difference of over 20fps at 4k on a 1080ti going from the tutorial material everyone starts with to an optimized one…

2 Likes

Hi,

I just tested on my end and it doesn’t seem to quite work. I’m using an RVT terrain so I’m not sure if this has something to do with it.

Maybe I am missing something? I looked around for checkboxes that could be related to activate this in the material itself or the Landscape actor, and nothing.

Chaos solver is ON, I’m on 4.26.2

EDIT: Nevermind that, the mask just happens to extends much farther than I expected. I was able to get it working from a Render Target without “normalize” on my end.

EDIT2: Something pretty important I noticed too, the changes only seem to actually take effect after I re-assign the default Physical Material to the landscape. Otherwise, any changes I made don’t actually update.

1 Like

Anyone gotten this feature to work? I have a simple test landscape, with two landscape layers, each with their own physical material, Rocks and Gravel. Doing a line trace down from my player returns the correct physical materials for both of those as I walk around, most of the time.

I added a Landscape Physical Material Output node to the material, outputting a physical material called Puddle. The result is unpredictable.
Sometimes the traces never return puddle at all. Sometimes they only return puddle across the entire material. I have yet to get the output to actually correctly return the puddle physmat in the spots I’m specifying with my mask.

It used to work when I tested it (pretty recent too).
Basically it takes a landscape wide texture.
Its ideal for RTs

And what it really does, is it let’s me change from grass to mud or ground at runtime when the … let’s not get into details, NDA and all.

But it did work, and it was a missing feature.

Output the mask you are using into the material base color to see what is up.
Needs clear black/white without fading to work right.

Mask looks fine in Base Color. I added an If node to make sure the output is pure black and pure white. Still no luck.

Here’s what this test looks like:

The entire material reads as puddle, seemingly ignoring the mask.

“D’oh”? … you are only outputting puddle. Is the engine supposed to magically know what the other physical material is?