Terrain tesselation and dynamic shadows

would be lovely to tackle all the landscape issues and feature requests, but while we’re on this thread I’d love to focus on the tessellation issues otherwise we’ll never get anywhere :wink:

still would be awesome for Epic staff to read up that forum thread though

this is the one he refers to:

https://forums.unrealengine.com/unreal-engine/feedback-for-epic/118347-landscape-system-related-features-and-issues

Landscape had been switching to a shader variant without tess for LOD1 and onwrads since 4.14 i think.

never heard of this feature. but that would mean that forcing the landscape to LOD1 (and beyond) would completely avoid the base cost of Tessellation, and I frankly doubt this has ever been the case (otherwise the base cost of tessellation on huge landscapes would never have been so big)

anyway this behavior changed in 4.19. Landscape has tessellation at all LOD levels now/again, and the new landscape actor’s tessellation properties control the curve and range of landscape tessellation reduction on the fly as a means to re-add the distance-based tessellation that got lost with switching landscape LOD from distabce-based to screenspace-based

note the emphasis on ‘on the fly’, which is what makes me suspect there isn’t a tess-less switch at any moment

so here’s how I use Tessellation in my material

It used to be LOD0 Tessellation, and LOD1+ Material with No Tessellation. Now user control up to which component screen size should we apply tessellation after that the behavior is as before, we use a material with tessellation off.

Even in the component that got the tessellation enabled material, there is a falloff that can be controls in settings to further improve the perf of tessellation.

Can you show your wireframe? Tessellated component will be rendered white, and you should be able to see if the falloff is working or not by moving around in the editor, the far rendered triangle from the component should not feel more opaque then the one close to the camera. (Obviously hide the rest of your actor otherwise it will be hard to see)

And as i already said, a factor of 1 should have no visual impact, it wont subdivide your triangle.

And if you do a stat gpu, with those settings, what it look like?

well then. by setting the Landscape’s TessellationComponentScreenSize to 1.0 and TessellationComponentScreenSizeFalloff to 1.0 (effectively reducing tessellation as much as it’s possible, since they are both capped at 1.0) I get tessellation in really just 1 landscape component. how to explain the big cost?

sure thing, here it goes

everything appears to be the exact same tone of grey though, I don’t see any of this white vs more opaque polygons. it’s just a more dense wireframe on the exact same shade of grey.

and to re-iterate, this wireframe is with a Tessellation Mutliplier of 1.0 in my material instance. only with a value of 0.0 do I get tessellation to appear completely removed. so a factor of 1 really does subdivide my triangles.


these are my landscape actor settings in case you’re curious

as you can see I push the LOD distribution a lot and the far away mountains are really low poly.

changing the TessellationComponentScreenSize and TessellationComponentScreenSizeFalloff values do have an impact on the falloff as you say, so that seems to be working correctly. but of course lower values than my current 1.0 means even more tessellation

with stat gpu it looks like this, (also in comparison with/without tessellation - shadows are enabled in both cases)

I kept my skybox and my little test box hidden btw

here’s my shadow cascade settings:

and the light compared to my camera (hope this one makes sense)


for what it’s worth, a completely top-down light results in the same performance

What are your shadow cascade settings?

Also where is the light compared to your camera?

Those last things, would be helped with my last optim i made, that might be put in 4.20.

Unfortunately for 4.19.X this is as good as you can get.

Increasing to a tessellation factor of 2, does your performance changes a lot?

Tessellation Factor performance:

  • factor 0.0: 58 fps / 17.2 ms
  • factor 1.0: 54 fps / 18.4 ms
  • factor 2.0: 50 fps / 19.8 ms
  • factor 3.0: 47 fps / 21 ms
  • factor 4.0: 44 fps / 22.2 ms

sad to hear that having no tessellation at all vs tessellation on one single component will drop my FPS from ~101 to ~58

however I can wait for 4.20 and more, it’s just important that the slowdown is acknowledged by you guys (and improved upon)

@Chosker
I only tested landscape tessellation in 4.19 preview, and to be fair, I did not experience performance issues, that I would be considered undue, provided the landscape is set up right.

@Michel.Dupuis
Michel, wanted to bring up one more tess-related issue. It is depth pre-pass.

Well, on practice, I doubt I’d ever use depth pre-pass on landscape at all.
Landscape is just too heavy and most importantly, it is kind of object with naturally low overdraw.

And lastly, with tess enabled, you are paying twice the cost of landscape tessellation for base pass.
How about allowing to optionally disable depth pre-pass for landscape?

Or alternatively, optionally disabling tessellation in landscape’s depth pre-pass ?
I’m pretty sure, gentlemen, who are into landscapes, can live with being restricted to use only positive displacement, if it doubles tess performance for base pass.

can you please elaborate on having “the landscape is set up right.” ? all I did was take AffordableLandscapes from the marketplace, opened one of the maps (an 8k landscape, 255x255 quads/section, 1x1 sections/component), deleted everything except the landscape itself and the skybox, and set the landscape actor scale to 0.25 to test having 4x4 quads per meter. then I modified the LOD settings to be more aggressive than default.

if there’s some secret to making tessellation not half my FPS when applied to my landscape, by all means share it! :slight_smile:

I wonder how big was the landscape in your test in the 4.19 preview?

@Michel.Dupuis here’s a new test I did:

  • I made a copy of my landscape material and disabled tessellation on it
  • then I selected all components except the 4 closest to the camera, and applied the non-tessellated version to them as Override Material

in theory this the same thing the engine is doing under the hood right?

now, this is the result:

the performance difference is very significant at almost a full 2ms. could there be something off in how this is handled?

the wireframes look exactly the same btw

@Chosker
Set up right involves:

  1. Avoid using 8k landscape, when practicable. You can’t LOD it efficiently, thus your LOD0 will still take huge space, even if you are running 1024 components. You can’t layer it efficiently either. Rely on world composition and smaller landscapes.
  2. LOD agressively.
  3. Set up shadow cascade splits in a such way, that your first cascade fully encloses components with tessellation enabled. In 4.20 this would change to Set up shadow cascade splits in a such way, that your first cascade fully encloses displaced region.
    4.19 Preview version had a core change, that did not make it. It is the essensce of this answerhub talk and without it tess shadow costs are still fubar.
    Whatever you do, you can’t afford rendering landscape components, where tessellation is enabled, into more than one shadow cascade.
  4. Disable early z pass in project settings.

@Michel.Dupuis
Speaking of an 8k landscape in 4.19.0, is there any partcilar reason why you can’t use component tessellation screen size higher than 1 ?
And adding to that, why you can’t push LOD0->LOD1 transition earlier?

Here is an actual LOD0 picture. You can’t push it closer to the cam. Nor you can force tess cutoff kick in earlier, which you definitely should be able to do.

And here is expected components, where tess should be enabled:

ok so,

1. I only use an 8k landscape to downscale it (to 0.25 scale) and get more density (1 quad per meter is far from cutting edge).

but this already means my components are not taking a huge space. what about having more+smaller components though?

I could try world composition but then I’m just going to improve upon the far-range stuff, which isn’t really that expensive with my current setup. with an 8k landscape downscaled to 0.25 scale I have a 2x2km landscape, which means I have an average of ~1.5 km view distance. world composition would pretty much destroy this already limited view distance. unless I use proxy meshes… but at this point (where my far landscape components are basically 4x4 quads, and my material is super simple) the landscape should in theory by superior performance-wise to using meshes.

unless something changed drastically in the past couple of years, world composition is just a tool to hide/unhide chunks of landscape, but in fact provides zero benefit if you want to keep to the same view distance (in fact when I tried it 3 years ago the performance was worse… Why is a regular landscape 2x faster than a tiled landscape? - World Creation - Unreal Engine Forums)

Layering: I don’t see how layering is relevant at this point. I’m merely comparing tessellation vs non tessellation. I’ll fight the layer battle later (I’ll limit it to 4 layers per component and I’ll make dynamic branching on custom nodes)

2. I already LOD aggressively. see my wireframe screenshot above.

though again this is a ‘general’ thing and not a tessellation-specific thing.

3. I could do that, but then it means close-range shadows will be really low-res. at this point my tessellated region is quite big (because the components are big, even if they are at 0.25 scale)

I’ll try it anyway, if at least to mitigate the impact for now.

4. disabling early Z pass had zero impact


(charlimit)