Search Unity

Question VFX Graph spawn by Point Cache for a character affected by animation

Discussion in 'Visual Effect Graph' started by masta-yoda, Nov 10, 2020.

  1. masta-yoda

    masta-yoda

    Joined:
    Apr 19, 2020
    Posts:
    91
    I'm working on a VFX graph where particles are spawned using a point cache asset, which I created from my character mesh (pic. 1). During the gameplay, certain animations are applied to the character (e.g. idle animation) and my VFX graph spawn positions are no longer in sync with the character posture.

    How can I create a Point Cache asset for a given character animation state? It's totally fine to have it pre-created based on certain animation stages. I'm also using Mixamo to animate my character so don't really have these animation meshes to create the asset from.

    Please advise.

    shot_201110_121852.png shot_201110_121834.png
     
  2. Lecks

    Lecks

    Joined:
    May 13, 2013
    Posts:
    18
    masta-yoda likes this.
  3. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi @masta-yoda ,

    We have internally implemented skinned mesh sampling and aim at releasing it during the Unity 2021.1 cycle (early next year). This will allow you to spawn VFX particles directly from a skinned mesh in Unity, without the need to use point caches or any external tools.
     
    valarnur, masta-yoda and florianhanke like this.
  4. masta-yoda

    masta-yoda

    Joined:
    Apr 19, 2020
    Posts:
    91
    Omg, this is amazing news! We will be able to accomplish such great effects with this. Looking forward to it.
     
  5. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    This is a very good news.
    How is the performance ?
    Will it be affected by mesh density of triangles ?
     
  6. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    It's performant to be running real-time. We are adding a way to sample into already transformed data on the GPU, so it will not slow down the GPU skinning.

    Yes and no. The skinning itself on the skinned mesh side will be slower the more vertices you have to transform, but from a VFX perspective, we are just sampling the already transformed data. The only effect on the VFX side would be that for a larger amount of data, we would need to sample into a bigger buffer, which could potentially have more cache misses.
     
    florianhanke likes this.
  7. koirat

    koirat

    Joined:
    Jul 7, 2012
    Posts:
    2,073
    Sometimes I'm not using skinned mesh but multiple "normal" meshes connected to transforms that I later animate.
    Would it be possible to use such an array of meshes and use it in a single VFX graph ?
     
  8. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    You can use the regular Mesh Sampling operator, but there's no mesh array support to sample them all at once, and you will have to supply their transforms manually to update any position/rotation/scale changes you might have in your animated hierarchy. Or otherwise I suppose you can try using Mesh.CombineMeshes to turn them at runtime into one mesh you are sampling once and updating as your animation changes.
     
    koirat likes this.