Search Unity

Question batching vfx graph

Discussion in 'Visual Effect Graph' started by laurentlavigne, May 11, 2021.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

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

    You can send particle attributes like position or color using EventAttributes; this forum post has some examples.

    As for the count, it is already set in the spawner's block (Single Burst) count. If I remember correctly, I don't think you can read attributes sent via script at the spawner stage, so if you want to modify the spawn number dynamically, spawn the max amount you could want and pass some attribute to store how many you actually want and then kill the rest off in the Initialize stage using Set Alive. Or you can also send multiple events (some work was done for 2021.2 where you can send multiple events in the same frame, something which was a limitation before).
     
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,364
    Thanks Vlad.
    I'm using 2020.1.17, what limitations will I face?
    oh I know :D only one event can be sent at the same time, so I'll stagger them I guess :)
     
    Last edited: May 12, 2021
  4. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Yup, the 1-event per frame should be the only limitation in 2020 :)