UE5.2: Dramatically Improve Moving Foliage Performance using this PCG parameter

preview_player
Показать описание
In this Unreal Engine 5.2 tutorial, I show how you can drastically improve the performance of moving foliage in your landscape using a new feature in Procedural Content Generator.

Now, instead of having to switch off all movement to get acceptable frame rates, you have total control over which grasses or trees move and how far into the distance they move for.

00:00 - Intro
00:31 - The problem with moving foliage
02:21 - A blunt solution switching off all movement
03:56 - The PCG solution - movable WPO distance
Рекомендации по теме
Комментарии
Автор

For anyone watching this video in the UE5.3+ era, there was a new parameter added to foliage called "VSM Cache Invalidation Behavior", where you can make it so specific foliage doesn't update the VSM at all whether it's moving or not. This will allow you to have things like trees in the distance blowing in the wind without having a perf hit of the VSM cache invalidation. This setting is also available on static meshes as well, so if you have other things that you aren't too worried about invalidating the shadow map you can use it on those as well.

ABentPaperclip
Автор

this video has great audio. loud, clear and not unpleasant to listen to. good work!

anjoomfaisal
Автор

The world position disable distance was already there on the other foliage types and the runtime grass nodes. You can also make a shader function to blend off the WPO as well to stop a sudden pop.

joegaffney
Автор

This is Gold! I wish they had this function on the foliage painting tool too

erikstarander
Автор

It's not just the virtual shadowmaps. WPO introduces also significant overhead for nanite meshes. That's why nanite diagnostic view has also WPO mask channel displayed, as WPO comes with significant cost on nanite meshes. So distance culling the WPO animation gives performance boost which comes both from VSMs as well as Nanite having easier work. It's combination of both.

LudvikKoutnyArt
Автор

Awesome! I've been trying to optimize some foliage and narrowed it down to world position offset, affecting FPS. I started to check the distance from the camera in the material itself but thought there might be a better way. Glad I found this video! This has made a drastic change in many of them.

codymccarty
Автор

You absolutely kick butt, Dude! Thanks so much for sharing.

douchecraft
Автор

another thing that could work (not sure if it is possible right now) is to turn off dynamic shadow generation at certain distance from camera, because no one would notice if the shadows on grass leaves aren't geometrically correct 30m away from them, heck, even 5 meters, that would basically eliminate all the extra load having to recalculate that stuff, probably would work for larger things like trees, maybe a bit further away than grass

dsfs
Автор

Thank you so much for that important information and show us this new feature.

carlossuarez
Автор

WONDERFUL INSIGHT AND EXPLANATION! 👏 👌 😊

theone
Автор

Another thing that often goes ignored for foliage performance in UE5 is that the per-pixel cost of masked materials with Nanite meshes is actually really large. It's often better to have a higher triangle count for the meshes cutting out around where the alpha mask is and then use an opaque material instead. This is what Epic did for the foliage in Fortnite when they upgraded to UE5.

Fafhrd
Автор

Thank you. This is indeed a very nice feature to have.

Project_Erasmus
Автор

Oooh, So that's why Nanite Foliage was so performance heavy....I never considered that the Shadow Maps would be constantly recalculated. Nice video man, thanks for sharing this info.

unrealdevop
Автор

You really know your stuff. Thanks a ton!👍

paulknipe
Автор

ohh my god, this video is a blessing!!!!

OfficialCloverPie
Автор

World position offset distance definitely improved performance for me, thank you. I wish there was a way to reduce VSM quality over distance, as its absolutely the shadows that are costing me a lot of frames. Possibly some global VSM shadow quality setting would help but I can't find anything in 5.2.1

Switchpoppy
Автор

It's tremendous, especially seeing the tests you do in the other videos, the only thing I see here is that it's a preview, we can't go over to it yet T.T

salvadorcabrera
Автор

In 5.3 there is a PCG option to disable shadow map updates from world offset position. Should be enough for most cases.

dansadler
Автор

This is because, the foliage is casting dynamic shadows, you can play with it aswell to get the desired work. great tutorial though :)

UnrealArtist
Автор

Hey, i have a different problem sir. My grass assets dose not work work with pcg as expected. When nanite is enabled my grasses move blury and glitchy. When i disable the nanite they work fine. This issue is same with megascan's trees unless you use pivot painter ones. As i see in your video your grasses work perfect do you have any idea regarding this problem.

ozzyosbourne