Search Unity

Vertices selection from skinned mesh into the Visual Effect Graph

Discussion in 'Visual Effect Graph' started by JDeligne, Aug 2, 2021.

  1. JDeligne

    JDeligne

    Joined:
    May 6, 2021
    Posts:
    2
    Hi,

    I try to get the particles spawn position from specific vertices (not all vertices) from a SampleSkinnedMesh node.

    I'm able to select an index range using a random node but the ones I want are very specific and their indices are not following each other.

    Is there anyway to target multiple range (like importing a List or an array) into the VSGraph ?

    Ultimate solution will be for me to extract the geometry from the mesh as a separate part and to apply the exact same skinning to it and then I will just need to apply to the totality of the skinned mesh.

    Thank you very much
     
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hi @JDeligne ,

    If you have specific areas of the character you want to spawn from, you can create mask texture and use a Sample Texture2D operator with the UVs from your mesh to pick the color at that location and use it to discard particles in Initialize. Here's a quick mockup:


    You could also use Graphics Buffers in latest 2021.2 to send large amounts of data, but you'll have to pre-process all the vertices you need beforehand. The texture approach described above is probably the most straight-forward way to accomplish what you are describing.
     

    Attached Files:

  3. JDeligne

    JDeligne

    Joined:
    May 6, 2021
    Posts:
    2
    Amazing it works perfectly and this is exactly what I needed.
    Thank you very much VladVNeykov !
     
    VladVNeykov likes this.