Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[WIP] PBR Plants with Physics Interactions

Discussion in 'Works In Progress - Archive' started by pmurph03, Dec 28, 2016.

  1. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    54
    Been working on an update to my Ontario PBR Plant Pack to add the ability for physics interactions to move the plants around. Currently have about 1 mesh from each plant type with physics interactions enabled as a kind of proof of concept and demonstration. This can be seen in the following video:



    Let me know what you think. Currently I'm using skinned meshes with a small number of bones per plant. Then configurable joints are added with rigidbodies and capsule colliders. Depending on the plant the number of bones are different. The performance impact of it doesn't seem to be substantial either which is nice. I initially tried other joint types with the first mesh I skinned, but the configurable joint provided the first result that seemed pretty good looking. Are there other methods I should be looking into to provide similar functionality? How do you feel the current implementation looks?

    Thanks for any feedback (positive or negative) or comments, or suggestions, anyone can give in advance!
     
    diasrodrigo, Lex4art, _M_S_D_ and 2 others like this.
  2. AussieSwissDave

    AussieSwissDave

    Joined:
    Apr 20, 2013
    Posts:
    97
    Honestly it looks stunning, well done! Have you tested it with a human walking across? Will the plants be squashed underfoot and perhaps then rebound? It would be lovely if you could have them stick to the ground after being trodden on, particularly for a muddy jungle environment.

    My only concern would be performance but you seem to be on top of testing that. I suppose for a large FPS you could use your sexy planets in the say 10 metres surrounding the player and then something more basic farther away.
     
    pmurph03 likes this.
  3. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    54
    Thanks! Those are some great ideas. I believe that it should be possible to stick to the ground in certain environments using some collision scripts.

    With the configurable joints it's even possible for a lot of them to be allowed to detach from the ground completely if hit with enough force (or torque). This is easier to allow on some meshes than others (ferns / grases are easy, but bushes not so much) So I'm trying to see what can be done about that.

    The package on the asset store currently contains the static meshes. So with these new additional skinned meshes people can use them to switch the plants closer to the camera / player with the interactable ones, and then back to the static ones when out of range for performance increases. I've done a lot of copy / pasting of all the plants and rolling through them and having experienced any performance issues yet which has been great.

    I just made a new video with a bunch of the other meshes in the pack now skinned and jointed up:


    My next video I'll try to remember to import Unity's Ethan and third person controller and see how that interacts with the plants as well. Great idea! Thanks for the suggestions Dave!
     
    Adam-Bailey and _M_S_D_ like this.
  4. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    54
    Did a quick gif showing Unity's Ethan running through a bunch of grass as an example
    Here's a quick gif/video showing this:

    https://giant.gfycat.com/MagnificentKaleidoscopicBonobo.gif

    Also working on documentation for performance stuff, this scene has several thousand (~2300) skinned mesh renders which are replaced by the static mesh using a pseudo LOD system that I scripted in a couple minutes.
     
  5. pmurph03

    pmurph03

    Joined:
    Mar 17, 2014
    Posts:
    54
    This update has now been added to the asset store package! I'm pretty happy with how it turned out, the example video also uses Unity's Ethan walking through a group of interactable meshes, thank you for that input AussieSwissDave.

    Let me know what you think!
     
  6. AxlJones

    AxlJones

    Joined:
    May 1, 2015
    Posts:
    3
    Hello,

    I am very interested in buying your asset; could you tell me the average amount of verts per plant? i plan to create a dense ground cover for the huge jungle of my game and my trees already take so much proc. power.
     
  7. alexanderameye

    alexanderameye

    Joined:
    Nov 27, 2013
    Posts:
    1,383
    Looks great! Is there a setting to choose how much they react? Because in the last video the plants looked a bit over excited in their movement I think.
     
    theANMATOR2b likes this.
  8. dan_wipf

    dan_wipf

    Joined:
    Jan 30, 2017
    Posts:
    314
    does this works with vegetation studio or terrain(the physics part) and would this react with some sort of rain? (like particle rain?)