Announcement

Collapse
No announcement yet.

MatLayerBlend Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    MatLayerBlend Problem

    HI all. Got a pretty annoying problem which im unable to figure out.
    Hadnt noticed the problem previously, due to the layers blended, being a similar colour.

    Basically,when I paint one layer, onto a second... a third layer appears within the blend.. Sounds stupid I know.

    Heres how it looks.
    Click image for larger version

Name:	GtoI0wi.jpg
Views:	1
Size:	338.6 KB
ID:	1164643
    The lighter, rock, that appears between the two layers shouldn't be there at all, in this particular area. I have only painted two layers.

    Here is the material blend section of the material used.
    Click image for larger version

Name:	sWljWug.png
Views:	1
Size:	501.7 KB
ID:	1164644
    The "SandPebbles" layer is painted on everywhere, then I've painted on "SandDunes" layer in the middle. The third layer that is appearing is the "LayeredCliffs" one.

    Anyone have any clue as to why this is happening? Maybe how I can fix it?

    Cheers all, kind of at my wits end with this one, I cannot figure it out.

    Cheers all!

    #2
    Looks to me like you are using Weight blended layer settings. When you do that it attempts to normalize all the weights and it will not know to account for the additional contrast you are performing on one of the layer alphas. I would suggest using non weight blended layers for a setup like this.
    Ryan Brucks
    Principal Technical Artist, Epic Games

    Comment


      #3
      You're kidding.

      I'm such a dumb ***.

      Thank you RyanB, you're a life saver!

      EDIT: Quick question. Is it normal that the order matters when doing it this way?
      It seems with No Weight-Blend, I am unable to keep painting over each layer.


      EDIT2: Also quickly. How do you use No Weight-Blend with tiled imports? It doesnt give you an option to do so.
      Last edited by Thorax; 10-08-2015, 11:57 AM.

      Comment


        #4
        Yes, that is expected. That is because with no weight blend, you are defining the layer order in your material by the order you chain your nodes together. I would recommend ordering them based on physical relationship. ie... bedrock then dirt then grass then snow in most cases. Then anytime you want to expose rock, just think about peeling away the top layers to expose it.

        You can actually get weight blend with blend modulation but you need to use only the landscape height layer blend node. There is not quite as much control there but it is doable.

        You can also do some manual height based weight blending with custom height lerping if you really want to be the math gets a bit tricky. Basically you would use your bottom rock alpha (with contrast adjustments applied) to subtract from the above layers. It gets a bit hairy though to do it correctly for many layers so I don't really recommend that unless you really understand how weighted blending works.
        Last edited by RyanB; 10-08-2015, 12:16 PM.
        Ryan Brucks
        Principal Technical Artist, Epic Games

        Comment


          #5
          Ahh ok. That makes sense. Thats also generally how i order my layers too. Except it seems I have been doing them backwards XD

          So what about importing tiled landscapes with non weight blending layers?


          Thanks again Ryan. Help is very much appreciated.

          Comment


            #6
            OK. Well I thought i would give it a try.

            I imported a tiled world. No option for the Layer Info type. So, I imported the world, saved, closed the editor. I then went and copied existing non weight-blend layers into the newly created shared assets folder for the tiled landscape. And to my surprise, it worked.

            A bit awkward, but it works.

            Comment


              #7
              I agree the tiled import dialogue is a bit lacking in features and polish.

              It has been a few months since I used it but I seem to recall that if I pointed it at my existing material it just used the existing layer assets without automatically making new ones... did you specify a material and it still made layer assets for you? It is unfortunate that it doesn't let you choose.
              Ryan Brucks
              Principal Technical Artist, Epic Games

              Comment


                #8
                Yeah unfortunately it doesn't work too well.

                It needs an option for the blending type. I thought I had found a work around as mentioned previously. But that only solve half the problem.

                Placing pre-existing "No Weight-Blend" Layer Info files into the map folders shared assets does make it paint like a No Weight-Blend layer, as in the rock is always at the bottom and you have to "un paint" the previous layers, which is nice.

                Not sure if it still gives that halo issue. Or its a problem with the layer generation from world machine. Will have to experiment more.

                Cheers for all your help Ryan!

                Comment


                  #9
                  So. I have been playing a round a bit more trying to get stuff to work. But to no avail really.

                  When importing tiled terrain. I seem to get a halo of the top most layer (cliffs) around the bottom most layer (dunes).
                  Even after swapping the layer info's for "No Weight-Blend" ones.

                  This is the material.
                  Click image for larger version

Name:	wW5EfbW.png
Views:	1
Size:	359.0 KB
ID:	1091079

                  And this is how it loks when applied to the terrain.


                  I have coloured the cliff layer pink. And as you can see its everywhere.

                  If I create a different material with just colours for each layer. Like so...
                  Click image for larger version

Name:	3FTD7Te.png
Views:	1
Size:	104.7 KB
ID:	1091081
                  It works fine...
                  Click image for larger version

