Announcement

Collapse
No announcement yet.

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

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

  • replied
    Unfortunately i can't really help you any further with this, since i haven't done much with parameter collections yet. You can dig through the Material Examples and maybe you will find something, otherwise you may have to wait for an example about it from Epic.

    Leave a comment:


  • replied
    Originally posted by Chris.R View Post
    You should have a look at Parameter Collections.



    https://docs.unrealengine.com/latest...ons/index.html
    Thanks for that link. I wouldn't have found that documentation with all the search terms I was trying. Truly appreciate it. I feel good knowing I've taken a step in the right direction.

    Sadly, that page doesn't explain how MaterialParameterCollection uses the collected parameters to make the grass move away from the player.

    I understand that the global position of the player is being fed to a shader on the foliage, and then the foliage reacts accordingly. At the same time, I do not understand it. Specifically, I don't understand how or why the problem is solved using global data. Why (and how) is this a global parameters problem?

    My confusion arises from my mental image of the problem: I see it as an issue between the character model and the foliage. And I see the solution as being between the model and the foliage. For example, simply have a wind-like shader on the foliage that reacts to contact with the player/any rigid mesh model collision. The wind effect area would only be a very small area surrounding the player model.

    I can't grasp the concept of a global parameter taking care of what seems to be a very "local" problem. I don't understand how I would set up the MaterialParameterCollection to make a certain shader on the all the game world's foliage bend away from the player. Is it the wind shader briefly blowing the grass away from the player?

    Is it: The MaterialParameterCollection tells the grass a single, small gust of wind is occuring, because the player's global location is XYZ? What parameterized shader is this "global parameters god" telling a blade of grass to use at that moment the player is touching it? How is this "god" aware that only those few blades of grass in location XYZ should move at the moment?

    I picture the player model telling the grass " You move because I am at location XYZ". I don't know how the MaterialParameterCollection god solves it by looking at the entire game world, then applying a bend shader to certain foliage at that very specific moment of player/foliage contact at location XYZ. And what shader is it?

    A "global view/solution" seems more complex to me, but obviously it works and apparently simply because that documentation mentions it.

    (Sorry I'm rambling. This probably started to make less and less sense as I kept writing. I am not articulate, that's for sure)
    Last edited by comet; 04-02-2014, 01:21 PM.

    Leave a comment:


  • replied
    You should have a look at Parameter Collections.

    • The player's position is being tracked and fed into the foliage. That position information is used to move the flowers and grass away from the player as they walk nearby.
    https://docs.unrealengine.com/latest...ons/index.html

    Leave a comment:


  • replied
    Originally posted by TheJamsh View Post
    Nothing like this exists right now. If you have the source code to the Unity plug-in that allows it, you could probably port it, or find someone who could?

    Surely such a thing is hideously expensive though? Unless it's using some shader magic and not actually calculating 'real' collisions.

    Wind does indeed exist, but once again it's done in the shader I'm almost certain this would be possible but it wouldn't be 'accurate' so to speak, do you have any videos of the Unity plugin working?
    Of course I don't mean it's as accurate as a server farm at Pixar calculating each a million blades of grass But it is certainly a very good enough touch bending effect. The grass simply bends as an object collides, like a wind shader is hitting it. Surely touch bending can be applied to grass easily.

    It is a simple affect that weak hardware like last gen consoles can do. As if a mini pocket of wind is punching the foliage. That is how the effect looks. It is not like a Cinema 4D rendering. Still cheap shader trickery. The grass bends like wind shader is hitting it, but it still works. Only the hit portion of the plant is affected too. It really works well in dense fields. The problem is it's limited by Unity's horsepower. UE4 imagery with this simple shader would be glorious.

    But I'm sad if it doesn't exist in UE4. Of course I know I shouldn't beg for it, being an amateur relying on GUI-based game making. Seeing a field of grass waving in the wind is beautiful in UE4, but then seeing my character run through it, the grass passing through his body and not bending at all, it affects the experience. It is something from gaming generations past.

    Here is the foliage bending shader forum discussion. I want something like this for UE4 because UE4 simply would do it better with more horsepower and eye candy.
    There might be videos somewhere.
    There is an online demo if you have free Unity.

    http://forum.unity3d.com/threads/133...hader-released

    Leave a comment:


  • replied
    Nothing like this exists right now. If you have the source code to the Unity plug-in that allows it, you could probably port it, or find someone who could?

    Surely such a thing is hideously expensive though? Unless it's using some shader magic and not actually calculating 'real' collisions.

    Wind does indeed exist, but once again it's done in the shader I'm almost certain this would be possible but it wouldn't be 'accurate' so to speak, do you have any videos of the Unity plugin working?

    Leave a comment:


  • replied
    I too, would very much like to hear something about his.

    Leave a comment:

Working...
X