Announcement

Collapse
No announcement yet.

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

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

  • replied
    The way crytek did it wasn't very expensive. In fact it even works perfectly well on mobile.
    I am of the opinion this is something Epic might want to consider investigating. Anyway. Its their call but i feel its a feature that would make basically everyone happy.

    Im sorry to say but a simple material setup isn't sufficient. It looks terrible. And is not practical for big plants with details. Sure some grass blades n stuff looks fine. But i haven't seen a single example of it looking great with big plants.
    Anyway. I know pretty well how crytek approached it and thought i would try and mimic it with a blueprint. I cant code otherwise i could have been of more help.

    My results are pretty weak considering it was a very quick setup just to establish if its worth investigating more.

    Leave a comment:


  • replied
    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
    This is good, it would be great if you did a short tutorial for building and placing this it would allow more feedback due to increased exposure.

    Leave a comment:


  • replied
    Hey guys i have been trying to figure this out for a week now and i am still completely confused. I am trying to bend the foliage away from the player and i have everything in my material setup except i don't get what these material parameters and blueprints are doing or even how to make one for this setup.

    Would someone mind posting a screen of their material parameters and blueprints?

    Also is anyone using Pivot Painter? Is this a completely separate way to control foliage bending/collision or is it needed?
    Last edited by Dynako; 09-29-2014, 03:39 PM.

    Leave a comment:


  • replied
    Tried creating a Material Collection Parameter. The details are not present in the properties window, and right clicking and then clicking details for this newly created parameter does not show the details for this parameter either. The entire window is just blank, except for the save and find in CB buttons on the top left of that window.

    Frustrating.

    Leave a comment:


  • replied
    So I am at the bar ATM and everything Is too loong so I didn't read but heres how I do it. get the moving player/moving objs facing direction and bend twords using that vector. I then have a variable that is multiplied by Rand and use that value as a timer for when the grass/foliage springs back up. it give a steam rolling effect. but it works well for me. btw I use a blueprint not foliage. But a shader shouldn't be too different. Hope this gives you some useful info.
    Last edited by SaxonRah; 09-17-2014, 01:30 AM.

    Leave a comment:


  • replied
    How does that collection parameter node named sphere pos work? How do you create such a parameter? I couldn't find anything in the documentation. I assume this node specifies the sphere that surrounds the player for plant collision? Is this sphere created in Maya or 3Ds Max, or is it obtained from within UE4?

    EDIT: Ah, here it is. Missed it on the first read.

    https://docs.unrealengine.com/latest...ons/index.html

    I'll ask more questions if this doesn't clear things up.
    Last edited by Rexemcn; 09-17-2014, 02:55 PM.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    Have you guys tried the Pivot Painter map in the Content Examples?
    I seem to remember a couple of examples that cover this.

    Leave a comment:


  • replied
    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.

    Leave a comment:


  • replied
    Yes, the grass has been placed/painted with the foliage tool.

    Leave a comment:


  • replied
    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?

    Leave a comment:


  • replied
    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

    Leave a comment:


  • replied
    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

    Leave a comment:


  • replied
    I assume this would be plugged into the WorldDisplacement node?

    Leave a comment:


  • replied
    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.

    Leave a comment:

Working...
X