Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question VFX Particle Wrap / Avoid

Discussion in 'Visual Effect Graph' started by JoelLB, Oct 5, 2021.

  1. JoelLB

    JoelLB

    Joined:
    Oct 9, 2019
    Posts:
    25
    Hi All,
    I have a 2D array of bytes which are values of sensors. I'm wanting to use unity's VFX graph to make a particle system where the particles flow in one direction, and as the sensor values change, the particle avoids / wraps around the the values and goes back onto its path upwards. The sensor values can be converted to a mesh or a texture depending on what is more helpful.
    I've attached a photo to hopefully better explain what I am try to achieve. So it the particle has its original path, and if an object is in its way then the particles go around.

    What is the best way to achieve this / any pointers people can suggest?
    This is my first time using VFX graph so its all new to me.

    I started looking into the forces, but couldn't find anything like a repel force.
    Is this best to be done using the unity particle system, rather than VFX?

    Thanks for your time and help :)

    Edit #1 - Additional Detail:
    This only needs to be rendered on a 2D view. It will eventually get rendered out as a texture and shown on some LED panels. So we only ever need the front / top view. The 2D sensor array will update every frame so if using a texture that would be updated often,.
     
    Last edited: Oct 5, 2021
  2. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    809
    I guess calculation for each point can be expansive, so what if you rendered these points as texture and each point on this texture would store information of repel direction, like some kind of normal map. You would sample this texture with particle position and add some force with given direction.

    I recommend you to add more details (for example is it top view only? are there other forces or constraints?) and I think Vlad or someone else will help you to find good solution.
     
    JoelLB likes this.
  3. JoelLB

    JoelLB

    Joined:
    Oct 9, 2019
    Posts:
    25
    Added an edit at the bottom of the post !