Search Unity

Is there an option to loop/repeat particles off-screen?

Discussion in 'General Graphics' started by noanoa, Jan 31, 2020.

  1. noanoa

    noanoa

    Joined:
    Apr 17, 2014
    Posts:
    225
    When you have slow moving particles(like snow particle) on your camera gameobject's child and make its simulation space "world", and when you move your camera fast, slow particles will go off-screen and take a while to spawn on the screen again unless the particle system has really wide shape.

    When I was using my own 2D particle system, I used to "loop/repeat" particles that go off-screen so every particle stays on the screen no matter how fast you move camera. For example, when a particle go off-screen to the left, it appears from right side of the screen(only works on 2D though). Can you do it with Unity particle system?
     
    Last edited: Jan 31, 2020
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    There are 3 solutions that I know of:

    * Use the Visual Effect Graph package (new, works mainly with HDRP, a bit with URP, not with Built-in, requires writing the maths yourself with the graph nodes, very efficient as runs on the GPU, requires compute capable platform, package is "experimental" until 2019.3, meaning not claiming to be production ready.)

    * Use the built-in Particle System and a script that calls SetParticles/GetParticles (guaranteed to work in all Unity versions, requires writing the maths yourself, not very efficient due to being per-particle script code, running on the main thread)

    * Use the built-in Particle System and a Burst compiled C# job (requires Unity 2019.3, requires writing the maths yourself, very efficient due to running multi-threaded using Burst)
     
  3. noanoa

    noanoa

    Joined:
    Apr 17, 2014
    Posts:
    225
    Thanks for the reply! Sounds like the Visual Effect Graph is the way to go.