Search Unity

[VFX Graph] Accessing particles data in Scripts

Discussion in 'Graphics Experimental Previews' started by Ben-Kuper, Mar 27, 2019.

  1. Ben-Kuper

    Ben-Kuper

    Joined:
    Aug 31, 2012
    Posts:
    16
    Hey there,
    I'm trying to use the VFX graph to filter out and modify input particles, so I can access a reduced amount of the initial particles in scripts.

    I have a KinectV2 generating a point cloud, quite dense.
    My idea is to use the VFX graph and keijiro's base to use this point cloud in the VFX graph, do some of the heavy processing of downsampling, AABoxKill, etc. and send back to a script the filtered particles, which would allow me to do more efficient CPU processing because it would only handle the reduced, filtered positions.

    So my main question here is : is it possible to retrieve the particle data in scripts after the update context ?
    Or does it make more sense to actually use computer shaders for that ?

    Thank you
     
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    110
    Hello,

    There is no way to readback particle data to CPU at the moment. This is something that is planned in the future.
    Also accessing particle buffers from GPU in a external compute shader is not yet there but may come soon.
     
  3. Ben-Kuper

    Ben-Kuper

    Joined:
    Aug 31, 2012
    Posts:
    16
    Ok thanks,
    so basically I should just use compute shaders to do all the heavylifting and then go back to CPU (maybe some ECS then do to clustering ?)
     
  4. headlessstudio

    headlessstudio

    Joined:
    Feb 25, 2016
    Posts:
    64
    Any news on this?
     
  5. tcmeric

    tcmeric

    Joined:
    Dec 21, 2016
    Posts:
    182
    Hi, also looking for this. Looking to get the particle position on die event.
     
unityunity