How to control Landscape Tessellation with distance?

Yes, but the grass doesnt have to be grass. It could be a series of random undulation rock like shapes that aid in displacement. The color could be driven by the material so things appear to be based on the terrain layers. Yes you would have collision issues but you’d have those with displacement on the landscape itself too.

Very interesting thread here! I got the Tessellation based on distance working, but I don’t get any displacement at all on the landscape. This is how it looks:

http://puu.sh/jKB0h/08759fe4c0.png

http://puu.sh/jKB1F/eabd730712.png

So you see the tesselation is getting less quite fast in the distance, and on the right I have placed a sphere static mesh with the same material applied as the landscape. On the sphere you can clearly see the displacement, while the landscape is tessellated, but stays flat.

This is the material:

http://puu.sh/jKB2Z/17ba01abf8.png

At the moment I have the “DisplacementMultiplier” set to 10, if I set it to something like 1000 I actually see “displacement” on the landscape, but it’s just that I get a “hill” near my camera, so the landscape is just getting higher quite uniformly with some cracks inside:

Displacement Multiplier set to 10:

http://puu.sh/jKBgG/e6c4baf643.png

Set to 1000:

http://puu.sh/jKBhR/4f88d30ac3.png

Why is it not working? What am I doing wrong?

You don’t need to blend down the displacement using the distance mask, you can displace the un-tessellated geometry and that will fix the ‘hump’ you are seeing. You might consider bias-scaling the displacement (orjust subtract 0.5 from the heightmap) to make it centered at 0.5 and displace both up and down rather than just up. With it displacing only upwards like your image, you will have some bad character clipping problems.

In terms of why it looks like a hump, it seems your resolution on the landscape is not high enough to tessellate for the small details in that displacement map. What is the world size of your landscape quads-untessellated? You need to start with a size of 1 meter per polygon before tessellation (or smaller) to have a chance at capturing small details.

In the image I posted above I had modified the engine locally to enable higher tessellation factors. I believe the current engine clamps to either 8 or 16 tessellations per polygon. I had locally set it to 32. Do you know how to build with VS? If so I can tell you how to modify it (I’d do it right now but didn’t bring the build home with me this weekend).

They Ryan, thanks a lot for the answer! :slight_smile:

I have fixed the issues you mentioned, I removed the blending of the displacement map and I also subtracted it by 0.5, the material now looks like this:

http://puu.sh/jLVeU/aafc56ad06.png

The problem with this is, it is now also displacing the landscape in the background, so there no tesselation gets applied, but it’s still displacing the polygons:

http://puu.sh/jLUVH/2307c193b4.png

And this also looks really “cracky”:

http://puu.sh/jLV1F/1fa6e7a4ce.png

The screenshots above are taken with “Displacement Multiplier” set to 1000. If I set it to something lower, like 100, it looks less “cracky”:

http://puu.sh/jLVa1/9ce59cf823.png

From near the ground it looks like this (multiplier set to 100):

http://puu.sh/jLVqI/14c3432167.png

http://puu.sh/jLW18/e045196deb.png

It feels like the displacement gets applied at the totally wrong location. It should make those stones “come out”, but it seems to just displace the whole landscape in “waves”.

Where can I set the resolution of the landscape? At the moment it’s set to 2 polygons per square meter. I can’t find a setting for changing this, neither in the landscape actor nor in the landscape generation settings.

I know how to build UE4 from VS, do you think the problem is just the tesselation resolution? At the wireframe screenshot above you see that the resolution is not really “high”, but i should at least be enough to make one vertex pop out where the stones are. If it would work correctly, it would probably look quite “spikey” because of the low resolution. But there has to be another problem at the moment since it does not even look “spikey”…

If the distance mask was fixing cracks, feel free to put it back :slight_smile:

In terms of the displacement being wrong, I still think it is just the resolution. You really should be testing with more specific test content, such as a perfect sphere heightmap (there is one in engine). It is too hard to see what is going on that displacement map for that texture is very lumpy overall.

Thanks Ryan, so I now use the perfect sphere heightmap from the engine, that’s a really good idea.

The material now looks like this (just changed the texture):

http://puu.sh/jNBh4/b16c3bd320.png

Displacement Multiplier is still set to 100.

In the level it looks like this:

http://puu.sh/jNBkA/2b92eaf66f.png

http://puu.sh/jNBlT/7cea52fc4d.png

So it looks like there would be no displacement at all, landscape stays completely flat. But if I move below the landscape and have it still selected, then the orange borders around the selected object the landscape) actually look completely correctly, like a lot of spherical dents at correct location:

http://puu.sh/jNBt7/6a6a604ae5.png

How comes that the “selection border” shows something completely different than the wireframe view? I don’t even need to move below the landscape, if I just move very close to the ground and look at it almost parallel to the ground the orange border shows how the landscape should look ideally, just that all polygons stay at the ground:

http://puu.sh/jNBz9/9c015fdf36.png

What’s happening here? Why is the selection border showing something what’s not there?

Now, if I increase the Displacement Multiplier to 1000 and zoom out really far, I actually see that the displacement is applied completely wrong:

http://puu.sh/jNBHm/4d088949cd.png

http://puu.sh/jNBIq/e675015793.png

The “base color” is tiled thousands of times across the landscape (thats correct) but the displacement map seems to be just one time applied to the landscape without any tiling at all! Is this a bug? And even more strange, the orange selection border is actually still correct, they show the correctly tiled elevations in the landscape:

