[FIXED in 4.20] Foliage Culling Bug with OpenGL on 4.19.x (UE-57652, UE-58198)

Hi,

I am seeing a bug with the recent 4.19.0 release on my project with Linux related to incorrect foliage culling. Here are two videos demonstrating it:

Foliage Culling Bug - Ubuntu 16.04 LTS / UE4.19.0: Foliage Culling Bug - Ubuntu 16.04 LTS / UE4.19.0 - YouTube

Foliage Culling Working - Windows 10 x64 1709 / UE4.19.0: Foliage Culling Working - Windows 10 x64 1709 / UE4.19.0 - YouTube

This started happening when I upgraded my project to 4.19.0. It did not happen on 4.18.1, which I upgraded from directly. (I smoke tested before and after the upgrade with no other changes, and this was the only breakage).

Any other information I can happily provide - if there are console commands I can use to debug what the culling system is doing please let me know.

Thanks,

Alan

A little more information - I looked around console commands relating to occlusion culling / foliage to try to figure out what exactly is causing this:

  • foliage.DisableCull 1 - no effect
  • foliage.Freeze - works as expected, freezes the foliage in whatever culled/unculled state it was when command executed
  • foliage.ForceLOD 1 - this fixes the bug in one level, but for another level just changes the view angle to trigger the bug.

It feels like the ForceLOD command is providing a bit of a hint into what’s going on - it’s as if the foliage culling system is misinterpreting the bounds of whatever LOD mesh is in use, and causing it to cull even when it’s in the view frustum.

Any other help here is greatly appreciated (console commands, engine code changes to help debug this etc), I’d love to pin this one down.

Cheers

Another update on this - it is still an issue with 4.19.1. I suspected this could be a forward renderer only issue so I tried re-packaging with the deferred renderer, but it doesn’t change anything, the bug still happens. I also tried disabling the global clip plane to see if it could be affecting this, though as expected that had no effect.

I am going to rebuild the editor on Linux and try to reproduce this in a separate project, though that will take some time (I cross compile my game on Windows for Linux so will have to pull the code and build from scratch on my Linux machine).

As before, if anyone has any idea of methods I can use to debug this, please let me know.

Alan

I rebuilt Unreal Engine 4.19.1 from source on my Linux machine, created a new project and reproduced this issue very easily:

I have submitted a bug report with this example project for Epic staff to review. It looks like a major regression from 4.18.x, but only on Linux.

Will update the thread with the Jira issue if it is confirmed + raised.

This does not only happen on Linux but also on Windows when rendering with OpenGL instead of Directx. I have submitted a bug report about this: Unreal Engine Issues and Bug Tracker (UE-57652)

Sweet! I feel stupid for doing the work to rebuild the engine on Linux, but very happy to know I’m not going insane :wink:

I have voted on the issue.

Cheers

I am also hitting this bug, reported and just got a confirmation: Unreal Engine Issues and Bug Tracker (UE-58198) (which links to this thread! )

I wonder if this affects everyone with openGL, or some limited subset?

For me, it happens on my geforce 970m and 1080ti

It also happens to me on 4.19.1 on machines with Nvidia 970 and amd rx 470gpus, only on OpenGL, Deepin Linux 15.5.

Just pulled/built 4.19.2 and packaged my project, looks like this is still an issue.

It wasn’t called out in the release notes but wanted to make sure it wasn’t inadvertently fixed by the other changes.

Just spotted: Unreal Engine Issues and Bug Tracker (UE-57652) mentions it is fixed (targeted for 4.20)

I strongly suspect it is the same bug as Unreal Engine Issues and Bug Tracker (UE-58198)

Hope we see a fix for it in 4.19, perhaps I’ll try out master on linux and see if the bug is still there…

Oh cool! Let me know if you find the commit / if it’s in master - I had a quick look but couldn’t see it on GitHub. Regardless of whether this makes the next 4.19 hotfix, I would love to grab the engine @ this commit so I can fix my game.

At this

Did not spot the relevant commit, pulled and built anyway.

Build threw an error building plugins (VARest and BluemanAI) and segfaults on launch - I think I’ll wait until it is officially pushed before I go too far down this rabbit hole :wink:

For UE-57652, the fix is in GitHub commit 25eed01c1338adc6f1c3341bd2b7be34d116202e with the following comment:

Looks like branches master and promoted contain this commit.

I will see if I can figure out the exact code change, but if it’s in the promoted branch this may mean it might be going into 4.19.3 (not completely sure about that though).

Oh thank goodness this is being talked about this has been going on for a while and a fix would be good.

Also grass foliage does not appear on my end and i cant draw more grass with the foliage tool.

For those following this, the fix for UE-57652 has now been merged into the 4.20 branch: Unreal Engine Issues and Bug Tracker (UE-57652)

A bit of other discussion about the two bugs logged against the two issues (I linked them here):

While checking the MacOS and Linux port of my game I realised that I have the same problem and it’s not limited to linux, MacOS also have it. Only windows isn’t affected.
I didn’t tried (yet) on console though…

Thanks, others have reported the same so I tweaked the title to reflect that. Out of interest - isn’t UE4 on MacOS using the Metal renderer, not OpenGL? I thought they were distinctly different and the OpenGL renderer was deprecated on MacOS. Might have completely misunderstood that… or maybe it impacts both!

Again for those following, Unreal Engine 4.20 has been released and contains the fix. For those experiencing this issue, the solution is to upgrade your project.