Search Unity

Creating Position and Velocity maps for VFX graph from skinned mesh

Discussion in 'General Graphics' started by eco_bach, Aug 22, 2019.

  1. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,393
    Trying to deconstruct Keijiro's SMRVFX demo https://github.com/keijiro/Smrvfx

    Stumped on how you would create Position and Velocity maps from a skinned mesh.

    These are used by the VFX Graph. I'd like to use my own custom rigged avatar.

    PositionVelocityMaps_1.JPG PositionVelocityMaps_2.JPG Anyone?
     
  2. SBliznitsov

    SBliznitsov

    Joined:
    Mar 13, 2019
    Posts:
    1
    I had the same question. Did you find a solution?
     
  3. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    625
    Well if Keijiro has done that, then you can find the answer in the script/Graph? :)

    Position he just probably bakes to a texture. It's done outside VEG in a compute shader (most likely). For lower vertex counts you could also do that quite ok in C# and a custom Binder.

    I have no idea how he's done velocity map as I haven't checked that project. But I'd imagine as there's velocity map in that editor view, he might bake them in the compute shader/script that bakes the maps. You could do this by just maybe calculating difference between two frames vertex positions.
     
unityunity