Announcement

Collapse
No announcement yet.

Foliage collision + foliage bend on collision- In engine feature?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by Smozius View Post
    Hey JackP,

    Thanks a lot for the information. I haven't found any examples posted to UE4 yet related to this thread. Do you know if this UE4 example of foliage collision is still being worked on?
    I would like to know this as well, so here's a bump.

    Comment


      #17
      I have set up a grass material and given it the players position using parameter collections and the level blueprint but I don't know how to use this to bend the grass away from the player, does anyone know how to do this or know where to find any tutorials/documentation about it?

      Thanks
      My website: www.jaspercousins.co.uk

      Comment


        #18
        Originally posted by Shoiko View Post
        Question:
        When i drag said tree or rock into the map manually my collisions work but with the painter they do not? Is this normal?

        Answer:

        Hello,

        It is expected that Foliage instance actors do not currently hold collision. We do plan on adding this in a future update, but it is not yet in the engine.

        Cheers!
        more ▼
        answered 1 day ago
        Alexander Paschall gravatar image
        Alexander Paschall ♦♦
        1.7k ● 65 ● 5 ● 6
        Shoiko gravatar image Shoiko 1 day ago
        So this should just be for bushes and grass for now trees and bolder should be manual understood.
        Thanks I hope it is relatively high priority. Would be amazing to have plant collision physics as part of a toolset within UE4. Would be precedent setting for a game engine. For example, using red to blue as hi to low bend reaction ("hot to cool"), a colored material image could be "painted" onto the plant mesh using UE4 or made separately in Photoshop, for example, as an image file of some format, and attached to the collection of textures for that specific plant mesh. The "hotter" red zones bend more than the "cooler" zones. Such as thick branches bending less than thin.

        I can't articulate it well. Hope that made sense. There is probably a much simpler, quicker way that you pros would achieve it though. I envision painting the thickness, which is the bend level, of plants being very easy though. Simply color a tree trunk red to not bend, but gradually cool down to blue as the mesh spreads out to thinner plant parts and ultimately leaves. And it could be told to react to wind using the color scale.

        Just wondering and hoping for in-depth foliage tools. Game worlds these days are very redundant in regards to open world natural scenery. They've reached a roadblock in physics, appearance, and density of plant life. Stale. I hope there's a new era of nature's glory in games soon

        Comment


          #19
          Would be awesome if it works like Cryengines bending weights which are based on vertex colors.
          That way we can just paint vertex colors to control vegetation bending
          http://celestialarch.com
          Free UE4 things available. More coming

          Comment


            #20
            Originally posted by The Cheese Dragon View Post
            I have set up a grass material and given it the players position using parameter collections and the level blueprint but I don't know how to use this to bend the grass away from the player, does anyone know how to do this or know where to find any tutorials/documentation about it?
            Just gave it a quick try and came up with this simple material. It's using the UVs green channel to prevent the grass base from being moved away. There are 2 parameters to adjust radius and strength of the bending effect.
            Click image for larger version

