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

แชร์
ฝัง

ความคิดเห็น • 90

  • @ABentPaperclip
    @ABentPaperclip 3 หลายเดือนก่อน +6

    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.

    • @unrealitybites763
      @unrealitybites763  3 หลายเดือนก่อน +1

      That is great info, must test that out when I get the chance.

  • @LudvikKoutnyArt
    @LudvikKoutnyArt ปีที่แล้ว +5

    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.

  • @joegaffney8006
    @joegaffney8006 ปีที่แล้ว +30

    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.

    • @infusestudio3753
      @infusestudio3753 ปีที่แล้ว +2

      It didnt actually work before now.

    • @tgykurtulus
      @tgykurtulus ปีที่แล้ว

      Hello, do you know how to make it ?

    • @joegaffney8006
      @joegaffney8006 ปีที่แล้ว +4

      @@tgykurtulus you basically do a lerp to set WPO to 0 based on view depth with the max depth being just before the hard cut off.

    • @jhett1746
      @jhett1746 ปีที่แล้ว +2

      @@joegaffney8006 lerps aren't branching. you are still paying the cost of it

    • @joegaffney8006
      @joegaffney8006 ปีที่แล้ว +4

      @@jhett1746 hey your right you still want the hard cut off set on the foliage (wpo max distance).
      Say the hard cut off is 5000 you start you fade around 3500 and finish before 5000

  • @Fafhrd42
    @Fafhrd42 7 หลายเดือนก่อน +1

    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.

  • @anjoomfaisal
    @anjoomfaisal 11 หลายเดือนก่อน +2

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

  • @dsfs17987
    @dsfs17987 ปีที่แล้ว +19

    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

    • @VictorTheSweGuy
      @VictorTheSweGuy ปีที่แล้ว +1

      This is exactly what I want to try, have you found anything on it? I'm gonna try disabling all dynamic shadows for grass etc. which is entirely covered by other shadows since it seems unnecessary. Not sure if ue5 takes anything like that into consideration but I assume everything gets calculated by default (VR so I need every frame I can get)

    • @IstyManame
      @IstyManame 7 หลายเดือนก่อน

      ​@@VictorTheSweGuy any solutions yet?

    • @Fafhrd42
      @Fafhrd42 7 หลายเดือนก่อน

      From the Unreal documentation for Virtual Shadow Maps:
      In some cases, creating Material LODs that remove WPO/PDO may be impractical, but the end effect of these transformations is small in the distance. Use r.Shadow.Virtual.Cache.MaxMaterialPositionInvalidationRange to set a distance (in centimeters) beyond which cache invalidations from these materials are ignored.
      I'm not sure if this will work with Nanite meshes, as there's some stuff about Nanite always rendering into VSM regardless of distance.

  • @hupekyser
    @hupekyser 3 หลายเดือนก่อน

    if the world position offset disable also had a 'falloff' parameter there could be a blend between non moving and moving foliage, stopping the 'jump' at the threshold

  • @dansadler
    @dansadler 6 หลายเดือนก่อน +1

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

  • @codymccarty9327
    @codymccarty9327 11 หลายเดือนก่อน +1

    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.

  • @erikstarander415
    @erikstarander415 ปีที่แล้ว +2

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

    • @erikstarander415
      @erikstarander415 ปีที่แล้ว

      Oh, the function is there! happy days!

    • @unrealitybites763
      @unrealitybites763  ปีที่แล้ว

      Erik, I can also see the parameter in the Foliage Type asset, but it doesn't seem to affect my painted foliage. Does it work for you?

    • @swaterik1986
      @swaterik1986 ปีที่แล้ว

      @@unrealitybites763 yes it works! Landscape is green in the view mode now and the wind is only on foliage close to camera. I'm not getting this kinda of performance boost however, like in the video.

  • @douchecraft3113
    @douchecraft3113 ปีที่แล้ว +1

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

  • @Switchpoppy
    @Switchpoppy 3 หลายเดือนก่อน

    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

  • @carlossuarez9272
    @carlossuarez9272 ปีที่แล้ว

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

  • @theone8625
    @theone8625 ปีที่แล้ว

    WONDERFUL INSIGHT AND EXPLANATION! 👏 👌 😊

  • @hernanpatane
    @hernanpatane ปีที่แล้ว

    I'm taking this to the team!

  • @Project_Erasmus
    @Project_Erasmus ปีที่แล้ว

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

  • @paulknipe3246
    @paulknipe3246 ปีที่แล้ว +2

    You really know your stuff. Thanks a ton!👍

    • @unrealitybites763
      @unrealitybites763  ปีที่แล้ว +3

      TBH, I came across this parameter by accident, I was just lucky to realise its potential ;-)

  • @GMTechArt
    @GMTechArt ปีที่แล้ว

    World Position Disable Distance is in HISM and Foliage and Static Mesh Details in UE 5.1.1 (Only Works for Nanite).

  • @unrealdevop
    @unrealdevop ปีที่แล้ว

    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.

    • @user-se2gm6bu5r
      @user-se2gm6bu5r ปีที่แล้ว

      No, Nanite Foliage is heavy no because of that. It's heavy because of overdraw which is caused by many geometry layers.

    • @unrealdevop
      @unrealdevop ปีที่แล้ว

      @@user-se2gm6bu5r Oh, that too...yeah I forgot about Overdraw and since most foliage has overlapping geometry I could see how it might drag down performance. However, shortly after 5.0's official release I got a Solid Geometry Foliage pack designed for Nanite before it actually supported Game-Ready Foliage and the performance was pretty bad. That was also before there was any way to preserve them from having the leaves striped from a distance.

  • @dmitrydagaev2750
    @dmitrydagaev2750 3 หลายเดือนก่อน

    Tx man, life saver!

  • @salvadorcabrera4941
    @salvadorcabrera4941 ปีที่แล้ว

    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

    • @unrealitybites763
      @unrealitybites763  ปีที่แล้ว

      Yes, you're right , it is experimental but it has so much promise

  • @cmdrStarrySky
    @cmdrStarrySky ปีที่แล้ว

    just what I need, thank you.

  • @UnrealArtist
    @UnrealArtist ปีที่แล้ว

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

  • @officialauspecs1285
    @officialauspecs1285 ปีที่แล้ว +1

    Another good way to limit the WPO distance is to use the "CameraDepthFade" node in the material to lerp your WPO value between your wind effects and "0". Not sure what the performance difference would be between the two though, would be a good experiment.

  • @SugarKaneNosey
    @SugarKaneNosey ปีที่แล้ว

    This is Marvelous!

  • @ibrahimakca8628
    @ibrahimakca8628 3 หลายเดือนก่อน

    While creating landscapes, I sometimes look at the developers and they always show realistic mountains from a single scene. The foothills of the mountain, the body, the upper layers are always the same, I wonder what is needed to create scenes that are at least a little more realistic.

  • @OfficialCloverPie
    @OfficialCloverPie ปีที่แล้ว

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

  • @javaddavoodi707
    @javaddavoodi707 ปีที่แล้ว

    Thanks for sharing man

  • @ozzyosbourne6
    @ozzyosbourne6 ปีที่แล้ว +1

    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.

  • @pandahsykes602
    @pandahsykes602 ปีที่แล้ว

    That’s Rye, you can grind it at a grinder in any guarded town if you have milling skills and agrostology lores maxed out

  • @eclipsisme
    @eclipsisme ปีที่แล้ว +2

    This option does exist on the other foliage assets since 5.1 but in 5.1 it did not affect VSM.

    • @gulagwarlord
      @gulagwarlord ปีที่แล้ว

      Yes it does, check the foliage editor... it was in 5.1

    • @infusestudio3753
      @infusestudio3753 ปีที่แล้ว

      @@gulagwarlord Hes saying it didnt affect Virtual Shadow Maps which he is correct it didnt. It would still make them dynamic around the foliage instead of whatever the green was in the debug view.

  • @user-hm3io7sd9f
    @user-hm3io7sd9f 6 หลายเดือนก่อน

    Controlling from material and controlling from PCG with WPO disable distance. Is there a difference in performance between the two methods?

  • @tylerz3975
    @tylerz3975 ปีที่แล้ว +1

    Even if I bring the WPO down to 1 the trees and grass and such still move. Is this bugged? Or might there be another place I have to disable WPO? I would like the 'distance from camera' that the PCG setting enables.

    • @degasjan8411
      @degasjan8411 9 หลายเดือนก่อน +1

      me to , we need help

  • @MarkOfArgyll
    @MarkOfArgyll ปีที่แล้ว

    Nice little parameter that! :) Seems a no brainer to expose that to foliage paint / PFV or just regular material graphs.. but time will tell. 1uu = 1cm btw, which I'm sure you knew already.

    • @hawke5311
      @hawke5311 ปีที่แล้ว

      It is already there in the Foliage menu.

  • @Radwalls
    @Radwalls ปีที่แล้ว

    Awesome!

  • @ShigomanyGameDev-xt5wt
    @ShigomanyGameDev-xt5wt ปีที่แล้ว

    Awsome!

  • @juiceLoosner
    @juiceLoosner 10 หลายเดือนก่อน

    Any good tips on creating animated foliage. All my meshes are static and i would love a procedural fix to create some movement. Guessing i will need to go to mesh level in my 3d package and set it up??

  • @gulagwarlord
    @gulagwarlord ปีที่แล้ว

    I can't get WPO to work with the Quixel European Beech trees with WPO turned on. They get all blurry and streaky unless I put the WPO culling distance to 0. Any ideas? Thanks.

  • @Drakmour666
    @Drakmour666 ปีที่แล้ว

    Is it possible to make area movement on the grass? For example on vast plains when the wind blows it makes some kind of waves that move across the whole plain. Like a crowd that stands in a wave on a stadium. SO that a grass movement will have an overall feel of movement along the plain. Maybe making an invisible area that will affect the grass movement that will move across the plain?

  • @everydayrussia
    @everydayrussia 11 หลายเดือนก่อน

    Really good stuff! I wonder if there is also a way to just stop regenerating shadow maps 10 or 20 meters away from Player. That will look fine, and save processing power

    • @unrealitybites763
      @unrealitybites763  10 หลายเดือนก่อน +1

      That's kind of what's happening by disabling the WPO animation over a certain distance. It only has to calculate the distant shadow map once for the distant meshes and then that is cached from frame to frame.

  • @michadevag
    @michadevag ปีที่แล้ว +2

    Can't you just use distance to camera with a lerp? You get a smooth transition between static and moving assets, good performance and if you place the asset by hand it is using the same parameters as the ones placed with PCG.

    • @shannenmr
      @shannenmr ปีที่แล้ว +1

      Use Camera Distance and IF's or better yet Per LOD Material Instances to disable WPO and other complex calculations, like shadows (use Cascade for close and distance fields for medium to far for larger objects) and unneeded texture lookup's for far away grass and tree's etc. Also in regards to Virtual Shadow Maps EPIC has a HUGE document around optimization / suggestions etc

    • @FireF1y644
      @FireF1y644 ปีที่แล้ว

      When WPO is not a constant zero, it will count as moving object, so only static switch (lod)

    • @MrSofazocker
      @MrSofazocker ปีที่แล้ว

      Yeah... no... doesnt work doing it only in the shader, as they are non branching, there no perf benefit.
      Yeah different material for lods with WPO disabled can work...
      But your using nanite, so there are no lods.

    • @FireF1y644
      @FireF1y644 ปีที่แล้ว

      @@MrSofazocker Yes, it works exactly as i said - you still can use Material LODs with Nanite.

  • @user-ds5jd5zy2d
    @user-ds5jd5zy2d ปีที่แล้ว

    I wonder if it is possible to make the movement of the grass dependent on the movement of the character - turning off the movement of foliage when the character moves.

  • @astralstormgamestudios1259
    @astralstormgamestudios1259 8 หลายเดือนก่อน

    Some meshes like trees , fern tend not to work when spawning with pcg graph. Have you encounted this and found a solution?

  • @ue5beginner248
    @ue5beginner248 ปีที่แล้ว

    fantastic….

  • @williamminnaar6311
    @williamminnaar6311 ปีที่แล้ว

    Hello there, thanks for your great tutorials - When I apply nanite to trees from previews packs - Such as Rural Australia pack and Meadow Packs trees - and I paint with the foliage tool or add as procedural foliage - the trees are broken / blurry - When they blow in the wind? Do you know how to fix this please?

    • @juiceLoosner
      @juiceLoosner 10 หลายเดือนก่อน +1

      Make sure your project settings are using Direct X 12. I rolled back to DX 11 and all my nanite broke. Going back to DX 12 fixed it. Could be your issue.

  • @BROCKSGAMING
    @BROCKSGAMING ปีที่แล้ว

    PCG vs Procedural foliage from editorpreferences , who is best in performance , who can spawn on particular layers of landscape , height and slope aligntment , etc

    • @g10118
      @g10118 ปีที่แล้ว +1

      Probably similar performance, they both utilize the same instancing systems. PCG can indeed filter based on slope, landscape layers etc.
      The real point of PCG is you can expand the system with blueprints relatively easily.
      Depends on your goals/scene on if the procedural foliage tool or PCG will be the right choice.

  • @Kiran.KillStreak
    @Kiran.KillStreak ปีที่แล้ว

    how it will work ? .does it uses two materials ,or a single material instance with wpo off on off bool ?

  • @saimon1987
    @saimon1987 10 หลายเดือนก่อน

    This feature has nothing to do with PCG. Its also available on static meshes or regular foliage.

  • @raydani8748
    @raydani8748 11 หลายเดือนก่อน

    How are you getting blueprint up for the grass?

  • @thefuppits
    @thefuppits ปีที่แล้ว

    Why is that a secret? It's right there in the settings and obvious what it's there for.

  • @carlosrivadulla8903
    @carlosrivadulla8903 ปีที่แล้ว +1

    that wpo culling distance can't be set in any other part on the engine for real?

    • @gulagwarlord
      @gulagwarlord ปีที่แล้ว

      Been in the foliage editor since 5.1

    • @unrealitybites763
      @unrealitybites763  ปีที่แล้ว

      Hi Gulag. I see the WPO Disable parameter in the Foliage Type asset as you describe, but it doesn't seem to actually have any affect on the painted foliage. Have you got this to work?

    • @gulagwarlord
      @gulagwarlord ปีที่แล้ว

      @@unrealitybites763 Yes, on my end it seems to work... I'll pop open my 5.1 project again and confirm though.

    • @gulagwarlord
      @gulagwarlord ปีที่แล้ว

      @@unrealitybites763 I checked, it works as expected. I just uploaded a quick video showing it in action. It's my most recent upload th-cam.com/video/uijIG8K0vPI/w-d-xo.html. Make sure you set the distance to something low but not zero. You probably know this but 0 disables the feature entirely. In my example, I'm switching between 10 and 1000. Cheers.

    • @marcop8862
      @marcop8862 7 หลายเดือนก่อน

      @@gulagwarlord Hello guys, I'm testing the wpo Disable parameter but I get it to work just in editor. If I then launch the game I can still see the WPO being active .
      Is it the same for you?
      Thank you

  • @andrinSky
    @andrinSky ปีที่แล้ว

    Is this only in Version 5.2 or is it the Same in Version 5.1?

  • @NoContentAtAll
    @NoContentAtAll 9 หลายเดือนก่อน

    A 1-minute video is stretched to 10 minutes

    • @unrealitybites763
      @unrealitybites763  9 หลายเดือนก่อน

      You'll hate my one-hour videos then

  • @Machine_in_pain
    @Machine_in_pain ปีที่แล้ว

    Love your videos but your microphone quality is really bad

    • @TheMrRatzz
      @TheMrRatzz ปีที่แล้ว +4

      Really? How so? Sounds ok to me...