Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Particle Systems C# job system support

Discussion in '2019.3 Beta' started by Peter77, Jul 18, 2019.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    I saw 2019.3 includes a new feature called Particle Systems C# job system support:
    Do you have any examples what things people want to create or perhaps created with it already, which wasn't possible before?
     
  2. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    It was available previously in 19.1 as experimental, but now its not, and its support some extras:
    https://docs.google.com/document/d/1ZpTYqCN_d7h2oUbdQkzdpa-MSC6voX__huiR95zPTNg/edit

     
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
    Thanks for your answer. I think I expressed myself poorly.

    I was trying to find an answer to what "type of content" people want to create with the Particle Systems C# job system, which wasn't possible before it existed.
     
  4. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Some content that requires fine-tuned control via code or procedural generated content, and the one that is utilizing particles array.
    So instead of doing constant back and forth array of particles swaps, you can now modify particles without copying arrays constantly. Which is a performance win for me. Also, less main thread ops.

    TL;DR: For everything that were previously done via .GetParticles() / .SetParticles().
     
    Peter77 likes this.
  5. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Hey! Check out https://forum.unity.com/threads/particle-system-c-job-system-support.529284/

    In theory it doesn’t let you do anything new that you couldn’t already do with get/set particles - it just let’s you do stuff a LOT more efficiently. So it makes complex custom behaviours more achievable on whatever your target platform is.

    I added a couple of examples on the linked thread: connecting nearby particles with lines, and inter-particle collisions.
     
    Peter77 likes this.
  6. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    973
    One example I’ve got, is something we use that we call “particle magnets”. They are components we use to mainly create collectible creation effects etc, where you collect an object, a particle replaces it, flies out, then gets pulled towards the counter for that collectible type after some amount of lifetime. That was slow with lots of particles, since it involved copying all particles out of the system and then back in, every frame. It’s now possible to implement directly.
     
    Last edited: Aug 1, 2019
    richardkettlewell and Peter77 like this.
  7. DavidSWu

    DavidSWu

    Joined:
    Jun 20, 2016
    Posts:
    183
    It works great if you use custom simulation structures that are thread-safe (i.e. we have a voxel representation of the game and a water sim)
    It will be even nicer when many physics calls become thread-safe, and when the dependencies are well ironed out.
     
    richardkettlewell likes this.