Name:	grassbendplayer_01vvsof.png
Views:	1
Size:	182.8 KB
ID:	1052426
            GIF: http://abload.de/img/grassbent01a7bs0q.gif
            3.14159265359

            Comment


              #21
              Hehe, that's a cool feature! I might use this at some point, thanks for sharing the material tree!
              Check out my GTA2 remake in UE4

              Comment


                #22
                Originally posted by JackP View Post
                I spoke to the artist who made the content in the doc screenshot. That content is from Fortnite, one of our internal games under development, but he's going to port that material to plain UE4 and build a small example which we will make available to you guys.
                Hey JackP,
                Has this been made available? The only thing I've seen like it is the pivot painter example, but that doesn't have the spring back effect I'm looking for.

                Comment


                  #23
                  I assume this would be plugged into the WorldDisplacement node?


                  Twitter - @TheCSilverman

                  Ancient Cistern | Advanced Material Pack Ed. 1 | Advanced Material Pack Ed. 2 | Advanced Material Pack Ed. 3 | Texture Pack Ed. 1 | Container Pack Ed. 1 | Road Sign Pack Ed. 1

                  Comment


                    #24
                    I was trying to create this sort of effect as well. Digging through the source code I found the interactive foliage actor, but no one seems to know how to use it :-p

                    Latest progress on that front (I haven't touched it in a while):

                    https://answers.unrealengine.com/que...-ue4-work.html
                    Victor Frenkel [IMDB LinkedIn]

                    Comment


                      #25
                      In theory, all you need to do is create your sphere of influence based on a Vector in the Material Parameter Collection, get the world position of each vertex on the Foliage via the "Absolute World Position" node, then 'move' the pixels in world-space (probably multiplied by a gradient in Vertex Colours to get stiffer movement at the base), in the opposite direction to the vector between the World Position and your Parameter Collection vectors.

                      This is the most efficient way to do it, because doing it with real collisions on the CPU would be far too expensive for any production game I imagine.

                      EDIT: Looks like everything I said has been mentioned already.. wups

                      Comment


                        #26
                        Originally posted by mAlkAv!An View Post
                        Just gave it a quick try and came up with this simple material. It's using the UVs green channel to prevent the grass base from being moved away. There are 2 parameters to adjust radius and strength of the bending effect.
                        [ATTACH=CONFIG]6384[/ATTACH]
                        GIF: http://abload.de/img/grassbent01a7bs0q.gif
                        Hi mAlkAv!An,

                        Regarding your screenshot in your previous post,
                        was your grass created using the foliage tool?

                        Comment


                          #27
                          Yes, the grass has been placed/painted with the foliage tool.
                          3.14159265359

                          Comment


                            #28
                            Thanks mAlkAv!An,
                            I got it working by following your material-graph.

                            Interestingly, I have implemented this kind of 'foliage bending at xyz' effect in a vertex shader (for another engine) in the past. However, the material-graph representation looks somewhat different and would have taken me much longer to figure out. I am still not fully acclimated to mapping my HLSL knowdedge to a material-graph (it does not always map as expected).

                            At least I now have a material-graph equivalent of a VertexShader for future comparison.


                            Theoretical question:

                            What if you wanted more than one sphere bending the grass in different places?
                            (e.g. 3 random balls rolling around, each bending the grass beneath them.)

                            Any thoughts on how that could be achieved?

                            Multiple material-graphs (one per ball) is probably redundant overkill.
                            I am not yet familiar with arrays or loops (not to mention potential performance issues) so can't say if that would work or if it is even possible.

                            Can you think of an efficient way for the same material-graph to bend grass at multiple/different xyz locations?
                            Last edited by ash22; 08-17-2014, 10:43 AM.

                            Comment


                              #29
                              Have you guys tried the Pivot Painter map in the Content Examples?
                              I seem to remember a couple of examples that cover this.
                              Fairytale Suite - Free orchestral music for fantasy settings
                              Marathon VR Environments - Simple re-creations of environments from Marathon 1/2

                              Comment


                                #30
                                Originally posted by ash22 View Post
                                Theoretical question:

                                What if you wanted more than one sphere bending the grass in different places?
                                (e.g. 3 random balls rolling around, each bending the grass beneath them.)

                                Any thoughts on how that could be achieved?

                                Multiple material-graphs (one per ball) is probably redundant overkill.
                                I am not yet familiar with arrays or loops (not to mention potential performance issues) so can't say if that would work or if it is even possible.

                                Can you think of an efficient way for the same material-graph to bend grass at multiple/different xyz locations?
                                arrays and loops aren't really supported in a material (though you can create them inside a Custom HLSL node, yet inputting stuff into that array wouldn't really be flexible). with a loop you'd avoid the redudancy in your graph but the cost would be the same as repeating it.

                                I'd say this is a task for the engine guys, probably through the use of the InteractiveFoliageActor or something similar.
                                I hope they get around to implement this into UE4, as it gives a nice feel of 'being in place' and interactivity to the decorative foliage. Assassin's Creed 4 was excellent in this regard.
                                and I hope they get to implement this feature to make it work with the Foliage tool. Otherwise it'll feel like an unfinished feature as it always was in UDK - you couldn't paint SpeedTrees with the Foliage tool (you can now in UE4), and you couldn't paint InteractiveFoliageActors with the Foliage tool either
                                Last edited by Chosker; 08-18-2014, 05:41 AM.
                                Follow me on Twitter!
                                Developer of Elium - Prison Escape

                                Comment

                                Working...
                                X