In this set of videos i will show how to make physics interactable foliage (aka. stuff that bends away when we walk through them). I will base some of the content off the already aquired knowledge from the ragdoll tutorial series i also posted on the forums here, so check that out too for more info on the Angular Motors and how they work.
Here’s a video showing what we will create.
WIP1
WIP2
WIP3
(last update)
Hope you enjoy. And as always, comment on the videos if you find stuff that could be done in a better way or have problems with it.
Thanks for the kind words and i hope to be able to make the tutorials once im back from work. To be honest im not entirely sure how to best test the performance, so maybe someone else can pitch in with info on that.
Nice ! can you do a tutorial on baked cloth animations like instead of realtime physics maybe bake the physics and import into Unreal ? I cant find a good tutorial that can help me achieve this …
Regarding performance impact, i’ve so far only tested inside the editor with only this fern. Which is setup with a base lod + 2 additional lod’s ranging from about 2k triangles to i think it was about 200. I’ve never tried to make foliage before, so i guess im not the right person to judge if this is a very complicated foliage? Also depends highly on what platform/quality you aim for i guess. Anyway, the tests i’ve made was with this fern with 750.000 of them spread out. And that seemed to perform well.
Now the real trick is to limit the number of dynamic foliages and there you can tweak it in various ways, all depending on the usecase.
Just a few things that pop in mind:
Convert dynamic foliages to static foliages when they’re not in the active viewport (or if it’s a multiplayer scenario, consider any active viewport)
Only allow converting a maximum number to dynamic foliages at one time
Adjust on the complexity of the meshes
Minimize the use of tick event, by limiting various code to run on a timer
My conclusion after having experimented with this for a week now, is that performance is something you need to consider carefully with this approach, but still with some tinkering, it can produce some very nice results.
If i have over 1000 dynamic foliage active, the performance on my machine starts to suffer. So lets just say that this setup is not optimal No need to test further on that i think.