No announcement yet.

Interactive Character collision (bending) on foliage (wheat, corn etc.) in Ue4?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Interactive Character collision (bending) on foliage (wheat, corn etc.) in Ue4?

    Hey all.
    I was just wondering if speed tree for UE4 comes with collision support for interactive foliage where the meshes will bend and move when the player walks through them? I know you can set up a material to do this but I'm not sure if it would be compatible with speed tree meshes or if there's already support for it out of the box?

  • #2

    For true interactive objects, you would need it to be a skeletal mesh and do collision tests on each piece and bend it accordingly.

    However, if you're just looking to bend scrubby grass or ferns away from the player as they walk, that isn't too hard. As of 4.19, the SpeedTree node in the material has an "extra bend" parameter that lets you bend the model in whatever direction you choose. If you then put the player position up to a parameter you can use in the material, you can use it to bend the foliage "away" from that position, perhaps with some transient oscillation to make it look like it is springing back.

    Much of what you would need to do for the plumbing is described on this docs page:

    Hope this helps


    • #3
      Awesome. Thanks Greg, that's exactly what I was hoping. It is just for simple grass, ferns, corn, wheat etc. I've already set up the player position and bending in a material for a different mesh, just wasn't sure if it would be compatible with speed tree specifically or if st came with something out of the box to handle it. Not planning to bend any actual trees.


      • #4
        Hey guys, I wanted to follow up about the physics based interactive foliage. I have a good UE4 blueprint for shader interactive vegetation, which I'll use for larger assets that won't move much (trees) and smaller ones like grass, but I want to use physics based interaction for things like bushes and small trees. I have a great tutorial for swapping a static mesh with a skeletal mesh with physics based on the players location, but I read there are issues with Speedtree assets, and using the Speedtree node. It sounds like it randomizes the colors in the model a bit for diversity, but it causes them to pop when the models swap, because they're random each time they load. Does anyone have experience with configuring speedtree assets as skeletal meshes with physics, as well as swapping them with static meshes? Is this functionality supported, or will I have trouble with the speedtree node? I'll post the tutorial that also links to a video tutorial about it, as well article that mentions the speedtree issue.


        Tutorial for interactive plants:
        Last edited by Cmh175; 02-18-2019, 07:00 PM.


        • #5
          Hue variation depends on the instance position/rotation. If that doesn't change, the tree won't change color. And even then, you don't have to use it.

          The subscription version of SpeedTree for UE4 does not support exporting skeletal meshes, but the full Games version of SpeedTree does. I am unsure of the problems you'll face in this endeavor, honestly.

          The SpeedTree node does have an "ExtraBend" parameter, however. This is an additional direction you want the tree to bend, and it applies it to the tree in the same manner as global wind motion (so you don't have to worry about the size of the tree versus another one, etc). You can add your own local effects with this (explosions, for example) or bend it away from the player, etc. You could maybe pipe some information through that instead. It won't be as complex as skeletal motion, but it might be enough for those using the subscription version.