Hello, I’m new to UE4 so apologies for the newbie question. I am developing a standalone application for building and exporting trees in FBX format with bones and weight maps already setup.
When I import a tree in UE4, I have a working skeleton and I can manually move bones and have branches and foliage respond accordingly.
At this point I tried a Wind Directional Source, so that branches could sway, but for some reasons I can’t make it to work. Could you please give me suggestions at how I’d need to configure the asset to make it work with a wind source?
Thanks
Wind source does not affetct skeletal meshes.
You would need to create a specific BP to add to your levels that generates the forces necessary to push the meshes around. You should have to loop through all the skeletal meshes, filter out the ones you don’t want affected, and apply the inputs accordingly to whatever parameters you see fit.
Your skeletal meshes would all need to have properly setup PHAT assets (not whatever gets created automatically).
Additionally, this is hardly a functional way to generate the effect you are looking for, since as I’m sure you realize, all those physics calculations get Very expensive.
The normal way to do this, is to create and manage a material parameter collection, and create or modify the tree material to offset the vertices accordingly.
Normally, you couple the wind node to an alpha mask of some sort - or vertex paint- in order to make the trunk not move but the branches swing around.
The cost on the GPU is far less then the costs of physics - and it is also how SpeedTree does it.
Thanks for the clarification. There is any documentation or tutorials about the approach you described?
Pretty much diddly squat. And I haven’t really seen a decent tutorial on anything much.
Mostly because to do it right you need a C++ custom class, and people are all about blueprint usually.
For setting up the asset with PHAT you will definitely trial and error your way for a solid day or so.
To me - and that doesn’t mean I’m right at all - the best way to get the branches to respond is to set a low/somewhat accurate custom weight for the component part, and to completely Lock all angular limits. You then just add some (5+ Linear damping and Angular damping).
The end of the frond may need more - it really depends the whole chain, how long and how much weight you set.
Since it has to be done manually, it eats time like there is no tomorrow - particularly when learning.
As far as Simple Wind material, you can find some stuff within the Academy
after you log in this video is specifically for grass, same nodes/ideas for the trees.
https://learn.unrealengine.com/course/2842589/module/5878057?moduletoken=UHxxnDLPW8SI03JKW4KYVFOTrPZwW6pOzDVvhSL0uL9yzyLcL-Ymt0e21grODS27&LPId=0
As far as stuff that could be reliable goes. Level 80 is often a decent source
and there’s always GPU Gems
Hope that helps.
IMHO, just use the academy links, and learn the material editor or perhaps better, HLSL shader code so you can create your own shader.
For trees you need GPU side stuff rather then simulated/physics stuff.
Though you can couple both for some really nice effects.
rats.
If you find anything on how to apply wind to either billboards or Impostors in your research make sure to share?
Nothing like Lodding down a finished scene to find out that the wind stops dead 20m from you.
Something to look at for best (definitely not easiest) approach is in the Content Examples project, level Pivot Painter. It shows a simple tree asset with branches pushed with wind. It’s a great effect but pivot painter is terribly bizarre to the uninitiated. There is a 3dsmax plugin hosted by unreal for pivot painter. There is a 3rd party plugin for blender (not sure if it’s compatible with blender 2.8). In a sense pivot painter is a material driven vertex animator. I’ve had cool results with it in the past but I’ve never animated foliage with it.
Also take a look at this. No pivot painter here, this is a good example of using UV coordinates to mask world position offset in materials.
https://www.unrealengine.com/en-US/b…-unreal-engine
Thank you for the suggestions, really appreciated. I’m going to post updates as I sort this out…
It is compatible with 2.8, I used it in one of my projects. It was remarkably easy, once exported there’s literally nothing to do but plug a single node into your material graph.
Performance is also very easily optimized as the shader cost is directly related to how many levels of animation you have and whether or not they are normal corrected.