Tessellation on landscapes using Material Function based automaterial?

Hi folks,

I’m currently working towards pre-production goals (mainly getting my pipelines down) on a project where I need to create a large volume of landscapes generated in the every updating ‘World Creator’.

Due to limited resources (one man show so far) I have to find good automated answers to my content queries and so I thought automated landscape material generation was the way to go.

I settled on the 4 part tutorial series provided by RATSGAME over on youtube: UE4 Landscape Material Tutorial Pt1

This automaterial uses material functions as a foundation for it’s slope weighted system and I chose this approach as it included distance based texturing resizing.

I have this material up and running and I even went as far as to duplicate the steps in these videos so create several ‘collections’ of materials which I’ve then used as bespoke layers on the terrain so I can break up surfaces with further detail and additional materials.

My problem is that I can’t get tessellation working within this system.

I know landscape tessellation is possible as one of Algorithmics latest videos breaks down how to do it.

The problem is their method uses manually painted layers as opposed to an automaterial.

How do I set up tessellation from a heightmap within a material function?

Hey, I’m in the same situation as you per this post. Did you figure out how to make this work, and if so could you share the workflow?

Heres my AnswerHub post which shows the wires Ive connected to make the tessellation appear (using various tutorials linked to in my post), although its not functioning as I want it to. Hope that helps to some extent.

I think tessellation is not hooked up in the material layer blend function. Double click the function and look at it’s content to double check. If so, you can just hook it up and save the function for later. Or make a copy of it because it will reset when you update the engine.

Not sure if this is what you are looking for but this is an excellent tutorial that explains how to create tesselation in a material with distance based intensity.

1 Like

I’ve already followed the tutorial you’ve posted above there WixZ and applied it to my material (same automaterial that the OP uses) to no avail. I forgot to link to my AnswerHub question in my first post which focuses on the same issue, here we go: Tessellated landscape - textures not tessellating as hoped for - Rendering - Unreal Engine Forums. And to Daedalus51, tessellation is hooked up in the material layer blend standard function.

What exactly isn’t working with your material? Is the tesselation not working or is not collapsing itself in the distance?

The tesselation and distance blend is working perfectly, but the tesselation is affecting every layer (material functions). I’ve tried setting up tesselation in the material functions and in the master material, and I still get the same result. I’ve got a heightmap texture for each layer, but so far I’m only using the cliff heightmap as I can’t figure out how to make the tesselation limited to one layer; once I know that I would use another heightmap for the tesselation on my erosion layer. If my pictures in the AnswerHub post are unclear I’d be happy to show more of the graph in order for some glorious guidance by people who know more than me. :slight_smile:

Ok so you want tesselation only on some parts of the material? Hmm… I have honestly never tried that before, but as far as I’m aware the way the tutorial type of distance based tesselation works is using a sphere mask, which is essentially a black and white mask. If that works, than I don’t see how you wouldn’t be able to just use a mask to define which areas need tesselation and which ones don’t. Maybe give that a try (if you haven’t already?)

A mask is just a range of values between 0 and 1 (if it’s clamped anyway), 0 tesselation to 1 full tesselation. So basically a lerp should work.

Also what do you mean with “layers”. Do you mean like vertex painting? Because that could also work fine with a mask.

What Ive basically got are three slopebased material functions (the layers Im talking about): cliff, erosion and grass. I would like to use tesselation on all of the layers, I just dont know how well the grass would look, and besides that I dont understand how to apply a different heightmap to each layer which supposedly shows where the tesselation is meant to push down or up. Im not sure whats the best approach, pretty much. Either way, the more tesselation the more realism and thats what Im going for.

Ive tried masking (B) the heightmap result of the cliff material function call, but it still affects all layers. I see that I linked to the edit of my post, heres the proper link if the previous didnt work.

If i understand it well tesselation isn’t the problem, it’s your heightmap which is now one heightmap for all layers, right? So what you need is 3 lerps if you have 3 layers. You will also need 3 masks which define each layer. Then you should use the lerps to define which layer needs which heightmap info, then plug the final result into world displacement.

Wow, okay. Yeah that sounded pretty reasonable haha. I’ve been pulling half of my hair out over this one, I’ll give the setup a try tomorrow and update you here if it worked. Cheers, WixZ. Your game looks absolutely gorgeous by the way, I’ll be following that! :slight_smile:

Hey man, if you need any more help, feel free to pm me or ask in here. And thanks! :slight_smile:

Hey WixZ, the setup worked perfectly in order to select the different heightmaps for the displacement, thanks a bunch! :slight_smile:

I’ve got one last issue with the displacement though: the erosion layer has pebbles in it, and is supposed to pop with the tesselation, but that’s not happening. Instead I’m getting “spiky” edges with the displacement value of 15 (any less and the displacement is barely visible, and any more just looks unnatural).

Could that be because of the textures being 2k instead of 4k?
Or that the heightmap greyscales are bad for displacement? I didn’t make them, but I tried playing around with the greyscale tones which resulted in very edgy walls displacing, instead of the pebbles popping out.
It could also be because of the landscapes’ resolution, what do you think? Here’s some pictures to demonstrate:

Erosion/dirt showing weird displacement:

Landscape resolution. The Cliffs look decent now :slight_smile:

Heightmap greyscale of the erosion/dirt:

Actual dirt texture with pebbles:

Hmmm… can’t get the images to work. Getting errors when uploading them on Microsoft Edge, while Chrome doesn’t even show how to upload images.

The pictures you attached in your post aren’t visible to me. :frowning:

Anyway, I think it might be because of the heightmap quality yes. Also keep in mind that the more blurry your heightmap the more blurry / smudgy your height displacement will be. If you amp that up too high you will indeed get unnatural looking displacement. It’s better to have a heightmap with crisp details.

Okay, cheers for the answers man. :slight_smile: I can’t figure out how to make those pictures viewable, they’re in simple

brackets. My heightmaps are pretty blurry, rarely with any fully white/black areas and looks pretty smudged like a noise mask. I’ll go scouting for a better set of textures, hopefully that solves it for me. Again, thanks a lot! If you don’t mind, I’ll take you up on the offer and PM you when I stumble across another hair-tearing issue hehe!