Announcement

Collapse
No announcement yet.

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

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

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


  • replied
    Hehe, that's a cool feature! I might use this at some point, thanks for sharing the material tree!

    Leave a comment:


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

    Leave a comment:


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

    Leave a comment:


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

    Leave a comment:


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

    Leave a comment:


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

    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,

    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?

    Leave a comment:


  • replied
    Thanks Shoiko!
    I've been asking that question for ~week now :P

    Leave a comment:


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

    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.
    awesome can;t wait to see that, could also be great to do permanent deformations like dents in cars?
    potentially tesselate the surface where hit, etc. very muc looking forward to seeing what I can do with that example

    Leave a comment:


  • replied
    Is the actual collision on foliage working?

    Leave a comment:


  • replied
    Originally posted by comet View Post
    My brain just always pictured it as "invisible sphere of influence attached to player touches grass = grass moves."
    And that could somehow be a "system" not relying on global parameters. Thus, my focus on collision.The sphere and grass just need to know they are touching each other and grass reacts according to its material programming.
    You could approach it from this direction, ie enable CPU-calculated collision on the foliage, and when a cluster of foliage instances get a collision notification, find which instance it is and move it etc. This all gets a bit messy because the individual instances of foliage are grouped together in a single component for rendering efficiency. You'd probably want to hide the instances being hit by the player and replace them with individual components that you then simulate etc. A GPU-only solution is more efficient and scalable, but doing things on the GPU sometimes requires you think backwards from the point of view of each independent piece of foliage as it's being rendered :-).

    Originally posted by comet View Post
    You used the term "material." Is it a material that bends the grass, and not shader? I was using shader for my questioning. I thought that's how I could get foliage to bend because coming from Unity, it is a shader that bends foliage. Like the wind shader.
    In Unreal-speak, the Material is higher-level the network you graph you build, where as Shaders are the lower level HLSL or GLSL code generated from the material graph. Note that one material might generate a number of shaders used for different purposes but that's mostly hidden from the user. We do use the terms independently to some degree. In this case using the World Position Offset input causes the material to generate code inside the vertex shader to move the foliage.

    Originally posted by comet View Post
    It would be wonderful to have the the foliage bend example material mentioned in the document.
    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.

    Leave a comment:


  • replied
    Originally posted by JackP View Post
    The MaterialParameterCollection is just a way of setting a global parameter such as the player location to all materials that want to make use of it. The foliage material would have a WorldPositionOffset input that checks if the foliage mesh is inside some sphere of influence centered on the player, and if so bends the foliage out of the way. It's a global parameter problem because an individual piece of foliage being rendered by the GPU doesn't know anything about the player. Note that this method of bending foliage doesn't really have anything to do with "collision", it's just some math calculated for every vertex of every piece of foliage, based on the player position parameter being sent to the shader.

    I'm not sure where the example material mentioned in that document is, or if it's available to UE4 subscribers yet, but I'll find out and post back here.

    - Jack
    Wow, you articulated that so concisely. And the part I bolded, that is exactly how my mental image of the problem is. Except you summed it up so much better and to the point. Thanks for explaining why it is a global parameter reasoning. I was half right at least. I just used too many words and didn't step back enough to examine the issue better.

    I see your point about it not really being about collision. Under the hood, the UE4 engine is not calculating two hard objects coming into contact. The result is a simulation of a collision, but behind the scenes, the engine doesn't see it as a collision.

    My brain just always pictured it as "invisible sphere of influence attached to player touches grass = grass moves."
    And that could somehow be a "system" not relying on global parameters. Thus, my focus on collision.The sphere and grass just need to know they are touching each other and grass reacts according to its material programming.

    A global approach does seem faster and easier to apply to a game world though. I am very interested in how the UE4 documentation version is done.

    You used the term "material." Is it a material that bends the grass, and not shader? I was using shader for my questioning. I thought that's how I could get foliage to bend because coming from Unity, it is a shader that bends foliage. Like the wind shader.

    Is the UE4 method using a material? Can UE4 bend grass simply by adding a material to the grass mesh? If so, that is incredibly simple and awesome. Especially for a visual learner, GUI reliant amateur like me - dragging a "bend" material onto the grass in Blueprint - UE4 would be my superhero.

    Thank you for looking into the UE4 documentation. It would be wonderful to have the the foliage bend example material mentioned in the document. Having a foliage bend material would be insanely popular and, speaking for myself, convert me from Unity.

    Thanks again for your very concise clarity. I am eager for your update.

    Leave a comment:


  • replied
    The MaterialParameterCollection is just a way of setting a global parameter such as the player location to all materials that want to make use of it. The foliage material would have a WorldPositionOffset input that checks if the foliage mesh is inside some sphere of influence centered on the player, and if so bends the foliage out of the way. It's a global parameter problem because an individual piece of foliage being rendered by the GPU doesn't know anything about the player. Note that this method of bending foliage doesn't really have anything to do with "collision", it's just some math calculated for every vertex of every piece of foliage, based on the player position parameter being sent to the shader.

    I'm not sure where the example material mentioned in that document is, or if it's available to UE4 subscribers yet, but I'll find out and post back here.

    - Jack

    Leave a comment:

Working...
X