x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

How do I blend landscape textures based on world height / heightmap values?

I'm currently working on texturing a map that is about 400,000 x 200,000 km in size, as such, it would make sense to build a dynamic texturing system that blends textures based on pre-defined heights and angles (snow textures applied at certain elevations, etc.) I've been trying many different methods and none of them seem to work. I already know how to align textures to angles (rocks on cliffs, grass/dirt on flat land), I plan on merging that with this.

I know there is a way to do this, but UE4 does not seem to have a node for it anymore...

Also, this same question was asked by somebody else here- https://answers.unrealengine.com/questions/30686/landscape-layer-by-height.html but nobody has answered yet. This is one of the few remaining things I need working for me to really get started on my project, thank you for your time...

Product Version: Not Selected
Tags:
more ▼

asked Apr 24 '14 at 11:34 PM in Using UE4

avatar image

Daverex
266 14 17 134

avatar image TJ V ♦♦ STAFF May 06 '14 at 07:23 PM

Hi Daverex,

Have you looked through the Stylized Landscape document? It may give you a few ideas.

https://docs.unrealengine.com/latest/INT/Resources/Showcases/Stylized/Landscape/index.html

I hope it help.

Thanks, TJ

avatar image Stunt Thumper May 06 '14 at 08:17 PM

We've both already looked at that page. It only show how to blend based on terrain angles. Ill repeat my comment and that it probably lies within the mf terrain height lerp

avatar image TJ V ♦♦ STAFF May 06 '14 at 09:19 PM

Here is another resource that could be of use.
https://docs.unrealengine.com/latest/INT/Engine/Rendering/Materials/ExpressionReference/Landscape/index.html

If it still doesn't help you figure out a solution please comment back and we'll see what else we can find.

Thanks, TJ

avatar image Stunt Thumper May 06 '14 at 09:27 PM

That node doesnt determine where the textures can be located based on the elevation of the landscape. Im about to get off work and play with some texture functions like the mf terrain height lerp. And im not sure how to use that with the world align blend node. It jacks up when i try to paint on it

avatar image Daverex May 06 '14 at 09:43 PM

There is no further need for this discussion, I believe. I've just solved it myself. I'll post my real solution shortly.

avatar image Investigator Sep 27 '16 at 03:30 PM

Is this, after two years, still the best way of doing this or have thing changed a bit? I am mainly asking this because I seem to be unable to find some rather important nodes. The blend layer, blend bump and white parameters specifically.

avatar image Daverex Sep 27 '16 at 03:56 PM

Oh absolutely not, I've refined it quite a bit and there are easier ways now to get these results. I've since switched to using World Machine just because it produces more rugged and defined results, but I can definitely dig out my old notes this evening and give a quick run-down of how to apply this method.

(comments are locked)
10|2000 characters needed characters left

2 answers: sort voted first

Finally after enough poking around and mental hardship, I've come to a solution for blending textures based on elevation.

The "divide" node controls where the blending starts along Z (also -Z, this will duplicate results on both positive and negative values, so make sure you've the lowest part of your terrain above 0 if you want to use this for oceans and lakes) For me, I had to set it to divide by 140 to get reasonable results.

Note: my example is not entirely finished, as this elevation blend will later be combined with an angle blend, to more realistically show how snow sits on a mountain. Still wont be perfect, but may be believable.

alt text

alt text

more ▼

answered May 06 '14 at 09:50 PM

avatar image

Daverex
266 14 17 134

avatar image Daverex May 06 '14 at 10:06 PM

And here's how it currently looks with my angle-calculations added to the blend. Hopefully this isn't just beneficial to me, but to everybody having the same problem.

Note: this can also be made into entire biome "Layers" For example, I want a temperate layer, and a desert layer, and painting them dynamically textures the terrain according to pre-defined parameters.

alt text

avatar image Stunt Thumper May 06 '14 at 10:12 PM

Woot! Any way i could see your full material set up? And are you able to paint on this with other textures?

avatar image Daverex May 06 '14 at 11:32 PM

I'll post the material setup once I'm done cleaning it up, haha.

And yes, additional textures can be painted using a [layer blend] node. This setup should be on your first layer, addition textures (or alternative elevation setups like mine) can simply be painted like any other layer. This is necessary, in fact. As this landscape setup only creates a massive, generalized environment, it cannot do much fine detail work, for obvious reasons.

avatar image Stunt Thumper May 06 '14 at 11:42 PM

Ive figured something out but i have to divide by 4mil for some reason lol. And im not sure where that Absolute world position node is located? And i dont see any changes by deleting all those multiplyers

avatar image Daverex May 06 '14 at 11:56 PM

The multipliers sharpen the results, which I wanted for my map, you don't necessarily need them, and there may be a way to replace them with something else.

Simply type WorldPosition, it's under coordinates. Yours will look a little different than mine.

you did the dot function first, yes? I'm not sure why you need to divide that high. My test map's landscape was aligned at 0 on Z, btw. If your landscape is below there, you'll get different results. As they're present across both the negative and positive values of the Z axis. Also, my test map stretches to the heighest point UE4 will support, which may be why my results don't need such a large divisor.

avatar image Stunt Thumper May 07 '14 at 12:01 AM

You can use Power under math. And plug a vector 3 into the main material nodes World Position Offset input and raise the z value to lower the center of ur material. I have mine now set up where the ocean is at the very bottom of what unreal can do and the snow at the very top. And if u haven't figured it out already just invert the snow function to create an ocean layer at the bottom. Oh and in order to paint i assume u have to run this through a landscape layer blend? Are you able to do that?

avatar image Daverex May 07 '14 at 03:57 AM

Yes, it's simple. Instead of plugging a texture into the layer function, just plug this whole setup into the first layer. You can use it the same as you would a single texture, except this already plans out the bulk of the painting. I believe I already mentioned this though?

and yes, I was going to replace the multiply nodes with an exponent function.

avatar image Stunt Thumper May 24 '14 at 05:40 PM

You never posted your full final material setup

avatar image Daverex May 24 '14 at 09:50 PM

Sorry about that, I've not had much time to work on things until recently. Here is a general overview of what my current material setup looks like, I'll try to post a more detailed view as well... alt text

avatar image Daverex May 24 '14 at 09:51 PM

alt text

alt text

avatar image Luis519RS Sep 14 '16 at 10:49 PM

Not sure if you figure it out. The way to remove the negative values is to clamp the negative values to zero before powering. Just change the Clamp Mode to min value to not block both directions. That should remove the negative values before you power without capping the positive Z values.

avatar image Stevenc94 Feb 18 '16 at 08:00 PM

Im confused on where to find the "world to local" node?

avatar image SememeS May 10 '16 at 09:13 PM

@Stevenc94 its the Transform node in vector ops

avatar image Dobric Apr 24 '17 at 07:48 PM

Ok, it works, but, I am having hard time applying grass MESH to that grass. It simply doesnt show up. I name the landscape grass layer same as grass textures inputs but doesnt work :/ how would you apply grass mesh to be where grass texture is?

(comments are locked)
10|2000 characters needed characters left

The way to remove the negative values is to clamp the negative values to zero before powering. Just change the Clamp Mode to min value. That should remove the negative values before you power without blocking your positive values.

more ▼

answered Sep 14 '16 at 10:45 PM

avatar image

Luis519RS
26 1 2 2

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question