Jump to content

Recommended Posts

Hey guys,

I'm copying this post from Reddit to get more exposure. Since you guys are pros, maybe you'll know the answer:

 

 I'm having an issue with my landscape material. I've got an HDA pulling in a landscape with six layers. I've setup each layer as a material function so I can blend each function in a material based on their layer name.

The problem is the material only works with three layers at a time. I can't do more. This is what it looks like with three layers as expected:

r/unrealengine - Landscape Layers Not Blending Correctly

Three layers with blend mode set to Opaque

The shader fails when I plug in more than three. It shades in a tiny square on the terrain (not shown here), the rest of the terrain is the standard checkerboard:

r/unrealengine - Landscape Layers Not Blending Correctly

Six layers fail with blend type set to Opaque

 

The only way to view all layers is to set Blend Type to Alpha Composite, however I completely lose my directional lighting:

r/unrealengine - Landscape Layers Not Blending Correctly

Six layers with blend type set to Alpha Composite (no directional lighting)

 

It must be something with my layering weights.. I just can't figure this out for the life of me. Here are my layer settings:

r/unrealengine - Landscape Layers Not Blending Correctly

Layer Blend settings

Let me know if you've run into this issue; I'm sure it's an easy fix.

 

Thanks guys,

Colby

 

Share this post


Link to post
Share on other sites

Did you try to plug a Constant3Vector into the layer blend? Just to check if that works.
I just tested a heightfield with 6 different masks and it works.

Share this post


Link to post
Share on other sites

So it seems to be working for base color now, but once I apply any other material attribute it won't shade the terrain. I made a low-res terrain to test.

six_colors.thumb.PNG.b924ff0721a73e74a82d0cf7ae020f8f.PNG

 

This is the material:

5f4aef22c1199_thisworks.thumb.PNG.5eb47c93342a4d9412fc1f1507900349.PNG

 

And this is the texture (it's the same default for testing, but it's working for base color):

5f4aef505524e_thisworks_texture.thumb.PNG.e40b73872bf65eaf2f4ee04a0c4cd2d4.PNG

 

However, when I apply ANYTHING other than Base Color, the shader fails:

this_does_not_work.thumb.PNG.d6ca3b80b3347b9d9e726a3066292df2.PNG

 

this_does_not_work_viewport.thumb.PNG.b660edba2f23a9db3ac90b64f060e73b.PNG

 

I'm just copying the Quixel default material into the material function for each layer:

mf.PNG.735e0a46b143e9eafda7909cf71c9cd8.PNG

 

Any idea why this is only working with Base Color?

Share this post


Link to post
Share on other sites

I just tried separating each material attribute and combining them individually via layer blend, however this still did not work... Again base color works fine with this method:

separating_each_attribute.thumb.PNG.9cdeb4a6d679e0a70cc070d7e40b9924.PNG

 

I'll keep messing around.

Share this post


Link to post
Share on other sites

Got it working!! So I needed to change the Sampler Source for each texture sampler to: Shared: Wrap. That and using a TenLayerBlend did the trick!

working.thumb.PNG.452645404232d19e5600ea6f70b54d07.PNG

 

And the texture sample node:

shared_wrap.thumb.PNG.4cca29fa6c9781bb1429922b35e4f5a6.PNG

  • Like 2
  • Thanks 1

Share this post


Link to post
Share on other sites

Hello, I am in a similar boat here and see that you used a TenLayerBlend. What are the inputs at the bottom and how did you create them. I understand the material inputs but the bottom ones elude me. It says sample but what is it a sample of? I feel like I am close!!

Regards,

Dan

Edited by darklordstudios

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×