Name:	4y1lsq9.png
Views:	1
Size:	738.3 KB
ID:	1091082
                  Here you can see the pink cliffs only showing up on the steep faces. As it should be.

                  This rules out it being a problem with the weight map generation from World Machine, as I thought it might have been.

                  So I tried again using the MatLayerBlend style blending, but with just plain colours. Like so...
                  Click image for larger version

Name:	yMh4SBi.png
Views:	1
Size:	302.5 KB
ID:	1091084
                  Each colour function is essentially this. (Yes I know I should have just made a function input or something)
                  Click image for larger version

Name:	uu9tpSi.png
Views:	1
Size:	69.6 KB
ID:	1091085
                  As you can see, I am still using the height blend for the dune layer.

                  And here is the result.
                  Click image for larger version

Name:	HtRTNuQ.png
Views:	1
Size:	632.0 KB
ID:	1091086
                  Same as the first time round. As you can see the dunes are still blending by height, but the cliff layer is everywhere it shouldn't be.

                  So it looks like im having the same problem I originally had... However. What's more confusing is that all the layers still paint absolutely fine. As seen here....



                  All the landscape screen shots are taken from the same position. The first and last screenshots are both using the exact same material.

                  I just can't figure out why with that material, its showing the cliff layer everywhere, when it clearly isnt there.
                  I literally have no idea why its doing this and its driving me insane.

                  I know I can just use a material with the landscape layer blend node. But then I wont be able to use Material Functions.

                  Can anyone tell what the hell is going on? Cos I really cant.

                  Thanks in advance everyone.
                  Attached Files

                  Comment


                    #10
                    Is it possible at all to alter the order in which weightmaps are imported?

                    Like this I mean.
                    Click image for larger version

Name:	hn28m7p.png
Views:	1
Size:	35.4 KB
ID:	1091098

                    This isnt the order in which I have set them up in the landscape material. I need the SandDunes to be at the very top as they are in the material, so it looks lie the dunes are spread across all layers where it applies.
                    As it is, the SandPebbles layer takes priority and creates a hard edge where it blends over the SandDunes layer.

                    Any ideas what I mean anyone?

                    Comment


                      #11
                      There should be no affect from the order the layers appear in the import dialogue. You are in control of that with your material.

                      I am not exactly sure what is going on, but to me it seems like you are doing your layers backwards. The way you are modulating your bottom layers is affecting all top layers. I think you should reverse it so the rock is the bottom, then cliffs, then cracked earth, then pebbles, then sand etc.
                      Ryan Brucks
                      Principal Technical Artist, Epic Games

                      Comment


                        #12
                        I was asking about the layer order cos it does matter if you are using https://docs.unrealengine.com/latest...als/index.html <---- this type of material.

                        And I'm pretty sure I am doing it that way around. The Cliff is the bottom most layer, then Rock, Cracked Earth, Pebbles, Sand.

                        The thing I dont understand is the material works perfectly fine. The problem only seems to occur when importing a landscape.

                        Here is the entire setup in WM anyway. Just incase you spot something I've missed.
                        Click image for larger version

Name:	usORr2X.png
Views:	1
Size:	96.1 KB
ID:	1091102

                        I honestly don't know what's going on.

                        Cheers again for the help Ryan

                        Comment


                          #13
                          Ah nevermind I was reading it wrong. I do see something a bit off then...

                          Your bottom most layer does not need a layer weight. So in your graph, "cliffs" should go into the base layer of the matlayerblend above with "rocks" as top. You should not use the bottom layer sample called "LayeredCliffs" at all since by definition it is always white by being the bottom layer. I can't say with certainty if that is causing the problem but I would try removing it.
                          Ryan Brucks
                          Principal Technical Artist, Epic Games

                          Comment


                            #14
                            I did wonder if that would be the case myself. To just not bother creating a weight-map for the bottom most layer as that one will always be 100%.
                            Well I tried it, and that didn't work either.

                            So i figured I would try doing this sort of setup instead.
                            Click image for larger version

Name:	3FTD7Te.png
Views:	1
Size:	104.7 KB
ID:	1091081

                            But when importing a tiled landscape using this sort of material, the sand dunes don't appear at all.
                            I wasn't sure If I just needed to reverse the Layer Blend items, but that had the same result.

                            Not that it would really matter, I've never managed to get this sort of set-up working with height blending.


                            I honestly don't know how to achieve this. It's just not working as expected.

                            Cheers for the help again Ryan. It is greatly appreciated.

                            Comment


                              #15
                              Think you have it in the wrong order, Cliffs should be at the top (index 0 in the list ) and sand dunes at the bottom (index 4)


                              I'm too are trying to make a landscape and this is my layers so far.
                              Click image for larger version

Name:	L_layers.jpg
Views:	1
Size:	252.5 KB
ID:	1091125


                              Rocks are LB Height Blend with a height mask in the Height Rock Layer blend input. The rest are LB Weight Blend for now.
                              Last edited by Numbat; 10-11-2015, 12:38 PM.

                              Comment

                              Working...
                              X