http://puu.sh/jNBQx/4e0b24af85.png

I really wonder why I get such strange results? I don’t seem to make anything wrong, but how could it work for you and also for Tireless and I just get these buggy results? So strange…

looks like you have no UVs specified for the heightmap so it is mapping to the entire landscape. I usually use worldposition-XY or sometimes landscapecoordinates for tiling textures. Worldposition-XY is more useful if you want to match the tiling on any static meshes near the terrain (ie common river border).

That is very strange that the selection outline is behaving differently. I have seen it do weird things before such as showing more intense displacement. For some reason the landscape must be using landscape coords in the vertex shader but UVs in the pixel shader as the default when no UV is specified. As long as you specify something it should fix it.

Using Worldposition-XY for the UV input fixes it! Thanks! I have also tried to plug the TextureCoordinates and LandscapeCoords node in there, but with these 2 I always get the heightmap mapped to the entire landscape without any tiling. So I plug the LandscapeCoords node into the heightmap texture, use it for both the base color and displacement, and while the base color is tiled correctly, the displacement is not tiled a all. How can this be? It surely is a bug?

One problem is left though, I get a lot of cracks in the landscape in the area where the tessellation multiplier is faded towards 0:

http://puu.sh/jOnHb/44a198e40b.png

http://puu.sh/jOnIp/aab54f06e9.png

http://puu.sh/jOo5E/fde05c54ac.gif

Any ideas how to fix those cracks? Did you not get those? I have of course enabled “Crack free displacement” in the material.

With using the Worldposition-XY for the UVs it now also works great with the real texture, and you are right, the resolution is a bit too low, it’s looking a bit too edgy. Are there any plans for making the max tessellation amount modifiable without the need for manually compiling the whole engine? I can live with the low resolution for now, if the cracks would not be there. So any idea how to fix the cracks?

Yea, you probably need to multiply down the displacement around the transition zone. I forgot about that but there is definitely a lot of cracks when you use tessellation across the boundary.

Not sure why landscape coords was messed up… did you actually enter a tiling factor for the landscape coords or UV node?

I now made it so that the area where tessellation get’s applied is quite a bit bigger than the are where displacement get’s applied, so this removes most of the cracks. There are still some cracks visible, though they are only single pixels and with enabled Temporal AA they get blurred out and are no longer visible. But why are there cracks at all with “Crack free displacement” checked?

Where should I enter a tiling factor in the TexCoord node? It’s default to 1 in U and V and I did not change it. For the LandscapeCoords I also used the default values. Have you ever made tesselation on a landscape work with not using the Worldposition-XY node for the UVs? For flat surfaces using the Worldposition-XY for UVs is fine, but for angular surfaces it looks not nice, so if possible I would like to use the regular UV node.

Thanks a lot for your help, at least it is working now :slight_smile:

The cracks are just a bug.

If you didn’t change the tiling factor, then it is expected that the texture maps to the entire landscape. Same with landscape coords, you need to specify the tiling factor that you want, the default is not meant to be used.

as before, it is a bug that things are being treated differently, but almost nobody will ever make a landscape and plug in a UV node without changing the tiling factor, so it is an unlikely bug for our QA team to find. It is still a bug but it will be very low priority since the workaround is so obvious and easy. Just specify the tiling you want and you are good to go.

Then why does the tiling work for the base color if it’s not expected to work with default settings?

When I try to get a feature to work (tessellation) I don’t care about whether it looks perfect (good tiling) but the important thing is that the feature works first, so all settings which are not related to tessellation stay on default. Wouldn’t you do it the same way? I don’t think it’s “obvious and easy” then to find a setting which is not related at all to the feature you want to get to work. I think this is why there is a marketplace package just for making tessellation work on a landscape, because almost no one else can manage to make it work with all those bugs, apparently the workarounds are not “obvious and easy” enough :slight_smile:

I tried to set a “tiling factor” in the LandscapeCoords node, I think you mean the setting “mapping scale”. After setting it to 2 it looks like this:

http://puu.sh/jOtXC/007b84dbe3.png

Setting it to 0.5 results in this:

http://puu.sh/jOu2s/fa481a42b2.png

So it does not fix the bug. It just changes the tiling factor for both the way it’s tiled in the base color and the displacement, but they both still don’t fit together at all.

actually upon further testing, try disabling the crack free option. that may be the cause. Does it make any difference in the cracks you see anyways? Last time I checked, it didn’t really do much.

I created a bug report for this.

Upon further testing, the issue here is the crack free displacement option. in my test the problem goes away once that option is disabled. I created a bug report.

If you are using worldposition-xy the issue does not occur. I am not sure if the crack free option actually helps that much. Does it for you?

You are right, disabling the “Crack Free Displacement” does indeed fix the wrong tiling of the displacement! It now works fine with the LandscapeCoords node, no matter how I set the scale/tiling factor. Thanks!

It does not seem to make any difference regarding the cracks, as far as I can tell. They are there, no matter whether the option is ticked or not.

Disabling the “Crack Free Displacement” does indeed fix the wrong tiling of the displacement, you are right! Using a LandscapeCoords node for the UVs works fine now, no matter what scale/tiling factor I use :slight_smile: Thanks!

I think I don’t notice any difference between having the “Crack Free Displacement” enabled or disabled regarding the cracks, they are always same good/bad on a landscape.

I haven’t read your whole post, so my apologies if this is of topic, but anyway:
Have you tried using the LODDistance Factor as seen in this thread?
It helped me when I googeled basically what you’ve wrote: