Tessellation and Foliage cause the Video Driver to crash

I noticed the issue back in 4.9 I think and it was just as bad back then. Same with Landscape but that has been a known issue since at least November. RyanB mentioned it here: POM material - Rendering - Unreal Engine Forums Hopefully it can be fixed soon :slight_smile:

Hi,

I guess tessellation still hasn’t been worked on, as I still get this issue in 4.12 preview 1

cheers,

still occurring in 4.12 preview 3

any news on when this could be looked into?

cheers

Hey ,

I grabbed your test project from and will begin testing soon so we can determine the next course of action. I am currently looking into some other issues at the moment, but I promise to return with more information once my test has completed.

Hi ,

any luck with this?

cheers,

I dug into it yesterday towards the end of the day, and didn’t get to completely test and verify the bug. I will continue to work on it today and see what I can do in the way or reporting the bug.

I did some more digging around in your project, and found that the drop in framerate is directly correlated with the parameter ‘Displacement Bias’. This parameter is set to a negative value (-0.5) and as soon as you set it to a whole integer or positive value, the issue goes away. Another way I found to fix the issue is to pull from the red channel instead of the Alpha channel of your texture sample when doing vertex displacement.

Displacement Bias (0.0)

91232-lodissuefixed.gif

You have a lot going on in your material, and you have a lot of parameters which can quickly cause issues like this to appear if you aren’t careful. As I mentioned before this is not a bug, but just a place where optimization is needed. No one is going to be using a 10k polygon foliage model used in conjunction with tessellation and displacement, and then expect it to run well with a complex material and densely painted foliage. While I admit, the results you get when keeping the Displacement Bias at -0.5 is a bit unexpected and undesired, if it can be fixed by changing your material, or setting it to a different value, this is not a bug.

Thank you,

Hi , thanks for looking into this.

I can confirm that setting the DisplacementBias to 0 or 1 makes the issue go away, same as getting the displacement from the red channel instead of the alpha channel.

however these are just workarounds that are able to hide the issue, without a real explanation as to why they happen in the first place.

don’t these workarounds seem strange to you? why would such a simple math operation (add -0.5) or using one or another texture channel make it such a make or break thing? just telling me that I just cannot make “half inwards, half outwards” displacement or that I cannot pack it into the alpha channel of my diffuse. in a place where 120 FPS turn into 25 when the tessellated mesh LODS are not even being rendered, and telling me it’s just a place where it needs optimization, seems quite unreasonable.

especially because I can remove most of the other nodes, and it will still break even if only have the following:

91282-displace.png

so with this in mind, what exactly is ‘not being careful’ with parameters and what isn’t? my material isn’t that complex anyway. you can see it’s now only 7 nodes hooked into displacement which is really nothing.

but most of all, I have to mention this again: the issue does not happen with regular staticmesh actors, only foliage. and also the issue does not happen if the foliage meshes have no LODs.

so basically if I remove the LODs I can go much more crazy with my material and it won’t break, rendering your explanation invalid. or if I use staticmeshactors instead of foliage I can also go much more crazy with my material and it won’t break, also rendering your explanation invalid.

basically I found a clear case where using features A + B + C is breaking something, and you’re telling me I should just use A + B + just a little bit of C. and you say it’s not a bug. I simply cannot accept it :confused:

hello again,

I just tried this all over again, creating a fresh new project in 4.5.1

I made the same setup with the same material with the displacement coming out of the Diffuse’s Alpha, same mesh with LOD painted as foliage, same parameters in the material instance with -0.5 displacement bias, etc. everything is the same.

in this 4.5.1 project, the issue is not there.

this confirms several things:

  1. that the issue is the same as this one from Red Gnash,
  2. that the issue is really a bug
  3. that the issue was introduced either in 4.6 or in 4.7, but in 4.5 it worked flawlessly. (Red Gnash updated directly from 4.5 to 4.7 so it’s unknown if the issue is there in 4.6 or not)

so,

I’ve clearly showed several times that the problem occurs only with tessellation + foliage + LOD, but not when all 3 features aren’t there.

It’s also clear that the issue only occurs when the tessellated material is completely hidden due to LOD, and the issue isn’t there when the tessellated material is actually in the view.

you have repro steps on a project that clearly and concisely shows the issue, and now you have the number of the UE4 version where the issue was not there, and a version where the issue is there.

I can also provide the 4.5 project if needed.

please spend some time to investigate this issue, it’s a real thing.

cheers,

hi again,

didn’t expect it to be fixed yet but anyway I tested on 4.12.0 (the non-preview), and it still occurs.

still hoping this can be looked into

regards,

Unfortunately, if this can be fixed by modifying a single value or using a different channel, then it is not a bug with the engine, but a problem with your set up. This has to be narrowed down to being able to reproduce using simple content.

If you can reproduce this using materials within the Starter Content then we can report the bug. It comes down to the complexity of your material, how you are applying that material to other functions and features within the engine, and how those interact with one another.

The 4.5.1 engine version is quite different from the 4.12 release as there were a lot of changes made to foliage and LOD’s between the two versions. In red gnash’s post, states,

“I was able to test this in 4.7.5 with the FPS degradation, but when bring the same project into our internal build of 4.8 I was not able to see the same loss in FPS. In your material, I removed everything but the world displacement pin. Everything else was irrelevant to this issue as the slow down was caused specifically in this part of the material. When this is disconnected and PN or FN tessellation is enabled there is no slow down.”

This means his issue was resolved with a later version of the engine.

The compilation of the three parts you mention foliage + tessellation + LOD using your specific material set up causing a drop in FPS therefore cannot be deemed as a bug. If the issue is resolved by changing a value or pulling from a different channel, there could be an error with the math when manipulating vertices. This is something you would need to investigate in order to determine why pulling from the alpha and using a negative value causes the issue to occur.

Thank you,

what do you mean with “simple content”? I’m using a sphere mesh with an LOD in it, a material that yes uses tessellation (a supported feature no less) that I’ve reduced to a mere 8 nodes, and foliage painting. it doesn’t get any simpler than that.

so I’ve gone ahead and tested my project again, now against every UE4 version since 4.5, here are the results:

  • 4.5.1 - the issue is not there
  • 4.6.1 - the issue is not there
  • 4.7.6 - the issue is there
  • 4.8.3 - the issue is there
  • 4.9.2 - the issue is there
  • 4.10.4 - the issue is there
  • 4.11.2 - the issue is there
  • 4.12.0 - the issue is there

as you can see the issue appeared on 4.7 (like Red Gnash reported)

it was an issue back then and it was acknowledged as a bug and it was tried to be fixed. you guys claimed it was improved/fixed but Red Gnash never confirmed it to be the case. either way, if this issue is the same as the one from RedGnash, it is still there and it was not fixed in 4.8 or any later version.


there’s another detail that I found now: in 4.7 and later versions I get dithered LOD transitions, and in 4.6 and earlier versions there are no dithered LOD transitions in the painted foliage.

could it be related to this? Foliage lod/draw calls problem (foliage system doesn't kick lods) - World Creation - Epic Developer Community Forums

problem is no matter what I do, I can’t get the dithered LOD transitions to be disabled. the “Dithered LODTransition” checkbox in the material only really works for staticmeshes, but for foliage I always get dithered transitions no matter what I do.

therefore I cannot confirm if this issue is related to dithered LOD and that other post.

so how do I proceed?

cheers,

Hi guys,

I updated the ticket UE-21449 we have to look at tessellation with foliage to try to get it fixed for 4.13.

Version 4.7 is when we moved from using fixed sized clusters instances inside multiple InstancedStaticMeshComponents to one huge HierarchicalInstancedStaticMeshComponent for all the foliage (of one type) in the level. This was a drastic performance improvement and enabled foliage in the Kite demo, but I suspect it has caused the problem is the tessellation.

I think the tessellation code using the size of the object in its calculations, and things are going wrong with the HISMC.

Cheers

BTW I believe GPU driver crashes like the one reported at the top of this thread are caused on a watchdog timer expiring in the driver when it’s convinced a frame is taking too long (due to too much GPU work).

We saw this a lot during foliage system development for the Kite demo when attempting to render millions of instances at highest LOD.

Fantastic news, thank you !

thank you so much , means a lot :slight_smile:

the GPU driver crashing was caused by the same problem described all along, just in a scene with hundreds of foliage instances placed. with tessellation disabled the scene was running fine (performance is good because the foliage has LODs)

hello,

I just noticed the entry of this issue in the Issues page: Unreal Engine Issues and Bug Tracker (UE-21449)

the repro steps say nothing about including LODs into the mix (which is the reason Tessellation kills the performance for me, with Foliage)

I’d appreciate if the Issue can be updated to reflect this. otherwise the fix from UE-21449 will not be relevant to the issue discussed all along this page

cheers

hi again.

I just tested this issue in 4.13 preview 1 and it’s still there, same as before.

guess you guys haven’t had time to fix it yet? hope it makes it to the final 4.13 :slight_smile:

cheers,

I can confirm that the issue is still present in 4.14.1.

at least I’m not alone :1